realtek: dts: convert LGS3xxC to NVMEM

These devices contain a single MAC address in the U-Boot environment.
Set it as eth0 and label MAC in device tree. To maintain the current
state, the 02_network script still sets individual port MAC addresses
and the bridge MAC address.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/22302
Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
Markus Stockhausen 2026-03-06 13:30:39 +01:00 committed by Robert Marko
parent 0872049226
commit 59f1fe1205
3 changed files with 32 additions and 3 deletions

View file

@ -53,6 +53,9 @@ realtek_setup_macs()
case $board in
edgecore,ecs4100-12ph|\
linksys,lgs310c|\
linksys,lgs328c|\
linksys,lgs352c|\
netgear,gs108t-v3|\
netgear,gs110tpp-v1|\
netgear,gs110tup-v1|\
@ -117,9 +120,6 @@ realtek_setup_macs()
hasivo,s1100w-8xgt-se|\
inaba,aml2-17gp|\
iodata,bsh-g24mb|\
linksys,lgs310c|\
linksys,lgs328c|\
linksys,lgs352c|\
netgear,gs750e|\
panasonic,m16eg-pn28160k|\
panasonic,m24eg-pn28240k|\

View file

@ -11,6 +11,7 @@
model = "Linksys LGS310C";
aliases {
label-mac-device = &ethernet0;
led-boot = &led_power;
led-failsafe = &led_fault;
led-running = &led_power;
@ -84,6 +85,12 @@
};
};
&ethernet0 {
nvmem-cells = <&macaddr_ubootenv_ethaddr 0>;
nvmem-cell-names = "mac-address";
};
&mdio_aux {
status = "okay";
@ -122,6 +129,14 @@
partition@80000 {
label = "u-boot-env";
reg = <0x00080000 0x10000>;
nvmem-layout {
compatible = "u-boot,env";
macaddr_ubootenv_ethaddr: ethaddr {
#nvmem-cell-cells = <1>;
};
};
};
partition@90000 {
label = "u-boot-env2";

View file

@ -6,6 +6,7 @@
/ {
aliases {
label-mac-device = &ethernet0;
led-boot = &led_power;
led-failsafe = &led_fault;
led-running = &led_power;
@ -89,6 +90,11 @@
status = "okay";
};
&ethernet0 {
nvmem-cells = <&macaddr_ubootenv_ethaddr 0>;
nvmem-cell-names = "mac-address";
};
&spi0 {
status = "okay";
flash@0 {
@ -109,6 +115,14 @@
partition@e0000 {
label = "u-boot-env";
reg = <0xe0000 0x10000>;
nvmem-layout {
compatible = "u-boot,env";
macaddr_ubootenv_ethaddr: ethaddr {
#nvmem-cell-cells = <1>;
};
};
};
partition@f0000 {
label = "u-boot-env2";