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>
case $board in
edgecore,ecs4100-12ph|\
+ linksys,lgs310c|\
+ linksys,lgs328c|\
+ linksys,lgs352c|\
netgear,gs108t-v3|\
netgear,gs110tpp-v1|\
netgear,gs110tup-v1|\
hasivo,s1100w-8xgt-se|\
inaba,aml2-17gp|\
iodata,bsh-g24mb|\
- linksys,lgs310c|\
- linksys,lgs328c|\
- linksys,lgs352c|\
netgear,gs750e|\
panasonic,m16eg-pn28160k|\
panasonic,m24eg-pn28240k|\
model = "Linksys LGS310C";
aliases {
+ label-mac-device = ðernet0;
led-boot = &led_power;
led-failsafe = &led_fault;
led-running = &led_power;
};
};
+
+ðernet0 {
+ nvmem-cells = <&macaddr_ubootenv_ethaddr 0>;
+ nvmem-cell-names = "mac-address";
+};
+
&mdio_aux {
status = "okay";
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";
/ {
aliases {
+ label-mac-device = ðernet0;
led-boot = &led_power;
led-failsafe = &led_fault;
led-running = &led_power;
status = "okay";
};
+ðernet0 {
+ nvmem-cells = <&macaddr_ubootenv_ethaddr 0>;
+ nvmem-cell-names = "mac-address";
+};
+
&spi0 {
status = "okay";
flash@0 {
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";