[Letux-kernel] [PATCH 00/20] A bunch of JZ4730 fixups for letux-kernel

H. Nikolaus Schaller hns at goldelico.com
Sun Dec 6 09:08:00 CET 2020


Hi Paul,

> Am 05.12.2020 um 23:31 schrieb Paul Boddie <paul at boddie.org.uk>:
> 
> On Saturday, 5 December 2020 23:09:30 CET H. Nikolaus Schaller wrote:
>> 
>> So we are simply missing the dmas and dma-names definitions which are
>> mandatory...
>> 
>> I have simply copied it and renamed "dmac" -> "dma". The result is
>> that the "Failed to get dma_tx channel" is still there but comes
>> later:
>> 
>> [    0.199807] OF: /mmc at 10021000: could not find phandle
>> [    0.187996] jz4740-mmc 10021000.mmc: Failed to get dma_tx channel (-19)
>> [    0.189406] jz4740-mmc 10021000.mmc: Ingenic SD/MMC card driver
>> registered
>> [    0.196558] jz4740-mmc 10021000.mmc: Using PIO, 4-bit mode
>> 
>> Likely the value 27&26 must be different(jz4725b uses 25&24).
> 
> According to the jz4730.h file I have, 26 is the MMC output request type 
> (transmit FIFO empty) and 27 is the input request type (receive FIFO full), 
> just as it is in the JZ4740.
> 
> As far as I know, the JZ4725B also uses 26 and 27. I think 25 and 24 are 
> related to the audio controller (AIC).

AH, yes. I had just searched for &dmac and found the audio entry:

	aic: audio-controller at 10020000 {
		compatible = "ingenic,jz4725b-i2s", "ingenic,jz4740-i2s";
...
		dmas = <&dmac 25 0xffffffff>, <&dmac 24 0xffffffff>;
		dma-names = "rx", "tx";
	}; 
	mmc0: mmc at 10021000 {
		compatible = "ingenic,jz4725b-mmc";
...
		dmas = <&dmac 27 0xffffffff>, <&dmac 26 0xffffffff>;
		dma-names = "rx", "tx";

		cap-sd-highspeed;
		cap-mmc-highspeed;
		cap-sdio-irq; 
	};

Sidenote: what we have to think about is wich capabilities to add to
the jz4730 mmc node. In doubt I would add them all :)

> 
>> And I have no idea which phandle is not found...
> 
> Neither have I!

I have added another printk() to of_phandle_iterator_next() in drivers/of/base.c:

It is:

[    0.324240] OF: /mmc at 10021000: could not find phandle (#dma-cells)

Ok, we have

		#dma-cells = <1>;

jz4730.dtsi which should be <2> if we add the 0xffffffff parameter.

In the same fix I would rename &dma -> &dmac like it is for the other JZ SoC.

Next test result:

[    0.164600] jz4740-mmc 10021000.mmc: Got CD GPIO
[    0.169689] jz4740-mmc 10021000.mmc: Got WP GPIO
[    0.174686] jz4740-mmc 10021000.mmc: Looking up vmmc-supply from device tree
[    0.165454] jz4740-mmc 10021000.mmc: Looking up vqmmc-supply from device tree
[    0.168055] jz4780_of_dma_xlate
[    0.171433] jz4780_of_dma_xlate 1
[    0.174934] jz4780_of_dma_xlate 4
[    0.178623] jz4780_of_dma_xlate
[    0.181973] jz4780_of_dma_xlate 1
[    0.168112] jz4780_of_dma_xlate 4
[    0.182327] ledtrig-cpu: registered to indicate activity on CPUs
[    0.179107] usbcore: registered new interface driver usbhid
[    0.184934] usbhid: USB HID core driver
[    0.182902] Initializing XFRM netlink socket
[    0.187550] NET: Registered protocol family 17
[    0.175165] NET: Registered protocol family 15
[    0.180118] 9pnet: Installing 9P2000 support
[    0.184712] Key type dns_resolver registered
[    0.189204] oprofile: using timer interrupt.
[    0.177627] Loading compiled-in X.509 certificates
[    0.178473] jz4740-mmc 10021000.mmc: Ingenic SD/MMC card driver registered
[    0.185624] jz4740-mmc 10021000.mmc: Using DMA, 4-bit mode

Still no /dev/mmc or something. But that may now be the CD/WP GPIO setup...

Now I think I should first consolidate my changes and push them to git before
digging into that.

BR and thanks,
Nikolaus




More information about the Letux-kernel mailing list