summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorJocelyn Bohr <bohr@google.com>2017-04-02 08:24:33 (GMT)
committerJaehoon Chung <jh80.chung@samsung.com>2017-04-14 06:23:03 (GMT)
commit4db2b61fcf206cb45753cd1f988a9b0aad92b561 (patch)
treec2133ee2a5c41d2bbc9ed9aa4305e4d0c8368473 /drivers/mmc
parentc86c0155dcfbb02ce92c4d7245ffdf6fa904fbee (diff)
downloadu-boot-4db2b61fcf206cb45753cd1f988a9b0aad92b561.tar.xz
mmc: bcm2835_sdhci: Speed up mmc writes.
The linux kernel driver for this module does not use a delay when writing to the SDHCI_BUFFER register. This patch mimics that behavior in order to speed up the mmc writes on the Raspberry Pi. Signed-off-by: Alex Deymo <deymo@google.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/bcm2835_sdhci.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/mmc/bcm2835_sdhci.c b/drivers/mmc/bcm2835_sdhci.c
index 29c2a85..20079bc 100644
--- a/drivers/mmc/bcm2835_sdhci.c
+++ b/drivers/mmc/bcm2835_sdhci.c
@@ -44,6 +44,7 @@
/* 400KHz is max freq for card ID etc. Use that as min */
#define MIN_FREQ 400000
+#define SDHCI_BUFFER 0x20
struct bcm2835_sdhci_host {
struct sdhci_host host;
@@ -69,8 +70,11 @@ static inline void bcm2835_sdhci_raw_writel(struct sdhci_host *host, u32 val,
* (Which is just as well - otherwise we'd have to nobble the DMA engine
* too)
*/
- while (timer_get_us() - bcm_host->last_write < bcm_host->twoticks_delay)
- ;
+ if (reg != SDHCI_BUFFER) {
+ while (timer_get_us() - bcm_host->last_write <
+ bcm_host->twoticks_delay)
+ ;
+ }
writel(val, host->ioaddr + reg);
bcm_host->last_write = timer_get_us();