summaryrefslogtreecommitdiff
path: root/target/linux/ixp4xx/patches-2.6.23/061-nslu2_setup_mac.patch
diff options
context:
space:
mode:
authorImre Kaloz <kaloz@openwrt.org>2007-12-28 21:00:01 +0000
committerImre Kaloz <kaloz@openwrt.org>2007-12-28 21:00:01 +0000
commitefadab3747594aaf96e828e0909eb9525433c236 (patch)
treee21be89886adb2a81cbb726094e699cad23fcfe7 /target/linux/ixp4xx/patches-2.6.23/061-nslu2_setup_mac.patch
parent91c42459f5ef87731628fe1f57fca3d50ee6ab5e (diff)
downloadmtk-20170518-efadab3747594aaf96e828e0909eb9525433c236.zip
mtk-20170518-efadab3747594aaf96e828e0909eb9525433c236.tar.gz
mtk-20170518-efadab3747594aaf96e828e0909eb9525433c236.tar.bz2
* upgrade ixp4xx to 2.6.23.12 * upgrade to the new ethernet driver (temporary breaks Marvell switch support on Compex units) * handle NPE microcodes in a user friendly way - YAY for Intel for changing the license * add support for the Lanready AP1000 (used in for example the Ligowave LGO2AGN)
SVN-Revision: 10016
Diffstat (limited to 'target/linux/ixp4xx/patches-2.6.23/061-nslu2_setup_mac.patch')
-rw-r--r--target/linux/ixp4xx/patches-2.6.23/061-nslu2_setup_mac.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/target/linux/ixp4xx/patches-2.6.23/061-nslu2_setup_mac.patch b/target/linux/ixp4xx/patches-2.6.23/061-nslu2_setup_mac.patch
new file mode 100644
index 0000000..c71c47e
--- /dev/null
+++ b/target/linux/ixp4xx/patches-2.6.23/061-nslu2_setup_mac.patch
@@ -0,0 +1,52 @@
+diff --git a/arch/arm/mach-ixp4xx/nslu2-setup.c b/arch/arm/mach-ixp4xx/nslu2-setup.c
+index e0d0dde..6e24916 100644
+--- a/arch/arm/mach-ixp4xx/nslu2-setup.c
++++ b/arch/arm/mach-ixp4xx/nslu2-setup.c
+@@ -19,6 +19,7 @@
+ #include <linux/serial_8250.h>
+ #include <linux/leds.h>
+ #include <linux/i2c-gpio.h>
++#include <linux/mtd/mtd.h>
+
+ #include <asm/mach-types.h>
+ #include <asm/mach/arch.h>
+@@ -167,6 +168,30 @@ static struct platform_device *nslu2_devices[] __initdata = {
+ &nslu2_eth[0],
+ };
+
++static void nslu2_flash_add(struct mtd_info *mtd)
++{
++ if (strcmp(mtd->name, "RedBoot") == 0) {
++ size_t retlen;
++ u_char mac[6];
++
++ if (mtd->read(mtd, 0x3FFB0, 6, &retlen, mac) == 0 && retlen == 6) {
++ printk(KERN_INFO "nslu2 mac: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
++ mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
++ memcpy(nslu2_plat_eth[0].hwaddr, mac, 6);
++ } else {
++ printk(KERN_ERR "nslu2 mac: read failed\n");
++ }
++ }
++}
++
++static void nslu2_flash_remove(struct mtd_info *mtd) {
++}
++
++static struct mtd_notifier nslu2_flash_notifier = {
++ .add = nslu2_flash_add,
++ .remove = nslu2_flash_remove,
++};
++
+ static void nslu2_power_off(void)
+ {
+ /* This causes the box to drop the power and go dead. */
+@@ -209,6 +234,8 @@ static void __init nslu2_init(void)
+ (void)platform_device_register(&nslu2_uart);
+
+ platform_add_devices(nslu2_devices, ARRAY_SIZE(nslu2_devices));
++
++ register_mtd_user(&nslu2_flash_notifier);
+ }
+
+ MACHINE_START(NSLU2, "Linksys NSLU2")