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

H. Nikolaus Schaller hns at goldelico.com
Sat Dec 5 23:09:30 CET 2020


Hi Paul,

> Am 05.12.2020 um 22:35 schrieb Paul Boddie <paul at boddie.org.uk>:
> 
> On Saturday, 5 December 2020 22:19:01 CET Paul Boddie wrote:
>> 
>> So, what we might want to provide in the device tree is this:
>> 
>> reg = <0x10020000 0xc0>, <0x100200f8 0x08>;
> 
> [...]
> 
>> So, what probably needs to be done is some parameterisation to use the right
>> offsets for descriptor address registers and the principal global
>> registers. Meanwhile, some investigation into what might be used for the
>> doorbell registers might be needed. Where other peripherals manipulate the
>> DMA system, I don't think the doorbell mechanism is needed at all, though.
> 
> For the time being, here's a tentative patch for the driver. The device tree 
> will also need modifying as noted above.

You are really quick! Faster than Police :)

> Paul<0001-Introduced-JZ4730-register-layout-customisations.patch>

Have applied it but it makes no visible difference (yet?).

So I think the current blocking point is

[    0.185707] jz4740-mmc 10021000.mmc: Failed to get dma_tx channel (-19)

The -19 is the errno from touching drivers/mmc/host/jz4740_mmc.c
It is ENODEV.

So this means that the mmc controller does not find the DMA controller although
it is successfully probed and likely registered.

Ok, that was easy to find:

vs. jz4730.dtsi:

	mmc: mmc at 10021000 {
		compatible = "ingenic,jz4740-mmc";
		reg = <0x10021000 0x100>;

		interrupt-parent = <&intc>;
		interrupts = <14>;

		clocks = <&cgu JZ4730_CLK_MMC>;
		clock-names = "mmc";
	};


vs. jz4740.dtsi:

	mmc: mmc at 10021000 {
		compatible = "ingenic,jz4740-mmc";
		reg = <0x10021000 0x1000>;

		clocks = <&cgu JZ4740_CLK_MMC>;
		clock-names = "mmc";

		interrupt-parent = <&intc>;
		interrupts = <14>;

		dmas = <&dmac 27 0xffffffff>, <&dmac 26 0xffffffff>;
		dma-names = "rx", "tx";

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

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).

And I have no idea which phandle is not found...

BR and thanks for today,
Nikolaus



More information about the Letux-kernel mailing list