diff options
Diffstat (limited to 'arch/sh/boards/mach-ecovec24/setup.c')
-rw-r--r-- | arch/sh/boards/mach-ecovec24/setup.c | 101 |
1 files changed, 91 insertions, 10 deletions
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index 49714258732e..be1d114d3a43 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c | |||
@@ -12,6 +12,8 @@ | |||
12 | #include <linux/device.h> | 12 | #include <linux/device.h> |
13 | #include <linux/platform_device.h> | 13 | #include <linux/platform_device.h> |
14 | #include <linux/mfd/sh_mobile_sdhi.h> | 14 | #include <linux/mfd/sh_mobile_sdhi.h> |
15 | #include <linux/mmc/host.h> | ||
16 | #include <linux/mmc/sh_mmcif.h> | ||
15 | #include <linux/mtd/physmap.h> | 17 | #include <linux/mtd/physmap.h> |
16 | #include <linux/gpio.h> | 18 | #include <linux/gpio.h> |
17 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
@@ -26,7 +28,6 @@ | |||
26 | #include <linux/mmc/host.h> | 28 | #include <linux/mmc/host.h> |
27 | #include <linux/input.h> | 29 | #include <linux/input.h> |
28 | #include <linux/input/sh_keysc.h> | 30 | #include <linux/input/sh_keysc.h> |
29 | #include <linux/mfd/sh_mobile_sdhi.h> | ||
30 | #include <video/sh_mobile_lcdc.h> | 31 | #include <video/sh_mobile_lcdc.h> |
31 | #include <sound/sh_fsi.h> | 32 | #include <sound/sh_fsi.h> |
32 | #include <media/sh_mobile_ceu.h> | 33 | #include <media/sh_mobile_ceu.h> |
@@ -139,7 +140,7 @@ static struct resource sh_eth_resources[] = { | |||
139 | }, | 140 | }, |
140 | }; | 141 | }; |
141 | 142 | ||
142 | struct sh_eth_plat_data sh_eth_plat = { | 143 | static struct sh_eth_plat_data sh_eth_plat = { |
143 | .phy = 0x1f, /* SMSC LAN8700 */ | 144 | .phy = 0x1f, /* SMSC LAN8700 */ |
144 | .edmac_endian = EDMAC_LITTLE_ENDIAN, | 145 | .edmac_endian = EDMAC_LITTLE_ENDIAN, |
145 | .ether_link_active_low = 1 | 146 | .ether_link_active_low = 1 |
@@ -159,7 +160,7 @@ static struct platform_device sh_eth_device = { | |||
159 | }; | 160 | }; |
160 | 161 | ||
161 | /* USB0 host */ | 162 | /* USB0 host */ |
162 | void usb0_port_power(int port, int power) | 163 | static void usb0_port_power(int port, int power) |
163 | { | 164 | { |
164 | gpio_set_value(GPIO_PTB4, power); | 165 | gpio_set_value(GPIO_PTB4, power); |
165 | } | 166 | } |
@@ -195,7 +196,7 @@ static struct platform_device usb0_host_device = { | |||
195 | }; | 196 | }; |
196 | 197 | ||
197 | /* USB1 host/function */ | 198 | /* USB1 host/function */ |
198 | void usb1_port_power(int port, int power) | 199 | static void usb1_port_power(int port, int power) |
199 | { | 200 | { |
200 | gpio_set_value(GPIO_PTB5, power); | 201 | gpio_set_value(GPIO_PTB5, power); |
201 | } | 202 | } |
@@ -421,7 +422,7 @@ static int ts_init(void) | |||
421 | return 0; | 422 | return 0; |
422 | } | 423 | } |
423 | 424 | ||
424 | struct tsc2007_platform_data tsc2007_info = { | 425 | static struct tsc2007_platform_data tsc2007_info = { |
425 | .model = 2007, | 426 | .model = 2007, |
426 | .x_plate_ohms = 180, | 427 | .x_plate_ohms = 180, |
427 | .get_pendown_state = ts_get_pendown_state, | 428 | .get_pendown_state = ts_get_pendown_state, |
@@ -436,7 +437,7 @@ static struct i2c_board_info ts_i2c_clients = { | |||
436 | }; | 437 | }; |
437 | 438 | ||
438 | #ifdef CONFIG_MFD_SH_MOBILE_SDHI | 439 | #ifdef CONFIG_MFD_SH_MOBILE_SDHI |
439 | /* SHDI0 */ | 440 | /* SDHI0 */ |
440 | static void sdhi0_set_pwr(struct platform_device *pdev, int state) | 441 | static void sdhi0_set_pwr(struct platform_device *pdev, int state) |
441 | { | 442 | { |
442 | gpio_set_value(GPIO_PTB6, state); | 443 | gpio_set_value(GPIO_PTB6, state); |
@@ -474,7 +475,8 @@ static struct platform_device sdhi0_device = { | |||
474 | }, | 475 | }, |
475 | }; | 476 | }; |
476 | 477 | ||
477 | /* SHDI1 */ | 478 | #if !defined(CONFIG_MMC_SH_MMCIF) |
479 | /* SDHI1 */ | ||
478 | static void sdhi1_set_pwr(struct platform_device *pdev, int state) | 480 | static void sdhi1_set_pwr(struct platform_device *pdev, int state) |
479 | { | 481 | { |
480 | gpio_set_value(GPIO_PTB7, state); | 482 | gpio_set_value(GPIO_PTB7, state); |
@@ -511,6 +513,7 @@ static struct platform_device sdhi1_device = { | |||
511 | .hwblk_id = HWBLK_SDHI1, | 513 | .hwblk_id = HWBLK_SDHI1, |
512 | }, | 514 | }, |
513 | }; | 515 | }; |
516 | #endif /* CONFIG_MMC_SH_MMCIF */ | ||
514 | 517 | ||
515 | #else | 518 | #else |
516 | 519 | ||
@@ -720,7 +723,7 @@ static struct clk fsimckb_clk = { | |||
720 | .rate = 0, /* unknown */ | 723 | .rate = 0, /* unknown */ |
721 | }; | 724 | }; |
722 | 725 | ||
723 | struct sh_fsi_platform_info fsi_info = { | 726 | static struct sh_fsi_platform_info fsi_info = { |
724 | .portb_flags = SH_FSI_BRS_INV | | 727 | .portb_flags = SH_FSI_BRS_INV | |
725 | SH_FSI_OUT_SLAVE_MODE | | 728 | SH_FSI_OUT_SLAVE_MODE | |
726 | SH_FSI_IN_SLAVE_MODE | | 729 | SH_FSI_IN_SLAVE_MODE | |
@@ -777,7 +780,7 @@ static struct platform_device irda_device = { | |||
777 | #include <media/ak881x.h> | 780 | #include <media/ak881x.h> |
778 | #include <media/sh_vou.h> | 781 | #include <media/sh_vou.h> |
779 | 782 | ||
780 | struct ak881x_pdata ak881x_pdata = { | 783 | static struct ak881x_pdata ak881x_pdata = { |
781 | .flags = AK881X_IF_MODE_SLAVE, | 784 | .flags = AK881X_IF_MODE_SLAVE, |
782 | }; | 785 | }; |
783 | 786 | ||
@@ -786,7 +789,7 @@ static struct i2c_board_info ak8813 = { | |||
786 | .platform_data = &ak881x_pdata, | 789 | .platform_data = &ak881x_pdata, |
787 | }; | 790 | }; |
788 | 791 | ||
789 | struct sh_vou_pdata sh_vou_pdata = { | 792 | static struct sh_vou_pdata sh_vou_pdata = { |
790 | .bus_fmt = SH_VOU_BUS_8BIT, | 793 | .bus_fmt = SH_VOU_BUS_8BIT, |
791 | .flags = SH_VOU_HSYNC_LOW | SH_VOU_VSYNC_LOW, | 794 | .flags = SH_VOU_HSYNC_LOW | SH_VOU_VSYNC_LOW, |
792 | .board_info = &ak8813, | 795 | .board_info = &ak8813, |
@@ -819,6 +822,58 @@ static struct platform_device vou_device = { | |||
819 | }, | 822 | }, |
820 | }; | 823 | }; |
821 | 824 | ||
825 | #if defined(CONFIG_MMC_SH_MMCIF) | ||
826 | /* SH_MMCIF */ | ||
827 | static void mmcif_set_pwr(struct platform_device *pdev, int state) | ||
828 | { | ||
829 | gpio_set_value(GPIO_PTB7, state); | ||
830 | } | ||
831 | |||
832 | static void mmcif_down_pwr(struct platform_device *pdev) | ||
833 | { | ||
834 | gpio_set_value(GPIO_PTB7, 0); | ||
835 | } | ||
836 | |||
837 | static struct resource sh_mmcif_resources[] = { | ||
838 | [0] = { | ||
839 | .name = "SH_MMCIF", | ||
840 | .start = 0xA4CA0000, | ||
841 | .end = 0xA4CA00FF, | ||
842 | .flags = IORESOURCE_MEM, | ||
843 | }, | ||
844 | [1] = { | ||
845 | /* MMC2I */ | ||
846 | .start = 29, | ||
847 | .flags = IORESOURCE_IRQ, | ||
848 | }, | ||
849 | [2] = { | ||
850 | /* MMC3I */ | ||
851 | .start = 30, | ||
852 | .flags = IORESOURCE_IRQ, | ||
853 | }, | ||
854 | }; | ||
855 | |||
856 | static struct sh_mmcif_plat_data sh_mmcif_plat = { | ||
857 | .set_pwr = mmcif_set_pwr, | ||
858 | .down_pwr = mmcif_down_pwr, | ||
859 | .sup_pclk = 0, /* SH7724: Max Pclk/2 */ | ||
860 | .caps = MMC_CAP_4_BIT_DATA | | ||
861 | MMC_CAP_8_BIT_DATA | | ||
862 | MMC_CAP_NEEDS_POLL, | ||
863 | .ocr = MMC_VDD_32_33 | MMC_VDD_33_34, | ||
864 | }; | ||
865 | |||
866 | static struct platform_device sh_mmcif_device = { | ||
867 | .name = "sh_mmcif", | ||
868 | .id = 0, | ||
869 | .dev = { | ||
870 | .platform_data = &sh_mmcif_plat, | ||
871 | }, | ||
872 | .num_resources = ARRAY_SIZE(sh_mmcif_resources), | ||
873 | .resource = sh_mmcif_resources, | ||
874 | }; | ||
875 | #endif | ||
876 | |||
822 | static struct platform_device *ecovec_devices[] __initdata = { | 877 | static struct platform_device *ecovec_devices[] __initdata = { |
823 | &heartbeat_device, | 878 | &heartbeat_device, |
824 | &nor_flash_device, | 879 | &nor_flash_device, |
@@ -831,7 +886,9 @@ static struct platform_device *ecovec_devices[] __initdata = { | |||
831 | &keysc_device, | 886 | &keysc_device, |
832 | #ifdef CONFIG_MFD_SH_MOBILE_SDHI | 887 | #ifdef CONFIG_MFD_SH_MOBILE_SDHI |
833 | &sdhi0_device, | 888 | &sdhi0_device, |
889 | #if !defined(CONFIG_MMC_SH_MMCIF) | ||
834 | &sdhi1_device, | 890 | &sdhi1_device, |
891 | #endif | ||
835 | #else | 892 | #else |
836 | &msiof0_device, | 893 | &msiof0_device, |
837 | #endif | 894 | #endif |
@@ -841,6 +898,9 @@ static struct platform_device *ecovec_devices[] __initdata = { | |||
841 | &fsi_device, | 898 | &fsi_device, |
842 | &irda_device, | 899 | &irda_device, |
843 | &vou_device, | 900 | &vou_device, |
901 | #if defined(CONFIG_MMC_SH_MMCIF) | ||
902 | &sh_mmcif_device, | ||
903 | #endif | ||
844 | }; | 904 | }; |
845 | 905 | ||
846 | #ifdef CONFIG_I2C | 906 | #ifdef CONFIG_I2C |
@@ -1134,6 +1194,7 @@ static int __init arch_setup(void) | |||
1134 | gpio_request(GPIO_PTB6, NULL); | 1194 | gpio_request(GPIO_PTB6, NULL); |
1135 | gpio_direction_output(GPIO_PTB6, 0); | 1195 | gpio_direction_output(GPIO_PTB6, 0); |
1136 | 1196 | ||
1197 | #if !defined(CONFIG_MMC_SH_MMCIF) | ||
1137 | /* enable SDHI1 on CN12 (needs DS2.6,7 set to ON,OFF) */ | 1198 | /* enable SDHI1 on CN12 (needs DS2.6,7 set to ON,OFF) */ |
1138 | gpio_request(GPIO_FN_SDHI1CD, NULL); | 1199 | gpio_request(GPIO_FN_SDHI1CD, NULL); |
1139 | gpio_request(GPIO_FN_SDHI1WP, NULL); | 1200 | gpio_request(GPIO_FN_SDHI1WP, NULL); |
@@ -1148,6 +1209,7 @@ static int __init arch_setup(void) | |||
1148 | 1209 | ||
1149 | /* I/O buffer drive ability is high for SDHI1 */ | 1210 | /* I/O buffer drive ability is high for SDHI1 */ |
1150 | __raw_writew((__raw_readw(IODRIVEA) & ~0x3000) | 0x2000 , IODRIVEA); | 1211 | __raw_writew((__raw_readw(IODRIVEA) & ~0x3000) | 0x2000 , IODRIVEA); |
1212 | #endif /* CONFIG_MMC_SH_MMCIF */ | ||
1151 | #else | 1213 | #else |
1152 | /* enable MSIOF0 on CN11 (needs DS2.4 set to OFF) */ | 1214 | /* enable MSIOF0 on CN11 (needs DS2.4 set to OFF) */ |
1153 | gpio_request(GPIO_FN_MSIOF0_TXD, NULL); | 1215 | gpio_request(GPIO_FN_MSIOF0_TXD, NULL); |
@@ -1223,6 +1285,25 @@ static int __init arch_setup(void) | |||
1223 | gpio_request(GPIO_PTU5, NULL); | 1285 | gpio_request(GPIO_PTU5, NULL); |
1224 | gpio_direction_output(GPIO_PTU5, 0); | 1286 | gpio_direction_output(GPIO_PTU5, 0); |
1225 | 1287 | ||
1288 | #if defined(CONFIG_MMC_SH_MMCIF) | ||
1289 | /* enable MMCIF (needs DS2.6,7 set to OFF,ON) */ | ||
1290 | gpio_request(GPIO_FN_MMC_D7, NULL); | ||
1291 | gpio_request(GPIO_FN_MMC_D6, NULL); | ||
1292 | gpio_request(GPIO_FN_MMC_D5, NULL); | ||
1293 | gpio_request(GPIO_FN_MMC_D4, NULL); | ||
1294 | gpio_request(GPIO_FN_MMC_D3, NULL); | ||
1295 | gpio_request(GPIO_FN_MMC_D2, NULL); | ||
1296 | gpio_request(GPIO_FN_MMC_D1, NULL); | ||
1297 | gpio_request(GPIO_FN_MMC_D0, NULL); | ||
1298 | gpio_request(GPIO_FN_MMC_CLK, NULL); | ||
1299 | gpio_request(GPIO_FN_MMC_CMD, NULL); | ||
1300 | gpio_request(GPIO_PTB7, NULL); | ||
1301 | gpio_direction_output(GPIO_PTB7, 0); | ||
1302 | |||
1303 | /* I/O buffer drive ability is high for MMCIF */ | ||
1304 | __raw_writew((__raw_readw(IODRIVEA) & ~0x3000) | 0x2000 , IODRIVEA); | ||
1305 | #endif | ||
1306 | |||
1226 | /* enable I2C device */ | 1307 | /* enable I2C device */ |
1227 | i2c_register_board_info(0, i2c0_devices, | 1308 | i2c_register_board_info(0, i2c0_devices, |
1228 | ARRAY_SIZE(i2c0_devices)); | 1309 | ARRAY_SIZE(i2c0_devices)); |