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

H. Nikolaus Schaller hns at goldelico.com
Sat Feb 10 21:23:21 CET 2024



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

[    0.000205] jz4740_mmc_probe
[    0.000205] CGU:
[    0.000205] 10000000: 9a094410
[    0.000205] 10000004: 00001f00
[    0.000205] 10000008: 00000001
[    0.000205] 1000000c: 00000020
[    0.000205] 10000010: 02e049cd
[    0.000205] 10000014: 0af0c9cd
[    0.000205] 10000018: 019059cd
[    0.000205] 1000001c: 00000000
[    0.000205] 10000020: 47ca3fc4
[    0.000205] 10000024: 00701500
[    0.000205] 10000028: 337effff
[    0.000205] 1000002c: a0000003
[    0.000205] 10000030: 00000000
[    0.000205] 10000034: effa3ac6
[    0.000205] 10000038: 0000a5a5
[    0.000205] 1000003c: 00000000
[    0.000205] 10000040: 02000096
[    0.000205] 10000044: 00ff0080
[    0.000205] 10000048: 80000000
[    0.000205] 1000004c: 00000000
[    0.000205] 10000050: 00000000
[    0.000205] 10000054: 6000001b
[    0.000205] 10000058: 00000000
[    0.000205] 1000005c: 6800000f
[    0.000205] 10000060: 40100002
[    0.000205] 10000064: 6800000f
[    0.000205] 10000068: 6000000d
[    0.000205] 1000006c: 6800000f
[    0.000205] 10000070: 00000001
[    0.000205] 10000074: 6800000f
[    0.000205] 10000078: 6800000f
[    0.000205] 1000007c: 40100002
[    0.000205] 10000080: 00000001
[    0.000205] 10000084: 00000000
[    0.000205] 10000088: 00000000
[    0.000205] 1000008c: 00000000
[    0.000205] 10000090: 00000000
[    0.000205] 10000094: 00000014
[    0.000205] 10000098: 0000003c
[    0.000205] 1000009c: 00000064
[    0.000205] 100000a0: 00000000
[    0.000205] 100000a4: 40000000
[    0.000205] 100000a8: 00000000
[    0.000205] 100000ac: 00000000
[    0.000205] 100000b0: 00000003
[    0.000205] 100000b4: 00000000
[    0.000205] 100000b8: 00000000
[    0.000205] 100000bc: 00000000
[    0.000205] 100000c0: 00000000
[    0.000205] 100000c4: 00000000
[    0.000205] 100000c8: 00000000
[    0.000205] 100000cc: f4838e2f
[    0.000205] 100000d0: 00000000
[    0.000205] 100000d4: f8000000
[    0.000205] 100000d8: 00000000
[    0.000205] 100000dc: 00000000
[    0.000205] 100000e0: 00000003
[    0.000205] 100000e4: 40000002
[    0.000205] MSC0:
[    0.000205] 13450000: 00000000
[    0.000205] 13450004: 1f000040
[    0.000205] 13450008: 00000000
[    0.000205] 1345000c: 00000409
[    0.000205] 13450010: 00000100
[    0.000205] 13450014: ffffffff
[    0.000205] 13450018: 00000200
[    0.000205] 1345001c: 00000001
[    0.000205] 13450020: 00000001
[    0.000205] 13450024: ffffffff
[    0.000205] 13450028: 00002000
[    0.000205] 1345002c: 00000011
[    0.000205] 13450030: 0000678c
[    0.000205] 13450034: 00005900
[    0.000205] 13450038: 00000000
[    0.000205] 1345003c: 00000000
[    0.000205] 13450040: 80000001
[    0.000205] 13450044: 00000000
[    0.000205] 13450048: 00000000
[    0.000205] 1345004c: 00000000
[    0.000205] 13450050: 00000000
[    0.000205] 13450054: 00000000
[    0.000205] 13450058: 00800000
[    0.000205] 1345005c: 00000000
[    0.000205] MSC1:
[    0.000205] 13460000: 00000000
[    0.000205] 13460004: 0f000040
[    0.000205] 13460008: 00000000
[    0.000205] 1346000c: 00005000
[    0.000205] 13460010: 00000100
[    0.000205] 13460014: 00ffffff
[    0.000205] 13460018: 00000000
[    0.000205] 1346001c: 00000000
[    0.000205] 13460020: 0000f42d
[    0.000205] 13460024: ffffffff
[    0.000205] 13460028: 10002000
[    0.000205] 1346002c: 00000000
[    0.000205] 13460030: 00000000
[    0.000205] 13460034: 0000376d
[    0.000205] 13460038: 4bd74220
[    0.000205] 1346003c: 00000000
[    0.000205] 13460040: 00000000
[    0.000205] 13460044: 00000000
[    0.000205] 13460048: 00000000
[    0.000205] 1346004c: 00000000
[    0.000205] 13460050: 00000000
[    0.000205] 13460054: 00000000
[    0.000205] 13460058: 00800000
[    0.000205] 1346005c: 00000000
[    0.000205] PC:
[    0.000205] 10010200: 807e0000
[    0.000205] 10010204: 00000000
[    0.000205] 10010208: 00000000
[    0.000205] 1001020c: 00000000
[    0.000205] 10010210: 00000000
[    0.000205] 10010214: 00000000
[    0.000205] 10010218: 00000000
[    0.000205] 1001021c: 00000000
[    0.000205] 10010220: 9f000007
[    0.000205] 10010224: 00000000
[    0.000205] 10010228: 00000000
[    0.000205] 1001022c: 00000000
[    0.000205] 10010230: 9f000007
[    0.000205] 10010234: 00000000
[    0.000205] 10010238: 00000000
[    0.000205] 1001023c: 00000000
[    0.000205] 10010240: 007e0000
[    0.000205] 10010244: 00000000
[    0.000205] 10010248: 00000000
[    0.000205] 1001024c: 00000000
[    0.000205] 10010250: 00000000
[    0.000205] 10010254: 00000000
[    0.000205] 10010258: 00000000
[    0.000205] 1001025c: 00000000
[    0.000205] 10010260: 00000000
[    0.000205] 10010264: 00000000
[    0.000205] 10010268: 00000000
[    0.000205] 1001026c: 00000000
[    0.000205] 10010270: 007e0000
[    0.000205] 10010274: 00000000
[    0.000205] 10010278: 00000000
[    0.000205] 1001027c: 00000000
[    0.000205] 10010280: 07000007
[    0.000205] 10010284: 00000000
[    0.000205] 10010288: 00000000
[    0.000205] PD:
[    0.000205] 10010300: 0000003e
[    0.000205] 10010304: 00000000
[    0.000205] 10010308: 00000000
[    0.000205] 1001030c: 00000000
[    0.000205] 10010310: 00000000
[    0.000205] 10010314: 00000000
[    0.000205] 10010318: 00000000
[    0.000205] 1001031c: 00000000
[    0.000205] 10010320: 0000003f
[    0.000205] 10010324: 00000000
[    0.000205] 10010328: 00000000
[    0.000205] 1001032c: 00000000
[    0.000205] 10010330: 0000003f
[    0.000205] 10010334: 00000000
[    0.000205] 10010338: 00000000
[    0.000205] 1001033c: 00000000
[    0.000205] 10010340: 00000000
[    0.000205] 10010344: 00000000
[    0.000205] 10010348: 00000000
[    0.000205] 1001034c: 00000000
[    0.000205] 10010350: 00000000
[    0.000205] 10010354: 00000000
[    0.000205] 10010358: 00000000
[    0.000205] 1001035c: 00000000
[    0.000205] 10010360: 00000000
[    0.000205] 10010364: 00000000
[    0.000205] 10010368: 00000000
[    0.000205] 1001036c: 00000000
[    0.000205] 10010370: 00000000
[    0.000205] 10010374: 00000000
[    0.000205] 10010378: 00000000
[    0.000205] 1001037c: 00000000
[    0.000205] 10010380: 00000000
[    0.000205] 10010384: 00000000
[    0.000205] 10010388: 00000000
[    0.000205] jz4740_mmc_reset

Code is pushed to
https://git.goldelico.com/?p=letux-kernel.git;a=shortlog;h=refs/heads/work-x1600-v2-printk

(Note: mmc1 is disabled in DTS)

BR,
Nikolaus



More information about the Letux-kernel mailing list