2018-05-06 08:20:11 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
. /lib/functions/system.sh
|
|
|
|
. /lib/functions/uci-defaults.sh
|
2018-06-13 13:14:49 +00:00
|
|
|
. /lib/functions/k2t.sh
|
2018-05-06 08:20:11 +00:00
|
|
|
|
|
|
|
ath79_setup_interfaces()
|
|
|
|
{
|
|
|
|
local board="$1"
|
|
|
|
|
|
|
|
case "$board" in
|
2018-08-02 07:14:10 +00:00
|
|
|
avm,fritz300e|\
|
2018-08-08 20:13:44 +00:00
|
|
|
ocedo,koala|\
|
2018-08-02 07:14:10 +00:00
|
|
|
ocedo,raccoon|\
|
|
|
|
pcs,cap324|\
|
2018-08-12 14:32:01 +00:00
|
|
|
pisen,wmm003n|\
|
2018-08-02 07:14:10 +00:00
|
|
|
tplink,re450-v2|\
|
|
|
|
tplink,tl-mr10u|\
|
|
|
|
tplink,tl-mr3020-v1|\
|
2018-08-13 14:14:54 +00:00
|
|
|
tplink,tl-mr3040-v2|\
|
2018-08-02 07:14:10 +00:00
|
|
|
tplink,tl-wr703n|\
|
2018-08-21 21:06:59 +00:00
|
|
|
ubnt,bullet-m|\
|
|
|
|
ubnt,rocket-m|\
|
2018-08-02 07:14:10 +00:00
|
|
|
ubnt,unifiac-lite|\
|
|
|
|
ubnt,unifiac-mesh|\
|
|
|
|
ubnt,unifi)
|
2018-05-06 08:20:11 +00:00
|
|
|
ucidef_set_interface_lan "eth0"
|
|
|
|
;;
|
2018-08-02 07:14:10 +00:00
|
|
|
buffalo,wzr-hp-g450h)
|
2018-08-02 07:14:10 +00:00
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0@eth0" "2:lan" "3:lan" "4:lan" "5:lan" "1:wan"
|
|
|
|
;;
|
2018-08-06 16:59:23 +00:00
|
|
|
buffalo,bhr-4grv2)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth0"
|
|
|
|
;;
|
2018-08-09 17:49:29 +00:00
|
|
|
dlink,dir-825-b1)
|
|
|
|
ucidef_set_interface_wan "eth1"
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0:lan" "1:lan" "2:lan" "3:lan" "5@eth0"
|
|
|
|
;;
|
2018-08-02 07:14:10 +00:00
|
|
|
embeddedwireless,dorin)
|
2018-06-05 14:56:48 +00:00
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0@eth0" "1:wan" "2:lan:3" "3:lan:2"
|
|
|
|
;;
|
2018-08-02 07:14:10 +00:00
|
|
|
etactica,eg200)
|
2018-08-02 07:14:10 +00:00
|
|
|
ucidef_set_interface_lan "eth0" "dhcp"
|
2018-05-30 13:18:55 +00:00
|
|
|
;;
|
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>
2018-08-18 16:30:46 +00:00
|
|
|
avm,fritz4020|\
|
2018-08-02 07:14:10 +00:00
|
|
|
glinet,ar150|\
|
|
|
|
glinet,ar300m)
|
2018-05-27 05:37:22 +00:00
|
|
|
ucidef_set_interfaces_lan_wan "eth1" "eth0"
|
|
|
|
;;
|
2018-08-20 07:32:42 +00:00
|
|
|
iodata,etg3-r|\
|
2018-08-16 08:08:28 +00:00
|
|
|
iodata,wn-ac1167dgr|\
|
2018-08-10 00:07:53 +00:00
|
|
|
iodata,wn-ac1600dgr2|\
|
|
|
|
pcs,cr5000)
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
|
|
|
|
;;
|
2018-08-11 22:18:53 +00:00
|
|
|
netgear,wndr3700|\
|
|
|
|
netgear,wndr3700v2|\
|
2018-08-02 07:14:10 +00:00
|
|
|
netgear,wndr3800)
|
2018-08-02 07:14:10 +00:00
|
|
|
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
|
|
|
|
;;
|
2018-08-02 07:14:10 +00:00
|
|
|
netgear,wnr612-v2|\
|
|
|
|
on,n150r)
|
2018-08-02 07:14:10 +00:00
|
|
|
ucidef_set_interface_wan "eth0"
|
2018-06-20 14:21:07 +00:00
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0@eth1" "1:lan" "2:lan" "3:lan:3" "4:lan:4"
|
2018-07-28 12:57:22 +00:00
|
|
|
;;
|
2018-08-02 07:14:10 +00:00
|
|
|
pcs,cr3000)
|
2018-07-28 12:57:22 +00:00
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0@eth1" "1:lan:1" "2:lan:4" "3:lan:3" "4:lan:2"
|
|
|
|
ucidef_set_interface_wan "eth0"
|
2018-06-20 14:21:07 +00:00
|
|
|
;;
|
2018-08-02 07:14:10 +00:00
|
|
|
phicomm,k2t)
|
2018-08-02 07:14:10 +00:00
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0@eth0" "3:lan:1" "5:lan:2" "4:wan"
|
|
|
|
;;
|
2018-08-17 16:36:32 +00:00
|
|
|
tplink,archer-c7-v1|\
|
2018-08-09 04:29:28 +00:00
|
|
|
tplink,archer-c7-v2|\
|
|
|
|
tplink,tl-wdr4900-v2)
|
2018-06-26 05:25:33 +00:00
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0@eth1" "2:lan" "3:lan" "4:lan" "5:lan" "6@eth0" "1:wan"
|
|
|
|
;;
|
2018-08-14 06:01:05 +00:00
|
|
|
buffalo,whr-g301n|\
|
2018-08-02 07:14:10 +00:00
|
|
|
tplink,tl-mr3220-v1|\
|
|
|
|
tplink,tl-mr3420-v1|\
|
|
|
|
tplink,tl-wr841-v7)
|
2018-06-26 14:01:47 +00:00
|
|
|
ucidef_set_interface_wan "eth0"
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
|
|
|
|
;;
|
2018-08-02 07:14:10 +00:00
|
|
|
tplink,tl-wdr3600|\
|
|
|
|
tplink,tl-wdr4300)
|
2018-05-18 16:06:03 +00:00
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
|
|
|
|
;;
|
2018-08-02 07:14:10 +00:00
|
|
|
tplink,tl-wr1043nd-v1)
|
2018-05-06 08:20:11 +00:00
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
|
|
|
|
;;
|
2018-08-02 07:14:10 +00:00
|
|
|
tplink,tl-wr1043nd-v2|\
|
|
|
|
tplink,tl-wr1043nd-v3)
|
2018-06-18 17:22:13 +00:00
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "6@eth0"
|
|
|
|
;;
|
2018-08-02 07:14:10 +00:00
|
|
|
tplink,tl-wr1043nd-v4)
|
2018-08-02 07:14:10 +00:00
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
|
|
|
|
;;
|
2018-08-02 07:14:10 +00:00
|
|
|
tplink,tl-wr2543-v1)
|
2018-06-20 22:02:10 +00:00
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
|
|
|
|
;;
|
2018-08-02 05:17:44 +00:00
|
|
|
tplink,tl-wr740n-v1|\
|
|
|
|
tplink,tl-wr740n-v3|\
|
|
|
|
tplink,tl-wr741-v1|\
|
|
|
|
tplink,tl-wr743nd-v1|\
|
|
|
|
tplink,tl-wr841-v5|\
|
|
|
|
tplink,tl-wr941-v4)
|
2018-08-02 07:14:10 +00:00
|
|
|
ucidef_set_interface_wan "eth0"
|
2018-05-06 08:20:11 +00:00
|
|
|
ucidef_add_switch "switch0" \
|
2018-08-02 07:14:10 +00:00
|
|
|
"0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
|
2018-05-06 08:20:11 +00:00
|
|
|
;;
|
2018-08-02 07:14:10 +00:00
|
|
|
tplink,tl-wr740nd-v4|\
|
2018-08-16 08:30:17 +00:00
|
|
|
tplink,tl-wr741nd-v4|\
|
|
|
|
tplink,tl-wr841-v9|\
|
|
|
|
tplink,tl-wr841-v11)
|
2018-08-02 07:14:10 +00:00
|
|
|
ucidef_set_interface_wan "eth0"
|
2018-05-06 08:20:11 +00:00
|
|
|
ucidef_add_switch "switch0" \
|
2018-08-02 07:14:10 +00:00
|
|
|
"0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
|
2018-05-06 08:20:11 +00:00
|
|
|
;;
|
2018-08-13 12:32:02 +00:00
|
|
|
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>
2018-08-27 13:59:09 +00:00
|
|
|
ubnt,routerstation)
|
|
|
|
ucidef_set_interfaces_lan_wan "eth1" "eth0"
|
|
|
|
;;
|
|
|
|
ubnt,routerstation-pro)
|
|
|
|
ucidef_set_interface_wan "eth0"
|
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0@eth1" "2:lan:3" "3:lan:2" "4:lan:1"
|
|
|
|
;;
|
2018-08-02 07:14:10 +00:00
|
|
|
ubnt,unifiac-mesh-pro|\
|
|
|
|
ubnt,unifiac-pro)
|
2018-06-26 07:30:46 +00:00
|
|
|
ucidef_add_switch "switch0" \
|
|
|
|
"0@eth0" "2:lan" "3:wan"
|
|
|
|
;;
|
2018-05-06 08:20:11 +00:00
|
|
|
*)
|
|
|
|
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2018-03-02 18:28:50 +00:00
|
|
|
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>
2018-08-18 16:30:46 +00:00
|
|
|
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)"))
|
|
|
|
;;
|
2018-08-09 17:49:29 +00:00
|
|
|
dlink,dir-825-b1)
|
|
|
|
lan_mac=$(mtd_get_mac_text "caldata" 65440)
|
|
|
|
wan_mac=$(mtd_get_mac_text "caldata" 65460)
|
|
|
|
;;
|
2018-08-20 07:32:42 +00:00
|
|
|
iodata,etg3-r)
|
|
|
|
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
|
|
|
|
wan_mac=$(macaddr_add "$lan_mac" -1)
|
|
|
|
;;
|
2018-08-16 08:08:28 +00:00
|
|
|
iodata,wn-ac1167dgr|\
|
2018-08-10 00:07:53 +00:00
|
|
|
iodata,wn-ac1600dgr2)
|
|
|
|
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
|
|
|
|
wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
|
|
|
|
;;
|
2018-08-13 20:10:47 +00:00
|
|
|
netgear,wndr3700|\
|
|
|
|
netgear,wndr3700v2|\
|
|
|
|
netgear,wndr3800)
|
|
|
|
lan_mac=$(macaddr_setbit_la "$(mtd_get_mac_binary art 0)")
|
|
|
|
;;
|
2018-06-13 13:14:49 +00:00
|
|
|
phicomm,k2t)
|
|
|
|
lan_mac=$(k2t_get_mac "lan_mac")
|
|
|
|
wan_mac=$(k2t_get_mac "wan_mac")
|
|
|
|
;;
|
2018-08-02 07:14:10 +00:00
|
|
|
tplink,tl-wr1043nd-v4)
|
2018-06-23 07:52:10 +00:00
|
|
|
base_mac=$(mtd_get_mac_binary product-info 8)
|
|
|
|
wan_mac=$(macaddr_add "$base_mac" 1)
|
|
|
|
;;
|
2018-08-13 12:32:02 +00:00
|
|
|
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>
2018-08-27 13:59:09 +00:00
|
|
|
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)
|
|
|
|
;;
|
2018-03-02 18:28:50 +00:00
|
|
|
esac
|
|
|
|
|
|
|
|
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
|
2018-06-13 13:14:49 +00:00
|
|
|
[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
|
2018-03-02 18:28:50 +00:00
|
|
|
}
|
|
|
|
|
2018-05-06 08:20:11 +00:00
|
|
|
board_config_update
|
|
|
|
board=$(board_name)
|
|
|
|
ath79_setup_interfaces $board
|
2018-03-02 18:28:50 +00:00
|
|
|
ath79_setup_macs $board
|
2018-05-06 08:20:11 +00:00
|
|
|
board_config_flush
|
|
|
|
|
|
|
|
exit 0
|