[openwrt/openwrt] ramips: add support for read/write uboot env to Asus RX-AX53U
LEDE Commits
lede-commits at lists.infradead.org
Sun Apr 2 07:13:26 PDT 2023
hauke pushed a commit to openwrt/openwrt.git, branch openwrt-22.03:
https://git.openwrt.org/3014c694da6c83bba883200ae65b0350a37d7976
commit 3014c694da6c83bba883200ae65b0350a37d7976
Author: Felix Baumann <felix.bau at gmx.de>
AuthorDate: Mon Dec 26 21:40:43 2022 +0100
ramips: add support for read/write uboot env to Asus RX-AX53U
Add support for read/writing uboot env by renaming the second partition
to its stock label "nvram" and remove the deemed unnecessary
"read-only". Split the first partition "u-boot" in two, in order
to allow `fw_setenv` safe write-access to the uboot environment
variables.
This implements hauke's request from [1].
Based on the patch provided by Shiji Yang.
[1] https://github.com/openwrt/openwrt/pull/10400#discussion_r945153224
Co-Authored-By: Shiji Yang <yangshiji66 at qq.com>
Signed-off-by: Felix Baumann <felix.bau at gmx.de>
[ improve commit title and description, fix some whitespace problem ]
Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
(cherry picked from commit 3f1e9f6f3b14385cab7ca6d1dcc2a4b658475bc3)
---
target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts b/target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts
index 2df8b749df..aabd90ce64 100644
--- a/target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts
+++ b/target/linux/ramips/dts/mt7621_asus_rt-ax53u.dts
@@ -60,12 +60,21 @@
partition at 0 {
label = "u-boot";
- reg = <0x0 0xe0000>;
+ reg = <0x0 0x80000>;
read-only;
};
- partition at e0000 {
+ /*
+ * u-boot gets split here while keeping u-boot read-only,
+ * which allows safe usage of fw_setenv
+ */
+ partition at 80000 {
label = "u-boot-env";
+ reg = <0x80000 0x60000>;
+ };
+
+ partition at e0000 {
+ label = "nvram";
reg = <0xe0000 0x100000>;
read-only;
};
More information about the lede-commits
mailing list