aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips
Commit message (Collapse)AuthorAgeFilesLines
* ramips: add support for D-Link DIR-878 R1Igor Nazarov2022-03-192-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifications: - SoC: MediaTek MT7621AT - RAM: 128 MB (DDR3) - Flash: 16 MB (SPI NOR) - WiFi: MT7615N (2.4GHz) and MT7615N (5Ghz) - Switch: 1 WAN, 4 LAN (Gigabit) - Buttons: Reset, WiFi Toggle, WPS - LEDs: Power, Internet, WiFi 2.4G WiFi 5G The R1 revision is identical to the A1 revision except - No Config2 Parition, therefore - factory partition resized to 64k from 128K - Firmware partition offset is 0x50000 not 0x60000 - Firmware partitions size increased by 64K - Firmware partition type is "denx,uimage", not "sge,uimage" - Padding of image creation "uimage-padhdr 96" removed Installation: Update to the last D-Link firmware through web-ui before OpenWRT installation then follow the instructions to patch your device using D-Link FailsafeUI. - D-Link FailsafeUI: Power down the router, press and hold the reset button, then re-plug it. Keep the reset button pressed until the internet LED stops flashing, then jack into any lan port and manually assign a static IP address in 192.168.0.0/24 other than 192.168.0.1 (e.g. 192.168.0.2) and go to http://192.168.0.1 Flash with the factory image. Signed-off-by: Igor Nazarov <tigron.dev@gmail.com>
* ramips: add support for Beeline SmartBox FlashMikhail Zhilkin2022-03-196-0/+252
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Beeline SmartBox Flash is a wireless AC1300 (WiFi 5) router manufactured by Arcadyan company. Device specification -------------------- SoC Type: MediaTek MT7621AT RAM: 256 MiB, Winbond W632GU6NB Flash: 128 MiB (NAND), Winbond W29N01HVSINF Wireless 2.4 GHz (MT7615DN): b/g/n, 2x2 Wireless 5 GHz (MT7615DN): a/n/ac, 2x2 Ethernet: 3xGbE (WAN, LAN1, LAN2) USB ports: 1xUSB3.0 Button: 1 (Reset/WPS) LEDs: 1 RGB LED Power: 12 VDC, 1.5 A Connector type: Barrel Bootloader: U-Boot (Ralink UBoot Version: 5.0.0.2) OEM: Arcadyan WE42022 Installation ------------ 1. Place *factory.trx on any web server (192.168.1.2 in this example) 2. Connect to the router using telnet shell (no password required) 3. Save MAC adresses to U-Boot environment: uboot_env --set --name eth2macaddr --value $(ifconfig | grep eth2 | \ awk '{print $5}') uboot_env --set --name eth3macaddr --value $(ifconfig | grep eth3 | \ awk '{print $5}') uboot_env --set --name ra0macaddr --value $(ifconfig | grep ra0 | \ awk '{print $5}') uboot_env --set --name rax0macaddr --value $(ifconfig | grep rax0 | \ awk '{print $5}') 4. Ensure that MACs were saved correctly: uboot_env --get --name eth2macaddr uboot_env --get --name eth3macaddr uboot_env --get --name ra0macaddr uboot_env --get --name rax0macaddr 5. Download and write the OpenWrt images: cd /tmp wget http://192.168.1.2/factory.trx mtd_write erase /dev/mtd4 mtd_write write factory.trx /dev/mtd4 6. Set 1st boot partition and reboot: uboot_env --set --name bootpartition --value 0 reboot Back to Stock ------------- 1. Run in the OpenWrt shell: fw_setenv bootpartition 1 reboot 2. Optional step. Upgrade the stock firmware with any version to overwrite the OpenWrt in Slot 1. MAC addresses ------------- +-----------+-------------------+----------------+ | Interface | MAC | Source | +-----------+-------------------+----------------+ | label | 30:xx:xx:51:xx:09 | No MACs was | | LAN | 30:xx:xx:51:xx:09 | found on Flash | | WAN | 30:xx:xx:51:xx:06 | [1] | | WLAN_2g | 30:xx:xx:51:xx:07 | | | WLAN_5g | 32:xx:xx:41:xx:07 | | +-----------+-------------------+----------------+ [1]: a. Label wasb't found neither in factory nor in other places. b. MAC addresses are stored in encrypted partition "glbcfg". Encryption key hasn't known yet. To ensure the correct MACs in OpenWrt, a hack with saving of the MACs to u-boot-env during the installation was applied. c. Default Ralink ethernet MAC address (00:0C:43:28:80:36) was found in "Factory" 0xfff0. It's the same for all Smartbox Flash devices. OEM firmware also uses this MAC when initialazes ethernet driver. In OpenWrt we use it only as internal GMAC (eth0), all other MACs are unique. Therefore, there is no any barriers to the operation of several Smartbox Flash devices even within the same broadcast domain. Stock firmware image format --------------------------- +--------------+---------------+----------------------------------------+ | Offset | 1.0.15 | Description | +==============+===============+========================================+ | 0x0 | 5d 43 6f 74 | TRX magic "]Cot" | +--------------+---------------+----------------------------------------+ | 0x4 | 00 70 ff 00 | Length (reverse) | +--------------+---------------+----------------------------------------+ | | | htonl(~crc) from 0xc ("flag_version") | | 0x8 | 72 b3 93 16 | to "Length" | +--------------+---------------+----------------------------------------+ | 0xc | 00 00 01 00 | Flags | +--------------+---------------+----------------------------------------+ | | | Offset (reverse) of Kernel partition | | 0x10 | 1c 00 00 00 | from the start of the header | +--------------+---------------+----------------------------------------+ | | | Offset (reverse) of RootFS partition | | 0x14 | 00 00 42 00 | from the start of the header | +--------------+---------------+----------------------------------------+ | 0x18 | 00 00 00 00 | Zeroes | +--------------+---------------+----------------------------------------+ | 0x1c | 27 05 19 56 … | Kernel data + zero padding | +--------------+---------------+----------------------------------------+ | | | RootFS data (starting with "hsqs") + | | 0x420000 | 68 73 71 73 … | zero padding to "Length" | +--------------+---------------+----------------------------------------+ | | | Some signature data (format is | | | | unknown). Necessary for the fw | | "Lenght" | 00 00 00 00 … | update via oem fw web interface. | +--------------+---------------+----------------------------------------+ | "Lenght" + | | TRX magic "HDR0". U-Boot is | | 0x10c | 48 44 52 30 | checking it at every boot. | +--------------+---------------+----------------------------------------+ | | | 1.00: | | | | Zero padding to ("Lenght" + 0x23000) | | | | 1.0.12: | | | | Zero padding to ("Lenght" + 0x2a000) | | "Lenght" + | | 1.0.13, 1.0.15, 1.0.16: | | 0x110 | 00 00 00 00 | Zero padding to ("Lenght" + 0x10000) | +--------------+---------------+----------------------------------------+ Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
* ramips: add support for Netgear WN3100RPv2Rodolphe de Saint Léger2022-03-166-155/+186
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the Netgear WN3100RPv2 http://www.netgear.com/support/product/wn3100rpv2.aspx Specifications: - SoC: MediaTek MT7620A (580MHz, ramips) - RAM: 32MB DDR - Storage: 8MB NOR SPI flash - Wireless: builtin MT7620A, 2x2:2 with u.FL connectors - Ethernet: 1x100M - Stock firmware based on OpenWRT Kamikaze Like the EX2700, the bootloader expects a secondary image signature, see https://forum.openwrt.org/viewtopic.php?pid=312577#p312577 This device seems to be same hardware as a WN3000RPv3 Flash instructions: - Use the Netgear WebUI to upgrade to OpenWRT using the factory image (see note below), - Use the sysupgrade image for upgrading versions from OpenWRT, - TFTP recovery procedure can be used to flash the factory image (preferred method). Note: - The WebUI may not reboot automatically, wait at least 5 minutes before powercycling the device Flashing using TFTP: - Set you IP address to 192.168.1.10/24 (no gateway) - Connect your machine to the Ethernet port - Power off the device and wait for 10 seconds, - Hold the reset button and power on the device (do not release reset), - Hold the reset button until the green light is flashing (Approx. 15s) - launch tftp, set mode to binary and connect to 192.168.1.1 - put the factory firmware image - All leds will switch off (like a power off), this is normal - Wait for the device to reboot in the new OpenWRT image (max 5 mins) - The first boot will take longer than usual. - After boot, the Device IP on the ethernet port is 192.168.1.1 Signed-off-by: Rodolphe de Saint Léger <rdesaintleger@gmail.com> [drop unneeded includes in dts, wrap commit message] Signed-off-by: Sungbo Eo <mans0n@gorani.run>
* Revert "ramips: add support for Netgear WN3000RPv3"Sungbo Eo2022-03-166-186/+155
| | | | | | | | | This reverts commit 7bc20cb6143e089fae6ad4b173fc42b55bdbecfe. It adds support for Netgear WN3100RPv2, but the commit title is wrong. It will be re-added with the correct title. Signed-off-by: Sungbo Eo <mans0n@gorani.run>
* ramips: add support for Netgear WN3000RPv3Rodolphe de Saint Léger2022-03-166-155/+186
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the Netgear WN3100RPv2 http://www.netgear.com/support/product/wn3100rpv2.aspx Specifications: - SoC: MediaTek MT7620A (580MHz, ramips) - RAM: 32MB DDR - Storage: 8MB NOR SPI flash - Wireless: builtin MT7620A, 2x2:2 with u.FL connectors - Ethernet: 1x100M - Stock firmware based on OpenWRT Kamikaze Like the EX2700, the bootloader expects a secondary image signature, see https://forum.openwrt.org/viewtopic.php?pid=312577#p312577 This device seems to be same hardware as a WN3000RPv3 Flash instructions: - Use the Netgear WebUI to upgrade to OpenWRT using the factory image (see note below), - Use the sysupgrade image for upgrading versions from OpenWRT, - TFTP recovery procedure can be used to flash the factory image (preferred method). Note: - The WebUI may not reboot automatically, wait at least 5 minutes before powercycling the device Flashing using TFTP: - Set you IP address to 192.168.1.10/24 (no gateway) - Connect your machine to the Ethernet port - Power off the device and wait for 10 seconds, - Hold the reset button and power on the device (do not release reset), - Hold the reset button until the green light is flashing (Approx. 15s) - launch tftp, set mode to binary and connect to 192.168.1.1 - put the factory firmware image - All leds will switch off (like a power off), this is normal - Wait for the device to reboot in the new OpenWRT image (max 5 mins) - The first boot will take longer than usual. - After boot, the Device IP on the ethernet port is 192.168.1.1 Signed-off-by: Rodolphe de Saint Léger <rdesaintleger@gmail.com> [drop unneeded includes in dts, wrap commit message] Signed-off-by: Sungbo Eo <mans0n@gorani.run>
* ramips: mt7620: Add support for D-Link DWR-961 A1Pawel Dembicki2022-03-168-172/+273
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DWR-961 A1 Wireless Router is based on the MT7620A SoC. It's a merge of two Amit boards: DWR-960 with ethernet part of Lava LR-25G001. ROMID it's taken from Telenor branded version and it works with tested device. Images from D-Link site for this router are from DWR-953 and it have ROMID DLK6E2424001. I don't know if it's mistake on web-site or if it's will require different image. Specification: - MediaTek MT7620A (580 Mhz) - 128 MB of RAM - 16 MB of FLASH - 1x 802.11bgn radio - 1x 802.11ac radio (MT7612 mpcie card) - 5x 10/100/1000 Mbps Ethernet: 4xLAN and 1xWAN (QCA8337) - 2x internal, non-detachable antennas (Wifi 2.4G) - 3x external, detachable antennas (2x LTE, 1x Wifi 5G) - 1x LTE modem cat 6 - UART (J5) header on PCB (57600 8n1) - 13x LED, 2x button - JBOOT bootloader Installation: Apply factory image via http web-gui or JBOOT recovery page How to revert to OEM firmware: - push the reset button and turn on the power. Wait until LED start blinking (~10sec.) - upload original factory image via JBOOT http (IP: 192.168.123.254) Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
* ramips: Apply pinctrl DTS changes to TL-WPA8631PJoe Mullally2022-03-131-9/+13
| | | | | | | | | Applies changes from 7774b86019 to new device committed later. Fix some whitespace in the DTS. Use standard model name format in DTS. Fixes: 6c743c3006f9 ("ramips: Add support for TP-Link TL-WPA8631P v3") Signed-off-by: Joe Mullally <jwmullally@gmail.com> Reported-by: Arınç ÜNAL <arinc.unal@arinc9.com>
* ramips: update WLAN MAC address of JCG Y2Chukun Pan2022-03-131-0/+4
| | | | | | | | MAC addresses on OEM firmware: 04:xx:xx:xx:xx:c8 factory 0x4 wlan2g 06:xx:xx:xx:xx:c8 [not on flash] wlan5g Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
* ramips: update WLAN MAC address of Phicomm K2PChukun Pan2022-03-132-2/+13
| | | | | | | The wireless mac address difference of this machine is similar to that of D-Link DIR-853-R1, so use the same practice. Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
* ramips: Add support for Dual-Q H721Dawsen Gao2022-03-132-0/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Dual-Q H721 is a router platform board, it is the smaller model of the U7621-06. The device has the following specifications: MT7621AT (880 MHz) 256 of RAM (DDR3) 16 MB of FLASH (MX25l12805d SPI) 5x 1 Gbps Ethernet (MT7621 built-in switch) 1x M.2 (NGFF) 3.7V 3A max for 5G M.2 Modem work at USB3.0 mode 1x Minipcie 3.7V 3A max for LTE Modem work at USB2.0 Mode 2x Minipcie for WIFI card 4x Lan+1x Wan 10/100M/1000M RJ45 port 14x LEDs (1x GPIO-controlled) 1x reset button 1x UART header (4-pins) 1x mico SD-card reader 1x DC jack for main power (5~27 V) The following has been tested and is working: Ethernet switch miniPCIe slots (tested with Wi-Fi cards and LTE modem cards) miniSIM slot (works with normal size simcard) sysupgrade reset button micro SD-card reader Installation: This board has no locked down bootloader. The seller can be asked to install openwrt, so upgrades are standard sysupgrade method. Recovery: This board contains a Chinese, closed-source bootloader called Breed (Boot and Recovery Environment for Embedded Devices). Breed supports web recovery and to enter it, you keep the reset button pressed for around 5 seconds during boot. Your machine will be assigned an IP through DHCP and the router will use IP address 192.168.1.1. The recovery website is in Chinese, but is easy to use. Click on the second item in the list to access the recovery page, then the second item on the next page is where you select the firmware. In order to start the recovery, you click the button at the bottom. Signed-off-by: Dawsen Gao <dawsen_gao@163.com> [change author name (used SoB one), add ethernet pinctrl, apply sorting to device recipe] Signed-off-by: Sungbo Eo <mans0n@gorani.run>
* ramips: allow USB power control on TP-Link MR3020v3Dmitry Chigiryov2022-03-091-1/+12
| | | | | | | | | | | | | By switching EPHY_LED4_N_JTRST_N from EPHY_LED4_N to GPIO#39 we can control USB port power an all current revisions of MR3020v3. It was not a thing on some first revisions, pin was unused. But for now on all current MR3020v3 boards EPHY_LED4_N_JTRST_N pin is connected to USB power key. Also it was not used as EPHY indicator on any revision of the board. Signed-off-by: Dmitry Chigiryov <dmitry.chigiryov@ya.ru> [changed author address (used SoB one)] Signed-off-by: Sungbo Eo <mans0n@gorani.run>
* ramips: fix DEVICE_VENDOR for unbranded devicesSungbo Eo2022-03-095-9/+9
| | | | | | | | | | | | | | | In commit ee66fe4ea9a6 ("ramips: convert DEVICE_TITLE to new variables"), DEVICE_VENDOR of some unbranded devices were set incorrectly: * WR512-3GN is not a dev board from Ralink. * "XDX-RN502J" is the whole model name and should be not split. This patch sets their DEVICE_VENDOR to "Unbranded", and changes their DTS model properties accordingly. Ref: d0bf15f23595 ("ramips: add support for A5-V11 board (resubmit)") Ref: 9085b05d9e71 ("ramips: rt305x: support for wr512-3gn-like routers") Ref: 0e486d2fd297 ("ramips: add support for unbranded XDX-RN502J board") Signed-off-by: Sungbo Eo <mans0n@gorani.run>
* ramips: mt7621: add support for Zbtlink ZBT-WG1608Kim Namu2022-03-094-0/+259
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Zbtlink ZBT-WG1608 is a Wi-Fi router intendent to use with WWAN (4G/5G) modems. Specifications: * SoC: MediaTek MT7621A * RAM: 256/512 MiB * Flash: 16/32 MiB (SPI NOR) * Wi-Fi: * MediaTek MT7603E : 2.4Ghz * MediaTek MT7613BE : 5Ghz * Ethernet: 10/100/1000 Mbps Ethernet x5 ports (4xLAN + WAN) * M.2: 1x slot with USB&SIM * EM7455/EM12-G/EM160R/RM500Q-AE * USB: 1x 3.0 Type-A port * External storage: 1x microSD (SDXC) slot * UART: console (115200 baud) * LED: * 1 power indicator * 1 WLAN 2.4G controlled (wlan 2G) * 3 SoC controlled (wlan 5G, wwan, internet) * 5 per Eth phy (4xLAN + WAN) MAC Addresses: * LAN : f8:5e:3c:xx:xx:e0 (Factory, 0xe000 (hex)) * WAN : f8:5e:3c:xx:xx:e1 (Factory, 0xe006 (hex)) * 2.4 GHz: f8:5e:3c:xx:xx:de (Factory, 0x0004 (hex)) * 5 GHz : f8:5e:3c:xx:xx:df (Factory, 0x8004 (hex)) Installation: * Vendor's firmware is OpenWrt (LEDE) based, so the sysupgrade image can be directly used to install OpenWrt. Firmware must be upgraded using the 'force' and 'do not save configuration' command line options (or correspondig web interface checkboxes) since the vendor firmware is from the pre-DSA era. Recovery Mode: * Press reset button, power up the device, wait for about 10sec. * Upload sysupgrade image through the firmware recovery mode web page at 192.168.1.1. Signed-off-by: Kim Namu <namu@theseed.io>
* ramips: add support for Asus RT-AC1200Ray Wang2022-03-093-26/+194
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Asus RT-AC1200 is a 2.4/5GHz dual band AC router, based on MediaTek MT7628AN. Specification: * SoC: MT7628AN * RAM: DDR2 64 MiB * Flash: 16 MiB NOR (W25Q128BV) * Wi-Fi: * 2.4GHz: SoC Built-in * 5GHz: MT7612EN * Ethernet: 5x 100Mbps * Switch: SoC built-in * USB: 1x 2.0 Flash Layout: 0x0000000-0x0030000 : "bootloader" 0x0030000-0x0040000 : "nvram" 0x0040000-0x0050000 : "factory" 0x0050000-0x1000000 : "firmware" MAC address: LAN: factory 0x28 WAN: factory 0x22 2.4G: factory 0x4 5G: factory 0x8004 Installation via **recovery** mode: 1. Download the Asus recovery firmware (windows) tool from http://dlcdnet.asus.com/pub/ASUS/LiveUpdate/Release/Wireless/Rescue.zip 2. Set your ethernet IP manually 192.168.1.5 / 255.255.255.0 with NO gateway. 3. Plug in your ethernet to LAN port 1 on the router. 4. Load up the recovery software with the firmware file, but don't press "Upload" yet. 5. Plug in the router to power WHILE HOLDING the reset button in. While CONTINUING to hold the button, select "Upload" Continue to hold the reset button in until it finishes and verifies! 6. If that doesn't work try pressing "Upload" first just before you do step 5. At some point while holding reset the rescue tool will finally detect and upload the firmware. That's when you can let go of the reset button. 7. The router will reboot and not much will happen. Wait a minute or 2. 8. Power off and on the router again. Voila. Set everything your Ethernet IP back to DHCP (automatically) and you're good to go. Revert to stock firmware: 1. Install stock image via recovery mode. Tested-by: Ivan Pavlov <AuthorReflex@gmail.com> Signed-off-by: Ray Wang <raywang777@foxmail.com>
* ramips: add support for Renkforce WS-WN530HP3-ABirger Koblitz2022-03-083-0/+171
| | | | | | | | | | | | | | | | | | | | | | | | | This adds support for the Renkforce WS-WN530HP3-A ceiling- mountable Wireless Access Point, which is powered over PoE. Hardware: - SoC: Mediatek MT7621DAT - RAM: 128MiB on SoC - Flash: 16MiB GigaDevice GD25Q128C - 2.4Ghz Wifi: Mediatek MT603EN - 5GHz Wifi: MT613BEN - Ethernet: - 1x 1GBit WAN port, passive PoE capable - 2x 1GBit LAN ports LEDs: 1x Bi-Color LED (red/blue) Buttons: 1x Reset Button, 1x Power Button Installation: Power on the access point and immedately press the reset button for 10 seconds. Connect web-browser to 192.168.10.1 and upload sysupgrade image. Flash uploaded image and wait about 2 minutes for reboot. Signed-off-by: Birger Koblitz <mail@birger-koblitz.de> Signed-off-by: Petr Štetiar <ynezz@true.cz> [fixed SoB]
* ramips: use parser_trx for Buffalo WCR-1166DSINAGAKI Hiroshi2022-03-062-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Buffalo WCR-1166DS uses trx-fomatted firmware and the custom magic number (0x5C436F74, "\Cot") is required for OpenWrt installation from OEM WebUI. But the current mtdsplit_trx doesn't support the custom magic number and fail to parse and split to kernel and rootfs when the factory image is flashed. Then, the kernel fails to mount rootfs automatically and panics. Before the commit fddc78bc116bc043fb5cd92dbc45cfd054c21af8, mtdsplit_trx was patched in ramips target and the device-specific magic number was supported only for WCR-1166DS[1]. But the patch was not inherited to the later version of the kernel and deleted by the above commit, then, the custom magic number support was broken. [1]: https://github.com/openwrt/openwrt/blob/05d6e92594c507dcd1f4be6c1bcb2282fe1abe1f/target/linux/ramips/patches-4.4/0400-mtd-mtdsplit-add-support-for-custom-trx-magic-for-Buffalo-WCR-1166DS.patch#L27 log (factory image): [ 1.165312] spi-mt7621 10000b00.spi: sys_freq: 193333333 [ 1.195782] spi-nor spi0.0: w25q128 (16384 Kbytes) [ 1.205353] 7 fixed-partitions partitions found on MTD device spi0.0 [ 1.217938] Creating 7 MTD partitions on "spi0.0": [ 1.227436] 0x000000000000-0x000000030000 : "u-boot" [ 1.238427] 0x000000030000-0x000000040000 : "u-boot-env" [ 1.250123] 0x000000040000-0x000000050000 : "factory" [ 1.261306] 0x000000050000-0x000000810000 : "firmware" [ 1.282051] 0x000000810000-0x000000fd0000 : "firmware2" [ 1.293594] 0x000000fd0000-0x000000fe0000 : "glbcfg" [ 1.304719] 0x000000fe0000-0x000000ff0000 : "board_data" ... [ 1.452424] /dev/root: Can't open blockdev [ 1.460619] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6 [ 1.475434] Please append a correct "root=" boot option; here are the available partitions: [ 1.491986] 1f00 192 mtdblock0 [ 1.491989] (driver?) [ 1.504938] 1f01 64 mtdblock1 [ 1.504941] (driver?) [ 1.517885] 1f02 64 mtdblock2 [ 1.517888] (driver?) [ 1.530831] 1f03 7936 mtdblock3 [ 1.530834] (driver?) [ 1.543777] 1f04 7936 mtdblock4 [ 1.543781] (driver?) [ 1.556724] 1f05 64 mtdblock5 [ 1.556727] (driver?) [ 1.569672] 1f06 64 mtdblock6 [ 1.569675] (driver?) [ 1.582617] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) [ 1.598976] Rebooting in 1 seconds.. This patch fixes this issue by using parser_trx with specifying custom magic number in dts instead of mtdsplit_trx. log (fixed factory image): [ 1.202044] spi-mt7621 10000b00.spi: sys_freq: 193333333 [ 1.225369] spi-nor spi0.0: w25q128 (16384 Kbytes) [ 1.235015] 7 fixed-partitions partitions found on MTD device spi0.0 [ 1.247603] Creating 7 MTD partitions on "spi0.0": [ 1.257106] 0x000000000000-0x000000030000 : "u-boot" [ 1.269447] 0x000000030000-0x000000040000 : "u-boot-env" [ 1.281192] 0x000000040000-0x000000050000 : "factory" [ 1.294208] 0x000000050000-0x000000810000 : "firmware" [ 1.305774] 2 trx partitions found on MTD device firmware [ 1.316540] Creating 2 MTD partitions on "firmware": [ 1.326399] 0x00000000001c-0x000000214754 : "linux" [ 1.336063] mtd: partition "linux" doesn't start on an erase/write block boundary -- force read-only [ 1.357070] 0x000000214754-0x0000007c0000 : "rootfs" [ 1.366994] mtd: partition "rootfs" doesn't start on an erase/write block boundary -- force read-only [ 1.386368] mtd: device 5 (rootfs) set to be root filesystem [ 1.398700] 1 squashfs-split partitions found on MTD device rootfs [ 1.411027] 0x000000520000-0x0000007c0000 : "rootfs_data" [ 1.422841] 0x000000810000-0x000000fd0000 : "firmware2" [ 1.436282] 0x000000fd0000-0x000000fe0000 : "glbcfg" [ 1.447408] 0x000000fe0000-0x000000ff0000 : "board_data" ... [ 1.611216] VFS: Mounted root (squashfs filesystem) readonly on device 31:5. Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
* ramips: switch parser of trx for mt76x8 subtargetINAGAKI Hiroshi2022-03-061-1/+1
| | | | | | | | | | This patch enable parser_trx and disable mtdsplit_trx for mt76x8 subtarget. The trx format is used only on Buffalo WCR-1166DS in mt76x8 subtarget and the parser need to be switched to parser_trx to use the custom magic number in the header for WCR-1166DS. Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
* ramips: update MAC address configuration for Buffalo WCR-1166DSINAGAKI Hiroshi2022-03-061-2/+2
| | | | | | | | This patch converts MAC address configuration of Buffalo WCR-1166DS in 02_network to use the generic function of OpenWrt. And also, add label_mac. Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
* ramips: increase spi frequency for Buffalo WCR-1166DSINAGAKI Hiroshi2022-03-061-1/+1
| | | | | | | Use higher frequency than current and up the speed to access to the flash on WCR-1166DS. Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
* ramips: Add support for TP-Link TL-WPA8631P v3Joe Mullally2022-03-064-0/+217
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AV1300 Gigabit Passthrough Powerline ac Wi-Fi Extender Specifications -------------- * SoC: MediaTek MT7621AT * CPU: 880 MHz MIPS 1004KEc dual-core CPU * RAM: 64 MiB DDR2 (Zentel A3R12E40DBF-8E) * Flash: 8 MiB SPI NOR (GigaDevice GD25Q64CSIG) * Ethernet: SoC built-in Switch 5x 1GbE * Port 0: PLC (connected through AR8035-A) * Port 1-3: LAN * WLAN: 2x2 2.4GHz 300 Mbps + 2x2 5GHz 867 Mbps (MT7603EN + MT7613BEN) * PLC: HomePlug AV2 (Qualcomm QCA7500) * PLC Flash: 2MiB SPI NOR (GigaDevice GD25Q16CSIG) * Buttons: Reset, LED, Pair, Wi-Fi * LEDs: Power (green), PLC (green/amber), LAN (green), 2.4G (green), 5G (green) * UART: J1 (57600 baud) * Pinout: (3V3) (GND) (RX) (TX) * Visually identify GND from connection to PCB ground plane Installation ------------ Installation is possible from the OEM web interface. Make sure to install the latest OEM firmware first, so that the PLC firmware is at the latest version. However, please first check the OpenWRT Wiki page for confirmation that your OEM firmware version is supported. Signed-off-by: Joe Mullally <jwmullally@gmail.com>
* kernel: bump 5.10 to 5.10.102John Audia2022-03-011-1/+1
| | | | | | | | | | | | | | | Removed upstreamed: bcm4908/patches-5.10/180-i2c-brcmstb-fix-support-for-DSL-and-CM-variants.patch[1] All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.102&id=f333c1916fd6b55900029bf8f918cc00009e2111 Build system: x86_64 Build-tested: bcm2711/RPi4B, mt7622/RT3200 Run-tested: bcm2711/RPi4B, mt7622/RT3200 Signed-off-by: John Audia <graysky@archlinux.us>
* mt7620: fix missing kernel config symbolPetr Štetiar2022-02-281-0/+1
| | | | | | | | | | | Fixes following missing kernel config symbol after adding GPIO watchdog: Software watchdog (SOFT_WATCHDOG) [M/n/y/?] m Watchdog device controlled through GPIO-line (GPIO_WATCHDOG) [Y/n/m/?] y Register the watchdog as early as possible (GPIO_WATCHDOG_ARCH_INITCALL) [N/y/?] (NEW) Fixes: 1a97c03d864e ("rampis: feed zbt-we1026 external watchdog") Signed-off-by: Petr Štetiar <ynezz@true.cz>
* rampis: feed zbt-we1026 external watchdogArvid E. Picciani2022-02-282-0/+9
| | | | | | Without feeding the gpio watchdog, the board will reset after 90 seconds Signed-off-by: Arvid E. Picciani <aep@exys.org>
* ramips: support TP-Link EAP615-WallStijn Tintel2022-02-273-1/+209
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for the TP-Link EAP615-Wall, an AX1800 Wall Plate WiFi 6 AP. The device is very similar to the TP-Link EAP235-Wall. Hardware: * SoC: MediaTek MT7621AT * RAM: 128MiB * Flash: 16MiB SPI-NOR * Ethernet: 4x GbE * Back: ETH0 (PoE-PD) * Bottom: ETH1, ETH2, ETH3 (PoE passthrough) * WiFi: MT7905DAN/MT7975DN 2.4/5 GHz 2T2R * LEDS: 1x white * Buttons: 1x LED, 1x reset Stock firmware uses a random MAC address for ethernet. OpenWrt uses the MAC address that is on the device label for ethernet and the wireless interfaces. MAC address must not be incremented, as this will cause MAC address conflicts in case you have two devices with consecutive MAC addresses. Instead, different locally administered addresses will be generated automatically, based on the MAC on the label. Installation via stock firmware: * Enable SSH in the TP-Link web interface * SSH to the device * Run `cliclientd stopcs` * Upload the OpenWrt factory image via the TP-Link web interface Installation via bootloader: * Solder TTL header. Pinout: 1: TX, 2: RX, 3: GND, 4: VCC, with pin 1 closest to ETH1. Baud rate 115200 * Interrupt boot process by holding a key during boot * Boot the OpenWrt initramfs: # tftpboot 0x84000000 openwrt-ramips-mt7621-tplink_eap615-wall-v1-initramfs-kernel.bin # bootm * Copy openwrt-ramips-mt7621-tplink_eap615-wall-v1-squashfs-sysupgrade.bin to /tmp and use sysupgrade to install it Thanks to Sander Vanheule for his work on the EAP235-Wall, which made adding support for the EAP615-Wall very easy. Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be> Reviewed-by: Sander Vanheule <sander@svanheule.net> Acked-by: Arınç ÜNAL <arinc.unal@arinc9.com>
* ramips: mt7621-dts: add pinctrl properties for ethernetArınç ÜNAL2022-02-2627-1/+108
| | | | | | | | | | | | | | | Add the missing pinctrl properties on the ethernet node. GMAC1 will start working with this change. Link: https://lore.kernel.org/netdev/83a35aa3-6cb8-2bc4-2ff4-64278bbcd8c8@arinc9.com/ Overwrite pinctrl-0 property without rgmii2_pins on devicetrees which use the rgmii2 pins as GPIO (22 - 33). Give gpio function to rgmii2 pin group on mt7621_tplink_archer-x6-v3.dtsi which uses GPIO 28. Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
* ramips: mt7621-dts: enable flow control on port@6Arınç ÜNAL2022-02-261-0/+1
| | | | | | | | Flow control needs to be enabled on both sides to work. It is already enabled on gmac0, enable it on port@6 too. Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com> Tested-by: Sungbo Eo <mans0n@gorani.run>
* ramips: mt7621-dts: fix switch@1f warningsArınç ÜNAL2022-02-261-3/+0
| | | | | | | | | | | | | Remove reg property from ports node to fix this warning: Warning (unit_address_vs_reg): /ethernet@1e100000/mdio-bus/switch@1f/ports: node has a reg or ranges property, but no unit name Another warning surfaces afterwards. Remove #address-cells and #size-cells from switch@1f node to fix this warning: Warning (avoid_unnecessary_addr_size): /ethernet@1e100000/mdio-bus/switch@1f: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
* ramips: clean up Makefile formattingNick McKinney2022-02-201-6/+6
| | | | | | | | | Use correct indent in target/linux/ramips/image/mt7621.mk to be consistent with the rest of the file. Signed-off-by: Nick McKinney <nick@ndmckinney.net> [rephrase commit message as Adrian suggested, fix a6004ns-m indent] Signed-off-by: Sungbo Eo <mans0n@gorani.run>
* ramips: mt7621: print size of factory initramfs-image if it's too bigSven Roederer2022-02-201-2/+2
| | | | | | | It's helpful to know the current and maximal size of the imagefiles if the creation fails. Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
* ramips: add support for ipTIME A3002MESHYoonji Park2022-02-204-0/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for ipTIME A3002MESH. Hardware: - SoC: MediaTek MT7621AT (880MHz, Duel-Core) - RAM: DDR3 128MB - Flash: XMC XM25QH128AHIG (SPI-NOR 16MB) - WiFi: MediaTek MT7615D (2.4GHz, 5GHz, DBDC) - Ethernet: MediaTek MT7530 (WAN x1, LAN x2, SoC built-in) - UART: [GND, RX, TX, 3.3V] (57600 8N1, J4) MAC addresses: | interface | MAC | source | comment |-----------|-------------------|----------------|---------- | LAN | 70:XX:XX:5X:XX:X3 | | | WAN | 70:XX:XX:5X:XX:X1 | u-boot 0x1fc40 | | WLAN 2G | 72:XX:XX:4X:XX:X0 | | | WLAN 5G | 70:XX:XX:5X:XX:X0 | factory 0x4 | | | 70:XX:XX:5X:XX:X0 | u-boot 0x1fc20 | unknown | | 70:XX:XX:5X:XX:X2 | factory 0x8004 | unknown - WLAN 2G MAC address is not the same as stock firmware since OpenWrt uses LAN MAC address with local bit sets. Installation: 1. Flash initramfs image. This can be done using stock web ui or TFTP 2. Connect to OpenWrt with an SSH connection to 192.168.1.1 3. Perform sysupgrade with sysupgrade image Revert to stock firmware: - Flash stock firmware via OEM TFTP Recovery mode - Perform sysupgrade with stock image 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> [wrap/rephrase commit message] Signed-off-by: Sungbo Eo <mans0n@gorani.run>
* Revert "ramips: increase spi-max-frequency for ipTIME mt7620 devices"Sungbo Eo2022-02-201-1/+1
| | | | | | | | | | | | | | | | | | | | This reverts commit 13a185bf8acb67da4a68873e560876c0e60b1a87. There was a report that one A1004ns device fails to detect its flash chip correctly: [ 1.470297] spi-nor spi0.0: unrecognized JEDEC id bytes: e0 10 0c 40 10 08 [ 1.484110] spi-nor: probe of spi0.0 failed with error -2 It also uses a different flash chip model: * in my hand: Winbond W25Q128FVSIG (SOIC-8) * reported: Macronix MX25L12845EMI-10G (SOP-16) Reducing spi-max-frequency solved the detection failure. Hence revert. Reported-by: Koasing <koasing@gmail.com> Tested-by: Koasing <koasing@gmail.com> Signed-off-by: Sungbo Eo <mans0n@gorani.run>
* ramips: add Ubiquiti EdgePoint R6 as alt nameNick Hainke2022-02-191-0/+2
| | | | | | | | | | | The Ubiquiti EdgePoint R6 is identical to the EdgeRouter X SFP. However, it fits well into outdoor environments due to its water-proven case. More specifications: 9715beb04c74 ("ramips: add support for Ubiquiti EdgeRouter X-SFP") Signed-off-by: Nick Hainke <vincent@systemli.org>
* ramips: fix NAND flash driver ECC bit position maskFelix Fietkau2022-02-161-1/+1
| | | | | | | | The bit position mask was accidentally made too wide, overlapping with the LSB from the byte position mask. This caused ECC calculation to fail for odd bytes Signed-off-by: Chad Monroe <chad.monroe@smartrg.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* ramips: mt7621: do memory detection on KSEG1Chuanhong Guo2022-02-141-0/+58
| | | | | | | | | | | | | | | | | | | | It's reported that current memory detection code occasionally detects larger memory under some bootloaders. Current memory detection code tests whether address space wraps around on KSEG0, which is unreliable because it's cached. Rewrite memory size detection to perform the same test on KSEG1 instead. While at it, this patch also does the following two things: 1. use a fixed pattern instead of a random function pointer as the magic value. 2. add an additional memory write and a second comparison as part of the test to prevent possible smaller memory detection result due to leftover values in memory. Fixes: 6d91ddf517 ("ramips: mt7621: add support for memory detection") Reported-by: Rui Salvaterra <rsalvaterra@gmail.com> Tested-by: Rui Salvaterra <rsalvaterra@gmail.com> Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
* kernel: bump 5.10 to 5.10.98John Audia2022-02-111-4/+4
| | | | | | | | | | | | | Manually rebased: bcm27xx/patches-5.10/950-0675-drm-vc4-hdmi-Drop-devm-interrupt-handler-for-CEC-int.patch All other patches automatically rebased. Build system: x86_64 Build-tested: bcm2711/RPi4B, mt7622/RT3200 Run-tested: bcm2711/RPi4B, mt7622/RT3200 Signed-off-by: John Audia <graysky@archlinux.us>
* ramips: add support for ELECOM WRC-2533GS2INAGAKI Hiroshi2022-02-112-0/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ELECOM WRC-2533GS2 is a 2.4/5 GHz band 11ac (Wi-Fi 5) router, based on MT7621A. Specification: - SoC : MediaTek MT7621A - RAM : DDR3 128 MiB (NT5CC64M16GP-DI) - Flash : SPI-NOR 16 MiB (MX25L12835FM2I-10G) - WLAN : 2.4/5GHz 4T4R (2x MediaTek MT7615) - Ethernet : 10/100/1000 Mbps x5 - Switch : MediaTek MT7530 (SoC) - LEDs/Keys : 4x/6x (2x buttons, 1x slide-switch) - UART : through-hole on PCB - J4: 3.3V, GND, TX, RX from ethernet port side - 57600n8 - Power : 12 VDC, 1.5 A Flash instruction using factory image: 1. Boot WRC-2533GS2 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:FB (Factory, 0xFFF4 (hex)) WAN : 04:AB:18:xx:xx:FC (Factory, 0xFFFA (hex)) 2.4 GHz : 04:AB:18:xx:xx:FD (Factory, 0x4 (hex)) 5 GHz : 04:AB:18:xx:xx:FE (Factory, 0x8004 (hex)) Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
* ramips: move MAC configs to device dts from wrc-gs-2pci.dtsiINAGAKI Hiroshi2022-02-117-24/+144
| | | | | | | | | | | | | | | | | | | | | | The locations of MAC addresses in mtd for LAN/WAN on ELECOM WRC-2533GS2 are changed from the other WRC-GS/GST devices with 2x PCIe. So move the related configurations in mt7621_elecom_wrc-gs-2pci.dtsi to dts of each model. - WRC-1750GS - WRC-1750GSV - WRC-1750GST2 - WRC-1900GST - WRC-2533GST - WRC-2533GST2 -> LAN: 0xE000, WAN: 0xE006 - WRC-2533GS2 -> LAN: 0xFFF4, WAN: 0xFFFA Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
* ramips: update WLAN MAC address of ipTIME A3004TSungbo Eo2022-02-111-0/+6
| | | | | | | | | | | | | | | | Reported MAC addresses: | interface | MAC address | source | comment |-----------|-------------------|----------------|--------- | LAN | 90:xx:xx:18:xx:1F | | [1] | WAN | 90:xx:xx:18:xx:1D | | | WLAN 2G | 92:xx:xx:48:xx:1C | | | WLAN 5G | 90:xx:xx:18:xx:1C | factory 0x4 | | | 90:xx:xx:18:xx:1C | config ethaddr | [1] Used in this patch as WLAN 2G MAC address with the local bit set Signed-off-by: Sungbo Eo <mans0n@gorani.run>
* ramips: add support for ipTIME AX2004MSungbo Eo2022-02-114-0/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ipTIME AX2004M is an 802.11ax (Wi-Fi 6) router, based on MediaTek MT7621A. Specifications: * SoC: MT7621A * RAM: 256 MiB * Flash: NAND 128 MiB * Wi-Fi: * MT7915D: 2.4/5 GHz (DBDC) * Ethernet: 5x 1GbE * Switch: SoC built-in * USB: 1x 3.0 * UART: J4 (115200 baud) * Pinout: [3V3] (TXD) (RXD) (GND) MAC addresses: | interface | MAC address | source | comment |-----------|-------------------|----------------|--------- | LAN | 58:xx:xx:00:xx:9B | | [1] | WAN | 58:xx:xx:00:xx:99 | | | WLAN 2G | 58:xx:xx:00:xx:98 | factory 0x4 | | WLAN 5G | 5A:xx:xx:40:xx:98 | | | | 58:xx:xx:00:xx:98 | config ethaddr | [1] Used in this patch as WLAN 5G MAC address with the local bit set Load addresses: * stock * 0x80010000: FIT image * 0x81001000: kernel image -> entry * OpenWrt * 0x80010000: FIT image * 0x82000000: uncompressed kernel+relocate image * 0x80001000: relocated kernel image -> entry Notes: * This device has a dual-boot partition scheme, but this firmware works only on boot partition 1. The stock web interface will flash only on the inactive boot partition, but the recovery web page will always flash on boot partition 1. Installation via recovery mode: 1. Press reset button, power up the device, wait >10s for CPU LED to stop blinking. 2. Upload recovery image through the recovery web page at 192.168.0.1. Revert to stock firmware: 1. Install stock image via recovery mode. Signed-off-by: Sungbo Eo <mans0n@gorani.run>
* kernel: backport MT7530 IRQ supportDENG Qingfang2022-02-101-0/+3
| | | | | | | | | | | Support MT7530 PHY link change interrupts, and enable for MT7621. For external MT7530, a GPIO IRQ line is required, which is board-specific, so it should be added to each DTS. In case the interrupt-controller property is missing, it will fall back to polling mode. Signed-off-by: DENG Qingfang <dqfext@gmail.com>
* kernel: backport MediaTek Ethernet PHY driverDENG Qingfang2022-02-091-0/+1
| | | | | | | | | | | | | | Add support for MediaTek Gigabit Ethernet PHYs found in MT7530 and MT7531. Fix some link up/down issues. The errornous check for the PHY mode which broke things with MT7531 has been removed as suggested by patch net: phy: mediatek: remove PHY mode check on MT7531 As a result, things are working fine now on MT7622+MT7531 as well. Signed-off-by: DENG Qingfang <dqfext@gmail.com> Tested-by: Daniel Golle <daniel@makrotopia.org> Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com> Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
* ramips: move KERNEL_LOADADDR into Device/DefaultSungbo Eo2022-02-081-1/+1
| | | | | | | | | | | | Commit f4a79148f8cb ("ramips: add support for ipTIME AX2004M") was reverted due to KERNEL_LOADADDR leakage, and it seems the problem can be mitigated by moving the variable definition into Device/Default. By this, KERNEL_LOADADDR redefined in a device recipe will not be leaked into the subsequent device recipes anymore and thus will remain as a per-device variable. Ref: cd6a6e3030ff ("Revert "ramips: add support for ipTIME AX2004M"") Signed-off-by: Sungbo Eo <mans0n@gorani.run>
* ramips: add support for Xiaomi Mi Router CR660x seriesRaymond Wang2022-02-078-0/+261
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Xiaomi Mi Router CR6606 is a Wi-Fi6 AX1800 Router with 4 GbE Ports. Alongside the general model, it has three carrier customized models: CR6606 (China Unicom), CR6608 (China Mobile), CR6609 (China Telecom) Specifications: - SoC: MediaTek MT7621AT - RAM: 256MB DDR3 (ESMT M15T2G16128A) - Flash: 128MB NAND (ESMT F59L1G81MB) - Ethernet: 1000Base-T x4 (MT7530 SoC) - WLAN: 2x2 2.4GHz 574Mbps + 2x2 5GHz 1201Mbps (MT7905DAN + MT7975DN) - LEDs: System (Blue, Yellow), Internet (Blue, Yellow) - Buttons: Reset, WPS - UART: through-hole on PCB ([VCC 3.3v](RX)(GND)(TX) 115200, 8n1) - Power: 12VDC, 1A Jailbreak Notes: 1. Get shell access. 1.1. Get yourself a wireless router that runs OpenWrt already. 1.2. On the OpenWrt router: 1.2.1. Access its console. 1.2.2. Create and edit /usr/lib/lua/luci/controller/admin/xqsystem.lua with the following code (exclude backquotes and line no.): ``` 1 module("luci.controller.admin.xqsystem", package.seeall) 2 3 function index() 4 local page = node("api") 5 page.target = firstchild() 6 page.title = ("") 7 page.order = 100 8 page.index = true 9 page = node("api","xqsystem") 10 page.target = firstchild() 11 page.title = ("") 12 page.order = 100 13 page.index = true 14 entry({"api", "xqsystem", "token"}, call("getToken"), (""), 103, 0x08) 15 end 16 17 local LuciHttp = require("luci.http") 18 19 function getToken() 20 local result = {} 21 result["code"] = 0 22 result["token"] = "; nvram set ssh_en=1; nvram commit; sed -i 's/channel=.*/channel=\"debug\"/g' /etc/init.d/dropbear; /etc/init.d/drop bear start;" 23 LuciHttp.write_json(result) 24 end ``` 1.2.3. Browse http://{OWRT_ADDR}/cgi-bin/luci/api/xqsystem/token It should give you a respond like this: {"code":0,"token":"; nvram set ssh_en=1; nvram commit; ..."} If so, continue; Otherwise, check the file, reboot the rout- er, try again. 1.2.4. Set wireless network interface's IP to 169.254.31.1, turn off DHCP of wireless interface's zone. 1.2.5. Connect to the router wirelessly, manually set your access device's IP to 169.254.31.3, make sure http://169.254.31.1/cgi-bin/luci/api/xqsystem/token still have a similar result as 1.2.3 shows. 1.3. On the Xiaomi CR660x: 1.3.1. Login to the web interface. Your would be directed to a page with URL like this: http://{ROUTER_ADDR}/cgi-bin/luci/;stok={STOK}/web/home#r- outer 1.3.2. Browse this URL with {STOK} from 1.3.1, {WIFI_NAME} {PASSWORD} be your OpenWrt router's SSID and password: http://{MIROUTER_ADDR}/cgi-bin/luci/;stok={STOK}/api/misy- stem/extendwifi_connect?ssid={WIFI_NAME}&password={PASSWO- RD} It should return 0. 1.3.3. Browse this URL with {STOK} from 1.3.1: http://{MIROUTER_ADDR}/cgi-bin/luci/;stok={STOK}/api/xqsy- stem/oneclick_get_remote_token?username=xxx&password=xxx&- nonce=xxx 1.4. Before rebooting, you can now access your CR660x via SSH. For CR6606, you can calculate your root password by this project: https://github.com/wfjsw/xiaoqiang-root-password, or at https://www.oxygen7.cn/miwifi. The root password for carrier-specific models should be the admi- nistration password or the default login password on the label. It is also feasible to change the root password at the same time by modifying the script from step 1.2.2. You can treat OpenWrt Router however you like from this point as long as you don't mind go through this again if you have to expl- oit it again. If you do have to and left your OpenWrt router unt- ouched, start from 1.3. 2. There's no official binary firmware available, and if you lose the content of your flash, no one except Xiaomi can help you. Dump these partitions in case you need them: "Bootloader" "Nvram" "Bdata" "crash" "crash_log" "firmware" "firmware1" "overlay" "obr" Find the corespond block device from /proc/mtd Read from read-only block device to avoid misoperation. It's recommended to use /tmp/syslogbackup/ as destination, since files would be available at http://{ROUTER_ADDR}/backup/log/YOUR_DUMP Keep an eye on memory usage though. 3. Since UART access is locked ootb, you should get UART access by modify uboot env. Otherwise, your router may become bricked. Excute these in stock firmware shell: a. nvram set boot_wait=on b. nvram set bootdelay=3 c. nvram commit Or in OpenWrt: a. opkg update && opkg install kmod-mtd-rw b. insmod mtd-rw i_want_a_brick=1 c. fw_setenv boot_wait on d. fw_setenv bootdelay 3 e. rmmod mtd-rw Migrate to OpenWrt: 1. Transfer squashfs-firmware.bin to the router. 2. nvram set flag_try_sys1_failed=0 3. nvram set flag_try_sys2_failed=1 4. nvram commit 5. mtd -r write /path/to/image/squashfs-firmware.bin firmware Additional Info: 1. CR660x series routers has a different nand layout compared to other Xiaomi nand devices. 2. This router has a relatively fresh uboot (2018.09) compared to other Xiaomi devices, and it is capable of booting fit image firmware. Unfortunately, no successful attempt of booting OpenWrt fit image were made so far. The cause is still yet to be known. For now, we use legacy image instead. Signed-off-by: Raymond Wang <infiwang@pm.me>
* Revert "kernel: backport MediaTek Ethernet PHY driver"Hauke Mehrtens2022-02-051-1/+0
| | | | | | | | | | | | | | | | | | This reverts commit 8b4cba53a9402f44da2dced4a78ca065b15dca94. This broke the mt7530 on Linksys e8450 (mt7622) for me. [ 1.312943] mt7530 mdio-bus:00 lan1 (uninitialized): failed to connect to PHY: -EINVAL [ 1.320890] mt7530 mdio-bus:00 lan1 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 0 [ 1.331163] mt7530 mdio-bus:00 lan2 (uninitialized): failed to connect to PHY: -EINVAL [ 1.339085] mt7530 mdio-bus:00 lan2 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 1 [ 1.349321] mt7530 mdio-bus:00 lan3 (uninitialized): failed to connect to PHY: -EINVAL [ 1.357241] mt7530 mdio-bus:00 lan3 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 2 [ 1.367452] mt7530 mdio-bus:00 lan4 (uninitialized): failed to connect to PHY: -EINVAL [ 1.375367] mt7530 mdio-bus:00 lan4 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 3 [ 1.385750] mt7530 mdio-bus:00 wan (uninitialized): failed to connect to PHY: -EINVAL [ 1.393575] mt7530 mdio-bus:00 wan (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 4 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* Revert "kernel: backport MT7530 IRQ support"Hauke Mehrtens2022-02-051-3/+0
| | | | | | | | | This reverts commit 3f4301e123f29348b4ad87578d62b7d1f5f210c6. This broke the mt7530 on Linksys e8450 (mt7622) for me. [ 1.300554] mt7530 mdio-bus:00: no interrupt support Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* kernel: backport MT7530 IRQ supportDENG Qingfang2022-02-051-0/+3
| | | | | | | | Support MT7530 PHY link change interrupts, and enable for MT7621. Signed-off-by: DENG Qingfang <dqfext@gmail.com> Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com> Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
* kernel: backport MediaTek Ethernet PHY driverDENG Qingfang2022-02-051-0/+1
| | | | | | | | | Add support for MediaTek Gigabit Ethernet PHYs found in MT7530. Fix some link up/down issues. Signed-off-by: DENG Qingfang <dqfext@gmail.com> Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com> Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
* ramips: Switch Teltonika RUT5xx to kernel GPIO-line watchdog driverSven Eckelmann2022-02-033-1/+11
| | | | | | | | | | | | | | | The commit 04e91631e050 ("om-watchdog: add support for Teltonika RUT5xx (ramips)") used the deprecated om-watchdog daemon to handle the GPIO-line connected watchdog on the Teltonika RUT5xx. But this daemon has massive problems since commit 30f61a34b4cf ("base-files: always use staged sysupgrade"). The process will always be stopped on sysupgrades. If the sysupgrade takes slightly longer, the watchdog is not triggered at the correct time and thus the sysupgrade will interrupted hard by the watchdog sysupgrade. And this hard interrupt can easily brick the device when there is no fallback (dual-boot, ...). Signed-off-by: Sven Eckelmann <sven@narfation.org>
* Revert "ramips: add support for ipTIME AX2004M"Stijn Tintel2022-02-014-192/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit f4a79148f8cb ("ramips: add support for ipTIME AX2004M") seems to leak KERNEL_LOADADDR 0x82000000 to other devices, causing the to no longer boot. The leak is visible in u-boot: Using 'config-1' configuration Trying 'kernel-1' kernel subimage Description: MIPS OpenWrt Linux-5.10.92 Type: Kernel Image Compression: lzma compressed Data Start: 0x840000e4 Data Size: 10750165 Bytes = 10.3 MiB Architecture: MIPS OS: Linux Load Address: 0x82000000 Entry Point: 0x82000000 Normally, it should look like this: Using 'config-1' configuration Trying 'kernel-1' kernel subimage Description: MIPS OpenWrt Linux-5.10.92 Type: Kernel Image Compression: lzma compressed Data Start: 0xbfca00e4 Data Size: 2652547 Bytes = 2.5 MiB Architecture: MIPS OS: Linux Load Address: 0x80001000 Entry Point: 0x80001000 Revert the commit to avoid more people soft-bricking their devices. This reverts commit f4a79148f8cbb7dfbcddfb0c1128caec45a01596. Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
* ramips: add support for Wavlink WL-WN535K1Davide Fioravanti2022-01-304-0/+210
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Wavlink WL-WN535K1 is a "mesh" router with 2 gigabit ethernet ports and one fast ethernet port. Mine is branded as Talius TAL-WMESH1. It can be found in kits of 2 or 3 (WL-WN535K2 or WL-WN535K3). The motherboard is labelled as WS-WN535G3-B-V1.2 so this image could potentially work for WL-WN535G3R and WS-WN535G3R with little to none effort, but it's untested. Hardware -------- SoC: Mediatek MT7620A RAM: 64MB FLASH: 8MB NOR (GigaDevice GD25Q64CS) ETH: - 2x 10/100/1000 Mbps Ethernet (RTL8211F) - 1x 10/100 Mbps Ethernet (integrated in SOC) WIFI: - 2.4GHz: 1x (integrated in SOC) (2x2:2) - 5GHz: 1x MT7612E (2x2:2) - 4 internal antennas BTN: - 1x Reset button - 1x Touchlink button (set to WPS) - 1x ON/OFF switch LEDS: - 1x Red led (system status) - 1x Blue led (system status) - 3x Green leds (ethernet port status/act) UART: - 57600-8-N-1 Everything works correctly. Currently there is no firmware update available. Because of this, in order to restore the OEM firmware, you must firstly dump the OEM firmware from your router before you flash the OpenWrt image. Backup the OEM Firmware ----------------------- The following steps are to be intended for users having little to none experience in linux. Obviously there are many ways to backup the OEM firmware, but probably this is the easiest way for this router. Procedure tested on WN535K1_V1510_200916 firmware version. 1) Go to http://192.168.10.1/webcmd.shtml 2) Type the following line in the "Command" input box and then press enter: mkdir /etc_ro/lighttpd/www/dev; dd if=/dev/mtd0ro of=/etc_ro/lighttpd/www/dev/mtd0ro 3) After few seconds in the textarea should appear this output: 16384+0 records in 16384+0 records out If your output doesn't match mine, stop reading and ask for help in the forum. 4) Open in another tab http://192.168.10.1/dev/mtd0ro to download the content of the whole NOR. If the file size is 0 byte, stop reading and ask for help in the forum. 5) Come back to the http://192.168.10.1/webcmd.shtml webpage and type: rm /etc_ro/lighttpd/www/dev/mtd0ro;for i in 1 2 3 4 5; do dd if=/dev/mtd${i}ro of=/etc_ro/lighttpd/www/dev/mtd${i}ro; done 6) After few seconds, in the textarea should appear this output: 384+0 records in 384+0 records out 128+0 records in 128+0 records out 128+0 records in 128+0 records out 14720+0 records in 14720+0 records out 1024+0 records in 1024+0 records out If your output doesn't match mine, stop reading and ask for help in the forum. 7) Open the following links to download the partitions of the OEM FW: http://192.168.10.1/dev/mtd1ro http://192.168.10.1/dev/mtd2ro http://192.168.10.1/dev/mtd3ro http://192.168.10.1/dev/mtd4ro http://192.168.10.1/dev/mtd5ro If one (or more) of these files are 0 byte, stop reading and ask for help in the forum. 8) Store these downloaded files in a safe place. 9) Reboot your router to remove any temporary file in ram. Installation ------------ Flash the initramfs image in the OEM firmware interface (http://192.168.10.1/update_mesh.shtml). When Openwrt boots, flash the sysupgrade image otherwise you won't be able to keep configuration between reboots. Restore OEM Firmware -------------------- Flash the "mtd4ro" file you previously backed-up directly from LUCI. Warning: Remember to not keep settings! Warning2: Remember to force the flash. Notes ----- 1) Router mac addresses: LAN XX:XX:XX:XX:XX:E2 (factory @ 0x28) WAN XX:XX:XX:XX:XX:E3 (factory @ 0x2e) WIFI 2G XX:XX:XX:XX:XX:E4 (factory @ 0x04) WIFI 5G XX:XX:XX:XX:XX:E5 (factory @ 0x8004) LABEL XX:XX:XX:XX:XX:E5 2) The OEM firmware upgrade page accepts only files containing the string "WN535K1" in the filename. 3) Additional notes 1,2,3 in the WS-WN583A6 commit are still valid (https://github.com/openwrt/openwrt/commit/92780d80ab6f5f03fac2407c06eb267dd83914a1) Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com> [remove trailing whitespace] Signed-off-by: Sungbo Eo <mans0n@gorani.run>