Skip to content

Commit eed995d

Browse files
nehebhauke
authored andcommitted
lantiq: more conversions to nvmem
Now that NVMEM in UBI is supported, more handling can be moved. Signed-off-by: Rosen Penev <rosenp@gmail.com> Link: openwrt#16376 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
1 parent 75b9fae commit eed995d

18 files changed

Lines changed: 138 additions & 14 deletions

target/linux/lantiq/ase/base-files/etc/board.d/02_network

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ lantiq_setup_macs()
3636

3737
case "$board" in
3838
allnet,all0333cj)
39-
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
40-
wan_mac=$(macaddr_add "$lan_mac" 1)
39+
wan_mac=$(macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 1)
4140
;;
4241
esac
4342

target/linux/lantiq/config-6.12

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ CONFIG_NO_EXCEPT_FILL=y
127127
CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
128128
CONFIG_NVMEM=y
129129
CONFIG_NVMEM_LAYOUTS=y
130+
CONFIG_NVMEM_LAYOUT_U_BOOT_ENV=y
130131
CONFIG_OF=y
131132
CONFIG_OF_ADDRESS=y
132133
CONFIG_OF_EARLY_FLATTREE=y

target/linux/lantiq/files/arch/mips/boot/dts/lantiq/amazonse_allnet_all0333cj.dts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@
7373

7474
&gsw {
7575
phy-mode = "mii";
76+
77+
nvmem-cells = <&macaddr_uboot_ethaddr 0>;
78+
nvmem-cell-names = "mac-address";
7679
};
7780

7881
&localbus {
@@ -101,6 +104,14 @@
101104
label = "u-boot-env";
102105
reg = <0x3ff200 0xc00>;
103106
read-only;
107+
108+
nvmem-layout {
109+
compatible = "u-boot,env";
110+
111+
macaddr_uboot_ethaddr: ethaddr {
112+
#nvmem-cell-cells = <1>;
113+
};
114+
};
104115
};
105116

106117
partition@3ffe00 {

target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4510pw.dts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,14 @@
154154

155155
&gsw {
156156
phy-mode = "rmii";
157+
158+
nvmem-cells = <&macaddr_uboot_ethaddr 0>;
159+
nvmem-cell-names = "mac-address";
160+
};
161+
162+
&ppe {
163+
nvmem-cells = <&macaddr_uboot_ethaddr 1>;
164+
nvmem-cell-names = "mac-address";
157165
};
158166

159167
&localbus {
@@ -179,6 +187,14 @@
179187
label = "u-boot-env";
180188
reg = <0x40000 0x20000>;
181189
read-only;
190+
191+
nvmem-layout {
192+
compatible = "u-boot,env";
193+
194+
macaddr_uboot_ethaddr: ethaddr {
195+
#nvmem-cell-cells = <1>;
196+
};
197+
};
182198
};
183199

184200
partition@60000 {

target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_bt_homehub-v2b.dts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,14 @@
136136

137137
&gsw {
138138
phy-mode = "rmii";
139+
140+
nvmem-cells = <&macaddr_uboot_ethaddr 0>;
141+
nvmem-cell-names = "mac-address";
142+
};
143+
144+
&ppe {
145+
nvmem-cells = <&macaddr_uboot_ethaddr 1>;
146+
nvmem-cell-names = "mac-address";
139147
};
140148

141149
&localbus {
@@ -158,6 +166,14 @@
158166
partition@40000 {
159167
label = "u-boot-env";
160168
reg = <0x40000 0x10000>; /* 64KB */
169+
170+
nvmem-layout {
171+
compatible = "u-boot,env";
172+
173+
macaddr_uboot_ethaddr: ethaddr {
174+
#nvmem-cell-cells = <1>;
175+
};
176+
};
161177
};
162178

163179
partition@50000 {
@@ -225,6 +241,9 @@
225241
compatible = "pci168c,0027";
226242
reg = <0x7000 0 0 0 0>;
227243
qca,no-eeprom; /* load from ath9k-eeprom-pci-0000:00:0e.0.bin */
244+
245+
nvmem-cells = <&macaddr_uboot_ethaddr 2>;
246+
nvmem-cell-names = "mac-address";
228247
};
229248
};
230249

target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_alphanetworks_asl56026.dts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@
7171
};
7272
};
7373

74+
&eth0 {
75+
nvmem-cells = <&macaddr_uboot_ethaddr 0>;
76+
nvmem-cell-names = "mac-address";
77+
};
78+
7479
&gphy0 {
7580
lantiq,gphy-mode = <GPHY_MODE_FE>;
7681
};
@@ -124,6 +129,14 @@
124129
partition@30000 {
125130
label = "u-boot-env";
126131
reg = <0x30000 0x10000>;
132+
133+
nvmem-layout {
134+
compatible = "u-boot,env";
135+
136+
macaddr_uboot_ethaddr: ethaddr {
137+
#nvmem-cell-cells = <1>;
138+
};
139+
};
127140
};
128141

129142
partition@40000 {

target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vg3503j.dts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@
6969
pinctrl-0 = <&gphy0_led0_pins>, <&gphy0_led1_pins>, <&gphy0_led2_pins>,
7070
<&gphy1_led0_pins>, <&gphy1_led1_pins>, <&gphy1_led2_pins>;
7171
pinctrl-names = "default";
72+
nvmem-cells = <&macaddr_uboot_ethaddr 0>;
73+
nvmem-cell-names = "mac-address";
7274
};
7375

7476
&gswip_mdio {
@@ -157,6 +159,14 @@
157159
partition@7f0000 {
158160
label = "u-boot-env";
159161
reg = <0x7f0000 0x10000>;
162+
163+
nvmem-layout {
164+
compatible = "u-boot,env";
165+
166+
macaddr_uboot_ethaddr: ethaddr {
167+
#nvmem-cell-cells = <1>;
168+
};
169+
};
160170
};
161171
};
162172
};

target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_bt_homehub-v5a.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@
227227
};
228228

229229
&ppe {
230-
nvmem-cells = <&macaddr_caldata_110c 5>;
230+
nvmem-cells = <&macaddr_caldata_110c 4>;
231231
nvmem-cell-names = "mac-address";
232232
};
233233

target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_buffalo_wbmr-300hpd.dts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,16 @@
155155
};
156156
};
157157

158+
&eth0 {
159+
nvmem-cells = <&macaddr_uboot_ethaddr 0>;
160+
nvmem-cell-names = "mac-address";
161+
};
162+
163+
&ppe {
164+
nvmem-cells = <&macaddr_uboot_ethaddr 1>;
165+
nvmem-cell-names = "mac-address";
166+
};
167+
158168
&gphy0 {
159169
lantiq,gphy-mode = <GPHY_MODE_FE>;
160170
};
@@ -267,6 +277,14 @@
267277
partition@ff0000 {
268278
reg = <0xff0000 0x2000>;
269279
label = "u-boot-env";
280+
281+
nvmem-layout {
282+
compatible = "u-boot,env";
283+
284+
macaddr_uboot_ethaddr: ethaddr {
285+
#nvmem-cell-cells = <1>;
286+
};
287+
};
270288
};
271289

272290
partition@ff3000 {

target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920-nand.dts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@
3434
partition@100000 {
3535
label = "u-boot-env";
3636
reg = <0x100000 0x40000>; /* 256 KB */
37+
38+
nvmem-layout {
39+
compatible = "u-boot,env";
40+
41+
macaddr_uboot_ethaddr: ethaddr {
42+
#nvmem-cell-cells = <1>;
43+
};
44+
};
3745
};
3846

3947
partition@140000 {

0 commit comments

Comments
 (0)