1 From a4d005c91d403d9f3d0272db6cc46202c06ec774 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
6 Signed-off-by: Axel Gembe <ago@bastart.eu.org>
8 arch/mips/bcm63xx/boards/board_bcm963xx.c | 19 +----------------
9 drivers/mtd/maps/bcm963xx-flash.c | 32 ++++++++++++++++++++++++----
10 drivers/mtd/redboot.c | 13 +++++++++--
11 3 files changed, 38 insertions(+), 26 deletions(-)
13 --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
14 +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
15 @@ -818,7 +818,7 @@ static struct mtd_partition mtd_partitio
19 -static const char *bcm63xx_part_types[] = { "bcm63xxpart", NULL };
20 +static const char *bcm63xx_part_types[] = { "bcm63xxpart", "RedBoot", NULL };
22 static struct physmap_flash_data flash_data = {
24 --- a/drivers/mtd/redboot.c
25 +++ b/drivers/mtd/redboot.c
26 @@ -75,6 +75,7 @@ static int parse_redboot_partitions(stru
30 + unsigned long fis_origin = 0;
31 #ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED
32 static char nullstring[] = "unallocated";
34 @@ -181,6 +182,16 @@ static int parse_redboot_partitions(stru
38 + if (data && data->origin) {
39 + fis_origin = data->origin;
41 + for (i = 0; i < numslots; i++) {
42 + if (!strncmp(buf[i].name, "RedBoot", 8)) {
43 + fis_origin = (buf[i].flash_base & (master->size << 1) - 1);
48 for (i = 0; i < numslots; i++) {
49 struct fis_list *new_fl, **prev;
51 @@ -201,10 +212,10 @@ static int parse_redboot_partitions(stru
54 new_fl->img = &buf[i];
55 - if (data && data->origin)
56 - buf[i].flash_base -= data->origin;
58 - buf[i].flash_base &= master->size-1;
60 + buf[i].flash_base -= fis_origin;
62 + buf[i].flash_base &= (master->size << 1) - 1;
64 /* I'm sure the JFFS2 code has done me permanent damage.
65 * I now think the following is _normal_