From fe17cc1bfd132c7dd2486952ec75dbb260abde44 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 5 Oct 2024 15:06:13 -0700 Subject: [PATCH] linux: replace u-boot,env with nvmem,layout The former is deprecated in favor of nvmem-layout. In preparation for eventual removal from the kernel, do so here. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16097 Signed-off-by: Robert Marko --- target/linux/apm821xx/dts/meraki-mr24.dts | 5 +++- target/linux/apm821xx/dts/meraki-mx60.dts | 5 +++- .../linux/apm821xx/dts/netgear-wndap6x0.dtsi | 23 +++++++++------- .../linux/apm821xx/dts/netgear-wndr4700.dts | 10 +++++-- target/linux/apm821xx/dts/wd-mybooklive.dts | 11 +++++--- .../linux/ath79/dts/ar7161_ruckus_gd11.dtsi | 5 +++- .../linux/ath79/dts/ar7240_ruckus_zf7025.dts | 5 +++- .../linux/ath79/dts/ar934x_ruckus_zf73xx.dtsi | 5 +++- .../linux/ath79/dts/qca955x_senao_loader.dtsi | 5 +++- .../ath79/dts/qca9563_dlink_dap-1720-a1.dts | 5 +++- .../ath79/dts/qca9563_dlink_dir-8x9-a1.dtsi | 7 +++-- .../dts/qca9563_ubnt_amplifi-router-hd.dts | 5 +++- .../boot/dts/qcom/qcom-ipq4018-eap1300.dts | 9 ++++--- .../boot/dts/qcom/qcom-ipq4029-ws-ap391x.dts | 10 +++++-- .../mediatek/dts/mt7981b-glinet-gl-mt2500.dts | 1 + .../mt7988a-bananapi-bpi-r4-emmc.dtso | 1 + .../mediatek/mt7988a-bananapi-bpi-r4-sd.dtso | 1 + .../boot/dts/marvell/armada-7040-rb5009.dts | 5 +++- .../arm64/boot/dts/qcom/ipq6010-xe3-4.dts | 27 ++++++++++--------- .../arm64/boot/dts/qcom/ipq8072-ax880.dts | 5 +++- .../arm64/boot/dts/qcom/ipq8072-wax218.dts | 8 ++++-- .../arm64/boot/dts/qcom/ipq8074-nbg7815.dts | 9 ++++--- .../boot/dts/qcom/ipq8074-wxr-5950ax12.dts | 7 +++-- .../ramips/dts/mt7621_jdcloud_re-cp-02.dts | 5 +++- 24 files changed, 127 insertions(+), 52 deletions(-) diff --git a/target/linux/apm821xx/dts/meraki-mr24.dts b/target/linux/apm821xx/dts/meraki-mr24.dts index 088372057a..c67faaaa32 100644 --- a/target/linux/apm821xx/dts/meraki-mr24.dts +++ b/target/linux/apm821xx/dts/meraki-mr24.dts @@ -65,9 +65,12 @@ * around for bad block management */ label = "u-boot-env"; - compatible = "u-boot,env"; reg = <0x00150000 0x00010000>; read-only; + + nvmem-layout { + compatible = "u-boot,env"; + }; }; partition@160000 { diff --git a/target/linux/apm821xx/dts/meraki-mx60.dts b/target/linux/apm821xx/dts/meraki-mx60.dts index 0471bd609d..534b5ac183 100644 --- a/target/linux/apm821xx/dts/meraki-mx60.dts +++ b/target/linux/apm821xx/dts/meraki-mx60.dts @@ -64,8 +64,11 @@ partition@100000 { label = "u-boot-env"; reg = <0x00100000 0x00100000>; - compatible = "u-boot,env"; read-only; + + nvmem-layout { + compatible = "u-boot,env"; + }; }; partition@200000 { diff --git a/target/linux/apm821xx/dts/netgear-wndap6x0.dtsi b/target/linux/apm821xx/dts/netgear-wndap6x0.dtsi index 7c9faa883f..2612bba85a 100644 --- a/target/linux/apm821xx/dts/netgear-wndap6x0.dtsi +++ b/target/linux/apm821xx/dts/netgear-wndap6x0.dtsi @@ -47,24 +47,27 @@ }; partition@100000 { - compatible = "u-boot,env"; label = "u-boot-env"; reg = <0x00100000 0x0004000>; read-only; - ethaddr { - }; + nvmem-layout { + compatible = "u-boot,env"; - bootcmd { - }; + ethaddr { + }; - serno { - }; + bootcmd { + }; - ProductID { - }; + serno { + }; + + ProductID { + }; - HardwareVer { + HardwareVer { + }; }; }; diff --git a/target/linux/apm821xx/dts/netgear-wndr4700.dts b/target/linux/apm821xx/dts/netgear-wndr4700.dts index 4ef05937d3..89d8bf5dd9 100644 --- a/target/linux/apm821xx/dts/netgear-wndr4700.dts +++ b/target/linux/apm821xx/dts/netgear-wndr4700.dts @@ -188,9 +188,12 @@ partition@40000 { label = "u-boot-env-main"; - compatible = "u-boot,env-redundant-count"; reg = <0x00040000 0x20000>; /* one block is 128k */ read-only; + + nvmem-layout { + compatible = "u-boot,env-redundant-count"; + }; }; /* @@ -199,9 +202,12 @@ * * partition@60000 { * label = "u-boot-env-redundant"; - * compatible = "u-boot,env-redundant-count"; * reg = <0x00060000 0x20000>; * read-only; + * + * nvmem-layout { + * compatible = "u-boot,env-redundant-count"; + * }; * }; */ }; diff --git a/target/linux/apm821xx/dts/wd-mybooklive.dts b/target/linux/apm821xx/dts/wd-mybooklive.dts index 5ed865e286..b3ea1a61d9 100644 --- a/target/linux/apm821xx/dts/wd-mybooklive.dts +++ b/target/linux/apm821xx/dts/wd-mybooklive.dts @@ -48,11 +48,14 @@ #size-cells = <1>; partition@0 { - compatible = "u-boot,env-redundant-bool"; reg = <0x00000000 0x00001000>; label = "u-boot-env-1"; - ethaddr { + nvmem-layout { + compatible = "u-boot,env-redundant-bool"; + + ethaddr { + }; }; }; @@ -60,10 +63,12 @@ * Causes the following warning: * sysfs: cannot create duplicate filename '/bus/nvmem/devices/u-boot-env0' * * partition@1000 { - * compatible = "u-boot,env-redundant-bool"; * reg = <0x00001000 0x00001000>; * label = "u-boot-env-2"; * + * nvmem-layout { + * compatible = "u-boot,env-redundant-bool"; + * }; * }; */ }; diff --git a/target/linux/ath79/dts/ar7161_ruckus_gd11.dtsi b/target/linux/ath79/dts/ar7161_ruckus_gd11.dtsi index a80b6045b4..eb3a126964 100644 --- a/target/linux/ath79/dts/ar7161_ruckus_gd11.dtsi +++ b/target/linux/ath79/dts/ar7161_ruckus_gd11.dtsi @@ -201,9 +201,12 @@ }; partition@f80000 { - compatible = "u-boot,env"; reg = <0xf80000 0x40000>; label = "u-boot-env"; + + nvmem-layout { + compatible = "u-boot,env"; + }; }; board_data: partition@fc0000 { diff --git a/target/linux/ath79/dts/ar7240_ruckus_zf7025.dts b/target/linux/ath79/dts/ar7240_ruckus_zf7025.dts index 887f5f7b29..8a540a0b1a 100644 --- a/target/linux/ath79/dts/ar7240_ruckus_zf7025.dts +++ b/target/linux/ath79/dts/ar7240_ruckus_zf7025.dts @@ -146,9 +146,12 @@ }; partition@f80000 { - compatible = "u-boot,env"; reg = <0xf80000 0x40000>; label = "u-boot-env"; + + nvmem-layout { + compatible = "u-boot,env"; + }; }; board_data: partition@fc0000 { diff --git a/target/linux/ath79/dts/ar934x_ruckus_zf73xx.dtsi b/target/linux/ath79/dts/ar934x_ruckus_zf73xx.dtsi index 2164ce9599..775aa88853 100644 --- a/target/linux/ath79/dts/ar934x_ruckus_zf73xx.dtsi +++ b/target/linux/ath79/dts/ar934x_ruckus_zf73xx.dtsi @@ -104,9 +104,12 @@ }; partition@f40000 { - compatible = "u-boot,env"; label = "u-boot-env"; reg = <0xf40000 0x040000>; + + nvmem-layout { + compatible = "u-boot,env"; + }; }; board_data: partition@f80000 { diff --git a/target/linux/ath79/dts/qca955x_senao_loader.dtsi b/target/linux/ath79/dts/qca955x_senao_loader.dtsi index 7cf64bd965..fd1e084cd3 100644 --- a/target/linux/ath79/dts/qca955x_senao_loader.dtsi +++ b/target/linux/ath79/dts/qca955x_senao_loader.dtsi @@ -59,9 +59,12 @@ }; partition@40000 { - compatible = "u-boot,env"; label = "u-boot-env"; reg = <0x040000 0x010000>; + + nvmem-layout { + compatible = "u-boot,env"; + }; }; partition@50000 { diff --git a/target/linux/ath79/dts/qca9563_dlink_dap-1720-a1.dts b/target/linux/ath79/dts/qca9563_dlink_dap-1720-a1.dts index 35f3913d9b..14fbc5b51e 100644 --- a/target/linux/ath79/dts/qca9563_dlink_dap-1720-a1.dts +++ b/target/linux/ath79/dts/qca9563_dlink_dap-1720-a1.dts @@ -104,10 +104,13 @@ }; partition@40000 { - compatible = "u-boot,env"; label = "u-boot-env"; // vendor calls it `bdcfg` reg = <0x040000 0x10000>; read-only; + + nvmem-layout { + compatible = "u-boot,env"; + }; }; partition@50000 { diff --git a/target/linux/ath79/dts/qca9563_dlink_dir-8x9-a1.dtsi b/target/linux/ath79/dts/qca9563_dlink_dir-8x9-a1.dtsi index 70ec60219d..c5ef01ca79 100644 --- a/target/linux/ath79/dts/qca9563_dlink_dir-8x9-a1.dtsi +++ b/target/linux/ath79/dts/qca9563_dlink_dir-8x9-a1.dtsi @@ -56,10 +56,13 @@ read-only; }; - bdcfg: partition@40000 { - compatible = "u-boot,env"; + partition@40000 { label = "bdcfg"; reg = <0x040000 0x010000>; + + bdcfg: nvmem-layout { + compatible = "u-boot,env"; + }; }; partition@50000 { diff --git a/target/linux/ath79/dts/qca9563_ubnt_amplifi-router-hd.dts b/target/linux/ath79/dts/qca9563_ubnt_amplifi-router-hd.dts index a322323899..64ad7f06d3 100644 --- a/target/linux/ath79/dts/qca9563_ubnt_amplifi-router-hd.dts +++ b/target/linux/ath79/dts/qca9563_ubnt_amplifi-router-hd.dts @@ -56,9 +56,12 @@ }; partition@60000 { - compatible = "u-boot,env"; label = "u-boot-env"; reg = <0x060000 0x010000>; + + nvmem-layout { + compatible = "u-boot,env"; + }; }; partition@70000 { diff --git a/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4018-eap1300.dts b/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4018-eap1300.dts index 52a96eae98..f343bea725 100644 --- a/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4018-eap1300.dts +++ b/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4018-eap1300.dts @@ -196,12 +196,15 @@ reg = <0x190000 0x1dc0000>; }; partition9@1f50000 { - compatible = "u-boot,env"; label = "u-boot-env"; reg = <0x01f50000 0x00010000>; - macaddr_ubootenv_ethaddr: ethaddr { - #nvmem-cell-cells = <1>; + nvmem-layout { + compatible = "u-boot,env"; + + macaddr_ubootenv_ethaddr: ethaddr { + #nvmem-cell-cells = <1>; + }; }; }; partition10@1f60000 { diff --git a/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4029-ws-ap391x.dts b/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4029-ws-ap391x.dts index 1eb6ea2eb8..9e1dfa5c1d 100644 --- a/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4029-ws-ap391x.dts +++ b/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4029-ws-ap391x.dts @@ -278,9 +278,12 @@ partition@e0000 { label = "CFG1"; - compatible = "u-boot,env-redundant-bool"; reg = <0xe0000 0x10000>; read-only; + + nvmem-layout { + compatible = "u-boot,env-redundant-bool"; + }; }; partition@f0000 { @@ -331,9 +334,12 @@ partition@1fe0000 { label = "CFG2"; - compatible = "u-boot,env-redundant-bool"; reg = <0x1fe0000 0x10000>; read-only; + + nvmem-layout { + compatible = "u-boot,env-redundant-bool"; + }; }; }; }; diff --git a/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dts b/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dts index 0bd3ac0a29..26d5b503e7 100644 --- a/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dts +++ b/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dts @@ -163,6 +163,7 @@ partitions { block-partition-u-boot-env { partname = "u-boot-env"; + nvmem-layout { compatible = "u-boot,env"; }; diff --git a/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-emmc.dtso b/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-emmc.dtso index cd266d6b0f..12c94e4da8 100644 --- a/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-emmc.dtso +++ b/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-emmc.dtso @@ -40,6 +40,7 @@ partitions { block-partition-env { partname = "ubootenv"; + nvmem-layout { compatible = "u-boot,env"; }; diff --git a/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-sd.dtso b/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-sd.dtso index c2ab424e3e..52075ab34a 100644 --- a/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-sd.dtso +++ b/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-sd.dtso @@ -38,6 +38,7 @@ partitions { block-partition-env { partname = "ubootenv"; + nvmem-layout { compatible = "u-boot,env"; }; diff --git a/target/linux/mvebu/files-6.6/arch/arm64/boot/dts/marvell/armada-7040-rb5009.dts b/target/linux/mvebu/files-6.6/arch/arm64/boot/dts/marvell/armada-7040-rb5009.dts index 306f84a516..023370a678 100644 --- a/target/linux/mvebu/files-6.6/arch/arm64/boot/dts/marvell/armada-7040-rb5009.dts +++ b/target/linux/mvebu/files-6.6/arch/arm64/boot/dts/marvell/armada-7040-rb5009.dts @@ -165,9 +165,12 @@ /* Empty space on NOR repurposed for U-Boot environment */ partition@fe0000 { - compatible = "u-boot,env"; label = "u-boot-env"; reg = <0xfe0000 0x20000>; + + nvmem-layout { + compatible = "u-boot,env"; + }; }; }; }; diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6010-xe3-4.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6010-xe3-4.dts index eba4d116ad..e0a6e9eb93 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6010-xe3-4.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6010-xe3-4.dts @@ -353,24 +353,27 @@ }; partition@510000 { - compatible = "u-boot,env"; label = "0:APPSBLENV"; reg = <0x510000 0x10000>; - ethaddr: ethaddr { - #nvmem-cell-cells = <0>; - }; + nvmem-layout { + compatible = "u-boot,env"; - eth1addr: eth1addr { - #nvmem-cell-cells = <0>; - }; + ethaddr: ethaddr { + #nvmem-cell-cells = <0>; + }; - eth2addr: eth2addr { - #nvmem-cell-cells = <0>; - }; + eth1addr: eth1addr { + #nvmem-cell-cells = <0>; + }; + + eth2addr: eth2addr { + #nvmem-cell-cells = <0>; + }; - eth5addr: eth5addr { - #nvmem-cell-cells = <0>; + eth5addr: eth5addr { + #nvmem-cell-cells = <0>; + }; }; }; diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-ax880.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-ax880.dts index 23e89a9ae4..e5c768fafb 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-ax880.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-ax880.dts @@ -193,9 +193,12 @@ }; partition@480000 { - compatible = "u-boot,env"; label = "0:appsblenv"; reg = <0x480000 0x10000>; + + nvmem-layout { + compatible = "u-boot,env"; + }; }; partition@490000 { diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-wax218.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-wax218.dts index 0e71faea72..8ced6318f9 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-wax218.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-wax218.dts @@ -167,11 +167,15 @@ #size-cells = <1>; partition@0 { - compatible = "u-boot,env"; label = "env-data"; reg = <0x0 0x40000>; - macaddr_ubootenv_ethaddr: ethaddr {}; + nvmem-layout { + compatible = "u-boot,env"; + + macaddr_ubootenv_ethaddr: ethaddr { + }; + }; }; }; }; diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-nbg7815.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-nbg7815.dts index b18f38cc6c..242f84fa15 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-nbg7815.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-nbg7815.dts @@ -212,12 +212,15 @@ }; partition@600000 { - compatible = "u-boot,env"; label = "0:appsblenv"; reg = <0x600000 0x10000>; - macaddr_lan: ethaddr { - #nvmem-cell-cells = <1>; + nvmem-layout { + compatible = "u-boot,env"; + + macaddr_lan: ethaddr { + #nvmem-cell-cells = <1>; + }; }; }; diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts index 347bb6e8ab..f5574c19b5 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts @@ -195,11 +195,14 @@ #size-cells = <1>; partition@0 { - compatible = "u-boot,env"; label = "env-data"; reg = <0x0 0x40000>; - macaddr_appsblenv_ethaddr: ethaddr { + nvmem-layout { + compatible = "u-boot,env"; + + macaddr_appsblenv_ethaddr: ethaddr { + }; }; }; }; diff --git a/target/linux/ramips/dts/mt7621_jdcloud_re-cp-02.dts b/target/linux/ramips/dts/mt7621_jdcloud_re-cp-02.dts index 8512ff96b0..cd429cbf4d 100644 --- a/target/linux/ramips/dts/mt7621_jdcloud_re-cp-02.dts +++ b/target/linux/ramips/dts/mt7621_jdcloud_re-cp-02.dts @@ -81,9 +81,12 @@ }; partition@40000 { - compatible = "u-boot,env"; label = "Config"; reg = <0x40000 0x10000>; + + nvmem-layout { + compatible = "u-boot,env"; + }; }; partition@50000 { -- 2.30.2