diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2013-08-21 11:11:36 +0200 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2013-08-21 20:18:36 +0200 |
commit | 96d355abba19f3f099f94a8b2d3e95be32c39be7 (patch) | |
tree | f7f7a31eb7f6d69430f9a2eda4e2dd5d8dcebdfe /firmware/target/arm/imx233/sdmmc-imx233.c | |
parent | 462adf2a0fefbfdbccfafa11c999ac6beb114e8a (diff) | |
download | rockbox-96d355abba19f3f099f94a8b2d3e95be32c39be7.tar.gz 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.c | 20 |
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) | |||
206 | imx233_ssp_sdmmc_is_detect_inverted(ssp)); | 206 | imx233_ssp_sdmmc_is_detect_inverted(ssp)); |
207 | } | 207 | } |
208 | 208 | ||
209 | static void sdmmc_enable_pullups(int drive, bool pullup) | ||
210 | { | ||
211 | /* setup pins, never use alternatives pin on SSP1 because no device use it | ||
212 | * but this could be made a flag */ | ||
213 | int bus_width = SDMMC_MODE(drive) == MMC_MODE ? 8 : 4; | ||
214 | if(SDMMC_SSP(drive) == 1) | ||
215 | imx233_ssp_setup_ssp1_sd_mmc_pins(pullup, bus_width, false); | ||
216 | else | ||
217 | imx233_ssp_setup_ssp2_sd_mmc_pins(pullup, bus_width); | ||
218 | } | ||
219 | |||
209 | static void sdmmc_power(int drive, bool on) | 220 | static void sdmmc_power(int drive, bool on) |
210 | { | 221 | { |
211 | /* power chip if needed */ | 222 | /* power chip if needed */ |
@@ -223,13 +234,8 @@ static void sdmmc_power(int drive, bool on) | |||
223 | } | 234 | } |
224 | if(SDMMC_FLAGS(drive) & POWER_DELAY) | 235 | if(SDMMC_FLAGS(drive) & POWER_DELAY) |
225 | sleep(SDMMC_CONF(drive).power_delay); | 236 | sleep(SDMMC_CONF(drive).power_delay); |
226 | /* setup pins, never use alternatives pin on SSP1 because no device use it | 237 | /* enable pullups for identification */ |
227 | * but this could be made a flag */ | 238 | sdmmc_enable_pullups(drive, true); |
228 | int bus_width = SDMMC_MODE(drive) == MMC_MODE ? 8 : 4; | ||
229 | if(SDMMC_SSP(drive) == 1) | ||
230 | imx233_ssp_setup_ssp1_sd_mmc_pins(on, bus_width, PINCTRL_DRIVE_4mA, false); | ||
231 | else | ||
232 | imx233_ssp_setup_ssp2_sd_mmc_pins(on, bus_width, PINCTRL_DRIVE_4mA); | ||
233 | } | 239 | } |
234 | 240 | ||
235 | #define MCI_NO_RESP 0 | 241 | #define MCI_NO_RESP 0 |