mmc: add bcm2835 driver
authorStephen Warren <swarren@wwwdotorg.org>
Tue, 29 Jan 2013 16:37:41 +0000 (16:37 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Wed, 20 Mar 2013 14:31:25 +0000 (15:31 +0100)
commit9a4fbe4fbdeb3ffadeb277236c672c2712443a1b
tree4901e71720de8d4f1ce338ce2f91d9ff83278557
parent6be3c9fca27252590b55b211bcf1df884fe3adbd
mmc: add bcm2835 driver

This adds a simple driver for the BCM2835's SD controller.

Workarounds are implemented for:
* Register writes can't be too close to each-other in time, or they will
  be lost.
* Register accesses must all be 32-bit, so implement custom accessors.

This code was extracted from:
git://github.com/gonzoua/u-boot-pi.git master
which was created by Oleksandr Tymoshenko.

Portions of the code there were obviously based on the Linux kernel at:
git://github.com/raspberrypi/linux.git rpi-3.6.y
commit f5b930b "Main bcm2708 linux port" signed-off-by Dom Cobley.

swarren changed the following for upstream:
* Removed hack udelay()s in bcm2835_sdhci_raw_writel(); setting
  SDHCI_QUIRK_WAIT_SEND_CMD appears to solve the issues.
* Remove register logging from read*/write* functions.
* Sort out confusion with min/max_freq values passed to add_sdhci().
* Use more descriptive variable names and calculations in IO accessors.
* Simplified and commented twoticks_delay calculation.
* checkpatch fixes.

Cc: Andy Fleming <afleming@gmail.com>
Signed-off-by: Oleksandr Tymoshenko <gonzo@bluezbox.com>
Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
Acked-by: Andy Fleming <afleming@gmail.com>
arch/arm/include/asm/arch-bcm2835/sdhci.h [new file with mode: 0644]
drivers/mmc/Makefile
drivers/mmc/bcm2835_sdhci.c [new file with mode: 0644]