summaryrefslogtreecommitdiff
path: root/target/linux/brcm63xx/patches-2.6.30/040-bcm963xx_flashmap.patch
diff options
context:
space:
mode:
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-08-01 16:56:36 +0000
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-08-01 16:56:36 +0000
commit5f12aa1919fbdc1e9f0b103f385bc82a5dc17782 (patch)
tree268f78afbf2a7752b38df36265f9fc1a138711df /target/linux/brcm63xx/patches-2.6.30/040-bcm963xx_flashmap.patch
parent37fd863e612ec587e2ef38f31e6c029bbb2d2c45 (diff)
[brcm63xx] add experimental support for 2.6.30.4
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@17081 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm63xx/patches-2.6.30/040-bcm963xx_flashmap.patch')
-rw-r--r--target/linux/brcm63xx/patches-2.6.30/040-bcm963xx_flashmap.patch73
1 files changed, 73 insertions, 0 deletions
diff --git a/target/linux/brcm63xx/patches-2.6.30/040-bcm963xx_flashmap.patch b/target/linux/brcm63xx/patches-2.6.30/040-bcm963xx_flashmap.patch
new file mode 100644
index 0000000000..f8d37abd89
--- /dev/null
+++ b/target/linux/brcm63xx/patches-2.6.30/040-bcm963xx_flashmap.patch
@@ -0,0 +1,73 @@
+From e734ace5baa04e0e8af1d4483475fbd6bd2b32a1 Mon Sep 17 00:00:00 2001
+From: Axel Gembe <ago@bastart.eu.org>
+Date: Mon, 12 May 2008 18:54:09 +0200
+Subject: [PATCH] bcm963xx: flashmap support
+
+
+Signed-off-by: Axel Gembe <ago@bastart.eu.org>
+---
+ drivers/mtd/maps/Kconfig | 7 +++++++
+ drivers/mtd/maps/Makefile | 1 +
+ drivers/mtd/redboot.c | 13 ++++++++++---
+ 3 files changed, 18 insertions(+), 3 deletions(-)
+
+--- a/drivers/mtd/maps/Kconfig
++++ b/drivers/mtd/maps/Kconfig
+@@ -268,6 +268,13 @@ config MTD_ALCHEMY
+ help
+ Flash memory access on AMD Alchemy Pb/Db/RDK Reference Boards
+
++config MTD_BCM963XX
++ tristate "BCM963xx Flash device"
++ depends on MIPS && BCM63XX
++ help
++ Flash memory access on BCM963xx boards. Currently only works with
++ RedBoot and CFE.
++
+ config MTD_DILNETPC
+ tristate "CFI Flash device mapped on DIL/Net PC"
+ depends on X86 && MTD_CONCAT && MTD_PARTITIONS && MTD_CFI_INTELEXT
+--- a/drivers/mtd/redboot.c
++++ b/drivers/mtd/redboot.c
+@@ -39,7 +39,7 @@ static inline int redboot_checksum(struc
+ return 1;
+ }
+
+-static int parse_redboot_partitions(struct mtd_info *master,
++int parse_redboot_partitions(struct mtd_info *master,
+ struct mtd_partition **pparts,
+ unsigned long fis_origin)
+ {
+@@ -162,6 +162,14 @@ static int parse_redboot_partitions(stru
+ goto out;
+ }
+
++ if (!fis_origin) {
++ for (i = 0; i < numslots; i++) {
++ if (!strncmp(buf[i].name, "RedBoot", 8)) {
++ fis_origin = (buf[i].flash_base & (master->size << 1) - 1);
++ }
++ }
++ }
++
+ for (i = 0; i < numslots; i++) {
+ struct fis_list *new_fl, **prev;
+
+@@ -184,9 +192,8 @@ static int parse_redboot_partitions(stru
+ new_fl->img = &buf[i];
+ if (fis_origin) {
+ buf[i].flash_base -= fis_origin;
+- } else {
+- buf[i].flash_base &= master->size-1;
+ }
++ buf[i].flash_base &= (master->size << 1) - 1;
+
+ /* I'm sure the JFFS2 code has done me permanent damage.
+ * I now think the following is _normal_
+--- a/drivers/mtd/maps/Makefile
++++ b/drivers/mtd/maps/Makefile
+@@ -62,3 +62,4 @@ obj-$(CONFIG_MTD_INTEL_VR_NOR) += intel_
+ obj-$(CONFIG_MTD_BFIN_ASYNC) += bfin-async-flash.o
+ obj-$(CONFIG_MTD_RBTX4939) += rbtx4939-flash.o
+ obj-$(CONFIG_MTD_VMU) += vmu-flash.o
++obj-$(CONFIG_MTD_BCM963XX) += bcm963xx-flash.o