diff options
Diffstat (limited to 'arch/sh/boards/mach-ecovec24/setup.c')
-rw-r--r-- | arch/sh/boards/mach-ecovec24/setup.c | 87 |
1 files changed, 65 insertions, 22 deletions
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index 5c246289b4f0..39ed8722d11a 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c | |||
@@ -64,18 +64,16 @@ | |||
64 | 64 | ||
65 | /* Heartbeat */ | 65 | /* Heartbeat */ |
66 | static unsigned char led_pos[] = { 0, 1, 2, 3 }; | 66 | static unsigned char led_pos[] = { 0, 1, 2, 3 }; |
67 | |||
67 | static struct heartbeat_data heartbeat_data = { | 68 | static struct heartbeat_data heartbeat_data = { |
68 | .regsize = 8, | ||
69 | .nr_bits = 4, | 69 | .nr_bits = 4, |
70 | .bit_pos = led_pos, | 70 | .bit_pos = led_pos, |
71 | }; | 71 | }; |
72 | 72 | ||
73 | static struct resource heartbeat_resources[] = { | 73 | static struct resource heartbeat_resource = { |
74 | [0] = { | 74 | .start = 0xA405012C, /* PTG */ |
75 | .start = 0xA405012C, /* PTG */ | 75 | .end = 0xA405012E - 1, |
76 | .end = 0xA405012E - 1, | 76 | .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT, |
77 | .flags = IORESOURCE_MEM, | ||
78 | }, | ||
79 | }; | 77 | }; |
80 | 78 | ||
81 | static struct platform_device heartbeat_device = { | 79 | static struct platform_device heartbeat_device = { |
@@ -84,8 +82,8 @@ static struct platform_device heartbeat_device = { | |||
84 | .dev = { | 82 | .dev = { |
85 | .platform_data = &heartbeat_data, | 83 | .platform_data = &heartbeat_data, |
86 | }, | 84 | }, |
87 | .num_resources = ARRAY_SIZE(heartbeat_resources), | 85 | .num_resources = 1, |
88 | .resource = heartbeat_resources, | 86 | .resource = &heartbeat_resource, |
89 | }; | 87 | }; |
90 | 88 | ||
91 | /* MTD */ | 89 | /* MTD */ |
@@ -455,7 +453,7 @@ static struct resource sdhi0_resources[] = { | |||
455 | .flags = IORESOURCE_MEM, | 453 | .flags = IORESOURCE_MEM, |
456 | }, | 454 | }, |
457 | [1] = { | 455 | [1] = { |
458 | .start = 101, | 456 | .start = 100, |
459 | .flags = IORESOURCE_IRQ, | 457 | .flags = IORESOURCE_IRQ, |
460 | }, | 458 | }, |
461 | }; | 459 | }; |
@@ -491,7 +489,7 @@ static struct resource sdhi1_resources[] = { | |||
491 | .flags = IORESOURCE_MEM, | 489 | .flags = IORESOURCE_MEM, |
492 | }, | 490 | }, |
493 | [1] = { | 491 | [1] = { |
494 | .start = 24, | 492 | .start = 23, |
495 | .flags = IORESOURCE_IRQ, | 493 | .flags = IORESOURCE_IRQ, |
496 | }, | 494 | }, |
497 | }; | 495 | }; |
@@ -698,13 +696,13 @@ static struct platform_device camera_devices[] = { | |||
698 | #define FCLKBCR 0xa415000c | 696 | #define FCLKBCR 0xa415000c |
699 | static void fsimck_init(struct clk *clk) | 697 | static void fsimck_init(struct clk *clk) |
700 | { | 698 | { |
701 | u32 status = ctrl_inl(clk->enable_reg); | 699 | u32 status = __raw_readl(clk->enable_reg); |
702 | 700 | ||
703 | /* use external clock */ | 701 | /* use external clock */ |
704 | status &= ~0x000000ff; | 702 | status &= ~0x000000ff; |
705 | status |= 0x00000080; | 703 | status |= 0x00000080; |
706 | 704 | ||
707 | ctrl_outl(status, clk->enable_reg); | 705 | __raw_writel(status, clk->enable_reg); |
708 | } | 706 | } |
709 | 707 | ||
710 | static struct clk_ops fsimck_clk_ops = { | 708 | static struct clk_ops fsimck_clk_ops = { |
@@ -753,6 +751,26 @@ static struct platform_device fsi_device = { | |||
753 | }, | 751 | }, |
754 | }; | 752 | }; |
755 | 753 | ||
754 | /* IrDA */ | ||
755 | static struct resource irda_resources[] = { | ||
756 | [0] = { | ||
757 | .name = "IrDA", | ||
758 | .start = 0xA45D0000, | ||
759 | .end = 0xA45D0049, | ||
760 | .flags = IORESOURCE_MEM, | ||
761 | }, | ||
762 | [1] = { | ||
763 | .start = 20, | ||
764 | .flags = IORESOURCE_IRQ, | ||
765 | }, | ||
766 | }; | ||
767 | |||
768 | static struct platform_device irda_device = { | ||
769 | .name = "sh_sir", | ||
770 | .num_resources = ARRAY_SIZE(irda_resources), | ||
771 | .resource = irda_resources, | ||
772 | }; | ||
773 | |||
756 | static struct platform_device *ecovec_devices[] __initdata = { | 774 | static struct platform_device *ecovec_devices[] __initdata = { |
757 | &heartbeat_device, | 775 | &heartbeat_device, |
758 | &nor_flash_device, | 776 | &nor_flash_device, |
@@ -773,8 +791,10 @@ static struct platform_device *ecovec_devices[] __initdata = { | |||
773 | &camera_devices[1], | 791 | &camera_devices[1], |
774 | &camera_devices[2], | 792 | &camera_devices[2], |
775 | &fsi_device, | 793 | &fsi_device, |
794 | &irda_device, | ||
776 | }; | 795 | }; |
777 | 796 | ||
797 | #ifdef CONFIG_I2C | ||
778 | #define EEPROM_ADDR 0x50 | 798 | #define EEPROM_ADDR 0x50 |
779 | static u8 mac_read(struct i2c_adapter *a, u8 command) | 799 | static u8 mac_read(struct i2c_adapter *a, u8 command) |
780 | { | 800 | { |
@@ -817,6 +837,12 @@ static void __init sh_eth_init(struct sh_eth_plat_data *pd) | |||
817 | msleep(10); | 837 | msleep(10); |
818 | } | 838 | } |
819 | } | 839 | } |
840 | #else | ||
841 | static void __init sh_eth_init(struct sh_eth_plat_data *pd) | ||
842 | { | ||
843 | pr_err("unable to read sh_eth MAC address\n"); | ||
844 | } | ||
845 | #endif | ||
820 | 846 | ||
821 | #define PORT_HIZA 0xA4050158 | 847 | #define PORT_HIZA 0xA4050158 |
822 | #define IODRIVEA 0xA405018A | 848 | #define IODRIVEA 0xA405018A |
@@ -831,7 +857,8 @@ static int __init arch_setup(void) | |||
831 | struct clk *clk; | 857 | struct clk *clk; |
832 | 858 | ||
833 | /* register board specific self-refresh code */ | 859 | /* register board specific self-refresh code */ |
834 | sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF, | 860 | sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF | |
861 | SUSP_SH_RSTANDBY, | ||
835 | &ecovec24_sdram_enter_start, | 862 | &ecovec24_sdram_enter_start, |
836 | &ecovec24_sdram_enter_end, | 863 | &ecovec24_sdram_enter_end, |
837 | &ecovec24_sdram_leave_start, | 864 | &ecovec24_sdram_leave_start, |
@@ -855,7 +882,7 @@ static int __init arch_setup(void) | |||
855 | gpio_direction_output(GPIO_PTG1, 0); | 882 | gpio_direction_output(GPIO_PTG1, 0); |
856 | gpio_direction_output(GPIO_PTG2, 0); | 883 | gpio_direction_output(GPIO_PTG2, 0); |
857 | gpio_direction_output(GPIO_PTG3, 0); | 884 | gpio_direction_output(GPIO_PTG3, 0); |
858 | ctrl_outw((ctrl_inw(PORT_HIZA) & ~(0x1 << 1)) , PORT_HIZA); | 885 | __raw_writew((__raw_readw(PORT_HIZA) & ~(0x1 << 1)) , PORT_HIZA); |
859 | 886 | ||
860 | /* enable SH-Eth */ | 887 | /* enable SH-Eth */ |
861 | gpio_request(GPIO_PTA1, NULL); | 888 | gpio_request(GPIO_PTA1, NULL); |
@@ -875,16 +902,16 @@ static int __init arch_setup(void) | |||
875 | gpio_request(GPIO_FN_LNKSTA, NULL); | 902 | gpio_request(GPIO_FN_LNKSTA, NULL); |
876 | 903 | ||
877 | /* enable USB */ | 904 | /* enable USB */ |
878 | ctrl_outw(0x0000, 0xA4D80000); | 905 | __raw_writew(0x0000, 0xA4D80000); |
879 | ctrl_outw(0x0000, 0xA4D90000); | 906 | __raw_writew(0x0000, 0xA4D90000); |
880 | gpio_request(GPIO_PTB3, NULL); | 907 | gpio_request(GPIO_PTB3, NULL); |
881 | gpio_request(GPIO_PTB4, NULL); | 908 | gpio_request(GPIO_PTB4, NULL); |
882 | gpio_request(GPIO_PTB5, NULL); | 909 | gpio_request(GPIO_PTB5, NULL); |
883 | gpio_direction_input(GPIO_PTB3); | 910 | gpio_direction_input(GPIO_PTB3); |
884 | gpio_direction_output(GPIO_PTB4, 0); | 911 | gpio_direction_output(GPIO_PTB4, 0); |
885 | gpio_direction_output(GPIO_PTB5, 0); | 912 | gpio_direction_output(GPIO_PTB5, 0); |
886 | ctrl_outw(0x0600, 0xa40501d4); | 913 | __raw_writew(0x0600, 0xa40501d4); |
887 | ctrl_outw(0x0600, 0xa4050192); | 914 | __raw_writew(0x0600, 0xa4050192); |
888 | 915 | ||
889 | if (gpio_get_value(GPIO_PTB3)) { | 916 | if (gpio_get_value(GPIO_PTB3)) { |
890 | printk(KERN_INFO "USB1 function is selected\n"); | 917 | printk(KERN_INFO "USB1 function is selected\n"); |
@@ -925,7 +952,7 @@ static int __init arch_setup(void) | |||
925 | gpio_request(GPIO_FN_LCDVSYN, NULL); | 952 | gpio_request(GPIO_FN_LCDVSYN, NULL); |
926 | gpio_request(GPIO_FN_LCDDON, NULL); | 953 | gpio_request(GPIO_FN_LCDDON, NULL); |
927 | gpio_request(GPIO_FN_LCDLCLK, NULL); | 954 | gpio_request(GPIO_FN_LCDLCLK, NULL); |
928 | ctrl_outw((ctrl_inw(PORT_HIZA) & ~0x0001), PORT_HIZA); | 955 | __raw_writew((__raw_readw(PORT_HIZA) & ~0x0001), PORT_HIZA); |
929 | 956 | ||
930 | gpio_request(GPIO_PTE6, NULL); | 957 | gpio_request(GPIO_PTE6, NULL); |
931 | gpio_request(GPIO_PTU1, NULL); | 958 | gpio_request(GPIO_PTU1, NULL); |
@@ -937,7 +964,7 @@ static int __init arch_setup(void) | |||
937 | gpio_direction_output(GPIO_PTA2, 0); | 964 | gpio_direction_output(GPIO_PTA2, 0); |
938 | 965 | ||
939 | /* I/O buffer drive ability is high */ | 966 | /* I/O buffer drive ability is high */ |
940 | ctrl_outw((ctrl_inw(IODRIVEA) & ~0x00c0) | 0x0080 , IODRIVEA); | 967 | __raw_writew((__raw_readw(IODRIVEA) & ~0x00c0) | 0x0080 , IODRIVEA); |
941 | 968 | ||
942 | if (gpio_get_value(GPIO_PTE6)) { | 969 | if (gpio_get_value(GPIO_PTE6)) { |
943 | /* DVI */ | 970 | /* DVI */ |
@@ -1069,7 +1096,7 @@ static int __init arch_setup(void) | |||
1069 | gpio_direction_output(GPIO_PTB7, 0); | 1096 | gpio_direction_output(GPIO_PTB7, 0); |
1070 | 1097 | ||
1071 | /* I/O buffer drive ability is high for SDHI1 */ | 1098 | /* I/O buffer drive ability is high for SDHI1 */ |
1072 | ctrl_outw((ctrl_inw(IODRIVEA) & ~0x3000) | 0x2000 , IODRIVEA); | 1099 | __raw_writew((__raw_readw(IODRIVEA) & ~0x3000) | 0x2000 , IODRIVEA); |
1073 | #else | 1100 | #else |
1074 | /* enable MSIOF0 on CN11 (needs DS2.4 set to OFF) */ | 1101 | /* enable MSIOF0 on CN11 (needs DS2.4 set to OFF) */ |
1075 | gpio_request(GPIO_FN_MSIOF0_TXD, NULL); | 1102 | gpio_request(GPIO_FN_MSIOF0_TXD, NULL); |
@@ -1107,6 +1134,11 @@ static int __init arch_setup(void) | |||
1107 | gpio_request(GPIO_FN_FSIOBLRCK, NULL); | 1134 | gpio_request(GPIO_FN_FSIOBLRCK, NULL); |
1108 | gpio_request(GPIO_FN_CLKAUDIOBO, NULL); | 1135 | gpio_request(GPIO_FN_CLKAUDIOBO, NULL); |
1109 | 1136 | ||
1137 | /* set SPU2 clock to 83.4 MHz */ | ||
1138 | clk = clk_get(NULL, "spu_clk"); | ||
1139 | clk_set_rate(clk, clk_round_rate(clk, 83333333)); | ||
1140 | clk_put(clk); | ||
1141 | |||
1110 | /* change parent of FSI B */ | 1142 | /* change parent of FSI B */ |
1111 | clk = clk_get(NULL, "fsib_clk"); | 1143 | clk = clk_get(NULL, "fsib_clk"); |
1112 | clk_register(&fsimckb_clk); | 1144 | clk_register(&fsimckb_clk); |
@@ -1123,6 +1155,17 @@ static int __init arch_setup(void) | |||
1123 | gpio_request(GPIO_FN_INTC_IRQ1, NULL); | 1155 | gpio_request(GPIO_FN_INTC_IRQ1, NULL); |
1124 | gpio_direction_input(GPIO_FN_INTC_IRQ1); | 1156 | gpio_direction_input(GPIO_FN_INTC_IRQ1); |
1125 | 1157 | ||
1158 | /* set VPU clock to 166 MHz */ | ||
1159 | clk = clk_get(NULL, "vpu_clk"); | ||
1160 | clk_set_rate(clk, clk_round_rate(clk, 166000000)); | ||
1161 | clk_put(clk); | ||
1162 | |||
1163 | /* enable IrDA */ | ||
1164 | gpio_request(GPIO_FN_IRDA_OUT, NULL); | ||
1165 | gpio_request(GPIO_FN_IRDA_IN, NULL); | ||
1166 | gpio_request(GPIO_PTU5, NULL); | ||
1167 | gpio_direction_output(GPIO_PTU5, 0); | ||
1168 | |||
1126 | /* enable I2C device */ | 1169 | /* enable I2C device */ |
1127 | i2c_register_board_info(0, i2c0_devices, | 1170 | i2c_register_board_info(0, i2c0_devices, |
1128 | ARRAY_SIZE(i2c0_devices)); | 1171 | ARRAY_SIZE(i2c0_devices)); |