Build both NPE-B and NPE-C microcode for the fsg-3 and other dual-ethernet ixp4xx...
[openwrt/svn-archive/archive.git] / target / linux / ixp4xx / patches / 520-compex_mtd_microcode.patch
1 diff -Nur linux-2.6.19.2/arch/arm/mach-ixp4xx/compex-setup.c linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/compex-setup.c
2 --- linux-2.6.19.2/arch/arm/mach-ixp4xx/compex-setup.c 2007-04-09 20:51:57.000000000 +0200
3 +++ linux-2.6.19.2-owrt/arch/arm/mach-ixp4xx/compex-setup.c 2007-04-09 21:48:22.000000000 +0200
4 @@ -17,6 +17,7 @@
5 #include <linux/serial.h>
6 #include <linux/tty.h>
7 #include <linux/serial_8250.h>
8 +#include <linux/mtd/mtd.h>
9 #include <linux/slab.h>
10
11 #include <asm/types.h>
12 @@ -136,11 +137,34 @@
13 .resource = &res_mac1,
14 };
15
16 +struct npe_ucode_platform_data compex_npe_ucode_data = {
17 + .mtd_partition = "RedBoot",
18 +};
19 +
20 +static struct platform_device compex_npe_ucode = {
21 + .name = "ixp4xx_npe_ucode",
22 + .id = 0,
23 + .dev.platform_data = &compex_npe_ucode_data,
24 +};
25 +
26 static struct platform_device *compex_devices[] __initdata = {
27 &compex_flash,
28 &compex_uart,
29 &mac0,
30 &mac1,
31 + &compex_npe_ucode,
32 +};
33 +
34 +static void compex_flash_add(struct mtd_info *mtd)
35 +{
36 +}
37 +
38 +static void compex_flash_remove(struct mtd_info *mtd) {
39 +}
40 +
41 +static struct mtd_notifier compex_flash_notifier = {
42 + .add = compex_flash_add,
43 + .remove = compex_flash_remove,
44 };
45
46 static void __init compex_init(void)
47 @@ -152,6 +176,8 @@
48 IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
49
50 platform_add_devices(compex_devices, ARRAY_SIZE(compex_devices));
51 +
52 + register_mtd_user(&compex_flash_notifier);
53 }
54
55 #ifdef CONFIG_ARCH_COMPEX