model = "Zyxel NBG6616";
aliases {
+ label-mac-device = &wmac;
led-boot = &led_power;
led-failsafe = &led_power;
led-running = &led_power;
};
partition@30000 {
+ compatible = "u-boot,env";
label = "u-boot-env";
reg = <0x030000 0x010000>;
+
+ macaddr_uboot_ethaddr: ethaddr {
+ #nvmem-cell-cells = <1>;
+ };
};
partition@40000 {
wifi@0,0 {
compatible = "qcom,ath10k";
reg = <0 0 0 0 0>;
- nvmem-cells = <&cal_art_5000>;
- nvmem-cell-names = "calibration";
+ nvmem-cells = <&cal_art_5000>, <&macaddr_uboot_ethaddr 1>;
+ nvmem-cell-names = "calibration", "mac-address";
};
};
model = "Zyxel NBG6716";
aliases {
+ label-mac-device = &wmac;
led-boot = &led_power;
led-failsafe = &led_power;
led-running = &led_power;
};
partition@40000 {
+ compatible = "u-boot,env";
label = "u-boot-env";
reg = <0x040000 0x010000>;
+
+ macaddr_uboot_ethaddr: ethaddr {
+ #nvmem-cell-cells = <1>;
+ };
};
partition@50000 {
wifi@0,0 {
compatible = "qcom,ath10k";
reg = <0 0 0 0 0>;
- nvmem-cells = <&cal_art_5000>;
- nvmem-cell-names = "calibration";
+ nvmem-cells = <&cal_art_5000>, <&macaddr_uboot_ethaddr 1>;
+ nvmem-cell-names = "calibration", "mac-address";
qcom,ath10k-calibration-variant = "ZyXEL-NBG6716";
};
};
pll-data = <0xa6000000 0x00000101 0x00001616>;
phy-handle = <&phy17>;
+ nvmem-cells = <&macaddr_uboot_ethaddr 2>;
+ nvmem-cell-names = "mac-address";
+
fixed-link {
speed = <1000>;
full-duplex;
pll-data = <0x03000101 0x00000101 0x00001616>;
phy-handle = <&phy1>;
+ nvmem-cells = <&macaddr_uboot_ethaddr 3>;
+ nvmem-cell-names = "mac-address";
+
fixed-link {
speed = <1000>;
full-duplex;
&wmac {
status = "okay";
- nvmem-cells = <&cal_art_1000>;
- nvmem-cell-names = "calibration";
+ nvmem-cells = <&cal_art_1000>, <&macaddr_uboot_ethaddr 0>;
+ nvmem-cell-names = "calibration", "mac-address";
};
&usb_phy0 {
xiaomi,aiot-ac2350)
lan_mac=$(mtd_get_mac_binary art 0x1002)
;;
- zyxel,nbg6616)
- label_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
- ;;
esac
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
iodata,wn-ac1600dgr|\
iodata,wn-ac1600dgr2|\
sitecom,wlr-7100|\
- sitecom,wlr-8100|\
- zyxel,nbg6616)
+ sitecom,wlr-8100)
# There is no eeprom data for 5 GHz wlan in "art" partition
# which would allow to patch the macaddress
[ "$PHYNBR" -eq 0 ] && \
[ "$PHYNBR" -eq 0 ] && \
macaddr_add "$(mtd_get_mac_text mac 0x18)" 1 > /sys${DEVPATH}/macaddress
;;
- zyxel,nbg6616)
- # Set mac address for 2.4g device
- [ "$PHYNBR" -eq 1 ] && \
- mtd_get_mac_ascii u-boot-env ethaddr > /sys${DEVPATH}/macaddress
- ;;
zyxel,nwa1123-ac)
[ "$PHYNBR" -eq 0 ] && \
mtd_get_mac_text mib0 0x66 > /sys${DEVPATH}/macaddress
base_mac=$(mtd_get_mac_encrypted_deco $(find_mtd_part config))
ip link set dev eth0 address $base_mac
;;
- zyxel,nbg6616)
- ethaddr=$(mtd_get_mac_ascii u-boot-env ethaddr)
- ip link set dev eth0 address $(macaddr_add $ethaddr 2)
- ip link set dev eth1 address $(macaddr_add $ethaddr 3)
- ;;
esac
}
+++ /dev/null
-[ "$ACTION" = "add" ] || exit 0
-
-PHYNBR=${DEVPATH##*/phy}
-
-[ -n $PHYNBR ] || exit 0
-
-. /lib/functions.sh
-. /lib/functions/system.sh
-
-board=$(board_name)
-
-case $board in
- zyxel,emg2926-q10a|\
- zyxel,nbg6716)
- ethaddr=$(mtd_get_mac_ascii u-boot-env ethaddr)
- [ "$PHYNBR" -eq 0 ] && \
- macaddr_add $ethaddr 1 > /sys${DEVPATH}/macaddress
- [ "$PHYNBR" -eq 1 ] && \
- echo -n $ethaddr > /sys${DEVPATH}/macaddress
- ;;
-esac
+++ /dev/null
-. /lib/functions.sh
-. /lib/functions/system.sh
-
-preinit_set_mac_address() {
- case $(board_name) in
- zyxel,emg2926-q10a|\
- zyxel,nbg6716)
- ethaddr=$(mtd_get_mac_ascii u-boot-env ethaddr)
- ip link set dev eth0 address $(macaddr_add $ethaddr 2)
- ip link set dev eth1 address $(macaddr_add $ethaddr 3)
- ;;
- esac
-}
-
-boot_hook_add preinit_main preinit_set_mac_address
CONFIG_MTD_UBI_BEB_LIMIT=20
CONFIG_MTD_UBI_BLOCK=y
CONFIG_MTD_UBI_WL_THRESHOLD=4096
+CONFIG_NVMEM_U_BOOT_ENV=y
# CONFIG_PCI_AR71XX is not set
CONFIG_POWER_RESET=y
CONFIG_POWER_RESET_GPIO_RESTART=y