aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ipq40xx/base-files/lib
Commit message (Collapse)AuthorAgeFilesLines
* base-files: fix Linksys upgrade, restore config stepMichael Trinidad2023-04-111-1/+1
| | | | | | | | | | | | | It appears that the refactor of the upgrade process for NAND devices resulted in the nand_do_upgrade_success step not being called for devices using the linksys.sh script. As a result, configuration was not preserved over sysupgrade steps. This corrects a typo in the call of nand_do_upgrade_failed for ipq40xx and ipq806x devices using the linksys.sh script. Fixes: 8634c1080d50 ("ipq40xx: Fix Linksys upgrade, restore config step") Fixes: 2715aff5df83 ("ipq806x: Fix Linksys upgrade, restore config step") Signed-off-by: Michael Trinidad <trinidude4@hotmail.com>
* ipq40xx: Fix Linksys upgrade, restore config stepJeff Kletsky2023-03-261-1/+6
| | | | | | | | | | | | | | | | | | | | It appears that the refactor of the upgrade process for NAND devices resulted in the nand_do_upgrade_success step not being called for devices using the linksys.sh script. As a result, configuration was not preserved over sysupgrade steps. This was restored for some devices in commit 84ff6c90dda1 ("base-files: bring back nand_do_upgrade_success"). This restored preservation of config for ipq40xx devices using the linksys.sh script. Other devices and targets have not been examined. Closes: #11677 Fixes: e25e6d8e54 ("base-files: fix and clean up nand sysupgrade code") Tested-on: EA8300 Signed-off-by: Jeff Kletsky <git-commits@allycomm.com> (checkpatch nitpick) Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* ipq40xx: add support for Wallystech DR40x9Robert Marko2023-03-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds support for the Wallys DR40x9 series boards. They come in IPQ4019 and IPQ4029 versions. IPQ4019/4029 only differ in that that IPQ4029 is the industrial version that is rated to higher temperatures. Specifications are: * CPU: Qualcomm IPQ40x9 (4x ARMv7A Cortex A7) at 716 MHz * RAM: 512 MB * Storage: 2MB of SPI-NOR, 128 MB of parallel NAND * USB 3.0 TypeA port for users * MiniPCI-E with PCI-E 2.0 link * MiniPCI-E for LTE modems with only USB2.0 link * 2 SIM card slots that are selected via GPIO11 * MicroSD card slot * Ethernet: 2x GBe with 24~48V passive POE * SFP port (Does not work, I2C and GPIO's not connected on hardware) * DC Jack * UART header * WLAN: In-SoC 2x2 802.11b/g/n and 2x2 802.11a/n/ac * 4x MMCX connectors for WLAN * Reset button * 8x LED-s Installation instructions: Connect to UART, pins are like this: -> 3.3V | TX | RX | GND Settings are 115200 8n1 Boot initramfs from TFTP: tftpboot 0x84000000 openwrt-ipq40xx-generic-wallys_dr40x9-initramfs-fit-uImage.itb bootm Then copy the sysupgrade image to the /tmp folder and execute sysupgrade -n <image_name> The board file binary was provided from Wallystech on March 14th 2023 including full permission to use and distribute. Signed-off-by: Robert Marko <robert.marko@sartura.hr> Signed-off-by: Koen Vandeputte <koen.vandeputte@citymesh.com>
* treewide: replace /sys/devices/virtual/ubi by /sys/class/ubiDaniel Golle2023-02-151-1/+1
| | | | | | | | | | Starting from Linux Kernel version 6.3 UBI devices will no longer be considered virtual, but rather have an MTD device parent. Hence they will no longer be listed under /sys/devices/virtual/ubi which is used in multiple places in OpenWrt. Prepare for future kernels by using /sys/class/ubi instead of /sys/devuces/virtual/ubi. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* ipq40xx: add support for Linksys WHW03 V2Vincent Tremblay2023-01-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SOC: Qualcomm IPQ4019 WiFi 1: QCA4019 IEEE 802.11b/g/n WiFi 2: QCA4019 IEEE 802.11a/n/ac WiFi 3: QCA8888 IEEE 802.11a/n/ac Bluetooth: Qualcomm CSR8811 (A12U) Zigbee: Silicon Labs EM3581 NCP + Skyworks SE2432L Ethernet: Qualcomm Atheros QCA8072 (2-port) Flash 1: Mactronix MX30LF4G18AC-XKI RAM (NAND): SK hynix H5TC4G63CFR-PBA (512MB) LED Controller: NXP PCA9633 (I2C) Buttons: Single reset button (GPIO). - The three WiFis were fully tested and are configured with the same settings as in the vendor firmware. - The specific board files were submitted to the ATH10k mailing list but I'm still waiting for a reply. They can be removed once they are approved upstream. - Two ethernet ports are accessible on the device. By default one is configured as WAN and the other one is LAN. They are fully working. Bluetooth: ======== - Fully working with the following caveats: - RFKILL need to be enabled in the kernel. - An older version of bluez is needed as bccmd is needed to configure the chip. Zigbee: ====== - The spidev device is available in the /dev directory. - GPIOs are configured the same way as in the vendor firmware. - Tests are on-going. I am working on getting access to the Silicon Labs stack to validate that it is fully working. Installation: ========= The squash-factory image can be installed via the Linksys Web UI: 1. Open "http://192.168.1.1/ca" (Change the IP with the IP of your device). 2. Login with your admin password. 3. To enter into the support mode, click on the "CA" link and the bottom of the page. 4. Open the "Connectivity" menu and upload the squash-factory image with the "Choose file" button. 5. Click start. Ignore all the prompts and warnings by click "yes" in all the popups. The device uses a dual partition mechanism. The device automatically revert to the previous partition after 3 failed boot attempts. If you want to force the previous firmware to load, you can turn off and then turn on the device for 2 seconds, 3 times in a row. It can also be done via TFTP: 1. Setup a local TFTP server and configure its IP to 192.168.1.100. 2. Rename your image to "nodes_v2.img" and put it to the TFTP root of your server. 3. Connect to the device through the serial console. 4. Power on device and press enter when prompted to drop into U-Boot. 5. Flash the partition of your choice by typing "run flashimg" or "run flashimg2". 6. Once flashed, enter "reset" to reboot the device. Reviewed-by: Robert Marko <robimarko@gmail.com> Signed-off-by: Vincent Tremblay <vincent@vtremblay.dev>
* ipq40xx: Add support ZTE MF18AMarcin Gajda2023-01-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Light and small router ( In Poland operators sells together with MC7010 outdoor modem to provide WIFI inside home). Device specification SoC Type: Qualcomm IPQ4019 RAM: 256 MiB Flash: 128 MiB SPI NAND (Winbond W25N01GV) ROM: 2MiB SPI Flash (GD25Q16) Wireless 2.4 GHz (IP4019): b/g/n, 2x2 Wireless 5 GHz (QCA9982): a/n/ac, 3x3 Ethernet: 2xGbE (WAN/LAN1, LAN2) USB ports: No Button: 2 (Reset/WPS) LEDs: 3 external leds: Power (blue) , WiFI (blue and red), SMARTHOME (blue and red) and 1 internal (blue) -- NOTE: Power controls all external led (if down ,all others also not lights even signal is up) Power: 5VDC, 2,1A via USB-C socket Bootloader: U-Boot On board ZWave and Zigbee (EFR32 MG1P232GG..) modules ( not supported by orginal software ) Installation 1.Open MF18A case by ungluing rubber pad under the router and unscrew screws, and connect to serial console port, with the following pinout, starting from pin 1, which is the topmost pin when the board is upright (reset button on the bottom) : VCC (3.3V). Do not use unless you need to source power for the converer from it. TX RX GND Default port configuration in U-boot as well as in stock firmware is 115200-8-N-1. 2.Place OpenWrt initramfs image for the device on a TFTP in the server's root. This example uses Server IP: 192.168.0.2 3.Connect TFTP server to RJ-45 port (WAN/LAN1). 4.Power on MF18A , stop in u-Boot (using ESC button) and run u-Boot commands: setenv serverip 192.168.0.2 setenv ipaddr 192.168.0.1 set fdt_high 0x85000000 tftpboot 0x84000000 openwrt-ipq40xx-generic-zte_mf18a-initramfs-fit-zImage.itb bootm 0x84000000 5.Please make backup of original partitions, if you think about revert to stock, specially mtd8 (Web UI) and mtd9 (rootFS). Use /tmp as temporary storage and do: WEB PARITION cat /dev/mtd8 > /tmp/mtd8.bin scp /tmp/mtd8.bin root@YOURSERVERIP:/ rm /tmp/mtd8.bin ROOT PARITION cat /dev/mtd9 > /tmp/mtd9.bin scp /tmp/mtd9.bin root@YOURSERVERIP:/ rm /tmp/mtd9.bin If you are sure ,that you want to flash openwrt, from uBoot, before bootm, clean rootfs partition with command: nand erase 0x1800000 0x1D00000 6.Login via ssh or serial and remove stock partitions (default IP 192.168.1.1): ubiattach -m 9 # it could return error if ubi was attached before or rootfs part was erased before ubirmvol /dev/ubi0 -N ubi_rootfs # it could return error if rootfs part was erased before ubirmvol /dev/ubi0 -N ubi_rootfs_data # some devices doesn't have it 7. Install image via : sysupgrade -n /tmp/openwrt-ipq40xx-generic-zte_mf18a-squashfs-sysupgrade.bin previously wgeting bin. Sometimes it could print ubi attach error, but please ignore it if process goes forward. Back to Stock (!!! need original dump taken from initramfs !!!) ------------- Place mtd8.bin and mtd9.bin initramfs image for the device on a TFTP in the server's root. This example uses Server IP: 192.168.0.2 Connect serial console (115200,8n1) to serial console connector . Connect TFTP server to RJ-45 port (WAN/LAN1). rename mtd8.bin to web.img and mtd9.bin to root_uImage_s Stop in u-Boot (using ESC button) and run u-Boot commands: This will erase Web and RootFS: nand erase 0x1000000 0x800000 nand erase 0x1800000 0x1D00000 This will restore RootFS: tftpboot 0x84000000 root_uImage_s nand erase 0x1800000 0x1D00000 nand write 0x84000000 0x1800000 0x1D00000 This will restore Web Interface: tftpboot 0x84000000 web.img nand erase 0x1000000 0x800000 nand write 0x84000000 0x1000000 0x800000 After first boot on stock firwmare, do a factory reset. Push reset button for 5 seconds so all parameters will be reverted to the one printed on label on bottom of the router As reference was taken MF289F support by Giammarco Marzano stich86@gmail.com and MF286D by Pawel Dembicki paweldembicki@gmail.com Signed-off-by: Marcin Gajda <mgajda@o2.pl>
* ipq40xx: sysupgrade: allow flashing Linksys factory firmwareTony Ambardar2022-12-311-0/+18
| | | | | | | | | | | | | | | | | Allow forced flashing of a factory firmware image, after checking for the correct FIT magic header and Linksys board-specific footer. Details of the footer are already described in scripts/linksys-image.sh. This is convenient as it avoids using a TFTP server or OEM GUI, and allows restoring OEM firmware or installing a "breaking" OpenWrt update (e.g DSA migration and kernel repartition) directly from the command line. Devices supported at this time include EA6350v3, EA8300, MR8300 and WHW01. Reviewed-by: Robert Marko <robimarko@gmail.com> Tested-by: Wyatt Martin <wawowl@gmail.com> # WHW01 Tested-by: Tony Ambardar <itugrok@yahoo.com> # EA6350v3 Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
* ipq40xx: fix up Linksys WHW01 board name, device definitionTony Ambardar2022-12-311-1/+1
| | | | | | | | | | | | | | Update the board name defined in DTS to match online documentation and the name encoded into factory firmware. This helps supports flashing firmware factory images using 'sysupgrade'. Original WHW01 device definition assumes the rootfs IMAGE_SIZE is 33 MB instead of the correct 74 MB, and defines factory images which include extra adjustments/padding that do not match OEM factory images and may cause problems flashing. Update image size and build recipe to fix these. Suggested-by: Wyatt Martin <wawowl@gmail.com> Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
* ipq40xx: add support for Mikrotik wAP R ac / LTE / LTE6Alexander Couzens2022-11-272-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The Mikrotik wAP R AC is an outdoor, dual band, dual radio (802.11ac) AP with a miniPCIe slot for a LTE modem. The wAP R AC is similar to the wAP AC but with the miniPCIe slot. The wAP R AC requires installing a LTE modem. The wAP LTE and wAP LTE6 comes with a LTE modem installed. See https://mikrotik.com/product/wap_r_ac for more info. Specifications: - SoC: Qualcomm Atheros IPQ4018 - CPU: 4x ARM Cortex A7 - RAM: 128MB - Storage: 16MB NOR flash - Wireless: - Built-in IPQ4018 (SoC) 802.11b/g/n 2x2:2, internal antenna - Built-in IPQ4018 (SoC) 802.11a/n/ac 2x2:2, internal antenna - Ethernet: Built-in IPQ4018 (SoC, QCA8075) , 2x 1000/100/10 ports one with 802.3af/at PoE in - 1x Mini PCI-E port (USB2) Installation: Boot the initramfs image via TFTP, then flash the sysupgrade image using sysupgrade. Details at https://openwrt.org/toh/mikrotik/common. Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
* ipq40xx: utilize nvmem-cells for openmesh,a62Sven Eckelmann2022-11-121-4/+0
| | | | | | | | | | | | | | | | The calibration data and mac addresses on this device are stored in the 0:ART partition. It is therefore possible to move the code to handle them directly to the devicetree instead of the various scripts. But the actual relevant information about the partition layout is provided by the bootloader via bootargs (mtdparts) and not via the devicetree itself. Instead of using a fixed-partition template, the mtd dynamic partitions support from the upstream kernel is used. Reported-by: Robert Marko <robert.marko@sartura.hr> Reviewed-by: Robert Marko <robimarko@gmail.com> Tested-by: Michaël BILCOT <michael.bilcot@gmail.com> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* ipq40xx: utilize nvmem-cells for openmesh,a42Sven Eckelmann2022-11-121-1/+0
| | | | | | | | | | | | | | | The calibration data and mac addresses on this device are stored in the 0:ART partition. It is therefore possible to move the code to handle them directly to the devicetree instead of the various scripts. But the actual relevant information about the partition layout is provided by the bootloader via bootargs (mtdparts) and not via the devicetree itself. Instead of using a fixed-partition template, the mtd dynamic partitions support from the upstream kernel is used. Reported-by: Robert Marko <robert.marko@sartura.hr> Reviewed-by: Robert Marko <robimarko@gmail.com> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* ipq40xx: Convert openmesh,a62 to DSASven Eckelmann2022-11-121-1/+2
| | | | | | | | | | | | | | | | | | | | * ethernet1: - physical port label "Ethernet 1" - can be used to power the device - its mac address is printed on the device label * ethernet2: - physical port label "Ethernet 2" Both ports are not marked by there role (because the vendor firmware automatically detects roles) but the "Ethernet 1" port was used in the past for "WAN" functionality in OpenWrt. Reviewed-by: Robert Marko <robimarko@gmail.com> Tested-by: Michaël BILCOT <michael.bilcot@gmail.com> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* ipq40xx: Convert openmesh,a42 to DSASven Eckelmann2022-11-121-0/+4
| | | | | | | | | | | | | | | | | | | * ethernet1: - physical port label "Ethernet 1" - can be used to power the device - its mac address is printed on the device label * ethernet2: - physical port label "Ethernet 2" Both ports are not marked by there role (because the vendor firmware automatically detects roles) but the "Ethernet 1" port was used in the past for "WAN" functionality in OpenWrt. Reviewed-by: Robert Marko <robimarko@gmail.com> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* ipq40xx: add support for GL.iNet GL-A1300Weiping Yang2022-11-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifications: SOC: Qualcomm IPQ4018 (DAKOTA) ARM Quad-Core RAM: 256 MiB FLASH1: 4 MiB NOR FLASH2: 128 MiB NAND ETH: Qualcomm QCA8075 WLAN1: Qualcomm Atheros QCA4018 2.4GHz 802.11b/g/n 2x2 WLAN2: Qualcomm Atheros QCA4018 5G 802.11n/ac W2 2x2 USB: 1 x USB 3.0 port Button: 1 x Reset button Switch: 1 x Mode switch LED: 1 x Blue LED + 1 x White LED Install via uboot tftp or uboot web failsafe. By uboot tftp: (IPQ40xx) # tftpboot 0x84000000 openwrt-ipq40xx-generic-glinet_gl-a1300-squashfs-nand-factory.ubi (IPQ40xx) # nand erase 0 0x8000000 (IPQ40xx) # nand write 0x84000000 0 $filesize By uboot web failsafe: Push the reset button for 10 seconds util the power led flash faster, then use broswer to access http://192.168.1.1 Afterwards upgrade can use sysupgrade image. Signed-off-by: Weiping Yang <weiping.yang@gl-inet.com>
* ipq40xx: add support for MikroTik hAP ac3 LTE6 kitCsaba Sipos2022-10-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for the MikroTik RouterBOARD RBD53GR-5HacD2HnD (hAP ac³ LTE6 kit), an indoor dual band, dual-radio 802.11ac wireless AP with built-in Mini PCI-E LTE modem, one USB port, five 10/100/1000 Mbps Ethernet ports. See https://mikrotik.com/product/hap_ac3_lte6_kit for more info. Specifications: - SoC: Qualcomm Atheros IPQ4019 - RAM: 256 MB - Storage: 16 MB NOR - Wireless: · Built-in IPQ4019 (SoC) 802.11b/g/n 2x2:2, 3 dBi internal antennae · Built-in IPQ4019 (SoC) 802.11a/n/ac 2x2:2, 5.5 dBi internal antennae - Ethernet: Built-in IPQ4019 (SoC, QCA8075) , 5x 1000/100/10 port - 1x USB Type A port - 1x Mini PCI-E port (supporting USB) - 1x Mini PCI-E LTE modem (MikroTik R11e-LTE6, Cat.6) Installation: Make sure your unit is runnning RouterOS v6 and RouterBOOT v6 (tested on 6.49.6). 0. Export your MikroTik license key (in case you want to use the device with RouterOS later) 1. Boot the initramfs image via TFTP 2. Upload the "openwrt-ipq40xx-mikrotik-mikrotik_hap-ac3-lte6-kit-squashfs-sysupgrade.bin" via SCP to the /tmp folder 3. Use sysupgrade to flash the image: sysupgrade -n /tmp/openwrt-ipq40xx-mikrotik-mikrotik_hap-ac3-lte6-kit-squashfs-sysupgrade.bin 4. Recovery to factory software is possible via Netinstall: https://help.mikrotik.com/docs/display/ROS/Netinstall Signed-off-by: Csaba Sipos <metro4@freemail.hu>
* ipq40xx: convert to DSA and enable asus,rt-ac42uChen Minqiang2022-10-221-2/+7
| | | | | | | This convert board asus,rt-ac42u to DSA and re-enable it Reviewed-by: Robert Marko <robimarko@gmail.com> Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
* ipq40xx: Convert mikrotik,wap-ac to DSAMark Mentovai2022-10-191-2/+2
| | | | | | | | | | | | | | | | | | As done previously, this preserves the MAC addresses of they physical Ethernet ports. The interfaces are renamed as eth0 is in use for the native GMAC; the new interface naming matches the physical port labels. - sw-eth1 corresponds to the physical port labeled ETH1 and has the base MAC address. This port can be used to power the device. - sw-eth2 corresponds to the physical port labeled ETH2 and has a MAC address one greater than the base. As this device has 2 physical ports, they are each connected to their respective PHYs, allowing the link status to be visible to software. Since they are not marked on the case with any role (such as LAN or WAN), both are bridged to the lan network by default, although this can easily be changed if needed. Signed-off-by: Mark Mentovai <mark@mentovai.com>
* ipq40xx: Meraki MR33: convert MAC addresses to nvmemLech Perczak2022-10-021-5/+0
| | | | | | | | This fixes assigning random MAC to br-lan interface upon boot. While at that, rename at24@50 node to eeprom@50, to align with upstream device tree style. Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
* ipq40xx: convert some boards to DSARobert Marko2022-10-022-26/+2
| | | | | | | | | | | | Convert IPQ40xx boards to DSA setup. Signed-off-by: Leon M. George <leon@georgemail.eu> Signed-off-by: Lech Perczak <lech.perczak@gmail.com> Signed-off-by: Nick Hainke <vincent@systemli.org> Signed-off-by: ChunAm See <z1250747241@gmail.com> Signed-off-by: Jeff Kletsky <git-commits@allycomm.com> Signed-off-by: Andrew Sim <andrewsimz@gmail.com> Signed-off-by: Robert Marko <robert.marko@sartura.hr>
* ipq40xx: Add ZTE MF289FGiammarco Marzano2022-09-241-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's a 4G Cat.20 router used by Vodafone Italy (called Vodafone FWA) and Vodafone DE\T-Mobile PL (called GigaCube). Modem is a MiniPCIe-to-USB based on Snapdragon X24, it supports 4CA aggregation. There are currently two hardware revisions, which differ on the 5Ghz radio: AT1 = QCA9984 5Ghz Radio on PCI-E bus AT2 = IPQ4019 5Ghz Radio inside IPQ4019 like 2.4Ghz Device specification -------------------- SoC Type: Qualcomm IPQ4019 RAM: 256 MiB Flash: 128 MiB SPI NAND (Winbond W25N01GV) ROM: 2MiB SPI Flash (GD25Q16) Wireless 2.4 GHz (IP4019): b/g/n, 2x2 Wireless 5 GHz: (QCA9984): a/n/ac, 4x4 HW REV AT1 (IPA4019): a/n/ac, 2x2 HW REV AT2 Ethernet: 2xGbE (WAN/LAN1, LAN2) USB ports: No Button: 2 (Reset/WPS) LEDs: 3 external leds: Network (white or red), Wifi, Power and 1 internal (blue) Power: 12 VDC, 1 A Connector type: Barrel Bootloader: U-Boot Installation ------------ 1. Place OpenWrt initramfs image for the device on a TFTP in the server's root. This example uses Server IP: 192.168.0.2 2. Connect serial console (115200,8n1) to serial connector GND (which is right next to the thing with MF289F MIMO-V1.0), RX, TX (refer to this image: https://ibb.co/31Gngpr). 3. Connect TFTP server to RJ-45 port (WAN/LAN1). 4. Stop in u-Boot (using ESC button) and run u-Boot commands: setenv serverip 192.168.0.2 setenv ipaddr 192.168.0.1 set fdt_high 0x85000000 tftp openwrt-ipq40xx-generic-zte_mf289f-initramfs-fit-zImage.itb bootm $loadaddr 5. Please make backup of original partitions, if you think about revert to stock, specially mtd16 (Web UI) and mtd17 (rootFS). Use /tmp as temporary storage and do: WEB PARITION -------------------------------------- cat /dev/mtd16 > /tmp/mtd16.bin scp /tmp/mtd16.bin root@YOURSERVERIP:/ rm /tmp/mtd16.bin ROOT PARITION -------------------------------------- cat /dev/mtd17 > /tmp/mtd17.bin scp /tmp/mtd17.bin root@YOURSERVERIP:/ rm /tmp/mtd17.bin 6. Login via ssh or serial and remove stock partitions (default IP 192.168.0.1): # this can return an error, if ubi was attached before # or rootfs part was erased before. ubiattach -m 17 # it could return error if rootfs part was erased before ubirmvol /dev/ubi0 -N ubi_rootfs # some devices doesn't have it ubirmvol /dev/ubi0 -N ubi_rootfs_data 7. download and install image via sysupgrade -n (either use wget/scp to copy the mf289f's squashfs-sysupgrade.bin to the device's /tmp directory) sysupgrade -n /tmp/openwrt-...-zte_mf289f-squashfs-sysupgrade.bin Sometimes it could print ubi attach error, but please ignore it if process goes forward. Flash Layout NAND: mtd8: 000a0000 00020000 "fota-flag" mtd9: 00080000 00020000 "0:ART" mtd10: 00080000 00020000 "mac" mtd11: 000c0000 00020000 "reserved2" mtd12: 00400000 00020000 "cfg-param" mtd13: 00400000 00020000 "log" mtd14: 000a0000 00020000 "oops" mtd15: 00500000 00020000 "reserved3" mtd16: 00800000 00020000 "web" mtd17: 01d00000 00020000 "rootfs" mtd18: 01900000 00020000 "data" mtd19: 03200000 00020000 "fota" mtd20: 0041e000 0001f000 "kernel" mtd21: 0101b000 0001f000 "ubi_rootfs" SPI: mtd0: 00040000 00010000 "0:SBL1" mtd1: 00020000 00010000 "0:MIBIB" mtd2: 00060000 00010000 "0:QSEE" mtd3: 00010000 00010000 "0:CDT" mtd4: 00010000 00010000 "0:DDRPARAMS" mtd5: 00010000 00010000 "0:APPSBLENV" mtd6: 000c0000 00010000 "0:APPSBL" mtd7: 00050000 00010000 "0:reserved1" Back to Stock (!!! need original dump taken from initramfs !!!) ------------- 1. Place mtd16.bin and mtd17.bin initramfs image for the device on a TFTP in the server's root. This example uses Server IP: 192.168.0.2 2. Connect serial console (115200,8n1) to serial console connector (refer to the pin-out from above). 3. Connect TFTP server to RJ-45 port (WAN/LAN1). 4. rename mtd16.bin to web.img and mtd17.bin to root_uImage_s 5. Stop in u-Boot (using ESC button) and run u-Boot commands: This will erase RootFS+Web: nand erase 0x1000000 0x800000 nand erase 0x1800000 0x1D00000 This will restore RootFS: tftpboot 0x84000000 ${dir}root_uImage_s nand erase 0x1800000 0x1D00000 nand write $fileaddr 0x1800000 $filesize This will restore Web Interface: tftpboot 0x84000000 ${dir}web.img nand erase 0x1000000 0x800000 nand write $fileaddr 0x1000000 $filesize After first boot on stock firwmare, do a factory reset. Push reset button for 5 seconds so all parameters will be reverted to the one printed on label on bottom of the router Signed-off-by: Giammarco Marzano <stich86@gmail.com> Reviewed-by: Lech Perczak <lech.perczak@gmail.com> (Warning: commit message did not conform to UTF-8 - hopefully fixed?, added description of the pin-out if image goes down, reformatted commit message to be hopefully somewhat readable on git-web, redid some of the gpio-buttons & leds DT nodes, etc.) Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* ipq40xx: add support for Sony NCP-HG100/CellularINAGAKI Hiroshi2022-09-242-0/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sony NCP-HG100/Cellular is a IoT Gateway with 2.4/5 GHz band 11ac (WiFi-5) wireless function, based on IPQ4019. Specification: - SoC : Qualcomm IPQ4019 - RAM : DDR3 512 MiB (H5TC4G63EFR) - Flash : eMMC 4 GiB (THGBMNG5D1LBAIT) - WLAN : 2.4/5 GHz 2T2R (IPQ4019) - Ethernet : 10/100/1000 Mbps x2 - Transceiver : Qualcomm QCA8072 - WWAN : Telit LN940A9 - Z-Wave : Silicon Labs ZM5101 - Bluetooth : Qualcomm CSR8811 - Audio DAC : Realtek ALC5629 - Audio Amp. : Realtek ALC1304 - Voice Input Processor : Conexant CX20924 - Micro Controller Unit : Nuvoton MINI54FDE - RGB LED, Fan, Temp. sensors - Touch Sensor : Cypress CY8C4014LQI - RGB LED driver : TI LP55231 (2x) - LEDs/Keys : 11x, 6x - UART : through-hole on PCB - J1: 3.3V, TX, RX, GND from tri-angle marking - 115200n8 - Power : 12 VDC, 2.5 A Flash instruction using initramfs image: 1. Prepare TFTP server with the IP address 192.168.132.100 and place the initramfs image to TFTP directory with the name "C0A88401.img" 2. Boot NCP-HG100/Cellular and interrupt after the message "Hit any key to stop autoboot: 2" 3. Perform the following commands and set bootcmd to allow booting from eMMC setenv bootcmd "mmc read 0x84000000 0x2e22 0x4000 && bootm 0x84000000" saveenv 4. Perform the following command to load/boot the OpenWrt initramfs image tftpboot && bootm 5. On the initramfs image, perform sysupgrade with the sysupgrade image (if needed, backup eMMC partitions by dd command and download to other place before performing sysupgrade) 6. Wait for ~120 seconds to complete flashing Known issues: - There are no drivers for audio-related chips/functions in Linux Kernel and OpenWrt, they cannot be used. - There is no driver for MINI54FDE Micro-Controller Unit, customized for this device by the firmware in the MCU. This chip controls the following functions, but they cannot be controlled in OpenWrt. - RGB LED - Fan this fan is controlled automatically by MCU by default, without driver - Thermal Sensors (2x) - Currently, there is no driver or tool for CY8C4014LQI and cannot be controlled. It cannot be exited from "booting mode" and moved to "normal op mode" after booting. And also, the 4x buttons (mic mute, vol down, vol up, alexa trigger) connected to the IC cannot be controlled. - it can be exited from "booting mode" by installing and executing i2cset command: opkg update opkg install i2c-tools i2cset -y 1 0x14 0xf 1 - There is a connection issue on the control by uqmi for the WWAN module. But modemmanager can be used without any issues and the use of it is recommended. - With the F2FS format, too many errors are reported on erasing eMMC partition "rootfs_data" while booting: [ 1.360270] sdhci: Secure Digital Host Controller Interface driver [ 1.363636] sdhci: Copyright(c) Pierre Ossman [ 1.369730] sdhci-pltfm: SDHCI platform and OF driver helper [ 1.374729] sdhci_msm 7824900.sdhci: Got CD GPIO ... [ 1.413552] mmc0: SDHCI controller on 7824900.sdhci [7824900.sdhci] using ADMA 64-bit [ 1.528325] mmc0: new HS200 MMC card at address 0001 [ 1.530627] mmcblk0: mmc0:0001 004GA0 3.69 GiB [ 1.533530] mmcblk0boot0: mmc0:0001 004GA0 partition 1 2.00 MiB [ 1.537831] mmcblk0boot1: mmc0:0001 004GA0 partition 2 2.00 MiB [ 1.542918] mmcblk0rpmb: mmc0:0001 004GA0 partition 3 512 KiB, chardev (247:0) [ 1.550323] Alternate GPT is invalid, using primary GPT. [ 1.561669] mmcblk0: p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16 p17 ... [ 8.841400] mount_root: loading kmods from internal overlay [ 8.860241] kmodloader: loading kernel modules from //etc/modules-boot.d/* [ 8.863746] kmodloader: done loading kernel modules from //etc/modules-boot.d/* [ 9.240465] block: attempting to load /etc/config/fstab [ 9.246722] block: unable to load configuration (fstab: Entry not found) [ 9.246863] block: no usable configuration [ 9.254883] mount_root: overlay filesystem in /dev/mmcblk0p17 has not been formatted yet [ 9.438915] urandom_read: 5 callbacks suppressed [ 9.438924] random: mkfs.f2fs: uninitialized urandom read (16 bytes read) [ 12.243332] mmc_erase: erase error -110, status 0x800 [ 12.246638] mmc0: cache flush error -110 [ 15.134585] mmc_erase: erase error -110, status 0x800 [ 15.135891] mmc_erase: group start error -110, status 0x0 [ 15.139850] mmc_erase: group start error -110, status 0x0 ...(too many the same errors)... [ 17.350811] mmc_erase: group start error -110, status 0x0 [ 17.356197] mmc_erase: group start error -110, status 0x0 [ 17.439498] sdhci_msm 7824900.sdhci: Card stuck in wrong state! card_busy_detect status: 0xe00 [ 17.446910] mmc0: tuning execution failed: -5 [ 17.447111] mmc0: cache flush error -110 [ 18.012440] F2FS-fs (mmcblk0p17): Found nat_bits in checkpoint [ 18.062652] F2FS-fs (mmcblk0p17): Mounted with checkpoint version = 428fa16b [ 18.198691] block: attempting to load /etc/config/fstab [ 18.198972] block: unable to load configuration (fstab: Entry not found) [ 18.203029] block: no usable configuration [ 18.211371] mount_root: overlay filesystem has not been fully initialized yet [ 18.214487] mount_root: switching to f2fs overlay So, this support uses ext4 format instead which has no errors. Note: - The primary uart is shared for debug console and Z-Wave chip. The function is switched by GPIO15 (Linux: 427). value: 1: debug console 0: Z-Wave - NCP-HG100/Cellular has 2x os-image pairs in eMMC. - 0:HLOS, rootfs - 0:HLOS_1, rootfs_1 In OpenWrt, the first image pair is used. - "bootipq" command in U-Boot requires authentication with signed-image by default. To boot unsigned image of OpenWrt, use "mmc read" and "bootm" command instead. - This support is for "Cellular" variant of NCP-HG100 and not tested on "WLAN" (non-cellular) variant. - The board files of ipq-wifi may also be used in "WLAN" variant of NCP-HG100, but unconfirmed and add files as for "Cellular" variant. - "NET" LED is used to indicate WWAN status in stock firmware. - There is no MAC address information in the label on the case, use the address included in UUID in the label as "label-MAC" instead. - The "CLOUD" LEDs are partially used for indication of system status in stock firmware, use they as status LEDs in OpenWrt instead of RGB LED connected to the MCU. MAC addresses: LAN : 5C:FF:35:**:**:ED (ART, 0x6 (hex)) WAN : 5C:FF:35:**:**:EF (ART, 0x0 (hex)) 2.4 GHz: 5C:FF:35:**:**:ED (ART, 0x1006 (hex)) 5 GHz : 5C:FF:35:**:**:EE (ART, 0x5006 (hex)) partition layout in eMMC (by fdisk, GPT): Disk /dev/mmcblk0: 7733248 sectors, 3776M Logical sector size: 512 Disk identifier (GUID): **** Partition table holds up to 20 entries First usable sector is 34, last usable sector is 7634910 Number Start (sector) End (sector) Size Name 1 34 1057 512K 0:SBL1 2 1058 2081 512K 0:BOOTCONFIG 3 2082 3105 512K 0:QSEE 4 3106 4129 512K 0:QSEE_1 5 4130 4641 256K 0:CDT 6 4642 5153 256K 0:CDT_1 7 5154 6177 512K 0:BOOTCONFIG1 8 6178 6689 256K 0:APPSBLENV 9 6690 8737 1024K 0:APPSBL 10 8738 10785 1024K 0:APPSBL_1 11 10786 11297 256K 0:ART 12 11298 11809 256K 0:HSEE 13 11810 28193 8192K 0:HLOS 14 28194 44577 8192K 0:HLOS_1 15 44578 306721 128M rootfs 16 306722 568865 128M rootfs_1 17 568866 3958065 1654M rootfs_data [initial work] Signed-off-by: Iwao Yuki <dev.clef@gmail.com> Co-developed-by: Iwao Yuki <dev.clef@gmail.com> [adjustments, cleanups, commit message, sending patch] Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com> (dropped clk_unused_ignore, dropped 901-* patches, renamed key nodes, changed LEDs chan/labels to match func-en, made :net -> (w)wan leds) Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* ipq40xx: add support for Extreme Networks WS-AP3915iDavid Bauer2022-09-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hardware -------- Qualcomm IPQ4029 WiSoC 2T2R 802.11 abgn 2T2R 802.11 nac Macronix MX25L25635E SPI-NOR (32M) 512M DDR3 RAM 1x Gigabit LAN 1x Cisco RJ-45 Console port Settings: 115200 8N1 Installation ------------ 1. Attach to the Console port. Power up the device and press the s key to interrupt autoboot. 2. The default username / password to the bootloader is admin / new2day 3. Update the bootcommand to allow loading OpenWrt. $ setenv ramboot_openwrt "setenv serverip 192.168.1.66; setenv ipaddr 192.168.1.1; tftpboot 0x86000000 openwrt-3915.bin; bootm" $ setenv boot_openwrt "sf probe; sf read 0x88000000 0x280000 0xc00000; bootm 0x88000000" $ setenv bootcmd "run boot_openwrt" $ saveenv 4. Download the OpenWrt initramfs image. Serve it using a TFTP server as "openwrt-3915.bin" at 192.1681.66. 5. Download & boot the OpenWrt initramfs image on the access point. $ run ramboot_openwrt 6. Wait for OpenWrt to start. 7. Download and transfer the sysupgrade image to the device using e.g. SCP. 8. Install OpenWrt to the device using "sysupgrade" $ sysupgrade -n /path/to/openwrt.bin Signed-off-by: David Bauer <mail@david-bauer.net>
* ipq40xx: add MikroTik wAP ac (RBwAPG-5HacD2HnD) supportMark Mentovai2022-07-182-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The MikroTik wAP ac (RBwAPG-5HacD2HnD) is a dual-band dual-radio 802.11ac wireless access point with integrated antenna and two Ethernet ports in a weatherproof enclosure. See https://mikrotik.com/product/wap_ac for more information. Important: this is the new ipq40xx-based wAP ac, not the older ath79-based wAP ac (RBwAPG-5HacT2HnD), already supported in OpenWrt. Specifications: - SoC: Qualcomm Atheros IPQ4018 - CPU: 4x ARM Cortex A7 - RAM: 128MB - Storage: 16MB NOR flash - Wireless - 2.4GHz: Built-in IPQ4018 (SoC) 802.11b/g/n 2x2:2, 2.5 dBi antennae - 5GHz: Built-in IPQ4018 (SoC) 802.11a/n/ac 2x2:2, 2.5 dBi antennae - Ethernet: Built-in IPQ4018 (SoC, QCA8075), 2x 1000/100/10Mb/s ports, one with 802.3af/at PoE in Installation: Boot the initramfs image via TFTP, then flash the sysupgrade image using sysupgrade. Details at https://openwrt.org/toh/mikrotik/common. Notes: This preserves the MAC addresses of the physical Ethernet ports: - eth0 corresponds to the physical port labeled ETH1 and has the base MAC address. This port can be used to power the device. - eth1 corresponds to the physical port labeled ETH2 and has a MAC address one greater than the base. MAC addresses are set from /lib/preinit/05_set_iface_mac_ipq40xx.sh rather than /etc/board.d/02_network so that they are in effect for preinit. This should likely be done for other MikroTik devices and possibly other non-MikroTik devices as well. As this device has 2 physical ports, they are each connected to their respective PHYs, allowing the link status to be visible to software. Since they are not marked on the case with any role (such as LAN or WAN), both are bridged to the lan network by default, although this can easily be changed if needed. Signed-off-by: Mark Mentovai <mark@mentovai.com>
* ipq40xx: add support for Meraki MR74Matthew Hagan2022-06-193-2/+5
| | | | | | | | | | | | The Meraki MR74 is part of the "Insect" series. This device is essentially an outdoor variant of the MR33 with identical hardware, but requiring a config@3 DTS option to be set to allow booting with the stock u-boot. The install procedure is replicated from the MR33, with the exception being that the MR74 sysupgrade image must be used. Signed-off-by: Matthew Hagan <mnhagan88@gmail.com>
* ipq40xx: add support for Linksys WHW01 v1Peter Adkins2022-06-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for Linksys WHW01 v1 ("Velop") [FCC ID Q87-03331]. Specification ------------- SOC: Qualcomm IPQ4018 WiFi 1: Qualcomm QCA4019 IEEE 802.11b/g/n WiFi 2: Qualcomm QCA4019 IEEE 802.11a/n/ac Bluetooth: Qualcomm CSR8811 (A12U) Ethernet: Qualcomm QCA8072 (2-port) SPI Flash 1: Mactronix MX25L1605D (2MB) SPI Flash 2: Winbond W25M02GV (256MB) DRAM: Nanya NT5CC128M16IP-DI (256MB) LED Controller: NXP PCA963x (I2C) Buttons: Single reset button (GPIO). Notes ----- There does not appear to be a way to trigger TFTP recovery without entering U-Boot. The device must be opened to access the serial console in order to first flash OpenWrt onto a device from factory. The device has automatic recovery backed by a second set of partitions on the larger of the two SPI flash ICs. Both the primary and secondary must be flashed to prevent accidental rollback to "factory" after 3 failed boot attempts. Serial console -------------- A serial console is available on the following pins of the populated J2 connector on the device mainboard (115200 8n1). (<-- Top of PCB / Device) J2 [o o o o o o] | | | | | `-- GND | `---- TX `--------- RX Installation instructions ------------------------- 1. Setup TFTP server with server IP set to 192.168.1.236. 2. Copy compiled `...squashfs-factory.bin` to `nodes-jr.img` in tftp root. 3. Connect to console using pinout detailed in the serial console section. 4. Power on device and press enter when prompted to drop into U-Boot. 5. Flash first partition device via `run flashimg`. 6. Once complete, reset device and allow to power up completely. 7. Once comfortable with device upgrade reboot and drop back into U-Boot. 8. Flash the second partition (recovery) via `run flashimg2`. Revert to "factory" ------------------- 1. Download latest firmware update from vendor support site. 2. Copy extracted `.img` file to `nodes-jr.img` in tftp root. 3. Connect to console using pinout detailed in the serial console section. 4. Power on device and press enter when prompted to drop into U-Boot. 5. Flash first partition device via `run flashimg`. 6. Once complete, reset device and allow to power up completely. 7. Once comfortable with device upgrade reboot and drop back into U-Boot. 8. Flash the second partition (recovery) via `run flashimg2`. Link: https://github.com/openwrt/openwrt/pull/3682 Signed-off-by: Peter Adkins <peter@sunkenlab.com> (calibration from nvmem, updated to 5.10+5.15) Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* ipq40xx: Add subtarget for Google WiFi (Gale)Brian Norris2022-03-251-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Google WiFi (codename: Gale) is an IPQ4019-based AP, with 2 Ethernet ports, 2x2 2.4+5GHz WiFi, 512 MB RAM, 4 GB eMMC, and a USB type C port. In its stock configuration, it runs a Chromium OS-based system, but you wouldn't know it, since you can only manage it via a "cloud" + mobile-app system. The "v2" label is coded into the bootloader, which prefers the "google,gale-v2" compatible string. I believe "v1" must have been pre-release hardware. Note: this is *not* the Google Nest WiFi, released in 2019. I include "factory.bin" support, where we generate a GPT-based disk image with 2 partitions -- a kernel partition (using the custom "Chrome OS kernel" GUID type) and a root filesystem partition. See below for flashing instructions. Sysupgrade is supported via recent emmc_do_upgrade() helper. This is a subtarget because it enables different features (FEATURES=boot-part rootfs-part) whose configurations don't make sense in the "generic" target, and because it builds in a few USB drivers, which are necessary for installation (installation is performed by booting from USB storage, and so these drivers cannot be built as modules, since we need to load modules from USB storage). Flashing instructions ===================== Documented here: https://openwrt.org/inbox/toh/google/google_wifi Note this requires booting from USB storage. Features ======== I've tested: * Ethernet, both WAN and LAN ports * eMMC * USB-C (hub, power-delivery, peripherals) * LED0 (R/G/B) * WiFi (limited testing) * SPI flash * Serial console: once in developer mode, console can be accessed via the USB-C port with SuzyQable, or other similar "Closed Case Debugging" tools: https://chromium.googlesource.com/chromiumos/third_party/hdctools/+/master/docs/ccd.md#suzyq-suzyqable * Sysupgrade Not tested: * TPM Known not working: * Reboot: this requires some additional TrustZone / SCM configuration to disable Qualcomm's SDI. I have a proposal upstream, and based on IRC chats, this might be acceptable with additional DT logic: [RFC PATCH] firmware: qcom_scm: disable SDI at boot https://lore.kernel.org/linux-arm-msm/20200721080054.2803881-1-computersforpeace@gmail.com/ * SMP: enabling secondary CPUs doesn't currently work using the stock bootloader, as the qcom_scm driver assumes newer features than this TrustZone firmware has. I posted notes here: [RFC] qcom_scm: IPQ4019 firmware does not support atomic API? https://lore.kernel.org/linux-arm-msm/20200913201608.GA3162100@bDebian/ * There's a single external button, and a few useful internal GPIO switches. I haven't hooked them up. The first two are fixed with subsequent commits. Additional notes ================ Much of the DTS is pulled from the Chrome OS kernel 3.18 branch, which the manufacturer image uses. Note: the manufacturer bootloader knows how to patch in calibration data via the wifi{0,1} aliases in the DTB, so while these properties aren't present in the DTS, they are available at runtime: # ls -l /sys/firmware/devicetree/base/soc/wifi@a*/qcom,ath10k-pre-calibration-data -r--r--r-- 1 root root 12064 Jul 15 19:11 /sys/firmware/devicetree/base/soc/wifi@a000000/qcom,ath10k-pre-calibration-data -r--r--r-- 1 root root 12064 Jul 15 19:11 /sys/firmware/devicetree/base/soc/wifi@a800000/qcom,ath10k-pre-calibration-data Ethernet MAC addresses are similarly patched in via the ethernet{0,1} aliases. Signed-off-by: Brian Norris <computersforpeace@gmail.com> (updated 901 - x1pro moved in the process) Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* ipq40xx: add support for ZTE MF286DPawel Dembicki2022-02-051-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ZTE MF286D is a LTE router with four gigabit ethernet ports and integrated QMI mPCIE modem. Hardware specification: - CPU: IPQ4019 - RAM: 256MB - Flash: NAND 128MB + NOR 2MB - WLAN1: Qualcomm Atheros QCA4019 2.4GHz 802.11bgn 2x2:2 - WLAN2: Qualcomm Atheros QCA4019 5GHz 802.11anac 2x2:2 - LTE: mPCIe cat 12 card (Modem chipset MDM9250) - LAN: 4 Gigabit Ports - USB: 1x USB2.0 (regular port). 1x USB3.0 (mpcie - used by the modem) - Serial console: X8 connector 115200 8n1 Known issues: - Many LEDs are driven by the modem. Only internal LEDs and wifi LEDs are driven by cpu. - Wifi LED is triggered by phy0tpt only - No VoIP support - LAN1/WAN port is configured as WAN - ZTE gives only one MAC per device. Use +1/+2/+3 increment for WAN and WLAN0/1 Opening the case: 1. Take of battery lid (no battery support for this model, battery cage is dummy). 2. Unscrew screw placed behind battery lid. 3. Take off back cover. It attached with multiple plastic clamps. 4. Unscrew four more screws hidden behind back case. 5. Remove front panel from blue chassis. There are more plastic clamps. 6. Unscrew two boards, which secures the PCB in the chassis. 7. Extract board from blue chassis. Console connection (X8 connector): 1. Parameters: 115200 8N1 2. Pin description: (from closest pin to X8 descriptor to farthest) - VCC (3.3V) - TX - RX - GND Install Instructions: Serial + initramfs: 1. Place OpenWrt initramfs image for the device on a TFTP in the server's root. This example uses Server IP: 192.168.1.3 2. Connect serial console (115200,8n1) to X8 connector. 3. Connect TFTP server to RJ-45 port. 4. Stop in u-Boot and run u-Boot commands: setenv serverip 192.168.1.3 setenv ipaddr 192.168.1.72 set fdt_high 0x85000000 tftp openwrt-ipq40xx-generic-zte_mf286d-initramfs-fit-zImage.itb bootm $loadaddr 5. Please make backup of original partitions, if you think about revert to stock. 6. Login via ssh or serial and remove stock partitions: ubiattach -m 9 ubirmvol /dev/ubi0 -N ubi_rootfs ubirmvol /dev/ubi0 -N ubi_rootfs_data 7. Install image via "sysupgrade -n". Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com> (cosmetic changes to the commit message) Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* ipq40xx: add MikroTik cAP ac supportAlar Aun2022-02-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for the MikroTik RouterBOARD RBcAPGi-5acD2nD (cAP ac), a indoor dual band, dual-radio 802.11ac wireless AP, two 10/100/1000 Mbps Ethernet ports. See https://mikrotik.com/product/cap_ac for more info. Specifications: - SoC: Qualcomm Atheros IPQ4018 - RAM: 128 MB - Storage: 16 MB NOR - Wireless: · Built-in IPQ4018 (SoC) 802.11b/g/n 2x2:2, 2.5 dBi antennae · Built-in IPQ4018 (SoC) 802.11a/n/ac 2x2:2, 2.5 dBi antennae - Ethernet: Built-in IPQ4018 (SoC, QCA8075) , 2x 1000/100/10 port, PoE in and passive PoE out Unsupported: - PoE out Installation: Boot the initramfs image via TFTP and then flash the sysupgrade image using "sysupgrade -n" Signed-off-by: Alar Aun <alar.aun@gmail.com>
* ipq40xx: add support for ASUS RT-ACRH17/RT-AC42UJoshua Roys2022-01-153-2/+7
| | | | | | | | | | | | | | | | | | | | | SOC: IPQ4019 CPU: Quad-core ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d DRAM: 256 MB NAND: 128 MiB Macronix MX30LF1G18AC ETH: Qualcomm Atheros QCA8075 Gigabit Switch (4x LAN, 1x WAN) USB: 1x 3.0 (via Synopsys DesignWare DWC3 controller in the SoC) WLAN1: Qualcomm Atheros QCA4019 2.4GHz 802.11bgn 2x2:2 WLAN2: Qualcomm Atheros QCA9984 5GHz 802.11nac 4x4:4 INPUT: 1x WPS, 1x Reset LEDS: Status, WIFI1, WIFI2, WAN (red & blue), 4x LAN This board is very similar to the RT-ACRH13/RT-AC58U. It must be flashed with an intermediary initramfs image, the jffs2 ubi volume deleted, and then finally a sysupgrade with the final image performed. Signed-off-by: Joshua Roys <roysjosh@gmail.com> (added ALT0) Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* ipq40xx: nvmem cells for EZVIZ CS-W3-WD1200G EUPChristian Lamparter2021-12-041-4/+0
| | | | | | | | | | introduce nvmem pre-cal + mac-address cells for both Wifis and ethernet on the EZVIZ CS-W3-WD1200G EUP. This is one of the few devices in which the correct mac adress is already at the right place for Wifi, so no separate nvmem cell is needed. Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* ipq40xx: sysupgrade: drop disabled UBI to UBI logicBjørn Mork2021-12-031-22/+2
| | | | | | | | | | | | | | | | The commented out code is not required, as the comment indicates. The purpose of this code seems to be to avoid issues caused by partially overwriting an existing UBI partition, where some of the erase counters would be reset but not the unmodified ones. This problem has been solved in a more generic way by the UBI EOF marker. This ensures that any old PEBs after the marker are properly initialized. It is therefore unnecessary to erase the whole partition before flashing a new OpenWrt factory image. Signed-off-by: Bjørn Mork <bjorn@mork.no>
* ipq40xx: add support for GL.iNet GL-B2200TruongSinh Tran-Nguyen2021-12-021-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds supports for the GL-B2200 router. Specifications: - SOC: Qualcomm IPQ4019 ARM Quad-Core - RAM: 512 MiB - Flash: 16 MiB NOR - SPI0 - EMMC: 8GB EMMC - ETH: Qualcomm QCA8075 - WLAN1: Qualcomm Atheros QCA4019 2.4GHz 802.11b/g/n 2x2 - WLAN2: Qualcomm Atheros QCA4019 5GHz 802.11n/ac W2 2x2 - WLAN3: Qualcomm Atheros QCA9886 5GHz 802.11n/ac W2 2x2 - INPUT: Reset, WPS - LED: Power, Internet - UART1: On board pin header near to LED (3.3V, TX, RX, GND), 3.3V without pin - 115200 8N1 - UART2: On board with BLE module - SPI1: On board socket for Zigbee module Update firmware instructions: Please update the firmware via U-Boot web UI (by default at 192.168.1.1, following instructions found at https://docs.gl-inet.com/en/3/troubleshooting/debrick/). Normal sysupgrade, either via CLI or LuCI, is not possible from stock firmware. Please do use the *gl-b2200-squashfs-emmc.img file, gunzipping the produced *gl-b2200-squashfs-emmc.img.gz one first. What's working: - WiFi 2G, 5G - WPA2/WPA3 Not tested: - Bluetooth LE/Zigbee Credits goes to the original authors of this patch. V1->V2: - updates *arm-boot-add-dts-files.patch correctly (sorry, my mistake) - add uboot-envtools support V2->V3: - Li Zhang updated official patch to fix wrong MAC address on wlan0 (PCI) interface V3->V4: - wire up sysupgrade Signed-off-by: Li Zhang <li.zhang@gl-inet.com> [fix tab and trailing space, document what's working and what's not] Signed-off-by: TruongSinh Tran-Nguyen <i@truongsinh.pro> [rebase on top of master, address remaining comments] Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com> [remove redundant check in platform.sh] Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* ipq40xx: add MikroTik LHGG-60ad outdoor 802.11ad (60GHz) dishAlexander Couzens2021-12-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | LHGG-60ad is IPQ4019 + wil6210 based. Specification: - Qualcomm IPQ4019 (717 MHz) - 256 MB of RAM (DDR3L) - 16 MB (SPI NOR) of flash - 1x Gbit ethernet, 802.3af/at POE IN connected through AR8035. - WLAN: wil6210 802.11ad PCI card - No USB or SD card ports - UART disabled - 8x LEDs Biggest news is the wil6210 PCI card. Integration for its configuration and detection has already been taken care of when adding support for TP-Link Talon AD7200. However, signal quality is much lower than with stock firmware, so probably additional board-specific data has to be provided to the driver and is still missing at the moment. Signed-off-by: Robert Marko <robimarko@gmail.com> Signed-off-by: Alexander Couzens <lynxis@fe80.eu> Signed-off-by: Daniel Golle <daniel@makrotopia.org> [Fix Ethernet Interface] Signed-off-by: Nick Hainke <vincent@systemli.org>
* ipq40xx: Add support for Teltonika RUTX10Felix Matouschek2021-11-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the Teltonika RUTX10. This device is an industrial DIN-rail router with 4 ethernet ports, 2.4G/5G dualband WiFi, Bluetooth, a USB 2.0 port and two GPIOs. The RUTX series devices are very similiar so common parts of the DTS are kept in a DTSI file. They are based on the QCA AP-DK01.1-C1 dev board. See https://teltonika-networks.com/product/rutx10 for more info. Hardware: SoC: Qualcomm IPQ4018 RAM: 256MB DDR3 SPI Flash 1: XTX XT25F128B (16MB, NOR) SPI Flash 2: XTX XT26G02AWS (256MB, NAND) Ethernet: Built-in IPQ4018 (SoC, QCA8075), 4x 10/100/1000 ports WiFi 1: Qualcomm QCA4019 IEEE 802.11b/g/n Wifi 2: Qualcomm QCA4019 IEEE 802.11a/n/ac USB Hub: Genesys Logic GL852GT Bluetooth: Qualcomm CSR8510 (A10U) LED/GPIO controller: STM32F030 with custom firmware Buttons: Reset button Leds: Power (green, cannot be controlled) WiFi 2.4G activity (green) WiFi 5G activity (green) MACs Details verified with the stock firmware: eth0: Partition 0:CONFIG Offset: 0x0 eth1: = eth0 + 1 radio0 (2.4 GHz): = eth0 + 2 radio1 (5.0 GHz): = eth0 + 3 Label MAC address is from eth0. The LED/GPIO controller needs a separate kernel driver to function. The driver was extracted from the Teltonika GPL sources and can be found at following feed: https://github.com/0xFelix/teltonika-rutx-openwrt USB detection of the bluetooth interface is sometimes a bit flaky. When not detected power cycle the device. When the bluetooth interface was detected properly it can be used with bluez / bluetoothctl. Flash instructions via stock web interface (sysupgrade based): 1. Set PC to fixed ip address 192.168.1.100 2. Push reset button and power on the device 3. Open u-boot HTTP recovery at http://192.168.1.1 4. Upload latest stock firmware and wait until the device is rebooted 5. Open stock web interface at http://192.168.1.1 6. Set some password so the web interface is happy 7. Go to firmware upgrade settings 8. Choose openwrt-ipq40xx-generic-teltonika_rutx10-squashfs-nand-factory.ubi 9. Set 'Keep settings' to off 10. Click update, when warned that it is not a signed image proceed Return to stock firmware: 1. Set PC to fixed ip address 192.168.1.100 2. Push reset button and power on the device 3. Open u-boot HTTP recovery at http://192.168.1.1 4. Upload latest stock firmware and wait until the device is rebooted Note: The DTS expects OpenWrt to be running from the second rootfs partition. u-boot on these devices hot-patches the DTS so running from the first rootfs partition should also be possible. If you want to be save follow the instructions above. u-boot HTTP recovery restores the device so that when flashing OpenWrt from stock firmware it is flashed to the second rootfs partition and the DTS matches. Signed-off-by: Felix Matouschek <felix@matouschek.org>
* ipq40xx: add support for MikroTik hAP ac3Robert Marko2021-11-281-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for the MikroTik RouterBOARD RBD53iG-5HacD2HnD (hAP ac³), a indoor dual band, dual-radio 802.11ac wireless AP with external omnidirectional antennae, USB port, five 10/100/1000 Mbps Ethernet ports and PoE passthrough. See https://mikrotik.com/product/hap_ac3 for more info. Specifications: - SoC: Qualcomm Atheros IPQ4019 - RAM: 256 MB - Storage: 16 MB NOR + 128 MB NAND - Wireless: · Built-in IPQ4019 (SoC) 802.11b/g/n 2x2:2, 3 dBi antennae · Built-in IPQ4019 (SoC) 802.11a/n/ac 2x2:2, 5.5 dBi antennae - Ethernet: Built-in IPQ4019 (SoC, QCA8075) , 5x 1000/100/10 port, passive PoE in, PoE passtrough on port 5 - 1x USB Type A port Installation: 1. Boot the initramfs image via TFTP 2. Run "cat /proc/mtd" and look for "ubi" partition mtd device number, ex. "mtd1" 3. Use ubiformat to remove MikroTik specific UBI volumes * Detach the UBI partition by running: "ubidetach -d 0" * Format the partition by running: "ubiformat /dev/mtdN -y" Replace mtdN with the correct mtd index from step 2. 3. Flash the sysupgrade image using "sysupgrade -n" Signed-off-by: Robert Marko <robimarko@gmail.com> Tested-by: Mark Birss <markbirss@gmail.com> Tested-by: Michael Büchler <michael.buechler@posteo.net> Tested-by: Alex Tomkins <tomkins@darkzone.net>
* ipq40xx: add support for P&W R619AC (aka G-DOCK 2.0)Richard Yu2021-11-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | P&W R619AC is a IPQ4019 Dual-Band AC1200 router. It is made by P&W (p2w-tech.com) known as P&W R619AC but marketed and sold more popularly as G-DOCK 2.0. Specification: * SOC: Qualcomm Atheros IPQ4019 (717 MHz) * RAM: 512 MiB * Flash: 16 MiB (NOR) + 128 MiB (NAND) * Ethernet: 5 x 10/100/1000 (4 x LAN, 1 x WAN) * Wireless: - 2.4 GHz b/g/n Qualcomm Atheros IPQ4019 - 5 GHz a/n/ac Qualcomm Atheros IPQ4019 * USB: 1 x USB 3.0 * LED: 4 x LAN, 1 x WAN, 2 x WiFi, 1 x Power (All Blue LED) * Input: 1 x reset * 1 x MicroSD card slot * Serial console: 115200bps, pinheader J2 on PCB * Power: DC 12V 2A * 1 x Unpopulated mPCIe Slot (see below how to connect it) * 1 x Unpopulated Sim Card Slot Installation: 1. Access to tty console via UART serial 2. Enter failsafe mode and mount rootfs <https://openwrt.org/docs/guide-user/troubleshooting/failsafe_and_factory_reset> 3. Edit inittab to enable shell on tty console `sed -i 's/#ttyM/ttyM/' /etc/inittab` 4. Reboot and upload `-nand-factory.bin` to the router (using wget) 5. Use `sysupgrade` command to install Another installation method is to hijack the upgrade server domain of stock firmware, because it's using insecure http. This commit is based on @LGA1150(at GitHub)'s work <https://github.com/LGA1150/openwrt/commit/a4932c8d5a275d1fb4297bd20ec03f9270a45d1c> With some changes: 1. Added `qpic_bam` node in dts. I don't know much about this, but I observed other dtses have this node. 2. Removed `ldo` node under `sd_0_pinmux`, because `ldo` cause SD card not working. This fix is from <https://github.com/coolsnowwolf/lede/commit/51143b4c7571f717afe071db60bbb4db1532cbf2> 3. Removed the 32MB NOR variant. 4. Removed `cd-gpios` in `sdhci` node, because it's reported that it makes wlan2g led light up. 5. Added ethphy led config in dts. 6. Changed nand partition label from `rootfs` to `ubi`. About the 128MiB variant: The stock bootloader sets size of nand to 64MiB. But most of this devices have 128MiB nand. If you want to use all 128MiB, you need to modify the `MIBIB` data of bootloader. More details can be found on github: <https://github.com/openwrt/openwrt/pull/3691#issuecomment-818770060> For instructions on how to flash the MIBIB partition from u-boot console: <https://github.com/openwrt/openwrt/pull/3691#issuecomment-819138232> About the Mini PCIe slot: (from "ygleg") "The REFCLK signals on the Mini PCIe slot is not connected on this board out of the box. If you want to use the Mini PCIe slot on the board, you need to (preferably) solder two 0402 resistors: R436 (REFCLK+) and R444 (REFCLK-)..." This and much more information is provoided in the github comment: <https://github.com/openwrt/openwrt/pull/3691#issuecomment-968054670> Signed-off-by: Richard Yu <yurichard3839@gmail.com> Signed-off-by: DENG Qingfang <dqfext@gmail.com> [Added comment about MIBIB+128 MiB variant. Added commit message section about pcie slot. Renamed gpio-leds' subnodes and added color, function+enum properties.] Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* ipq40xx: add support for Netgear SRR60/SRS60 and RBR50/RBS50Davide Fioravanti2021-11-012-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Netgear SRS60 and SRR60 (sold together as SRK60) are two almost identical AC3000 routers. The SRR60 has one port labeled as wan while the SRS60 not. The RBR50 and RBS50 (sold together as RBK50) have a different external shape but they have an USB 2.0 port on the back. This patch has been tested only on SRS60 and RBR50, but should work on SRR60 and RBS50. Hardware -------- SoC: Qualcomm IPQ4019 (717 MHz, 4 cores 4 threads) RAM: 512MB DDR3 FLASH: 4GB EMMC ETH: - 3x 10/100/1000 Mbps Ethernet - 1x 10/100/1000 Mbps Ethernet (WAN) WIFI: - 2.4GHz: 1x IPQ4019 (2x2:2) - 5GHz: 1x IPQ4019 (2x2:2) - 5GHz: 1x QCA9984 (4x4:4) - 6 internal antennas BTN: - 1x Reset button - 1x Sync button - 1x ON/OFF button LEDS: - 8 leds controlled by TLC59208F (they can be switched on/off independendently but the color can by changed by GPIOs) - 1x Red led (Power) - 1x Green led (Power) UART: - 115200-8-N-1 Everything works correctly. Installation ------------ These routers have a dual partition system. However this firmware works only on boot partition 1 and the OEM web interface will always flash on the partition currently not booted. The following steps will use the SRS60 firmware, but you have to chose the right firmware for your router. There are 2 ways to install Openwrt the first time: 1) Using NMRPflash 1. Download nmrpflash (https://github.com/jclehner/nmrpflash) 2. Put the openwrt-ipq40xx-generic-netgear_srs60-squashfs-factory.img file in the same folder of the nmrpflash executable 3. Connect your pc to the router using the port near the power button. 4. Run "nmrpflash -i XXX -f openwrt-ipq40xx-generic-netgear_srs60-squashfs-factory.img". Replace XXX with your network interface (can be identified by running "nmrpflash -L") 5. Power on the router and wait for the flash to complete. After about a minute the router should boot directly to Openwrt. If nothing happens try to reboot the router. If you have problems flashing try to set "10.164.183.253" as your computer IP address 2) Without NMRPflash The OEM web interface will always flash on the partition currently not booted, so to flash OpenWrt for the first time you have to switch to boot partition 2 and then flash the factory image directly from the OEM web interface. To switch on partition 2 you have to enable telnet first: 1. Go to http://192.168.1.250/debug.htm and check "Enable Telnet". 2. Connect through telent ("telnet 192.168.1.250") and login using admin/password. To read the current boot_part: artmtd -r boot_part To write the new boot_part: artmtd -w boot_part 02 Then reboot the router and then check again the current booted partition Now that you are on boot partition 2 you can flash the factory Openwrt image directly from the OEM web interface. Restore OEM Firmware -------------------- 1. Download the stock firmware from official netgear support. 2. Follow the nmrpflash procedure like above, using the official Netgear firmware (for example SRS60-V2.2.1.210.img) nmrpflash -i XXX -f SRS60-V2.2.1.210.img Notes ----- 1) You can check and edit the boot partition in the Uboot shell using the UART connection. "boot_partition_show" shows the current boot partition "boot_partition_set 1" sets the current boot partition to 1 2) Router mac addresses: LAN XX:XX:XX:XX:XX:69 WAN XX:XX:XX:XX:XX:6a WIFI 2G XX:XX:XX:XX:XX:69 WIFI 5G XX:XX:XX:XX:XX:6b WIFI 5G (2nd) XX:XX:XX:XX:XX:6c LABEL XX:XX:XX:XX:XX:69 Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com> Signed-off-by: Robert Marko <robimarko@gmail.com> [added 5.10 changes for 901-arm-boot-add-dts-files.patch, moved sysupgrade mmc.sh to here and renamed it, various dtsi changes] Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* ipq40xx: add missing case closing symbolAdrian Schmutzler2021-06-281-0/+1
| | | | | | | Though not strictly necessary, add the closing symbol to make the job easier for future developers editing this file. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* treewide: remove "+" sign for increment with macaddr_addAdrian Schmutzler2021-06-051-7/+7
| | | | | | | | | | | | Many people appear to use an unneeded "+" prefix for the increment when calculating a MAC address with macaddr_add. Since this is not required and used inconsistently [*], just remove it. [*] As a funny side-fact, copy-pasting has led to almost all hotplug.d files using the "+", while nearly all of the 02_network files are not using it. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* ipq40xx: add netgear wac510 supportRobert Marko2021-06-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for the Netgear WAC510 Insight Managed Smart Cloud Wireless Access Point, an indoor dual-band, dual-radio 802.11ac business-class wireless AP with integrated omnidirectional antennae and two 10/100/1000 Mbps Ethernet ports. For more information see: <https://www.netgear.com/business/wifi/access-points/wac510> Specifications: SoC: Qualcomm IPQ4018 (DAKOTA) ARM Quad-Core RAM: 256 MiB Flash1: 2 MiB Winbond W25Q16JV SPI-NOR Flash2: 128 MiB Winbond W25N01GVZEIG SPI-NAND Ethernet: Built-in IPQ4018 (SoC, QCA8072 PHY), 2x 1000/100/10 port, WAN port active IEEE 802.3af/at PoE in Wireless1: Built-in IPQ4018 (SoC) 802.11b/g/n 2x2:2, 3 dBi antennae Wireless2: Built-in IPQ4018 (SoC) 802.11a/n/ac 2x2:2, 4 dBi antennae Input: (Optional) Barrel 12 V 2.5 A Power, Reset button SW1 LEDs: Power, Insight, WAN PoE, LAN, 2.4G WLAN, 5G WLAN Serial: Header J2 1 - 3.3 Volt (Do NOT connect!) 2 - TX 3 - RX 4 - Ground WARNING: The serial port needs a TTL/RS-232 3.3 volt level converter! The Serial settings are 115200-8-N-1. Installation via Stock Web Interface: BTW: The default factory console/web interface login user/password are admin/password. In the web interface navigating to Management - Maintenance - Upgrade - 'Firmware Upgrade' will show you what is currently installed e.g.: Manage Firmware Current Firmware Version: V5.0.10.2 Backup Firmware Version: V1.2.5.11 Under 'Upgrade Options' choose Local (alternatively SFTP would be available) then click/select 'Browse File' on the right side, choose openwrt-ipq40xx-generic-netgear_wac510-squashfs-nand-factory.tar and hit the Upgrade button below. After a minute or two your browser should indicate completion printing 'Firmware update complete.' and 'Rebooting AP...'. Note that OpenWrt will use the WAN PoE port as actual WAN port defaulting to DHCP client but NOT allowing LuCI access, use LAN port defaulting to 192.168.1.1/24 to access LuCI. Installation via TFTP Requiring Serial U-Boot Access: Connect to the device's serial port and hit any key to stop autoboot. Upload and boot the initramfs based OpenWrt image as follows: (IPQ40xx) # setenv serverip 192.168.1.1 (IPQ40xx) # setenv ipaddr 192.168.1.2 (IPQ40xx) # tftpboot openwrt-ipq40xx-generic-netgear_wac510-initramfs-fit-uImage.itb (IPQ40xx) # bootm Note: This only runs OpenWrt from RAM and has not installed anything to flash as of yet. One may permanently install OpenWrt as follows: Check the MTD device number of the active partition: root@OpenWrt:/# dmesg | grep 'set to be root filesystem' [ 1.010084] mtd: device 9 (rootfs) set to be root filesystem Upload the factory image ending with .ubi to /tmp (e.g. using scp or tftp). Then flash the image as follows (substituting the 9 in mtd9 below with whatever number reported above): root@OpenWrt:/# ubiformat /dev/mtd9 -f /tmp/openwrt-ipq40xx-generic-netgear_wac510-squashfs-nand-factory.ubi And reboot. Dual Image Configuration: The default U-Boot boot command bootipq uses the U-Boot environment variables primary/secondary to decide which image to boot. E.g. primary=0, secondary=3800000 uses rootfs while primary=3800000, secondary=0 uses rootfs_1. Switching their values changes the active partition. E.g. from within U-Boot: (IPQ40xx) # setenv primary 0 (IPQ40xx) # setenv secondary 3800000 (IPQ40xx) # saveenv Or from a OpenWrt userspace serial/SSH console: fw_setenv primary 0 fw_setenv secondary 3800000 Note that if you install two copies of OpenWrt then each will have its independent configuration not like when switching partitions on the stock firmware. BTW: The kernel log shows which boot partition is active: [ 2.439050] ubi0: attached mtd9 (name "rootfs", size 56 MiB) vs. [ 2.978785] ubi0: attached mtd10 (name "rootfs_1", size 56 MiB) Note: After 3 failed boot attempts it automatically switches partition. Signed-off-by: Robert Marko <robimarko@gmail.com> Signed-off-by: Marcel Ziswiler <marcel@ziswiler.com> [squashed netgear-tar commit into main and rename netgear-tar for now, until it is made generic.] Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* ipq40xx: add support for MikroTik SXTsq 5 acRoger Pueyo Centelles2021-04-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds support for the MikroTik SXTsq 5 ac (RBSXTsqG-5acD), an outdoor 802.11ac wireless CPE with one 10/100/1000 Mbps Ethernet port. Specifications: - SoC: Qualcomm Atheros IPQ4018 - RAM: 256 MB - Storage: 16 MB NOR - Wireless: IPQ4018 (SoC) 802.11a/n/ac 2x2:2, 16 dBi antennae - Ethernet: IPQ4018 (SoC) 1x 10/100/1000 port, 10-28 Vdc PoE in - 1x Ethernet LED (green) - 7x user-controllable LEDs · 1x power (blue) · 1x user (green) · 5x rssi (green) Note: Serial UART is probably available on the board, but it has not been tested. Flashing: Boot via TFTP the initramfs image. Then, upload a sysupgrade image via SSH and flash it normally. More info at the "Common procedures for MikroTik products" page https://openwrt.org/toh/mikrotik/common. Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
* ipq40xx: add MikroTik hAP ac2 supportRobert Marko2021-04-051-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for the MikroTik RouterBOARD RBD52G-5HacD2HnD-TC (hAP ac²), a indoor dual band, dual-radio 802.11ac wireless AP with integrated omnidirectional antennae, USB port and five 10/100/1000 Mbps Ethernet ports. See https://mikrotik.com/product/hap_ac2 for more info. Specifications: - SoC: Qualcomm Atheros IPQ4018 - RAM: 128 MB - Storage: 16 MB NOR - Wireless: · Built-in IPQ4018 (SoC) 802.11b/g/n 2x2:2, 2.5 dBi antennae · Built-in IPQ4018 (SoC) 802.11a/n/ac 2x2:2, 2.5 dBi antennae - Ethernet: Built-in IPQ4018 (SoC, QCA8075) , 5x 1000/100/10 port, passive PoE in - 1x USB Type A port Installation: Boot the initramfs image via TFTP and then flash the sysupgrade image using "sysupgrade -n" Signed-off-by: Robert Marko <robimarko@gmail.com>
* ipq40xx: add support for GL.iNet GL-AP1300Dongming Han2020-12-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifications: SOC: Qualcomm IPQ4018 (DAKOTA) ARM Quad-Core RAM: 256 MiB FLASH1: 4 MiB NOR FLASH2: 128 MiB NAND ETH: Qualcomm QCA8075 WLAN1: Qualcomm Atheros QCA4018 2.4GHz 802.11b/g/n 2x2 WLAN2: Qualcomm Atheros QCA4018 5GHz 802.11n/ac W2 2x2 INPUT: Reset LED: Power, Internet UART1: On board pin header near to LED (3.3V, TX, RX, GND), 3.3V without pin - 115200 8N1 OTHER: On board with BLE module - by cp210x USB serial chip On board hareware watchdog with GPIO0 high to turn on, and GPIO4 for watchdog feed Install via uboot tftp or uboot web failsafe. By uboot tftp: (IPQ40xx) # tftpboot 0x84000000 openwrt-ipq40xx-generic-glinet_gl-ap1300-squashfs-nand-factory.ubi (IPQ40xx) # run lf By uboot web failsafe: Push the reset button for 10 seconds util the power led flash faster, then use broswer to access http://192.168.1.1 Afterwards upgrade can use sysupgrade image. Signed-off-by: Dongming Han <handongming@gl-inet.com>
* ipq40xx: add support for devolo Magic 2 WiFi nextStefan Schake2020-12-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SOC: IPQ4018 / QCA Dakota CPU: Quad-Core ARMv7 Processor rev 5 (v71) Cortex-A7 DRAM: 256 MiB NOR: 32 MiB ETH: Qualcomm Atheros QCA8075 (2 ports) PLC: MaxLinear G.hn 88LX5152 WLAN1: Qualcomm Atheros QCA4018 2.4GHz 802.11bgn 2:2x2 WLAN2: Qualcomm Atheros QCA4018 5GHz 802.11a/n/ac 2:2x2 INPUT: RESET, WiFi, PLC Button LEDS: red/white home, white WiFi To modify a retail device to run OpenWRT firmware: 1) Setup a TFTP server on IP address 192.168.0.100 and copy the OpenWRT initramfs (initramfs-fit-uImage.itb) to the TFTP root as 'uploadfile'. 2) Power on the device while pressing the recessed reset button next to the Ethernet ports. This causes the bootloader to retrieve and start the initramfs. 3) Once the initramfs is booted, the device will come up with IP 192.168.1.1. You can then connect through SSH (allow some time for the first connection). 4) On the device shell, run 'fw_printenv' to show the U-boot environment. Backup this information since it contains device unique factory data. 5) Change the boot command to support booting OpenWRT: # fw_setenv bootcmd 'sf probe && sf read 0x84000000 0x180000 0x400000 && bootm' 6) Change directory to /tmp, download the sysupgrade (e.g. through wget) and install it with sysupgrade. The device will reboot into OpenWRT. Notice that there is currently no support for booting the G.hn chip. This requires userland software we lack the rights to share right now. Signed-off-by: Stefan Schake <stefan.schake@devolo.de>
* ipq40xx: add support for Plasma Cloud PA2200Marek Lindner2020-12-222-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Device specifications: * QCA IPQ4019 * 256 MB of RAM * 32 MB of SPI NOR flash (w25q256) - 2x 15 MB available; but one of the 15 MB regions is the recovery image * 2T2R 2.4 GHz - QCA4019 hw1.0 (SoC) - requires special BDF in QCA4019/hw1.0/board-2.bin with bus=ahb,bmi-chip-id=0,bmi-board-id=20,variant=PlasmaCloud-PA2200 * 2T2R 5 GHz (channel 36-64) - QCA9888 hw2.0 (PCI) - requires special BDF in QCA9888/hw2.0/board-2.bin bus=pci,bmi-chip-id=0,bmi-board-id=16,variant=PlasmaCloud-PA2200 * 2T2R 5 GHz (channel 100-165) - QCA4019 hw1.0 (SoC) - requires special BDF in QCA4019/hw1.0/board-2.bin with bus=ahb,bmi-chip-id=0,bmi-board-id=21,variant=PlasmaCloud-PA2200 * GPIO-LEDs for 2.4GHz, 5GHz-SoC and 5GHz-PCIE * GPIO-LEDs for power (orange) and status (blue) * 1x GPIO-button (reset) * TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX) * 2x gigabit ethernet - phy@mdio3: + Label: Ethernet 1 + gmac0 (ethaddr) in original firmware + used as LAN interface - phy@mdio4: + Label: Ethernet 2 + gmac1 (eth1addr) in original firmware + 802.3at POE+ + used as WAN interface * 12V 2A DC Flashing instructions: The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be used to transfer the factory image to the u-boot when the device boots up. Signed-off-by: Marek Lindner <marek.lindner@kaiwoo.ai> [sven@narfation.org: prepare commit message, rebase, use all LEDs, switch to dualboot_datachk upgrade script, use eth1 as designated WAN interface] Signed-off-by: Sven Eckelmann <sven@narfation.org>
* ipq40xx: add support for Plasma Cloud PA1200Marek Lindner2020-12-222-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Device specifications: * QCA IPQ4018 * 256 MB of RAM * 32 MB of SPI NOR flash (w25q256) - 2x 15 MB available; but one of the 15 MB regions is the recovery image * 2T2R 2.4 GHz - QCA4019 hw1.0 (SoC) - requires special BDF in QCA4019/hw1.0/board-2.bin with bus=ahb,bmi-chip-id=0,bmi-board-id=16,variant=PlasmaCloud-PA1200 * 2T2R 5 GHz - QCA4019 hw1.0 (SoC) - requires special BDF in QCA4019/hw1.0/board-2.bin with bus=ahb,bmi-chip-id=0,bmi-board-id=17,variant=PlasmaCloud-PA1200 * 3x GPIO-LEDs for status (cyan, purple, yellow) * 1x GPIO-button (reset) * 1x USB (xHCI) * TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX) * 2x gigabit ethernet - phy@mdio4: + Label: Ethernet 1 + gmac0 (ethaddr) in original firmware + used as LAN interface - phy@mdio3: + Label: Ethernet 2 + gmac1 (eth1addr) in original firmware + 802.3af/at POE(+) + used as WAN interface * 12V/24V 1A DC Flashing instructions: The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be used to transfer the factory image to the u-boot when the device boots up. Signed-off-by: Marek Lindner <marek.lindner@kaiwoo.ai> [sven@narfation.org: prepare commit message, rebase, use all LEDs, switch to dualboot_datachk upgrade script, use eth1 as designated WAN interface] Signed-off-by: Sven Eckelmann <sven@narfation.org>
* ipq40xx: Change name for openmesh.sh to vendor-free nameSven Eckelmann2020-12-222-5/+5
| | | | | | | | | Other vendors are using functionality similar to the ones OpenMesh used to implement two areas on the flash to store the default image and a fallback image. So just change the name to dualboot_datachk.sh to avoid duplicated code just to have the same script for different vendors. Signed-off-by: Sven Eckelmann <sven@narfation.org>
* ipq40xx: Add support for Linksys MR8300 (Dallas)Hans Geiblinger2020-09-254-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Linksys MR8300 is based on QCA4019 and QCA9888 and provides three, independent radios. NAND provides two, alternate kernel/firmware images with fail-over provided by the OEM U-Boot. Hardware Highlights: SoC: IPQ4019 at 717 MHz (4 CPUs) RAM: 512MB RAM SoC: Qualcomm IPQ4019 at 717 MHz (4 CPUs) RAM: 512M DDR3 FLASH: 256 MB NAND (Winbond W29N02GV, 8-bit parallel) ETH: Qualcomm QCA8075 (4x GigE LAN, 1x GigE Internet Ethernet Jacks) BTN: Reset and WPS USB: USB3.0, single port on rear with LED SERIAL: Serial pads internal (unpopulated) LED: Four status lights on top + USB LED WIFI1: 2x2:2 QCA4019 2.4 GHz radio on ch. 1-14 WIFI2: 2x2:2 QCA4019 5 GHz radio on ch. 36-64 WIFI3: 2x2:2 QCA9888 5 GHz radio on ch. 100-165 Support is based on the already supported EA8300. Key differences: EA8300 has 256MB RAM where MR8300 has 512MB RAM. MR8300 has a revised top panel LED setup. Installation: "Factory" images may be installed directly through the OEM GUI using URL: https://ip-of-router/fwupdate.html (Typically 192.168.1.1) Signed-off-by: Hans Geiblinger <cybrnook2002@yahoo.com> [copied Hardware-highlights from EA8300. Fixed alphabetical order. fixed commit subject, removed bogus unit-address of keys, fixed author (used Signed-off-By to From:) ] Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* ipq40xx: add support for Luma Home WRTQ-329ACNTomasz Maciej Nowak2020-09-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Luma Home WRTQ-329ACN, also known as Luma WiFi System, is a dual-band wireless access point. Specification SoC: Qualcomm Atheros IPQ4018 RAM: 256 MB DDR3 Flash: 2 MB SPI NOR 128 MB SPI NAND WIFI: 2.4 GHz 2T2R integrated 5 GHz 2T2R integrated Ethernet: 2x 10/100/1000 Mbps QCA8075 USB: 1x 2.0 Bluetooth: 1x 4.0 CSR8510 A10, connected to USB bus LEDS: 16x multicolor LEDs ring, controlled by MSP430G2403 MCU Buttons: 1x GPIO controlled EEPROM: 16 Kbit, compatible with AT24C16 UART: row of 4 holes marked on PCB as J19, starting count from the side of J19 marking on PCB 1. GND, 2. RX, 3. TX, 4. 3.3V baud: 115200, parity: none, flow control: none The device supports OTA or USB flash drive updates, unfotunately they are signed. Until the signing key is known, the UART access is mandatory for installation. The difficult part is disassembling the casing, there are a lot of latches holding it together. Teardown Prepare three thin, but sturdy, prying tools. Place the device with back of it facing upwards. Start with the wall having a small notch. Insert first tool, until You'll feel resistance and keep it there. Repeat the procedure for neighbouring walls. With applying a pressure, one edge of the back cover should pop up. Now carefully slide one of the tools to free the rest of the latches. There's no need to solder pins to the UART holes, You can use hook clips, but wiring them outside the casing, will ease debuging and recovery if problems occur. Installation 1. Prepare TFTP server with OpenWrt initramfs image. 2. Connect to UART port (don't connect the voltage pin). 3. Connect to LAN port. 4. Power on the device, carefully observe the console output and when asked quickly enter the failsafe mode. 5. Invoke 'mount_root'. 6. After the overlayfs is mounted run: fw_setenv bootdelay 3 This will allow to access U-Boot shell. 7. Reboot the device and when prompted to stop autoboot, hit any key. 8. Adjust "ipaddr" and "serverip" addresses in U-Boot environment, use 'setenv' to do that, then run following commands: tftpboot 0x84000000 <openwrt_initramfs_image_name> bootm 0x84000000 and wait till OpenWrt boots. 9. In OpenWrt command line run following commands: fw_setenv openwrt "setenv mtdids nand1=spi_nand; setenv mtdparts mtdparts=spi_nand:-(ubi); ubi part ubi; ubi read 0x84000000 kernel; bootm 0x84000000" fw_setenv bootcmd "run openwrt" 10. Transfer OpenWrt sysupgrade image to /tmp directory and flash it with: ubirmvol /dev/ubi0 -N ubi_rootfs sysupgrade -v -n /tmp/<openwrt_sysupgrade_image_name> 11. After flashing, the access point will reboot to OpenWrt, then it's ready for configuration. Reverting to OEM firmware 1. Execute installation guide steps: 1, 2, 3, 7, 8. 2. In OpenWrt command line run following commands: ubirmvol /dev/ubi0 -N rootfs_data ubirmvol /dev/ubi0 -N rootfs ubirmvol /dev/ubi0 -N kernel ubirename /dev/ubi0 kernel1 kernel ubi_rootfs1 ubi_rootfs ubimkvol /dev/ubi0 -S 34 -N kernel1 ubimkvol /dev/ubi0 -S 320 -N ubi_rootfs1 ubimkvol /dev/ubi0 -S 264 -N rootfs_data fw_setenv bootcmd bootipq 3. Reboot. Known issues The LEDs ring doesn't have any dedicated driver or application to control it, the only available option atm is to manipulate it with 'i2cset' command. The default action after applying power to device is spinning blue light. This light will stay active at all time. To disable it install 'i2c-tools' with opkg and run: i2cset -y 2 0x48 3 1 0 0 i The light will stay off until next cold boot. Additional information After completing 5. step from installation guide, one can disable asking for root password on OEM firmware by running: sed -e 's/root:x:/root::/' -i /etc/passwd This is useful for investigating the OEM firmware. One can look at the communication between the stock firmware and the vendor's cloud servers or as a way of making a backup of both flash chips. The root password seems to be constant across all sold devices. This is output of 'led_ctl' from OEM firmware to illustrate possibilities of LEDs ring: Usage: led_ctl [status | upgrade | force_upgrade | version] led_ctl solid COLOR <brightness> led_ctl single COLOR INDEX <brightness 0 - 15> led_ctl spinning COLOR <period 1 - 16 (lower = faster)> led_ctl fill COLOR <period 1 - 16 (lower = faster)> ( default is 5 ) led_ctl flashing COLOR <on dur 1 - 128> <off dur 1 - 128> (default is 34) ( default is 34 ) led_ctl pulsing COLOR COLOR: red, green, blue, yellow, purple, cyan, white Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl> [squash "ipq-wifi: add BDFs for Luma Home WRTQ-329ACN" into commit, changed ubi volumes for easier integration, slightly reworded commit message, changed ubi volume layout to use standard names all around] Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* treewide: remove empty default casesAdrian Schmutzler2020-09-171-2/+0
| | | | | | There is no apparent reason to have an empty default case. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>