kernel: add linux 4.4 support
[openwrt.git] / target / linux / generic / patches-4.4 / 431-mtd-bcm47xxpart-support-for-Xiaomi-specific-board_da.patch
1 From 841e59ba3e496d86ca5f069204d5e5c1ad43c01d Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
3 Date: Tue, 27 Jan 2015 22:29:21 +0100
4 Subject: [PATCH] mtd: bcm47xxpart: support for Xiaomi specific board_data
5  partition
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
11 ---
12  drivers/mtd/bcm47xxpart.c | 4 +++-
13  1 file changed, 3 insertions(+), 1 deletion(-)
14
15 --- a/drivers/mtd/bcm47xxpart.c
16 +++ b/drivers/mtd/bcm47xxpart.c
17 @@ -33,6 +33,7 @@
18  /* Magics */
19  #define BOARD_DATA_MAGIC               0x5246504D      /* MPFR */
20  #define BOARD_DATA_MAGIC2              0xBD0D0BBD
21 +#define BOARD_DATA_XIAOMI_MAGIC                0x474D4442      /* GMDB */
22  #define CFE_MAGIC                      0x43464531      /* 1EFC */
23  #define FACTORY_MAGIC                  0x59544346      /* FCTY */
24  #define NVRAM_HEADER                   0x48534C46      /* FLSH */
25 @@ -262,7 +263,8 @@ static int bcm47xxpart_parse(struct mtd_
26                 }
27  
28                 /* Some devices (ex. WNDR3700v3) don't have a standard 'MPFR' */
29 -               if (buf[0x000 / 4] == BOARD_DATA_MAGIC2) {
30 +               if (buf[0x000 / 4] == BOARD_DATA_MAGIC2 ||
31 +                   le32_to_cpu(buf[0x000 / 4]) == BOARD_DATA_XIAOMI_MAGIC) {
32                         bcm47xxpart_add_part(&parts[curr_part++], "board_data",
33                                              offset, MTD_WRITEABLE);
34                         continue;