2 arch/arm/mach-ixp4xx/nslu2-setup.c | 27 +++++++++++++++++++++++++++
3 1 file changed, 27 insertions(+)
5 Index: linux-2.6.19/arch/arm/mach-ixp4xx/nslu2-setup.c
6 ===================================================================
7 --- linux-2.6.19.orig/arch/arm/mach-ixp4xx/nslu2-setup.c
8 +++ linux-2.6.19/arch/arm/mach-ixp4xx/nslu2-setup.c
10 #include <linux/serial.h>
11 #include <linux/serial_8250.h>
12 #include <linux/leds.h>
13 +#include <linux/mtd/mtd.h>
15 #include <asm/mach-types.h>
16 #include <asm/mach/arch.h>
17 @@ -180,6 +181,30 @@ static struct platform_device *nslu2_dev
21 +static void nslu2_flash_add(struct mtd_info *mtd)
23 + if (strcmp(mtd->name, "RedBoot") == 0) {
27 + if (mtd->read(mtd, 0x3FFB0, 6, &retlen, mac) == 0 && retlen == 6) {
28 + printk(KERN_INFO "nslu2 mac: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
29 + mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
30 + memcpy(plat_mac0.hwaddr, mac, 6);
32 + printk(KERN_ERR "nslu2 mac: read failed\n");
37 +static void nslu2_flash_remove(struct mtd_info *mtd) {
40 +static struct mtd_notifier nslu2_flash_notifier = {
41 + .add = nslu2_flash_add,
42 + .remove = nslu2_flash_remove,
45 static void nslu2_power_off(void)
47 /* This causes the box to drop the power and go dead. */
48 @@ -210,6 +235,8 @@ static void __init nslu2_init(void)
49 (void)platform_device_register(&nslu2_uart);
51 platform_add_devices(nslu2_devices, ARRAY_SIZE(nslu2_devices));
53 + register_mtd_user(&nslu2_flash_notifier);
56 MACHINE_START(NSLU2, "Linksys NSLU2")