2 arch/arm/mach-ixp4xx/nas100d-setup.c | 27 +++++++++++++++++++++++++++
3 1 file changed, 27 insertions(+)
5 Index: linux-2.6.19/arch/arm/mach-ixp4xx/nas100d-setup.c
6 ===================================================================
7 --- linux-2.6.19.orig/arch/arm/mach-ixp4xx/nas100d-setup.c
8 +++ linux-2.6.19/arch/arm/mach-ixp4xx/nas100d-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 @@ -165,6 +166,30 @@ static struct platform_device *nas100d_d
21 +static void nas100d_flash_add(struct mtd_info *mtd)
23 + if (strcmp(mtd->name, "RedBoot config") == 0) {
27 + if (mtd->read(mtd, 0x0FD8, 6, &retlen, mac) == 0 && retlen == 6) {
28 + printk(KERN_INFO "nas100d 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 "nas100d mac: read failed\n");
37 +static void nas100d_flash_remove(struct mtd_info *mtd) {
40 +static struct mtd_notifier nas100d_flash_notifier = {
41 + .add = nas100d_flash_add,
42 + .remove = nas100d_flash_remove,
45 static void nas100d_power_off(void)
47 /* This causes the box to drop the power and go dead. */
48 @@ -196,6 +221,8 @@ static void __init nas100d_init(void)
49 (void)platform_device_register(&nas100d_uart);
51 platform_add_devices(nas100d_devices, ARRAY_SIZE(nas100d_devices));
53 + register_mtd_user(&nas100d_flash_notifier);
56 MACHINE_START(NAS100D, "Iomega NAS 100d")