]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
sunxi: mmc: Properly setup mod-clk and clock sampling phases
authorHans de Goede <hdegoede@redhat.com>
Sun, 7 Dec 2014 19:55:10 +0000 (20:55 +0100)
committerHans de Goede <hdegoede@redhat.com>
Wed, 14 Jan 2015 13:56:36 +0000 (14:56 +0100)
commitfc3a832576ce7bb597b1823935bfb7dcca235c3c
tree7f4528593415b0a68be44d3e450f06ab929f1b6f
parent0454493aa3491f543e3351a9fe9b728fb82ef319
sunxi: mmc: Properly setup mod-clk and clock sampling phases

The sunxi mmc controller has both an internal clock divider, as well as
the divider in the mod0-clk for the mmc controller.

The internal divider cannot be used, as it conflicts with the setting of
clock sampling phases which is done in the mod0-clk, so it must be set to
0 (divide by 1).

For some reason while the kernel has had this correct from day one, the
u-boot sunxi mmc code has been using a fixed mod0-clk and setting its
internal divider depending on the desired speed. This is something which
we've inherited from the original Allwinner u-boot sources, but while this
has been fixed in Allwinner's own u-boot code at least for the A23 and later
upstream u-boot was still doing this wrong.

This commit fixes this, thereby also fixing mmc support not working reliable
on the A23 (which seems more sensitive to this) and possible also fixes some
other sunxi mmc issues.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
arch/arm/include/asm/arch-sunxi/clock_sun4i.h
arch/arm/include/asm/arch-sunxi/clock_sun6i.h
drivers/mmc/sunxi_mmc.c