diff options
author | Kuninori Morimoto <morimoto.kuninori@renesas.com> | 2009-08-26 07:04:26 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-08-26 22:36:09 -0400 |
commit | 35a35408914bcd22dbaeea710ec1e711b673b59e (patch) | |
tree | 136e2eaccb099e24d38b9030c6e99513688b9807 /arch/sh | |
parent | b7056bc1943ec85084450e2f105650f837ae5cfc (diff) |
sh: Add SH-ETH support for EcoVec24
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/boards/mach-ecovec24/setup.c | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index e555b9282498..8c0c8453d089 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c | |||
@@ -14,8 +14,10 @@ | |||
14 | #include <linux/mtd/physmap.h> | 14 | #include <linux/mtd/physmap.h> |
15 | #include <linux/gpio.h> | 15 | #include <linux/gpio.h> |
16 | #include <linux/interrupt.h> | 16 | #include <linux/interrupt.h> |
17 | #include <asm/io.h> | 17 | #include <linux/io.h> |
18 | #include <linux/delay.h> | ||
18 | #include <asm/heartbeat.h> | 19 | #include <asm/heartbeat.h> |
20 | #include <asm/sh_eth.h> | ||
19 | #include <cpu/sh7724.h> | 21 | #include <cpu/sh7724.h> |
20 | 22 | ||
21 | /* | 23 | /* |
@@ -93,9 +95,41 @@ static struct platform_device nor_flash_device = { | |||
93 | }, | 95 | }, |
94 | }; | 96 | }; |
95 | 97 | ||
98 | /* SH Eth */ | ||
99 | #define SH_ETH_ADDR (0xA4600000) | ||
100 | #define SH_ETH_MAHR (SH_ETH_ADDR + 0x1C0) | ||
101 | #define SH_ETH_MALR (SH_ETH_ADDR + 0x1C8) | ||
102 | static struct resource sh_eth_resources[] = { | ||
103 | [0] = { | ||
104 | .start = SH_ETH_ADDR, | ||
105 | .end = SH_ETH_ADDR + 0x1FC, | ||
106 | .flags = IORESOURCE_MEM, | ||
107 | }, | ||
108 | [1] = { | ||
109 | .start = 91, | ||
110 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | ||
111 | }, | ||
112 | }; | ||
113 | |||
114 | struct sh_eth_plat_data sh_eth_plat = { | ||
115 | .phy = 0x1f, /* SMSC LAN8700 */ | ||
116 | .edmac_endian = EDMAC_LITTLE_ENDIAN, | ||
117 | }; | ||
118 | |||
119 | static struct platform_device sh_eth_device = { | ||
120 | .name = "sh-eth", | ||
121 | .id = 0, | ||
122 | .dev = { | ||
123 | .platform_data = &sh_eth_plat, | ||
124 | }, | ||
125 | .num_resources = ARRAY_SIZE(sh_eth_resources), | ||
126 | .resource = sh_eth_resources, | ||
127 | }; | ||
128 | |||
96 | static struct platform_device *ecovec_devices[] __initdata = { | 129 | static struct platform_device *ecovec_devices[] __initdata = { |
97 | &heartbeat_device, | 130 | &heartbeat_device, |
98 | &nor_flash_device, | 131 | &nor_flash_device, |
132 | &sh_eth_device, | ||
99 | }; | 133 | }; |
100 | 134 | ||
101 | static int __init devices_setup(void) | 135 | static int __init devices_setup(void) |
@@ -114,6 +148,23 @@ static int __init devices_setup(void) | |||
114 | gpio_direction_output(GPIO_PTG2, 0); | 148 | gpio_direction_output(GPIO_PTG2, 0); |
115 | gpio_direction_output(GPIO_PTG3, 0); | 149 | gpio_direction_output(GPIO_PTG3, 0); |
116 | 150 | ||
151 | /* enable SH-Eth */ | ||
152 | gpio_request(GPIO_PTA1, NULL); | ||
153 | gpio_direction_output(GPIO_PTA1, 1); | ||
154 | mdelay(20); | ||
155 | |||
156 | gpio_request(GPIO_FN_RMII_RXD0, NULL); | ||
157 | gpio_request(GPIO_FN_RMII_RXD1, NULL); | ||
158 | gpio_request(GPIO_FN_RMII_TXD0, NULL); | ||
159 | gpio_request(GPIO_FN_RMII_TXD1, NULL); | ||
160 | gpio_request(GPIO_FN_RMII_REF_CLK, NULL); | ||
161 | gpio_request(GPIO_FN_RMII_TX_EN, NULL); | ||
162 | gpio_request(GPIO_FN_RMII_RX_ER, NULL); | ||
163 | gpio_request(GPIO_FN_RMII_CRS_DV, NULL); | ||
164 | gpio_request(GPIO_FN_MDIO, NULL); | ||
165 | gpio_request(GPIO_FN_MDC, NULL); | ||
166 | gpio_request(GPIO_FN_LNKSTA, NULL); | ||
167 | |||
117 | return platform_add_devices(ecovec_devices, | 168 | return platform_add_devices(ecovec_devices, |
118 | ARRAY_SIZE(ecovec_devices)); | 169 | ARRAY_SIZE(ecovec_devices)); |
119 | } | 170 | } |