aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
Commit message (Collapse)AuthorAgeFilesLines
* realtek: initialize port masks to match the default stateJan Hoffmann2023-05-072-24/+22
| | | | | | | | | | | | | All ports are disabled by default, so configure the port isolation masks and the pm field accordingly in the setup function. When port_enable is called for a port, the isolation masks will be set up so that traffic can flow between the port and the CPU. While at it, change the code to also use the traffic_set method in rtl83xx_setup, instead of writing to the RTL838x_PORT_ISO_CTRL(i) registers directly. Signed-off-by: Jan Hoffmann <jan@3e8.eu>
* realtek: properly update port masks when port leaves bridgeJan Hoffmann2023-05-072-10/+10
| | | | | | | | | | | | | | | | | Correctly update the isolation mask of the port being configured. The port_bitmap variable should contain all other bridge members and needs to be actually removed from the isolation mask instead of added to it. Also actually remove the port being configured from the pm field of the other ports, so that any other ports that are currently disabled will be configured correctly when they are enabled. Fixes: df8e6be59a1f ("rtl838x: add new architecture") [fixed updating pm field of other ports] Fixes: 2b88563ee5aa ("realtek: update the tree to the latest refactored version") [reintroduced incorrect pm field update] Fixes: 27029277f98d ("realtek: add switch driver support for the RTL93XX based switches") Signed-off-by: Jan Hoffmann <jan@3e8.eu>
* layerscape: Add support for Felix DSA switchWojciech Dubowik2023-05-071-0/+5
| | | | | | It's present on LS1028ARDB reference board from NXP. Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@protonmail.ch>
* layerscape: Add ls1028ardb supportWojciech Dubowik2023-05-075-0/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for NXP LS1028ARDB reference board. It's a dual core Coretex-A53 board with 4G RAM and 5 Eternet ports (4 ports are connected to MSCC Felix switch). The original layout of NXP board has been kept but firmware images are adapted to be more sysupgrade friendly. At the moment NOR and SD boots are supported. NOR flash instructions: * make sd card with sdboot image * boot * write firmware image to spi flash $ mtd write /tmp/openwrt-layerscape-armv8_64b-fsl_ls1028a-rdb- squashfs-firmware.bin /dev/mtd0 * change jumper to NOR boot and reset V3: * Added board specific network defaults for lan/wan v2: * Added INA220 curent monitor, PCF2129 RTC clock and NXP SA56004ED temperature sensor to default packages * removed compat fixups for thist board Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@protonmail.ch>
* ramips: add support for SNR-CPE-ME1Maximilian Weinmann2023-05-073-0/+227
| | | | | | | | | | | | | | | | | | | | | | | | | | | | SNR-CPE-ME1 is a wireless WiFi 5 router manufactured by SNR/NAG company. Specification: - SoC : MediaTek MT7621A - RAM : DDR3 256 MiB - Flash : SPI-NOR 16 MiB (GD25Q128CSIG) - WLAN : 2.4 GHz (MediaTek MT7603EN) 5 GHz (MediaTek MT7610EN) - Ethernet : 10/100/1000 Mbps x5 - Switch : MediaTek MT7530 (in SoC) - USB : 3.0 x1 - UART : through-hole on PCB - [J4] 3.3V, RX, TX, GND (57600n8) - Power : 12 VDC, 2 A Flash instruction via TFTP: 1. Boot SNR-CPE-ME1 to recovery mode (hold the reset button while power on) 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 Signed-off-by: Maximilian Weinmann <x1@disroot.org>
* ath79: add support for ZTE MF282Andreas Böhler2023-05-063-0/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ZTE MF282 is a LTE router used (exclusively?) by the network operator "3". Specifications ============== SoC: QCA9563 (775MHz) RAM: 128MiB Flash: 8MiB SPI-NOR + 128MiB SPI-NAND LAN: 1x GBit LAN LTE: ZTE MF270 (Cat4), detected as P685M WiFi: QCA9880ac + QCA9560bgn MAC addresses ============= LAN: from config WiFi 1: from config WiFi 2: +1 Installation ============ TFTP installation using UART is preferred. Disassemble the device and connect serial. Put the initramfs image as openwrt.bin to your TFTP server and configure a static IP of 192.168.1.100. Load the initramfs image by typing: setenv serverip 192.168.1.100 setenv ipaddr 192.168.1.1 tftpboot 0x82000000 openwrt.bin bootm 0x82000000 From this intiramfs boot you can take a backup of the currently installed partitions as no vendor firmware is available for download. Once booted, transfer the sysupgrade image and run sysupgrade. LTE Modem ========= The LTE modem is probably the same as in the MF283+, all instructions apply. Configuring the connection using modemmanager works properly, the modem provides three serial ports and a QMI CDC ethernet interface. Signed-off-by: Andreas Böhler <dev@aboehler.at>
* ath79: refactor ZTE MF28x dts filesAndreas Böhler2023-05-063-329/+233
| | | | | | | Move common dts entries of ZTE MF281 and ZTE MF286 to a common .dtsi file to reduce redundancies. Signed-off-by: Andreas Böhler <dev@aboehler.at>
* ramips: mt7621: rename Asus RT-AC57U to v1Felix Baumann2023-05-062-4/+6
| | | | | | rename RT-AC57U to avoid confusion with unsupported revisions 2 and 3 Signed-off-by: Felix Baumann <felix.bau@gmx.de>
* realtek: adapt patch description to it's current useNick Hainke2023-05-061-3/+2
| | | | | | The patch is not doing anymore what the descriptions says. Update it. Signed-off-by: Nick Hainke <vincent@systemli.org>
* generic: 5.15: remove outdated symbolsNick Hainke2023-05-051-8/+0
| | | | | | | | | | | | | Remove symbols that are no longer present in 5.15: - CONFIG_CRYPTO_RMD128 - CONFIG_CRYPTO_RMD256 - CONFIG_CRYPTO_RMD320 - CONFIG_CRYPTO_SALSA20 - CONFIG_CRYPTO_TGR192 - CONFIG_RAW_DRIVER - CONFIG_ENABLE_MUST_CHECK Signed-off-by: Nick Hainke <vincent@systemli.org>
* generic: 5.15: add patch fixing compiling mvebu with gcc-13Nick Hainke2023-05-051-0/+348
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes errors in the form of: drivers/ata/libahci.c: In function 'ahci_led_store': ././include/linux/compiler_types.h:334:45: error: call to '__compiletime_assert_363' declared with attribute error: BUILD_BUG_ON failed: sizeof(_s) > sizeof(long) 334 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) | ^ ././include/linux/compiler_types.h:315:25: note: in definition of macro '__compiletime_assert' 315 | prefix ## suffix(); \ | ^~~~~~ ././include/linux/compiler_types.h:334:9: note: in expansion of macro '_compiletime_assert' 334 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) | ^~~~~~~~~~~~~~~~~~~ ./include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert' 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) | ^~~~~~~~~~~~~~~~~~ ./include/linux/build_bug.h:50:9: note: in expansion of macro 'BUILD_BUG_ON_MSG' 50 | BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition) | ^~~~~~~~~~~~~~~~ ./include/linux/nospec.h:62:9: note: in expansion of macro 'BUILD_BUG_ON' 62 | BUILD_BUG_ON(sizeof(_s) > sizeof(long)); \ | ^~~~~~~~~~~~ drivers/ata/libahci.c:1143:23: note: in expansion of macro 'array_index_nospec' 1143 | pmp = array_index_nospec(pmp, EM_MAX_SLOTS); | ^~~~~~~~~~~~~~~~~~ Signed-off-by: Nick Hainke <vincent@systemli.org>
* lantiq: switch to Kernel 5.15 by defaultPaul Spooren2023-05-041-2/+1
| | | | | | Getting ready for the next release. Signed-off-by: Paul Spooren <mail@aparcar.org>
* lantiq: xway: use capital letters in Fritz!Box nameNick Hainke2023-05-041-1/+1
| | | | | | | Rename to Fritz!Box to keep naming uniform. Fixes: ceac4ae3b403 ("lantiq: xway: add support for AVM FRITZ!Box 7330") Signed-off-by: Nick Hainke <vincent@systemli.org>
* lantiq: xrx200: mark subtarget as source-onlyAleksander Jan Bajkowski2023-05-041-1/+1
| | | | | | | | | The current problems blocking the switch to the kernel 5.15 are related to the GSWIP driver. This driver is only used by the xrx200 subtarget. The other subtargets are unaffected by this problem. Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
* Revert "lantiq: mark source only"Aleksander Jan Bajkowski2023-05-041-1/+1
| | | | | | | | This reverts commit c306385474f4f183657423be708ac7813ee38b47. It should be sufficient to disable only the xrx200 subtarget. Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
* kernel: improve handling of CONFIG_IO_URINGTony Ambardar2023-05-0314-14/+0
| | | | | | | | | | | | | | | | | | | | | | Kernel setting CONFIG_IO_URING supports high-performance I/O for file access and servers, generally for more performant platforms, and adds ~45 KB to kernel sizes. The need for this on less "beefy" devices is questionable, as is the size cost considering many platforms have kernel size limits which require tricky repartitioning if outgrown. The size cost is also large relative to the ~180 KB bump expected between major OpenWRT kernel releases. No OpenWrt packages have hard dependencies on this; samba4 and mariadb can take advantage if available (+KERNEL_IO_URING:liburing) but otherwise build and work fine. Since CONFIG_IO_URING is already managed via the KERNEL_IO_URING setting in Config-kernel.in (default Y), remove it from those target configs which unconditionally enable it, and update the defaults to enable it conditionally only on more powerful 64-bit x86 and arm devices. It may still be manually enabled as needed for high-performance custom builds. Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
* kernel: fix handling of CONFIG_DYNAMIC_DEBUGTony Ambardar2023-05-039-9/+2
| | | | | | | | | | Since CONFIG_DYNAMIC_DEBUG is already managed via the KERNEL_DYNAMIC_DEBUG setting in Config-kernel.in (default N), remove or disable it in target configs which unconditionally enable it, along with the related setting CONFIG_DYNAMIC_DEBUG_CORE. This saves several KB in the kernels for ipq40xx, ipq806x, filogic, mt7622, qoriq, and sunxi. Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
* kernel: bump 5.15 to 5.15.110John Audia2023-05-032-2/+2
| | | | | | | | | | All patches automatically rebased. 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>
* ipq40xx: convert AVM FRITZ!Repeater 3000 to DSANick Hainke2023-05-033-2/+22
| | | | | | Convert the repeater to DSA. Signed-off-by: Nick Hainke <vincent@systemli.org>
* kernel: Activate CONFIG_SLAB_FREELIST_RANDOMHauke Mehrtens2023-05-032-2/+2
| | | | | | | | | | | | | This activates CONFIG_SLAB_FREELIST_RANDOM. This option make the free list less predictable. This makes it harder to exploit heap based security vulnerabilities. This adds a little bit more code to the kernel and a small additional compute overhead. This option is activated in Debian by default. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* omap: mark source onlyPaul Spooren2023-05-031-1/+1
| | | | | | | | The target is currently broken with Kernel 5.15 and no one in sight to fix it. Instead of stalling the next release indefinitely, make it source only and see if someone steps up to fix it. Signed-off-by: Paul Spooren <paul.spooren@rhebo.com>
* lantiq: mark source onlyPaul Spooren2023-05-031-1/+1
| | | | | | | | The target is currently broken with Kernel 5.15 and no one in sight to fix it. Instead of stalling the next release indefinitely, make it source only and see if someone steps up to fix it. Signed-off-by: Paul Spooren <paul.spooren@rhebo.com>
* ramips: mt7621: add support for Cudy X6 v2Felix Baumann2023-05-025-52/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename existing device to v1 and create common .dtsi Difference to v1: 16MB Flash Specifications: SoC: MediaTek MT7621 RAM: 256 MB Flash: 16 MB (SPI NOR, XM25QH128C on my device) WiFi: MediaTek MT7915E Switch: 1 WAN, 4 LAN (Gigabit) Buttons: Reset, WPS LEDs: Two Power LEDs (blue and red; together they form purple) Power: DC 12V 1A center positive Serial: 115200 8N1 C440 - (3V3 - GND - RX - TX) - C41 | v1 and v2 (P - G - R - T) | v2 labels them on the board Installation: Download and flash the manufacturer's built OpenWrt image available at http://www.cudytech.com/openwrt_software_download Install the new OpenWrt image via luci (System -> Backup/Flash firmware) Be sure to NOT keep settings. Recovery: Loads only signed manufacture firmware due to bootloader RSA verification Serve tftp-recovery image as /recovery.bin on 192.168.1.88/24 Connect to any lan ethernet port Power on the device while holding the reset button Wait at least 8 seconds before releasing reset button for image to download MAC addresses as verified by OEM firmware: use address source LAN f4:a4:54:86:75:a2 label WAN f4:a4:54:86:75:a3 label + 1 2g f4:a4:54:86:75:a2 label 5g f6:a4:54:b6:75:a2 label + LA-Bit set + 4th oktet increased The label MAC address is found in bdinfo 0xde00. Signed-off-by: Felix Baumann <felix.bau@gmx.de>
* realtek: hpe_1920-8g: add phy-handle for SFP portsJan Hoffmann2023-04-302-0/+4
| | | | | | | | The switch driver actually expects every port to have a PHY handle, and several branches in the code determine if a port is valid by checking for a non-zero phy field. Signed-off-by: Jan Hoffmann <jan@3e8.eu>
* mediatek: no longer hard-code WAN PHY of Netgear WAX206Daniel Golle2023-04-301-2/+2
| | | | | | | | The RealTek 2.5G PHY providing the WAN port of the Netgear WAX206 has previously been hard-coded in the device tree. Now that the PHY can be probed correctly also via Clause-45 MDIO, use that instead. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* generic: net: phy: realtek: detect early version of RTL8221BDaniel Golle2023-04-301-0/+63
| | | | | | | | | | Early versions (?) of the RTL8221B PHY cannot be identified in a regular Clause-45 bus scan as the PHY doesn't report the implemented MMDs correctly but returns 0 instead. Implement custom identify function using the PKGID instead of iterating over the implemented MMDs to work-around this problem. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* kernel: bump 5.15 to 5.15.109John Audia2023-04-3010-59/+10
| | | | | | | | | | | | | | | Removed upstreamed: backport-5.15/743-v6.3-0005-net-dsa-b53-mmap-add-phy-ops.patch[1] All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.109&id=357fa038d93d0e9159a0f0d45bae0f8654e2ade5 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>
* kernel: bump 5.10 to 5.10.179John Audia2023-04-308-14/+14
| | | | | | All patches automatically rebased. Signed-off-by: John Audia <therealgraysky@proton.me>
* ramips: add factory image for TP-Link EC330-G5u v1Mikhail Zhilkin2023-04-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds factory.bin image for TP-Link EC330-G5u v1. This allows to install OpenWrt without connecting a serial cable (UART). Installation using factory image -------------------------------- Tested with "3.16.0 0.9.1 v6037.0 Build 191016 Rel.30619nb" TP-Link firmware. 1. Login to the router web interface (http://192.168.0.1/ by default) and save running config to "conf.bin" file 2. Open configuration file in any TP-Link config editor (e.g. https://jahed.github.io/tp-link-config-editor/) 3. Find "DeviceInfo" section and insert a new string "<Description val="Modem Router`telnetd -p 1023 -l login`" />" according to the following example: <DeviceInfo> ... <Description val="Modem Router`telnetd -p 1023 -l login`" /> ... </DeviceInfo> 4. Save configuration file and upload changed configuration using stock firmware interface 5. Login using telnet to IP:192.168.0.1 (Username:admin, password:1234) 6. Run "cat /proc/mtd | grep mtd7" a. If the result is 'mtd7: 03000000 00020000 "rootfs" 03400000', then install stock firmware using web interface to toggle booted firmware image from "os1" to "os0" b. If the result is 'mtd7: 03000000 00020000 "rootfs" 00400000', then all is ok, go to the next step 7. Set up a tftp server with OpenWrt factory.bin image (IP:192.168.0.100 in this example) 8. Login using telnet to 192.168.0.1 9. Download OpenWrt factory.bin image from the tftp server: cd /tmp tftp -g -r factory.bin 192.168.0.100 10. Write OpenWrt factory.bin image: dd if=/tmp/factory.bin of=/dev/mtdblock1 11. Power cycle the router Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
* ramips: TP-Link EC330-G5u v1: switch to mac-address-asciiMikhail Zhilkin2023-04-293-10/+26
| | | | | | | | | | | | | The TP-Link EC330-G5u v1 router has MAC address that stored in factory mtd in ascii format. This commit makes the router use of "mac-address-ascii" in dts. After the change: 1. All MAC addresses are explicitly assigned in dts (the workarounds in network scripts are no longer needed); 2. gmac0 (eth0) MAC address is no longer random. Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
* ramips: lzma-loader: Refactor loaderAntonio Vázquez2023-04-299-87/+75
| | | | | | | | | * Delete unused lantiq makefile * Delete redundant makefiles and unify them into the main makefile * Refactor and unify board code into a single file * Add support and review subtarget specific board support Signed-off-by: Antonio Vázquez <antoniovazquezblanco@gmail.com>
* ramips: add support for D-Link DAP-1620 B1Rani Hod2023-04-295-8/+191
| | | | | | | | | | | | | | | | | | | | | | | | | The DAP-1620 rev B is a wall-plug AC1300 repeater. Specifications: - MT7621AT, 256 MiB RAM, 16 MiB SPI NOR - MT7615DN 2x2 802.11n +2x2 802.11ac (DBDC) - Ethernet: 1 port 10/100/1000 - Status LEDs (1x red+green) - LED RSSI bargraph (2x green, 1x red+green) Installation: - Keep reset button pressed during plug-in - Web Recovery Updater is at 192.168.0.50 - Upload factory.bin, confirm flashing (seems to work best with Chromium-based browsers) Revert to OEM firmware: - tail -c+117 DAP1620B1_FW212B03.bin | \ openssl aes-256-cbc -d -md md5 -out decrypted.bin \ -k 905503a4e0c3cd3c1ce062246de427a68962347e - flash decrypted.bin via D-Link Web Recovery Signed-off-by: Rani Hod <rani.hod@gmail.com>
* bcm27xx: Deactivate CONFIG_OABI_COMPATHauke Mehrtens2023-04-292-2/+0
| | | | | | | | | | | | | This deactivates the kernel option CONFIG_OABI_COMPAT. The old arm OABI is not needed any more, we compile all applications for the new ARM EABI. This reduces the attack surface of the kernel syscall interface. On all other targets CONFIG_OABI_COMPAT is already deactivated. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* kernel: Deactivate CONFIG_COMPATHauke Mehrtens2023-04-293-11/+0
| | | | | | | | | | | | | | This deactivates the CONFIG_COMPAT kernel option. With CONFIG_COMPAT the kernel will provide syscall interfaces for arm32 binaries in addition to the interfaces needed for arm64 binaries. In OpenWrt the complete userspace is compiled for this specific architecture and support for 32 bit ARM applications is not needed. This reduces the size and the attack surface for the systems. On all other targets CONFIG_COMPAT is already deactivated. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* kernel: Deactivate CONFIG_LEGACY_PTYSHauke Mehrtens2023-04-2912-24/+0
| | | | | | | | | The legacy (BSD) PTY support could open security problems in a system, We do not need them in OpenWrt, deactivate this option in all targets. Debian also deactivates this option. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* kernel: Activate CONFIG_ARM64_SW_TTBR0_PANHauke Mehrtens2023-04-294-4/+0
| | | | | | | | | | | | | This activates the CONFIG_ARM64_SW_TTBR0_PAN option for all arm64 kernels by default. The CONFIG_ARM64_SW_TTBR0_PAN option prevents the kernel form accessing user space memory directly. This makes it harder to exploit the kernel. This is activated by default and was already activate on all other arm64 targets before. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* kernel: Activate CONFIG_HARDENED_USERCOPY for all targetsHauke Mehrtens2023-04-294-4/+0
| | | | | | | | | | | | | | This activates CONFIG_HARDENED_USERCOPY for the remaining targets. This adds additional checks in the copy_from_user() and copy_to_user() functions. This was not activated for ARCHS38 before because of a bug in the Linux kernel 5.4 till 5.14, which as fixed and is described here: https://github.com/foss-for-synopsys-dwc-arc-processors/linux/issues/15 I do not know why this was deactivated for mt7629 and rockchip. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* ramips: mt7621: add support for ZyXEL WSM20Andreas Böhler2023-04-296-1/+322
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ZyXEL WSM20 aka Multy M1 is a cheap mesh router system by ZyXEL based on the MT7621 CPU. Specifications ============== SoC: MediaTek MT7621AT (880MHz) RAM: 256MiB Flash: 128MiB NAND Wireless: 802.11ax (2x2 MT7915E DBDC) Ethernet: 4x 10/100/1000 (MT7530) Button: 1x WPS, 1x Reset, 1x LED On/Off LED: 7 LEDs (3x white, 2x red, 2x green) MAC address assignment ====================== The MAC address assignment follows stock: The label MAC address is the LAN MAC address, the WAN address is read from flash. The WiFi MAC addresses are set in userspace to label MAC + 1 and label MAC + 2. Installation (web interface) ============================ The device is cloud-managed, but there is a hidden local firmware upgrade page in the OEM web interface. The device has to be registered in the cloud in order to be able to access this page. The system has a dual firmware design, there is no way to tell which firmware is currently booted. Therefore, an -initramfs version is flashed first. 1. Log into the OEM web GUI 2. Access the hidden upgrade page by navigating to https://192.168.212.1/gui/#/main/debug/firmwareupgrade 3. Upload the -initramfs-kernel.bin file and flash it 4. Wait for OpenWrt to boot and log in via SSH 5. Transfer the sysupgrade file via SCP 6. Run sysupgrade to install the image 7. Reboot and enjoy NB: If the initramfs version was installed in RAS2, the sysupgrade script sets the boot number to the first partition. A backup has to be performed manually in case the OEM firwmare should be kept. Installation (UART method) ========================== The UART method is more difficult, as the boot loader does not have a timeout set. A semi-working stock firmware is required to configure it: 1. Attach UART 2. Boot the stock firmware until the message about failsafe mode appears 3. Enter failsafe mode by pressing "f" and "Enter" 4. Type "mount_root" 5. Run "fw_setenv bootmenu_delay 3" 6. Reboot, U-Boot now presents a menu 7. The -initramfs-kernel.bin image can be flashed using the menu 8. Run the regular sysupgrade for a permanent installation Changing the partition to boot is a bit cumbersome in U-Boot, as there is no menu to select it. It can only be checked using mstc_bootnum. To change it, issue the following commands in U-Boot: nand read 1800000 53c0000 800 mw.b 1800004 1 1 nand erase 53c0000 800 nand write 1800000 53c0000 800 This selects FW1. Replace "mw.b 1800004 1 1" by "mw.b 1800004 2 1" to change to the second slot. Back to stock ============= It is possible to flash back to stock, but a OEM firmware upgrade is required. ZyXEL does not provide the link on its website, but the link can be acquired from the OEM web GUI by analyzing the transferred JSON objects. It is then a matter of writing the firmware to Kernel2 and setting the boot partition to FW2: mtd write zyxel.bin Kernel2 echo -ne "\x02" | dd of=/dev/mtdblock7 count=1 bs=1 seek=4 conv=notrunc Signed-off-by: Andreas Böhler <dev@aboehler.at> Credits to forum users Annick and SirLouen for their initial work on this device
* kernel: mtk_bmt: refactor to avoid deep recursionMichał Kępień2023-04-291-31/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A Linksys E8450 (mt7622) device running current master has recently started crashing: [ 0.562900] mtk-ecc 1100e000.ecc: probed [ 0.570254] spi-nand spi2.0: Fidelix SPI NAND was found. [ 0.575576] spi-nand spi2.0: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 64 [ 0.583780] mtk-snand 1100d000.spi: ECC strength: 4 bits per 512 bytes [ 0.682930] Insufficient stack space to handle exception! [ 0.682939] ESR: 0x0000000096000047 -- DABT (current EL) [ 0.682946] FAR: 0xffffffc008c47fe0 [ 0.682948] Task stack: [0xffffffc008c48000..0xffffffc008c4c000] [ 0.682951] IRQ stack: [0xffffffc008008000..0xffffffc00800c000] [ 0.682954] Overflow stack: [0xffffff801feb00a0..0xffffff801feb10a0] [ 0.682959] CPU: 1 PID: 1 Comm: swapper/0 Tainted: G S 5.15.107 #0 [ 0.682966] Hardware name: Linksys E8450 (DT) [ 0.682969] pstate: 800000c5 (Nzcv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 0.682975] pc : dequeue_entity+0x0/0x250 [ 0.682988] lr : dequeue_task_fair+0x98/0x290 [ 0.682992] sp : ffffffc008c48030 [ 0.682994] x29: ffffffc008c48030 x28: 0000000000000001 x27: ffffff801feb6380 [ 0.683004] x26: 0000000000000001 x25: ffffff801feb6300 x24: ffffff8000068000 [ 0.683011] x23: 0000000000000001 x22: 0000000000000009 x21: 0000000000000000 [ 0.683017] x20: ffffff801feb6380 x19: ffffff8000068080 x18: 0000000017a740a6 [ 0.683024] x17: ffffffc008bae748 x16: ffffffc008bae6d8 x15: ffffffffffffffff [ 0.683031] x14: ffffffffffffffff x13: 0000000000000000 x12: 0000000f00000101 [ 0.683038] x11: 0000000000000449 x10: 0000000000000127 x9 : 0000000000000000 [ 0.683044] x8 : 0000000000000125 x7 : 0000000000116da1 x6 : 0000000000116da1 [ 0.683051] x5 : 00000000001165a1 x4 : ffffff801feb6e00 x3 : 0000000000000000 [ 0.683058] x2 : 0000000000000009 x1 : ffffff8000068080 x0 : ffffff801feb6380 [ 0.683066] Kernel panic - not syncing: kernel stack overflow [ 0.683069] SMP: stopping secondary CPUs [ 1.648361] SMP: failed to stop secondary CPUs 0-1 [ 1.648366] Kernel Offset: disabled [ 1.648368] CPU features: 0x00003000,00000802 [ 1.648372] Memory Limit: none Several factors contributed to this issue: 1. The mtk_bmt driver recursively calls its scan_bmt() helper function during device initialization, while looking for a valid block mapping table (BMT). 2. Commit fa4dc86e98 ("kernel: backport MEMREAD ioctl"): - increased the size of some stack-allocated structures (like struct mtd_oob_ops, used in bbt_nand_read(), which is indirectly called from scan_bmt()), - increased the stack size for some functions (for example, spinand_mtd_read(), which is indirectly called from scan_bmt(), now uses an extra stack-allocated struct mtd_ecc_stats). 3. OpenWrt currently compiles the kernel with the -fno-optimize-sibling-calls flag, which prevents tail-call optimization. Collectively, all of these factors caused stack usage in the mtk_bmt driver to grow excessively large, triggering stack overflows. Recursion is not really necessary in scan_bmt() as it simply iterates over flash memory blocks in reverse order, looking for a valid BMT. Refactor the logic contained in the scan_bmt() and read_bmt() functions in target/linux/generic/files/drivers/mtd/nand/mtk_bmt_v2.c so that deep recursion is prevented (and therefore also any potential stack overflows it may cause). Link: https://lists.openwrt.org/pipermail/openwrt-devel/2023-April/040872.html Signed-off-by: Michał Kępień <openwrt@kempniu.pl>
* kernel: Activate CONFIG_SCHED_STACK_END_CHECKHauke Mehrtens2023-04-292-2/+2
| | | | | | | | | | | This activates the CONFIG_SCHED_STACK_END_CHECK option. The kernel will check if the kernel stack overflowed in the schedule() function. This just adds a very small computational overhead. This option is activated in Debian by default. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* kernel: Activate CONFIG_SLAB_FREELIST_HARDENEDHauke Mehrtens2023-04-292-2/+2
| | | | | | | | | | This activates some extra checks in SLAB or SLUB to make it harder to execute kernel heap exploits. This adds a minor performance degradation which I haven't measured-. Many mainstream Linux distributions also activate this option. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* kernel: Initialize RNG using CPU RNG and bootloaderHauke Mehrtens2023-04-292-4/+4
| | | | | | | | | | | | | | | | | | | This activates the following kernel options by default: * CONFIG_RANDOM_TRUST_CPU * CONFIG_RANDOM_TRUST_BOOTLOADER With these option Linux will also use data from the CPU RNG e.g. RDRAND and the bootloader to initialize the Linux RNG if such sources are available. These random bits are used in addition to the other sources, no other sources are getting deactivated. I read that the Chacha mixer isn't vulnerable to injected entropy, so this should not be a problem even if these sources might inject bad random data. The Linux kernel suggests to activate both options, Debian also activates them. This does not increase kernel code size. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* mediatek: remove mt753x driverFelix Fietkau2023-04-2916-3970/+0
| | | | | | It is unused Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ramips: reduce Archer AX23 / MR70X SPI-frequencyDavid Bauer2023-04-272-2/+2
| | | | | | | | | | | | | | It was brought to attention the Archer AX23 v1 fails to read jffs2 data from time to time. While this is not reproducible on my unit, it is on others. Reducing the SPI frequency does the trick. While it worked with at lest 40 MHz, opt for the cautious side and choose a save frequency of 25 MHz. Apply the same treatment to the Mercusys MR70X which uses a similar design just in case. Signed-off-by: David Bauer <mail@david-bauer.net>
* generic: Convert incorrect generic/5.15 patches againOlliver Schinagl2023-04-273-0/+47
| | | | | | | | | | | | | | OpenWrt's developer guide prefers having actual patches so they an be sent upstream more easily. However, in the case of hack-5.15 patches which are not meant for upstream, adding proper fields allows for `git am` to properly function. This commit tries to rectify that, by digging in the history to find where and how it was first added. Signed-off-by: Olliver Schinagl <oliver@schinagl.nl> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* bmips: fix external interrupt controllerÁlvaro Fernández Rojas2023-04-271-21/+2
| | | | | | | | | - irq_domain_add_simple() can't be used on bmips since interrupts aren't hardcoded with specific offsets for internal and external as opposed to bcm63xx. This is needed to avoid collisions with other interrupts. - remove unused bcm63xx-specific code. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* bmips: document GPIO external interruptsÁlvaro Fernández Rojas2023-04-2712-11/+51
| | | | | | | BCM63xx SoCs have an external interrupt controller which can be used for specific GPIO keys. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* bmips: increment polled keys interval to 100Álvaro Fernández Rojas2023-04-279-9/+9
| | | | | | | There's no need to poll the gpio keys every 20 ms and the linux kernel documentation suggests 100 ms. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* kernel: ssb: fallback-sprom: check bustypeÁlvaro Fernández Rojas2023-04-241-2/+7
| | | | | | host_pci is only defined when bustype is SSB_BUSTYPE_PCI. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
* kernel: bcma: fallback-sprom: check hosttypeÁlvaro Fernández Rojas2023-04-241-2/+7
| | | | | | host_pci is only defined when hosttype is BCMA_HOSTTYPE_PCI. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>