diff options
author | Magnus Damm <damm@opensource.se> | 2011-08-18 01:45:00 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-08-29 03:50:38 -0400 |
commit | 8722c996d61948a57ada840350b0383f6879bcaa (patch) | |
tree | 60a0498f2fc34ab42b9e04c6078ac958af8c890c /arch/arm/mach-shmobile | |
parent | 9e9a892417317c3c7fc98f9a87f51c0e7b013b36 (diff) |
ARM: mach-shmobile: Kota2 SDHI0 and SDHI1 support
Add SDHI0 and SDHI1 support to the Kota2 board.
SDHI0 is hooked up to a microSD card slot and SDHI1
to a wireless module that also connects to SCIFB.
This depends on the recently merged code for
TMIO_MMC_HAS_IDLE_WAIT together with PFC support
for pull-ups on SDHI0 and SDHI1.
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r-- | arch/arm/mach-shmobile/board-kota2.c | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-kota2.c b/arch/arm/mach-shmobile/board-kota2.c index 0dbee59bc6d9..adc73122bf20 100644 --- a/arch/arm/mach-shmobile/board-kota2.c +++ b/arch/arm/mach-shmobile/board-kota2.c | |||
@@ -35,6 +35,8 @@ | |||
35 | #include <linux/leds.h> | 35 | #include <linux/leds.h> |
36 | #include <linux/mmc/host.h> | 36 | #include <linux/mmc/host.h> |
37 | #include <linux/mmc/sh_mmcif.h> | 37 | #include <linux/mmc/sh_mmcif.h> |
38 | #include <linux/mfd/tmio.h> | ||
39 | #include <linux/mmc/sh_mobile_sdhi.h> | ||
38 | #include <mach/hardware.h> | 40 | #include <mach/hardware.h> |
39 | #include <mach/sh73a0.h> | 41 | #include <mach/sh73a0.h> |
40 | #include <mach/common.h> | 42 | #include <mach/common.h> |
@@ -205,12 +207,86 @@ static struct platform_device mmcif_device = { | |||
205 | .resource = mmcif_resources, | 207 | .resource = mmcif_resources, |
206 | }; | 208 | }; |
207 | 209 | ||
210 | static struct sh_mobile_sdhi_info sdhi0_info = { | ||
211 | .tmio_caps = MMC_CAP_SD_HIGHSPEED, | ||
212 | .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT, | ||
213 | }; | ||
214 | |||
215 | static struct resource sdhi0_resources[] = { | ||
216 | [0] = { | ||
217 | .name = "SDHI0", | ||
218 | .start = 0xee100000, | ||
219 | .end = 0xee1000ff, | ||
220 | .flags = IORESOURCE_MEM, | ||
221 | }, | ||
222 | [1] = { | ||
223 | .start = gic_spi(83), | ||
224 | .flags = IORESOURCE_IRQ, | ||
225 | }, | ||
226 | [2] = { | ||
227 | .start = gic_spi(84), | ||
228 | .flags = IORESOURCE_IRQ, | ||
229 | }, | ||
230 | [3] = { | ||
231 | .start = gic_spi(85), | ||
232 | .flags = IORESOURCE_IRQ, | ||
233 | }, | ||
234 | }; | ||
235 | |||
236 | static struct platform_device sdhi0_device = { | ||
237 | .name = "sh_mobile_sdhi", | ||
238 | .id = 0, | ||
239 | .num_resources = ARRAY_SIZE(sdhi0_resources), | ||
240 | .resource = sdhi0_resources, | ||
241 | .dev = { | ||
242 | .platform_data = &sdhi0_info, | ||
243 | }, | ||
244 | }; | ||
245 | |||
246 | static struct sh_mobile_sdhi_info sdhi1_info = { | ||
247 | .tmio_caps = MMC_CAP_NONREMOVABLE | MMC_CAP_SDIO_IRQ, | ||
248 | .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT, | ||
249 | }; | ||
250 | |||
251 | static struct resource sdhi1_resources[] = { | ||
252 | [0] = { | ||
253 | .name = "SDHI1", | ||
254 | .start = 0xee120000, | ||
255 | .end = 0xee1200ff, | ||
256 | .flags = IORESOURCE_MEM, | ||
257 | }, | ||
258 | [1] = { | ||
259 | .start = gic_spi(87), | ||
260 | .flags = IORESOURCE_IRQ, | ||
261 | }, | ||
262 | [2] = { | ||
263 | .start = gic_spi(88), | ||
264 | .flags = IORESOURCE_IRQ, | ||
265 | }, | ||
266 | [3] = { | ||
267 | .start = gic_spi(89), | ||
268 | .flags = IORESOURCE_IRQ, | ||
269 | }, | ||
270 | }; | ||
271 | |||
272 | static struct platform_device sdhi1_device = { | ||
273 | .name = "sh_mobile_sdhi", | ||
274 | .id = 1, | ||
275 | .num_resources = ARRAY_SIZE(sdhi1_resources), | ||
276 | .resource = sdhi1_resources, | ||
277 | .dev = { | ||
278 | .platform_data = &sdhi1_info, | ||
279 | }, | ||
280 | }; | ||
281 | |||
208 | static struct platform_device *kota2_devices[] __initdata = { | 282 | static struct platform_device *kota2_devices[] __initdata = { |
209 | ð_device, | 283 | ð_device, |
210 | &keysc_device, | 284 | &keysc_device, |
211 | &gpio_keys_device, | 285 | &gpio_keys_device, |
212 | &gpio_leds_device, | 286 | &gpio_leds_device, |
213 | &mmcif_device, | 287 | &mmcif_device, |
288 | &sdhi0_device, | ||
289 | &sdhi1_device, | ||
214 | }; | 290 | }; |
215 | 291 | ||
216 | static struct map_desc kota2_io_desc[] __initdata = { | 292 | static struct map_desc kota2_io_desc[] __initdata = { |
@@ -319,6 +395,15 @@ static void __init kota2_init(void) | |||
319 | gpio_request(GPIO_PORT208, NULL); /* Reset */ | 395 | gpio_request(GPIO_PORT208, NULL); /* Reset */ |
320 | gpio_direction_output(GPIO_PORT208, 1); | 396 | gpio_direction_output(GPIO_PORT208, 1); |
321 | 397 | ||
398 | /* SDHI0 (microSD) */ | ||
399 | gpio_request(GPIO_FN_SDHICD0_PU, NULL); | ||
400 | gpio_request(GPIO_FN_SDHICMD0_PU, NULL); | ||
401 | gpio_request(GPIO_FN_SDHICLK0, NULL); | ||
402 | gpio_request(GPIO_FN_SDHID0_3_PU, NULL); | ||
403 | gpio_request(GPIO_FN_SDHID0_2_PU, NULL); | ||
404 | gpio_request(GPIO_FN_SDHID0_1_PU, NULL); | ||
405 | gpio_request(GPIO_FN_SDHID0_0_PU, NULL); | ||
406 | |||
322 | /* SCIFB (BT) */ | 407 | /* SCIFB (BT) */ |
323 | gpio_request(GPIO_FN_PORT159_SCIFB_SCK, NULL); | 408 | gpio_request(GPIO_FN_PORT159_SCIFB_SCK, NULL); |
324 | gpio_request(GPIO_FN_PORT160_SCIFB_TXD, NULL); | 409 | gpio_request(GPIO_FN_PORT160_SCIFB_TXD, NULL); |
@@ -326,6 +411,14 @@ static void __init kota2_init(void) | |||
326 | gpio_request(GPIO_FN_PORT162_SCIFB_RXD, NULL); | 411 | gpio_request(GPIO_FN_PORT162_SCIFB_RXD, NULL); |
327 | gpio_request(GPIO_FN_PORT163_SCIFB_RTS_, NULL); | 412 | gpio_request(GPIO_FN_PORT163_SCIFB_RTS_, NULL); |
328 | 413 | ||
414 | /* SDHI1 (BCM4330) */ | ||
415 | gpio_request(GPIO_FN_SDHICLK1, NULL); | ||
416 | gpio_request(GPIO_FN_SDHICMD1_PU, NULL); | ||
417 | gpio_request(GPIO_FN_SDHID1_3_PU, NULL); | ||
418 | gpio_request(GPIO_FN_SDHID1_2_PU, NULL); | ||
419 | gpio_request(GPIO_FN_SDHID1_1_PU, NULL); | ||
420 | gpio_request(GPIO_FN_SDHID1_0_PU, NULL); | ||
421 | |||
329 | #ifdef CONFIG_CACHE_L2X0 | 422 | #ifdef CONFIG_CACHE_L2X0 |
330 | /* Early BRESP enable, Shared attribute override enable, 64K*8way */ | 423 | /* Early BRESP enable, Shared attribute override enable, 64K*8way */ |
331 | l2x0_init(__io(0xf0100000), 0x40460000, 0x82000fff); | 424 | l2x0_init(__io(0xf0100000), 0x40460000, 0x82000fff); |