diff options
author | Rafał Miłecki <rafal@milecki.pl> | 2016-11-19 07:58:25 +0100 |
---|---|---|
committer | Rafał Miłecki <rafal@milecki.pl> | 2016-11-19 07:58:25 +0100 |
commit | eab2b17d436fa7fd72f4ec4d84d2cd497fcbc0cb (patch) | |
tree | 494b6945e390eadd1872ef9e8aed56743be535ef /target/linux/bcm53xx/patches-4.4/901-mtd-bcm47xxpart-add-device-specific-workarounds.patch | |
parent | fd924d2068f27e7622534990a6c90348597cd214 (diff) | |
download | upstream-eab2b17d436fa7fd72f4ec4d84d2cd497fcbc0cb.tar.gz upstream-eab2b17d436fa7fd72f4ec4d84d2cd497fcbc0cb.tar.bz2 upstream-eab2b17d436fa7fd72f4ec4d84d2cd497fcbc0cb.zip |
bcm53xx: add kernel support for TP-LINK Archer C9 V1
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'target/linux/bcm53xx/patches-4.4/901-mtd-bcm47xxpart-add-device-specific-workarounds.patch')
-rw-r--r-- | target/linux/bcm53xx/patches-4.4/901-mtd-bcm47xxpart-add-device-specific-workarounds.patch | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/target/linux/bcm53xx/patches-4.4/901-mtd-bcm47xxpart-add-device-specific-workarounds.patch b/target/linux/bcm53xx/patches-4.4/901-mtd-bcm47xxpart-add-device-specific-workarounds.patch new file mode 100644 index 0000000000..06cb5104d5 --- /dev/null +++ b/target/linux/bcm53xx/patches-4.4/901-mtd-bcm47xxpart-add-device-specific-workarounds.patch @@ -0,0 +1,48 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl> +Subject: [PATCH] mtd: bcm47xxpart: add device specific workarounds +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Rafał Miłecki <rafal@milecki.pl> +--- + +--- a/drivers/mtd/bcm47xxpart.c ++++ b/drivers/mtd/bcm47xxpart.c +@@ -14,6 +14,7 @@ + #include <linux/slab.h> + #include <linux/mtd/mtd.h> + #include <linux/mtd/partitions.h> ++#include <linux/of.h> + + #include <uapi/linux/magic.h> + +@@ -159,6 +160,28 @@ static int bcm47xxpart_parse(struct mtd_info *master, + break; + } + ++ /* ++ * Device specific workarounds (hacks). We should use DT to ++ * define partitions but we need a working TRX firmware splitter ++ * first. ++ */ ++ if (of_machine_is_compatible("asus,rt-ac87u") && offset == 0x7ec0000) { ++ /* ++ * "asus" partition uses JFFS2 which we don't detect and ++ * we don't want to as this could affect other devices. ++ */ ++ bcm47xxpart_add_part(&parts[curr_part++], "asus", offset, MTD_WRITEABLE); ++ continue; ++ } else if (of_machine_is_compatible("tplink,archer-c9-v1") && offset == 0xe40000) { ++ /* ++ * There is a whole set of partitions (not even listed ++ * by original firmware): "default-mac", "pin", ++ * "partition-table", etc. ++ */ ++ bcm47xxpart_add_part(&parts[curr_part++], "tplink", offset, MTD_WRITEABLE); ++ continue; ++ } ++ + /* Read beginning of the block */ + err = mtd_read(master, offset, BCM47XXPART_BYTES_TO_READ, + &bytes_read, (uint8_t *)buf); |