Skip to content

Commit

Permalink
linux: replace u-boot,env with nvmem,layout
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: openwrt/openwrt#16097
Signed-off-by: Robert Marko <[email protected]>
  • Loading branch information
neheb authored and robimarko committed Dec 27, 2024
1 parent 648d070 commit fe17cc1
Show file tree
Hide file tree
Showing 24 changed files with 127 additions and 52 deletions.
5 changes: 4 additions & 1 deletion target/linux/apm821xx/dts/meraki-mr24.dts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 4 additions & 1 deletion target/linux/apm821xx/dts/meraki-mx60.dts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
23 changes: 13 additions & 10 deletions target/linux/apm821xx/dts/netgear-wndap6x0.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
};
};
};

Expand Down
10 changes: 8 additions & 2 deletions target/linux/apm821xx/dts/netgear-wndr4700.dts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
};
};

/*
Expand All @@ -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";
* };
* };
*/
};
Expand Down
11 changes: 8 additions & 3 deletions target/linux/apm821xx/dts/wd-mybooklive.dts
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,27 @@
#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 {
};
};
};

/*
* 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";
* };
* };
*/
};
Expand Down
5 changes: 4 additions & 1 deletion target/linux/ath79/dts/ar7161_ruckus_gd11.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 4 additions & 1 deletion target/linux/ath79/dts/ar7240_ruckus_zf7025.dts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 4 additions & 1 deletion target/linux/ath79/dts/ar934x_ruckus_zf73xx.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 4 additions & 1 deletion target/linux/ath79/dts/qca955x_senao_loader.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 4 additions & 1 deletion target/linux/ath79/dts/qca9563_dlink_dap-1720-a1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 5 additions & 2 deletions target/linux/ath79/dts/qca9563_dlink_dir-8x9-a1.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 4 additions & 1 deletion target/linux/ath79/dts/qca9563_ubnt_amplifi-router-hd.dts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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";
};
};
};
};
Expand Down
1 change: 1 addition & 0 deletions target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
partitions {
block-partition-u-boot-env {
partname = "u-boot-env";

nvmem-layout {
compatible = "u-boot,env";
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
partitions {
block-partition-env {
partname = "ubootenv";

nvmem-layout {
compatible = "u-boot,env";
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
partitions {
block-partition-env {
partname = "ubootenv";

nvmem-layout {
compatible = "u-boot,env";
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
};
};
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
};
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,12 @@
};

partition@480000 {
compatible = "u-boot,env";
label = "0:appsblenv";
reg = <0x480000 0x10000>;

nvmem-layout {
compatible = "u-boot,env";
};
};

partition@490000 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
};
};
};
};
};
Expand Down
Loading

0 comments on commit fe17cc1

Please sign in to comment.