[Letux-kernel] [PATCH 00/20] A bunch of JZ4730 fixups for letux-kernel
H. Nikolaus Schaller
hns at goldelico.com
Tue Dec 15 18:06:28 CET 2020
Hi Paul,
> Am 15.12.2020 um 17:35 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
>
> The problem is either communication of the driver with the mmc controller or
> the controller with the card due to wrong setup.
>
> I think I should add printk to the jz4740-mmc driver...
>
> First inspection shows that there is some code path dependency on
>
> host->version
>
> but it is very likely that the jz4730 is similar to jz4740 and not jz4725 and
> later.
Ok, here are some first observations:
jz_mmc_irq
jz4740_mmc_set_irq_enabled
jz_mmc_irq_worker
jz4740_mmc_read_response
jz4740_mmc_request_done
jz4740_mmc_request
jz4740_mmc_send_command
jz4740_mmc_clock_disable
jz4740_mmc_clock_enable
are all called. Still
[ 2.166846] mmc0: card never left busy state
[ 2.171367] mmc0: error -145 whilst initialising SD card
So either the bits of the controller do not match.
This is a little more unlikely after this test because
we can see interrupts.
It is a little more likely pinmux or communication between
the controller and the card (or regulator?).
But doesn't it just use those from U-Boot if there is no
new setup in the kernel?
Unfortunately we can't boot to some shell or I could inspect
the pinmux registers through devmem2... If I remember correctly
I did this for the CI20 to compare the working vendor setup
with what our DWC and HDMI code was doing until they were
equivalent.
Hm.
A complex but doable approach: add code to jz4740_mmc_probe
to printk mmc controller registers and pinmux registers and
perhaps also gpio controller (for cd, wp, SD power).
And hack the same into the 2.6 kernel which we can boot.
What I would need help for is a list of register addresses to
ioremap and readw/readl and printk. This would work without
shell and devmem2.
BR,
Nikolaus
PS: can it be that there is no card-detect interrupt?
The variable jz4740_mmc_host->card_detect_irq in jz4740_mmc.c
is nowhere used. (BTW: there is a similarly stale definition in
include/linux/platform_data/mmc-omap.h)
More information about the Letux-kernel
mailing list