summaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2007-07-01 19:02:23 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2007-07-01 19:02:23 +0000
commit6598291ff8a292369886c9f32a10950b159cb4ae (patch)
tree1691dc2a48ec77979f8504b9a4653490a8a96516 /target
parent9d8c82f5393b174277d1b4a3f94e0b0679dcece8 (diff)
add gateway 7001 support patch from #1918
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@7838 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/ixp4xx-2.6/patches/139-ixp4xx_net_driver_mtd_load_fw.patch2
-rw-r--r--target/linux/ixp4xx-2.6/patches/212-gateway_7001_mtd_microcode.patch67
2 files changed, 68 insertions, 1 deletions
diff --git a/target/linux/ixp4xx-2.6/patches/139-ixp4xx_net_driver_mtd_load_fw.patch b/target/linux/ixp4xx-2.6/patches/139-ixp4xx_net_driver_mtd_load_fw.patch
index 46ba858f1..ef53155c0 100644
--- a/target/linux/ixp4xx-2.6/patches/139-ixp4xx_net_driver_mtd_load_fw.patch
+++ b/target/linux/ixp4xx-2.6/patches/139-ixp4xx_net_driver_mtd_load_fw.patch
@@ -148,7 +148,7 @@ Index: linux-2.6.20-rc3/drivers/net/ixp4xx/npe_ucode.c
+
+ print_image_info(id, offset - 12, size);
+
-+ if (size < 24000 && ( IMG_FUNC(id) == 0x01 || IMG_FUNC(id) == 0x00) ) { // XXX fix size/detection
++ if (size < 24000 && ( IMG_FUNC(id) == 0x01 || IMG_FUNC(id) == 0x00) || IMG_FUNC(id) == 0x05 ) { // XXX fix size/detection
+
+ struct dl_image *image = kmalloc(size, GFP_KERNEL);
+
diff --git a/target/linux/ixp4xx-2.6/patches/212-gateway_7001_mtd_microcode.patch b/target/linux/ixp4xx-2.6/patches/212-gateway_7001_mtd_microcode.patch
new file mode 100644
index 000000000..c15c5f66a
--- /dev/null
+++ b/target/linux/ixp4xx-2.6/patches/212-gateway_7001_mtd_microcode.patch
@@ -0,0 +1,67 @@
+--- linux-2.6.21.5/arch/arm/mach-ixp4xx/gateway7001-setup.c.orig 2007-06-19 18:03:37.202848276 +0100
++++ linux-2.6.21.5/arch/arm/mach-ixp4xx/gateway7001-setup.c 2007-06-19 18:09:04.152969985 +0100
+@@ -16,6 +16,7 @@
+ #include <linux/device.h>
+ #include <linux/serial.h>
+ #include <linux/tty.h>
++#include <linux/mtd/mtd.h>
+ #include <linux/serial_8250.h>
+ #include <linux/slab.h>
+
+@@ -122,11 +123,48 @@
+ .resource = &res_mac1,
+ };
+
++struct npe_ucode_platform_data gateway7001_npe_ucode_data = {
++ .mtd_partition = "microcode",
++};
++
++static struct platform_device gateway7001_npe_ucode = {
++ .name = "ixp4xx_npe_ucode",
++ .id = 0,
++ .dev.platform_data = &gateway7001_npe_ucode_data,
++};
++
+ static struct platform_device *gateway7001_devices[] __initdata = {
+ &gateway7001_flash,
+ &gateway7001_uart,
+ &mac0,
+ &mac1,
++ &gateway7001_npe_ucode,
++};
++
++static void gateway7001_flash_add(struct mtd_info *mtd)
++{
++ if (strcmp(mtd->name, "RedBoot config") == 0) {
++ size_t retlen;
++ u_char mac0[6], mac1[6];
++ if (mtd->read(mtd, 0x0422, 6, &retlen, mac0) == 0 && retlen == 6) {
++ printk(KERN_INFO "gateway 7001 mac0: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
++ mac0[0], mac0[1], mac0[2], mac0[3], mac0[4], mac0[5]);
++ memcpy(plat_mac0.hwaddr, mac0, 6);
++ }
++ if (mtd->read(mtd, 0x043B, 6, &retlen, mac1) == 0 && retlen == 6) {
++ printk(KERN_INFO "gateway 7001 mac1: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
++ mac1[0], mac1[1], mac1[2], mac1[3], mac1[4], mac1[5]);
++ memcpy(plat_mac1.hwaddr, mac1, 6);
++ }
++ }
++}
++
++static void gateway7001_flash_remove(struct mtd_info *mtd) {
++}
++
++static struct mtd_notifier gateway7001_flash_notifier = {
++ .add = gateway7001_flash_add,
++ .remove = gateway7001_flash_remove,
+ };
+
+ static void __init gateway7001_init(void)
+@@ -140,6 +178,7 @@
+ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0;
+
+ platform_add_devices(gateway7001_devices, ARRAY_SIZE(gateway7001_devices));
++ register_mtd_user(&gateway7001_flash_notifier);
+ }
+
+ #ifdef CONFIG_MACH_GATEWAY7001