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/ramips/base-files/etc/board.d/02_network

714 lines
16 KiB
Plaintext

#!/bin/sh
. /lib/functions.sh
. /lib/functions/uci-defaults.sh
. /lib/functions/system.sh
ramips_setup_rt3x5x_vlans()
{
if [ ! -x /sbin/swconfig ]; then
# legacy default
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
return
fi
local wanports=""
local lanports=""
for port in 5 4 3 2 1 0; do
if [ `swconfig dev rt305x port $port get disable` = "1" ]; then
continue
fi
if [ `swconfig dev rt305x port $port get lan` = "0" ]; then
wanports="$port:wan $wanports"
else
lanports="$port:lan $lanports"
fi
done
ucidef_add_switch "rt305x" $lanports $wanports "6t@eth0"
}
ramips_setup_interfaces()
{
local board="$1"
case $board in
wevo,11acnas|\
d-team,newifi-d2|\
dlink,dir-615-h1|\
wevo,w2914ns-v2|\
zbtlink,zbt-we2026)
ucidef_add_switch "switch0" \
"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan:5" "6@eth0"
;;
asiarf,ap7621-001)
ucidef_add_switch "switch0" "0:lan" "4:wan" "6@eth0"
;;
tenda,3g150b|\
tenda,3g300m|\
unbranded,a5-v11|\
allnet,all0256n-4m|\
allnet,all0256n-8m|\
allnet,all5002|\
allnet,all5003|\
yukai,bocco|\
hauppauge,broadway|\
dlink,dcs-930|\
dlink,dcs-930l-b1|\
ramips: add support for Edimax EW-7476RPC / EW-7478AC SoC: MediaTek MT7620a @ 580MHz RAM: 64M (Winbond W9751G6KB-25) FLASH: 8MB (Macronix) WiFi: SoC-integrated: MediaTek MT7620a bgn WiFi: MediaTek MT7612EN nac GbE: 1x (RTL8211E) BTN: WPS - RFKILL/RF 50%/RF 100% toggle LED: - Wifi 5g (blue) - Wifi 2g (blue) - Crossband (green) - Power (green) - WPS (green) - LAN (Green) UART: UART is present as Pads with throughholes on the PCB. They are located next to the switch for the wifi configuration 3.3V - RX - GND - TX / 57600-8N1 3.3V is the square pad Installation ------------ Update the factory image via the web-interfaces (by default: 192.168.9.2/24). http://192.168.9.2/index.asp ramips: add Edimax EW-7478AC SoC: MediaTek MT7620a @ 580MHz RAM: 64M (Winbond W9751G6KB-25) FLASH: 8MB (Macronix) WiFi: SoC-integrated: MediaTek MT7620a bgn WiFi: MediaTek MT7612EN nac GbE: 1x (RTL8211E) BTN: WPS - RFKILL/RF 50%/RF 100% toggle LED: - Wifi 5g (blue) - Wifi 2g (blue) - Crossband (green) - Power (green) - WPS (green) - LAN (Green) UART: UART is present as Pads with throughholes on the PCB. They are located next to the switch for the wifi configuration 3.3V - RX - GND - TX / 57600-8N1 3.3V is the square pad Installation ------------ Update the factory image via the web-interfaces (by default: http://edimaxext.setup) Or push wpa button on power on and send firmware via tftp to 192.168.1.6 The EW-7478AC is identical to the EW-7476RPC, except instead of 2 internal antennas it has 2 external ones. Signed-off-by: Birger Koblitz <mail@birger-koblitz.de> [merge conflict in 01_leds] Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
edimax,ew-7476rpc|\
edimax,ew-7478ac|\
hootoo,ht-tm02|\
kimax,u35wf|\
mediatek,linkit-smart-7688|\
intenso,memory2move|\
microduino,microwrt|\
ramips: add support for MikroTik RouterBOARD RBM11g This commit adds support for the MikroTik RouterBOARD RBM11g. =Hardware= The RBM11g is a mt7621 based device featuring one GbE port and one miniPCIe slot with a sim card socket and USB 2.0. ==Switch== The single onboard Ethernet port is connected the CPU directly. The internal switch of the mt7621 SoC is disabled. ==Flash== The device has one spi nor flash chip. It is a 128 Mbit winbond 25Q128FVS connected to CS0. ==PCIe== The board features a single miniPCIe slot. It has a dedicated mini SIM socket and a USB 2.0 port. Power to the miniPCIe slot is controlled via GPIO9. ==USB== There are no external USB ports. ==Power== The board can accept both, passive PoE and external power via a 2.1 mm barrel jack (center-positive). The input voltage range is 11-32 V. ==Serial port== The device does have an onboard UART on an unpopulated header next to the flash chip: GND: pin 2 TX: pin 7 RX: pin 6 Settings: 115200, 8N1 See below illustration for positioning of the header. 0 = screw hole * = some pin T = TX pin R = RX pin G = GND pin Pinout: +--------------- |O | __ | / \ | \__/ | | | | +---+ | |RAM| | +--+ | | | |**| <- unpopulated header with UART | |*T| +---+ | |R*| +--------+ | |**| | | | |G*| | CPU | | +--+ | | | +--+ | | | | | +--------+ | +--+ <- flash chip |O | +-----+ | | | |+--+ | | || | | | +--------------------- =Installation= To install an OpenWRT image to the device two components must be built: 1. A openwrt initramfs image 2. A openwrt sysupgrade image ===initramfs & sysupgrade image=== Select target devices "Mikrotik RBM11G" in openwrt menuconfig and build the images. This will create the images "openwrt-ramips-mt7621-mikrotik_rbm11g-initramfs-kernel.bin" and "openwrt-ramips-mt7621-mikrotik_rbm11g-squashfs-sysupgrade.bin" in the output directory. ==Installing== **Make sure to back up your RouterOS license in case you do ever want to go back to RouterOS using "/system license output" and back up the created license file.** When rebooted the board will try booting via ethernet first. If your board does not boot via ethernet automatically you will have to attach to the serial port and set ethernet as boot device within RouterBOOT. 1. Set up a dhcp server that points the bootfile to tftp server serving the "openwrt-ramips-mt7621-mikrotik_rbm11g-initramfs-kernel.bin" initramfs image 2. Connect to ethernet port on board 3. Power on the board 4. Wait for OpenWrt to boot Right now OpenWrt will be running with a SSH server listening. Now OpenWrt must be flashed to the devices flash: 1. Copy "openwrt-ramips-mt7621-mikrotik_rbm11g-squashfs-sysupgrade.bin" to the device using scp. 2. Write openwrt to flash using "sysupgrade openwrt-ramips-mt7621-mikrotik_rbm11g-squashfs-sysupgrade.bin" Once the flashing completes the board will reboot. Disconnect from the devices ethernet port or stop the DHCP/TFTP server to prevent the device from booting via ethernet again. The device should now boot straight to OpenWrt. Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
6 years ago
mikrotik,rbm11g|\
hame,mpr-a2|\
wansview,ncs601w|\
onion,omega2|\
onion,omega2p|\
thunder,timecloud|\
tplink,tl-wa801nd-v5|\
tenda,w150m|\
widora,neo-16m|\
widora,neo-32m|\
netgear,wnce2001|\
zbtlink,zbt-cpe102|\
zorlik,zl5900v2|\
zte,q7)
ucidef_add_switch "switch0"
ucidef_add_switch_attr "switch0" "enable" "false"
ucidef_set_interface_lan "eth0"
;;
kingston,mlw221|\
aximcom,mr-102n)
ucidef_set_interface_lan "eth0.2"
;;
edimax,3g-6200n|\
aigale,ai-br100|\
alfa-network,ac1200rm|\
mediatek,ap-mt7621a-v60|\
xzwifi,creativebox-v1|\
sanlinking,d240|\
planex,db-wrt01|\
dlink,dir-300-b7|\
dlink,dir-320-b1|\
dlink,dir-610-a1|\
dlink,dir-615-h1|\
dlink,dir-810l|\
dlink,dwr-116-a1|\
dlink,dwr-921-c1|\
ramips: add support for DLINK DWR-922-E2 Very similar to the DWR-921-C1, except has a telephony/RJ11 port (not sure if supported, I didn't try), wireless router with QMI LTE embedded modem is based on the MT7620N SoC. Specification: * MediaTek MT7620N (580 Mhz) * 64 MB of RAM * 16 MB of FLASH * 802.11bgn radio * 5x 10/100 Mbps Ethernet (1 WAN and 4 LAN) * 2x external, detachable (LTE) antennas * UART header on PCB (57600 8n1) * 6x LED (GPIO-controlled) * 1x bi-color Signal Strength LED (GPIO-controlled) * 2x button * JBOOT bootloader The status led has been assigned to the dwr-922-e2:green:signalstrength (lte signal strength) led. At the end of the boot it is switched off and is available for lte operation. Works correctly also during sysupgrade operation. Installation: Apply factory image via d-link http web-gui, or via recovery interface: How to recover/revert to OEM firmware: 1.) Push and hold the reset button and turn on the power. Wait until all LEDs start rapidly blinking (~10sec.) 2.) DHCP should give you an IP in the 192.168.123.0/24 subnet, or set one manually 3.) Upload original factory image via JBOOT http interface at IP 192.168.123.254 4.) If http doesn't work, it can be done with curl command: curl -F FN=@XXXXX.bin http://192.168.123.254/upg where XXXXX.bin is name of firmware file. 5.) You can optionally telnet to 192.168.123.254 before or during the upload and it will report the flashing status, memory address etc. 6.) Once web UI and/or telnet says "Success", power cycle the router, or type "reboot" into the telnet session. Signed-off-by: Simon Quigley <squigley@squigley.net> [squashed commits, word wrap commit message, rename signal strenght led name to match what is used for the DWR-921-C1 since they share the led configuration, add label referenced in the aliases node] Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
dlink,dwr-922-e2|\
afoundry,ew1200|\
firefly,firewrt|\
hiwifi,hc5661a|\
hiwifi,hc5962|\
hilink,hlk-rm04|\
phicomm,k2p|\
zyxel,keenetic|\
zyxel,keenetic-omni|\
mercury,mac1200r-v2|\
xiaomi,miwifi-mini|\
xiaomi,miwifi-nano|\
mediatek,mt7621-eval-board|\
mediatek,mt7628an-eval-board|\
ramips: add support for MTC Wireless Router WR1201 MTC Wireless Router WR1201 is the OEM name of the board. It is also sold rebranded as STRONG Dual Band Gigabit Router 1200. Specification: - SoC: MediaTek MT7621A (880 MHz) - Flash: 16 MiB - RAM: 128 MiB - Wireless: 2.4Ghz(MT7602EN) and 5Ghz (MT7612EN) - Ethernet speed: 10/100/1000 - Ethernet ports: 4+1 - 1x USB 3.0 - 1x microSD reader - Serial baud rate of Bootloader and factory firmware: 57600 The OEM webinterface writes only as much bytes as listed in the uImage header field to the flash. Also, the OEM webinterface evaluates the name field of uImage header before flashing (the string "WR1201_8_128") To flash via webinterface, is mandatory to use first initramfs.bin and after (from the OpenWrt) the sysupgrade.bin Some notes: - Some microSD will not work: mtk-sd 1e130000.sdhci: no support for card's volts mmc0: error -22 whilst initialising SDIO card mtk-sd 1e130000.sdhci: no support for card's volts mmc0: error -22 whilst initialising MMC card mtk-sd 1e130000.sdhci: no support for card's volts mmc0: error -22 whilst initialising SDIO card mtk-sd 1e130000.sdhci: card claims to support voltages below defined range mtk-sd 1e130000.sdhci: no support for card's volts mmc0: error -22 whilst initialising MMC card mtk-sd 1e130000.sdhci: no support for card's volts mmc0: error -22 whilst initialising SDIO card mtk-sd 1e130000.sdhci: no support for card's volts mmc0: error -22 whilst initialising MMC card Signed-off-by: Valentín Kivachuk <vk18496@gmail.com>
6 years ago
mtc,wr1201|\
planex,mzk-750dhp|\
planex,mzk-w300nh2|\
nixcore,x1-8m|\
nixcore,x1-16m|\
ohyeah,oy-0001|\
d-team,pbr-m1|\
phicomm,psg1208|\
phicomm,psg1218a|\
netgear,r6220|\
ramips: add support for Netgear R6350 Netgear R6350 is a wireless router, aka Netgear AC1750. Specification: - SoC: Mediatek MT7621AT (2 CPU cores, 4 threads) - RAM: 128MiB (Nanya NT5CC64M16GP-DI) - ROM: 128MiB NAND Flash (Macronix MX30LF1G18AC-TI) - Wireless: for 11b/g/n (upto 300Mbps): MT7603 for 11a/ac (upto 1450Mbps) : MT7615, is not avaliable now - Ethernet LAN speed: up to 1000Mbps - Ethernet LAN ports: 4 - Ethernet WAN speed: up to 1000Mbps - Ethernet WAN ports: 1 - USB ports: 1 (USB 2.0) - LEDs: 4 (all can be controlled by SoC's GPIO) - buttons: 2 - serial ports: unknown Installation through telnet: - Copy kernel.bin and rootfs.bin to a USB flash disk, plug to usb port on the router. - Enable telnet with link: http://192.168.1.1/setup.cgi?todo=debug (login if required, default: admin password) - You will see "Debug Enabled!" - Telnet 192.168.1.1 and login with "root" - ls /mnt/shares/ to find out path of your USB disk. 'myUdisk' for example. - cd /mnt/shares/myUdisk - mtd_write write rootfs.bin Rootfs - mtd_write write kernel.bin Kernel - reboot recovery when bricked: nmrpflash can be used to recover to the netgear firmware if a broken image was flashed. The SC_PART_MAP partition suggests that an on flash partition table exists. After implementing a partition parser/builder for the sercom partition format, the definitions don't match the flash layout used by the stock firmware. It either means the partition format has not yet been completely understood or it isn't used by the stock firmware. For now, use fixed partitions instead. Signed-off-by: NOGUCHI Hiroshi <drvlabo@gmail.com> [apply latest ramips changes and document the on flash partition map issues] Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
netgear,r6350|\
asus,rt-n12p|\
storylink,sap-g3200u3|\
samknows,whitebox-v8|\
telco-electronics,x1|\
totolink,a7000r|\
totolink,lr1200|\
unielec,u7621-06-256m-16m|\
unielec,u7621-06-512m-64m|\
planex,vr500|\
wavlink,wl-wn570ha1|\
wavlink,wl-wn575a3|\
netis,wf-2881|\
buffalo,whr-g300n|\
mqmaker,witi-256m|\
mqmaker,witi-512m|\
netgear,wndr3700-v5|\
youku,yk1|\
youku,yk-l2|\
zbtlink,zbt-ape522ii|\
zbtlink,zbt-we1326|\
zbtlink,zbt-we826-e|\
zbtlink,zbt-we3526|\
zbtlink,zbt-we826-16m|\
zbtlink,zbt-we826-32m|\
zbtlink,zbt-wg2626|\
zbtlink,zbt-wg3526-16m|\
zbtlink,zbt-wg3526-32m|\
zbtlink,zbt-wr8305rt)
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0"
;;
gehua,ghl-r-001)
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "4:wan" "6@eth0"
;;
alfa-network,awusfree1|\
alfa-network,tube-e4g|\
planex,cs-qr10|\
huawei,d105|\
dlink,dap-1522-a1|\
dlink,dch-m225|\
netgear,ex2700|\
netgear,ex3700|\
omnima,hpm|\
planex,mzk-ex300np|\
planex,mzk-ex750np|\
sercomm,na930|\
d-team,pbr-d1|\
ravpower,wd03|\
tama,w06|\
tplink,tl-mr3020-v3|\
tplink,tl-wr802n-v4|\
kimax,u25awf-h1|\
buffalo,wli-tx4-ag300n|\
loewe,wmdr-143n|\
buffalo,wmr-300|\
netgear,wn3000rp-v3|\
elecom,wrh-300cr)
ucidef_set_interface_lan "eth0"
;;
dlink,dwr-118-a1)
ucidef_add_switch "switch0" \
"1:lan:2" "2:lan:3" "3:lan:1" "4:lan:0" "5:wan" "6@eth0"
;;
dlink,dwr-118-a2)
ucidef_add_switch "switch0" \
"1:lan:2" "2:lan:1" "3:lan:3" "4:lan" "0:wan" "6@eth0"
;;
phicomm,psg1218b)
ucidef_add_switch "switch0" \
"0:lan:3" "1:lan:2" "2:lan:1" "3:wan" "6@eth0"
;;
buffalo,whr-300hp2|\
buffalo,whr-600d|\
buffalo,wsr-1166dhp|\
buffalo,wsr-600dhp)
ucidef_add_switch "switch0" \
"0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "4:wan:5" "6@eth0"
;;
airlink101,ar670w|\
airlink101,ar725w|\
rakwireless,rak633|\
asus,rt-ac51u)
ucidef_add_switch "switch0" \
"0:wan" "1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0"
;;
belkin,f9k1109v1|\
asus,rt-n15|\
sitecom,wl-351)
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "5@eth0"
;;
alphanetworks,asl26555-8m|\
alphanetworks,asl26555-16m|\
asus,rp-n53)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0"
;;
argus,atp-52b|\
asiarf,awm002-evb-4m|\
asiarf,awm002-evb-8m|\
bdcom,wap2100-sk|\
tplink,archer-c20i|\
dlink,dir-645|\
glinet,gl-mt300a|\
glinet,gl-mt300n|\
glinet,gl-mt750|\
hilink,hlk-7628n|\
hiwifi,hc5861b|\
jcg,jhr-n805r|\
jcg,jhr-n825r|\
jcg,jhr-n926r|\
mikrotik,rb750gr3|\
ramips: Add support for Mikrotik RouterBOARD RBM33g This commit adds support for the Mikrotik RouterBOARD RBM33g. =Hardware= The RBM33g is a mt7621 based device featuring three gigabit ports, 2 miniPCIe slots with sim card sockets, 1 M.2 slot, 1 USB 3.0 port and a male onboard RS-232 serial port. Additionally there are a lot of accessible GPIO ports and additional buses like i2c, mdio, spi and uart. ==Switch== The three Ethernet ports are all connected to the internal switch of the mt7621 SoC: port 0: Ethernet Port next to barrel jack with PoE printed on it port 1: Innermost Ethernet Port on opposite side of RS-232 port port 2: Outermost Ethernet Port on opposite side of RS-232 port port 6: CPU ==Flash== The device has two spi flash chips. The first flash chips is rather small (512 kB), connected to CS0 by default and contains only the RouterBOOT bootloader and some factory information (e.g. mac address). The second chip has a size of 16 MB, is by default connected to CS1 and contains the firmware image. ==PCIe== The board features three PCIe-enabled slots. Two of them are miniPCIe slots (PCIe0, PCIe1) and one is a M.2 (Key M) slot (PCIe2). Each of the miniPCIe slots is connected to a dedicated mini SIM socket on the back of the board. Power to all three PCIe-enabled slots is controlled via GPIOs on the mt7621 SoC: PCIe0: GPIO9 PCIe1: GPIO10 PCIe2: GPIO11 ==USB== The board has one external USB 3.0 port at the rear. Additionally PCIe port 0 has a permanently enabled USB interface. PCIe slot 1 shares its USB interface with the rear USB port. Thus only either the rear USB port or the USB interface of PCIe slot 1 can be active at the same time. The jumper next to the rear USB port controls which one is active: open: USB on PCIe 1 is active closed: USB on rear USB port is active ==Power== The board can accept both, passive PoE and external power via a 2.1 mm barrel jack. The input voltage range is 11-32 V. =Installation= ==Prerequisites== A USB -> RS-232 Adapter and a null modem cable are required for installation. To install an OpenWRT image to the device two components must be built: 1. A openwrt initramfs image 2. A openwrt sysupgrade image ===initramfs & sysupgrade image=== Select target devices "Mikrotik RBM33G" in openwrt menuconfig and build the images. This will create the images "openwrt-ramips-mt7621-mikrotik_rbm33g-initramfs-kernel.bin" and "openwrt-ramips-mt7621-mikrotik_rbm33g-squashfs-sysupgrade.bin" in the output directory. ==Installing== **Make sure to back up your RouterOS license in case you do ever want to go back to RouterOS using "/system license output" and back up the created license file.** Serial settings: 115200 8N1 The installation is a two-step process. First the "openwrt-ramips-mt7621-mikrotik_rbm33g-initramfs-kernel.bin" must be booted via tftp: 1. Set up a dhcp server that points the bootfile to tftp server serving the "openwrt-ramips-mt7621-mikrotik_rbm33g-initramfs-kernel.bin" initramfs image 2. Connect to WAN port (left side, next to sys-LED and power indicator) 3. Connect to serial port of board 4. Power on board and enter RouterBOOT setup menu 5. Set boot device to "boot over ethernet" 6. Set boot protocol to "dhcp protocol" (can be omitted if DHCP server allows dynamic bootp) 6. Save config 7. Wait for board to boot via Ethernet On the serial port you should now be presented with the OpenWRT boot log. The next steps will install OpenWRT persistently. 1. Copy "openwrt-ramips-mt7621-mikrotik_rbm33g-squashfs-sysupgrade.bin" to the device using scp. 2. Write openwrt to flash using "sysupgrade openwrt-ramips-mt7621-mikrotik_rbm33g-squashfs-sysupgrade.bin" Once the flashing completes reboot the router and let it boot from flash. It should boot straight to OpenWRT. Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
6 years ago
mikrotik,rbm33g|\
planex,mzk-wdpr|\
asus,rt-n14u|\
skylab,skw92a|\
tplink,archer-c20-v4|\
tplink,archer-c50-v3|\
tplink,archer-c50-v4|\
tplink,tl-mr3420-v5|\
tplink,tl-wr842n-v5|\
tplink,tl-wr840n-v4|\
tplink,tl-wr840n-v5|\
tplink,tl-wr841n-v13|\
tplink,tl-wr841n-v14|\
unielec,u7628-01-128m-16m|\
ubiquiti,edgerouterx|\
ubiquiti,edgerouterx-sfp|\
upvel,ur-326n4g|\
wrtnode,wrtnode|\
wrtnode,wrtnode2p|\
wrtnode,wrtnode2r|\
youhua,wr1200js|\
zbtlink,zbt-wa05|\
zyxel,keenetic-extra-ii)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0"
;;
tplink,archer-c50-v1|\
tplink,archer-c20-v1)
ucidef_add_switch "switch0" \
"1:lan:3" "2:lan:4" "3:lan:1" "4:lan:2" "0:wan" "6@eth0"
;;
dlink,dir-860l-b1|\
elecom,wrc-1167ghbk2-s|\
elecom,wrc-2533gst|\
elecom,wrc-1900gst|\
huawei,hg255d|\
ramips: add support for I-O DATA WN-AX1167GR I-O DATA WN-AX1167GR is a 2.4/5 GHz band 11ac router, based on MediaTek MT7621A. Specification: - MT7621A (2-Cores, 4-Threads) - 64 MB of RAM (DDR2) - 16 MB of Flash (SPI) - 2T2R 2.4/5 GHz - 5x 10/100/1000 Mbps Ethernet - 2x LEDs, 4x keys (2x buttons, 1x slide switch) - UART header on PCB - Vcc, GND, TX, RX from ethernet port side - baudrate: 115200 bps (U-Boot, OpenWrt) Stock firmware: In the stock firmware, WN-AX1167GR has two os images each composed of Linux kernel and rootfs. These images are stored in "Kernel" and "app" partition of the following partitions, respectively. (excerpt from dmesg): MX25L12805D(c2 2018c220) (16384 Kbytes) mtd .name = raspi, .size = 0x01000000 (16M) .erasesize = 0x00010000 (64K) .numeraseregions = 0 Creating 10 MTD partitions on "raspi": 0x000000000000-0x000001000000 : "ALL" 0x000000000000-0x000000030000 : "Bootloader" 0x000000030000-0x000000040000 : "Config " 0x000000040000-0x000000050000 : "Factory" 0x000000050000-0x000000060000 : "iNIC_rf" 0x000000060000-0x0000007e0000 : "Kernel" 0x000000800000-0x000000f80000 : "app" 0x000000f90000-0x000000fa0000 : "Key" 0x000000fa0000-0x000000fb0000 : "backup" 0x000000fb0000-0x000001000000 : "storage" The flag for boot partition is stored in "Key" partition, and U-Boot reads this and determines the partition to boot. If the image that U-Boot first reads according to the flag is "Bad Magic Number", U-Boot then tries to boot from the other image. If the second image is correct, change the flag to the number corresponding to that image and boot from that image. (example): ## Booting image at bc800000 ... Bad Magic Number,FFFFFFFF Boot from KERNEL 1 !! ## Booting image at bc060000 ... Image Name: MIPS OpenWrt Linux-4.14.50 Image Type: MIPS Linux kernel Image (lzma compressed) Data Size: 1865917 Bytes = 1.8 MB Load Address: 80001000 Entry Point: 80001000 Verifying Checksum ... OK Uncompressing Kernel Image ... OK raspi_erase_write: offs:f90000, count:34 . . Done! Starting kernel ... Flash instruction using factory image: 1. Connect the computer to the LAN port of WN-AX1167GR 2. Connect power cable to WN-AX1167GR and turn on it 3. Access to "192.168.0.1" on the web browser and open firmware update page ("ファームウェア") 4. Select the OpenWrt factory image and perform firmware update 5. On the initramfs image, execute "mtd erase firmware" to erase stock firmware and execute sysupgrade with sysupgrade image for WN-AX1167GR 6. Wait ~180 seconds to complete flasing Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years ago
iodata,wn-ax1167gr|\
iodata,wn-gx300gr)
ucidef_add_switch "switch0" \
"1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0"
;;
gnubee,gb-pc1|\
gnubee,gb-pc2)
ucidef_add_switch "switch0" \
"0:lan" "4:lan" "6@eth0"
;;
glinet,gl-mt300n-v2)
ucidef_add_switch "switch0" \
"1:lan" "0:wan" "6@eth0"
;;
asiarf,awapn2403)
ucidef_add_switch "switch0" \
"0:lan" "1:wan" "6@eth0"
;;
b2c|\
netcore,nw718|\
petatel,psr-680w|\
skyline,sl-r7205|\
upvel,ur-336un|\
alfa-network,w502u|\
accton,wr6202)
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
;;
edimax,br-6475nd)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
;;
hnet,c108|\
comfast,cf-wr800n)
ucidef_add_switch "switch0" \
"4:lan" "6t@eth0"
;;
ramips: add CUDY WR1000 support Cudy WR1200 is an AC1200 AP with 3-port FE and 2 non-detachable antennas Specifications: MT7628 (580 MHz) 64 MB of RAM (DDR2) 8 MB of FLASH 2T2R 2.4 GHz (MT7628) 2T2R 5 GHz (MT7612E) 3x 10/100 Mbps Ethernet (2 LAN + 1 WAN) 2x external, non-detachable antennas (5dbi) UART header on PCB (57600 8n1) 7x LED, 2x button Known issues: The Power LED is always ON, probably because it is connected directly to power. Flash instructions ------------------ Load the ...-factory.bin image via the stock web interface. Openwrt upgrade instructions ---------------------------- Use the ...-sysupgrade.bin image for future upgrades. Revert to stock FW ------------------ Warning! This tutorial will work only with the following OEM FW: WR1000_EU_92.122.2.4987.201806261618.bin WR1000_US_92.122.2.4987.201806261609.bin If in the future these firmwares will not be available anymore, you have to find the new XOR key. 1) Download the original FW from the Cudy website. (For example WR1000_EU_92.122.2.4987.201806261618.bin) 2) Remove the header. dd if="WR1000_EU_92.122.2.4987.201806261618.bin" of="WR1000_EU_92.122.2.4987.201806261618.bin.mod" skip=8 bs=64 3) XOR the new file with the region key. FOR EU: 7B76741E67594351555042461D625F4545514B1B03050208000603020803000D FOR US: 7B76741E675943555D5442461D625F454555431F03050208000603060007010C You can use OpenWrt's tools/firmware-utils/src/xorimage.c tool for this: xorimage -i WR1000..bin.mod -o stock-firmware.bin -x -p 7B767.. Or, you can use this tool (CHANGE THE XOR KEY ACCORDINGLY!): https://gchq.github.io/CyberChef/#recipe=XOR(%7B'option':'Hex','string':''%7D,'',false) 4) Check the resulting decrypted image. Check if bytes from 0x20 to 0x3f are: 4C 69 6E 75 78 20 4B 65 72 6E 65 6C 20 49 6D 61 67 65 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Alternatively, you can use u-boot's tool dumpimage tool to check if the decryption was successful. It should look like: # dumpimage -l stock-firmware.bin Image Name: Linux Kernel Image Created: Tue Jun 26 10:24:54 2018 Image Type: MIPS Linux Kernel Image (lzma compressed) Data Size: 4406635 Bytes = 4303.35 KiB = 4.20 MiB Load Address: 80000000 Entry Point: 8000c150 5) Flash it via forced firmware upgrade and don't "Keep Settings" CLI: sysupgrade -F -n stock-firmware.bin LuCI: make sure to click on the "Keep settings" checkbox to disable it. You'll need to do this !TWICE! because on the first try, LuCI will refuse the image and reset the "Keep settings" to enable. However a new "Force upgrade" checkbox will appear as well. Make sure to do this very carefully! Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com> Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [added wifi compatible, spiffed-up the returned to stock instructions]
5 years ago
cudy,wr1000)
ucidef_add_switch "switch0" \
"2:lan:2" "3:lan:1" "4:wan" "6@eth0"
;;
samsung,cy-swr1100)
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "9@eth0"
;;
duzun,dm06)
ucidef_add_switch "switch0" \
"1:lan" "0:wan" "6@eth0"
;;
linksys,e1700|\
ralink,mt7620a-mt7530-evb)
ucidef_add_switch "switch1" \
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0"
;;
edimax,br-6478ac-v2|\
tplink,archer-c2-v1)
ucidef_add_switch "switch1" \
"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0"
;;
hiwifi,hc5661|\
ramips: Add support for Head Weblink HDRM200 Head Weblink HDRM200 is a dual-sim router based on MT7620A. The detailed specifications are: - MT7620A (580MHz) - 64MB RAM - 16MB of flash (SPI NOR) - 6x 10/100Mbps Ethernet (MT7620A built-in switch) - 1x microSD slot - 1x miniPCIe slot (only USB2.0 bus). Device is shipped with a SIMCOM SIM7100E LTE modem. - 2x SIM slots (standard size) - 1x USB2.0 port - 1x 2.4GHz wifi (rt2800) - 1x 5GHz wifi (mt7612) - 1x reset button - 1x WPS button - 3x GPIO-controllable LEDs - 1x 10 pin terminal block (RS232, RS485, 4 x GPIO) Tested: - Ethernet switch - Wifi - USB slot - SD card slot - miniPCIe-slot - sysupgrade - reset button Installation instructions: Installing OpenWRT for the first time requires a bit of work, as the board does not ship with OpenWRT. In addition, the bootloader automatically reboots when installing an image over tftp. In order to install OpenWRT on the HDRM200, you need to do the following: * Copy the initramfs-image to your tftp-root (default filename is test.bin) and configure networking accordingly (default server IP is 10.10.10.3, client 10.10.10.123). Start your tftp server. * Open the board and connect to UART. The pins are exposed and clearly marked. * Boot the board and press 1. * Either use the default filename and client/server IP-addresses, or specify your own. The image should now be loaded to memory and board boot. If the router reboots while the image is loading, you need to try again. Once the board has booted, copy the sysupgrade-image to the router and run sysupgrade in order to install OpenWRT to the flash. Notes: - You control which SIM slot to use by writing 0/1 to /sys/class/gpio/gpio0/value. In order for the change to take effect, you can either use AT-commands (AT+CFUN) or power-cycle the modem (write 0/1 to /sys/class/gpio/gpio21/value). - RS485 is available on /dev/ttyS0. - RS232 is available on /dev/ttyS1. - The name of the ioX-gpios map to the labels on the casing. Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com> [fixed whitespace issue and merge conflict in target.mk] Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
head-weblink,hdrm200|\
lenovo,newifi-y1s)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "5:lan" "0:wan" "6@eth0"
;;
hiwifi,hc5861)
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "5:wan" "6@eth0"
;;
iodata,wn-ac1167gr|\
iodata,wn-ac733gr3)
ucidef_add_switch "switch1" \
"1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0"
;;
zyxel,keenetic-omni-ii)
ucidef_add_switch "switch0" \
"0:wan" "1:lan" "2:lan" "3:lan" "4:lan" "6@eth0"
;;
zyxel,keenetic-viva)
ucidef_add_switch "switch1" \
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "7t@eth0"
;;
kingston,mlwg2|\
easyacc,wizard-8800|\
asus,wl-330n)
ucidef_set_interface_lan "eth0.1"
;;
tplink,archer-mr200)
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "3:lan" "6t@eth0"
ucidef_set_interface_wan "usb0"
;;
netgear,r6120)
ucidef_add_switch "switch0" \
"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0"
;;
hiwifi,hc5761)
ucidef_add_switch "switch0" \
"1:lan" "4:lan" "0:wan" "6@eth0"
;;
planex,mzk-dp150n|\
vocore,vocore-8m|\
vocore,vocore-16m)
ucidef_add_switch "switch0" \
"0:lan" "4:lan" "6t@eth0"
;;
lenovo,newifi-d1)
ucidef_add_switch "switch0" \
"1:lan:2" "2:lan:1" "4:wan" "6@eth0"
;;
phicomm,k2g)
ucidef_add_switch "switch0" \
"0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5:wan" "6@eth0"
;;
dlink,dir-510l|\
glinet,vixmini|\
netgear,ex6150|\
tplink,re350-v1)
ucidef_add_switch "switch0" \
"0:lan" "6@eth0"
;;
linksys,re6500)
ucidef_add_switch "switch0" \
"0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "6@eth0"
;;
asus,rt-n56u)
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "8@eth0"
;;
trendnet,tew-638apb-v2)
ucidef_add_switch "switch0" \
"4:lan" "6@eth0"
;;
lava,lr-25g001|\
trendnet,tew-691gr|\
trendnet,tew-692gr|\
sitecom,wlr-6000)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "0@eth0"
;;
tplink,tl-wr902ac-v3)
ucidef_add_switch "switch0" \
"4:lan" "6@eth0"
;;
vonets,var11n-300|\
nexx,wt1520-4m|\
nexx,wt1520-8m)
ramips: add support for Vonets VAR11N-300 The VAR11N-300 is a tiny wireless-N device with a hardwired Ethernet cable, one extra Ethernet port, and an internal antenna, based on the MediaTek MT7620n chipset. Specs: - MT7620n WiSoC @ 600MHz - 32 MB SDRAM - 4 MB SPI flash - 2T2R 2.4GHz WiFi-N - 1 attached 10/100 Ethernet cable (LAN) - 1 10/100 Ethernet port (WAN) - 1 attached USB / barrel 5vdc power cable - 5 LEDs (see notes below) - 1 reset button - 1 UART (3 pads on board) Installation: The stock firmware does not support uploading new firmware directly, only checking the manufacturer's site for updates. This process may be possible to spoof, but the update check uses some kind of homebrew encryption that I didn't investigate. Instead, you can install via a backdoor: 1. Set up a TFTP server to serve the firmware binary (lede-ramips-mt7620-var11n-300-squashfs-sysupgrade.bin) 2. Factory reset the device by holding the reset button for a few seconds. 3. Open the web interface (default IP: 192.168.253.254) 4. Log in with the "super admin" credentials: username `vonets`, password `vonets26642519`. 5. On the "Operative Status" page, click the text "System Uptime", then quickly click the uptime value. 6. If successful, an alert dialog will appear reading "Ated start", and the device will now accept telnet connections. If the alert does not appear, repeat step 5 until it works (the timing is a bit tricky). 7. Telnet to the device using credentials "admin / admin" 8. Retrieve the firmware binary from the tftp server: `tftp -l lede.bin -r lede-ramips-mt7620-var11n-300-squashfs-sysupgrade.bin -g <tftp-server-ip>` 9. Write the firmware to flash: `mtd_write write lede.bin /dev/mtd4` 10. Reboot Tested: - LAN / WAN ethernet - WiFi - LAN / WAN / status LED GPIOs (see notes below) - Reset button - Sysupgrade Notes: LEDs: The board has 5 LEDs - two green LEDs for LAN / WAN activity, one blue LED for WiFi, and a pair of "status" LEDs connected to the same GPIO (the blue LED lights when the GPIO is low, and the green when it's high). I was unable to determine how to operate the WiFi LED, as it does not appear to be controlled by a GPIO directly. Recovery: The default U-boot installation will only boot from flash due to a missing environment block. I generated a valid 4KB env block using U-boot's `fw_setenv` tool and wrote it to flash at 0x30000 using an external programmer. After this, it was possible to enter the U-boot commandline interface and download a new image via TFTP (`tftpboot 81b00000 <image-filename>`), but while I could boot this image sucessfully (`bootm`), writing it to flash (`cp.linux`) just corrupted the flash chip. The sysupgrade file can be written to flash at 0x50000 using an external programmer. Signed-off-by: Andrew Crawley <acrawley@gmail.com>
7 years ago
ucidef_add_switch "switch0" \
"0:lan" "4:wan" "6@eth0"
;;
vocore,vocore2|\
vocore,vocore2-lite)
ucidef_add_switch "switch0" \
"0:lan" "2:lan" "6t@eth0"
;;
belkin,f5d8235-v1|\
belkin,f5d8235-v2|\
trendnet,tew-714tru|\
ralink,v11st-fe|\
buffalo,wzr-agl300nh)
ucidef_add_switch "switch0" \
"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
;;
buffalo,wcr-1166ds)
ucidef_add_switch "switch0" \
"3:lan" "4:wan" "6@eth0"
;;
sparklan,wcr-150gn|\
zbtlink,we1026-5g-16m)
ucidef_add_switch "switch0" \
"0:lan" "6t@eth0"
;;
buffalo,whr-1166d)
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "3:lan" "5:wan" "6@eth0"
;;
wiznet,wizfi630a)
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:wan" "6@eth0"
;;
wiznet,wizfi630s)
ucidef_add_switch "switch0" \
"0:wan" "3:lan" "4:lan" "6@eth0"
;;
nexx,wt3020-4m|\
nexx,wt3020-8m)
ucidef_add_switch "switch0" \
"4:lan" "0:wan" "6@eth0"
;;
xiaomi,mir3g)
ucidef_add_switch "switch0" \
"2:lan:2" "3:lan:1" "1:wan" "6t@eth0"
;;
ramips: add support for Xiaomi Mi Router 3 Pro Hardware: CPU: MediaTek MT7621AT (2x880MHz) RAM: 512MB DDR3 FLASH: 256MB NAND WiFi: 2.4GHz 4x4 MT7615 b/g/n (Needs driver, See Issues!) WiFI: 5GHz 4x4 MT7615 a/n/ac (Needs driver, See Issues!) USB: 1x 3.0 ETH: 1x WAN 10/100/1000 3x LAN 10/100/1000 LED: Power/Status BTN: RESET UART: 115200 8n1 Partition layout and boot: Stock Xiaomi firmware has the MTD split into (among others) - kernel0 (@0x200000) - kernel1 (@0x600000) - rootfs0 - rootfs1 - overlay (ubi) Xiaomi uboot expects to find kernels at 0x200000 & 0x600000 referred to as system 1 & system 2 respectively. a kernel is considered suitable for handing control over if its linux magic number exists & uImage CRC are correct. If either of those conditions fail, a matching sys'n'_fail flag is set in uboot env & a restart performed in the hope that the alternate kernel is okay. If neither kernel checksums ok and both are marked failed, system 2 is booted anyway. Note uboot's tftp flash install writes the transferred image to both kernel partitions. Installation: Similar to the Xiaomi MIR3G, we keep stock Xiaomi firmware in kernel0 for ease of recovery, and install OpenWRT into kernel1 and after. The installation file for OpenWRT is a *squashfs-factory.bin file that contains the kernel and a ubi partition. This is flashed as follows: nvram set flag_try_sys1_failed=1 nvram set flag_try_sys2_failed=0 nvram commit dd if=factory.bin bs=1M count=4 | mtd write - kernel1 dd if=factory.bin bs=1M skip=4 | mtd write - rootfs0 reboot Reverting to stock: The part of stock firmware we've kept in kernel0 allows us to run stock recovery, which will re-flash stock firmware from a *.bin file on a USB. For this we do the following: fw_setenv flag_try_sys1_failed 0 fw_setenv flag_try_sys2_failed 1 reboot After reboot the LED status light will blink red, at which point pressing the 'reset' button will cause stock firmware to be installed from USB. Issues: OpenWRT currently does not have support for the MT7615 wifi chips. There is ongoing work to add mt7615 support to the open source mt76 driver. Until that support is in place, there are closed-source kernel modules that can be used. See: https://forum.openwrt.org/t/support-for-xiaomi-wifi-r3p-pro/20290/170 Signed-off-by: Ozgur Can Leonard <ozgurcan@gmail.com> Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [02_network remaps, Added link to notes]
5 years ago
xiaomi,mir3p)
ucidef_add_switch "switch0" \
"1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0"
;;
xiaomi,mir4a-100m)
ucidef_add_switch "switch0" \
"4:lan:1" "2:lan:2" "0:wan" "6@eth0"
;;
zbtlink,zbt-we1226|\
lenovo,newifi-y1)
ucidef_add_switch "switch0" \
"0:lan:2" "1:lan:1" "4:wan" "6@eth0"
;;
zyxel,keenetic-start)
ucidef_add_switch "switch0" \
"0:lan:3" "1:lan:2" "2:lan:1" "3:lan:0" "4:wan" "6@eth0"
;;
*)
RT3X5X=`cat /proc/cpuinfo | egrep "(RT3.5|RT5350)"`
if [ -n "${RT3X5X}" ]; then
ramips_setup_rt3x5x_vlans
else
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
fi
;;
esac
}
ramips_setup_macs()
{
local board="$1"
local lan_mac=""
local wan_mac=""
case $board in
unbranded,a5-v11|\
hootoo,ht-tm02|\
loewe,wmdr-143n)
lan_mac=$(cat /sys/class/net/eth0/address)
;;
8devices,carambola|\
arcwireless,freestation5|\
alfa-network,w502u|\
netgear,wnce2001)
wan_mac=$(mtd_get_mac_binary factory 46)
;;
nexaira,bc2|\
hauppauge,broadway|\
huawei,d105|\
dlink,dir-300-b7|\
dlink,dir-320-b1|\
dlink,dir-620-a1|\
engenius,esr-9753|\
arcwireless,freestation5|\
hilink,hlk-7628n|\
hilink,hlk-rm04|\
hame,mpr-a1|\
petatel,psr-680w|\
skyline,sl-r7205|\
lenovo,newifi-y1|\
lenovo,newifi-y1s)
lan_mac=$(cat /sys/class/net/eth0/address)
lan_mac=$(macaddr_setbit_la "$lan_mac")
wan_mac=$(macaddr_add "$lan_mac" 1)
;;
belkin,f9k1109v1)
wan_mac=$(mtd_get_mac_ascii uboot-env HW_WAN_MAC)
lan_mac=$(mtd_get_mac_ascii uboot-env HW_LAN_MAC)
;;
edimax,br-6475nd)
lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(mtd_get_mac_binary devdata 7)
;;
samsung,cy-swr1100|\
dlink,dch-m225)
lan_mac=$(mtd_get_mac_ascii factory lanmac)
;;
dlink,dir-645)
lan_mac=$(mtd_get_mac_ascii nvram lanmac)
wan_mac=$(mtd_get_mac_ascii nvram wanmac)
;;
dlink,dir-860l-b1)
lan_mac=$(mtd_get_mac_ascii factory lanmac)
wan_mac=$(mtd_get_mac_ascii factory wanmac)
;;
dlink,dir-510l|\
dlink,dwr-116-a1|\
dlink,dwr-118-a1|\
dlink,dwr-118-a2|\
dlink,dwr-921-c1|\
ramips: add support for DLINK DWR-922-E2 Very similar to the DWR-921-C1, except has a telephony/RJ11 port (not sure if supported, I didn't try), wireless router with QMI LTE embedded modem is based on the MT7620N SoC. Specification: * MediaTek MT7620N (580 Mhz) * 64 MB of RAM * 16 MB of FLASH * 802.11bgn radio * 5x 10/100 Mbps Ethernet (1 WAN and 4 LAN) * 2x external, detachable (LTE) antennas * UART header on PCB (57600 8n1) * 6x LED (GPIO-controlled) * 1x bi-color Signal Strength LED (GPIO-controlled) * 2x button * JBOOT bootloader The status led has been assigned to the dwr-922-e2:green:signalstrength (lte signal strength) led. At the end of the boot it is switched off and is available for lte operation. Works correctly also during sysupgrade operation. Installation: Apply factory image via d-link http web-gui, or via recovery interface: How to recover/revert to OEM firmware: 1.) Push and hold the reset button and turn on the power. Wait until all LEDs start rapidly blinking (~10sec.) 2.) DHCP should give you an IP in the 192.168.123.0/24 subnet, or set one manually 3.) Upload original factory image via JBOOT http interface at IP 192.168.123.254 4.) If http doesn't work, it can be done with curl command: curl -F FN=@XXXXX.bin http://192.168.123.254/upg where XXXXX.bin is name of firmware file. 5.) You can optionally telnet to 192.168.123.254 before or during the upload and it will report the flashing status, memory address etc. 6.) Once web UI and/or telnet says "Success", power cycle the router, or type "reboot" into the telnet session. Signed-off-by: Simon Quigley <squigley@squigley.net> [squashed commits, word wrap commit message, rename signal strenght led name to match what is used for the DWR-921-C1 since they share the led configuration, add label referenced in the aliases node] Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
dlink,dwr-922-e2|\
lava,lr-25g001)
wan_mac=$(jboot_config_read -m -i $(find_mtd_part "config") -o 0xE000)
lan_mac=$(macaddr_add "$wan_mac" 1)
;;
linksys,e1700)
wan_mac=$(mtd_get_mac_ascii config WAN_MAC_ADDR)
;;
edimax,br-6478ac-v2)
lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(macaddr_add "$lan_mac" 2)
;;
elecom,wrc-1167ghbk2-s|\
elecom,wrc-2533gst|\
elecom,wrc-1900gst|\
samknows,whitebox-v8)
wan_mac=$(mtd_get_mac_binary factory 57350)
;;
glinet,gl-mt300n-v2|\
buffalo,whr-g300n)
wan_mac=$(mtd_get_mac_binary factory 4)
;;
hiwifi,hc5661|\
hiwifi,hc5761|\
hiwifi,hc5861|\
hiwifi,hc5661a|\
hiwifi,hc5962|\
hiwifi,hc5861b)
lan_mac=`mtd_get_mac_ascii bdinfo "Vfac_mac "`
[ -n "$lan_mac" ] || lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(macaddr_add "$lan_mac" 1)
;;
iodata,wn-ac1167gr|\
iodata,wn-ac733gr3)
wan_mac=$(macaddr_add "$(mtd_get_mac_binary Factory 4)" -1)
;;
ramips: add support for I-O DATA WN-AX1167GR I-O DATA WN-AX1167GR is a 2.4/5 GHz band 11ac router, based on MediaTek MT7621A. Specification: - MT7621A (2-Cores, 4-Threads) - 64 MB of RAM (DDR2) - 16 MB of Flash (SPI) - 2T2R 2.4/5 GHz - 5x 10/100/1000 Mbps Ethernet - 2x LEDs, 4x keys (2x buttons, 1x slide switch) - UART header on PCB - Vcc, GND, TX, RX from ethernet port side - baudrate: 115200 bps (U-Boot, OpenWrt) Stock firmware: In the stock firmware, WN-AX1167GR has two os images each composed of Linux kernel and rootfs. These images are stored in "Kernel" and "app" partition of the following partitions, respectively. (excerpt from dmesg): MX25L12805D(c2 2018c220) (16384 Kbytes) mtd .name = raspi, .size = 0x01000000 (16M) .erasesize = 0x00010000 (64K) .numeraseregions = 0 Creating 10 MTD partitions on "raspi": 0x000000000000-0x000001000000 : "ALL" 0x000000000000-0x000000030000 : "Bootloader" 0x000000030000-0x000000040000 : "Config " 0x000000040000-0x000000050000 : "Factory" 0x000000050000-0x000000060000 : "iNIC_rf" 0x000000060000-0x0000007e0000 : "Kernel" 0x000000800000-0x000000f80000 : "app" 0x000000f90000-0x000000fa0000 : "Key" 0x000000fa0000-0x000000fb0000 : "backup" 0x000000fb0000-0x000001000000 : "storage" The flag for boot partition is stored in "Key" partition, and U-Boot reads this and determines the partition to boot. If the image that U-Boot first reads according to the flag is "Bad Magic Number", U-Boot then tries to boot from the other image. If the second image is correct, change the flag to the number corresponding to that image and boot from that image. (example): ## Booting image at bc800000 ... Bad Magic Number,FFFFFFFF Boot from KERNEL 1 !! ## Booting image at bc060000 ... Image Name: MIPS OpenWrt Linux-4.14.50 Image Type: MIPS Linux kernel Image (lzma compressed) Data Size: 1865917 Bytes = 1.8 MB Load Address: 80001000 Entry Point: 80001000 Verifying Checksum ... OK Uncompressing Kernel Image ... OK raspi_erase_write: offs:f90000, count:34 . . Done! Starting kernel ... Flash instruction using factory image: 1. Connect the computer to the LAN port of WN-AX1167GR 2. Connect power cable to WN-AX1167GR and turn on it 3. Access to "192.168.0.1" on the web browser and open firmware update page ("ファームウェア") 4. Select the OpenWrt factory image and perform firmware update 5. On the initramfs image, execute "mtd erase firmware" to erase stock firmware and execute sysupgrade with sysupgrade image for WN-AX1167GR 6. Wait ~180 seconds to complete flasing Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years ago
iodata,wn-ax1167gr|\
iodata,wn-gx300gr)
wan_mac=$(macaddr_add "$(mtd_get_mac_binary Factory 4)" 1)
;;
zyxel,keenetic-omni|\
zyxel,keenetic-omni-ii|\
zyxel,keenetic-viva)
wan_mac=$(mtd_get_mac_binary factory 40)
;;
mediatek,linkit-smart-7688)
wan_mac=$(mtd_get_mac_binary factory 4)
lan_mac=$(mtd_get_mac_binary factory 46)
;;
mercury,mac1200r-v2)
lan_mac=$(mtd_get_mac_binary factory_info 13)
wan_mac=$(macaddr_add "$lan_mac" 1)
;;
xiaomi,miwifi-mini)
wan_mac=$(cat /sys/class/net/eth0/address)
lan_mac=$(macaddr_setbit_la "$wan_mac")
;;
poray,m3|\
poray,m4-4m|\
poray,m4-8m|\
poray,x5|\
poray,x8)
lan_mac=$(cat /sys/class/net/eth0/address)
lan_mac=$(macaddr_add "$lan_mac" -2)
;;
lenovo,newifi-d1)
lan_mac=$(cat /sys/class/net/eth0/address)
lan_mac=$(macaddr_add "$lan_mac" 2)
;;
onion,omega2|\
onion,omega2p)
wan_mac=$(mtd_get_mac_binary factory 4)
lan_mac=$(mtd_get_mac_binary factory 46)
;;
ohyeah,oy-0001|\
phicomm,k2g)
lan_mac=$(mtd_get_mac_binary factory 40)
wan_mac=$(mtd_get_mac_binary factory 46)
;;
netgear,r6220|\
netgear,r6350|\
netgear,wndr3700-v5)
wan_mac=$(mtd_get_mac_binary factory 4)
lan_mac=$(macaddr_add "$wan_mac" 1)
;;
asus,rt-n56u)
lan_mac=$(cat /sys/class/net/eth0/address)
lan_mac=$(macaddr_setbit_la "$lan_mac")
wan_mac=$(mtd_get_mac_binary factory 32772)
;;
skylab,skw92a)
ramips: add support for Skylab SKW92A in EVB Specifically, SKW92A_E16, described here: http://www.skylabmodule.com/wp-content/uploads/SkyLab_SKW92A_V1.04_datasheet.pdf Specification: - MediaTek MT7628N/N (580 Mhz) - 64 MB of RAM - 16 MB of FLASH - 2T2R 2.4 GHz - 5x 10/100 Mbps Ethernet - 2x u.FL - Power by micro-USB connector at USB1 on EVB - UART via micro-USB connector at USB3 on EVB (57600 8n1) - 5x Ethernet LEDs - 1x WLAN LEDs - 1x WPS LED connected by jumper wire from I2S_CK on J20 to WPS_LED pin hole next to daughter board on EVB - WPS/Reset button (S2 on EVB) - RESET button (S1 on EVB) is *not* connected to RST hole next to daughter board Flash instruction: >From Skylab firmware: 1. Associate with SKYLAP_AP 2. In a browser, load: http://10.10.10.254/ 3. Username/password: admin/admin 4. In web admin interface: Administration / Upload Firmware, browse to sysupgrade image, apply, flash will fail with a message: Not a valid firmware. *** Warning: "/var/tmpFW" has corrupted data! 5. Telnet to 10.10.10.254, drops you into a root shell with no credentials 6. # cd /var 7. # mtd_write -r write tmpFW mtd4 Unlocking mtd4 ... Writing from tmpFW to mtd4 ... [e] 8. When flash has completed, you will have booted into your firmware. >From U-boot via TFTP and initramfs: 1. Place openwrt-ramips-mt76x8-skw92a-initramfs-kernel.bin on a TFTP server 2. Connect to serial console at USB3 on EVB 3. Connect ethernet between port 1 (not WAN) and your TFTP server (e.g. 192.168.11.20) 4. Start terminal software (e.g. screen /dev/ttyUSB0 57600) on PC 5. Apply power to EVB 6. Interrupt u-boot with keypress of "1" 7. At u-boot prompts: Input device IP (10.10.10.123) ==:192.168.11.21 Input server IP (10.10.10.3) ==:192.168.11.20 Input Linux Kernel filename (root_uImage) ==:openwrt-ramips-mt76x8-skw92a-initramfs-kernel.bin 8. Move ethernet to port 0 (WAN) on EVB 9. At new OpenWrt console shell, fetch squashfs-sysupgrade image and flash with sysupgrade. >From U-boot via TFTP direct flash: 1. Place openwrt-ramips-mt76x8-skw92a-squashfs-sysupgrade.bin on a TFTP server 2. Connect to serial console at USB3 on EVB (57600 8N1) 3. Connect ethernet between port 1 (not WAN) an your TFTP server (e.g. 192.168.11.20) 4. Start terminal software (e.g. screen /dev/ttyUSB0 57600) on PC 5. Apply power to EVB 6. Interrupt u-boot with keypress of "2" 7. At u-boot prompts: Warning!! Erase Linux in Flash then burn new one. Are you sure?(Y/N) Y Input device IP (10.10.10.123) ==:192.168.11.21 Input server IP (10.10.10.3) ==:192.168.11.20 Input Linux Kernel filename (root_uImage) ==:openwrt-ramips-mt76x8-skw92a-squashfs-sysupgrade.bin 8. When transfer is complete or as OpenWrt begins booting, move ethernet to port 0 (WAN). Signed-off-by: Russell Senior <russell@personaltelco.net>
6 years ago
lan_mac=$(mtd_get_mac_binary factory 40)
wan_mac=$(mtd_get_mac_binary factory 46)
;;
trendnet,tew-691gr)
wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 4)" 3)
;;
trendnet,tew-692gr)
wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 4)" 1)
;;
dovado,tiny-ac)
lan_mac=$(mtd_get_mac_ascii u-boot-env LAN_MAC_ADDR)
wan_mac=$(mtd_get_mac_ascii u-boot-env WAN_MAC_ADDR)
;;
planex,vr500)
lan_mac=$(mtd_get_mac_binary factory 57344)
wan_mac=$(mtd_get_mac_binary factory 57350)
;;
tenda,w306r-v2)
lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(macaddr_add "$lan_mac" 5)
;;
buffalo,wcr-1166ds|\
buffalo,wsr-1166dhp)
local index="$(find_mtd_index "board_data")"
wan_mac="$(grep -m1 mac= "/dev/mtd${index}" | cut -d= -f2)"
lan_mac=$wan_mac
;;
sparklan,wcr-150gn)
wan_mac=$(mtd_get_mac_binary factory 40)
;;
buffalo,whr-1166d|\
buffalo,whr-300hp2|\
buffalo,whr-600d|\
buffalo,wsr-600dhp)
wan_mac=$(mtd_get_mac_binary factory 4)
lan_mac=$wan_mac
;;
wiznet,wizfi630a)
lan_mac=$(mtd_get_mac_binary factory 4)
wan_mac=$(mtd_get_mac_binary factory 40)
;;
sitecom,wlr-6000)
ramips: add support for Sitecom WLR-6000 The Sitecom firmware upgrade file has SENAO_FIRMWARE_TYPE 2 set. This looks rather wrong since SENAO_FIRMWARE_TYPE 2 is kernel only but the file is way to big for only including a kernel. The factory image need to have the dlf file extension. Otherwise the Sitecom firmware rejects the file. The stock firmware uses the following mac addresses: LAN: 00:0C:F6:AA:BB:D8 (u-boot env: ethaddr) 2,4: 00:0C:F6:AA:BB:D8 (EEPROM) 5: 00:0C:F6:AA:BB:DC (EEPROM) WAN: 00:0C:F6:AA:C8:43 (u-boot env: wanaddr) Assuming the mac address range :D8 to :DC is reserved for this device, the MAC addresses were reorder to have a unique MAC address for each interface: 2.4GHz: 00:0C:F6:AA:BB:D8 LAN: 00:0C:F6:AA:BB:D9 WAN: 00:0C:F6:AA:BB:DA 5 GHz: 00:0C:F6:AA:BB:DC The first MAC is assigned to the 2.4GHz WiFi interface to keep compatibility with the SSIDs printed on the case, which have the last three sextets of the MAC address appended. There are still issues with the rt2x00 driver. It is not possible to use both wireless interfaces at the same time. The 2.4 GHz wireless (PCIe) only works if the internal 5GHz wireless is/has been enabled or used for scanning. The internal 5GHz wireless only works if the 2.4GHz wireless (PCIe) was never enabled. Disabling the 2.4Ghz after it was enabled will result in stations seeing the 5Ghz AP but are unable to connect. Due to the not optimal working wifi the manufacture, backup and storage partitions of the OEM firmware are kept for now to allow an easy switch back to the Sitecom firmware. Signed-off-by: Jasper Scholte <NightNL@outlook.com> Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 32772)" 2)
;;
xiaomi,mir3g|\
xiaomi,mir3p)
lan_mac=$(mtd_get_mac_binary Factory 0xe006)
;;
zyxel,keenetic-start)
wan_mac=$(mtd_get_mac_binary factory 40)
;;
*)
lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(macaddr_add "$lan_mac" 1)
;;
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)
ramips_setup_interfaces $board
ramips_setup_macs $board
board_config_flush
exit 0