bcm53xx: fix partitions on Netgear R8000
[openwrt.git] / target / linux / bcm53xx / patches-3.18 / 400-mtd-bcm47xxpart-scan-whole-flash-on-ARCH_BCM_5301X.patch
1 From d658c21d6697293a928434fd6ac19264b5a8948d Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
3 Date: Fri, 30 Jan 2015 08:25:54 +0100
4 Subject: [PATCH] mtd: bcm47xxpart: scan whole flash on ARCH_BCM_5301X
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
10 ---
11  drivers/mtd/bcm47xxpart.c | 6 ++++++
12  1 file changed, 6 insertions(+)
13
14 diff --git a/drivers/mtd/bcm47xxpart.c b/drivers/mtd/bcm47xxpart.c
15 index ee3e010..f13c824 100644
16 --- a/drivers/mtd/bcm47xxpart.c
17 +++ b/drivers/mtd/bcm47xxpart.c
18 @@ -120,9 +120,15 @@ static int bcm47xxpart_parse(struct mtd_info *master,
19         /* Parse block by block looking for magics */
20         for (offset = 0; offset <= master->size - blocksize;
21              offset += blocksize) {
22 +#ifndef CONFIG_ARCH_BCM_5301X
23 +               /*
24 +                * ARM routers may have partitions in higher memory. E.g.
25 +                * Netgear R8000 has board_data at 0x2600000.
26 +                */
27                 /* Nothing more in higher memory */
28                 if (offset >= 0x2000000)
29                         break;
30 +#endif
31  
32                 if (curr_part >= BCM47XXPART_MAX_PARTS) {
33                         pr_warn("Reached maximum number of partitions, scanning stopped!\n");
34 -- 
35 1.8.4.5
36