aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRod Whitby <rod@whitby.id.au>2008-02-01 18:04:05 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-02-04 08:15:26 -0500
commitb7edc84a9619eb2c8bfb5265d4079da9c70ad270 (patch)
treecacd9ffa7a99d6d75ce42f0b6edcd84c90fdf9e2 /arch
parent1208ebf25b654a48f075c191de1d6410af7062b0 (diff)
[ARM] 4806/1: ixp4xx: Ethernet support for the nslu2 and nas100d boards
Enables the new ixp4xx qmgr and npe drivers in ixp4xx_defconfig. Sets up the corresponding platform data for the nslu2 and nas100d boards, and reads the ethernet MAC address from the internal flash. Tested on both little-endian and big-endian kernels. Tested-by: Tom King <tom@websb.net> Signed-off-by: Rod Whitby <rod@whitby.id.au> Signed-off-by: Michael Westerhof <mwester@dls.net> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/configs/ixp4xx_defconfig8
-rw-r--r--arch/arm/mach-ixp4xx/nas100d-setup.c43
-rw-r--r--arch/arm/mach-ixp4xx/nslu2-setup.c44
3 files changed, 93 insertions, 2 deletions
diff --git a/arch/arm/configs/ixp4xx_defconfig b/arch/arm/configs/ixp4xx_defconfig
index 77fe3b005141..efa0485d2f7e 100644
--- a/arch/arm/configs/ixp4xx_defconfig
+++ b/arch/arm/configs/ixp4xx_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.24-rc8 3# Linux kernel version: 2.6.24
4# Wed Jan 23 17:26:16 2008 4# Sun Jan 27 07:33:38 2008
5# 5#
6CONFIG_ARM=y 6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y 7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -174,6 +174,8 @@ CONFIG_MACH_GTWX5715=y
174# 174#
175CONFIG_DMABOUNCE=y 175CONFIG_DMABOUNCE=y
176# CONFIG_IXP4XX_INDIRECT_PCI is not set 176# CONFIG_IXP4XX_INDIRECT_PCI is not set
177CONFIG_IXP4XX_QMGR=y
178CONFIG_IXP4XX_NPE=y
177 179
178# 180#
179# Boot options 181# Boot options
@@ -832,6 +834,7 @@ CONFIG_DUMMY=y
832# CONFIG_PHYLIB is not set 834# CONFIG_PHYLIB is not set
833CONFIG_NET_ETHERNET=y 835CONFIG_NET_ETHERNET=y
834CONFIG_MII=y 836CONFIG_MII=y
837CONFIG_IXP4XX_ETH=y
835# CONFIG_AX88796 is not set 838# CONFIG_AX88796 is not set
836# CONFIG_HAPPYMEAL is not set 839# CONFIG_HAPPYMEAL is not set
837# CONFIG_SUNGEM is not set 840# CONFIG_SUNGEM is not set
@@ -925,6 +928,7 @@ CONFIG_HDLC_X25=m
925# CONFIG_PC300TOO is not set 928# CONFIG_PC300TOO is not set
926# CONFIG_FARSYNC is not set 929# CONFIG_FARSYNC is not set
927# CONFIG_DSCC4 is not set 930# CONFIG_DSCC4 is not set
931# CONFIG_IXP4XX_HSS is not set
928CONFIG_DLCI=m 932CONFIG_DLCI=m
929CONFIG_DLCI_MAX=8 933CONFIG_DLCI_MAX=8
930CONFIG_WAN_ROUTER_DRIVERS=m 934CONFIG_WAN_ROUTER_DRIVERS=m
diff --git a/arch/arm/mach-ixp4xx/nas100d-setup.c b/arch/arm/mach-ixp4xx/nas100d-setup.c
index 5801579ae959..a432226b2050 100644
--- a/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ b/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -12,6 +12,7 @@
12 * 12 *
13 */ 13 */
14 14
15#include <linux/if_ether.h>
15#include <linux/kernel.h> 16#include <linux/kernel.h>
16#include <linux/serial.h> 17#include <linux/serial.h>
17#include <linux/serial_8250.h> 18#include <linux/serial_8250.h>
@@ -22,6 +23,7 @@
22#include <asm/mach-types.h> 23#include <asm/mach-types.h>
23#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
24#include <asm/mach/flash.h> 25#include <asm/mach/flash.h>
26#include <asm/io.h>
25 27
26static struct flash_platform_data nas100d_flash_data = { 28static struct flash_platform_data nas100d_flash_data = {
27 .map_name = "cfi_probe", 29 .map_name = "cfi_probe",
@@ -131,10 +133,28 @@ static struct platform_device nas100d_uart = {
131 .resource = nas100d_uart_resources, 133 .resource = nas100d_uart_resources,
132}; 134};
133 135
136/* Built-in 10/100 Ethernet MAC interfaces */
137static struct eth_plat_info nas100d_plat_eth[] = {
138 {
139 .phy = 0,
140 .rxq = 3,
141 .txreadyq = 20,
142 }
143};
144
145static struct platform_device nas100d_eth[] = {
146 {
147 .name = "ixp4xx_eth",
148 .id = IXP4XX_ETH_NPEB,
149 .dev.platform_data = nas100d_plat_eth,
150 }
151};
152
134static struct platform_device *nas100d_devices[] __initdata = { 153static struct platform_device *nas100d_devices[] __initdata = {
135 &nas100d_i2c_gpio, 154 &nas100d_i2c_gpio,
136 &nas100d_flash, 155 &nas100d_flash,
137 &nas100d_leds, 156 &nas100d_leds,
157 &nas100d_eth[0],
138}; 158};
139 159
140static void nas100d_power_off(void) 160static void nas100d_power_off(void)
@@ -150,6 +170,10 @@ static void nas100d_power_off(void)
150 170
151static void __init nas100d_init(void) 171static void __init nas100d_init(void)
152{ 172{
173 DECLARE_MAC_BUF(mac_buf);
174 uint8_t __iomem *f;
175 int i;
176
153 ixp4xx_sys_init(); 177 ixp4xx_sys_init();
154 178
155 /* gpio 14 and 15 are _not_ clocks */ 179 /* gpio 14 and 15 are _not_ clocks */
@@ -172,6 +196,25 @@ static void __init nas100d_init(void)
172 (void)platform_device_register(&nas100d_uart); 196 (void)platform_device_register(&nas100d_uart);
173 197
174 platform_add_devices(nas100d_devices, ARRAY_SIZE(nas100d_devices)); 198 platform_add_devices(nas100d_devices, ARRAY_SIZE(nas100d_devices));
199
200 /*
201 * Map in a portion of the flash and read the MAC address.
202 * Since it is stored in BE in the flash itself, we need to
203 * byteswap it if we're in LE mode.
204 */
205 f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x1000000);
206 if (f) {
207 for (i = 0; i < 6; i++)
208#ifdef __ARMEB__
209 nas100d_plat_eth[0].hwaddr[i] = readb(f + 0xFC0FD8 + i);
210#else
211 nas100d_plat_eth[0].hwaddr[i] = readb(f + 0xFC0FD8 + (i^3));
212#endif
213 iounmap(f);
214 }
215 printk(KERN_INFO "NAS100D: Using MAC address %s for port 0\n",
216 print_mac(mac_buf, nas100d_plat_eth[0].hwaddr));
217
175} 218}
176 219
177MACHINE_START(NAS100D, "Iomega NAS 100d") 220MACHINE_START(NAS100D, "Iomega NAS 100d")
diff --git a/arch/arm/mach-ixp4xx/nslu2-setup.c b/arch/arm/mach-ixp4xx/nslu2-setup.c
index 41d55c84164a..fd9ec17c8b86 100644
--- a/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ b/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -14,6 +14,7 @@
14 * Changed to conform to new style __init ixdp425 kas11 10/22/04 14 * Changed to conform to new style __init ixdp425 kas11 10/22/04
15 */ 15 */
16 16
17#include <linux/if_ether.h>
17#include <linux/kernel.h> 18#include <linux/kernel.h>
18#include <linux/serial.h> 19#include <linux/serial.h>
19#include <linux/serial_8250.h> 20#include <linux/serial_8250.h>
@@ -25,6 +26,7 @@
25#include <asm/mach/arch.h> 26#include <asm/mach/arch.h>
26#include <asm/mach/flash.h> 27#include <asm/mach/flash.h>
27#include <asm/mach/time.h> 28#include <asm/mach/time.h>
29#include <asm/io.h>
28 30
29static struct flash_platform_data nslu2_flash_data = { 31static struct flash_platform_data nslu2_flash_data = {
30 .map_name = "cfi_probe", 32 .map_name = "cfi_probe",
@@ -143,11 +145,29 @@ static struct platform_device nslu2_uart = {
143 .resource = nslu2_uart_resources, 145 .resource = nslu2_uart_resources,
144}; 146};
145 147
148/* Built-in 10/100 Ethernet MAC interfaces */
149static struct eth_plat_info nslu2_plat_eth[] = {
150 {
151 .phy = 1,
152 .rxq = 3,
153 .txreadyq = 20,
154 }
155};
156
157static struct platform_device nslu2_eth[] = {
158 {
159 .name = "ixp4xx_eth",
160 .id = IXP4XX_ETH_NPEB,
161 .dev.platform_data = nslu2_plat_eth,
162 }
163};
164
146static struct platform_device *nslu2_devices[] __initdata = { 165static struct platform_device *nslu2_devices[] __initdata = {
147 &nslu2_i2c_gpio, 166 &nslu2_i2c_gpio,
148 &nslu2_flash, 167 &nslu2_flash,
149 &nslu2_beeper, 168 &nslu2_beeper,
150 &nslu2_leds, 169 &nslu2_leds,
170 &nslu2_eth[0],
151}; 171};
152 172
153static void nslu2_power_off(void) 173static void nslu2_power_off(void)
@@ -176,6 +196,10 @@ static struct sys_timer nslu2_timer = {
176 196
177static void __init nslu2_init(void) 197static void __init nslu2_init(void)
178{ 198{
199 DECLARE_MAC_BUF(mac_buf);
200 uint8_t __iomem *f;
201 int i;
202
179 ixp4xx_sys_init(); 203 ixp4xx_sys_init();
180 204
181 nslu2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); 205 nslu2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
@@ -195,6 +219,26 @@ static void __init nslu2_init(void)
195 (void)platform_device_register(&nslu2_uart); 219 (void)platform_device_register(&nslu2_uart);
196 220
197 platform_add_devices(nslu2_devices, ARRAY_SIZE(nslu2_devices)); 221 platform_add_devices(nslu2_devices, ARRAY_SIZE(nslu2_devices));
222
223
224 /*
225 * Map in a portion of the flash and read the MAC address.
226 * Since it is stored in BE in the flash itself, we need to
227 * byteswap it if we're in LE mode.
228 */
229 f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x40000);
230 if (f) {
231 for (i = 0; i < 6; i++)
232#ifdef __ARMEB__
233 nslu2_plat_eth[0].hwaddr[i] = readb(f + 0x3FFB0 + i);
234#else
235 nslu2_plat_eth[0].hwaddr[i] = readb(f + 0x3FFB0 + (i^3));
236#endif
237 iounmap(f);
238 }
239 printk(KERN_INFO "NSLU2: Using MAC address %s for port 0\n",
240 print_mac(mac_buf, nslu2_plat_eth[0].hwaddr));
241
198} 242}
199 243
200MACHINE_START(NSLU2, "Linksys NSLU2") 244MACHINE_START(NSLU2, "Linksys NSLU2")