aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar7/patches-3.3/920-ar7part.patch
diff options
context:
space:
mode:
authorblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-10-05 10:12:53 +0000
committerblogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-10-05 10:12:53 +0000
commit5c105d9f3fd086aff195d3849dcf847d6b0bd927 (patch)
tree1229a11f725bfa58aa7c57a76898553bb5f6654a /target/linux/ar7/patches-3.3/920-ar7part.patch
downloadopenwrt-5c105d9f3fd086aff195d3849dcf847d6b0bd927.tar.gz
openwrt-5c105d9f3fd086aff195d3849dcf847d6b0bd927.zip
branch Attitude Adjustment
git-svn-id: svn://svn.openwrt.org/openwrt/branches/attitude_adjustment@33625 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar7/patches-3.3/920-ar7part.patch')
-rw-r--r--target/linux/ar7/patches-3.3/920-ar7part.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/target/linux/ar7/patches-3.3/920-ar7part.patch b/target/linux/ar7/patches-3.3/920-ar7part.patch
new file mode 100644
index 000000000..9cbc53786
--- /dev/null
+++ b/target/linux/ar7/patches-3.3/920-ar7part.patch
@@ -0,0 +1,56 @@
+--- a/drivers/mtd/ar7part.c
++++ b/drivers/mtd/ar7part.c
+@@ -29,11 +29,14 @@
+ #include <linux/magic.h>
+ #include <linux/module.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
+@@ -45,6 +48,10 @@ struct ar7_bin_rec {
+ unsigned int address;
+ };
+
++int create_titan_partitions(struct mtd_info *master,
++ struct mtd_partition **pparts,
++ struct mtd_part_parser_data *data);
++
+ static int create_mtd_partitions(struct mtd_info *master,
+ struct mtd_partition **pparts,
+ struct mtd_part_parser_data *data)
+@@ -58,6 +65,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, data);
++ }
++
+ ar7_parts = kzalloc(sizeof(*ar7_parts) * AR7_PARTS, GFP_KERNEL);
+ if (!ar7_parts)
+ return -ENOMEM;
+--- a/drivers/mtd/titanpart.c
++++ b/drivers/mtd/titanpart.c
+@@ -149,7 +149,7 @@ static void titan_add_partition(char * e
+ }
+ int create_titan_partitions(struct mtd_info *master,
+ struct mtd_partition **pparts,
+- unsigned long origin)
++ struct mtd_part_parser_data *data)
+ {
+ struct nsp_img_hdr_head hdr;
+ struct nsp_img_hdr_section_info sect_info;