]> git.baikalelectronics.ru Git - kernel.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)
commit2b62cace8164ee26501340082f877b417a055e38
tree134bf591657b7bb682b23705d5751ba4a618f64e
parent952ae01259294246de7b3a9f6cbe0797a2bb56b4
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