summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/sdmmc-imx233.c
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-08-21 11:11:36 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-08-21 20:18:36 +0200
commit96d355abba19f3f099f94a8b2d3e95be32c39be7 (patch)
treef7f7a31eb7f6d69430f9a2eda4e2dd5d8dcebdfe /firmware/target/arm/imx233/sdmmc-imx233.c
parent462adf2a0fefbfdbccfafa11c999ac6beb114e8a (diff)
downloadrockbox-96d355abba19f3f099f94a8b2d3e95be32c39be7.tar.gz
rockbox-96d355abba19f3f099f94a8b2d3e95be32c39be7.tar.bz2
rockbox-96d355abba19f3f099f94a8b2d3e95be32c39be7.zip
imx233: fix drive strength for sd/mmc
At high speed, we need a drive strength of 8mA on the clock line to get stable transfers. Change-Id: Ida668db10cd3e10ad5740e35fd973f2fa394edb2
Diffstat (limited to 'firmware/target/arm/imx233/sdmmc-imx233.c')
-rw-r--r--firmware/target/arm/imx233/sdmmc-imx233.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/firmware/target/arm/imx233/sdmmc-imx233.c b/firmware/target/arm/imx233/sdmmc-imx233.c
index 99dd817ec6..164bf79eee 100644
--- a/firmware/target/arm/imx233/sdmmc-imx233.c
+++ b/firmware/target/arm/imx233/sdmmc-imx233.c
@@ -206,6 +206,17 @@ static void sdmmc_detect_callback(int ssp)
imx233_ssp_sdmmc_is_detect_inverted(ssp));
}
+static void sdmmc_enable_pullups(int drive, bool pullup)
+{
+ /* setup pins, never use alternatives pin on SSP1 because no device use it
+ * but this could be made a flag */
+ int bus_width = SDMMC_MODE(drive) == MMC_MODE ? 8 : 4;
+ if(SDMMC_SSP(drive) == 1)
+ imx233_ssp_setup_ssp1_sd_mmc_pins(pullup, bus_width, false);
+ else
+ imx233_ssp_setup_ssp2_sd_mmc_pins(pullup, bus_width);
+}
+
static void sdmmc_power(int drive, bool on)
{
/* power chip if needed */
@@ -223,13 +234,8 @@ static void sdmmc_power(int drive, bool on)
}
if(SDMMC_FLAGS(drive) & POWER_DELAY)
sleep(SDMMC_CONF(drive).power_delay);
- /* setup pins, never use alternatives pin on SSP1 because no device use it
- * but this could be made a flag */
- int bus_width = SDMMC_MODE(drive) == MMC_MODE ? 8 : 4;
- if(SDMMC_SSP(drive) == 1)
- imx233_ssp_setup_ssp1_sd_mmc_pins(on, bus_width, PINCTRL_DRIVE_4mA, false);
- else
- imx233_ssp_setup_ssp2_sd_mmc_pins(on, bus_width, PINCTRL_DRIVE_4mA);
+ /* enable pullups for identification */
+ sdmmc_enable_pullups(drive, true);
}
#define MCI_NO_RESP 0