model = "HiWiFi HC5661";
aliases {
+ label-mac-device = ðernet;
led-boot = &led_system;
led-failsafe = &led_system;
led-running = &led_system;
model = "HiWiFi HC5761";
aliases {
+ label-mac-device = ðernet;
led-boot = &led_system;
led-failsafe = &led_system;
led-running = &led_system;
&pcie0 {
mt76@0,0 {
reg = <0x0000 0 0 0 0>;
- nvmem-cells = <&eeprom_factory_8000>;
- nvmem-cell-names = "eeprom";
+ nvmem-cells = <&eeprom_factory_8000>, <&macaddr_bdinfo_18a 0>;
+ nvmem-cell-names = "eeprom", "mac-address";
ieee80211-freq-limit = <5000000 6000000>;
};
};
model = "HiWiFi HC5861";
aliases {
+ label-mac-device = ðernet;
led-boot = &led_system;
led-failsafe = &led_system;
led-running = &led_system;
wifi@0,0 {
compatible = "pci14c3,7662";
reg = <0x0000 0 0 0 0>;
- nvmem-cells = <&eeprom_factory_8000>;
- nvmem-cell-names = "eeprom";
+ nvmem-cells = <&eeprom_factory_8000>, <&macaddr_bdinfo_18a 0>;
+ nvmem-cell-names = "eeprom", "mac-address";
ieee80211-freq-limit = <5000000 6000000>;
};
};
eeprom_factory_8000: eeprom@8000 {
reg = <0x8000 0x200>;
};
-
- macaddr_factory_4: macaddr@4 {
- reg = <0x4 0x6>;
- };
};
};
label = "bdinfo";
reg = <0xfe0000 0x10000>;
read-only;
+
+ nvmem-layout {
+ compatible = "fixed-layout";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ macaddr_bdinfo_18a: macaddr@18a {
+ compatible = "mac-base";
+ reg = <0x18a 0x11>;
+ #nvmem-cell-cells = <1>;
+ };
+ };
};
partition@ff0000 {
};
ðernet {
- nvmem-cells = <&macaddr_factory_4>;
- nvmem-cell-names = "mac-address";
-
mediatek,portmap = "wllll";
+
+ nvmem-cells = <&macaddr_bdinfo_18a 0>;
+ nvmem-cell-names = "mac-address";
};
&sdhci {
};
&wmac {
- nvmem-cells = <&eeprom_factory_0>;
- nvmem-cell-names = "eeprom";
+ nvmem-cells = <&eeprom_factory_0>, <&macaddr_bdinfo_18a 0>;
+ nvmem-cell-names = "eeprom", "mac-address";
};
&state_default {
model = "HiWiFi HC5962";
aliases {
+ label-mac-device = &gmac0;
led-boot = &led_system;
led-failsafe = &led_system;
led-running = &led_status;
label = "bdinfo";
reg = <0x21c0000 0x80000>;
read-only;
+
+ nvmem-layout {
+ compatible = "fixed-layout";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ macaddr_bdinfo_18a: macaddr@18a {
+ compatible = "mac-base";
+ reg = <0x18a 0x11>;
+ #nvmem-cell-cells = <1>;
+ };
+ };
};
ubiconcat1: partition@2240000 {
&pcie0 {
mt76@0,0 {
reg = <0x0000 0 0 0 0>;
- nvmem-cells = <&eeprom_factory_0>;
- nvmem-cell-names = "eeprom";
+ nvmem-cells = <&eeprom_factory_0>, <&macaddr_bdinfo_18a 0>;
+ nvmem-cell-names = "eeprom", "mac-address";
ieee80211-freq-limit = <2400000 2500000>;
};
};
&pcie1 {
mt76@0,0 {
reg = <0x0000 0 0 0 0>;
- nvmem-cells = <&eeprom_factory_8000>;
- nvmem-cell-names = "eeprom";
+ nvmem-cells = <&eeprom_factory_8000>, <&macaddr_bdinfo_18a 0>;
+ nvmem-cell-names = "eeprom", "mac-address";
ieee80211-freq-limit = <5000000 6000000>;
};
};
+&gmac0 {
+ nvmem-cells = <&macaddr_bdinfo_18a 0>;
+ nvmem-cell-names = "mac-address";
+};
+
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <ðphy4>;
+
+ nvmem-cells = <&macaddr_bdinfo_18a 1>;
+ nvmem-cell-names = "mac-address";
};
ðphy4 {
&pcie0 {
wifi@0,0 {
reg = <0x0000 0 0 0 0>;
- nvmem-cells = <&eeprom_factory_8000>;
- nvmem-cell-names = "eeprom";
+ nvmem-cells = <&eeprom_factory_8000>, <&macaddr_bdinfo_18a 0>;
+ nvmem-cell-names = "eeprom", "mac-address";
ieee80211-freq-limit = <5000000 6000000>;
};
};
wifi@0,0 {
reg = <0x0000 0 0 0 0>;
ieee80211-freq-limit = <5000000 6000000>;
- nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_2e>;
+ nvmem-cells = <&eeprom_factory_8000>, <&macaddr_bdinfo_18a 0>;
nvmem-cell-names = "eeprom", "mac-address";
led {
compatible = "hiwifi,hc5x61a", "mediatek,mt7628an-soc";
aliases {
+ label-mac-device = ðernet;
led-boot = &led_system;
led-failsafe = &led_system;
led-running = &led_system;
eeprom_factory_8000: eeprom@8000 {
reg = <0x8000 0x200>;
};
-
- macaddr_factory_4: macaddr@4 {
- reg = <0x4 0x6>;
- };
-
- macaddr_factory_2e: macaddr@2e {
- reg = <0x2e 0x6>;
- };
};
};
label = "bdinfo";
reg = <0xfe0000 0x10000>;
read-only;
+
+ nvmem-layout {
+ compatible = "fixed-layout";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ macaddr_bdinfo_18a: macaddr@18a {
+ compatible = "mac-base";
+ reg = <0x18a 0x11>;
+ #nvmem-cell-cells = <1>;
+ };
+ };
};
partition@ff0000 {
};
ðernet {
- nvmem-cells = <&macaddr_factory_4>;
+ nvmem-cells = <&macaddr_bdinfo_18a 0>;
nvmem-cell-names = "mac-address";
};
&wmac {
status = "okay";
- nvmem-cells = <&eeprom_factory_0>;
- nvmem-cell-names = "eeprom";
+ nvmem-cells = <&eeprom_factory_0>, <&macaddr_bdinfo_18a 0>;
+ nvmem-cell-names = "eeprom", "mac-address";
};
hiwifi,hc5661|\
hiwifi,hc5761|\
hiwifi,hc5861)
- lan_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ")
- label_mac=$lan_mac
- [ -n "$lan_mac" ] || lan_mac=$(cat /sys/class/net/eth0/address)
- wan_mac=$(macaddr_add "$lan_mac" 1)
+ wan_mac=$(macaddr_add "$(cat /sys/class/net/eth0/address)" 1)
;;
iodata,wn-ac1167gr|\
iodata,wn-ac733gr3)
board=$(board_name)
case "$board" in
- hiwifi,hc5661)
- label_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ")
- [ "$PHYNBR" = "0" ] && [ -n "$label_mac" ] && \
- echo -n "$label_mac" > /sys${DEVPATH}/macaddress
- ;;
hiwifi,hc5761|\
hiwifi,hc5861)
- label_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ")
- [ "$PHYNBR" = "1" ] && [ -n "$label_mac" ] && \
- echo -n "$label_mac" > /sys${DEVPATH}/macaddress
- [ "$PHYNBR" = "0" ] && [ -n "$label_mac" ] && \
- macaddr_unsetbit "$label_mac" 6 > /sys${DEVPATH}/macaddress
+ [ "$PHYNBR" = "0" ] && \
+ macaddr_unsetbit "$(cat /sys${DEVPATH}/macaddress)" 6 > /sys${DEVPATH}/macaddress
;;
esac
lan_mac=$(macaddr_add "$label_mac" 1)
wan_mac=$label_mac
;;
- hiwifi,hc5962)
- lan_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac")
- label_mac=$lan_mac
- [ -n "$lan_mac" ] || lan_mac=$(cat /sys/class/net/eth0/address)
- wan_mac=$(macaddr_add "$lan_mac" 1)
- ;;
iodata,wnpr2600g)
wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
label_mac=$wan_mac
macaddr_setbit_la "$(mtd_get_mac_binary factory 0x4)" > /sys${DEVPATH}/macaddress
;;
hiwifi,hc5962)
- label_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac")
- [ "$PHYNBR" = "0" ] && [ -n "$label_mac" ] && \
- echo -n "$label_mac" > /sys${DEVPATH}/macaddress
- [ "$PHYNBR" = "1" ] && [ -n "$label_mac" ] && \
- macaddr_unsetbit "$label_mac" 6 > /sys${DEVPATH}/macaddress
+ [ "$PHYNBR" = "1" ] && \
+ macaddr_unsetbit "$(cat /sys${DEVPATH}/macaddress)" 6 > /sys${DEVPATH}/macaddress
;;
iptime,a3002mesh|\
iptime,a3004t)
hiwifi,hc5661a|\
hiwifi,hc5761a|\
hiwifi,hc5861b)
- lan_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ")
- label_mac=$lan_mac
- [ -n "$lan_mac" ] || lan_mac=$(cat /sys/class/net/eth0/address)
- wan_mac=$(macaddr_add "$lan_mac" 1)
+ wan_mac=$(macaddr_add "$(cat /sys/class/net/eth0/address)" 1)
;;
iptime,a3|\
iptime,a604m|\
board=$(board_name)
case "$board" in
- hiwifi,hc5611|\
- hiwifi,hc5661a|\
hiwifi,hc5761a|\
hiwifi,hc5861b)
- label_mac=$(mtd_get_mac_ascii bdinfo "Vfac_mac ")
- [ "$PHYNBR" = "0" ] && [ -n "$label_mac" ] && \
- echo -n "$label_mac" > /sys${DEVPATH}/macaddress
- [ "$PHYNBR" = "1" ] && [ -n "$label_mac" ] && \
- macaddr_unsetbit "$label_mac" 6 > /sys${DEVPATH}/macaddress
+ [ "$PHYNBR" = "1" ] && \
+ macaddr_unsetbit "$(cat /sys${DEVPATH}/macaddress)" 6 > /sys${DEVPATH}/macaddress
;;
esac