aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mediatek/dts
Commit message (Collapse)AuthorAgeFilesLines
* mediatek: filogic: add specific layout for WR30UHank Moretti2023-08-071-0/+22
| | | | | | | | | Because this device enable NMBM by default, most users use custom U-Boot with NMBM-Enabled in Chinese forums. This layout is the same as the ubootmod layout but enabling NMBM. Signed-off-by: Hank Moretti <mchank9999@gmail.com>
* mediatek: filogic: add support for Xiaomi WR30UHank Moretti2023-08-073-0/+299
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hardware specification: SoC: MediaTek MT7981B 2x A53 Flash: ESMT F50L1G41LB 128MB RAM: NT52B128M16JR-FL 256MB Ethernet: 4x 10/100/1000 Mbps Switch: MediaTek MT7531AE WiFi: MediaTek MT7976C Button: Reset, Mesh Power: DC 12V 1A Flash instructions: 1. Get ssh access Check this link: https://forum.openwrt.org/t/openwrt-support-for-xiaomi-ax3000ne/153769/22 2. Backup import partitions ``` dev: size erasesize name mtd1: 00100000 00020000 "BL2" mtd2: 00040000 00020000 "Nvram" mtd3: 00040000 00020000 "Bdata" mtd4: 00200000 00020000 "Factory" mtd5: 00200000 00020000 "FIP" mtd8: 02200000 00020000 "ubi" mtd9: 02200000 00020000 "ubi1" mtd12: 00040000 00020000 "KF" ``` Use these commands blow to backup your stock partitions. ``` nanddump -f /tmp/BL2.bin /dev/mtd1 nanddump -f /tmp/Nvram.bin /dev/mtd2 nanddump -f /tmp/Bdata.bin /dev/mtd3 nanddump -f /tmp/Factory.bin /dev/mtd4 nanddump -f /tmp/FIP.bin /dev/mtd5 nanddump -f /tmp/ubi.bin /dev/mtd8 nanddump -f /tmp/KF.bin /dev/mtd12 ``` Then, transfer them to your computer via scp, netcat, tftp or others and keep them in a safe place. 3. Setup Nvram Get the current stock: `cat /proc/cmdline` If you find `firmware=0` or `mtd=ubi`, use these commands: ``` nvram set boot_wait=on nvram set uart_en=1 nvram set flag_boot_rootfs=1 nvram set flag_last_success=1 nvram set flag_boot_success=1 nvram set flag_try_sys1_failed=0 nvram set flag_try_sys2_failed=0 nvram commit ``` If you find `firmware=1` or `mtd=ubi1`, use these commands: ``` nvram set boot_wait=on nvram set uart_en=1 nvram set flag_boot_rootfs=0 nvram set flag_last_success=0 nvram set flag_boot_success=1 nvram set flag_try_sys1_failed=0 nvram set flag_try_sys2_failed=0 nvram commit ``` 4. Flash stock-initramfs-factory.ubi If you find `firmware=0` or `mtd=ubi`: `ubiformat /dev/mtd9 -y -f /tmp/stock-initramfs-factory.ubi` If you find `firmware=1` or `mtd=ubi1`: `ubiformat /dev/mtd8 -y -f /tmp/stock-initramfs-factory.ubi` Then reboot your router, it should boot to the openwrt initramfs system now. 5. Setup uboot-env Now it will be setup automatically in upgrade process, you can skip this step. If your `fw_setenv` did not work, you need run this command: `echo "/dev/mtd1 0x0 0x10000 0x20000" > /etc/fw_env.config` Then setup uboot-env: ``` fw_setenv boot_wait on fw_setenv uart_en 1 fw_setenv flag_boot_rootfs 0 fw_setenv flag_last_success 1 fw_setenv flag_boot_success 1 fw_setenv flag_try_sys1_failed 8 fw_setenv flag_try_sys2_failed 8 fw_setenv mtdparts "nmbm0:1024k(bl2),256k(Nvram),256k(Bdata), 2048k(factory),2048k(fip),256k(crash),256k(crash_log), 34816k(ubi),34816k(ubi1),32768k(overlay),12288k(data),256k(KF)" ``` 6. Flash stock-squashfs-sysupgrade.bin Use shell command: `sysupgrade -n /tmp/stock-squashfs-sysupgrade.bin` Or go to luci web. If you need to change to Openwrt U-Boot layout, do next. If you do not need, please ignore it. Change to OpenWrt U-Boot: 1. Flash ubootmod-initramfs-factory.ubi Check mtd partitions: `cat /proc/mtd` ``` mtd7: 00040000 00020000 "KF" mtd8: 02200000 00020000 "ubi_kernel" mtd9: 04e00000 00020000 "ubi" ``` Run following command: `ubiformat /dev/mtd8 -y -f /tmp/ubootmod-initramfs-factory.ubi` Then reboot your router, it should boot to the openwrt initramfs system now. 2. Check mtd again ``` mtd7: 00040000 00020000 "KF" mtd8: 07000000 00020000 "ubi" ``` Make sure mtd8 is ubi. 3. Install kmod-mtd-rw Run command: `opkg update && opkg install kmod-mtd-rw` Or get it in openwrt server, or build it yourself, then install it manually Then run this command: `insmod /lib/modules/$(uname -r)/mtd-rw.ko i_want_a_brick=1` 4. Clean up pstore Run Command: `rm -f /sys/fs/pstore/*` 5. Format ubi and create new ubootenv volume ``` ubidetach -p /dev/mtd8; ubiformat /dev/mtd8 -y; ubiattach -p /dev/mtd8 ubimkvol /dev/ubi0 -n 0 -N ubootenv -s 128KiB ubimkvol /dev/ubi0 -n 1 -N ubootenv2 -s 128KiB ``` 6. (Optional) Add recovery boot feature. ``` ubimkvol /dev/ubi0 -n 2 -N recovery -s 10MiB ubiupdatevol /dev/ubi0_2 /tmp/ubootmod-initramfs-recovery.itb ``` 7. Flash Openwrt U-Boot ``` mtd write /tmp/ubootmod-preloader.bin BL2 mtd write /tmp/ubootmod-bl31-uboot.fip FIP ``` 6. Flash ubootmod-squashfs-sysupgrade.itb Use shell command: `sysupgrade -n /tmp/ubootmod-squashfs-sysupgrade.itb` Or go to luci web. Now everything is done, Enjoy! Go Back to stock from Openwrt U-Boot: 1. Force flash ubootmod-initramfs-recovery.itb Use shell command: `sysupgrade -F -n /tmp/ubootmod-initramfs-recovery.itb` Or go to luci web. Then it should boot to the openwrt initramfs system now. 2. Format ubi and Nvram ``` ubidetach -p /dev/mtd8; ubiformat /dev/mtd8 -y; ubiattach -p /dev/mtd8 mtd erase Nvram ``` 3. Install kmod-mtd-rw Run command: `opkg update && opkg install kmod-mtd-rw` Or get it in openwrt server, or build it yourself, then install it manually Then run this command: `insmod /lib/modules/$(uname -r)/mtd-rw.ko i_want_a_brick=1` 4. Flash stock U-Boot and ubi ``` mtd write /tmp/BL2.bin BL2 mtd write /tmp/FIP.bin FIP mtd write /tmp/ubi.bin ubi ``` Then reboot your router, waiting it finished rollback in minutes. Go Back to stock from stock layout Openwrt: Just run command: `ubiformat /dev/mtd8 -y -f /tmp/ubi.bin` Then reboot your router, waiting it finished rollback in minutes. Notes: 1. Openwrt U-Boot and ubootmod openwrt did not enable NMBM. Please make your backup safe. Signed-off-by: Hank Moretti <mchank9999@gmail.com>
* mediatek: add support for Acer Predator W6David Bauer2023-08-051-0/+503
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hardware -------- SOC: MediaTek MT7986A RAM: 1GB DDR4 FLASH: 4GB eMMC WiFi: 2x2 2.4 GHz 802.11 b/g/n/ax MT7916 DBDC 4x4 5 GHz 802.11 a/n/ac/ax MT7986 2x2 6 GHz 802.11ax MT7916 DBDC ETH: 4x LAN 1Gbit/s (MT7531) 1x WAN 2.5Gbit/s (GPY211) BTN: RESET, WPS LED: Antenna LEDs (GPIO) Mood-LED (Kinetic KTD2601) - unsupported UART: Header nest to USB port - 3V3 115200 8N1 [BUTTON] GND - RX - TX [USB] Installation ------------ 1. Connect to the device using serial console. 2. Interrupt the Autoboot process when promted by sending '0' twice. 3. Serve the OpenWrt initramfs image using TFTP at 192.168.1.66. Name the image "predator.bin" and conenct the TFTP server to the routers LAN port. 4. Configure U-Boot to allow loading unsigned images from MMC $ setenv bootcmd 'mmc read 0x40000000 0x00004400 0x0010000; fdt addr $(fdtcontroladdr); fdt rm /signature; bootm 0x40000000'; saveenv 5. Transfer the image from U-Boot $ setenv serverip 192.168.1.66; setenv ipaddr 192.168.1.1; tftpboot 0x46000000 predator.bin; fdt addr $(fdtcontroladdr); fdt rm /signature; bootm 6. Wait for OpenWrt to boot 7. Transfer the OpenWrt sysupgrade image to the router using scp. 8. Install OpenWrt using sysupgrade. Signed-off-by: David Bauer <mail@david-bauer.net> (cherry picked from commit 7e7eb5312d7810084547bb54a4b6867c2da08182)
* mediatek: add support for ZyXEL NWA50AX ProDavid Bauer2023-07-231-0/+225
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hardware -------- CPU: Mediatek MT7981 RAM: 512M DDR4 FLASH: 256M NAND ETH: MaxLinear GPY211 (2.5GbE N Base-T) WiFi: Mediatek MT7981 (2.4GHz 2T2R:2 5GHz 3T3R:2 802.11ax) BTN: 1x Reset LED: 1x Multi-Color UART Console ------------ Available below the rubber cover next to the ethernet port. Settings: 115200 8N1 Layout: <12V> <LAN> GND-RX-TX-VCC Logic-Level is 3V3. Don't connect VCC to your UART adapter! Installation Web-UI ------------------- Upload the Factory image using the devices Web-Interface. As the device uses a dual-image partition layout, OpenWrt can only installed on Slot A. This requires the current active image prior flashing the device to be on Slot B. In case this is not the case, OpenWrt will boot only one time, returning to the ZyXEL firmware the second boot. If this happens, first install a ZyXEL firmware upgrade of any version and install OpenWrt after that. Installation TFTP / Recovery ---------------------------- This installation routine is especially useful in case of a bricked device. Attach to the UART console header of the device. Interrupt the boot procedure by pressing Enter. The bootloader has a reduced command-set available from CLI, but more commands can be executed by abusing the atns command. Boot a OpenWrt initramfs image available on a TFTP server at 192.168.1.66. Rename the image to nwa50axpro-openwrt-initramfs.bin. $ atnf nwa50axpro-openwrt-initramfs.bin $ atna 192.168.1.88 $ atns "192.168.1.66; tftpboot; setenv fdt_high 0xffffffffffffffff; bootm" Upon booting, set the booted image to the correct slot: $ zyxel-bootconfig /dev/mtd9 get-status $ zyxel-bootconfig /dev/mtd9 set-image-status 0 valid $ zyxel-bootconfig /dev/mtd9 set-active-image 0 Copy the OpenWrt sysupgrade image to the device using scp. Write the sysupgrade image to NAND using sysupgrade. $ sysupgrade -n image.bin Signed-off-by: David Bauer <mail@david-bauer.net> (cherry picked from commit f0445746f6fd96fc7c5394b238153bd2ff22bc5b)
* mediatek: filogic: add H3C Magic NX30 Pro supportChukun Pan2023-07-131-0/+239
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hardware specification: SoC: MediaTek MT7981B 2x A53 Flash: W25N01GVZEIG 128MB RAM: NT5CB128M16JR-FL 256MB Ethernet: 4x 10/100/1000 Mbps Switch: MediaTek MT7531AE WiFi: MediaTek MT7976C Button: Reset, WPS Power: DC 12V 1A Flash instructions: 1. PC run command: "telnet 192.168.124.1 99" Username: H3C, password is the web login password of the router. 2. Download preloader.bin and bl31-uboot.fip 3. PC run command: "python3 -m http.server 80" 4. Download files in the telnet window: "wget http://192.168.124.xx/xxx.bin" Replace xx with your PC's IP and the preloader.bin and bl31-uboot.fip. 5. Flushing openwrt's uboot: "mtd write xxx-preloader.bin BL2" "mtd write xxx-bl31-uboot.fip FIP" 6. Connect to the router via the Lan port, set a static ip of your PC. (ip 192.168.1.254, gateway 192.168.1.1) 7. Download initramfs image, reboot router, waiting for tftp recovery to complete. 8. After openwrt boots up, perform sysupgrade. Note: 1. The u-boot-env partition on mtd is empty, OEM stores their env on ubi:u-boot-env. 2. Back up all mtd partitions before flashing. Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn> (cherry picked from commit e78d1a06c8a47be9ea5a306bfb43f3d7ceb89646)
* mediatek: add support for Netgear EX6250v2 seriesWenli Looi2023-07-131-0/+238
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Netgear EX6250v2, EX6400v3, EX6410v2, EX6470 are wall-plug 802.11ac (Wi-Fi 5) extenders. Like other MT7629 devices, Wi-Fi does not work currently as there is no driver. Related: https://github.com/openwrt/openwrt/pull/5084 For future reference, 2.4GHz MAC = LAN+1, 5GHz MAC = LAN+2. Specifications: * MT7629, 256 MiB RAM, 16 MiB SPI NOR * MT7761N (2.4GHz) / MT7762N (5GHz) - no driver * Ethernet: 1 port 10/100/1000 * UART: 115200 baud (labeled on board) 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. * After installation, perform a factory reset. Wait for the device to boot, then hold the reset button for 10 seconds. This is needed because sysupgrade in the stock firmware will attempt to preserve its configuration using sysupgrade.tgz. See https://github.com/openwrt/openwrt/pull/4182 Revert to stock firmware: * Flash the stock firmware to the bootloader using TFTP/NMRP. Signed-off-by: Wenli Looi <wlooi@ucalgary.ca> (cherry picked from commit 73de41898fcd06d837b013449c370c493bcdc595)
* mediatek: define NMBM management region for WAX220David Bauer2023-07-021-0/+5
| | | | | | | | | The NETGEAR WAX220 employs NMBM on SPI-NAND. In order to avoid dealing with invalid factory data, enable NMBM in the area preceding the UBI volume. Signed-off-by: David Bauer <mail@david-bauer.net> (cherry picked from commit 92eec257dd562547bc08ee76c1901eb22b66937c)
* mediatek: add support for Mercusys MR90X v1Mikhail Zhilkin2023-07-011-0/+276
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds support for Mercusys MR90X(EU) v1 router. Device specification -------------------- SoC Type: MediaTek MT7986BLA, Cortex-A53, 64-bit RAM: MediaTek MT7986BLA (512MB) Flash: SPI NAND GigaDevice GD5F1GQ5UEYIGY (128 MB) Ethernet: MediaTek MT7531AE + 2.5GbE MaxLinear GPY211C0VC (SLNW8) Ethernet: 1x2.5Gbe (WAN/LAN 2.5Gbps), 3xGbE (WAN/LAN 1Gbps, LAN1, LAN2) WLAN 2g: MediaTek MT7975N, b/g/n/ax, MIMO 4x4 WLAN 5g: MediaTek MT7975P(N), a/n/ac/ax, MIMO 4x4 LEDs: 1 orange and 1 green status LEDs, 4 green gpio-controlled LEDs on ethernet ports Button: 1 (Reset) USB ports: No Power: 12 VDC, 2 A Connector: Barrel Bootloader: Main U-Boot - U-Boot 2022.01-rc4. Additionally, both UBI slots contain "seconduboot" (also U-Boot 2022.01-rc4) Serial console (UART) --------------------- V +-------+-------+-------+-------+ | +3.3V | GND | TX | RX | +---+---+-------+-------+-------+ | +--- Don't connect The R3 (TX line) and R6 (RX line) are absent on the PCB. You should solder them or solder the jumpers. Installation (UART) ------------------- 1. Place OpenWrt initramfs image on tftp server with IP 192.168.1.2 2. Attach UART, switch on the router and interrupt the boot process by pressing 'Ctrl-C' 3. Load and run OpenWrt initramfs image: tftpboot initramfs-kernel.bin bootm 4. Once inside OpenWrt, set / update env variables: fw_setenv baudrate 115200 fw_setenv bootargs "ubi.mtd=ubi0 console=ttyS0,115200n1 loglevel=8 earlycon=uart8250,mmio32,0x11002000 init=/etc/preinit" fw_setenv fdtcontroladdr 5ffc0e70 fw_setenv ipaddr 192.168.1.1 fw_setenv loadaddr 0x46000000 fw_setenv mtdids "spi-nand0=spi-nand0" fw_setenv mtdparts "spi-nand0:2M(boot),1M(u-boot-env),50M(ubi0),50M(ubi1),8M(userconfig),4M(tp_data)" fw_setenv netmask 255.255.255.0 fw_setenv serverip 192.168.1.2 fw_setenv stderr serial@11002000 fw_setenv stdin serial@11002000 fw_setenv stdout serial@11002000 fw_setenv tp_boot_idx 0 5. Run 'sysupgrade -n' with the sysupgrade OpenWrt image Installation (without UART) --------------------------- 1. Login as root via SSH (router IP, port 20001, password - your web interface password) 2. Open for editing /etc/hotplug.d/iface/65-iptv (e.g., using WinSCP and SSH settings from the p.1) 3. Add a newline after "#!/bin/sh": telnetd -l /bin/login.sh 4. Save "65-iptv" file 5. Toggle "IPTV/VLAN Enable" checkbox in the router web interface and save 6. Make sure that telnetd is running: netstat -ltunp | grep 23 7. Login via telnet to router IP, port 23 (no username and password are required) 8 Upload OpenWrt "initramfs-kernel.bin" to the "/tmp" folder of the router (e.g., using WinSCP and SSH settings from the p.1) 9. Stock busybox doesn't contain ubiupdatevol command. Hence, we need to download and upload the full version of busybox to the router. For example, from here: https://github.com/xerta555/Busybox-Binaries/raw/master/busybox-arm64 Upload busybox-arm64 to the /tmp dir of the router and run: in the telnet shell: cd /tmp chmod a+x busybox-arm64 10. Check "initramfs-kernel.bin" size: du -h initramfs-kernel.bin 11. Delete old and create new "kernel" volume with appropriate size (greater than "initramfs-kernel.bin" size): ubirmvol /dev/ubi0 -N kernel ubimkvol /dev/ubi0 -n 1 -N kernel -s 9MiB 12. Write OpenWrt "initramfs-kernel.bin" to the flash: ./busybox-arm64 ubiupdatevol /dev/ubi0_1 /tmp/initramfs-kernel.bin 13. u-boot-env can be empty so lets create it (or overwrite it if it already exists) with the necessary values: fw_setenv baudrate 115200 fw_setenv bootargs "ubi.mtd=ubi0 console=ttyS0,115200n1 loglevel=8 earlycon=uart8250,mmio32,0x11002000 init=/etc/preinit" fw_setenv fdtcontroladdr 5ffc0e70 fw_setenv ipaddr 192.168.1.1 fw_setenv loadaddr 0x46000000 fw_setenv mtdids "spi-nand0=spi-nand0" fw_setenv mtdparts "spi-nand0:2M(boot),1M(u-boot-env),50M(ubi0),50M(ubi1),8M(userconfig),4M(tp_data)" fw_setenv netmask 255.255.255.0 fw_setenv serverip 192.168.1.2 fw_setenv stderr serial@11002000 fw_setenv stdin serial@11002000 fw_setenv stdout serial@11002000 fw_setenv tp_boot_idx 0 14. Reboot to OpenWrt initramfs: reboot 15. Login as root via SSH (IP 192.168.1.1, port 22) 16. Upload OpenWrt sysupgrade.bin image to the /tmp dir of the router 17. Run sysupgrade: sysupgrade -n /tmp/sysupgrade.bin Recovery -------- 1. Press Reset button and power on the router 2. Navigate to U-Boot recovery web server (http://192.168.1.1/) and upload the OEM firmware Recovery (UART) --------------- 1. Place OpenWrt initramfs image on tftp server with IP 192.168.1.2 2. Attach UART, switch on the router and interrupt the boot process by pressing 'Ctrl-C' 3. Load and run OpenWrt initramfs image: tftpboot initramfs-kernel.bin bootm 4. Do what you need (restore partitions from a backup, install OpenWrt etc.) Stock layout ------------ 0x000000000000-0x000000200000 : "boot" 0x000000200000-0x000000300000 : "u-boot-env" 0x000000300000-0x000003500000 : "ubi0" 0x000003500000-0x000006700000 : "ubi1" 0x000006700000-0x000006f00000 : "userconfig" 0x000006f00000-0x000007300000 : "tp_data" ubi0/ubi1 format ---------------- U-Boot at boot checks that all volumes are in place: +-------------------------------+ | Volume Name: uboot Vol ID: 0| | Volume Name: kernel Vol ID: 1| | Volume Name: rootfs Vol ID: 2| +-------------------------------+ MAC addresses ------------- +---------+-------------------+-----------+ | | MAC | Algorithm | +---------+-------------------+-----------+ | label | 00:eb:xx:xx:xx:be | label | | LAN | 00:eb:xx:xx:xx:be | label | | WAN | 00:eb:xx:xx:xx:bf | label+1 | | WLAN 2g | 00:eb:xx:xx:xx:be | label | | WLAN 5g | 00:eb:xx:xx:xx:bd | label-1 | +---------+-------------------+-----------+ label MAC address was found in UBI partition "tp_data", file "default-mac". OEM wireless eeprom is also there (file "MT7986_EEPROM.bin"). Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com> (cherry picked from commit e4fe3097ef6a961874b66932a0ac4be18070630a) [Fix merging conflict] Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
* filogic: add support for Netgear WAX220Flole Systems2023-06-261-0/+288
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hardware -------- SOC: MediaTek MT7986 RAM: 1024MB DDR3 FLASH: 128MB SPI-NAND (Winbond) WIFI: Mediatek MT7986 DBDC 802.11ax 2.4/5 GHz ETH: Realtek RTL8221B-VB-CG 2.5 N-Base-T PHY with PoE UART: 3V3 115200 8N1 (Pinout silkscreened / Do not connect VCC) Installation ------------ 1. Download the OpenWrt initramfs image. Copy the image to a TFTP server 2. Connect the TFTP server to the WAX220. Conect to the serial console, interrupt the autoboot process by pressing '0' when prompted. 3. Download & Boot the OpenWrt initramfs image. $ setenv ipaddr 192.168.2.1 $ setenv serverip 192.168.2.2 $ tftpboot openwrt.bin $ bootm 4. Wait for OpenWrt to boot. Transfer the sysupgrade image to the device using scp and install using sysupgrade. $ sysupgrade -n <path-to-sysupgrade.bin> Signed-off-by: Flole Systems <flole@flole.de> Signed-off-by: Stefan Agner <stefan@agner.ch> (cherry picked from commit 984786a2f7ec622c99e8c9cdada65d0ea0cf4e0b)
* mediatek: sync MT7986 device trees with upstreamDaniel Golle2023-06-0912-850/+55
| | | | | | | | | Sync device tree files for MT7986 boards with what landed in upstream Linux tree to easy maintainance and also allow for a smooth update to Linux 6.1. Signed-off-by: Daniel Golle <daniel@makrotopia.org> (cherry picked from commit 7a0ec001ff79b12beefb8f3773820bfedebbb340)
* mediatek: convert mt7986a-zyxel-ex5601-t0-stock.dts to UNIXDaniel Golle2023-06-091-560/+560
| | | | | | | The device tree file was in DOS format (CR-LF). Convert it to UNIX style. Signed-off-by: Daniel Golle <daniel@makrotopia.org> (cherry picked from commit d28534545edfa29e9529f9c9cd5960889a9d4018)
* mediatek: filogic: add Qihoo 360T7 supportChukun Pan2023-05-291-0/+229
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hardware specification: SoC: MediaTek MT7981B 2x A53 Flash: ESMT F50L1G41LB 128MB RAM: MT5CC128M16JR-EK 256MB Ethernet: 4x 10/100/1000 Mbps Switch: MediaTek MT7531AE WiFi: MediaTek MT7976C Button: Reset, WPS Power: DC 12V 1A Flash instructions: 1. Attach UART, boot the stock firmware until the message about failsafe mode appears. 2. Enter failsafe mode by pressing "f" and "Enter" 3. Type "mount_root", then run "fw_setenv bootmenu_delay 3" 4. Back up all mtd partitions before flashing. 5. Reboot, U-Boot now presents a menu. 6. Connect to your PC via the Gigabit port of the router, set a static ip on the ethernet interface of your PC. (ip 192.168.1.254, gateway 192.168.1.1) 7. Select "Upgrade ATF BL2", then use this file: openwrt-mediatek-filogic-qihoo_360t7-preloader.bin 8. Select "Upgrade ATF FIP", then use this file: openwrt-mediatek-filogic-qihoo_360t7-bl31-uboot.fip 9. Download the initramfs image, and type "reset", waiting for tftp recovery to complete. a. After openwrt boots up, perform sysupgrade. Note: 1. Since NMBM is disabled, we must back up all partitions. 2. Flash instructions is based on commit 28df7f7. Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn> (cherry picked from commit dc2d4d73939c3d86a8e9d968c5c3462f92771bc6) Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: add support for Zyxel EX5601-T0 routerPietro Ameruoso2023-05-241-0/+560
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Zyxel EX5601-T0 specifics -------------- The operator specific firmware running on the Zyxel branded EX5601-T0 includes U-Boot modifications affecting the OpenWrt installation. Partition Table | dev | size | erasesize | name | | ---- | -------- | --------- | ------------- | | mtd0 | 20000000 | 00040000 | "spi0.1" | | mtd1 | 00100000 | 00040000 | "BL2" | | mtd2 | 00080000 | 00040000 | "u-boot-env" | | mtd3 | 00200000 | 00040000 | "Factory" | | mtd4 | 001c0000 | 00040000 | "FIP" | | mtd5 | 00040000 | 00040000 | "zloader" | | mtd6 | 04000000 | 00040000 | "ubi" | | mtd7 | 04000000 | 00040000 | "ubi2" | | mtd8 | 15a80000 | 00040000 | "zyubi" | The router boots BL2 which than loads FIP (u-boot). U-boot has hardcoded a command to always launch Zloader "mtd read zloader 0x46000000" and than "bootm". Bootargs are deactivated. Zloader is the zyxel booloader which allow to dual-boot ubi or ubi2, by default access to zloader is blocked. Too zloader checks that the firmware contains a particolar file called zyfwinfo. Additional details regarding Zloader can be found here: https://hack-gpon.github.io/zyxel/ https://forum.openwrt.org/t/adding-openwrt-support-for-zyxel-ex5601-t0/155914 Hardware -------- SOC: MediaTek MT7986a CPU: 4 core cortex-a53 (2000MHz) RAM: 1GB DDR4 FLASH: 512MB SPI-NAND (Micron xxx) WIFI: Wifi6 Mediatek MT7976 802.11ax 5 GHz 4x4 + 2.4GHZ 4x4 ETH: MediaTek MT7531 Switch + SoC 3 x builtin 1G phy (lan1, lan2, lan3) 1 x MaxLinear GPY211B 2.5 N-Base-T phy5 (lan4) 1 x MaxLinear GPY211B 2.5Gbit xor SFP/N-Base-T phy6 (wan) USB: 1 x USB 3.2 Enhanced SuperSpeed port UART: 3V3 115200 8N1 (Pinout: GND KEY RX TX VCC) VOIP: 2 FXS ports for analog phones MAC Address Table ----------------- eth0/lan Factory 0x002a eth1/wan Factory 0x0024 wifi 2.4Ghz Factory 0x0004 wifi 5Ghz Factory 0x0004 + 1 Serial console (UART) --------------------- +-------+-------+-------+-------+-------+ | +3.3V | RX | TX | KEY | GND | +---+---+-------+-------+-------+-------+ | +--- Don't connect Installation ------------ Keep in mind that openwrt can only run on the UBI partition, the openwrt firmware is not able to understand the zloader bootargs. The procedure allows restoring the UBI partition with the Zyxel firmware and retains all the OEM functionalities. 1. Unlock Zloader (this will allow to swap manually between partitions UBI and UBI2): - Attach a usb-ttl adapter to your computer and boot the router. - While the router is booting at some point you will read the following: `Please press Enter to activate this console.` - As soon as you read that press enter, type root and than press enter again (just do it, don't care about the logs scrolling). - Most likely the router is still printing the boot log, leave it boot until it stops. - If everything went ok you should have full root access "root@EX5601-T0:/#". - Type the following command and press enter: "fw_setenv EngDebugFlag 0x1". - Reboot the router. - As soon as you read `Hit any key to stop autoboot:` press Enter. - If everything went ok you should have the following prompt: "ZHAL>". - You have successfully unlocked zloader access, this procedure must be done only once. 2. Check the current active partition: - Boot the router and repeat the steps above to gain root access. - Type the following command to check the current active image: "cat /proc/cmdline". - If `rootubi=ubi` it means that the active partition is `mtd6` - If `rootubi=ubi2` it means that the active partition is `mtd7` - As mentioned earlier we need to flash openwrt into ubi/mtd6 and never overwrite ubi2/mtd7 to be able to fully roll-back. - To activate and boot from mtd7 (ubi2) enter into ZHAL> command prompt and type the following commands: atbt 1 # unlock write atsw # swap boot partition atsr # reboot the router - After rebooting check again with "cat /proc/cmdline" that you are correctly booting from mtd7/ubi2 - If yes proceed with the installation guide. If not probably you don't have a firmware into ubi2 or you did something wrong. 3. Flashing: - Download the sysupgrade file for the router from openwrt, than we need to add the zyfwinfo file into the sysupgrade tar. Zloader only checks for the magic (which is a fixed value 'EXYZ') and the crc of the file itself (256bytes). I created a script to create a valid zyfwinfo file but you can use anything that does exactly the same: https://raw.githubusercontent.com/pameruoso/OpenWRT-Zyxel-EX5601-T0/main/gen_zyfwinfo.sh - Add the zyfwinfo file into the sysupgrade tar. - Enter via telnet or ssh into the router with admin credentials - Enter the following commands to disable the firmware and model checks "zycli fwidcheck off" and "zycli modelcheck off" - Open the router web interface and in the update firmware page select the "restore default settings option" - Select the sysupgrade file and click on upload. - The router will flash and reboot itself into openwrt from UBI 4. Restoring and going back to Zyxel firmware. - Use the ZHAL> command line to manually swap the boot parition to UBI2 with the following: atbt 1 # unlock write atsw # swap boot partition atsr # reboot the router - You will boot again the Zyxel firmware you have into UBI2 and you can flash the zyxel firmware to overwrite the UBI partition and openwrt. Working features ---------------- 3 gbit lan ports Wifi Zyxel partitioning for coexistance with Zloader and dual boot. WAN SFP port (only after exporting pins 57 and 10. gpiobase411) leds reset button serial interface usb port lan ethernet 2.5 gbit port (autosense) wan ethernet 2.5 gbit port (autosense) Not working ---------------- voip (missing drivers or proper zyxel platform software) Swapping the wan ethernet/sfp xor port ---------------- The way to swap the wan port between sfp and ethernet is the following: export the pins 57 and 10. Pin 57 is used to probe if an sfp is present. If pin 57 value is 0 it means that an sfp is present into the cage (cat /sys/class/gpio/gpio468/value). If pin 57 value is 1 it means that no sfp is inserted into the cage. In conclusion by default both 57 an 10 pins are by default 1, which means that the active port is the ethernet one. After inserting an SFP pin 57 will become 0 and you have to manually change the value of pin 10 to 0 too. This is totally scriptable of course. Leds description ------------ All the leds are working out of the box but the leds managed by the 2 maxlinear phy (phy 5 lan, phy6 wan). To activate the phy5 led (rj45 ethernet port led on the back of the router) you have to use mdio-tools. To activate the phy6 led (led on the front of the router for 2.5gbit link) you have to use mdio-tools. Example: Set lan5 led to fast blink on 2500/1000, slow blink on 10/100: mdio mdio-bus mmd 5:30 raw 0x0001 0x33FC Set wan 2.5gbit led to constant on when wan is 2.5gbit: mdio mdio-bus mmd 6:30 raw 0x0001 0x0080 Signed-off-by: Pietro Ameruoso <p.ameruoso@live.it> (cherry picked from commit 1c05388ab04c934ec240e8362321908f91381a90) Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: add support for the GL.iNet GL-MT3000Daniel Golle2023-05-181-0/+240
| | | | | | | | | | | | | | | | | | | | | | The MT-3000 is a pocket-sized Wi-Fi 6 router based on MediaTek MT7981. Specification: - SoC: MediaTek MT7981B - CPU: 2x 1.3 GHz Cortex-A53 - Flash: 256 MiB Macronix SPI NAND - RAM: 512 MiB Nanya DDR4 - WLAN: 2.4 GHz, 5 GHz (MediaTek MT7976CN) - Ethernet: - 1x 10/100/1000 Mbps built-in PHY (LAN) - 1x 10/100/1000/2500 Mbps MaxLinear GPY211 PHY (WAN) - USB 3.0 port - Buttons: 1 button, 1 switch - LEDs: 1x light-blue, 1x warm-white - Serial console: internal 4-pin header, 115200 8n1 - PWM controlled fan with tacho - Power: 5 VDC, 3 A (USB Type-C) Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: add support for Cudy WR3000 v1David Bauer2023-05-181-0/+282
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hardware -------- MediaTek MT7981 WiSoC 256MB DDR3 RAM 16MB SPI-NOR (XMC XM25QH128C) MediaTek MT7981 2x2 DBDC 802.11ax 2T2R (2.4 / 5) UART: 115200 8N1 3.3V [LEDS] VCC-GND-RX-TX [ETH] Header is located below the heatsink Case ---- Unscrew the 4 bottom screws. Remove the top of the case by inserting a small screwdriver into the ventilation holes and lift the top cover. This works best by beginning near the ETH-ports. The top is clipped on the front near the LEDs with two plastic clips. The back has a single clip in the middle. Start at one of the back edges. MAC-Addresses ------------- 80:AF:CA:00:F9:C6 LAN 80:AF:CA:00:F9:C7 WAN 80:AF:CA:00:F9:C6 W2 82:AF:CA:30:F9:C6 W5 Installation ------------ 1. Connect to the serial port as described in the "Hardware" section. 2. Power on the device. Keep pressing the "0" key to enter the U-Boot shell. 3. Download the OpenWrt initramfs image. Place it on an TFTP server connected to the Cudy LAN ports. Make sure the server is reachable at 192.168.1.2. Rename the image to "cudy3000.bin" 4. Download and boot the OpenWrt initramfs image. $ tftpboot 0x46000000 cudy3000.bin; bootm 0x46000000 5. Transfer the OpenWrt sysupgrade image to the device using scp. Install with sysupgrade. Note: Cudy does not yet provide a image for disabling their signature-protection. This has happened in the past. Make sure to check the wiki for a possible easier installation method. Signed-off-by: David Bauer <mail@david-bauer.net>
* mediatek: apply stock configuration for WAN-LEDDavid Bauer2023-05-111-1/+1
| | | | | | | Apply the same LED configuration used by the vendor-firmware for the GPY211 controlled WAN LED in OpenWrt. Signed-off-by: David Bauer <mail@david-bauer.net>
* mediatek: configure TUF-AX4200 LAN LEDsDavid Bauer2023-05-111-0/+61
| | | | | | | | | | As we can now configure the switch LED configuration, write the switch LED configuration values from the vendor firmware to the switch-IC. Previously, the switch-LEDs did not show any acitvity or link-status whatsoever. Signed-off-by: David Bauer <mail@david-bauer.net>
* 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>
* mediatek: add support for TP-Link TL-XDR4288/608xChukun Pan2023-04-224-0/+480
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hardware specification: SoC: MediaTek MT7986A 4x A53 Flash: ESMT F50L1G41LB 128MB RAM: ESMT M15T4G16256A 512MB Ethernet (Max Speed): XDR4288: 1x 2.5G Wan, 1x 2.5G Lan, 4x 1G Lan XDR6086: 1x 2.5G Wan, 1x 2.5G Lan, 1x 1G Lan XDR6088: 1x 2.5G Wan, 1x 2.5G Lan, 4x 1G Lan WiFi: XDR4288: MT7976DAN (2.4G 2T2R, 5G 3T3R) XDR6086/XDR6088: WiFi1: MT7976GN 2.4GHz 4T4R WiFi2: MT7976AN 5GHz 4T4R Button: Reset, WPS, Turbo USB: 1 x USB 3.0 Power: DC 12V 4A Flash instructions: 1. Execute the following operation to open nc shell: https://openwrt.org/inbox/toh/tp-link/xdr-6086#rooting 2. Replace the stock bootloader to OpenWrt's: dd bs=131072 conv=sync of=/dev/mtdblock9 if=/tmp/xxx-preloader.bin dd bs=131072 conv=sync of=/dev/mtdblock9 seek=28 if=/tmp/xxx-bl31-uboot.fip 3. Connect to your PC via the Gigabit port of the router, set a static ip on the ethernet interface of your PC. (ip 192.168.1.254, gateway 192.168.1.1) 4. Download the initramfs image, and restart the router, waiting for tftp recovery to complete. 5. After openwrt boots up, perform sysupgrade. Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn> [Add uboot build, fit and sysupgrade support, fix RealTek PHYs] Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: bpi-r3: allow up to 3W per SFP moduleDaniel Golle2023-04-201-0/+2
| | | | | | | | | According to SinoVoip up to 3A @ 3.3V are available for both SFP modules together. Raise energy limit from 1W (default) to 3W, however, be aware that using modules consuming more than 1W will require active cooling! Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* filogic: add support for ASUS TUF-AX4200David Bauer2023-03-241-0/+291
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hardware -------- SOC: MediaTek MT7986 RAM: 512MB DDR3 FLASH: 256MB SPI-NAND (Winbond W25N02KV) WIFI: Mediatek MT7986 DBDC 802.11ax 2.4/5 GHz ETH: MediaTek MT7531 Switch MaxLinear GPY211C 2.5 N-Base-T PHY UART: 3V3 115200 8N1 (Pinout silkscreened / Do not ocnnect VCC) Installation ------------ 1. Download the OpenWrt initramfs image. Copy the image to a TFTP server reachable at 192.168.1.66/24. Rename the image to tufax4200.bin. 2. Connect the TFTP server to the AX4200. Conect to the serial console, interrupt the autoboot process by pressing '4' when prompted. 3. Download & Boot the OpenWrt initramfs image. $ setenv ipaddr 192.168.1.1 $ setenv serverip 192.168.1.66 $ tftpboot 0x46000000 tufax4200.bin $ bootm 0x46000000 4. Wait for OpenWrt to boot. Transfer the sysupgrade image to the device using scp and install using sysupgrade. $ sysupgrade -n <path-to-sysupgrade.bin> Missing features ---------------- - The LAN port LEDs are driven by the switch but OpenWrt does not correctly configure the output. Signed-off-by: David Bauer <mail@david-bauer.net>
* treewide: remove label = "cpu" from DSA dt-bindingArınç ÜNAL2023-02-269-9/+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>
* mediatek: add support for Netgear WAX206Marcel Ziswiler2023-02-181-0/+559
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* mediatek: mt7622: fix rootfs/ubi detection for Xiaomi AX6SOleg S2023-02-111-1/+0
| | | | | | | | | | | | | | | | | By specifying the flag "denx,fit" for partition "kernel", the kernel try to find rootfs in the same partition during boot. Reality is that the placement of rootfs is precisely determined by the name of another partition -"ubi". It was also found that on some device (for example devices with NAND chips), the "Denx search engine" manages to find roots at the end of partition "kernel", but such partition doesn't exist and is empty there. Fix this by removing the "denx,fit" flag from partition "kernel". With this change the original behavior of searchif rootfs in partition "ubi" is restored. Signed-off-by: Oleg S <remittor@gmail.com>
* mediatek: drop redmi-ax6000 variant with modified envChuanhong Guo2022-12-301-42/+0
| | | | | | | | | | | | | | | | | | | This variant uses xiaomi factory u-boot and modified u-boot-env & bootcmd. By modifying uboot-env, the xiaomi firmware recovery provided in the vendor u-boot doesn't work anymore. It's possible to put u-boot into a state where it refuese to take any serial input. If the u-boot is in this state, users can't restore their firmware without taking the flash off the board. We now have a -stock variant where the vendor u-boot is used in a way that xiaomi firmware recovery still works, and a -ubootmod variant where we get rid of all xiaomi components, have more usable space and no uart console lock. These two should cover all use cases and we don't need this variant anymore. Drop this redmi-ax6000 variant. Existing users of this variant should perform a u-boot mod or restore to the -stock layout. Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
* mediatek: add new layout for Xiaomi Redmi Router AX6000 for OpenWrt U-BootFurong Xu2022-12-294-17/+53
| | | | | | | | | This new layout is only bootable with OpenWrt U-Boot. It reuses the two crash partions and expands the ubi partion to the end of whole flash. Do not use this layout with stock U-Boot! Signed-off-by: Furong Xu <xfr@outlook.com>
* mediatek: redmi-ax6000: drop cs-gpiosChuanhong Guo2022-12-171-1/+0
| | | | | | | | 'cs-gpios = <0>, <0>' is a hack in ath79 to override the incorrectly specified maximum number of chipselects available in spi-ath79.c. It's not needed here and must have been copied here by mistake. Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
* mediatek: add alternative stock layout for Xiaomi Redmi Router AX6000Chen Minqiang2022-12-173-281/+310
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In this implementation, the flash partition layout is adjusted to avoid modifying the uboot environment of mtdparts. This ensures that the 30M ubi_kernel partition remains aligned with the stock ubi partition, and the kernel volume is placed in it. This allows the stock uboot to boot from it without changing the mtdparts, which is useful for reverting back to the stock firmware using Xiaomi Firmware Tools. In actual testing, modifying mtdparts has been found to break Xiaomi Firmware Tools. 1. use ARTIFACTS to generate initramfs-factory.ubi for easy installation. 2. The NAND flash layout is changed to allow for reverting back to the stock firmware. 3. Before performing sysupgrade, do some cleanup in platform_pre_upgrade to ensure a clean installation of OpenWRT. 4. Setup the uboot env to ensure that the system always boot, which can be helpful for users who may forget to do this before sysupgrade in the initramfs. New flash instructions: 1. Gain ssh access. Please refer to: https://openwrt.org/toh/xiaomi/redmi_ax6000#installation) 2. Check which system current u-boot is loading from: COMMAND: `cat /proc/cmdline` sample OUTPUT: `console=ttyS0,115200n1 loglevel=8 firmware=1 uart_en=1` if firmware=1, current system is ubi1 if firmware=0, current system is ubi0 3. Setup nvram and write the firmware: If the current system is ubi1, please set it up so that the next time it will boot from ubi, and write the firmware to ubi: ``` nvram set boot_wait=on nvram set uart_en=1 nvram set flag_boot_rootfs=0 nvram set flag_last_success=0 nvram set flag_boot_success=1 nvram set flag_try_sys1_failed=0 nvram set flag_try_sys2_failed=0 nvram commit ubiformat /dev/mtd8 -y -f /tmp/initramfs-factory.ubi ``` If the current system is ubi, please set it up so that the next time it will boot from ubi1, and write the firmware to ubi1: ``` nvram set boot_wait=on nvram set uart_en=1 nvram set flag_boot_rootfs=1 nvram set flag_last_success=1 nvram set flag_boot_success=1 nvram set flag_try_sys1_failed=0 nvram set flag_try_sys2_failed=0 nvram commit ubiformat /dev/mtd9 -y -f /tmp/initramfs-factory.ubi ``` 4. After rebooting, the system should now boot into the openwrt initramfs. Flash the squashfs-sysupgrade.bin via using ssh or luci. ``` sysupgrade -n /tmp/squashfs-sysupgrade.bin ``` Done. For existing users of the Redmi AX6000 running OpenWrt, here are the steps to switch to this new layout: 1. Flash initramfs-factory.ubi ``` mtd -r -e ubi write /tmp/initramfs-factory.ubi ubi ``` 2. After rebooting, the system will boot into the new openwrt-initramfs. Log in and perform a sysupgrade to complete the process. ``` sysupgrade -n /tmp/squashfs-sysupgrade.bin ``` Signed-off-by: Chen Minqiang <ptpt52@gmail.com> Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
* mediatek: add LED support for Xiaomi Redmi AX6000Furong Xu2022-12-161-0/+38
| | | | | | | add DT nodes and default package for the LEDs on Redmi AX6000 Signed-off-by: Furong Xu <xfr@outlook.com> Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
* mediatek: also move &slot0 from dtsi down to board dtsDaniel Golle2022-12-073-10/+20
| | | | | | | | | As the referenced MTD partition is only present in the dts, also move &slot0 down to the dts files. Fixes: 64e9b62829 ("mediatek: remove redundant flash entry from dtsi") Fixes: 7dbac3433f ("mediatek: add support for reyee AX3200-E5") Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: remove redundant flash entry from dtsiDaniel Golle2022-12-073-74/+16
| | | | | | | | | | Splitting-off the common parts of Ruijie RG-EW3200GX PRO and reyee AX3200-E5 went wrong because the flash descriptiom was kept also in the dtsi. Remove it there, as flash definition is added by both board dts files. Fixes: 7dbac3433f ("mediatek: add support for reyee AX3200-E5") Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: add support for reyee AX3200-E5Alex Hansen2022-12-063-255/+404
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: add Xiaomi Redmi Router AX6000 supportChukun Pan2022-10-301-0/+255
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hardware specification: SoC: MediaTek MT7986A 4x A53 Flash: ESMT F50L1G41LB 128 MB RAM: K4A4G165WF-BCWE 512 MB Ethernet: 4x 10/100/1000 Mbps WiFi1: MT7976GN 2.4GHz ax 4x4 WiFi2: MT7976AN 5GHz ax 4x4 Button: Mesh, Reset Flash instructions: 1. Gain ssh and serial port access, see the link below: https://openwrt.org/toh/xiaomi/redmi_ax6000#installation 2. Use ssh or serial port to log in to the router, and execute the following command: nvram set boot_wait=on nvram set flag_boot_rootfs=0 nvram set flag_boot_success=1 nvram set flag_last_success=1 nvram set flag_try_sys1_failed=8 nvram set flag_try_sys2_failed=8 nvram commit 3. Set a static ip on the ethernet interface of your computer (e.g. default: ip 192.168.31.100, gateway 192.168.31.1) 4. Download the initramfs image, rename it to initramfs.bin, and host it with the tftp server. 5. Interrupt U-Boot and run these commands: setenv mtdparts nmbm0:1024k(bl2),256k(Nvram),256k(Bdata),2048k(factory),2048k(fip),256k(crash),256k(crash_log),112640k(ubi) saveenv tftpboot initramfs.bin bootm 6. After openwrt boots up, use scp or luci web to upload sysupgrade.bin to upgrade. Revert to stock firmware: Restore mtdparts back to default, then use the vendor's recovery tool (Windows only). Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
* mediatek: filogic: set correct PWM clock and clean thermal zoneDaniel Golle2022-10-091-1/+2
| | | | | | | | | | | | * set correct clocks for PWM to work. * MT7986 PWM does have the 26MHz-clock-select, set that in patch * drop useless 'passive' trip point in thermal zone * extend pwm-fan to have 3 active operating points * set reasonable trip points in thermal zone * invert pwm-fan operating points and set shorter period to allow less noisy operation of the PWM fan of the BPi-R3. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: filogic: enable thermal, I2C and PWM of the BPi-R3Daniel Golle2022-10-071-0/+31
| | | | | | | Setup thermal zone, select pins and enabled drivers for I2C (on 26-pin GPIO bank) and PWM (1x fan and 1x GPIO bank). Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: add support for ipTIME A6004MX Add basic support for ipTIME A6004MX.Yoonji Park2022-09-121-0/+294
| | | | | | | | | | | | | | | | | | | | | | | | | Hardware: SoC: MediaTek MT7629 Cortex-A7 (ARMv7 1.25GHz, Dual-Core) RAM: DDR3 128MB Flash: Macronix MX35LF1GE4AB (SPI-NAND 128MB) WiFi: MediaTek MT7761N (2.4GHz) / MediaTek MT7762N (5GHz) - no driver Ethernet: SoC (WAN) / MediaTek MT7531 (LAN x4) UART: [GND, RX, TX, 3.3V] (115200) Installation: - Flash recovery image with TFTP recovery Revert to stock firmware: - Flash stock firmware with TFTP recovery TFTP Recovery method: 1. Unplug the router 2. Hold the reset button and plug in 3. Release when the power LED stops flashing and go off 4. Set your computer IP address manually to 192.168.0.x / 255.255.255.0 5. Flash image with TFTP client to 192.168.0.1 Signed-off-by: Yoonji Park <koreapyj@dcmys.kr>
* mediatek: disable unsupported background radar detectionShiji Yang2022-09-123-2/+7
| | | | | | | | | | | MT7915 requires an additional antenna for background radar scanning. Disable this feature in the following devices that do not have a separate DFS antenna: linksys,e8450 ruijie,rg-ew3200gx-pro xiaomi,redmi-router-ax6s Signed-off-by: Shiji Yang <yangshiji66@qq.com>
* mediatek: fix ledbar of UniFi 6 LR when running custom U-BootDaniel Golle2022-09-111-1/+2
| | | | | | | | | | The RGB LED of the UniFi 6 LR v1 doesn't work when using the Openwrt- built U-Boot. This is because the vendor loader resets the ledbar controller while our U-Boot doesn't care. Add reset-gpio so the ledbar driver in Linux will always reset the ledbar controller. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: filogic: use WPS button instead of RST on BPi-R3Daniel Golle2022-09-101-0/+12
| | | | | | | | | The GPIO used for the RST button is also used for PCIe-CLKREQ signal. Hence it cannot be used as button signal if PCIe is also used. Wire up WPS button to serve as KEY_RESTART in Linux and "reset" button in U-Boot. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: mt7622: fix DTS compatible of UniFi 6 LR variantsDaniel Golle2022-09-033-3/+3
| | | | | | | Make sure the compatible string in DTS matches the now v1/v2 differentiated board name in target/linux/mediatek/image/mt7622.mk. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: add support for Bananapi BPi-R3Daniel Golle2022-08-305-0/+798
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Bananapi BPi-R3 is a development router board built around the MediaTek Filogic 830 (MT7986A) SoC. The board can boot either from microSD, SPI-NAND, SPI-NOR or eMMC. Only either SPI-NAND or SPI-NOR can be used at the same time, also only either microSD or eMMC can be used. The various storage options can be selected using small SMD switches on the board. Specs: * MediaTek MT7986A (Filogic 830) 4x ARM Cortex A53 * 4T4R 2.4G 802.11bgnax (MT7975N) * 4T4R 5G 802.11anac/ax (MT7975P) * 2 GB DDR4 RAM * 8 GB eMMC * 128 MB SPI-NAND flash * 32 MB SPI-NOR flash * on-board MT7531 GbE switch * 2x SFP+ (1 GbE / 2.5 GbE) * 5x GbE network port * miniPCIe slot (only USB 2.0 connected) * uSIM slot (connected to miniPCIe interface) * M.2 KEY-E PCIe interface (PCIe x2) * microSD card interface * 26 PIN GPIO Hardware details: https://wiki.banana-pi.org/Banana_Pi_BPI-R3 Working: * all 4 boot methods incl. installation via U-Boot, sysupgrade, ... * copper LAN and WAN ports * SFP1 (connected to gmac1, eth1 in Linux) * WiFi * LEDs * Buttons * PSTORE/ramoops based dual-boot Not Working (missing driver features): * SFP2 (connected to MT7531 switch) Untested: * M.2/NGFF slot (PCIe x2) * mPCIe slot (USB 2.0 + SIM) Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: mt7622: add missing vbus regulator node to totolink-a8000ru dtsAndrew Sim2022-07-071-0/+10
| | | | | | | | | | On boot, kernel log complains no vbus supply is found: `xhci-mtk 1a0c0000.usb: supply vbus not found, using dummy regulator` so add the dts node entries to solve the issue Signed-off-by: Andrew Sim <andrewsimz@gmail.com>
* mediatek: mt7622: fix white dome LED of UniFi 6 LRDaniel Golle2022-07-041-3/+1
| | | | | | | | | | The recent differentiation between v1 and v2 of the UniFi 6 LR added support for the v2 version which has GPIO-controlled LEDs instead of using an additional microcontroller to drive an RGB led. The polarity of the white LED, however, was inverted and the default states didn't make a lot of sense after all. Fix that. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: UniFi 6 LR: disable RTCDaniel Golle2022-06-181-0/+6
| | | | | | | | There is not RTC battery connected to the SoC of the UniFi 6 LR board. Disable the RTC to prevent the system coming up with time set to 2000-01-01 00:00:00 after each reboot. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* mediatek: add Ubiquiti UniFi 6 LR v2 targetsHenrik Riomar2022-06-113-0/+210
| | | | | | | | | | | | | | | Add targets: * Ubiquiti UniFi 6 LR v2 * Ubiquiti UniFi 6 LR v2 (U-Boot mod) This target does not have a RGB led bar like v1 did Used target/linux/ramips/dts/mt7621_ubnt_unifi.dtsi as inspiration The white dome LED is default-on, blue will turn on when the system is in running state Signed-off-by: Henrik Riomar <henrik.riomar@gmail.com>
* mediatek: new target ubnt_unifi-6-lr-v1-ubootmodHenrik Riomar2022-06-111-1/+1
| | | | | | | | based on current ubnt_unifi-6-lr-ubootmod Signed-off-by: Daniel Golle <daniel@makrotopia.org> [added SUPPORTED_DEVICES for compatibility with existing setups] Signed-off-by: Henrik Riomar <henrik.riomar@gmail.com>
* mediatek: new target mt7622-ubnt-unifi-6-lr-v1Henrik Riomar2022-06-114-28/+30
| | | | | | | | | | | | Based on current mt7622-ubnt-unifi-6-lr, this is a preparation for adding a v2 version of this target * v1 - with led-bar * v2 - two simple GPIO connected LEDs (in later commits) Signed-off-by: Daniel Golle <daniel@makrotopia.org> [added SUPPORTED_DEVICES for compatibility with existing setups] Signed-off-by: Henrik Riomar <henrik.riomar@gmail.com>
* mediatek: mt7622: add support for ELECOM WRC-X3200GST3INAGAKI Hiroshi2022-05-211-0/+436
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ELECOM WRC-X3200GST3 is a 2.4/5 GHz band 11ax (Wi-Fi 6) router, based on MT7622B. Specifications: - SoC : MediaTek MT7622B - RAM : DDR3 512 MiB (Nanya NT5CC256M16ER-EK) - Flash : SPI-NAND 128 MiB (Winbond W25N01GVZEIG) - WLAN : 2.4/5 GHz 4T4R - 2.4 GHz : MediaTek MT7622B (SoC) - 5 GHz : MediaTek MT7915A - Ethernet : 5x 10/100/1000 Mbps - Switch : MediaTek MT7531 - LEDs/Keys : 6x/4x (2x buttons, 1x slide-switch) - UART : through-hole on PCB - J19: 3.3V, GND, TX, RX from power jack side - 115200n8 - Power : 12 VDC, 1.5 A Flash instruction using factory image: 1. Boot WRC-X3200GST3 normally with "Router" mode 2. Access to "http://192.168.2.1/" and open firmware update page ("ファームウェア更新") 3. Select the OpenWrt factory image and click apply ("適用") button 4. Wait ~120 seconds to complete flashing MAC Addresses: LAN : 04:AB:18:xx:xx:77 (Factory, 0x7FFF4 (hex)) WAN : 04:AB:18:xx:xx:78 (Factory, 0x7FFFA (hex)) 2.4 GHz: 04:AB:18:xx:xx:79 (Factory, 0x4 (hex)) 5 GHz : 04:AB:18:xx:xx:7A (none) Note: - currently, there is no "phy1tpt" trigger for 5 GHz wlan (MT7915) in "trigger" file of LEDs, use "phy1radio" trigger instead Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
* mediatek: add an upstreamed spi-nand driverChuanhong Guo2022-04-285-216/+260
| | | | | | | This patch implements the spi-nand controller driver as an ECC-capable spi-mem controller to use the upstream SPI-NAND driver. Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
* mediatek: Add support for Xiaomi Redmi Router AX6SRichard Huynh2022-03-201-0/+355
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also known as the "Xiaomi Router AX3200" in western markets, but only the AX6S is widely installation-capable at this time. SoC: MediaTek MT7622B RAM: DDR3 256 MiB (ESMT M15T2G16128A) Flash: SPI-NAND 128 MiB (ESMT F50L1G41LB or Gigadevice GD5F1GQ5xExxG) WLAN: 2.4/5 GHz 4T4R 2.4 GHz: MediaTek MT7622B 5 GHz: MediaTek MT7915E Ethernet: 4x 10/100/1000 Mbps Switch: MediaTek MT7531B LEDs/Keys: 2/2 (Internet + System LED, Mesh button + Reset pin) UART: Marked J1 on board VCC RX GND TX, beginning from "1". 3.3v, 115200n8 Power: 12 VDC, 1.5 A Notes: U-Boot passes through the ethaddr from uboot-env partition, but also has been known to reset it to a generic mac address hardcoded in the bootloader. However, bdata is also populated with the ethernet mac addresses, but is also typically never written to. Thus this is used instead. Installation: 1. Flash stock Xiaomi "closed beta" image labelled 'miwifi_rb03_firmware_stable_1.2.7_closedbeta.bin'. (MD5: 5eedf1632ac97bb5a6bb072c08603ed7) 2. Calculate telnet password from serial number and login 3. Execute commands to prepare device nvram set ssh_en=1 nvram set uart_en=1 nvram set boot_wait=on nvram set flag_boot_success=1 nvram set flag_try_sys1_failed=0 nvram set flag_try_sys2_failed=0 nvram commit 4. Download and flash image On computer: python -m http.server On router: cd /tmp wget http://<IP>:8000/factory.bin mtd -r write factory.bin firmware Device should reboot at this point. Reverting to stock: Stock Xiaomi recovery tftp that accepts their signed images, with default ips of 192.168.31.1 + 192.168.31.100. Stock image should be renamed to tftp server ip in hex (Eg. C0A81F64.img) Triggered by holding reset pin on powerup. A simple implementation of this would be via dnsmasq's dhcp-boot option or using the vendor's (Windows only) recovery tool available on their website. Signed-off-by: Richard Huynh <voxlympha@gmail.com>