summaryrefslogtreecommitdiffstats
path: root/target/linux/ar7/patches-2.6.32/920-ar7part.patch
diff options
context:
space:
mode:
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-06-06 19:16:55 +0000
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2010-06-06 19:16:55 +0000
commit816ab94c6291c82226a9ebf09181e067d40cd743 (patch)
treeb7161cfeea0eb6982735e3fa305643f007f311fb /target/linux/ar7/patches-2.6.32/920-ar7part.patch
parent4b648be10a79aff321d33026ee2620b5a1903e37 (diff)
[ar7] add Titan MTD partitionning support (#6632)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21691 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar7/patches-2.6.32/920-ar7part.patch')
-rw-r--r--target/linux/ar7/patches-2.6.32/920-ar7part.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/target/linux/ar7/patches-2.6.32/920-ar7part.patch b/target/linux/ar7/patches-2.6.32/920-ar7part.patch
new file mode 100644
index 000000000..e4ad09f2d
--- /dev/null
+++ b/target/linux/ar7/patches-2.6.32/920-ar7part.patch
@@ -0,0 +1,55 @@
+--- a/drivers/mtd/ar7part.c-back 2010-01-13 15:58:44.000000000 -0500
++++ b/drivers/mtd/ar7part.c 2010-01-13 16:16:05.000000000 -0500
+@@ -27,12 +27,14 @@
+ #include <linux/mtd/partitions.h>
+ #include <linux/bootmem.h>
+ #include <linux/magic.h>
++#include <asm/mach-ar7/prom.h>
+
+ #define AR7_PARTS 4
+ #define ROOT_OFFSET 0xe0000
+
+ #define LOADER_MAGIC1 le32_to_cpu(0xfeedfa42)
+ #define LOADER_MAGIC2 le32_to_cpu(0xfeed1281)
++#define LOADER_MAGIC3 le32_to_cpu(0x434d4d4c)
+
+ #ifndef SQUASHFS_MAGIC
+ #define SQUASHFS_MAGIC 0x73717368
+@@ -44,6 +46,10 @@ struct ar7_bin_rec {
+ unsigned int address;
+ };
+
++int create_titan_partitions(struct mtd_info *master,
++ struct mtd_partition **pparts,
++ unsigned long origin);
++
+ static int create_mtd_partitions(struct mtd_info *master,
+ struct mtd_partition **pparts,
+ unsigned long origin)
+@@ -57,6 +63,16 @@ static int create_mtd_partitions(struct
+ int retries = 10;
+ struct mtd_partition *ar7_parts;
+
++ const char *prod_id ;
++ prod_id = prom_getenv("ProductID");
++ if(prod_id &&
++ (strcmp(prod_id, "CYWL")==0 ||
++ strcmp(prod_id, "CYWM")==0 ||
++ strcmp(prod_id, "CYLM")==0 ||
++ strcmp(prod_id, "CYLL")==0)){
++ return create_titan_partitions(master, pparts, origin);
++ }
++
+ ar7_parts = kzalloc(sizeof(*ar7_parts) * AR7_PARTS, GFP_KERNEL);
+ if (!ar7_parts)
+ return -ENOMEM;
+--- a/drivers/mtd/Makefile 2010-01-11 14:44:12.000000000 -0500
++++ a/drivers/mtd/Makefile 2010-02-03 13:44:38.000000000 -0500
+@@ -12,6 +12,7 @@ obj-$(CONFIG_MTD_REDBOOT_PARTS) += redbo
+ obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o
+ obj-$(CONFIG_MTD_AFS_PARTS) += afs.o
+ obj-$(CONFIG_MTD_AR7_PARTS) += ar7part.o
++obj-$(CONFIG_MTD_AR7_PARTS) += titanpart.o
+ obj-$(CONFIG_MTD_OF_PARTS) += ofpart.o
+ obj-$(CONFIG_MTD_MYLOADER_PARTS) += myloader.o
+