diff options
Diffstat (limited to 'arch/arm/mach-ux500/board-mop500-sdi.c')
-rw-r--r-- | arch/arm/mach-ux500/board-mop500-sdi.c | 88 |
1 files changed, 56 insertions, 32 deletions
diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c index 6826faeecc68..23be34b3bb6e 100644 --- a/arch/arm/mach-ux500/board-mop500-sdi.c +++ b/arch/arm/mach-ux500/board-mop500-sdi.c | |||
@@ -22,6 +22,12 @@ | |||
22 | #include "ste-dma40-db8500.h" | 22 | #include "ste-dma40-db8500.h" |
23 | 23 | ||
24 | /* | 24 | /* |
25 | * v2 has a new version of this block that need to be forced, the number found | ||
26 | * in hardware is incorrect | ||
27 | */ | ||
28 | #define U8500_SDI_V2_PERIPHID 0x10480180 | ||
29 | |||
30 | /* | ||
25 | * SDI 0 (MicroSD slot) | 31 | * SDI 0 (MicroSD slot) |
26 | */ | 32 | */ |
27 | 33 | ||
@@ -117,10 +123,7 @@ static void sdi0_configure(void) | |||
117 | gpio_direction_output(sdi0_en, 1); | 123 | gpio_direction_output(sdi0_en, 1); |
118 | 124 | ||
119 | /* Add the device, force v2 to subrevision 1 */ | 125 | /* Add the device, force v2 to subrevision 1 */ |
120 | if (cpu_is_u8500v2()) | 126 | db8500_add_sdi0(&mop500_sdi0_data, U8500_SDI_V2_PERIPHID); |
121 | db8500_add_sdi0(&mop500_sdi0_data, 0x10480180); | ||
122 | else | ||
123 | db8500_add_sdi0(&mop500_sdi0_data, 0); | ||
124 | } | 127 | } |
125 | 128 | ||
126 | void mop500_sdi_tc35892_init(void) | 129 | void mop500_sdi_tc35892_init(void) |
@@ -132,6 +135,42 @@ void mop500_sdi_tc35892_init(void) | |||
132 | } | 135 | } |
133 | 136 | ||
134 | /* | 137 | /* |
138 | * SDI1 (SDIO WLAN) | ||
139 | */ | ||
140 | #ifdef CONFIG_STE_DMA40 | ||
141 | static struct stedma40_chan_cfg sdi1_dma_cfg_rx = { | ||
142 | .mode = STEDMA40_MODE_LOGICAL, | ||
143 | .dir = STEDMA40_PERIPH_TO_MEM, | ||
144 | .src_dev_type = DB8500_DMA_DEV32_SD_MM1_RX, | ||
145 | .dst_dev_type = STEDMA40_DEV_DST_MEMORY, | ||
146 | .src_info.data_width = STEDMA40_WORD_WIDTH, | ||
147 | .dst_info.data_width = STEDMA40_WORD_WIDTH, | ||
148 | }; | ||
149 | |||
150 | static struct stedma40_chan_cfg sdi1_dma_cfg_tx = { | ||
151 | .mode = STEDMA40_MODE_LOGICAL, | ||
152 | .dir = STEDMA40_MEM_TO_PERIPH, | ||
153 | .src_dev_type = STEDMA40_DEV_SRC_MEMORY, | ||
154 | .dst_dev_type = DB8500_DMA_DEV32_SD_MM1_TX, | ||
155 | .src_info.data_width = STEDMA40_WORD_WIDTH, | ||
156 | .dst_info.data_width = STEDMA40_WORD_WIDTH, | ||
157 | }; | ||
158 | #endif | ||
159 | |||
160 | static struct mmci_platform_data mop500_sdi1_data = { | ||
161 | .ocr_mask = MMC_VDD_29_30, | ||
162 | .f_max = 50000000, | ||
163 | .capabilities = MMC_CAP_4_BIT_DATA, | ||
164 | .gpio_cd = -1, | ||
165 | .gpio_wp = -1, | ||
166 | #ifdef CONFIG_STE_DMA40 | ||
167 | .dma_filter = stedma40_filter, | ||
168 | .dma_rx_param = &sdi1_dma_cfg_rx, | ||
169 | .dma_tx_param = &sdi1_dma_cfg_tx, | ||
170 | #endif | ||
171 | }; | ||
172 | |||
173 | /* | ||
135 | * SDI 2 (POP eMMC, not on DB8500ed) | 174 | * SDI 2 (POP eMMC, not on DB8500ed) |
136 | */ | 175 | */ |
137 | 176 | ||
@@ -158,7 +197,8 @@ static struct stedma40_chan_cfg mop500_sdi2_dma_cfg_tx = { | |||
158 | static struct mmci_platform_data mop500_sdi2_data = { | 197 | static struct mmci_platform_data mop500_sdi2_data = { |
159 | .ocr_mask = MMC_VDD_165_195, | 198 | .ocr_mask = MMC_VDD_165_195, |
160 | .f_max = 50000000, | 199 | .f_max = 50000000, |
161 | .capabilities = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, | 200 | .capabilities = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA | |
201 | MMC_CAP_MMC_HIGHSPEED, | ||
162 | .gpio_cd = -1, | 202 | .gpio_cd = -1, |
163 | .gpio_wp = -1, | 203 | .gpio_wp = -1, |
164 | #ifdef CONFIG_STE_DMA40 | 204 | #ifdef CONFIG_STE_DMA40 |
@@ -208,20 +248,10 @@ static struct mmci_platform_data mop500_sdi4_data = { | |||
208 | 248 | ||
209 | void __init mop500_sdi_init(void) | 249 | void __init mop500_sdi_init(void) |
210 | { | 250 | { |
211 | u32 periphid = 0; | 251 | /* PoP:ed eMMC */ |
212 | 252 | db8500_add_sdi2(&mop500_sdi2_data, U8500_SDI_V2_PERIPHID); | |
213 | /* v2 has a new version of this block that need to be forced */ | ||
214 | if (cpu_is_u8500v2()) | ||
215 | periphid = 0x10480180; | ||
216 | /* PoP:ed eMMC on top of DB8500 v1.0 has problems with high speed */ | ||
217 | if (!cpu_is_u8500v10()) | ||
218 | mop500_sdi2_data.capabilities |= MMC_CAP_MMC_HIGHSPEED; | ||
219 | |||
220 | db8500_add_sdi2(&mop500_sdi2_data, periphid); | ||
221 | |||
222 | /* On-board eMMC */ | 253 | /* On-board eMMC */ |
223 | db8500_add_sdi4(&mop500_sdi4_data, periphid); | 254 | db8500_add_sdi4(&mop500_sdi4_data, U8500_SDI_V2_PERIPHID); |
224 | |||
225 | /* | 255 | /* |
226 | * On boards with the TC35892 GPIO expander, sdi0 will finally | 256 | * On boards with the TC35892 GPIO expander, sdi0 will finally |
227 | * be added when the TC35892 initializes and calls | 257 | * be added when the TC35892 initializes and calls |
@@ -231,13 +261,9 @@ void __init mop500_sdi_init(void) | |||
231 | 261 | ||
232 | void __init snowball_sdi_init(void) | 262 | void __init snowball_sdi_init(void) |
233 | { | 263 | { |
234 | u32 periphid = 0x10480180; | ||
235 | |||
236 | mop500_sdi2_data.capabilities |= MMC_CAP_MMC_HIGHSPEED; | ||
237 | |||
238 | /* On-board eMMC */ | 264 | /* On-board eMMC */ |
239 | db8500_add_sdi4(&mop500_sdi4_data, periphid); | 265 | db8500_add_sdi4(&mop500_sdi4_data, U8500_SDI_V2_PERIPHID); |
240 | 266 | /* External Micro SD slot */ | |
241 | mop500_sdi0_data.gpio_cd = SNOWBALL_SDMMC_CD_GPIO; | 267 | mop500_sdi0_data.gpio_cd = SNOWBALL_SDMMC_CD_GPIO; |
242 | mop500_sdi0_data.cd_invert = true; | 268 | mop500_sdi0_data.cd_invert = true; |
243 | sdi0_en = SNOWBALL_SDMMC_EN_GPIO; | 269 | sdi0_en = SNOWBALL_SDMMC_EN_GPIO; |
@@ -247,17 +273,15 @@ void __init snowball_sdi_init(void) | |||
247 | 273 | ||
248 | void __init hrefv60_sdi_init(void) | 274 | void __init hrefv60_sdi_init(void) |
249 | { | 275 | { |
250 | u32 periphid = 0x10480180; | 276 | /* PoP:ed eMMC */ |
251 | 277 | db8500_add_sdi2(&mop500_sdi2_data, U8500_SDI_V2_PERIPHID); | |
252 | mop500_sdi2_data.capabilities |= MMC_CAP_MMC_HIGHSPEED; | ||
253 | |||
254 | db8500_add_sdi2(&mop500_sdi2_data, periphid); | ||
255 | |||
256 | /* On-board eMMC */ | 278 | /* On-board eMMC */ |
257 | db8500_add_sdi4(&mop500_sdi4_data, periphid); | 279 | db8500_add_sdi4(&mop500_sdi4_data, U8500_SDI_V2_PERIPHID); |
258 | 280 | /* External Micro SD slot */ | |
259 | mop500_sdi0_data.gpio_cd = HREFV60_SDMMC_CD_GPIO; | 281 | mop500_sdi0_data.gpio_cd = HREFV60_SDMMC_CD_GPIO; |
260 | sdi0_en = HREFV60_SDMMC_EN_GPIO; | 282 | sdi0_en = HREFV60_SDMMC_EN_GPIO; |
261 | sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO; | 283 | sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO; |
262 | sdi0_configure(); | 284 | sdi0_configure(); |
285 | /* WLAN SDIO channel */ | ||
286 | db8500_add_sdi1(&mop500_sdi1_data, U8500_SDI_V2_PERIPHID); | ||
263 | } | 287 | } |