aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips
Commit message (Collapse)AuthorAgeFilesLines
* ramips: mt7621: remove set-affinity scriptRosen Penev2023-04-011-19/+0
| | | | | | | | | | | | From https://github.com/openwrt/openwrt/pull/12280#issuecomment-1489279860 On Ethernet and WLAN, NAPI is threaded for all queues. This means that the processing work is not stuck on the CPU that fired the IRQ. Under heavy load, IRQs get disabled anyway, so it should not matter at all which CPUs the IRQs fire on. Basic testing indicates this to be true. There's no speedup or slowdown. Signed-off-by: Rosen Penev <rosenp@gmail.com>
* ramips: mt7621: ASUS RT-AX53U add NMBM, nest firmwareFelix Baumann2023-04-011-7/+26
| | | | | | | | | | | | Nests kernel and ubi into firmware partition in-order to be compatible with OEM firmware. This allows restoring oem firmware from a backup of firmware2. Add jffs2 partition which is present in the oem firmware. Add support for mediatek NMBM (wear leveling on newer mediatek devices). Exclude UBI partition from NMBM management. Continues PR #10685. Tested-by: Felix Baumann <felix.bau@gmx.de> Signed-off-by: Felix Baumann <felix.bau@gmx.de>
* kernel: bump 5.15 to 5.15.105John Audia2023-04-013-8/+8
| | | | | | | | | | | | | | | | | | | Manually rebased: Removed upstreamed: backport-5.15/743-v6.3-0005-net-dsa-b53-mmap-fix-device-tree-support.patch[1] backport-5.15/743-v6.3-0006-net-dsa-tag_brcm-legacy-fix-daisy-chained-switches.patch[2] All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.105&id=9bbb3d3f218f1cf51f57a43cf8fd63b05be1b821 2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.105&id=48f52431af9980582b6faa32ff8b581edb10486c Build system: x86_64 Build-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod Run-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod Signed-off-by: John Audia <therealgraysky@proton.me>
* ramips: Refresh patchesHauke Mehrtens2023-03-291-2/+2
| | | | | | | Refresh the ramips kernel patches. Fixes: 7472476aef26 ("kernel: fix mtk_eth_soc throughput regressions on gigabit PHY ports") Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* generic: mtk_eth_soc: switch to external PCS driverDaniel Golle2023-03-271-2/+2
| | | | | | Backport patch to make use of the new PCS driver in mtk_eth_soc. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* generic: backport some phylink helper functionsDaniel Golle2023-03-271-1/+1
| | | | | | | | | | | | | | It isn't feasible to literally backport all upstream phylink_pcs changes down to Linux 5.15: It's just too many patches, and many downstream drivers and hacks are likely to break. We are too close to branching off to risk this, and it's also just too much work. Instead just add helper functions used by modern PCS drivers while keeping the original functions instact as well. While this may add a kilobyte or two of extra kernel size, it has the advantage that we get the best of both worlds: None of the existing codepaths are touched, but yet we have the option to backport singular improvements to Ethernet drivers where needed. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* ramips: add support for Keenetic Lite III rev. AAlexey Bartenev2023-03-274-0/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | General specification: SoC Type: MediaTek MT7620N (580MHz) ROM: 8 MB SPI-NOR (W25Q64FV) RAM: 64 MB DDR (EM6AB160TSD-5G) Switch: MediaTek MT7530 Ethernet: 5 ports - 5×100MbE (WAN, LAN1-4) Wireless: 2.4 GHz (MediaTek RT5390): b/g/n Buttons: 3 button (POWER, RESET, WPS) Slide switch: 4 position (BASE, ADAPTER, BOOSTER, ACCESS POINT) Bootloader: U-Boot 1.1.3 Power: 9 VDC, 0.6 A MAC in stock: |- + | | LAN | RF-EEPROM + 0x04 | | WLAN | RF-EEPROM + 0x04 | | WAN | RF-EEPROM + 0x28 | OEM easy installation 1. Use a PC to browse to http://my.keenetic.net. 2. Go to the System section and open the Files tab. 3. Under the Files tab, there will be a list of system files. Click on the Firmware file. 4. When a modal window appears, click on the Choose File button and upload the firmware image. 5. Wait for the router to flash and reboot. OEM installation using the TFTP method 1. Download the latest firmware image and rename it to klite3_recovery.bin. 2. Set up a Tftp server on a PC (e.g. Tftpd32) and place the firmware image to the root directory of the server. 3. Power off the router and use a twisted pair cable to connect the PC to any of the router's LAN ports. 4. Configure the network adapter of the PC to use IP address 192.168.1.2 and subnet mask 255.255.255.0. 5. Power up the router while holding the reset button pressed. 6. Wait approximately for 5 seconds and then release the reset button. 7. The router should download the firmware via TFTP and complete flashing in a few minutes. After flashing is complete, use the PC to browse to http://192.168.1.1 or ssh to proceed with the configuration. Signed-off-by: Alexey Bartenev <41exey@proton.me>
* ramips: mt7621: enable unused PCIe port to fix potential boot failureShiji Yang2023-03-264-16/+0
| | | | | | | | | | | | | One user reported that his SIMAX1800T couldn't boot like the others. After debugging, I found that this was caused by the disabled PCIe port. I cannot reproduce this issue on my SIMAX1800T. But when I disabled pcie2 on the ASUS RT-AC57U, I got the same result. It seems that disabling these unused PCIe ports on some mt7621 revisions will cause PCIe to fail to initialize. So we'd better to re-enable them on all related mt7621 devices. Signed-off-by: Shiji Yang <yangshiji66@qq.com>
* ramips: fix 5g mac for TOTOLINK X5000RChuanhong Guo2023-03-261-0/+4
| | | | | | | | | There's no valid mac address for the second band in the eeprom. The vendor fw uses 2.4G mac + 4 as the mac for 5G radio. Do the same in our firmware. Fixes: 23be410b3d ("ramips: add support for TOTOLINK X5000R") Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
* kernel: bump 5.15 to 5.15.103John Audia2023-03-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Manually rebased: backport-5.15/704-15-v5.19-net-mtk_eth_soc-move-MAC_MCR-setting-to-mac_finish.patch Removed upstreamed: backport-5.15/060-v6.0-01-tools-build-Add-feature-test-for-init_disassemble_in.patch[1] backport-5.15/060-v6.0-02-tools-include-add-dis-asm-compat.h-to-handle-version.patch[2] backport-5.15/060-v6.0-03-tools-perf-Fix-compilation-error-with-new-binutils.patch[3] backport-5.15/060-v6.0-04-tools-bpf_jit_disasm-Fix-compilation-error-with-new-.patch[4] backport-5.15/060-v6.0-05-tools-bpftool-Fix-compilation-error-with-new-binutil.patch[5] pending-5.15/733-02-net-ethernet-mtk_eth_soc-fix-RX-data-corruption-issu.patch[6] bcm47xx/patches-5.15/170-bgmac-fix-initial-chip-reset-to-support-BCM5358.patch[7] All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.103&id=51b99dc38c1a053e2e732d7f9e2740e343ae7eae 2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.103&id=451c9d7b16169645ed291ebb2ca9844caa088f2d 3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.103&id=97f005c0bdbaf656a7808586d234965385a06c58 4. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.103&id=1c27fab243333821375e4d63128d60093fdbe149 5. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.103&id=4441a90091931fd81607567961dc122f24f735bb 6. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.103&id=2adc29350a5b4669544566f71f208d2abaec60ab 7. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.103&id=04bfc5bcdfc0fdb73587487c71b04d63807ae15a Build system: x86_64 Build-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod Run-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3, filogic/xiaomi_redmi-router-ax6000-ubootmod Signed-off-by: John Audia <therealgraysky@proton.me>
* ramips: add support for Mercusys MR70XDavid Bauer2023-03-243-4/+183
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hardware ======== - SoC: MediaTek MT7621AT (880MHz, Duel-Core) - RAM: DDR3 128MB - Flash: Winbond W25Q128JV (SPI-NOR 16MB) - WiFi: MediaTek MT7915D (2.4GHz, 5GHz, DBDC) - Ethernet: MediaTek MT7530 (WAN x1, LAN x3, SoC) - UART: >TX RX GND 3v3 (115200 8N1, J1) Do not connect 3v3. TX is marked with an arrow. Installation ============ Flash factory image. This can be done using stock web ui. Revert to stock firmware ======================== Flash stock firmware via OEM Web UI Recovery mode. Web UI Recovery method ====================== 1. Unplug the router 2. Plug in and hold reset button 5~10 secs 3. Set your computer IP address manually to 192.168.1.x / 255.255.255.0 4. Flash image with web browser to 192.168.1.1 Co-authored-by: Robert Senderek <robert.senderek@10g.pl> Co-authored-by: Yoonji Park <koreapyj@dcmys.kr> Signed-off-by: David Bauer <mail@david-bauer.net>
* ramips: mt7621: enable lzma-loader for AFOUNDRY EW1200Tony Butler2023-03-221-0/+1
| | | | | | | | | Fixes boot loader LZMA decompression issues (LZMA ERROR 1) As reported in issue #12208 Reported-by: Raúl M. <raul.m@sparkedhost.com> Tested-by: Raúl M. <raul.m@sparkedhost.com> Signed-off-by: Tony Butler <spudz76@gmail.com>
* ramips: fix Archer AX23 WiFi MAC address conflictDavid Bauer2023-03-211-4/+1
| | | | | | | | | | The original claim about conflicting MAC addresses is wrong. mac80211 does increment the first octet and sets the LA bit. This means our "workaround" actually leads to the issue while incrementing the last octet is safe. Signed-off-by: David Bauer <mail@david-bauer.net>
* ramips: cudy wr1300v2 reduce SPI freq to 40000000Óscar García Amor2023-03-201-2/+1
| | | | | | | | | Cases have been reported in which certain devices do not boot correctly or have errors. After various tests by users who have such errors it has been concluded that the SPI frequency should be reduced to 40Mhz, at this speed it appears that all devices work correctly. Signed-off-by: Óscar García Amor <ogarcia@connectical.com>
* kernel: bump 5.10 to 5.10.175John Audia2023-03-201-2/+2
| | | | | | | | | | | | | | Manually rebased: backport-5.10/611-v5.12-net-ethernet-mediatek-support-setting-MTU.patch Removed upstreamed: bcm47xx/patches-5.10/170-bgmac-fix-initial-chip-reset-to-support-BCM5358.patch[1] All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.175&id=cbf11ff3708ff163387da924f80a47ce7c721e9b Signed-off-by: John Audia <therealgraysky@proton.me>
* kernel: bump 5.10 to 5.10.173John Audia2023-03-202-11/+10
| | | | | | | | | Manually rebased: ramips/patches-5.10/810-uvc-add-iPassion-iP2970-support.patch All other patches automatically rebased. Signed-off-by: John Audia <therealgraysky@proton.me>
* kernel: bump 5.15 to 5.15.100John Audia2023-03-182-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Manually rebased: bcm27xx/patches-5.15/950-0421-Support-RPi-DPI-interface-in-mode6-for-18-bit-color.patch bcm27xx/patches-5.15/950-0706-media-i2c-imx219-Scale-the-pixel-clock-rate-for-the-.patch ramips/patches-5.15/810-uvc-add-iPassion-iP2970-support.patch Removed upstreamed: bcm27xx/patches-5.15/950-0707-drm-vc4-For-DPI-MEDIA_BUS_FMT_RGB565_1X16-is-mode-1-.patch[1] bcm27xx/patches-5.15/950-0596-drm-vc4-dpi-Add-option-for-inverting-pixel-clock-and.patch[2] ipq807x/0006-v5.16-arm64-dts-qcom-Fix-IPQ8074-PCIe-PHY-nodes.patch [3] ipq807x/0034-v6.1-arm64-dts-qcom-ipq8074-fix-PCIe-PHY-serdes-size.patch [4] ipq807x/0103-arm64-dts-qcom-ipq8074-fix-Gen2-PCIe-QMP-PHY.patch [5] ipq807x/0104-arm64-dts-qcom-ipq8074-fix-Gen3-PCIe-QMP-PHY.patch [6] ipq807x/0105-arm64-dts-qcom-ipq8074-correct-Gen2-PCIe-ranges.patch [7] ipq807x/0108-arm64-dts-qcom-ipq8074-fix-Gen3-PCIe-node.patch [8] ipq807x/0109-arm64-dts-qcom-ipq8074-correct-PCIe-QMP-PHY-output-c.patch [9] ipq807x/0132-arm64-dts-qcom-ipq8074-correct-USB3-QMP-PHY-s-clock-.patch [10] All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.99&id=d2991e6b30020e286f2dd9d3b4f43548c547caa6 2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/drivers/gpu/drm/vc4/vc4_dpi.c?h=v5.15.100&id=8e04aaffb6de5f1ae61de7b671c1531172ccf429 3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/arm64/boot/dts/qcom/ipq8074.dtsi?h=v5.15.99&id=a55a645aa303a3f7ec37db69822d5420657626da 4. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/arm64/boot/dts/qcom/ipq8074.dtsi?h=v5.15.99&id=d9df682bcea57fa25f37bbf17eae56fa05662635 5. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/arm64/boot/dts/qcom/ipq8074.dtsi?h=v5.15.99&id=7e6eeb5fb3aa9e5feffdb6e137dcc06f5f6410e1 6. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/arm64/boot/dts/qcom/ipq8074.dtsi?h=v5.15.99&id=e88204931d9a60634cd50bbc679f045439c4b91d 7. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/arm64/boot/dts/qcom/ipq8074.dtsi?h=v5.15.99&id=1563af0f28afd3b6d64ac79a2aecced3969c90bf 8. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/arm64/boot/dts/qcom/ipq8074.dtsi?h=v5.15.99&id=feb8c71f015d416f1afe90e1f62cf51e47376c67 9. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/arm64/boot/dts/qcom/ipq8074.dtsi?h=v5.15.99&id=69c7a270357a7d50ffd3471b14c60250041200e3 10. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/arm64/boot/dts/qcom/ipq8074.dtsi?h=v5.15.99&id=dd3d021ae5471d98adf81f1e897431c8657d0a18 Build system: x86_64 Build-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3 Run-tested: bcm2711/RPi4B, ramips/tplink_archer-a6-v3 Signed-off-by: John Audia <therealgraysky@proton.me> Tested-by: Robert Marko <robimarko@gmail.com> #ipq807x/Dynalink WRX36 Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> #ipq807x/ax3600, x86_64/FW-7543B, ath79/tl-wdr3600, ipq806x/g10, ipq806x/nbg6817
* uencrypt: add support for mbedtlsEneas U de Queiroz2023-03-171-2/+2
| | | | | | | | | | | | | | This commit includes some additional changes: - better handling of iv and keys in openssl/wolfssl variants - fix compiler warnings and whitespace - build all 3 variants as separate packages - adjust the new package name in targets' DEVICE_PACKAGES - remove PKG_FLAGS:=nonshared [Beeline SmartBox Flash - OK] Tested-by: Mikhail Zhilkin <csharper2005@gmail.com> [after test: replaced a hardcoded IV size of 16 by cipher_info->iv_size] Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
* ramips: add support for TP-Link Archer AX23 v1David Bauer2023-03-154-0/+223
| | | | | | | | | | | | | | | | | | | | | | | | | Hardware -------- CPU: MediaTek MT7621 DAT RAM: 128MB DDR3 (integrated) FLASH: 16MB SPI-NOR () WiFi: MediaTek MT7905 + MT7975 (2.4 / 5 DBDC) 802.11ax SERIAL: 115200 8N1 LEDs - (3V3 - GND - RX - TX) - ETH ports Installation ------------ Upload the factory image using the Web-UI. Web-Recovery ------------ The router supports a HTTP recovery mode by holding the reset-button when powering on. The interface is reachable at 192.168.0.1 and supports installation using the factory image. Signed-off-by: David Bauer <mail@david-bauer.net>
* ramips: add support for SNR-CPE-ME2-SFPAleksey Nasibulin2023-03-083-0/+235
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SNR-CPE-ME2-SFP is a wireless router with SFP cage manufactured by SNR/NAG company. Specification: - SoC: MediaTek MT7621A - CPU: 880MHz - Flash: 16 MB (GD25Q127CSIG) - RAM: 256 MB - WLAN: 2.4 GHz, 5 GHz (MediaTek MT7615DN) - Ethernet: 4x 10/100/1000 Mbps - SFP cage (using RTL8211FS-CG) - USB 3.0 port - Power: 12 VDC, 2 A Flash instruction via TFTP: 1. Boot SNR-CPE-ME2 to recovery mode (press reset button and power on device, hold button for ~10 seconds) 2. Send firmware via TFTP client: TFTP Server address: 192.168.1.1 TFTP Client address: 192.168.1.131 3. Wait ~120 seconds to complete flashing 4. Do sysupgrade using web-interface MAC Addresses(stock) -------------------- +----------+------------------+-------------------+ | use | address | example | +----------+------------------+-------------------+ | Device | label | 6A:C4:DD:xx:xx:28 | | Ethernet | + 1 | 6A:C4:DD:xx:xx:29 | | 2g | + 2 | 6A:C4:DD:xx:xx:2A | | 5g | + 3 | 6A:C4:DD:xx:xx:2B | +----------+------------------+-------------------+ Notes: - Reading sfp eeprom is not supported [1] (driver issue). Stock image has the same situation. References: 1. https://forum.openwrt.org/t/mt7621-and-reading-sfp-eeprom/152249 Signed-off-by: Aleksey Nasibulin <alealexpro100@ya.ru>
* ramips: mt7621: TP-Link EAP235/615-Wall: add poe passthrough gpio definitionsAndré Fonseca2023-03-041-0/+4
| | | | | | | | | Add the missing definitions for the PoE passthrough functionality. The relevant pin is already being exported, but it is missing from the initial board configuration file. With this change, the user is now able to toggle the PoE passthorough functionality via the uci cli Signed-off-by: André Fonseca <mail@andrefonseca.pt>
* ramips: fix wrong pcie port number for Arcadyan WE420223-99Mikhail Zhilkin2023-03-041-1/+1
| | | | | | | | | | | | | Wrong pcie port number for WLAN causes missing 5g WLAN interface with 5.15 kernel on Arcadyan WE420223-99 (KPN Experia WiFi). This changes port from pcie0 to pcie1. [1.331556] mt7621-pci 1e140000.pcie: pcie0 no card, disable it (RST & CLK) [1.345299] mt7621-pci 1e140000.pcie: pcie2 no card, disable it (RST & CLK) [1.359116] mt7621-pci 1e140000.pcie: PCIE1 enabled Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
* ramips: add support for D-Link Dir-853 A1Hang Zhou2023-03-044-0/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifications: * SoC: MT7621AT * RAM: 256MB (NT5CC64M16GP-DI) * Flash: 16MB NOR SPI flash (GD25Q127CSIG, using GD25Q128C driver) * WiFi: MT7615DN (2.4GHz+5Ghz) with DBDC * Ethernet: 4x1000M LAN, 1x 1000M WAN * LEDs: Power Blue+Orange,Wan Blue+Orange,WPS Blue,"2.4G"Blue, "5G" Blue, USB Blue * Buttons: Reset,WPS, Wifi * Serial interface: on board but not populated, pinout (from the DC jack side to the WAN port side) is "3.3V Input Output Gnd". Baud rate is 57600, settings are 8 data bits, no parity bit, one stop bit, and no flow control. Stock flash layout: ``` GD25Q128C(c8 40180000) (16384 Kbytes) mtd .name = raspi, .size = 0x01000000 (16M) .erasesize = 0x00010000 (64K) .numeraseregions = 0 Creating 7 MTD partitions on "raspi": 0x000000000000-0x000001000000 : "ALL" 0x000000000000-0x000000030000 : "Bootloader" 0x000000030000-0x000000040000 : "Config" 0x000000040000-0x000000050000 : "Factory" 0x000000050000-0x000000060000 : "Config2" 0x000000060000-0x000000fb0000 : "Kernel" 0x000000fb0000-0x000001000000 : "Private" ``` The kernel partition will be replaced with the OpenWrt image, the other partitions are left untouched. "Config2" seems to be the config storage used by the stock firmware. "Private" is a 320kB empty JFFS2 partition that comes with the stock firmware. One can get a larger space for OpenWrt by merging it with "Kernel". OpenWrt flash layout: ``` 0x000000000000-0x000000030000 : "u-boot" 0x000000030000-0x000000040000 : "u-boot-env" 0x000000040000-0x000000050000 : "factory" 0x000000050000-0x000000060000 : "config2_stock" 0x000000060000-0x000000fb0000 : "firmware" 0x000000fb0000-0x000001000000 : "private_stock" ``` The OpenWrt image must have 96 bytes of padding in the header. MAC addresses on OEM firmware: | | location on the flash | notes | |------ |----------------------- |---------- | | lan (eth2) | factory + 0xe000 | on label | | wan (eth3) | factory + 0xe006 | | | 2.4g (rax0) | not on flash | lan + 1 | | 5g (ra0) | not on flash | lan + 2 | Mac addresses of the 2.4g and 5g interface are stored as ASCII strings in the u-boot-env partition, but they are not used. OpenWrt calculates Wifi Mac addresses based on the LAN Mac. Flash and test instructions: Flash the encrypted image (available in the OpenWrt forum) through the stock D-Dink web interface. 1. Open the case, and solder the 4-pin header near the WAN port. 2. Connect it to a USB-UART TTL (3.3V) adapter, no need to connect VCC. 3. Open a terminal emulator (e.g. `screen /dev/ttyUSB0` on linux) with the settings mentioned above. 4. Setup a TFTP server on your PC that can serve `xxx-ramips-mt7621-dlink_dir-853-a1-initramfs-kernel.bin`. 5. Connect any LAN port to your PC and set a static IPv4 address to 192.168.0.101 (netmask 255.255.255.0). 6. Power on the device and keeps pressing 1 until you see the prompt. 7. Use default IP addresses and enter the file name accordingly, then hit enter. 8. Wait until it boots to OpenWrt, the default IP address is 192.168.1.1, you need to change your PC network adapter to use DHCP in order to access LUCI. 9. So far, the OpenWrt runs in RAM and the flash contents are not touched. You can try OpenWrt without having to overwrite the stock firmware, a reboot clears all changes. 10. Optionally, backup the stock firmware (the "firmware" partition) in Luci. 11. To permantly install OpenWrt to the device , click on "System -> Backup/Flash Firmware" in Luci and flash `xxx-ramips-mt7621-dlink_dir-853-a1-squashfs-sysupgrade.bin` Known problems: * WLAN0 defaults to 5G after a fresh installation, to enable 2.4G network, you need to config it manually in LUCI. * If you see jffs2 related warnings/errors after updating from the stock web interface, you need to do a reset in LUCI. The error will be gone after a cold reboot. Signed-off-by: Hang Zhou <929513338qq@gmail.com>
* mt7621: move uboot-envtools to DEFAULT_PACKAGESBjørn Mork2023-03-012-178/+194
| | | | | | | | | Several devices depend on fw_printenv during sysupgrade. Make sure it always is present in all images, including initramfs images built by the buildbots. Fixes: 2449a632084b ("ramips: mt7621: Add support for ZyXEL NR7101") Signed-off-by: Bjørn Mork <bjorn@mork.no>
* ramips: rt5350: enable lzma-loader for ALLNET ALL5003Sergio Paracuellos2023-03-011-0/+1
| | | | | | | Fixes the boot loader LZMA decompression issue: LZMA ERROR 1 - must RESET board to recover Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
* treewide: remove label = "cpu" from DSA dt-bindingArınç ÜNAL2023-02-261-1/+0
| | | | | | | This is not used by the DSA dt-binding, so remove it from all devicetrees. Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9cc115d8d6f73dd260de1609182f3645844d6907 Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
* ramips: Alternative name Asus RT-AC750L for Asus RT-AC1200V2Karl Chan2023-02-261-0/+2
| | | | | | | | The Asus RT-AC750L is identical to the already supported Asus RT-AC1200V2. Use the ALT0 buildroot tags to show both devices. Reference : https://forum.openwrt.org/t/asus-rt-ac750l-is-the-same-as-rt-ac1200-v2/151783 Signed-off-by: Karl Chan <exkc@exkc.moe>
* ramips: correct the PCIe port number for some mt7621 devicesFelix Baumann2023-02-252-2/+2
| | | | | | | | | | | | | | | | | | | | MT7621 uses a new PCIe driver in the 5.15+ kernel. Allocating wrong PCIe port will cause the PCIe NIC to not work properly. This commit fixes the wrong port numbers on Netgear R6220, WAC104 and WNDR3700 v5. According to bootlog, MT7612E (5GHz) is connected to pcie0, and MT7603E (2GHz) is connected to pcie2: [2.758986] mt7621-pci 1e140000.pcie: pcie1 no card, disable it (RST & CLK) [2.772862] mt7621-pci 1e140000.pcie: PCIE0 enabled [2.782579] mt7621-pci 1e140000.pcie: PCIE2 enabled ... [3.009151] pci 0000:01:00.0: [14c3:7662] type 00 class 0x028000 [3.125715] pci 0000:02:00.0: [14c3:7603] type 00 class 0x028000 Tested-by: Maximilian Baumgartner <aufhaxer@googlemail.com> Signed-off-by: Shiji Yang <yangshiji66@qq.com> [felix.bau@gmx.de: adjust commit message for Netgear devices] Signed-off-by: Felix Baumann <felix.bau@gmx.de>
* ramips: add alternative device name for Wiflyer WF3526-PShiji Yang2023-02-191-0/+2
| | | | | | | | | Wiflyer WF3526-P and Zbtlink ZBT-WE1326 have the same circuit design. Installing the misunderstading firmware of ZBT-WE3526 will cause Wi-Fi not work due to allocate the wrong pcie port. Add alternative name to help users easily build or download the correct firmware. Signed-off-by: Shiji Yang <yangshiji66@qq.com>
* ramips: correct the PCIe port number for Zbtlink ZBT-WE1326Shiji Yang2023-02-191-2/+2
| | | | | | | | | | | | | | | | | MT7621 gets a new PCIe driver in the 5.15+ kernel. Allocating wrong PCIe port will cause the PCIe NIC to not work properly. This commit fixes the wrong port numbers on Zbtlink ZBT-WE1326. According to the bootlog, MT7612E (5 GHz) is connected to pcie1, and MT7603E (2 GHz) is connected to pcie2: [4.197658] mt7621-pci 1e140000.pcie: pcie0 no card, disable it (RST & CLK) [4.204609] mt7621-pci 1e140000.pcie: PCIE1 enabled [4.209476] mt7621-pci 1e140000.pcie: PCIE2 enabled ... [4.307988] pci 0000:01:00.0: [14c3:7662] type 00 class 0x028000 [4.367206] pci 0000:02:00.0: [14c3:7603] type 00 class 0x028000 Signed-off-by: Shiji Yang <yangshiji66@qq.com>
* ramips: add support for Huasifei WS1208V2Arınç ÜNAL2023-02-183-0/+200
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The Huasifei WS1208V2 is an AC1200 router featuring 5 Ethernet ports with a Quectel RM520N-GL cellular modem which supports QMI and MBIM modes. Specifications: - MT7621AT, 256 MiB RAM, 16 MiB SPI Flash - MT7603EN 2.4 GHz & MT7612EN 5 GHz WLAN - Quectel RM520N-GL Cellular Modem - 2 WLAN & 4 Cellular Antennas - 5 Gigabit Ethernet Ports - 1 USB 2.0 port - 1 PCI-E Slot - 1 M.2 slot - 1 SIM card slot - 1 SD card slot Installation: - Install sysupgrade image via ROOter OS. TFTP Recovery: - Connect to serial console. - Boot initramfs image by choosing option 1 when U-Boot prompts. - Install sysupgrade image via OpenWrt. Link: https://www.huasifei.com/a/Products/5G%20CPE/240.html Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
* ramips: add label MAC address for EPG600 and ESR600Michael Pratt2023-02-181-0/+1
| | | | | | | set label mac for the current ESR600 and new EPG600 using the board.d scripts Signed-off-by: Michael Pratt <mcpratt@pm.me>
* ramips: add support for Senao Engenius EPG600Michael Pratt2023-02-183-0/+245
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FCC ID: A8J-EPG600 Engenius EPG600 is an indoor wireless router with 1 Gb ethernet switch, dual-band wireless, internal antenna plates, USB, and phone lines (not supported) this board is a Senao device: the hardware is equivalent to EnGenius ESR600 (except for phone lines) the software is Senao SDK which is based on openwrt and uboot which uses the legacy Senao header with Vendor / Product IDs to verify the firmware upgrade image. **Specification:** - MT7620 SOC MIPS 24kec, 2.4 GHz WMAC, 2x2 - RT5592N WLAN PCI chip, 5 GHz, 2x2 - QCA8337N Gb SW RGMII GbE, SW P0 -- SOC P5, 5 LEDs - 40 MHz clock - 16 MB FLASH MX25L12845EMI-10G - 64 MB RAM NT5TU32M16 - UART console J2, populated - USB 2.0 port direct to SOC - 6 GPIO LEDs power, 2G, 5G, wps2g, wps5g, line - 3 buttons reset, wps, "reg" (registeration) - 4 antennas internal omni-directional plates NOT YET SUPPORTED: VoIP - Si3050-FT + Si3019-FT Voice DAA, SPI control, PCM data - Phone Ports "TEL", "LINE" RJ11, 4P2C (2 pins) **MAC addresses:** MAC address labeled as MAC ADDRESS MACs present in both wifi cal data and uboot environment eth0.1/phy1 ---- *:82 rf 0x4 phy0 ---- *:83 factory 0x4 eth0.2 MAC *:b8 "wanaddr" **Installation:** Method 1: Firmware upgrade page: (if you cannot access the APs webpage) factory reset with the reset button connect ethernet to a computer OEM webpage at 192.168.0.1 username and password 'admin' Navigate to gear icon, "Device Management", "Tools" select the factory.dlf image Upload and verify checksum Method 2: Serial to upload initramfs: Follow directions for TFTP recovery upload and boot initramfs and do a sysupgrade **TFTP recovery:** Requires UART serial console, reset button does nothing rename initramfs-kernel.bin to 'uImageEPG600' make available on TFTP server at 192.168.99.8 power board, interrupt boot with "4" execute `tftpboot` and `bootm` (with the load address) **Return to OEM:** Images from OEM are provided, but not compatible with openwrt sysupgrade. So it must be modified. Alternatively, back up all mtd partitions before flashing **Note on switch registers:** The necessary registers needed for the QCA8337 switch can be read from interrupted boot (tftpboot, bootm) by using the following lines in the switch driver ar8327.c in the function 'ar8327_hw_config_of' where 'qca,ar8327-initvals' is parsed from DTS before the new register values are written: pr_info("0x04 %08x\n", ar8xxx_read(priv, AR8327_REG_PAD0_MODE)); pr_info("0x08 %08x\n", ar8xxx_read(priv, AR8327_REG_PAD5_MODE)); pr_info("0x0c %08x\n", ar8xxx_read(priv, AR8327_REG_PAD6_MODE)); pr_info("0x10 %08x\n", ar8xxx_read(priv, AR8327_REG_POWER_ON_STRAP)); Signed-off-by: Michael Pratt <mcpratt@pm.me>
* ramips: mt7620: split gsw hw_init to mac_init, ephy_initMichael Pratt2023-02-181-16/+24
| | | | | | | | | | | | | | | | | | | in order for the option ephy-disable to work without also needing ephy-base option, we have to skip all the lines that write to mdio addresses that assume those addresses do not have an external switch. Otherwise, ephy ports will be disabled in hardware, but register writes still happen as if they are enabled. Split the functions so that other things are done first, and ephy port setup can be skipped with a simple "return". Tested on Engenius EPG600 (MT7620A ver:2 eco:3) with QCA8337 external switch Ref: cc6fd6fbb505 ("ramips: mt7620: add ephy-disable option to switch driver") Signed-off-by: Michael Pratt <mcpratt@pm.me>
* ramips: fix the name of ASUS AX54 because it has dupilcated twiceKarl Chan2023-02-181-5/+3
| | | | | | The name of ASUS AX54 has dupilcated in the DEVICE_ALT0_VENDOR/DEVICE_ALT0_MODEL Signed-off-by: Karl Chan <exkc@exkc.moe>
* ramips: backport mt7621 PCIs initialization delay patchShiji Yang2023-02-182-0/+104
| | | | | | | | | | | | | The sender domain has a DMARC Reject/Quarantine policy which disallows sending mailing list messages using the original "From" header. To mitigate this problem, the original message has been wrapped automatically by the mailing list software. Some devices like ZBT WE1326 and ZBT WF3526-P and some Netgear models need to delay phy port initialization after calling the mt7621_pcie_init_port() driver function to get into reliable boots for both warm and hard resets. Signed-off-by: Shiji Yang <yangshiji66@qq.com>
* ramips: Switch default kernel to 5.15Rodrigo B. de Sousa Martins2023-02-171-2/+1
| | | | | | | | | | | | | I tested kernel 5.15 on my device for several times without any problems. In my tests, 5.15 kernel has performance improvements such MGLRU. Finally, initial kernel 6.1 support is imminent. All ramips subtargets have 5.15 as testing kernel. So, it's time to change. Tested on my Archer C6 v3.2 (mt7621) Signed-off-by: Rodrigo B. de Sousa Martins <rodrigo.sousa.577@gmail.com> [reformat commit subject and message] Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
* ramips: fix wrong pcie port number for Arcadyan devicesMikhail Zhilkin2023-02-171-1/+1
| | | | | | | | | | | Wrong pcie port number for WLAN causes missing 5g WLAN interface with 5.15 kernel. This changes port from pcie0 to pcie1 in dtsi. [1.166330] mt7621-pci 1e140000.pcie: pcie0 no card, disable it (RST & CLK) [1.180073] mt7621-pci 1e140000.pcie: pcie2 no card, disable it (RST & CLK) [1.193889] mt7621-pci 1e140000.pcie: PCIE1 enabled Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
* ramips: add support for ASUS RT-AX54Karl Chan2023-02-124-0/+216
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifications: - Device: ASUS RT-AX54 (AX1800S/HP,AX54HP) - SoC: MT7621AT - Flash: 128MB - RAM: 256MB - Switch: 1 WAN, 4 LAN (10/100/1000 Mbps) - WiFi: MT7905 2x2 2.4G + MT7975 2x2 5G - LEDs: 1x POWER (blue, configurable) 1x LAN (blue, configurable) 1x WAN (blue, configurable) 1x 2.4G (blue, not configurable) 1x 5G (blue, not configurable) Flash by U-Boot TFTP method: - Configure your PC with IP 192.168.1.2 - Set up TFTP server and put the factory.bin image on your PC - Connect serial port(rate:115200) and turn on AP, then interrupt "U-Boot Boot Menu" by hitting any key Select "2. Upgrade firmware" Press enter when show "Run firmware after upgrading? (Y/n):" Select 0 for TFTP method Input U-Boot's IP address: 192.168.1.1 Input TFTP server's IP address: 192.168.1.2 Input IP netmask: 255.255.255.0 Input file name: openwrt-ramips-mt7621-asus_rt-ax1800hp-squashfs-factory.bin - Restart AP aftre see the log "Firmware upgrade completed!" Signed-off-by: Karl Chan <exkc@exkc.moe>
* ramips: fix dts whitespaceFelix Baumann2023-02-096-15/+15
| | | | | | | Replace blanks with tabs Remove whitespace from otherwise empty lines Signed-off-by: Felix Baumann <felix.bau@gmx.de>
* kernel: bump 5.15 to 5.15.92John Audia2023-02-081-2/+2
| | | | | | | | | | All other patches automatically rebased. Build system: x86_64 Build-tested: bcm2711/RPi4B, filogic/xiaomi_redmi-router-ax6000-ubootmod Run-tested: bcm2711/RPi4B, filogic/xiaomi_redmi-router-ax6000-ubootmod Signed-off-by: John Audia <therealgraysky@proton.me>
* treewide: replace wpad-basic-wolfssl defaultRosen Penev2023-02-048-29/+29
| | | | | | | The newly merged mbedtls backend is smaller and has fewer ABI related issues than the wolfSSL one. Signed-off-by: Rosen Penev <rosenp@gmail.com>
* ramips: mt7621-dts: fix phy-mode of external phy on GB-PC2Arınç ÜNAL2023-02-031-1/+1
| | | | | | | | The phy-mode property must be defined on the MAC instead of the PHY. Define phy-mode under gmac1 which the external phy is connected to. Tested-by: Petr Louda <petr.louda@outlook.cz> Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
* ramips: mt7621-dts: fix compatible string for mt7530 on TP-Link EAP615-WallArınç ÜNAL2023-02-031-1/+0
| | | | | | | | | | The correct compatible string for the multi-chip module MT7530 switch in MT7621AT, MT7621DAT and MT7621ST SoCs is mediatek,mt7621. Remove the property on TP-Link EAP615-Wall which will default to the said string. Fixes: a1b8a4d7b3ff ("ramips: support TP-Link EAP615-Wall") Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
* ramips: use on-flash partition table for Sercomm BZV/CHJJan Hoffmann2023-02-032-8/+330
| | | | | | | | | | | | | | | | | | | These devices have a partition table stored in flash, which compensates for any pre-existing bad blocks by enlarging the respective partition. This means that the current static partition table is only correct for devices without any bad blocks. Typical results of this mismatch are degraded wireless performance and wrong MAC addresses, when the factory partition is shifted due to a bad block somewhere before it. If there is a bad block already before the ubi partition, then OpenWrt may not run at all because the kernel can't find the rootfs. Use the on-flash partition table to fix these issues. Replace the two reserved partitions by the full partition list, as the driver does not allow merging them. Signed-off-by: Jan Hoffmann <jan@3e8.eu>
* ramips: add support for TP-Link Deco M4R v4Mark Ceeha2023-02-034-0/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds support for the V4 hardware revision of the Deco M4R. V4 is a complete overhaul of the hardware compared to V1 and V2, and is much more similar to the Archer C6 V3 and C6U V1. Specifications: SoC: MediaTek MT7621AT (2 cores at 880 MHz, 4 threads) RAM: Kingston D1216ECMDXGJD (256 MB) Wireless 2.4 GHz: MediaTek MT7603EN Wireless 5 GHz: MediaTek MT7613BEN Flash: 16 MB SPI NOR Installation: Flash the *-factory.bin image in the U-Boot recovery webserver. You can trigger this webserver by holding the reset button until the LED flashes yellow, or by hooking up to serial pads on the board (clearly labeled GND, RX and TX) and pressing `x` early in boot. Once the factory image has been flashed, you can use the regular upgrade procedure with sysupgrade images for subsequent flashes. Signed-off-by: Mark Ceeha <hi@shiz.me> Tested-by: Mark Ceeha <hi@shiz.me>
* ramips: mt7621: add support for Xiaomi Mi Router 4A Gigabit v2Dmitry Sokolov2023-01-286-132/+241
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Device is the same as Xiaomi Mi Router 4A Gigabit, except of: - 5G WiFi is MT7663 - addresses of leds, wifi and eth ports are slightly changed Specs: SoC: MT7621 CPU: 2 x 880 MHz ROM: 16 MB RAM: 128 MB WLAN: MT7603, MT7663 MAC addresses: WAN **** factory 0xe006 (label) LAN *:f7 factory 0xe000 2.4 GHz *:f8 factory 0x0000+0x4 (mtd-eeprom+0x4) 5 GHz *:f9 factory 0x8000+0x4 (mtd-eeprom+0x4) Installation: Factory firmware is based on a custom OpenWrt 17.x. Installation is the same as for Xiaomi Mi Router 4A Gigabit. Probably the easiest way to install is to use the script from this repository: https://github.com/acecilia/OpenWRTInvasion/pull/155 In a more advanced case, you can do everything yourself: - gain access to the device through one of the exploits described in the link above - upload sysupgrade image to /tmp - overwrite stock firmware: # mtd -e OS1 -r write /tmp/sysupgrade.bin OS1 Recovery: Recovery procedure is the same as for Xiaomi Mi Router 4A Gigabit. Possible options can be found here: https://openwrt.org/inbox/toh/xiaomi/xiaomi_mi_router_4a_gigabit_edition One of the ways is to use another router with OpenWrt: - connect both routers by their LAN ports - download stock firmware from [1] - place it inside /tmp/test.bin on the main router - configure PXE/TFTP on the main router - power off 4Av2, hold Reset button, power on - as soon as image download via TFTP starts, Reset can be released - blinking blue wan LED will indicate the end of the flashing process, now router can be rebooted [1] http://cdn.cnbj1.fds.api.mi-img.com/xiaoqiang/rom/r4av2/miwifi_r4av2_firmware_release_2.30.28.bin Signed-off-by: Dmitry Sokolov <e323w@proton.me>
* ramips: improve support for Zyxel Keenetic Extra IIMaxim Anisimov2023-01-283-13/+27
| | | | | | | | | | | - drop unneeded default-state for led_power - concat firmware partitions to extend available free space - increase spi flash frequency to 32 Mhz (value from stock firmware bootlog) - drop broken-flash-reset because of onboard flash chip W25Q256FV has reset support - add compatible for pcie wifi according to kernel documetation - switch to wan mac address with offset 0x28 in rf-eeprom Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
* ramips: use hex value in zyimage command for Keenetic KN-3010Maxim Anisimov2023-01-281-1/+1
| | | | | | | This is cosmetic change. The hex value is related to the device model and more human friendly. Signed-off-by: Maxim Anisimov <maxim.anisimov.ua@gmail.com>
* ramips: Fix root volume for tplink-er605-v2Nikolay Martynov2023-01-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This device has two sets of volumes: main ones (`kernel`, `rootfs`, etc) and 'backup' (`kernel.b`, `rootfs.b`, etc). Bootloader tries to determine which set of volumes to use by looking at contens of `extra-para` and `extra-para.b` volumes. These volumes contain JSON that looks like this: ``` { "dbootFlag": "1", "integerFlag": "1", "fwFlag": "GOOD", "score":1 } ``` It looks like the bootloader looks for `"fwFlag": "GOOD"` (as opposed to `BAD`) then it compares `score` field - whichever 'good' volume has bigger score wins. This determines which set of volumes to use to boot. So for example if `extra-para` is good and has bigger score then `kernel`, `rootfs`, etc volumes are used. This means bootloader needs to explain to the kernel which volume to use for the rootfs. After looking at bootloader code with disassembler I think it contains a bug. Relevant part of code looks something like this: ``` if (image_id == 0) { rootfs_volume_id = 8; rootfs_volume_name = "rootfs"; } else { rootfs_volume_id = 0xf; rootfs_volume_name = "rootfs.b"; } sprintf( &buffer, 0x800, "console=ttyS0,115200 noinitrd ubi.mtd=3,2048 ubi.block=0,%s root=/dev/ubiblock0_%d DKMGT_IMAGE_ID=%d DKMGT_IMAGE_TYPE=ubi", rootfs_volume_name, rootfs_volume_id, image_id ); ``` Where `image_id == 0` if 'normal' (not '*.b' set of volumes is used). However from device dumps we know that from the factory `rootfs.b` has id 8 and `rootfs` has id 15. So from above we can see that ids and names of rootfs volumes do not match. More over - they are hardcoded in the bootloader. Both things are problematic for OpwnWRT which completely removes volumes on update meaning that volume ids may actually change. So instead of relying on bootloader to provide the kernel with root device this patch forces kernel to determine root automatically - and it defaults to `rootfs` volume which is correct for our purposes. Overall this makes image boot fine from flash after sysupgrade from inirams. assuming `extra-para*` volumes make bootloader use non-'*.b' set of volumes. Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>