[Letux-kernel] X1600 / LX16 support - here: adding MMC
H. Nikolaus Schaller
hns at goldelico.com
Fri Feb 9 17:19:05 CET 2024
> Am 09.02.2024 um 17:02 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
>
> Hi Andreas,
>
>> Am 09.02.2024 um 16:20 schrieb Andreas Kemnade <andreas at kemnade.info>:
>>
>> Hi Nikolaus,
>>
>> On Fri, 9 Feb 2024 15:14:11 +0100
>> "H. Nikolaus Schaller" <hns at goldelico.com> wrote:
>>
>>> Unfortunately we can't look into /sys/kernel/debug...
>>
>> well, you can either use an initrd (haven't a nice mips one lying
>> around here, but maybe just an alpine image suffices),
>
> Or one of the letux rootfs? http://download.goldelico.com/letux-debian-rootfs/wheezy-mipsel-minimal.tbz
>
> But I think it is far too big for an initrd (ca. 100 MB).
>
>> or configure
>
> Yes, that yould work but is probably the same complexity as fixing
> the real bug.
>
>> one of the slots as gpio and use mmc over spi over gpio.
>
> In both cases we disable the mmc initialization we want to analyse.
> To understand why the setup isn't correct.
>
> So I think the only way seems to printk inside the running mmc driver...
>
> It doesn't look very difficult. Just some io_remap and loops to hexdump
> multiple register values.
>
> Then look into the PM to understand the bit values...
>
> The good thing will be that if we find a fix, we can easily compare before
> and after.
>
> BR,
> Nikolaus
Here is a first intermediate result. I have converted the pr_debug() in
mmc_rescan_try_freq() to pr_info() and the kernel tells:
[ 0.000201] mmc0: mmc_rescan_try_freq: trying to init card at 400000 Hz
[ 0.000201] mmc1: mmc_rescan_try_freq: trying to init card at 400000 Hz
How does this fit to the 3.5 MHz I have seen? Factor 8 would be 3.2 MHz
and be within precision of interpreting the CLK on the scope...
BTW: later I see:
[ 0.000201] mmc0: mmc_rescan_try_freq: trying to init card at 390625 Hz
[ 0.000201] mmc1: mmc_rescan_try_freq: trying to init card at 390625 Hz
[ 0.000201] mmc0: mmc_rescan_try_freq: trying to init card at 400000 Hz
So there may be some fluctuation in asking a clock for its current frequency.
BTW: it is printed from a parameter passed to mmc_rescan_try_freq() which
seems to come from some magic in mmc_rescan() and the array freqs[] trying
400k, 300k, 200k, 100k - if the host->f_min permits.
Probably host->f_min = 390625 which makes the mmc_rescan() alternatingly
try 400000 Hz and 390625 Hz. So this magic is ok.
Just because I am going through the code: clock is set through mmc_set_clock()
mmc_set_ios(). Another location with a pr_debug() to be made an pr_info().
BR,
Nikolaus
More information about the Letux-kernel
mailing list