You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openwrt/target/linux/ath79/base-files/etc/board.d/02_network

328 lines
8.0 KiB
Plaintext

#!/bin/sh
. /lib/functions/system.sh
. /lib/functions/uci-defaults.sh
. /lib/functions/k2t.sh
ath79_setup_interfaces()
{
local board="$1"
case "$board" in
avm,fritz300e|\
devolo,dvl1200i|\
devolo,dvl1750c|\
devolo,dvl1750i|\
ocedo,koala|\
ocedo,raccoon|\
pcs,cap324|\
pisen,wmm003n|\
pqi,air-pen|\
tplink,re450-v2|\
tplink,tl-mr10u|\
tplink,tl-mr3020-v1|\
tplink,tl-mr3040-v2|\
tplink,tl-wa901nd-v2|\
tplink,tl-wr703n|\
ubnt,bullet-m|\
ubnt,bullet-m-xw|\
ubnt,lap-120|\
ubnt,nanostation-ac-loco|\
ubnt,rocket-m|\
ubnt,unifiac-lite|\
ubnt,unifiac-mesh|\
ubnt,unifi|\
wd,mynet-wifi-rangeextender|\
winchannel,wb2000)
ucidef_set_interface_lan "eth0"
;;
avm,fritz4020|\
pcs,cr3000|\
tplink,archer-c58-v1|\
tplink,archer-c59-v1)
ucidef_set_interface_wan "eth0"
ucidef_add_switch "switch0" \
"0@eth1" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
;;
buffalo,bhr-4grv|\
buffalo,wzr-hp-g450h)
ucidef_add_switch "switch0" \
"0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
;;
buffalo,bhr-4grv2)
ucidef_add_switch "switch0" \
"0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth0"
;;
buffalo,wzr-hp-ag300h)
ucidef_set_interface_wan "eth1"
ucidef_add_switch "switch0" \
"0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
;;
buffalo,wzr-hp-g302h-a1a0)
ucidef_add_switch "switch0" \
"0@eth0" "1:lan:1" "3:lan:4" "4:lan:3" "5:lan:2" "2:wan"
;;
devolo,dvl1200e|\
devolo,dvl1750e)
ucidef_set_interface_lan "eth0 eth1"
;;
dlink,dir-825-b1)
ucidef_set_interface_wan "eth1"
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
;;
dlink,dir-825-c1|\
dlink,dir-835-a1|\
dlink,dir-859-a1|\
tplink,archer-c2-v3|\
tplink,tl-wr1043nd-v4)
ucidef_add_switch "switch0" \
"0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
;;
elecom,wrc-1750ghbk2-i|\
elecom,wrc-300ghbk2-i)
ucidef_add_switch "switch0" \
"0@eth0" "2:lan:4" "3:lan:3" "4:lan:2" "5:lan:1" "1:wan"
;;
embeddedwireless,dorin)
ucidef_add_switch "switch0" \
"0@eth0" "1:wan" "2:lan:3" "3:lan:2"
;;
engenius,ews511ap)
ucidef_set_interface_lan "eth0 eth1" "dhcp"
;;
etactica,eg200)
ucidef_set_interface_lan "eth0" "dhcp"
;;
glinet,gl-ar150|\
glinet,gl-ar300m-nand|\
glinet,gl-ar300m-nor|\
glinet,gl-x750|\
tplink,tl-wr810n-v1|\
tplink,tl-wr810n-v2|\
ubnt,routerstation)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
;;
glinet,gl-ar750s)
ucidef_add_switch "switch0" \
"0@eth0" "2:lan:2" "3:lan:1" "1:wan"
;;
iodata,etg3-r|\
iodata,wn-ac1167dgr|\
ath79: add support for I-O DATA WN-AC1600DGR I-O DATA WN-AC1600DGR is a 2.4/5 GHz band 11ac router, based on Qualcomm Atheros QCA9557. Specification: - SoC: Qualcomm Atheros QCA9557 - RAM: 128 MB - Flash: 16 MB - WLAN: 2.4/5 GHz - 2.4 GHz: 2T2R (SoC internal) - 5 GHz: 3T3R (QCA9880) - Ethernet: 5x 10/100/1000 Mbps - Switch: QCA8337N - LED/key: 6x/6x(4x buttons, 1x slide switch) - UART: through-hole on PCB - Vcc, GND, TX, RX from ethernet port side - 115200n8 Flash instruction using factory image: 1. Connect the computer to the LAN port of WN-AC1600DGR 2. Connect power cable to WN-AC1600DGR and turn on it 3. Access to "http://192.168.0.1/" and open firmware update page ("ファームウェア") 4. Select the OpenWrt factory image and click update ("更新") button 5. Wait ~150 seconds to complete flashing Alternative flash instruction using initramfs image: 1. Prepare a computer and TFTP server software with the IP address "192.168.99.8" and renamed OpenWrt initramfs image "uImageWN-AC1600DGR" 2. Connect between WN-AC1600DGR and the computer with UART 3. Connect power cable to WN-AC1600DGR, press "4" on the serial console and enter the U-Boot console 4. execute "tftpboot" command on the console and download initramfs image from the TFTP server 5. execute "bootm" command and boot OpenWrt 6. On initramfs image, download the sysupgrade image to the device and perform sysupgrade with it 7. Wait ~150 seconds to complete flashing This commit also removes unnecessary "qca,no-eeprom" property from the ath10k wifi node. Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
5 years ago
iodata,wn-ac1600dgr|\
iodata,wn-ac1600dgr2|\
iodata,wn-ag300dgr|\
pcs,cr5000)
ucidef_add_switch "switch0" \
"0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
;;
nec,wg800hp)
ucidef_add_switch "switch0" \
"0@eth0" "2:lan" "3:lan" "4:lan" "1:wan"
;;
netgear,wndr3700|\
netgear,wndr3700v2|\
netgear,wndr3800)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "switch0" \
"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5u@eth0"
ucidef_add_switch_attr "switch0" "blinkrate" 2
ucidef_add_switch_port_attr "switch0" 1 led 6
ucidef_add_switch_port_attr "switch0" 2 led 9
ucidef_add_switch_port_attr "switch0" 5 led 2
;;
netgear,wnr612-v2|\
on,n150r|\
tplink,tl-wr841-v7)
ucidef_set_interface_wan "eth0"
ucidef_add_switch "switch0" \
"0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
;;
phicomm,k2t)
ucidef_add_switch "switch0" \
"0@eth0" "3:lan:1" "5:lan:2" "4:wan"
;;
rosinson,wr818)
ucidef_add_switch "switch0" \
"0@eth0" "1:lan" "2:lan" "3:wan"
;;
tplink,archer-c5-v1|\
tplink,archer-c7-v1|\
tplink,archer-c7-v2|\
tplink,tl-wdr4900-v2)
ucidef_add_switch "switch0" \
"0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan"
;;
buffalo,whr-g301n|\
tplink,tl-mr3220-v1|\
tplink,tl-mr3420-v1|\
tplink,tl-wr841-v9|\
tplink,tl-wr841-v11|\
ubnt,airrouter)
ucidef_set_interface_wan "eth0"
ucidef_add_switch "switch0" \
"0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
;;
ath79: add support for TP-Link Archer A7 This patch adds support for TP-Link Archer A7 Specification: - SOC: QCA9563 - Flash: 16 MiB (SPI) - RAM: 128 MiB (DDR2) - Ethernet: 4x 1Gbps LAN + 1x 1Gbps WAN - Wireless: - 2.4GHz (bgn) SoC internal - 5GHz (ac) QCA988x - USB: 1x USB 2.0 port - Button: 1x power, 1x reset, 1x wps - LED: 10x LEDs - UART: holes in PCB - Vcc, GND, RX, TX from ethernet port side - 115200n8 Flash instructions: Upload openwrt-ath79-generic-tplink_archer-a7-v5-squashfs-factory.bin via the Webinterface. Flash instruction using tftp recovery: 1. Connect the computer to one of the LAN ports of the Archer A7 2. Set the computer IP to 192.168.0.66 3. Start a tftp server with the OpenWrt factory image in the tftp root directory renamed to ArcherC7v5_tp_recovery.bin 2. Connect power cable to Archer A7, press and hold the reset button and turn the router on 3. Keep the reset button pressed for ~5 seconds 4. Wait ~150 seconds to complete flashing Changes since first revision: - Flash instructions using stock image webinterface - Changed "Version 5" in model string to "v5" - Split DTS file in qca9563_tplink_archer-x7-v5.dtsi and qca9563_tplink_archer-a7-v5.dts - Firmware image is now build with dynamic partitioning - Default to ath10k-ct Changes since second revision: - Changed uboot@0 to uboot@20000 in DTS file - Fixed ordering issue in board led script - Specify firmware partition format in DTS file - Rebased Makefile device definition on common Device/tplink-safeloader-uimage definition - Merged switch section in network script (same configuration as tplink,tl-wdr3600 and tplink,tl-wdr4300) Signed-off-by: Karl-Felix Glatzer <karl.glatzer@gmx.de>
6 years ago
tplink,archer-a7-v5|\
tplink,archer-c6-v2|\
tplink,archer-c7-v4|\
tplink,archer-c7-v5|\
tplink,tl-wdr3600|\
tplink,tl-wdr4300)
ucidef_add_switch "switch0" \
"0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
;;
tplink,tl-wr1043nd-v1)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
;;
tplink,tl-wr1043nd-v2|\
tplink,tl-wr1043nd-v3)
ucidef_add_switch "switch0" \
"0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "6@eth0"
;;
tplink,tl-wr2543-v1)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
;;
tplink,tl-wr740n-v1|\
tplink,tl-wr740n-v3|\
tplink,tl-wr741-v1|\
tplink,tl-wr743nd-v1|\
tplink,tl-wr841-v5|\
tplink,tl-wr941-v4)
ucidef_set_interface_wan "eth0"
ucidef_add_switch "switch0" \
"0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
;;
tplink,tl-wr740n-v4|\
tplink,tl-wr741nd-v4|\
tplink,tl-wr841-v8|\
tplink,tl-wr842n-v1|\
tplink,tl-wr842n-v2)
ucidef_set_interface_wan "eth0"
ucidef_add_switch "switch0" \
"0@eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
;;
tplink,tl-wr941-v2)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
;;
ath79: initial support for Ubiquiti RouterStation and RouterStation Pro This adds a shared ar7161_ubnt_routerstation.dtsi as well as two other .dts files that utilize it, ar7161_ubnt_routerstation.dts and ar7161_ubnt_routerstation-pro.dts. The modifications to generic-ubnt.mk, config-default, and base-files necessary for image generation, parsing RedBoot FIS partitions, network configuration, and sysupgrade are also included. This reintroduces vital bits from platform_do_upgrade_combined() and its supporting functions to /lib/upgrade/platform.sh, which were previously removed from ath79 in 3e9d9f62258f80298710441e0db557e59e152dcf "ath79: sysupgrade: drop unused platform checks". The new function is called "routerstation_do_upgrade" and will *only* work for the RouterStation series of boards. It does however retain the ability to downgrade (e.g. from master -> 17.01.x using sysupgrade -F). All hardware is functional including the AR8216 switch (for the Pro), wireless via ath5k/ath9k using the miniPCI slots, flash, USB, button, and LED. Switch and LAN/WAN configuration is the same as it is with the equivalent ar71xx targets. MAC addresses are assigned based upon the content stored in the RedBoot config partition. Flashing via both sysupgrade and TFTP has been confirmed to work. Also, the initramfs images are now raw .bin files instead of being wrapped in a uImage (as they currently are in ar71xx), which makes them bootable with RedBoot. One notable difference to ar71xx is the inclusion of the RedBoot "fconfig" utility (analogous to U-Boot’s fw_printenv/fw_setenv) in DEVICE_PACKAGES. The FIS partitions are probed using the RedBoot MTD parser’s DT binding, whose proper usage is mutually exclusive to defining a separate fixed-partitions node for "RedBoot config". This config partition contains the board's base MAC address. The lack of a hard-coded flash location means that the mtd-mac-address property cannot be used in the .dts, so instead fconfig is used to read the MAC addresses from flash in userspace during first boot. Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl> Signed-off-by: Matt Merhar <mattmerhar@protonmail.com>
6 years ago
ubnt,routerstation-pro)
ucidef_set_interface_wan "eth0"
ucidef_add_switch "switch0" \
"0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
;;
ubnt,nanostation-ac|\
ubnt,unifiac-mesh-pro|\
ubnt,unifiac-pro)
ucidef_add_switch "switch0" \
"0@eth0" "2:lan" "3:wan"
;;
xiaomi,mi-router-4q)
ucidef_set_interface_wan "eth0"
ucidef_add_switch "switch0" \
"0@eth1" "3:lan:1" "4:lan:2"
;;
*)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
;;
esac
}
ath79_setup_macs()
{
local board="$1"
case "$board" in
avm,fritz300e)
lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)"))
;;
ath79: add support for Fritz!Box 4020 This commit adds support for the AVM Fritz!Box 4020 WiFi-router. SoC: Qualcomm Atheros QCA9561 (Dragonfly) 750MHz RAM: Winbond W971GG6KB-25 FLASH: Macronix MX25L12835F WiFi: QCA9561 b/g/n 3x3 450Mbit/s USB: 1x USB 2.0 IN: WPS button, WiFi button OUT: Power LED green, Internet LED green, WLAN LED green, LAN LED green, INFO LED green, INFO LED red UART: Header Next to Black metal shield Pinout is 3.3V - RX - TX - GND (Square Pad is 3.3V) The Serial setting is 115200-8-N-1. Tested and working: - Ethernet (LAN + WAN) - WiFi (correct MAC) - Installation via EVA bootloader - OpenWRT sysupgrade - Buttons - LEDs The USB port doesn't work. Both Root Hubs are detected as having 0 Ports: [ 3.670807] kmodloader: loading kernel modules from /etc/modules-boot.d/* [ 3.723267] usbcore: registered new interface driver usbfs [ 3.729058] usbcore: registered new interface driver hub [ 3.734616] usbcore: registered new device driver usb [ 3.744181] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver [ 3.758357] SCSI subsystem initialized [ 3.766026] ehci-platform: EHCI generic platform driver [ 3.771548] ehci-platform ehci-platform.0: EHCI Host Controller [ 3.777708] ehci-platform ehci-platform.0: new USB bus registered, assigned bus number 1 [ 3.788169] ehci-platform ehci-platform.0: irq 48, io mem 0x1b000000 [ 3.816647] ehci-platform ehci-platform.0: USB 2.0 started, EHCI 0.00 [ 3.824001] hub 1-0:1.0: USB hub found [ 3.828219] hub 1-0:1.0: config failed, hub doesn't have any ports! (err -19) [ 3.835825] ehci-platform ehci-platform.1: EHCI Host Controller [ 3.842009] ehci-platform ehci-platform.1: new USB bus registered, assigned bus number 2 [ 3.852481] ehci-platform ehci-platform.1: irq 49, io mem 0x1b400000 [ 3.886631] ehci-platform ehci-platform.1: USB 2.0 started, EHCI 0.00 [ 3.894011] hub 2-0:1.0: USB hub found [ 3.898190] hub 2-0:1.0: config failed, hub doesn't have any ports! (err -19) [ 3.908928] usbcore: registered new interface driver usb-storage [ 3.915634] kmodloader: done loading kernel modules from /etc/modules-boot.d/* A few words about the shift-register: AVM used a trick to control the shift-register for the LEDs with only 2 pins, SERCLK and MOSI. Q7S, normally used for daisy-chaining multiple shift-registers, pulls the latch, moving the shift register-state to the storage register. It also pulls down MR (normally pulled up) to clear the storage register, so the latch gets released and will not be pulled by the remaining bits in the shift-register. Shift register is all-zero after this. For that we need to make sure output 7 is set to high on driver probe. We accomplish this by using gpio-hogging. Installation via EVA: In the first seconds after Power is connected, the bootloader will listen for FTP connections on 169.254.157.1 (Might also be 192.168.178.1). Firmware can be uploaded like following: ftp> quote USER adam2 ftp> quote PASS adam2 ftp> binary ftp> debug ftp> passive ftp> quote MEDIA FLSH ftp> put openwrt-sysupgrade.bin mtd1 Note that this procedure might take up to two minutes. After transfer is complete you need to powercycle the device to boot OpenWRT. Signed-off-by: David Bauer <mail@david-bauer.net>
6 years ago
avm,fritz4020)
lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)"))
wan_mac=$(fritz_tffs -n macb -i $(find_mtd_part "tffs (1)"))
;;
dlink,dir-825-b1)
lan_mac=$(mtd_get_mac_text "caldata" 65440)
wan_mac=$(mtd_get_mac_text "caldata" 65460)
;;
dlink,dir-825-c1|\
dlink,dir-835-a1)
lan_mac=$(mtd_get_mac_text "mac" 4)
wan_mac=$(mtd_get_mac_text "mac" 24)
;;
dlink,dir-859-a1)
lan_mac=$(mtd_get_mac_ascii devdata "lanmac")
wan_mac=$(mtd_get_mac_ascii devdata "wanmac")
;;
elecom,wrc-1750ghbk2-i|\
elecom,wrc-300ghbk2-i)
wan_mac=$(macaddr_add "$(mtd_get_mac_binary ART 4098)" -2)
;;
engenius,ews511ap)
lan_mac=$(mtd_get_mac_text "u-boot-env" 233)
eth1_mac=$(macaddr_add "$lan_mac" 1)
ucidef_set_interface "eth0" ifname "eth0" protocol "none" macaddr "$lan_mac"
ucidef_set_interface "eth1" ifname "eth1" protocol "none" macaddr "$eth1_mac"
;;
iodata,etg3-r)
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
wan_mac=$(macaddr_add "$lan_mac" -1)
;;
iodata,wn-ac1167dgr|\
ath79: add support for I-O DATA WN-AC1600DGR I-O DATA WN-AC1600DGR is a 2.4/5 GHz band 11ac router, based on Qualcomm Atheros QCA9557. Specification: - SoC: Qualcomm Atheros QCA9557 - RAM: 128 MB - Flash: 16 MB - WLAN: 2.4/5 GHz - 2.4 GHz: 2T2R (SoC internal) - 5 GHz: 3T3R (QCA9880) - Ethernet: 5x 10/100/1000 Mbps - Switch: QCA8337N - LED/key: 6x/6x(4x buttons, 1x slide switch) - UART: through-hole on PCB - Vcc, GND, TX, RX from ethernet port side - 115200n8 Flash instruction using factory image: 1. Connect the computer to the LAN port of WN-AC1600DGR 2. Connect power cable to WN-AC1600DGR and turn on it 3. Access to "http://192.168.0.1/" and open firmware update page ("ファームウェア") 4. Select the OpenWrt factory image and click update ("更新") button 5. Wait ~150 seconds to complete flashing Alternative flash instruction using initramfs image: 1. Prepare a computer and TFTP server software with the IP address "192.168.99.8" and renamed OpenWrt initramfs image "uImageWN-AC1600DGR" 2. Connect between WN-AC1600DGR and the computer with UART 3. Connect power cable to WN-AC1600DGR, press "4" on the serial console and enter the U-Boot console 4. execute "tftpboot" command on the console and download initramfs image from the TFTP server 5. execute "bootm" command and boot OpenWrt 6. On initramfs image, download the sysupgrade image to the device and perform sysupgrade with it 7. Wait ~150 seconds to complete flashing This commit also removes unnecessary "qca,no-eeprom" property from the ath10k wifi node. Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
5 years ago
iodata,wn-ac1600dgr|\
iodata,wn-ac1600dgr2|\
iodata,wn-ag300dgr)
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
;;
nec,wg800hp)
lan_mac=$(mtd_get_mac_text board_data 640)
wan_mac=$(mtd_get_mac_text board_data 1152)
;;
netgear,wndr3700|\
netgear,wndr3700v2|\
netgear,wndr3800)
lan_mac=$(macaddr_setbit_la "$(mtd_get_mac_binary art 0)")
;;
phicomm,k2t)
lan_mac=$(k2t_get_mac "lan_mac")
wan_mac=$(k2t_get_mac "wan_mac")
;;
rosinson,wr818)
wan_mac=$(mtd_get_mac_binary factory 0)
lan_mac=$(macaddr_setbit_la "$wan_mac")
;;
tplink,archer-c7-v4)
base_mac=$(mtd_get_mac_binary config 8)
wan_mac=$(macaddr_add "$base_mac" 1)
;;
tplink,tl-wr1043nd-v4)
base_mac=$(mtd_get_mac_binary product-info 8)
wan_mac=$(macaddr_add "$base_mac" 1)
;;
tplink,tl-wr941-v2)
base_mac=$(mtd_get_mac_binary u-boot 130048)
wan_mac=$(macaddr_add "$base_mac" 1)
;;
ath79: initial support for Ubiquiti RouterStation and RouterStation Pro This adds a shared ar7161_ubnt_routerstation.dtsi as well as two other .dts files that utilize it, ar7161_ubnt_routerstation.dts and ar7161_ubnt_routerstation-pro.dts. The modifications to generic-ubnt.mk, config-default, and base-files necessary for image generation, parsing RedBoot FIS partitions, network configuration, and sysupgrade are also included. This reintroduces vital bits from platform_do_upgrade_combined() and its supporting functions to /lib/upgrade/platform.sh, which were previously removed from ath79 in 3e9d9f62258f80298710441e0db557e59e152dcf "ath79: sysupgrade: drop unused platform checks". The new function is called "routerstation_do_upgrade" and will *only* work for the RouterStation series of boards. It does however retain the ability to downgrade (e.g. from master -> 17.01.x using sysupgrade -F). All hardware is functional including the AR8216 switch (for the Pro), wireless via ath5k/ath9k using the miniPCI slots, flash, USB, button, and LED. Switch and LAN/WAN configuration is the same as it is with the equivalent ar71xx targets. MAC addresses are assigned based upon the content stored in the RedBoot config partition. Flashing via both sysupgrade and TFTP has been confirmed to work. Also, the initramfs images are now raw .bin files instead of being wrapped in a uImage (as they currently are in ar71xx), which makes them bootable with RedBoot. One notable difference to ar71xx is the inclusion of the RedBoot "fconfig" utility (analogous to U-Boot’s fw_printenv/fw_setenv) in DEVICE_PACKAGES. The FIS partitions are probed using the RedBoot MTD parser’s DT binding, whose proper usage is mutually exclusive to defining a separate fixed-partitions node for "RedBoot config". This config partition contains the board's base MAC address. The lack of a hard-coded flash location means that the mtd-mac-address property cannot be used in the .dts, so instead fconfig is used to read the MAC addresses from flash in userspace during first boot. Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl> Signed-off-by: Matt Merhar <mattmerhar@protonmail.com>
6 years ago
ubnt,routerstation|\
ubnt,routerstation-pro)
wan_mac=$(fconfig -s -r -d $(find_mtd_part "RedBoot config") -n ar7100_esa)
lan_mac=$(macaddr_add "$wan_mac" 1)
;;
wd,mynet-wifi-rangeextender)
lan_mac=$(nvram get et0macaddr)
;;
esac
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
}
board_config_update
board=$(board_name)
ath79_setup_interfaces $board
ath79_setup_macs $board
board_config_flush
exit 0