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

Andreas Kemnade andreas at kemnade.info
Sun Feb 11 00:31:55 CET 2024


On Sat, 10 Feb 2024 23:47:56 +0100
Andreas Kemnade <andreas at kemnade.info> wrote:

> On Sat, 10 Feb 2024 23:20:56 +0100
> Andreas Kemnade <andreas at kemnade.info> wrote:
> 
> > On Sat, 10 Feb 2024 21:23:21 +0100
> > "H. Nikolaus Schaller" <hns at goldelico.com> wrote:
> >   
> > > > Am 10.02.2024 um 17:58 schrieb Andreas Kemnade <andreas at kemnade.info>:
> > > > 
> > > > On Sat, 10 Feb 2024 14:53:47 +0100
> > > > "H. Nikolaus Schaller" <hns at goldelico.com> wrote:
> > > >       
> > > >> 
> > > >> If pinctrl is broken, this can explain other problems. Like no clock at msc1.
> > > >> Or why we have to disable the UART DTS nodes. In that case the U-Boot defaults likely survive.
> > > >> 
> > > >> Despite the pinctrl driver being part of the working 5.10.y it has got some (un)tested
> > > >> upstream work and adaptations for v6.8.
> > > >> 
> > > >> Some ideas:
> > > >> * check /sys/kernel/debug/gpio (if the gpio is configured as output)      
> > > > 
> > > > # cat /sys/kernel/debug/gpio 
> > > > gpiochip0: GPIOs 0-31, parent: platform/10010000.pinctrl, GPIOA:
> > > > 
> > > > gpiochip1: GPIOs 32-63, parent: platform/10010000.pinctrl, GPIOB:
> > > > 
> > > > gpiochip2: GPIOs 64-95, parent: platform/10010000.pinctrl, GPIOC:
> > > > gpio-64  (                    |led-0               ) in  lo 
> > > > gpio-92  (                    |bootsel1            ) in  lo IRQ 
> > > > gpio-95  (                    |WAKEUP              ) in  hi IRQ ACTIVE LOW
> > > > 
> > > > gpiochip3: GPIOs 96-127, parent: platform/10010000.pinctrl, GPIOD:
> > > > 
> > > > after unbinding led-gpio:
> > > > 
> > > > /sys/devices/platform/apb/10010000.pinctrl/gpiochip2/gpio/gpio64 # echo out >dir
> > > > ection 
> > > > /sys/devices/platform/apb/10010000.pinctrl/gpiochip2/gpio/gpio64 # cat direction
> > > > in      
> > > 
> > > Maybe an explanation is the attached hex dump of CGU, MSC0/1 and PC/PD pincrl
> > > (where the red LEDs and MMC0/1 are connected to). The dump starts right after
> > > entering jz4740_mmc_probe where I thing the pinctrl is already set up (and
> > > rewound if probe fails):
> > >     
> > busybox devmem 0x10010238 32 0x2
> > did the trick for the led, it clears the direction bit. Maybe there is some
> > issue with set/clear registers in the pinctrl driver.
> >   
> ok,
> devmem 0x10010238 32 0x3 then enables the second led.
> 
> and I can enable heartbeat.
> 
> So the pinctrl/gpio driver really needs some boiling.
> 
with the patch I sent applied, I get the -145 error also for mmc1.
But interestingly, as also tried with mmc0, I set bus-width to 1
and now have this spam:
[    0.000189] mmc1: host does not support reading read-only switch, assuming write-enable
[    0.000189] mmc1: new high speed SDHC card at address 59b4
[    0.000189] mmcblk1: mmc1:59b4 USDU1 14.9 GiB
[    0.000189]  mmcblk1: unable to read partition table
[    0.000189] mmc1: card 59b4 removed
[    0.000189] mmc1: host does not support reading read-only switch, assuming write-enable
[    0.000189] mmc1: new high speed SDHC card at address 59b4
[    0.000189] mmcblk1: mmc1:59b4 USDU1 14.9 GiB
[    0.000189]  mmcblk1: unable to read partition table
[    0.000189] mmc1: card 59b4 removed
[    0.000189] mmc1: host does not support reading read-only switch, assuming write-enable
[    0.000189] mmc1: new high speed SDHC card at address 59b4
[    0.000189] mmcblk1: mmc1:59b4 USDU1 14.9 GiB
[    0.000189]  mmcblk1: unable to read partition table
[    0.000189] mmc1: card 59b4 removed

For mmc0 I get this only once.

Regards,
Andreas


More information about the Letux-kernel mailing list