aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/patches-4.4/0400-mtd-mtdsplit-add-support-for-custom-trx-magic-for-Buffalo-WCR-1166DS.patch
diff options
context:
space:
mode:
authorFUKAUMI Naoki <naobsd@gmail.com>2017-01-29 01:05:56 +0900
committerRafał Miłecki <rafal@milecki.pl>2017-01-31 11:10:58 +0100
commit6b0b526a4fc11d3b1b588d5b3b789da0c66adce9 (patch)
tree1ad589aba17e5ec3f9b14dc18c3b3e6afe02e41a /target/linux/ramips/patches-4.4/0400-mtd-mtdsplit-add-support-for-custom-trx-magic-for-Buffalo-WCR-1166DS.patch
parent3b5d29b96e4df80dbfbcc5bbb8a5898a9390c683 (diff)
downloadupstream-6b0b526a4fc11d3b1b588d5b3b789da0c66adce9.tar.gz
upstream-6b0b526a4fc11d3b1b588d5b3b789da0c66adce9.tar.bz2
upstream-6b0b526a4fc11d3b1b588d5b3b789da0c66adce9.zip
ramips: add support for Buffalo WCR-1166DS
Buffalo WCR-1166DS is a small wireless router with - MT7628AN + MT7612E - 64MiB DDR2 SDRAM - 16MiB SPI flash - 2T2R 11ac/a/b/g/n Wi-Fi - 2x 10/100M ethernet switch - 8x programmable LED - 3x button - UART pad on PCB (J2: 3.3V, GND, TX, RX) factory image can be installed via stock web UI. due to the "dual image" function in the bootloader, the second half of the SPI flash ("firmware2" partition) cannot be used as a part of the file system. Signed-off-by: FUKAUMI Naoki <naobsd@gmail.com>
Diffstat (limited to 'target/linux/ramips/patches-4.4/0400-mtd-mtdsplit-add-support-for-custom-trx-magic-for-Buffalo-WCR-1166DS.patch')
-rw-r--r--target/linux/ramips/patches-4.4/0400-mtd-mtdsplit-add-support-for-custom-trx-magic-for-Buffalo-WCR-1166DS.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/target/linux/ramips/patches-4.4/0400-mtd-mtdsplit-add-support-for-custom-trx-magic-for-Buffalo-WCR-1166DS.patch b/target/linux/ramips/patches-4.4/0400-mtd-mtdsplit-add-support-for-custom-trx-magic-for-Buffalo-WCR-1166DS.patch
new file mode 100644
index 0000000000..1af72f93df
--- /dev/null
+++ b/target/linux/ramips/patches-4.4/0400-mtd-mtdsplit-add-support-for-custom-trx-magic-for-Buffalo-WCR-1166DS.patch
@@ -0,0 +1,30 @@
+--- a/drivers/mtd/mtdsplit/mtdsplit_trx.c
++++ b/drivers/mtd/mtdsplit/mtdsplit_trx.c
+@@ -13,6 +13,7 @@
+ #include <linux/module.h>
+ #include <linux/init.h>
+ #include <linux/kernel.h>
++#include <linux/of.h>
+ #include <linux/slab.h>
+ #include <linux/mtd/mtd.h>
+ #include <linux/mtd/partitions.h>
+@@ -20,7 +21,8 @@
+
+ #include "mtdsplit.h"
+
+-#define TRX_MAGIC 0x30524448 /* "HDR0" */
++#define TRX_MAGIC 0x30524448 /* "HDR0" */
++#define TRX_MAGIC_BUFFALO 0x746f435c
+
+ struct trx_header {
+ __le32 magic;
+@@ -82,7 +84,8 @@ mtdsplit_parse_trx(struct mtd_info *mast
+ if (ret)
+ continue;
+
+- if (hdr.magic != cpu_to_le32(TRX_MAGIC)) {
++ if (hdr.magic != cpu_to_le32(TRX_MAGIC) &&
++ !(of_machine_is_compatible("buffalo,wcr-1166ds") && hdr.magic == cpu_to_le32(TRX_MAGIC_BUFFALO))) {
+ pr_debug("no valid trx header found in \"%s\" at offset %llx\n",
+ master->name, (unsigned long long) offset);
+ continue;