Commit d980efea authored by Sergei Poselenov's avatar Sergei Poselenov

RM 1947. Added missed change for SD support on Freescale TWR.

parent c10887f3
......@@ -25,6 +25,9 @@
#include <common.h>
#include <netdev.h>
#include <nand.h>
#include <mmc.h>
#include <fsl_esdhc.h>
#include <asm/arch/kinetis.h>
#include <asm/arch/kinetis_gpio.h>
......@@ -435,6 +438,24 @@ static const struct kinetis_gpio_pin_config twr_k70f120m_gpio[] = {
/* B.20 = NFC_D15 */
{{KINETIS_GPIO_PORT_B, 20}, KINETIS_GPIO_CONFIG_DSE(5)},
#endif /* CONFIG_CMD_NAND */
#ifdef CONFIG_FSL_ESDHC
/* E.0 = SDHC0_D1 */
{{KINETIS_GPIO_PORT_E, 0}, KINETIS_GPIO_CONFIG_MUX(4)},
/* E.1 = SDHC0_D0 */
{{KINETIS_GPIO_PORT_E, 1}, KINETIS_GPIO_CONFIG_MUX(4)},
/* E.2 = SDHC0_DCLK */
{{KINETIS_GPIO_PORT_E, 2}, KINETIS_GPIO_CONFIG_MUX(4)},
/* E.3 = SDHC0_CMD */
{{KINETIS_GPIO_PORT_E, 3}, KINETIS_GPIO_CONFIG_MUX(4)},
/* E.4 = SDHC0_D3 */
{{KINETIS_GPIO_PORT_E, 4}, KINETIS_GPIO_CONFIG_MUX(4)},
/* E.5 = SDHC0_D2 */
{{KINETIS_GPIO_PORT_E, 5}, KINETIS_GPIO_CONFIG_MUX(4)},
/* E.28 = SD switch */
{{KINETIS_GPIO_PORT_E, 28}, KINETIS_GPIO_CONFIG_PULLUP(1)},
#endif
};
/*
......@@ -858,3 +879,17 @@ int board_eth_init(bd_t *bis)
}
#endif
#ifdef CONFIG_FSL_ESDHC
int board_mmc_getcd(struct mmc *mmc)
{
/*
* Check GPIO E.28 for the SD card presence
*/
return (*(volatile uint *)0x400FF110 & (1 << 28)) ? 0 : 1;
}
int board_mmc_init(bd_t *bis)
{
return fsl_esdhc_mmc_init(bis);
}
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment