From 96d355abba19f3f099f94a8b2d3e95be32c39be7 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Wed, 21 Aug 2013 11:11:36 +0200 Subject: 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 --- firmware/target/arm/imx233/sdmmc-imx233.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'firmware/target/arm/imx233/sdmmc-imx233.c') 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 -- cgit v1.2.3