aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/gemini/patches
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2009-05-15 19:16:47 +0000
committerGabor Juhos <juhosg@openwrt.org>2009-05-15 19:16:47 +0000
commit0a0a8bb2f8ad354ca1de9794d218b5c6839f71ff (patch)
tree0d6f69b5977f9d6a5150f06b5b13aad7b2d483fa /target/linux/gemini/patches
parent6f2a3f464e7e37eac4f64edb411d2ba070631e43 (diff)
downloadupstream-0a0a8bb2f8ad354ca1de9794d218b5c6839f71ff.tar.gz
upstream-0a0a8bb2f8ad354ca1de9794d218b5c6839f71ff.tar.bz2
upstream-0a0a8bb2f8ad354ca1de9794d218b5c6839f71ff.zip
add static mtd map for the WBD-111
SVN-Revision: 15874
Diffstat (limited to 'target/linux/gemini/patches')
-rw-r--r--target/linux/gemini/patches/003-wbd111-static-flash-map.patch62
-rw-r--r--target/linux/gemini/patches/100-mtd-physmap-try-static-partitions-first.patch30
2 files changed, 92 insertions, 0 deletions
diff --git a/target/linux/gemini/patches/003-wbd111-static-flash-map.patch b/target/linux/gemini/patches/003-wbd111-static-flash-map.patch
new file mode 100644
index 0000000000..9a2b2bd299
--- /dev/null
+++ b/target/linux/gemini/patches/003-wbd111-static-flash-map.patch
@@ -0,0 +1,62 @@
+--- a/arch/arm/mach-gemini/board-wbd111.c
++++ b/arch/arm/mach-gemini/board-wbd111.c
+@@ -15,6 +15,7 @@
+ #include <linux/input.h>
+ #include <linux/gpio_keys.h>
+ #include <linux/mdio-gpio.h>
++#include <linux/mtd/partitions.h>
+ #include <asm/mach-types.h>
+ #include <asm/mach/arch.h>
+ #include <asm/mach/time.h>
+@@ -101,11 +102,50 @@ static struct sys_timer wbd111_timer = {
+ .init = gemini_timer_init,
+ };
+
++#ifdef CONFIG_MTD_PARTITIONS
++static struct mtd_partition wbd111_partitions[] = {
++ {
++ .name = "RedBoot",
++ .offset = 0,
++ .size = 0x020000,
++ .mask_flags = MTD_WRITEABLE,
++ } , {
++ .name = "kernel",
++ .offset = 0x020000,
++ .size = 0x100000,
++ } , {
++ .name = "rootfs",
++ .offset = 0x120000,
++ .size = 0x6a0000,
++ } , {
++ .name = "VCTL",
++ .offset = 0x7c0000,
++ .size = 0x010000,
++ .mask_flags = MTD_WRITEABLE,
++ } , {
++ .name = "cfg",
++ .offset = 0x7d0000,
++ .size = 0x010000,
++ .mask_flags = MTD_WRITEABLE,
++ } , {
++ .name = "FIS",
++ .offset = 0x7e0000,
++ .size = 0x010000,
++ .mask_flags = MTD_WRITEABLE,
++ }
++};
++#define wbd111_num_partitions ARRAY_SIZE(wbd111_partitions)
++#else
++#define wbd111_partitions NULL
++#define wbd111_num_partitions 0
++#endif /* CONFIG_MTD_PARTITIONS */
++
+ static void __init wbd111_init(void)
+ {
+ gemini_gpio_init();
+ platform_register_uart();
+- platform_register_pflash(SZ_8M, NULL, 0);
++ platform_register_pflash(SZ_8M, wbd111_partitions,
++ wbd111_num_partitions);
+ platform_device_register(&wbd111_leds_device);
+ platform_device_register(&wbd111_keys_device);
+ platform_device_register(&wbd111_phy_device);
diff --git a/target/linux/gemini/patches/100-mtd-physmap-try-static-partitions-first.patch b/target/linux/gemini/patches/100-mtd-physmap-try-static-partitions-first.patch
new file mode 100644
index 0000000000..887dab0b7d
--- /dev/null
+++ b/target/linux/gemini/patches/100-mtd-physmap-try-static-partitions-first.patch
@@ -0,0 +1,30 @@
+--- a/drivers/mtd/maps/physmap.c
++++ b/drivers/mtd/maps/physmap.c
+@@ -170,6 +170,13 @@ static int physmap_flash_probe(struct pl
+ goto err_out;
+
+ #ifdef CONFIG_MTD_PARTITIONS
++ if (physmap_data->nr_parts) {
++ printk(KERN_NOTICE "Using physmap partition information\n");
++ add_mtd_partitions(info->cmtd, physmap_data->parts,
++ physmap_data->nr_parts);
++ return 0;
++ }
++
+ err = parse_mtd_partitions(info->cmtd, part_probe_types,
+ &info->parts, 0);
+ if (err > 0) {
+@@ -177,13 +184,6 @@ static int physmap_flash_probe(struct pl
+ info->nr_parts = err;
+ return 0;
+ }
+-
+- if (physmap_data->nr_parts) {
+- printk(KERN_NOTICE "Using physmap partition information\n");
+- add_mtd_partitions(info->cmtd, physmap_data->parts,
+- physmap_data->nr_parts);
+- return 0;
+- }
+ #endif
+
+ add_mtd_device(info->cmtd);