aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500/board-mop500-sdi.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-ux500/board-mop500-sdi.c')
-rw-r--r--arch/arm/mach-ux500/board-mop500-sdi.c61
1 files changed, 44 insertions, 17 deletions
diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c
index 7c6cb4fa47a9..d0cb9e5eb87c 100644
--- a/arch/arm/mach-ux500/board-mop500-sdi.c
+++ b/arch/arm/mach-ux500/board-mop500-sdi.c
@@ -32,13 +32,32 @@
32#define MCI_DATA31DIREN (1 << 5) 32#define MCI_DATA31DIREN (1 << 5)
33#define MCI_FBCLKEN (1 << 7) 33#define MCI_FBCLKEN (1 << 7)
34 34
35/* GPIO pins used by the sdi0 level shifter */
36static int sdi0_en = -1;
37static int sdi0_vsel = -1;
38
35static u32 mop500_sdi0_vdd_handler(struct device *dev, unsigned int vdd, 39static u32 mop500_sdi0_vdd_handler(struct device *dev, unsigned int vdd,
36 unsigned char power_mode) 40 unsigned char power_mode)
37{ 41{
38 if (power_mode == MMC_POWER_UP) 42 switch (power_mode) {
39 gpio_set_value_cansleep(GPIO_SDMMC_EN, 1); 43 case MMC_POWER_UP:
40 else if (power_mode == MMC_POWER_OFF) 44 case MMC_POWER_ON:
41 gpio_set_value_cansleep(GPIO_SDMMC_EN, 0); 45 /*
46 * Level shifter voltage should depend on vdd to when deciding
47 * on either 1.8V or 2.9V. Once the decision has been made the
48 * level shifter must be disabled and re-enabled with a changed
49 * select signal in order to switch the voltage. Since there is
50 * no framework support yet for indicating 1.8V in vdd, use the
51 * default 2.9V.
52 */
53 gpio_direction_output(sdi0_vsel, 0);
54 gpio_direction_output(sdi0_en, 1);
55 break;
56 case MMC_POWER_OFF:
57 gpio_direction_output(sdi0_vsel, 0);
58 gpio_direction_output(sdi0_en, 0);
59 break;
60 }
42 61
43 return MCI_FBCLKEN | MCI_CMDDIREN | MCI_DATA0DIREN | 62 return MCI_FBCLKEN | MCI_CMDDIREN | MCI_DATA0DIREN |
44 MCI_DATA2DIREN | MCI_DATA31DIREN; 63 MCI_DATA2DIREN | MCI_DATA31DIREN;
@@ -67,8 +86,10 @@ static struct stedma40_chan_cfg mop500_sdi0_dma_cfg_tx = {
67static struct mmci_platform_data mop500_sdi0_data = { 86static struct mmci_platform_data mop500_sdi0_data = {
68 .vdd_handler = mop500_sdi0_vdd_handler, 87 .vdd_handler = mop500_sdi0_vdd_handler,
69 .ocr_mask = MMC_VDD_29_30, 88 .ocr_mask = MMC_VDD_29_30,
70 .f_max = 100000000, 89 .f_max = 50000000,
71 .capabilities = MMC_CAP_4_BIT_DATA, 90 .capabilities = MMC_CAP_4_BIT_DATA |
91 MMC_CAP_SD_HIGHSPEED |
92 MMC_CAP_MMC_HIGHSPEED,
72 .gpio_wp = -1, 93 .gpio_wp = -1,
73#ifdef CONFIG_STE_DMA40 94#ifdef CONFIG_STE_DMA40
74 .dma_filter = stedma40_filter, 95 .dma_filter = stedma40_filter,
@@ -77,10 +98,6 @@ static struct mmci_platform_data mop500_sdi0_data = {
77#endif 98#endif
78}; 99};
79 100
80/* GPIO pins used by the sdi0 level shifter */
81static int sdi0_en = -1;
82static int sdi0_vsel = -1;
83
84static void sdi0_configure(void) 101static void sdi0_configure(void)
85{ 102{
86 int ret; 103 int ret;
@@ -140,7 +157,7 @@ static struct stedma40_chan_cfg mop500_sdi2_dma_cfg_tx = {
140 157
141static struct mmci_platform_data mop500_sdi2_data = { 158static struct mmci_platform_data mop500_sdi2_data = {
142 .ocr_mask = MMC_VDD_165_195, 159 .ocr_mask = MMC_VDD_165_195,
143 .f_max = 100000000, 160 .f_max = 50000000,
144 .capabilities = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, 161 .capabilities = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
145 .gpio_cd = -1, 162 .gpio_cd = -1,
146 .gpio_wp = -1, 163 .gpio_wp = -1,
@@ -177,7 +194,7 @@ static struct stedma40_chan_cfg mop500_sdi4_dma_cfg_tx = {
177 194
178static struct mmci_platform_data mop500_sdi4_data = { 195static struct mmci_platform_data mop500_sdi4_data = {
179 .ocr_mask = MMC_VDD_29_30, 196 .ocr_mask = MMC_VDD_29_30,
180 .f_max = 100000000, 197 .f_max = 50000000,
181 .capabilities = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA | 198 .capabilities = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA |
182 MMC_CAP_MMC_HIGHSPEED, 199 MMC_CAP_MMC_HIGHSPEED,
183 .gpio_cd = -1, 200 .gpio_cd = -1,
@@ -199,17 +216,27 @@ void __init mop500_sdi_init(void)
199 /* PoP:ed eMMC on top of DB8500 v1.0 has problems with high speed */ 216 /* PoP:ed eMMC on top of DB8500 v1.0 has problems with high speed */
200 if (!cpu_is_u8500v10()) 217 if (!cpu_is_u8500v10())
201 mop500_sdi2_data.capabilities |= MMC_CAP_MMC_HIGHSPEED; 218 mop500_sdi2_data.capabilities |= MMC_CAP_MMC_HIGHSPEED;
202 db8500_add_sdi2(&mop500_sdi2_data, periphid); 219 /* sdi2 on snowball is in ATL_B mode for FSMC (LAN) */
220 if (!machine_is_snowball())
221 db8500_add_sdi2(&mop500_sdi2_data, periphid);
203 222
204 /* On-board eMMC */ 223 /* On-board eMMC */
205 db8500_add_sdi4(&mop500_sdi4_data, periphid); 224 db8500_add_sdi4(&mop500_sdi4_data, periphid);
206 225
207 if (machine_is_hrefv60()) { 226 if (machine_is_hrefv60() || machine_is_snowball()) {
208 mop500_sdi0_data.gpio_cd = HREFV60_SDMMC_CD_GPIO; 227 if (machine_is_hrefv60()) {
209 sdi0_en = HREFV60_SDMMC_EN_GPIO; 228 mop500_sdi0_data.gpio_cd = HREFV60_SDMMC_CD_GPIO;
210 sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO; 229 sdi0_en = HREFV60_SDMMC_EN_GPIO;
230 sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO;
231 } else if (machine_is_snowball()) {
232 mop500_sdi0_data.gpio_cd = SNOWBALL_SDMMC_CD_GPIO;
233 mop500_sdi0_data.cd_invert = true;
234 sdi0_en = SNOWBALL_SDMMC_EN_GPIO;
235 sdi0_vsel = SNOWBALL_SDMMC_1V8_3V_GPIO;
236 }
211 sdi0_configure(); 237 sdi0_configure();
212 } 238 }
239
213 /* 240 /*
214 * On boards with the TC35892 GPIO expander, sdi0 will finally 241 * On boards with the TC35892 GPIO expander, sdi0 will finally
215 * be added when the TC35892 initializes and calls 242 * be added when the TC35892 initializes and calls