aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards/mach-ecovec24
diff options
context:
space:
mode:
authorKuninori Morimoto <morimoto.kuninori@renesas.com>2009-10-02 03:54:42 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-10-25 21:37:27 -0400
commit96987d96f0058d8689a2b8ac288dbff2e6d85563 (patch)
treee93a801281eaf1b6c44a90661841854fbc34d984 /arch/sh/boards/mach-ecovec24
parentd2a2fb97d1af449238d24356b1659325cf00372e (diff)
sh: mach-ecevec24: Add SDHI support
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards/mach-ecovec24')
-rw-r--r--arch/sh/boards/mach-ecovec24/setup.c78
1 files changed, 78 insertions, 0 deletions
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index 5f9881e16e2f..cb148cfe20c2 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -376,6 +376,54 @@ static struct platform_device keysc_device = {
376 }, 376 },
377}; 377};
378 378
379/* SHDI0 */
380static struct resource sdhi0_resources[] = {
381 [0] = {
382 .name = "SDHI0",
383 .start = 0x04ce0000,
384 .end = 0x04ce01ff,
385 .flags = IORESOURCE_MEM,
386 },
387 [1] = {
388 .start = 101,
389 .flags = IORESOURCE_IRQ,
390 },
391};
392
393static struct platform_device sdhi0_device = {
394 .name = "sh_mobile_sdhi",
395 .num_resources = ARRAY_SIZE(sdhi0_resources),
396 .resource = sdhi0_resources,
397 .id = 0,
398 .archdata = {
399 .hwblk_id = HWBLK_SDHI0,
400 },
401};
402
403/* SHDI1 */
404static struct resource sdhi1_resources[] = {
405 [0] = {
406 .name = "SDHI1",
407 .start = 0x04cf0000,
408 .end = 0x04cf01ff,
409 .flags = IORESOURCE_MEM,
410 },
411 [1] = {
412 .start = 24,
413 .flags = IORESOURCE_IRQ,
414 },
415};
416
417static struct platform_device sdhi1_device = {
418 .name = "sh_mobile_sdhi",
419 .num_resources = ARRAY_SIZE(sdhi1_resources),
420 .resource = sdhi1_resources,
421 .id = 1,
422 .archdata = {
423 .hwblk_id = HWBLK_SDHI1,
424 },
425};
426
379static struct platform_device *ecovec_devices[] __initdata = { 427static struct platform_device *ecovec_devices[] __initdata = {
380 &heartbeat_device, 428 &heartbeat_device,
381 &nor_flash_device, 429 &nor_flash_device,
@@ -386,6 +434,8 @@ static struct platform_device *ecovec_devices[] __initdata = {
386 &ceu0_device, 434 &ceu0_device,
387 &ceu1_device, 435 &ceu1_device,
388 &keysc_device, 436 &keysc_device,
437 &sdhi0_device,
438 &sdhi1_device,
389}; 439};
390 440
391#define EEPROM_ADDR 0x50 441#define EEPROM_ADDR 0x50
@@ -649,6 +699,34 @@ static int __init arch_setup(void)
649 gpio_direction_input(GPIO_PTR5); 699 gpio_direction_input(GPIO_PTR5);
650 gpio_direction_input(GPIO_PTR6); 700 gpio_direction_input(GPIO_PTR6);
651 701
702 /* enable SDHI0 */
703 gpio_request(GPIO_FN_SDHI0CD, NULL);
704 gpio_request(GPIO_FN_SDHI0WP, NULL);
705 gpio_request(GPIO_FN_SDHI0CMD, NULL);
706 gpio_request(GPIO_FN_SDHI0CLK, NULL);
707 gpio_request(GPIO_FN_SDHI0D3, NULL);
708 gpio_request(GPIO_FN_SDHI0D2, NULL);
709 gpio_request(GPIO_FN_SDHI0D1, NULL);
710 gpio_request(GPIO_FN_SDHI0D0, NULL);
711
712 /* enable SDHI1 */
713 gpio_request(GPIO_FN_SDHI1CD, NULL);
714 gpio_request(GPIO_FN_SDHI1WP, NULL);
715 gpio_request(GPIO_FN_SDHI1CMD, NULL);
716 gpio_request(GPIO_FN_SDHI1CLK, NULL);
717 gpio_request(GPIO_FN_SDHI1D3, NULL);
718 gpio_request(GPIO_FN_SDHI1D2, NULL);
719 gpio_request(GPIO_FN_SDHI1D1, NULL);
720 gpio_request(GPIO_FN_SDHI1D0, NULL);
721
722 gpio_request(GPIO_PTB6, NULL);
723 gpio_request(GPIO_PTB7, NULL);
724 gpio_direction_output(GPIO_PTB6, 1);
725 gpio_direction_output(GPIO_PTB7, 1);
726
727 /* I/O buffer drive ability is high for SDHI1 */
728 ctrl_outw((ctrl_inw(IODRIVEA) & ~0x3000) | 0x2000 , IODRIVEA);
729
652 /* enable I2C device */ 730 /* enable I2C device */
653 i2c_register_board_info(1, i2c1_devices, 731 i2c_register_board_info(1, i2c1_devices,
654 ARRAY_SIZE(i2c1_devices)); 732 ARRAY_SIZE(i2c1_devices));