ar71xx: use soc specific divider for mdio clock
[openwrt.git] / target / linux / brcm63xx / patches-2.6.30 / 040-bcm963xx_flashmap.patch
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
5
6
7 Signed-off-by: Axel Gembe <ago@bastart.eu.org>
8 ---
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(-)
13
14 --- a/drivers/mtd/maps/Kconfig
15 +++ b/drivers/mtd/maps/Kconfig
16 @@ -268,6 +268,13 @@ config MTD_ALCHEMY
17 help
18 Flash memory access on AMD Alchemy Pb/Db/RDK Reference Boards
19
20 +config MTD_BCM963XX
21 + tristate "BCM963xx Flash device"
22 + depends on MIPS && BCM63XX
23 + help
24 + Flash memory access on BCM963xx boards. Currently only works with
25 + RedBoot and CFE.
26 +
27 config MTD_DILNETPC
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
33 return 1;
34 }
35
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)
40 {
41 @@ -162,6 +162,14 @@ static int parse_redboot_partitions(stru
42 goto out;
43 }
44
45 + if (!fis_origin) {
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);
49 + }
50 + }
51 + }
52 +
53 for (i = 0; i < numslots; i++) {
54 struct fis_list *new_fl, **prev;
55
56 @@ -184,9 +192,8 @@ static int parse_redboot_partitions(stru
57 new_fl->img = &buf[i];
58 if (fis_origin) {
59 buf[i].flash_base -= fis_origin;
60 - } else {
61 - buf[i].flash_base &= master->size-1;
62 }
63 + buf[i].flash_base &= (master->size << 1) - 1;
64
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 @@ -62,3 +62,4 @@ obj-$(CONFIG_MTD_INTEL_VR_NOR) += intel_
70 obj-$(CONFIG_MTD_BFIN_ASYNC) += bfin-async-flash.o
71 obj-$(CONFIG_MTD_RBTX4939) += rbtx4939-flash.o
72 obj-$(CONFIG_MTD_VMU) += vmu-flash.o
73 +obj-$(CONFIG_MTD_BCM963XX) += bcm963xx-flash.o
This page took 0.042015 seconds and 5 git commands to generate.