1 From e734ace5baa04e0e8af1d4483475fbd6bd2b32a1 Mon Sep 17 00:00:00 2001
2 From: Axel Gembe <ago@bastart.eu.org>
3 Date: Mon, 12 May 2008 18:54:09 +0200
4 Subject: [PATCH] bcm963xx: flashmap support
7 Signed-off-by: Axel Gembe <ago@bastart.eu.org>
9 drivers/mtd/maps/Kconfig | 7 +++++++
10 drivers/mtd/maps/Makefile | 1 +
11 drivers/mtd/redboot.c | 13 ++++++++++---
12 3 files changed, 18 insertions(+), 3 deletions(-)
14 --- a/drivers/mtd/maps/Kconfig
15 +++ b/drivers/mtd/maps/Kconfig
16 @@ -257,6 +257,13 @@ config MTD_ALCHEMY
18 Flash memory access on AMD Alchemy Pb/Db/RDK Reference Boards
21 + tristate "BCM963xx Flash device"
22 + depends on MIPS && BCM63XX
24 + Flash memory access on BCM963xx boards. Currently only works with
28 tristate "CFI Flash device mapped on DIL/Net PC"
29 depends on X86 && MTD_CONCAT && MTD_PARTITIONS && MTD_CFI_INTELEXT
30 --- a/drivers/mtd/redboot.c
31 +++ b/drivers/mtd/redboot.c
32 @@ -39,7 +39,7 @@ static inline int redboot_checksum(struc
36 -static int parse_redboot_partitions(struct mtd_info *master,
37 +int parse_redboot_partitions(struct mtd_info *master,
38 struct mtd_partition **pparts,
39 unsigned long fis_origin)
41 @@ -162,6 +162,14 @@ static int parse_redboot_partitions(stru
46 + for (i = 0; i < numslots; i++) {
47 + if (!strncmp(buf[i].name, "RedBoot", 8)) {
48 + fis_origin = (buf[i].flash_base & (master->size << 1) - 1);
53 for (i = 0; i < numslots; i++) {
54 struct fis_list *new_fl, **prev;
56 @@ -184,9 +192,8 @@ static int parse_redboot_partitions(stru
57 new_fl->img = &buf[i];
59 buf[i].flash_base -= fis_origin;
61 - buf[i].flash_base &= master->size-1;
63 + buf[i].flash_base &= (master->size << 1) - 1;
65 /* I'm sure the JFFS2 code has done me permanent damage.
66 * I now think the following is _normal_
67 --- a/drivers/mtd/maps/Makefile
68 +++ b/drivers/mtd/maps/Makefile
69 @@ -61,3 +61,4 @@ obj-$(CONFIG_MTD_PLATRAM) += plat-ram.o
70 obj-$(CONFIG_MTD_OMAP_NOR) += omap_nor.o
71 obj-$(CONFIG_MTD_INTEL_VR_NOR) += intel_vr_nor.o
72 obj-$(CONFIG_MTD_BFIN_ASYNC) += bfin-async-flash.o
73 +obj-$(CONFIG_MTD_BCM963XX) += bcm963xx-flash.o