[Letux-kernel] X1600 / LX16 support - here: adding MMC

H. Nikolaus Schaller hns at goldelico.com
Wed Feb 7 17:05:25 CET 2024


Paul,

> Am 07.02.2024 um 16:54 schrieb Paul Boddie <paul at boddie.org.uk>:
> 
> On Tuesday, 6 February 2024 22:18:52 CET H. Nikolaus Schaller wrote:
>>> Am 06.02.2024 um 21:21 schrieb Paul Boddie <paul at boddie.org.uk>:
>>> 
>>> On Tuesday, 6 February 2024 19:47:27 CET H. Nikolaus Schaller wrote:
>>>> 
>>>> So we likely can take the compatible string ingenic,jz4780-mmc", move
>>>> some stuff from lx16.dts to x1600.dtsi and set up the clock (and
>>>> potentially the DMA nodes) and it might start to do something...
>>> 
>>> I might even give that a try.
>> 
>> Would be fine!
> 
> OK, I gave it a try. First of all, I changed the compatible property, as 
> suggested. Then, I had to change the DMA usage in the X1600 device tree to use 
> the mainline JZ4780 driver, also introducing a suitable header file for the 
> X1600 request types and removing usage of the vendor header for DMA.
> 
> I also found that the LX16 device tree was using pinctrl configurations for 
> "disable" and "enable" that were not recognised, but these appear superfluous 
> and it seems that they can be removed.

I think they are used by the vendor kernel to enable the 32 kHz clock for an optional
WiFi module. Adding this to pinctrl is IMHO the wrong approach. Maybe we can look
how our omap based devices are doing this. There is also some sdio sequencer
driver (I forgot the name) which can enable power and handle resets for a WiFi
subdevice.

> And I found that this line had been 
> added to the MMC driver immediately after the indicated structure member had 
> been set:
> 
> host->use_dma = false;
> 
> I suppose this was done to avoid DMA since it wasn't working yet.


This may also come from the jz4730 where DMA isn't working at all.
The jz4780 is then still fast enough to handle the non-DMA mode...

> In any case, 
> this is what I have achieved so far:
> 
> [    0.000188] jz4740-mmc 13450000.mmc: Ingenic SD/MMC card driver registered
> [    0.000188] jz4740-mmc 13450000.mmc: Using DMA, 4-bit mode
> [    0.000188] input: gpio_keys as /devices/platform/gpio_keys/input/input0
> [    0.000188] clk: Not disabling unused clocks
> [    0.000188] jz4740-mmc 13460000.mmc: Ingenic SD/MMC card driver registered
> [    0.000188] jz4740-mmc 13460000.mmc: Using DMA, 4-bit mode

Ok, looks good.

Here should then come a message which SD card was recognized (if at all).
And AFAIR the kernel should wait a little for that to happen.

> [    0.000188] /dev/root: Can't open blockdev
> [    0.000188] VFS: Cannot open root device "/dev/mmcblk0p2" or unknown-
> block(0,0): error -6
> [    0.000188] Please append a correct "root=" boot option; here are the 
> available partitions:

IMHO, this are all secondary messages after the SD card isn't found.

> Unfortunately, all of the partitions are ram0..15. In principle, the desired 
> root device seems correct, so I don't think this is caused by the absent 
> cmdline parsing.

Well, the cmdline parsing (argv) works. Just the env pointers are broken.
I just sent a mail about my latest findings in U-Boot.

> Anyway, I have pushed the changes to the paulb-letux-6.7-rc8-mmc branch in 
> case someone else can see what I have missed.

Thanks! I may find some time to look into it after fixing our U-Boot...
The I can also look with an oscilloscope at the SD CLK and CMD lines.

Best regards,
Nikolaus



More information about the Letux-kernel mailing list