]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mmc: sunxi: Fix clk-delay settings
authorHans de Goede <hdegoede@redhat.com>
Wed, 23 Sep 2015 20:06:48 +0000 (22:06 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 29 Sep 2015 10:17:04 +0000 (12:17 +0200)
commit51424b2860670ec20e1dd5177fe70ab4b6fd7a5b
tree134bf591657b7bb682b23705d5751ba4a618f64e
parent43934ece2ea72c1dd279c0b0478c1a036d5d77ee
mmc: sunxi: Fix clk-delay settings

In recent allwinner kernel sources the mmc clk-delay settings have been
slightly tweaked, and for sun9i they are completely different then what
we are using.

This commit brings us in sync with what allwinner does, fixing problems
accessing sdcards on some A33 devices (and likely others).

For pre sun9i hardware this makes the following changes:
-At 400Khz change the sample delay from 7 to 0 (introduced in A31 sdk)
-At 50 Mhz change the sample delay from 5 to 4 (introduced in A23 sdk)

This also drops the clk-delay calculation for clocks > 50 MHz, we do
not need this as we've: mmc->f_max = 50000000, and the delays in the
old code were not correct (at 100 MHz the delay must be a multiple of 60,
at 200 MHz a multiple of 120).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sunxi-mmc.c