summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSungbo Eo2023-12-17 16:06:21 +0000
committerSungbo Eo2024-03-10 07:32:14 +0000
commit7e04a611bc798c27a0dc584959d2c2bdf64da05f (patch)
tree7bea2100184861f9d62818276d61dd9d61b33848
parent97f542238a23a1c8461b40dfb26d9213826d8e78 (diff)
downloadopenwrt-7e04a611bc798c27a0dc584959d2c2bdf64da05f.tar.gz
ramips: add NMBM support for ipTIME AX2004M
AX2004M uses NMBM on its NAND flash, but it was not enabled in DTS as the device support [1] had been added before NMBM feature in mtk_bmt driver [2]. Let's enable it now. With this change, there is a low possibility of boot failure after sysupgrade from older versions. As AX2004M already has gone through two stable releases in the meantime, it would be safe to warn users by bumping DEVICE_COMPAT_VERSION. [1] 37753f34ac68 ("ramips: add support for ipTIME AX2004M") [2] 06382d1af7b2 ("kernel: add support for mediatek NMBM flash mapping support") Signed-off-by: Sungbo Eo <mans0n@gorani.run>
-rw-r--r--target/linux/ramips/dts/mt7621_iptime_ax2004m.dts7
-rw-r--r--target/linux/ramips/image/mt7621.mk4
-rw-r--r--target/linux/ramips/mt7621/base-files/etc/board.d/05_compat-version3
3 files changed, 14 insertions, 0 deletions
diff --git a/target/linux/ramips/dts/mt7621_iptime_ax2004m.dts b/target/linux/ramips/dts/mt7621_iptime_ax2004m.dts
index 51be0d4939..7237bf822f 100644
--- a/target/linux/ramips/dts/mt7621_iptime_ax2004m.dts
+++ b/target/linux/ramips/dts/mt7621_iptime_ax2004m.dts
@@ -57,6 +57,11 @@
&nand {
status = "okay";
+ mediatek,nmbm;
+ mediatek,bmt-max-ratio = <1>;
+ mediatek,bmt-max-reserved-blocks = <64>;
+ mediatek,bmt-remap-range = <0x000000 0x580000>;
+
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
@@ -118,6 +123,8 @@
reg = <0x400000 0x7280000>;
};
};
+
+ /* last 8 MiB is reserved for NMBM bad block table */
};
};
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index ab1b829ba0..7b7266b73e 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -1461,6 +1461,10 @@ define Device/iptime_ax2004m
DEVICE_VENDOR := ipTIME
DEVICE_MODEL := AX2004M
DEVICE_PACKAGES := kmod-mt7915-firmware kmod-usb3 -uboot-envtools
+ DEVICE_COMPAT_VERSION := 2.0
+ DEVICE_COMPAT_MESSAGE := NMBM has been newly enabled, and its flash block \
+ mapping might be incompatible with existing installation. \
+ New installation via recovery mode is recommended.
endef
TARGET_DEVICES += iptime_ax2004m
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/05_compat-version b/target/linux/ramips/mt7621/base-files/etc/board.d/05_compat-version
index 45bef9385b..c510dfd81a 100644
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/05_compat-version
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/05_compat-version
@@ -8,6 +8,9 @@
board_config_update
case "$(board_name)" in
+ iptime,ax2004m)
+ ucidef_set_compat_version "2.0"
+ ;;
*)
ucidef_set_compat_version "1.1"
;;