aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/boards')
-rw-r--r--arch/sh/boards/mach-ecovec24/setup.c53
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 e555b928249..8c0c8453d08 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)
102static 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
114struct sh_eth_plat_data sh_eth_plat = {
115 .phy = 0x1f, /* SMSC LAN8700 */
116 .edmac_endian = EDMAC_LITTLE_ENDIAN,
117};
118
119static 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
96static struct platform_device *ecovec_devices[] __initdata = { 129static 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
101static int __init devices_setup(void) 135static 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}