aliases {
serial0 = &uart0;
+ label-mac-device = &gmac1;
led-boot = &led_blue;
led-failsafe = &led_blue;
led-running = &led_white;
compatible = "mediatek,eth-mac";
reg = <0>;
phy-mode = "2500base-x";
+ nvmem-cells = <&macaddr_factory_a 2>;
+ nvmem-cell-names = "mac-address";
fixed-link {
speed = <2500>;
gmac1: mac@1 {
compatible = "mediatek,eth-mac";
reg = <1>;
+ nvmem-cells = <&macaddr_factory_a 0>;
+ nvmem-cell-names = "mac-address";
phy-mode = "2500base-x";
phy-handle = <&phy1>;
};
};
&wifi {
+ nvmem-cells = <&eeprom_factory_0>;
+ nvmem-cell-names = "eeprom";
pinctrl-names = "default";
pinctrl-0 = <&wf_2g_5g_pins>;
status = "okay";
no-sd;
no-sdio;
status = "okay";
+
+ card@0 {
+ compatible = "mmc-card";
+ reg = <0>;
+
+ block {
+ compatible = "block-device";
+ partitions {
+ block-partition-env {
+ partname = "u-boot-env";
+
+ nvmem-layout {
+ compatible = "u-boot,env-layout";
+ };
+ };
+
+ block-partition-factory {
+ partname = "factory";
+
+ nvmem-layout {
+ compatible = "fixed-layout";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ eeprom_factory_0: eeprom@0 {
+ reg = <0x0 0x1000>;
+ };
+
+ macaddr_factory_a: macaddr@a {
+ compatible = "mac-base";
+ reg = <0xa 0x6>;
+ #nvmem-cell-cells = <1>;
+ };
+ };
+ };
+ };
+ };
+ };
};
wan_mac="$label_mac"
lan_mac="$(macaddr_add $label_mac 1)"
;;
- glinet,gl-mt6000)
- label_mac=$(mmc_get_mac_binary factory 0x0a)
- wan_mac=$label_mac
- lan_mac=$(macaddr_add "$label_mac" 2)
- ;;
h3c,magic-nx30-pro)
wan_mac=$(mtd_get_mac_ascii pdt_data_1 ethaddr)
lan_mac=$(macaddr_add "$wan_mac" 1)