kernel: b53: add support for GPIO reset
[openwrt.git] / target / linux / brcm47xx / patches-3.9 / 026-mtd-bcm47xxpart-find-boot-partition-by-CFE-magic.patch
1 --- a/drivers/mtd/bcm47xxpart.c
2 +++ b/drivers/mtd/bcm47xxpart.c
3 @@ -23,9 +23,10 @@
4   * Amount of bytes we read when analyzing each block of flash memory.
5   * Set it big enough to allow detecting partition and reading important data.
6   */
7 -#define BCM47XXPART_BYTES_TO_READ      0x404
8 +#define BCM47XXPART_BYTES_TO_READ      0x4e8
9  
10  /* Magics */
11 +#define CFE_MAGIC                      0x43464531      /* 1EFC */
12  #define BOARD_DATA_MAGIC               0x5246504D      /* MPFR */
13  #define POT_MAGIC1                     0x54544f50      /* POTT */
14  #define POT_MAGIC2                     0x504f          /* OP */
15 @@ -93,8 +94,9 @@ static int bcm47xxpart_parse(struct mtd_
16                         continue;
17                 }
18  
19 -               /* CFE has small NVRAM at 0x400 */
20 -               if (buf[0x400 / 4] == NVRAM_HEADER) {
21 +               /* Magic or small NVRAM at 0x400 */
22 +               if (buf[0x4e0 / 4] == CFE_MAGIC ||
23 +                   buf[0x400 / 4] == NVRAM_HEADER) {
24                         bcm47xxpart_add_part(&parts[curr_part++], "boot",
25                                              offset, MTD_WRITEABLE);
26                         continue;