aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorImre Kaloz <kaloz@openwrt.org>2008-01-04 16:18:05 +0000
committerImre Kaloz <kaloz@openwrt.org>2008-01-04 16:18:05 +0000
commitf88ddb8ba8eaf4f28f9f96cd2b76756958c33c78 (patch)
treedd4263ed9073e3d73a346887d64002fe04f9d7b2
parent40ad352b37fd792b0548c54448f21faa25435e73 (diff)
downloadupstream-f88ddb8ba8eaf4f28f9f96cd2b76756958c33c78.tar.gz
upstream-f88ddb8ba8eaf4f28f9f96cd2b76756958c33c78.tar.bz2
upstream-f88ddb8ba8eaf4f28f9f96cd2b76756958c33c78.zip
use the newer mac handling patches from nslu2-linux
SVN-Revision: 10116
-rw-r--r--target/linux/ixp4xx/patches-2.6.23/061-nslu2_setup_mac.patch52
-rw-r--r--target/linux/ixp4xx/patches-2.6.23/062-nas100d_setup_mac.patch52
-rw-r--r--target/linux/ixp4xx/patches-2.6.23/064-fsg3_setup_mac.patch56
-rw-r--r--target/linux/ixp4xx/patches-2.6.23/066-nslu2_fetch_mac.patch56
-rw-r--r--target/linux/ixp4xx/patches-2.6.23/067-nas100d_fetch_mac.patch56
-rw-r--r--target/linux/ixp4xx/patches-2.6.23/068-fsg3_fetch_mac.patch68
6 files changed, 180 insertions, 160 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
deleted file mode 100644
index c71c47e655..0000000000
--- a/target/linux/ixp4xx/patches-2.6.23/061-nslu2_setup_mac.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-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")
diff --git a/target/linux/ixp4xx/patches-2.6.23/062-nas100d_setup_mac.patch b/target/linux/ixp4xx/patches-2.6.23/062-nas100d_setup_mac.patch
deleted file mode 100644
index df40a6e96a..0000000000
--- a/target/linux/ixp4xx/patches-2.6.23/062-nas100d_setup_mac.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-diff --git a/arch/arm/mach-ixp4xx/nas100d-setup.c b/arch/arm/mach-ixp4xx/nas100d-setup.c
-index d4d8540..b8c99fa 100644
---- a/arch/arm/mach-ixp4xx/nas100d-setup.c
-+++ b/arch/arm/mach-ixp4xx/nas100d-setup.c
-@@ -17,6 +17,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>
-@@ -151,6 +152,30 @@ static struct platform_device *nas100d_devices[] __initdata = {
- &nas100d_eth[0],
- };
-
-+static void nas100d_flash_add(struct mtd_info *mtd)
-+{
-+ if (strcmp(mtd->name, "RedBoot config") == 0) {
-+ size_t retlen;
-+ u_char mac[6];
-+
-+ if (mtd->read(mtd, 0x0FD8, 6, &retlen, mac) == 0 && retlen == 6) {
-+ printk(KERN_INFO "nas100d mac: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
-+ mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
-+ memcpy(nas100d_plat_eth[0].hwaddr, mac, 6);
-+ } else {
-+ printk(KERN_ERR "nas100d mac: read failed\n");
-+ }
-+ }
-+}
-+
-+static void nas100d_flash_remove(struct mtd_info *mtd) {
-+}
-+
-+static struct mtd_notifier nas100d_flash_notifier = {
-+ .add = nas100d_flash_add,
-+ .remove = nas100d_flash_remove,
-+};
-+
- static void nas100d_power_off(void)
- {
- /* This causes the box to drop the power and go dead. */
-@@ -183,6 +208,8 @@ static void __init nas100d_init(void)
- (void)platform_device_register(&nas100d_uart);
-
- platform_add_devices(nas100d_devices, ARRAY_SIZE(nas100d_devices));
-+
-+ register_mtd_user(&nas100d_flash_notifier);
- }
-
- MACHINE_START(NAS100D, "Iomega NAS 100d")
diff --git a/target/linux/ixp4xx/patches-2.6.23/064-fsg3_setup_mac.patch b/target/linux/ixp4xx/patches-2.6.23/064-fsg3_setup_mac.patch
deleted file mode 100644
index 359fc0b2de..0000000000
--- a/target/linux/ixp4xx/patches-2.6.23/064-fsg3_setup_mac.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-diff --git a/arch/arm/mach-ixp4xx/fsg-setup.c b/arch/arm/mach-ixp4xx/fsg-setup.c
-index ec3d517..7cc7201 100644
---- a/arch/arm/mach-ixp4xx/fsg-setup.c
-+++ b/arch/arm/mach-ixp4xx/fsg-setup.c
-@@ -16,6 +16,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>
-@@ -177,6 +178,34 @@ static struct platform_device *fsg_devices[] __initdata = {
- &fsg_eth[1],
- };
-
-+static void fsg_flash_add(struct mtd_info *mtd)
-+{
-+ if (strcmp(mtd->name, "RedBoot config") == 0) {
-+ size_t retlen;
-+ u_char mac[6];
-+
-+ if (mtd->read(mtd, 0x0422, 6, &retlen, mac) == 0 && retlen == 6) {
-+ printk(KERN_INFO "eth0 mac: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
-+ mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
-+ memcpy(fsg_plat_eth[0].hwaddr, mac, 6);
-+ mac[5]++;
-+ printk(KERN_INFO "eth1 mac: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
-+ mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
-+ memcpy(fsg_plat_eth[1].hwaddr, mac, 6);
-+ } else {
-+ printk(KERN_ERR "fsg mac: read failed\n");
-+ }
-+ }
-+}
-+
-+static void fsg_flash_remove(struct mtd_info *mtd) {
-+}
-+
-+static struct mtd_notifier fsg_flash_notifier = {
-+ .add = fsg_flash_add,
-+ .remove = fsg_flash_remove,
-+};
-+
- static void __init fsg_init(void)
- {
- ixp4xx_sys_init();
-@@ -198,6 +227,8 @@ static void __init fsg_init(void)
- (void)platform_device_register(&fsg_uart);
-
- platform_add_devices(fsg_devices, ARRAY_SIZE(fsg_devices));
-+
-+ register_mtd_user(&fsg_flash_notifier);
- }
-
- MACHINE_START(FSG, "Freecom FSG-3")
diff --git a/target/linux/ixp4xx/patches-2.6.23/066-nslu2_fetch_mac.patch b/target/linux/ixp4xx/patches-2.6.23/066-nslu2_fetch_mac.patch
new file mode 100644
index 0000000000..93f3c2ee0f
--- /dev/null
+++ b/target/linux/ixp4xx/patches-2.6.23/066-nslu2_fetch_mac.patch
@@ -0,0 +1,56 @@
+Index: linux-2.6.23.11-armeb/arch/arm/mach-ixp4xx/nslu2-setup.c
+===================================================================
+--- linux-2.6.23.11-armeb.orig/arch/arm/mach-ixp4xx/nslu2-setup.c 2007-12-29 01:46:05.000000000 -0600
++++ linux-2.6.23.11-armeb/arch/arm/mach-ixp4xx/nslu2-setup.c 2007-12-29 12:21:29.000000000 -0600
+@@ -24,6 +24,7 @@
+ #include <asm/mach/arch.h>
+ #include <asm/mach/flash.h>
+ #include <asm/mach/time.h>
++#include <asm/io.h>
+
+ static struct flash_platform_data nslu2_flash_data = {
+ .map_name = "cfi_probe",
+@@ -193,6 +194,9 @@
+
+ static void __init nslu2_init(void)
+ {
++ uint8_t __iomem *f;
++ int i;
++
+ ixp4xx_sys_init();
+
+ nslu2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+@@ -209,6 +213,33 @@
+ (void)platform_device_register(&nslu2_uart);
+
+ platform_add_devices(nslu2_devices, ARRAY_SIZE(nslu2_devices));
++
++
++ /*
++ * Map in a portion of the flash and read the MAC address.
++ * Since it is stored in BE in the flash itself, we need to
++ * byteswap it if we're in LE mode.
++ */
++ if ((f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x40000))) {
++#ifdef __ARMEB__
++ for (i = 0; i < 6; i++) {
++ nslu2_plat_eth[0].hwaddr[i] = readb(f + 0x3FFB0 + i);
++ }
++#else
++ nslu2_plat_eth[0].hwaddr[0] = readb(f + 0x3FFB0 + 3);
++ nslu2_plat_eth[0].hwaddr[1] = readb(f + 0x3FFB0 + 2);
++ nslu2_plat_eth[0].hwaddr[2] = readb(f + 0x3FFB0 + 1);
++ nslu2_plat_eth[0].hwaddr[3] = readb(f + 0x3FFB0 + 0);
++ nslu2_plat_eth[0].hwaddr[4] = readb(f + 0x3FFB0 + 7);
++ nslu2_plat_eth[0].hwaddr[5] = readb(f + 0x3FFB0 + 6);
++#endif
++ iounmap(f);
++ }
++ printk(KERN_INFO "NSLU2: Using MAC address %.2x:%.2x:%.2x:%.2x:%.2x:%.2x for port 0\n",
++ nslu2_plat_eth[0].hwaddr[0], nslu2_plat_eth[0].hwaddr[1],
++ nslu2_plat_eth[0].hwaddr[2], nslu2_plat_eth[0].hwaddr[3],
++ nslu2_plat_eth[0].hwaddr[4], nslu2_plat_eth[0].hwaddr[5]);
++
+ }
+
+ MACHINE_START(NSLU2, "Linksys NSLU2")
diff --git a/target/linux/ixp4xx/patches-2.6.23/067-nas100d_fetch_mac.patch b/target/linux/ixp4xx/patches-2.6.23/067-nas100d_fetch_mac.patch
new file mode 100644
index 0000000000..fdaaffdd41
--- /dev/null
+++ b/target/linux/ixp4xx/patches-2.6.23/067-nas100d_fetch_mac.patch
@@ -0,0 +1,56 @@
+Index: linux-2.6.23.11-armeb/arch/arm/mach-ixp4xx/nas100d-setup.c
+===================================================================
+--- linux-2.6.23.11-armeb.orig/arch/arm/mach-ixp4xx/nas100d-setup.c 2007-12-29 23:19:07.000000000 +1030
++++ linux-2.6.23.11-armeb/arch/arm/mach-ixp4xx/nas100d-setup.c 2007-12-29 23:24:06.000000000 +1030
+@@ -21,6 +21,7 @@
+ #include <asm/mach-types.h>
+ #include <asm/mach/arch.h>
+ #include <asm/mach/flash.h>
++#include <asm/io.h>
+
+ static struct flash_platform_data nas100d_flash_data = {
+ .map_name = "cfi_probe",
+@@ -164,6 +165,9 @@
+
+ static void __init nas100d_init(void)
+ {
++ uint8_t __iomem *f;
++ int i;
++
+ ixp4xx_sys_init();
+
+ /* gpio 14 and 15 are _not_ clocks */
+@@ -183,6 +187,33 @@
+ (void)platform_device_register(&nas100d_uart);
+
+ platform_add_devices(nas100d_devices, ARRAY_SIZE(nas100d_devices));
++
++
++ /*
++ * Map in a portion of the flash and read the MAC address.
++ * Since it is stored in BE in the flash itself, we need to
++ * byteswap it if we're in LE mode.
++ */
++ if ((f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x1000000))) {
++#ifdef __ARMEB__
++ for (i = 0; i < 6; i++) {
++ nas100d_plat_eth[0].hwaddr[i] = readb(f + 0xFC0FD8 + i);
++ }
++#else
++ nas100d_plat_eth[0].hwaddr[0] = readb(f + 0xFC0FD8 + 3);
++ nas100d_plat_eth[0].hwaddr[1] = readb(f + 0xFC0FD8 + 2);
++ nas100d_plat_eth[0].hwaddr[2] = readb(f + 0xFC0FD8 + 1);
++ nas100d_plat_eth[0].hwaddr[3] = readb(f + 0xFC0FD8 + 0);
++ nas100d_plat_eth[0].hwaddr[4] = readb(f + 0xFC0FD8 + 7);
++ nas100d_plat_eth[0].hwaddr[5] = readb(f + 0xFC0FD8 + 6);
++#endif
++ iounmap(f);
++ }
++ printk(KERN_INFO "NAS100D: Using MAC address %.2x:%.2x:%.2x:%.2x:%.2x:%.2x for port 0\n",
++ nas100d_plat_eth[0].hwaddr[0], nas100d_plat_eth[0].hwaddr[1],
++ nas100d_plat_eth[0].hwaddr[2], nas100d_plat_eth[0].hwaddr[3],
++ nas100d_plat_eth[0].hwaddr[4], nas100d_plat_eth[0].hwaddr[5]);
++
+ }
+
+ MACHINE_START(NAS100D, "Iomega NAS 100d")
diff --git a/target/linux/ixp4xx/patches-2.6.23/068-fsg3_fetch_mac.patch b/target/linux/ixp4xx/patches-2.6.23/068-fsg3_fetch_mac.patch
new file mode 100644
index 0000000000..294f7d83f9
--- /dev/null
+++ b/target/linux/ixp4xx/patches-2.6.23/068-fsg3_fetch_mac.patch
@@ -0,0 +1,68 @@
+Index: linux-2.6.23.11-armeb/arch/arm/mach-ixp4xx/fsg-setup.c
+===================================================================
+--- linux-2.6.23.11-armeb.orig/arch/arm/mach-ixp4xx/fsg-setup.c 2007-12-29 23:10:08.000000000 +1030
++++ linux-2.6.23.11-armeb/arch/arm/mach-ixp4xx/fsg-setup.c 2007-12-29 23:25:24.000000000 +1030
+@@ -20,6 +20,7 @@
+ #include <asm/mach-types.h>
+ #include <asm/mach/arch.h>
+ #include <asm/mach/flash.h>
++#include <asm/io.h>
+
+ static struct flash_platform_data fsg_flash_data = {
+ .map_name = "cfi_probe",
+@@ -179,6 +180,9 @@
+
+ static void __init fsg_init(void)
+ {
++ uint8_t __iomem *f;
++ int i;
++
+ ixp4xx_sys_init();
+
+ fsg_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
+@@ -198,6 +202,45 @@
+ (void)platform_device_register(&fsg_uart);
+
+ platform_add_devices(fsg_devices, ARRAY_SIZE(fsg_devices));
++
++
++ /*
++ * Map in a portion of the flash and read the MAC addresses.
++ * Since it is stored in BE in the flash itself, we need to
++ * byteswap it if we're in LE mode.
++ */
++ if ((f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x400000))) {
++#ifdef __ARMEB__
++ for (i = 0; i < 6; i++) {
++ fsg_plat_eth[0].hwaddr[i] = readb(f + 0x3C0422 + i);
++ fsg_plat_eth[1].hwaddr[i] = readb(f + 0x3C043B + i);
++ }
++#else
++ fsg_plat_eth[0].hwaddr[0] = readb(f + 0x3C0422 + 3);
++ fsg_plat_eth[0].hwaddr[1] = readb(f + 0x3C0422 + 2);
++ fsg_plat_eth[0].hwaddr[2] = readb(f + 0x3C0422 + 1);
++ fsg_plat_eth[0].hwaddr[3] = readb(f + 0x3C0422 + 0);
++ fsg_plat_eth[0].hwaddr[4] = readb(f + 0x3C0422 + 7);
++ fsg_plat_eth[0].hwaddr[5] = readb(f + 0x3C0422 + 6);
++
++ fsg_plat_eth[1].hwaddr[0] = readb(f + 0x3C0422 + 3);
++ fsg_plat_eth[1].hwaddr[1] = readb(f + 0x3C0422 + 2);
++ fsg_plat_eth[1].hwaddr[2] = readb(f + 0x3C0422 + 1);
++ fsg_plat_eth[1].hwaddr[3] = readb(f + 0x3C0422 + 0);
++ fsg_plat_eth[1].hwaddr[4] = readb(f + 0x3C0422 + 7);
++ fsg_plat_eth[1].hwaddr[5] = readb(f + 0x3C0422 + 6);
++#endif
++ iounmap(f);
++ }
++ printk(KERN_INFO "FSG: Using MAC address %.2x:%.2x:%.2x:%.2x:%.2x:%.2x for port 0\n",
++ fsg_plat_eth[0].hwaddr[0], fsg_plat_eth[0].hwaddr[1],
++ fsg_plat_eth[0].hwaddr[2], fsg_plat_eth[0].hwaddr[3],
++ fsg_plat_eth[0].hwaddr[4], fsg_plat_eth[0].hwaddr[5]);
++ printk(KERN_INFO "FSG: Using MAC address %.2x:%.2x:%.2x:%.2x:%.2x:%.2x for port 1\n",
++ fsg_plat_eth[1].hwaddr[0], fsg_plat_eth[1].hwaddr[1],
++ fsg_plat_eth[1].hwaddr[2], fsg_plat_eth[1].hwaddr[3],
++ fsg_plat_eth[1].hwaddr[4], fsg_plat_eth[1].hwaddr[5]);
++
+ }
+
+ MACHINE_START(FSG, "Freecom FSG-3")