]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
fsl_esdhc: Use mmc_set_clock to set initial speed
authorJerry Huang <Chang-Ming.Huang@freescale.com>
Thu, 25 Nov 2010 17:06:07 +0000 (17:06 +0000)
committerWolfgang Denk <wd@denx.de>
Sat, 18 Dec 2010 21:11:27 +0000 (22:11 +0100)
After booting the u-boot, and first using some SD card (such as Sandisk 2G SD
card), because the field 'clock' of struct mmc is zero, this will cause
the read transfer is always active and SDHC DATA line is always active,
therefore, driver can't handle the next command.

Therefore, we use mmc_set_clock to setup both the data structure and HW
to the initial clock speed of 400000Hz.

Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
Tested-by: Stefano Babic <sbabic@denx.de>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
drivers/mmc/fsl_esdhc.c
include/mmc.h

index 57cd4ee1f436cced7b367e09e5b43c200ab54ca5..73d5cd3826afb5efe5434e8c498f475f76f8b338 100644 (file)
@@ -398,7 +398,7 @@ static int esdhc_init(struct mmc *mmc)
        esdhc_write32(&regs->sysctl, SYSCTL_HCKEN | SYSCTL_IPGEN);
 
        /* Set the initial clock speed */
-       set_sysctl(mmc, 400000);
+       mmc_set_clock(mmc, 400000);
 
        /* Disable the BRR and BWR bits in IRQSTAT */
        esdhc_clrbits32(&regs->irqstaten, IRQSTATEN_BRR | IRQSTATEN_BWR);
index 9f94f423fbf55a4536c0e736409e43ecc38cbd68..74c0b1d0ee992a3e95411a24be62edf1a871aa01 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008, Freescale Semiconductor, Inc
+ * Copyright 2008,2010 Freescale Semiconductor, Inc
  * Andy Fleming
  *
  * Based (loosely) on the Linux code
@@ -280,6 +280,7 @@ int mmc_register(struct mmc *mmc);
 int mmc_initialize(bd_t *bis);
 int mmc_init(struct mmc *mmc);
 int mmc_read(struct mmc *mmc, u64 src, uchar *dst, int size);
+void mmc_set_clock(struct mmc *mmc, uint clock);
 struct mmc *find_mmc_device(int dev_num);
 int mmc_set_dev(int dev_num);
 void print_mmc_devices(char separator);