aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorShiji Yang <yangshiji66@qq.com>2023-07-09 22:10:54 +0800
committerHauke Mehrtens <hauke@hauke-m.de>2023-08-24 00:04:38 +0200
commit12f53724c6575245cf8b2f0dc75d1b9b2e4fe488 (patch)
tree6639bfaf9581eeda4819775a90e0a339cfaee7a4 /target/linux
parent0f9b8aa3f592b22e3f1d5f7d049e92653ba0f884 (diff)
downloadupstream-12f53724c6575245cf8b2f0dc75d1b9b2e4fe488.tar.gz
upstream-12f53724c6575245cf8b2f0dc75d1b9b2e4fe488.tar.bz2
upstream-12f53724c6575245cf8b2f0dc75d1b9b2e4fe488.zip
ath79: fix first reboot issue on Netgear WNDR4300 v2 and WNDR4500 v3
From the Netgear u-boot GPL code[1]. Bootloader always unconditionally marks block 768, 1020 - 1023 as bad blocks on each boot. This may lead to conflicts with the OpenWrt nand driver since these blocks may be good blocks. In this case, U-boot will override the oob of these blocks so that break the ubi volume. The system will be damaged after first reboot. To avoid this issue, manually skip these blocks by using "mtd-concat". [1] https://www.downloads.netgear.com/files/GPL/EX7300v2series-V1.0.0.146_gpl_src.tar.bz2.zip Fixes: https://github.com/openwrt/openwrt/issues/8878 Tested-by: Yousaf <yousaf465@gmail.com> Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/ath79/dts/qca9563_netgear_wndr.dtsi32
-rw-r--r--target/linux/ath79/image/nand.mk6
-rw-r--r--target/linux/ath79/nand/base-files/etc/board.d/05_compat-version15
3 files changed, 50 insertions, 3 deletions
diff --git a/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi b/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi
index a51fb1964b0..799297f4e15 100644
--- a/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi
+++ b/target/linux/ath79/dts/qca9563_netgear_wndr.dtsi
@@ -90,6 +90,22 @@
linux,default-trigger = "phy1tpt";
};
};
+
+ ubi-concat {
+ compatible = "mtd-concat";
+ devices = <&ubiconcat0 &ubiconcat1>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "ubi";
+ reg = <0x0 0x0>;
+ };
+ };
+ };
};
&spi {
@@ -165,10 +181,20 @@
reg = <0x0 0x400000>;
};
- partition@400000 {
- label = "ubi";
- reg = <0x400000 0x7c00000>;
+ ubiconcat0: partition@400000 {
+ label = "ubiconcat0";
+ reg = <0x400000 0x5c00000>;
+ };
+
+ ubiconcat1: partition@6020000 {
+ label = "ubiconcat1";
+ reg = <0x6020000 0x1f60000>;
};
+ /*
+ * U-boot always unconditionally marks block 768, 1020 - 1023 as
+ * bad blocks on each boot. To avoid conflicts with the nand
+ * driver, manually skip them.
+ */
};
};
};
diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk
index 884a9da7562..e4ee5554512 100644
--- a/target/linux/ath79/image/nand.mk
+++ b/target/linux/ath79/image/nand.mk
@@ -373,6 +373,9 @@ TARGET_DEVICES += netgear_wndr4300tn
define Device/netgear_wndr4300-v2
SOC := qca9563
+ DEVICE_COMPAT_VERSION := 1.1
+ DEVICE_COMPAT_MESSAGE := Partition table has been changed to fix the \
+ first reboot issue. Please reflash factory image with nmrp or tftp.
DEVICE_MODEL := WNDR4300
DEVICE_VARIANT := v2
UIMAGE_MAGIC := 0x27051956
@@ -384,6 +387,9 @@ TARGET_DEVICES += netgear_wndr4300-v2
define Device/netgear_wndr4500-v3
SOC := qca9563
+ DEVICE_COMPAT_VERSION := 1.1
+ DEVICE_COMPAT_MESSAGE := Partition table has been changed to fix the \
+ first reboot issue. Please reflash factory image with nmrp or tftp.
DEVICE_MODEL := WNDR4500
DEVICE_VARIANT := v3
UIMAGE_MAGIC := 0x27051956
diff --git a/target/linux/ath79/nand/base-files/etc/board.d/05_compat-version b/target/linux/ath79/nand/base-files/etc/board.d/05_compat-version
new file mode 100644
index 00000000000..238927aa7b4
--- /dev/null
+++ b/target/linux/ath79/nand/base-files/etc/board.d/05_compat-version
@@ -0,0 +1,15 @@
+. /lib/functions.sh
+. /lib/functions/uci-defaults.sh
+
+board_config_update
+
+case "$(board_name)" in
+ netgear,wndr4300-v2|\
+ netgear,wndr4500-v3)
+ ucidef_set_compat_version "1.1"
+ ;;
+esac
+
+board_config_flush
+
+exit 0