wan_mac=$(get_mac_label)
lan_mac=$(macaddr_add "$wan_mac" 1)
;;
- linksys,ea6350v3|\
- linksys,ea8300|\
- linksys,mr6350|\
- linksys,mr8300)
- wan_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
- lan_mac=$(macaddr_add "$wan_mac" 1)
- ;;
- linksys,whw03)
- wan_mac=$(mmc_get_mac_ascii devinfo hw_mac_addr)
- lan_mac="$wan_mac"
- ;;
mikrotik,cap-ac|\
mikrotik,hap-ac2|\
mikrotik,hap-ac3|\
/usr/bin/fritz_cal_extract -i 1 -s 0x3C800 -e 0x212 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1") || \
/usr/bin/fritz_cal_extract -i 1 -s 0x3C000 -e 0x212 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1")
;;
- linksys,ea8300|\
- linksys,mr6350|\
- linksys,mr8300)
- caldata_extract "ART" 0x9000 0x2f20
- # OEM assigns 4 sequential MACs
- ath10k_patch_mac $(macaddr_setbit_la $(macaddr_add "$(cat /sys/class/net/eth0/address)" 4))
- ;;
- linksys,whw03)
- caldata_extract_mmc "0:ART" 0x9000 0x2f20
- ath10k_patch_mac $(macaddr_add "$(cat /sys/class/net/eth0/address)" 3)
- ;;
netgear,rbr40|\
netgear,rbs40|\
netgear,rbr50|\
caldata_extract "ART" 0x1000 0x2f20
ath10k_patch_mac $(mtd_get_mac_ascii CFG1 RADIOADDR0)
;;
- linksys,ea8300|\
- linksys,mr6350|\
- linksys,mr8300)
- caldata_extract "ART" 0x1000 0x2f20
- ath10k_patch_mac $(macaddr_add "$(cat /sys/class/net/eth0/address)" 2)
- ;;
- linksys,whw03)
- caldata_extract_mmc "0:ART" 0x1000 0x2f20
- ath10k_patch_mac $(macaddr_add "$(cat /sys/class/net/eth0/address)" 1)
- ;;
mikrotik,cap-ac|\
mikrotik,hap-ac2|\
mikrotik,hap-ac3|\
caldata_extract "ART" 0x5000 0x2f20
ath10k_patch_mac $(mtd_get_mac_ascii CFG1 RADIOADDR1)
;;
- linksys,ea8300|\
- linksys,mr6350|\
- linksys,mr8300)
- caldata_extract "ART" 0x5000 0x2f20
- ath10k_patch_mac $(macaddr_add "$(cat /sys/class/net/eth0/address)" 3)
- ;;
- linksys,whw03)
- caldata_extract_mmc "0:ART" 0x5000 0x2f20
- ath10k_patch_mac $(macaddr_add "$(cat /sys/class/net/eth0/address)" 2)
- ;;
mikrotik,cap-ac|\
mikrotik,hap-ac2|\
mikrotik,hap-ac3|\
extreme-networks,ws-ap391x)
ip link set dev eth0 address $(mtd_get_mac_ascii CFG1 ethaddr)
;;
- linksys,ea8300|\
- linksys,mr6350|\
- linksys,mr8300)
- base_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
- ip link set dev lan1 address $(macaddr_add "$base_mac" 1)
- ip link set dev eth0 address $(macaddr_setbit "$base_mac" 7)
- ;;
- linksys,whw03)
- base_mac=$(mmc_get_mac_ascii devinfo hw_mac_addr)
- ip link set dev eth0 address "$base_mac"
- ip link set dev lan address "$base_mac"
- ip link set dev wan address "$base_mac"
- ;;
mikrotik,wap-ac|\
mikrotik,wap-ac-lte|\
mikrotik,wap-r-ac)
CONFIG_NR_CPUS=4
CONFIG_NVMEM=y
CONFIG_NVMEM_LAYOUTS=y
+CONFIG_NVMEM_LAYOUT_ASCII_ENV=y
CONFIG_NVMEM_LAYOUT_U_BOOT_ENV=y
CONFIG_NVMEM_QCOM_QFPROM=y
# CONFIG_NVMEM_QCOM_SEC_QFPROM is not set
qcom,ath10k-calibration-variant = "linksys-ea8300-fcc";
};
-&pcie_bridge0 {
- wifi@0,0 {
- compatible = "qcom,ath10k";
- reg = <0x00010000 0 0 0 0>;
- ieee80211-freq-limit = <5490000 5835000>;
- qcom,ath10k-calibration-variant = "linksys-ea8300-fcc";
- };
+&wifi2 {
+ status = "okay";
+ ieee80211-freq-limit = <5490000 5835000>;
+ qcom,ath10k-calibration-variant = "linksys-ea8300-fcc";
};
// Top panel LEDs, above Linksys logo
leds {
compatible = "gpio-leds";
-
+
led_blue: led-blue {
color = <LED_COLOR_ID_BLUE>;
function = LED_FUNCTION_STATUS;
reset-delay-us = <2000>;
reset-post-delay-us = <5000>;
};
-
+
&tlmm {
status = "okay";
qcom,ath10k-calibration-variant = "linksys-mr8300-v0-fcc";
};
-&pcie_bridge0 {
- wifi@0,0 {
- compatible = "qcom,ath10k";
- reg = <0x00010000 0 0 0 0>;
- ieee80211-freq-limit = <5490000 5835000>;
- qcom,ath10k-calibration-variant = "linksys-mr8300-v0-fcc";
- };
+&wifi2 {
+ status = "okay";
+ ieee80211-freq-limit = <5490000 5835000>;
+ qcom,ath10k-calibration-variant = "linksys-mr8300-v0-fcc";
};
sd-ldo-gpios = <&tlmm 33 GPIO_ACTIVE_LOW>;
vqmmc-supply = <&vqmmc>;
+
+ card@0 {
+ compatible = "mmc-card";
+ reg = <0>;
+
+ block {
+ compatible = "block-device";
+ partitions {
+ block-partition-art {
+ partname = "art";
+
+ nvmem-layout {
+ compatible = "fixed-layout";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ precal_art_1000: pre-calibration@1000 {
+ reg = <0x1000 0x2f20>;
+ };
+
+ precal_art_5000: pre-calibration@5000 {
+ reg = <0x5000 0x2f20>;
+ };
+
+ precal_art_9000: pre-calibration@9000 {
+ reg = <0x9000 0x2f20>;
+ };
+ };
+ };
+
+ block-partition-devinfo {
+ partname = "devinfo";
+
+ nvmem-layout {
+ compatible = "ascii-eq-delim-env";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ hw_mac_addr: hw_mac_addr {
+ compatible = "mac-base";
+ #nvmem-cell-cells = <1>;
+ };
+ };
+ };
+ };
+ };
+ };
+};
+
+&gmac {
+ nvmem-cells = <&hw_mac_addr 0>;
+ nvmem-cell-names = "mac-address";
};
&wifi0 {
qcom,ath10k-calibration-variant = "linksys-whw03";
+
+ nvmem-cells = <&precal_art_1000>, <&hw_mac_addr 1>;
+ nvmem-cell-names = "pre-calibration", "mac-address";
};
&wifi1 {
qcom,ath10k-calibration-variant = "linksys-whw03";
+
+ nvmem-cells = <&precal_art_5000>, <&hw_mac_addr 2>;
+ nvmem-cell-names = "pre-calibration", "mac-address";
};
&pcie_bridge0 {
reg = <0x00010000 0 0 0 0>;
ieee80211-freq-limit = <5490000 5835000>;
qcom,ath10k-calibration-variant = "linksys-whw03";
+ nvmem-cells = <&precal_art_9000>, <&hw_mac_addr 3>;
+ nvmem-cell-names = "pre-calibration", "mac-address";
};
};
/ {
aliases {
- ethernet0 = &gmac;
led-boot = &led_blue;
led-failsafe = &led_red;
led-running = &led_blue;
bootargs-append = " root=/dev/ubiblock0_0 rootfstype=squashfs ro";
};
-
- aliases {
- // TODO: Verify if the ethernet0 alias is needed
- ethernet0 = &gmac;
- };
-
soc {
tcsr@1949000 {
compatible = "qcom,tcsr";
label = "ART";
reg = <0x400000 0x80000>;
read-only;
+
+ nvmem-layout {
+ compatible = "fixed-layout";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ precal_art_1000: pre-calibration@1000 {
+ reg = <0x1000 0x2f20>;
+ };
+
+ precal_art_5000: pre-calibration@5000 {
+ reg = <0x5000 0x2f20>;
+ };
+
+ precal_art_9000: pre-calibration@9000 {
+ reg = <0x9000 0x2f20>;
+ };
+ };
};
partition@480000 {
label = "devinfo";
reg = <0x740000 0x40000>;
read-only;
+
+ nvmem-layout {
+ compatible = "ascii-eq-delim-env";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ hw_mac_addr: hw_mac_addr {
+ compatible = "mac-base";
+ #nvmem-cell-cells = <1>;
+ };
+ };
};
partition@780000 {
&gmac {
status = "okay";
+
+ nvmem-cells = <&hw_mac_addr 1>;
+ nvmem-cell-names = "mac-address";
};
&switch {
&swport5 {
status = "okay";
+
+ nvmem-cells = <&hw_mac_addr 0>;
+ nvmem-cell-names = "mac-address";
+};
+
+&wifi0 {
+ nvmem-cells = <&precal_art_1000>, <&hw_mac_addr 2>;
+ nvmem-cell-names = "pre-calibration", "mac-address";
+};
+
+&wifi1 {
+ nvmem-cells = <&precal_art_5000>, <&hw_mac_addr 3>;
+ nvmem-cell-names = "pre-calibration", "mac-address";
+};
+
+&pcie_bridge0 {
+ wifi2: wifi@0,0 {
+ compatible = "qcom,ath10k";
+ reg = <0x00010000 0 0 0 0>;
+ nvmem-cells = <&precal_art_9000>, <&hw_mac_addr 4>;
+ nvmem-cell-names = "pre-calibration", "mac-address";
+
+ status = "disabled";
+ };
};
[ "$PHYNBR" = "0" ] && echo $(mtd_get_mac_ascii CFG1 RADIOADDR0) > /sys${DEVPATH}/macaddress
[ "$PHYNBR" = "1" ] && echo $(mtd_get_mac_ascii CFG1 RADIOADDR1) > /sys${DEVPATH}/macaddress
;;
- linksys,ea7500-v1|\
- linksys,ea8500)
- macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) $(($PHYNBR + 1)) > /sys${DEVPATH}/macaddress
- ;;
esac
OPATH=${DEVPATH##/devices/platform/}
wifi@0,0 {
compatible = "qcom,ath10k";
reg = <0x10000 0 0 0 0>;
- nvmem-cells = <&precal_art_1000>;
- nvmem-cell-names = "pre-calibration";
+ nvmem-cells = <&precal_art_1000>, <&hw_mac_addr 1>;
+ nvmem-cell-names = "pre-calibration", "mac-address";
};
};
wifi@0,0 {
compatible = "qcom,ath10k";
reg = <0x10000 0 0 0 0>;
- nvmem-cells = <&precal_art_5000>;
- nvmem-cell-names = "pre-calibration";
+ nvmem-cells = <&precal_art_5000>, <&hw_mac_addr 2>;
+ nvmem-cell-names = "pre-calibration", "mac-address";
};
};
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_power;
+ label-mac-device = &gmac0;
serial0 = &uart0;
};
label = "devinfo";
reg = <0x51c0000 0x40000>;
read-only;
+
+ nvmem-layout {
+ compatible = "ascii-eq-delim-env";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ hw_mac_addr: hw_mac_addr {
+ compatible = "mac-base";
+
+ #nvmem-cell-cells = <1>;
+ };
+ };
};
partition@5200000 {
};
};
+&gmac0 {
+ nvmem-cells = <&hw_mac_addr 0>;
+ nvmem-cell-names = "mac-address";
+};
+
+&gmac1 {
+ nvmem-cells = <&hw_mac_addr 0>;
+ nvmem-cell-names = "mac-address";
+};
+
&ssusb {
vusb33-supply = <®_3p3v>;
vbus-supply = <®_5v>;
local board="$1"
case $board in
- linksys,ea7500-v3)
- lan_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
- wan_mac=$lan_mac
- label_mac=$lan_mac
- ;;
netgear,ex6250-v2)
lan_mac=$(mtd_get_mac_ascii Config mac)
label_mac=$lan_mac
CONFIG_NR_CPUS=2
CONFIG_NVMEM=y
CONFIG_NVMEM_LAYOUTS=y
+CONFIG_NVMEM_LAYOUT_ASCII_ENV=y
# CONFIG_NVMEM_LAYOUT_ADTRAN is not set
# CONFIG_NVMEM_MTK_EFUSE is not set
CONFIG_NVMEM_SYSFS=y
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_power;
+ label-mac-device = &gmac0;
};
chosen {
label = "devinfo";
reg = <0x140000 0x40000>;
read-only;
+
+ nvmem-layout {
+ compatible = "ascii-eq-delim-env";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ hw_mac_addr: hw_mac_addr {
+ compatible = "mac-base";
+
+ #nvmem-cell-cells = <1>;
+ };
+ };
};
partition@180000 {
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
- nvmem-cells = <&eeprom_factory_0>;
- nvmem-cell-names = "eeprom";
+ nvmem-cells = <&eeprom_factory_0>, <&hw_mac_addr 1>;
+ nvmem-cell-names = "eeprom", "mac-address";
};
};
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
- nvmem-cells = <&eeprom_factory_8000>;
- nvmem-cell-names = "eeprom";
+ nvmem-cells = <&eeprom_factory_8000>, <&hw_mac_addr 2>;
+ nvmem-cell-names = "eeprom", "mac-address";
};
};
+&gmac0 {
+ nvmem-cells = <&hw_mac_addr 0>;
+ nvmem-cell-names = "mac-address";
+};
+
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <ðphy4>;
+
+ nvmem-cells = <&hw_mac_addr 0>;
+ nvmem-cell-names = "mac-address";
};
ðphy4 {
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_power;
+ label-mac-device = &gmac0;
};
chosen {
label = "devinfo";
reg = <0x140000 0x40000>;
read-only;
+
+ nvmem-layout {
+ compatible = "ascii-eq-delim-env";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ hw_mac_addr: hw_mac_addr {
+ compatible = "mac-base";
+
+ #nvmem-cell-cells = <1>;
+ };
+ };
};
partition@180000 {
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
- nvmem-cells = <&eeprom_factory_0>;
- nvmem-cell-names = "eeprom";
+ nvmem-cells = <&eeprom_factory_0>, <&hw_mac_addr 1>;
+ nvmem-cell-names = "eeprom", "mac-address";
};
};
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
- nvmem-cells = <&eeprom_factory_8000>;
- nvmem-cell-names = "eeprom";
+ nvmem-cells = <&eeprom_factory_8000>, <&hw_mac_addr 2>;
+ nvmem-cell-names = "eeprom", "mac-address";
};
};
+&gmac0 {
+ nvmem-cells = <&hw_mac_addr 0>;
+ nvmem-cell-names = "mac-address";
+};
+
&gmac1 {
status = "okay";
label = "wan";
phy-handle = <ðphy0>;
+
+ nvmem-cells = <&hw_mac_addr 0>;
+ nvmem-cell-names = "mac-address";
};
ðphy0 {
wan_mac=$lan_mac
label_mac=$lan_mac
;;
- linksys,e5600|\
- linksys,ea6350-v4|\
- linksys,ea7300-v1|\
- linksys,ea7300-v2|\
- linksys,ea7500-v2|\
- linksys,ea8100-v1|\
- linksys,ea8100-v2)
- lan_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
- wan_mac=$lan_mac
- label_mac=$lan_mac
- ;;
belkin,rt1800|\
linksys,e7350)
lan_mac=$(mtd_get_mac_ascii Config lan_hwaddr)
[ "$PHYNBR" = "1" ] && \
macaddr_setbit_la "$(mtd_get_mac_binary rf-eeprom 0x4)" > /sys${DEVPATH}/macaddress
;;
- linksys,e5600|\
- linksys,ea6350-v4|\
- linksys,ea7300-v1|\
- linksys,ea7300-v2|\
- linksys,ea7500-v2|\
- linksys,ea8100-v1|\
- linksys,ea8100-v2)
- hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
- [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress
- [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress
- ;;
belkin,rt1800|\
linksys,e7350)
hw_mac_addr=$(mtd_get_mac_ascii Config wan_hwaddr)
CONFIG_NR_CPUS=4
CONFIG_NVMEM=y
CONFIG_NVMEM_LAYOUTS=y
+CONFIG_NVMEM_LAYOUT_ASCII_ENV=y
CONFIG_NVMEM_LAYOUT_MIKROTIK=y
CONFIG_NVMEM_LAYOUT_U_BOOT_ENV=y
CONFIG_OF=y