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
17 Flash memory access on 4G Systems MTX-1 Board. If you have one of
18 these boards and would like to use the flash chips on it, say 'Y'.
21 + tristate "BCM963xx Flash device"
22 + depends on MIPS && BCM963XX
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/maps/Makefile
31 +++ b/drivers/mtd/maps/Makefile
33 obj-$(CONFIG_MTD_OMAP_NOR) += omap_nor.o
34 obj-$(CONFIG_MTD_MTX1) += mtx-1_flash.o
35 obj-$(CONFIG_MTD_INTEL_VR_NOR) += intel_vr_nor.o
36 +obj-$(CONFIG_MTD_BCM963XX) += bcm963xx-flash.o
37 --- a/drivers/mtd/redboot.c
38 +++ b/drivers/mtd/redboot.c
43 -static int parse_redboot_partitions(struct mtd_info *master,
44 +int parse_redboot_partitions(struct mtd_info *master,
45 struct mtd_partition **pparts,
46 unsigned long fis_origin)
53 + for (i = 0; i < numslots; i++) {
54 + if (!strncmp(buf[i].name, "RedBoot", 8)) {
55 + fis_origin = (buf[i].flash_base & (master->size << 1) - 1);
60 for (i = 0; i < numslots; i++) {
61 struct fis_list *new_fl, **prev;
64 new_fl->img = &buf[i];
66 buf[i].flash_base -= fis_origin;
68 - buf[i].flash_base &= master->size-1;
70 + buf[i].flash_base &= (master->size << 1) - 1;
72 /* I'm sure the JFFS2 code has done me permanent damage.
73 * I now think the following is _normal_