summaryrefslogtreecommitdiffstats
path: root/target/linux/mediatek/mt7622
Commit message (Collapse)AuthorAgeFilesLines
* mediatek: switch to Linux 6.6Daniel Golle2024-05-031-479/+0
| | | | | | | Switch to Linux kernel version 6.6 and drop configs, files and patches for Linux 6.1. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: add Airoha EN8801SC PHY driverRobert Marko2024-04-112-0/+2
| | | | | | | | | | | Airoha EN8801SC PHY is a gigabit PHY used on Edgecore EAP111 so, include the MTK driver with some cleanups. Unfortunatelly, there is no specification sheet nor datasheet available in order to demistify the magic PBUS writes and work on upstreaming this driver. Signed-off-by: Robert Marko <robert.marko@sartura.hr>
* treewide: disable spectre mitigation on unaffected Arm64 targetsQingfang Deng2024-03-232-0/+2
| | | | | | | Cortex-A53 is not vulnerable to any Spectre variants. Ref: https://developer.arm.com/Arm%20Security%20Center/Speculative%20Processor%20Vulnerability Signed-off-by: Qingfang Deng <dqfext@gmail.com>
* mediatek: mt7622: add a second u-boot for redmi-ax6sChuanhong Guo2024-03-212-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The vendor u-boot knows nothing about UBI, and we used to have a fixed-size kernel partition for vendor u-boot and UBI for rootfs. However, that fixed partition becomes too small eventually, and expanding it requires complicated procedure. This commit changed the flash layout and added a second u-boot where the kernel supposed to be. Now the vendor u-boot chainloads our mainline u-boot, and our u-boot reads kernel+rootfs from UBI, verifies it, and boot into OpenWrt. There are two possible ways to convert from the old fw: Flash the factory image using mtd (provided by @rany2): mount -o remount,ro / mount -o remount,ro /overlay cd /tmp dd if=factory.bin bs=1M count=4 | mtd write - kernel dd if=factory.bin bs=1M skip=4 | mtd -r write - ubi Or, flash the 2nd u-boot via mtd and upload the firmware to the 2nd u-boot using tftp: 1. prepare a tftp server at 192.168.1.254 to serve the sysupgrade image: openwrt-mediatek-mt7622-xiaomi_redmi-router-ax6s-squashfs-sysupgrade.itb 2. upload the ubi-loader.itb to OpenWrt /tmp, and flash it to the old kernel partition: mtd -r write openwrt-mediatek-mt7622-xiaomi_redmi-router-ax6s-ubi-loader.itb 3. The router should reboot and flash the sysupgrade image via TFTP. Procedure for flashing from vendor firmware shouldn't change. Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
* mediatek: mt7622: simplify 02_networkChukun Pan2024-03-161-15/+6
| | | | | | | | | Most mt7622 devices use the mt7531 switch, which have been switched to dsa driver for a long time. So use dsa as the default configuration and configure these rtl8367s devices separately. This reduces the amount of code. Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
* mediatek: add kernel configs for Linux 6.6Daniel Golle2024-03-111-0/+495
| | | | | | Add config-6.6 for all mediatek subtargets. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: include 'fitblk' package for subtargetsDaniel Golle2024-02-261-1/+1
| | | | | | | | | | If selected on a per-board base, fitblk doesn't end up in initramfs images which always only come with the subtarget's default packages. Hence fitblk needs to be included as a default package of all subtargets making use of fitblk instead of it being selected for individual boards. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: drop platform_get_bootdevDaniel Golle2024-02-261-17/+2
| | | | | | | Now that we got fitblk_get_bootdev in /lib/upgrade/common.sh we don't need platform_get_bootdev in each of the subtargets any longer. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: mt7622: no longer select FIT_PARTITIONDaniel Golle2024-02-231-1/+1
| | | | | | | | | | | | | All mt7622 board previously using the FIT partition parser have been converted to use the fitblk driver: 6aec3c7b5b mediatek: mt7622: modernize Linksys E8450 / Belkin RT3200 UBI build 41c053141e mediatek: mt7622: convert unifi6lr-v{1,2,3}-ubootmod to fitblk 208f6c1232 mediatek: mt7622: convert BPi-R64 to all-UBI layout and fitblk Remove the now no longer needed FIT partition parser from builds for mt7622. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: mt7622: modernize Linksys E8450 / Belkin RT3200 UBI buildDaniel Golle2024-02-154-4/+9
| | | | | | | | | | | | | | | | | Move fip and factory into UBI static volumes. Use fitblk instead of partition parser. !! RUN INSTALLER FIRST !! Existing users of previous OpenWrt releases or snapshot builds will have to **re-run the updated installer** before upgrading to firmware after this commit. DO NOT flash or run even just the initramfs image unless you have run the updated installer which moves the content of the 'factory' partition into a UBI volume. tl;dr: DON'T USE YET! Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: mt7622: convert unifi6lr-v{1,2,3}-ubootmod to fitblkDaniel Golle2024-02-151-1/+8
| | | | | | No bootloader changes needed in this case, smooth transition. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: mt7622: convert BPi-R64 to all-UBI layout and fitblkDaniel Golle2024-02-154-13/+31
| | | | | | | Modernize bootloader and flash memory layout of the BPi-R64 similar to how it has also been done for the BPi-R3. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: backport a hell of thermal commitsDaniel Golle2024-02-151-0/+2
| | | | | | | Backport almost 50 commits from upstream Linux to improve thermal drivers for MediaTek SoCs and add new LVTS driver for MT7988. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: switch to Linux version 6.1Daniel Golle2024-02-151-444/+0
| | | | | | Drop support for Linux 5.15 and switch to Linux 6.1. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: mt7622: refresh kernel configChukun Pan2024-01-142-23/+9
| | | | | | Refresh kernel config with 'make kernel_oldconfig'. Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
* mediatek: Add support for D-Link EAGLE PRO AI R32Roland Reinl2024-01-024-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | R32 is like the M32 part of the EAGLE PRO AI series from D-Link. Specification: - MT7622BV SoC with 2.4GHz wifi - MT7975AN + MT7915AN for 5GHz - MT7531BE Switch - 512MB RAM - 128 MB flash - 2 LEDs (Status and Internet, both can be either orange or white) - 2 buttons (WPS and Reset) Compared to M32, the R32 has the following differences: - 4 LAN ports instead of 2 - The recory image starts with DLK6E6015001 instaed of DLK6E6010001 - Individual LEDs for power and internet - MAC address is stored at another offset in the ODM partition MAC addresses: - WAN MAC is stored in partition "Odm" at offset 0x81 - LAN (as printed on the device) is WAN MAC + 1 - WLAN MAC (2.4 GHz) is WAN MAC + 2 - WLAN MAC (5GHz) is WAN MAC + 3 Flashing via Recovery Web Interface: - Set your IP address to 192.168.0.10, subnetmask 255.255.255.0 - Press the reset button while powering on the deivce - Keep the reset button pressed until the internet LED blinks fast - Open a Chromium based and goto http://192.168.0.1 - Download openwrt-mediatek-mt7622-dlink_eagle-pro-ai-r32-a1-squashfs-recovery.bin Flashing via uBoot: - Open the case, connect to the UART console - Set your IP address to 10.10.10.3, subnet mask 255.255.255.0. Connect to one of the LAN interfaces of the router - Run a tftp server which provides openwrt-mediatek-mt7622-dlink_eagle-pro-ai-r32-initramfs-kernel.bin. - You can rename the file to iverson_uImage (no extension), then you don't have to enter the whole file name in uboot later. - Power on the device and select "1. System Load Linux to SDRAM via TFTP." in the boot menu - Enter image file, tftp server IP and device IP (if they differ from the default). - TFTP download to RAM will start. After a few seconds OpenWrt initramfs should start - The initramfs is accessible via 192.168.1.1, change your IP address accordingly (or use multiple IP addresses on your interface) - Create a backup of the Kernel1 partition, this file is required if a revert to stock should be done later - Perform a sysupgrade using openwrt-mediatek-mt7622-dlink_eagle-pro-ai-r32-squashfs-sysupgrade.bin - Reboot the device. OpenWrt should start from flash now Revert back to stock using the Recovery Web Interface: - Set your IP address to 192.168.0.10, subnetmask 255.255.255.0 - Press the reset button while powering on the deivce - Keep the reset button pressed until the internet LED blinks fast - Open a Chromium based and goto http://192.168.0.1 - Flash a decrypted firmware image from D-Link. Decrypting an firmware image is described below. Decrypting a D-Link firmware image: - Download https://github.com/RolandoMagico/firmware-utils/blob/M32/src/m32-firmware-util.c - Compile a binary from the downloaded file, e.g. gcc m32-firmware-util.c -lcrypto -o m32-firmware-util - Run ./m32-firmware-util R32 --DecryptFactoryImage <OriginalFirmware> <OutputFile> - Example for firmware R32A1_FW103B01: ./m32-firmware-util R32 --DecryptFactoryImage R32A1_FW103B01.bin R32A1_FW103B01.decrypted.bin Revert back to stock using uBoot: - Open the case, connect to the UART console - Set your IP address to 10.10.10.3, subnet mask 255.255.255.0. Connect to one of the LAN interfaces of the router - Run a tftp server which provides the previously created backup of the Kernel1 partition. - You can rename the file to iverson_uImage (no extension), then you don't have to enter the whole file name in uboot later. - Power on the device and select "2. System Load Linux Kernel then write to Flash via TFTP." in the boot menu - Enter image file, tftp server IP and device IP (if they differ from the default). - TFTP download to FLASH will start. After a few seconds the stock firmware should start again There is also an image openwrt-mediatek-mt7622-dlink_eagle-pro-ai-r32-a1-squashfs-tftp.bin which can directly be flashed via U-Boot and TFTP. It can be used if no backup of the Kernel1 partition is reuqired. Flahsing via OEM web interface is currently not possible, the OEM images are encrypted. Creating images is only possible manually at the moment. The support for the M32/R32 already includes support for flashing from the OEM web interface: - The device tree contains both partitions (Kernel1 and Kernel2) with conditions to select the correct one based on the kernel command line - The U-Boot variable "boot_part" is set accordingly during startup to finish the partition swap after flashing from the OEM web interface - OpenWrt sysupgrade flashing always uses the partition where it was initially flashed to (no partition swap) Signed-off-by: Roland Reinl <reinlroland+github@gmail.com>
* mediatek: import driver for Adtran SmartRG RGBW LEDDaniel Golle2023-12-102-0/+2
| | | | | | | Import driver for I2C-connected HolTek MCU controlling the RGBW LED found in Adtran SmartRG devices. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: Add support for D-Link EAGLE PRO AI M32Roland Reinl2023-11-123-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specification: - MT7622BV SoC with 2.4GHz wifi - MT7975AN + MT7915AN for 5GHz - MT7531BE Switch - 512MB RAM - 128 MB flash - 3 LEDs (red, orange, white) - 2 buttons (WPS and Reset) MAC addresses: - WAN MAC is stored in partition "Odm" at offset 0x83 - LAN (as printed on the device) is WAN MAC + 1 - WLAN MAC (2.4 GHz) is WAN MAC + 2 - WLAN MAC (5GHz) is WAN MAC + 3 Disassembly: Remove 4 screws in the bottom and 2 screws in the top (after removing the blue cover on the top), then the board can be pulled out. The pins for the serial console are already labeled on the board (VCC, TX, RX, GND). Serial settings: 3.3V, 115200,8n1 Flashing via Recovery Web Interface: - Set your IP address to 192.168.0.10, subnetmask 255.255.255.25 - Press the reset button while powering on the deivce - Keep the reset button pressed until the status LED blinks fast - Open a Chromium based and goto http://192.168.0.1 - Download openwrt-mediatek-mt7622-dlink_eagle-pro-ai-m32-a1-squashfs-recovery.bin Flashing via uBoot: - Open the case, connect to the UART console - Set your IP address to 10.10.10.3, subnet mask 255.255.255.0. Connect to one of the LAN interfaces of the router - Run a tftp server which provides openwrt-mediatek-mt7622-dlink_eagle-pro-ai-m32-initramfs-kernel.bin. You can rename the file to iverson_uImage (no extension), then you don't have to enter the whole file name in uboot later. - Power on the device and select "1. System Load Linux to SDRAM via TFTP." in the boot menu - Enter image file, tftp server IP and device IP (if they differ from the default). - TFTP download to RAM will start. After a few seconds OpenWrt initramfs should start - The initramfs is accessible via 192.168.1.1, change your IP address accordingly (or use multiple IP addresses on your interface) - Create a backup of the Kernel1 partition, this file is required if a revert to stock should be done later - Perform a sysupgrade using openwrt-mediatek-mt7622-dlink_eagle-pro-ai-m32-squashfs-sysupgrade.bin - Reboot the device. OpenWrt should start from flash now Revert back to stock using the Recovery Web Interface: - Set your IP address to 192.168.0.10, subnetmask 255.255.255.25 - Press the reset button while powering on the deivce - Keep the reset button pressed until the status LED blinks fast - Open a Chromium based and goto http://192.168.0.1 - Flash a decrypted firmware image from D-Link. Decrypting an firmware image is described below. Decrypting a D-Link firmware image: - Download https://github.com/RolandoMagico/firmware-utils/blob/M32/src/m32-firmware-util.c - Compile a binary from the downloaded file, e.g. gcc m32-firmware-util.c -lcrypto -o m32-firmware-util - Run ./m32-firmware-util M32 --DecryptFactoryImage <OriginalFirmware> <OutputFile> - Example for firmware 1.03.01_HOTFIX: ./m32-firmware-util M32 --DecryptFactoryImage M32-REVA_1.03.01_HOTFIX.enc.bin M32-REVA_1.03.01_HOTFIX.decrypted.bin Revert back to stock using uBoot: - Open the case, connect to the UART console - Set your IP address to 10.10.10.3, subnet mask 255.255.255.0. Connect to one of the LAN interfaces of the router - Run a tftp server which provides the previously created backup of the Kernel1 partition. You can rename the file to iverson_uImage (no extension), then you don't have to enter the whole file name in uboot later. - Power on the device and select "2. System Load Linux Kernel then write to Flash via TFTP." in the boot menu - Enter image file, tftp server IP and device IP (if they differ from the default). - TFTP download to FLASH will start. After a few seconds the stock firmware should start again There is also an image openwrt-mediatek-mt7622-dlink_eagle-pro-ai-m32-a1-squashfs-tftp.bin which can directly be flashed via U-Boot and TFTP. It can be used if no backup of the Kernel1 partition is reuqired. Flahsing via OEM web interface is currently not possible, the OEM images are encrypted and require a specific memory layout which is not compatible to the partition layout of OpenWrt. Signed-off-by: Roland Reinl <reinlroland+github@gmail.com>
* mediatek: add support for Buffalo WSR-3200AX4SINAGAKI Hiroshi2023-09-244-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Buffalo WSR-3200AX4S is a 2.4/5 GHz band 11ax (Wi-Fi 6) router, based on MT7622B. Specification: - SoC : MediaTek MT7622B - RAM : DDR3 512 MiB - Flash : SPI-NAND 128 MiB (Winbond W25N01GVZEIG) - WLAN : 2.4/5 GHz 4T4R - 2.4 GHz : MediaTek MT7622B (SoC) - 5 GHz : MediaTek MT7915 - Ethernet : 5x 10/100/1000 Mbps - Switch : MediaTek MT7531 - LEDs/Keys : 6x/5x (2x: buttons, 3x: slide-switches) - UART : through-hole on PCB (J4) - assignment: 3.3V, GND, TX, RX from tri-angle marking - settings : 115200n8 - Power : 12 VDC, 1.5 A Flash instruction using factory.bin image: 1. Boot WSR-3200AX4S with "Router" mode 2. Access to "http://192.168.11.1/" and open firmware update page ("ファームウェア更新") 3. Select the OpenWrt factory.bin image and click update ("更新実行") button 4. Wait ~120 seconds to complete flashing Note: - This device has 2x OS images on flash. The first one will always be used for booting and the secondary is for backup. - This support generates multiple factory*.bin image: - factory.bin : for flashing from OEM WebUI - factory-uboot.bin: for flashing from U-Boot or clean installation via sysupgrade (don't use for normal sysupgrade) Known issues: - Wi-Fi MAC addresses won't be applied to each adapter. MAC Addresses: LAN : C4:3C:EA:xx:xx:60 (board_data, mac (text)) WAN : C4:3C:EA:xx:xx:60 (board_data, mac (text)) 2.4 GHz: C4:3C:EA:xx:xx:61 5 GHz : C4:3C:EA:xx:xx:68 Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
* mediatek: expand kernel size to 6MiB for WSR-2533DHP2INAGAKI Hiroshi2023-09-241-1/+2
| | | | | | | | | | Expand kernel partition size on WSR-2533DHP2 for the kernel larger than 4 MiB. To prevent upgrading from old firmware before this commit, bump the compat version to 1.1 and add a message for forced sysupgrade using factory-uboot.bin image. Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
* kernel: remove CRYPTO_BLAKE2S from all >=5.15Christian Svensson2023-07-081-1/+0
| | | | | | | | | This option was removed from upstream kernel back in 2022. See commits: 2d16803c562ecc644803d42ba98a8e0aef9c014e (>=6.0) 3dd33a09f5dc12ccb0902923c4c784eb0f8c7554 (>=5.15.61 backport) Signed-off-by: Christian Svensson <blue@cmd.nu>
* mediatek: adapt kernel configuration for Linux 6.1Daniel Golle2023-07-071-30/+44
| | | | | | Update kernel configuration to build Linux 6.1 for all subtargets. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: copy config-5.15 to config-6.1 for all subtargetsDaniel Golle2023-07-071-0/+458
| | | | | | | To ease review, first copy all subtargets' kernel config-5.15 to the to-be-adapted config-6.1. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: set new compat version if booted on R64 and R3Daniel Golle2023-06-061-0/+10
| | | | | | | | | | | | | | | | | If the board comes up with OpenWrt that means that the bootloader is recent enough and knows about the new device tree overlays. Using /etc/board.d/ is not enough in this case because it doesn't overwrite existing configuration which may exist (and is fine to exist) if the user updated with 'sysupgrade -F *.itb' and has kept configuration. They would still need to manually set compat_version even though the fact that the bootloader env has been updated can be implied by the fact that the system has started. Hence we can always set compat_version=1.1 for those two boards using uci-defaults. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: use updated device tree overlay mechanism for BPi-R64Daniel Golle2023-06-051-0/+15
| | | | | | Use new device tree overlay mechanism for the BananaPi BPi-R64 board. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: filogic: add driver for Richtek RT5190A regulatorDaniel Golle2023-05-231-0/+1
| | | | | | | | The Richtek RT5190A is used on the MT7988 reference board. Backport and enable the driver on the filogic subtarget, so we can support cpufreq on the MT7988 reference board. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: add driver for built-in 2.5G Ethernet PHYDaniel Golle2023-05-231-0/+1
| | | | | | | | Add driver for the built-in 2.5G Ethernet PHY found in the MT7988 SoC. To function the PHY also needs firmware files which have not yet been published via linux-firmware. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: update pending SoC Ethernet PHY driverDaniel Golle2023-05-231-1/+1
| | | | | | | Update driver for MediaTek's built-in Gigabit Ethernet PHYs which can be found in the MT7981 and MT7988 SoCs. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* generic: mt7530: backport support for the MT7988 built-in switchDaniel Golle2023-05-231-0/+2
| | | | | | | | | | | | | | | | Backport commits adding support for the MT7988 built-in switch to the mt7530 driver. This change results in the Kconfig symbol NET_DSA_MT7530 to be extended by NET_DSA_MT7530_MDIO (everything formally covered by NET_DSA_MT7530) and NET_DSA_MT7530_MMIO (a new driver for the MMIO-connected built-in switch of the MT7988 SoC). Select NET_DSA_MT7530_MDIO for all targets previously selecting NET_DSA_MT7530, with the exception of mediatek/filogic which also selects NET_DSA_MT7530_MMIO. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* generic: add support for MediaTek NETSYS v3Daniel Golle2023-05-231-0/+1
| | | | | | | In order to support Ethernet on the MT7988 SoC add support for NETSYS v3 as well as new paths and USXGMII SerDes to the mtk_eth_soc driver. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: add mt7988 pinctrl driver supportSam Shih2023-05-231-0/+1
| | | | | | | This adds provisional pinctrl driver support for the MediaTek MT7988 SoC. Signed-off-by: Sam Shih <sam.shih@mediatek.com> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: add mt7988 clock drivers supportSam Shih2023-05-231-0/+1
| | | | | | | This adds clock drivers for the MediaTek MT7988 SoC Signed-off-by: Sam Shih <sam.shih@mediatek.com> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* kernel: enable (ARM|ARM64)_MODULE_PLTS in generic configTony Ambardar2023-05-231-1/+0
| | | | | | | | | | | | | | | | | | | This allows loading modules with large memory requirements, recently needed while testing on armvirt/32. Past forum discussions [1] and bug reports [2] also raised this and the ipq806x target already set it in response [3]. Given this increases kernel image size by only ~1KB, is generally useful on multi-platform kernels, and enabled by default on upstream arm32 Linux, add it to the generic config. The setting has similar utility on arm64, is a requirement for KASLR, and already enabled on most OpenWrt aarch64 targets, so pull this into the top-level generic config. [1]: https://forum.openwrt.org/t/vmap-allocation-for-size-442368-failed-use-vmalloc-size-to-increase-size/34545/7 [2]: https://github.com/openwrt/openwrt/issues/8282 [3]: f81e148eb6 ("ipq806x: update 4.19 kernel config"). Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
* kernel: fix handling of CONFIG_DYNAMIC_DEBUGTony Ambardar2023-05-031-1/+0
| | | | | | | | | | 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: Deactivate CONFIG_COMPATHauke Mehrtens2023-04-291-4/+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: Activate CONFIG_ARM64_SW_TTBR0_PANHauke Mehrtens2023-04-291-1/+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>
* mediatek: add support for built-in GE PHYs of newer SoCsDaniel Golle2023-03-271-0/+1
| | | | | | | | | | | MT7981 and the upcoming MT7988 have built-in Gigabit Ethernet PHYs. While they share some design properties with the PHYs present in MT753x, they do need calibration data from the SoC's efuse. Add driver to support them. Upstreaming it is planned, but there are still some ongoing discussions with MediaTek. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: backport pinctrl driver for MT7981 SoCDaniel Golle2023-03-271-0/+1
| | | | | | | Backport the pinctrl driver for the MT7981 SoC. The driver has also been submitted upstream and is part of Linux 6.3. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: backport clk driver for MT7981 SoCDaniel Golle2023-03-271-0/+1
| | | | | | | Backport driver for common clocks in MT7981 SoC. The driver has also been submitted upstream and became part of Linux 6.3. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: add support for Netgear WAX206Marcel Ziswiler2023-02-183-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifications: * SoC: MediaTek MT7622BV * RAM: DDR3 512 MiB (Nanya NT5CC256M16ER-EK) * Flash: SPI-NAND 256 MiB (Toshiba TC58CVG1S3HRAIJ) * Wi-Fi 2.4/5 GHz 4T4R: * 2.4 GHz: MediaTek MT7622BV * 5 GHz: MediaTek MT7915AN/MT7975AN * Ethernet: 4x 10/100/1000 Mbps LAN, 1x 10/100/1000/2500 Mbps WAN (Realtek RTL8221B PHY) * Switch: MediaTek MT7531AE * LEDs/Keys: 8/1 (Power, Internet, LAN1, LAN2, LAN3, LAN4, Wifin and Wifia dual-colour LEDs + Reset pin) * UART: Marked J19 on board VCC GND TX RX, beginning from "1". 3.3v, 115200n8 * Power: 12 VDC, 2.5 A Installation: * Flash the factory image through the stock web interface, or TFTP to the bootloader. NMRP can be used to TFTP without opening the case. * U-Boot allows booting an initramfs image via TFTP as follows: setenv ipaddr 192.168.1.1 setenv serverip 192.168.1.100 tftpboot openwrt-mediatek-mt7622-netgear_wax206-initramfs-recovery.itb bootm Known Limitations: * The 2.5G WAN port labeled 'wan' only works for speeds up to 1G at the moment. If connected to a multi-gig port the speed has to be manually set to 1G/full either for the switch port or in OpenWrt. For example add the following to /etc/rc.local to set it on boot: /usr/sbin/ethtool -s wan speed 1000 duplex full Revert to stock firmware: * Flash the stock firmware to the bootloader using TFTP/NMRP. References to WAX206 GPL source: https://www.downloads.netgear.com/files/GPL/WAX206_V1.0.4.0_Source.rar * openwrt/target/linux/mediatek/dts/mt7622-netgear-wax206.dts DTS file for this device. * openwrt/target/linux/mediatek/image/mt7622.mk Image creation code for this device Signed-off-by: Marcel Ziswiler <marcel@ziswiler.com> [fix WAN port (1G only), adjust partition layout, adjust image creation] Signed-off-by: Thomas Kupper <thomas.kupper@gmail.com>
* treewide: replace wpad-basic-wolfssl defaultRosen Penev2023-02-041-1/+1
| | | | | | | 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>
* mediatek: fix wrong return code in platform_check_image()Chen Minqiang2023-01-291-0/+1
| | | | | | Ensure that the platform_check_image() function returns an error code. Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
* mediatek: mt7622: fix sysupgrade on MMC on BPi-R64Daniel Golle2023-01-161-0/+1
| | | | | | | | A previous attempt to simplify things went wrong and now sysupgrade is broken on this device. Fix that. Fixes: d640cbac0e ("mediatek: mt7622: don't rely on existing image for sysupgrade") Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mt76: add stand-alone MT7622 firmware packageShiji Yang2023-01-071-1/+1
| | | | | | | | | Add a separate firmware package to avoid installing the MT7615 firmware on all MT7622 target devices by default. Now we only add MT7615 firmware packages for devices that use MT7615E. This commit also removes the explicit dependency on kmod-mt7615e to refine the package dependency. Signed-off-by: Shiji Yang <yangshiji66@qq.com>
* treewide: update NVMEM symbolsRafał Miłecki2023-01-071-1/+1
| | | | | Fixes: 8dfe69cdfc5c ("kernel: update nvmem subsystem to the latest upstream") Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* mediatek: add support for reyee AX3200-E5Alex Hansen2022-12-062-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is yet another model of the Ruijie RG-EW3200GX PRO with a slightly different flash layout, install process is the same. Specifications: SoC: MT7622B RAM: 256MB Flash: XMC XM25QH128C or Winbond WQ25Q128JVSQ 16MB SPI NOR Ethernet: 5x1GbE Switch: MT7531BE WiFi: 2.4G: MT7622 5G: MT7915AN+MT7975AN 3LEDs: System LED(blue) + Mesh LED(green) + Mesh LED(red) 2Keys: Mesh button + Reset button UART: Marked J19 on board. 3.3v, 115200n1 Power: 12V 2.5A Flash instruction: 1. Serve the initramfs.img using a TFTP server with address 10.10.10.3. 2. Interrupt the uboot startup process via UART. 3. Select "System Load Linux to SDRAM via TFTP" item. 4. (important) Back up firmware(mtd7) partitions with: dd if=/dev/mtd7 of=/tmp/firmware.bin and then download the firmware.bin image via SCP. 5. Flash the OpenWrt sysupgrade firmware. Recovery stock firmware: 1. Transfer the firmware.bin image to the device. 2. Flash the image with: mtd write firmware.bin firmware Signed-off-by: Alex Hansen <mralexh123@gmail.com> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: set persistent wifi mac for bpi-r64 and bpi-r3Daniel Golle2022-11-241-0/+3
| | | | | | | Use persistent MAC address for the built-in wireless interfaces of the BPi-R64 and BPi-R3 development boards. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* kernel: disable CONFIG_CPU_LITTLE_ENDIAN in generic configAleksander Jan Bajkowski2022-10-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Endianness depends on CPU architecture. CONFIG_CPU_(BIG/LITTLE)_ENDIAN should be enabled on target or subtarget based on SoC architecture. Fixes warning: $ make kernel_oldconfig CONFIG_TARGET=subtarget ... .config:1008:warning: override: CPU_LITTLE_ENDIAN changes choice state .... Summary: - ARC - only the CONFIG_CPU_BIG_ENDIAN symbol is defined for this architeture. If it is disabled then the processor operates in LITTLE_ENDIAN mode (default), - ARM32 - CONFIG_CPU_LITTLE_ENDIAN symbol available since kernel 5.19. This option should be enabled after OpenWRT moves to kernel 6.x. After refreshing the kernel, the symbol disappears, - ARM64 - enabled CONFIG_CPU_LITTLE_ENDIAN, - MIPS - enabled relevant symbols, - POWERPC - enabled CONFIG_CPU_BIG_ENDIAN, - UML - Symbols are not defined for this architecture, - X86 - always little endian. Symbols are not defined for this architecture. Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
* mt7622: switch default CPU governor to ondemandJohn Audia2022-10-201-1/+1
| | | | | | | | | | | | | | | | | | The most common CPU governor in the OpenWRT project is currently ondemand (see below). Switch mt7622 over to it as well. Audit the code by running the following and then analyzing the results: find -name 'config-5.*' -print0 | xargs -0 grep 'CONFIG_CPU_FREQ_DEFAULT_GOV.*=y' ondemand: 16 performance: 5 schedutil: 5 userspace: 2 Build system: x86_64 Build-tested: ramips/mt7621 Signed-off-by: John Audia <graysky@archlinux.us>
* mediatek: mt7622: don't rely on existing image for sysupgradeDaniel Golle2022-10-191-2/+2
| | | | | | | | Don't reply on mapped rootfs partition but rather just take what ever has been set to the kernel cmdline root= parameter as a hint to decide which media to install sysupgrade to on the BananaPi BPi-R64. Signed-off-by: Daniel Golle <daniel@makrotopia.org>