Skip to content
Snippets Groups Projects
  1. Mar 08, 2022
  2. Mar 07, 2022
    • INAGAKI Hiroshi's avatar
      realtek: add support for I-O DATA BSH-G24MB · 7b197705
      INAGAKI Hiroshi authored
      
      I-O DATA BSH-G24MB is a 24 port gigabit switch, based on RTL8382M.
      
      Specification:
      
      - SoC		: Realtek RTL8382M
      - RAM		: DDR2 128 MiB (Nanya NT5TU128M8HE-AC)
      - Flash		: SPI-NOR 16 MiB (Macronix MX25L12835FM2I-10G)
      - Ethernet	: 10/100/1000 Mbps x24
        - port 1-8	: RTL8218B
        - port 9-16	: RTL8218B (SoC)
        - port 17-24	: RTL8218B
      - LEDs/Keys	: 2x, 1x
      - UART		: pin header on PCB
        - JP2: 3.3V, TX, RX, GND from rear side
        - 115200n8
      - Power		: 100 VAC, 50/60 Hz
        - Plug	: IEC 60320-C13
      
      Flash instruction using sysupgrade image:
      
      1. Boot BSH-G24MB normally
      2. Connect BSH-G24MB to the DHCP enabled network
      3. Find the device's IP address and open the WebUI and login
         Note: by default, the device obtains IP address from DHCP server of
               the network
      4. Open firmware update page ("ファームウェア アップデート")
      5. Rename the OpenWrt sysupgrade image to "bsh-g24mb_v100.image" and
         select it
      6. Press apply ("適用") button to perform update
      7. Wait ~150 seconds to complete flashing
      
      Note:
      
      - BSH-G24MB has a power-related LED ("電源"), but it's not connected to
        the GPIO of the SoC or RTL8231 and cannot be controlled. Instead of
        it, use system status LED on other than running-state.
      
      - "sys_loop" LED indicates system status and loop-detection status in
        stock firmware.
      
      - BSH-G24MB has 2x os-image partitions named as "RUNTIME"/"RUNTIME2" in
        16 MiB SPI-NOR flash and the size of image per partition is only
        6848 KiB. The secondary image is never used on stock firmware, so also
        use it on OpenWrt to get more space.
      
      Signed-off-by: default avatarINAGAKI Hiroshi <musashino.open@gmail.com>
      7b197705
    • Rafał Miłecki's avatar
      bcm4908: fix init on CFE devices · c45b5abf
      Rafał Miłecki authored
      
      exit in preinit script was stopping whole process
      
      Fixes: 93259e8c ("bcm4908: support "rootfs_data" on U-Boot devices")
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      c45b5abf
  3. Mar 06, 2022
    • Bjørn Mork's avatar
      realtek: net: dsa: configure better brport flags when ports leave the bridge · 0890fb2d
      Bjørn Mork authored
      
      Ensures that the DSA driver sets exactly the same default flags as the
      bridge when a port joins or leaves.  Without this we end up with a
      confusing flag mismatch, where DSA and bridge ports use different sets
      of flags.
      
      This is critical as the "learning" mismatch will be harmful to the
      network, causing all traffic to be flooded on all ports.
      
      The original commit was buggy, trying to set the flags one-by-one in a
      loop.  This was not supported by the API and the end result was that
      all but the last flag were cleared.  This bug was implicitly fixed
      upstream by commit e18f4c18ab5b ("net: switchdev: pass flags and mask
      to both {PRE_,}BRIDGE_FLAGS attributes").
      
      This is a minimum temporary stop measure fix for the critical lack of
      "learning" only.  The major API change associated with a full v5.12+
      backport is neither required nor wanted. A simpler fix, moving the
      call to dsa_port_bridge_flags() out of the loop,  has therefore been
      merged into this modified backport.
      
      Fixes: afa3ab54 ("realtek: Backport bridge configuration for DSA")
      Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
      Acked-by: default avatarDaniel Golle <daniel@makrotopia.org>
      Tested-by: default avatarStijn Tintel <stijn@linux-ipv6.be>
      [fix typos in commit message]
      Signed-off-by: default avatarStijn Tintel <stijn@linux-ipv6.be>
      0890fb2d
    • INAGAKI Hiroshi's avatar
      ramips: use parser_trx for Buffalo WCR-1166DS · f7f9e6bd
      INAGAKI Hiroshi authored
      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 fddc78bc, 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: default avatarINAGAKI Hiroshi <musashino.open@gmail.com>
      f7f9e6bd
    • INAGAKI Hiroshi's avatar
      ramips: switch parser of trx for mt76x8 subtarget · 5403defb
      INAGAKI Hiroshi authored
      
      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: default avatarINAGAKI Hiroshi <musashino.open@gmail.com>
      5403defb
    • INAGAKI Hiroshi's avatar
      kernel: backport patch to allow using parser_trx from ramips · d339de2e
      INAGAKI Hiroshi authored
      
      This patch adds a patch to allow using parser_trx from ramips target,
      mainly for Buffalo devices.
      
      Signed-off-by: default avatarINAGAKI Hiroshi <musashino.open@gmail.com>
      d339de2e
    • INAGAKI Hiroshi's avatar
      kernel: move parser_trx patches of custom magic to generic · cc49abc0
      INAGAKI Hiroshi authored
      
      This patch moves the patches of parser_trx in mediatek target to
      generic/backport-5.10 to use the changes from ramips target and
      backport the additional patch of the parser.
      
      Signed-off-by: default avatarINAGAKI Hiroshi <musashino.open@gmail.com>
      cc49abc0
    • INAGAKI Hiroshi's avatar
      ramips: update MAC address configuration for Buffalo WCR-1166DS · 770cfe9b
      INAGAKI Hiroshi authored
      
      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: default avatarINAGAKI Hiroshi <musashino.open@gmail.com>
      770cfe9b
    • INAGAKI Hiroshi's avatar
      ramips: increase spi frequency for Buffalo WCR-1166DS · 621d88d7
      INAGAKI Hiroshi authored
      
      Use higher frequency than current and up the speed to access to the
      flash on WCR-1166DS.
      
      Signed-off-by: default avatarINAGAKI Hiroshi <musashino.open@gmail.com>
      621d88d7
    • Joe Mullally's avatar
      ramips: Add support for TP-Link TL-WPA8631P v3 · 6c743c30
      Joe Mullally authored
      
      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: default avatarJoe Mullally <jwmullally@gmail.com>
      6c743c30
  4. Mar 05, 2022
    • Langhua Ye's avatar
      mediatek: add support for Ruijie RG-EW3200GX PRO · ce8a33b0
      Langhua Ye authored
      
      X32 Pro is another product  name for it in the Chinese market.
      
      Specifications:
      - SoC: MT7622B
      - RAM: 256MB
      - Flash: XMC XM25QH128C or Winbond WQ25Q128JVSQ 16MB SPI NOR
      - Ethernet: 5x1GbE
      - Switch: MT7531BE
      - WiFi: 2.4G: MT7622 5G: MT7915AN+MT7975AN
      - 3LEDs: System LED(blue) + Mesh LED(green) + Mesh LED(red)
      - 2Keys: Mesh button + Reset button
      - UART: Marked J19 on board. 3.3v, 115200n1
      - Power: 12V 2.5A
      
      MAC addresses as verified by OEM firmware:
      use   address    source
      WAN   *:F4       ethaddr@product_info
      LAN   *:F5
      5g    *:F6
      2g    *:F7
      
      Flash instruction:
      1. Serve the initramfs.img using a TFTP server with address 10.10.10.3.
      2. Interrupt the uboot startup process via UART.
      3. Select "System Load Linux to SDRAM via TFTP" item.
      4. (important) Back up firmware(mtd7) partitions with:
              dd if=/dev/mtd7 of=/tmp/firmware.bin
         and then download the firmware.bin image via SCP.
      5. Flash the OpenWrt sysupgrade firmware.
      
      Recovery stock firmware:
      1. Transfer the firmware.bin image to the device.
      2. Flash the image with:
              mtd write firmware.bin firmware
      
      Signed-off-by: default avatarLanghua Ye <y1248289414@outlook.com>
      ce8a33b0
    • Langhua Ye's avatar
      kernel: add support for XMC XM25QH128C · df1383f7
      Langhua Ye authored
      The XMC XM25QH128C is a 16MB SPI NOR chip. The patch is verified on Ruijie RG-EW3200GX PRO.
      Datasheet available at https://www.xmcwh.com/uploads/435/XM25QH128C.pdf
      
      
      
      Signed-off-by: default avatarLanghua Ye <y1248289414@outlook.com>
      df1383f7
    • Rui Salvaterra's avatar
      kernel: bump 5.10 to 5.10.103 · 05ed7dc5
      Rui Salvaterra authored
      
      Patches automatically rebased.
      
      Signed-off-by: default avatarRui Salvaterra <rsalvaterra@gmail.com>
      05ed7dc5
  5. Mar 04, 2022
    • Rafał Miłecki's avatar
      bcm4908: support "rootfs_data" on U-Boot devices · 93259e8c
      Rafał Miłecki authored
      
      1. Create "rootfs_data" dynamicaly
      
      U-Boot firmware images can contain only 2 UBI volumes: bootfs (container
      with U-Boot + kernel + DTBs) and rootfs (e.g. squashfs). There is no way
      to include "rootfs_data" UBI volume or make firmware file tell U-Boot to
      create one.
      
      For that reason "rootfs_data" needs to be created dynamically. Use
      preinit script to handle that. Fire it right before "mount_root" one.
      
      2. Relate "rootfs_data" to flashed firmware
      
      As already explained flashing new firmware with U-Boot will do nothing
      to the "rootfs_data". It could result in new firmware reusing old
      "rootfs_data" overlay UBI volume and its file. Users expect a clean
      state after flashing firmware (even if flashing the same one).
      
      Solve that by reading flash counter of running firmware and storing it
      in "rootfs_data" UBI volume. Every mismatch will result in wiping old
      data.
      
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      93259e8c
  6. Mar 01, 2022
  7. Feb 28, 2022
  8. Feb 27, 2022
    • Piotr Dymacz's avatar
      ath79: add support for TP-Link Archer A9 v6 · 9c335acc
      Piotr Dymacz authored
      TP-Link Archer A9 v6 (FCCID: TE7A9V6) is an AC1900 Wave-2 gigabit home
      router based on a combination of Qualcomm QCN5502 (most likely a 4x4:4
      version of the QCA9563 WiSOC), QCA9984 and QCA8337N.
      
      The vendor's firmware content reveals that the same device might be
      available on the US market under name 'Archer C90 v6'. Due to lack of
      access to such hardware, support introduced in this commit was tested
      only on the EU version (sold under 'Archer A9 v6' name).
      
      Based on the information on the PL version of the vendor website, this
      device has been already phased out and is no longer available.
      
      Specifications:
      
      - Qualcomm QCN5502 (775 MHz)
      - 128 MB of RAM (DDR2)
      - 16 MB of flash (SPI NOR)
      - 5x Gbps Ethernet (Qualcomm QCA8337N over SGMII)
      - Wi-Fi:
        - 802.11b/g/n on 2.4 GHz: Qualcomm QCN5502* in 4x4:4 mode
        - 802.11a/n/ac on 5 GHz: Qualcomm QCA9984 in 3x3:3 mode
        - 3x non-detachable, dual-band external antennas (~3.5 dBi for 5 GHz,
          ~2.2 dBi for 2.4 GHz, IPEX/U.FL connectors)
        - 1x internal PCB antenna for 2.4 GHz (~1.8 dBi)
      - 1x USB 2.0 Type-A
      - 11x LED (4x connected to QCA8337N, 7x connected to QCN5502)
      - 2x button (reset, WPS)
      - UART (4-pin, 2.54 mm pitch) header on PCB (not populated)
      - 1x mechanical power switch
      - 1x DC jack (12 V)
      
        *) unsupported due to missing support for QCN550x in ath9k
      
      UART system serial console notice:
      
      The RX signal of the main SOC's UART on this device is shared with the
      WPS button's GPIO. The first-stage U-Boot by default disables the RX,
      resulting in a non-functional UART input.
      If you press and keep 'ENTER' on the serial console during early
      boot-up, the first-stage U-Boot will enable RX input.
      
      Vendor firmware allows password-less access to the system over serial.
      
      Flash instruction (vendor GUI):
      
      1. It is recommended to first upgrade vendor firmware to the latest
         version (1.1.1 Build 20210315 rel.40637 at the time of writing).
      2. Use the 'factory' image directly in the vendor's GUI.
      
      Flash instruction (TFTP based recovery in second-stage U-Boot):
      
      1. Rename 'factory' image to 'ArcherA9v6_tp_recovery.bin'
      2. Setup a TFTP server on your PC with IP 192.168.0.66/24.
      3. Press and hold the reset button for ~5 sec while turning on power.
      4. The device will download image, flash it and reboot.
      
      Flash instruction (web based recovery in first-stage U-Boot):
      
      1. Use 'CTRL+C' during power-up to enable CLI in first-stage U-Boot.
      2. Connect a PC with IP set to 192.168.0.1 to one of the LAN ports.
      3. Issue 'httpd' command and visit http://192.168.0.1
      
       in browser.
      4. Use the 'factory' image.
      
      If you would like to restore vendor's firmware, follow one of the
      recovery methods described above.
      
      Signed-off-by: default avatarPiotr Dymacz <pepe2k@gmail.com>
      9c335acc
    • Piotr Dymacz's avatar
      ath79: add support for ALFA Network Tube-2HQ · 131671bc
      Piotr Dymacz authored
      
      ALFA Network Tube-2HQ is a successor of the Tube-2H/P series (EOL) which
      was based on the Atheros AR9331. The new version uses Qualcomm QCA9531.
      
      Specifications:
      
      - Qualcomm/Atheros QCA9531 v2
      - 650/400/200 MHz (CPU/DDR/AHB)
      - 64 or 128 MB of RAM (DDR2)
      - 16+ MB of flash (SPI NOR)
      - 1x 10/100 Mbps Ethernet with passive PoE input (24 V)
        (802.3at/af PoE support with optional module)
      - 1T1R 2.4 GHz Wi-Fi with external PA (SE2623L, up to 27 dBm) and LNA
      - 1x Type-N (male) antenna connector
      - 6x LED (5x driven by GPIO)
      - 1x button (reset)
      - external h/w watchdog (EM6324QYSP5B, enabled by default)
      - UART (4-pin, 2.00 mm pitch) header on PCB
      
      Flash instruction:
      
      You can use sysupgrade image directly in vendor firmware which is based
      on LEDE/OpenWrt. Alternatively, you can use web recovery mode in U-Boot:
      
      1. Configure PC with static IP 192.168.1.2/24.
      2. Connect PC with one of RJ45 ports, press the reset button, power up
         device, wait for first blink of all LEDs (indicates network setup),
         then keep button for 3 following blinks and release it.
      3. Open 192.168.1.1 address in your browser and upload sysupgrade image.
      
      Signed-off-by: default avatarPiotr Dymacz <pepe2k@gmail.com>
      131671bc
    • Piotr Dymacz's avatar
      ath79: utilize ath9k 'nvmem-cells' on ALFA Network boards · 53ac6ee5
      Piotr Dymacz authored
      
      Drop custom 'mtd-cal-data' and switch to 'nvmem-cells' based solution
      for fetching radio calibration data and its MAC address.
      
      Signed-off-by: default avatarPiotr Dymacz <pepe2k@gmail.com>
      53ac6ee5
    • Piotr Dymacz's avatar
      ath79: reduce 'nvmem-cells' definitions on ALFA Network QCA9531 boards · f645bacd
      Piotr Dymacz authored
      
      All the QCA9531 based boards from ALFA Network are based on the same
      design and share a common DTSI: 'qca9531_alfa-network_r36a.dtsi'.
      
      Instead of defining 'nvmem-cells' for the MAC address in every device's
      DTS, move definition to the common DTSI file.
      
      Signed-off-by: default avatarPiotr Dymacz <pepe2k@gmail.com>
      f645bacd
    • Paul Spooren's avatar
      bcm63xx: switch to Kernel 5.10 · 493b60d0
      Paul Spooren authored
      
      Bump the last missing target to Kernel 5.10. While this requires a work
      around to boot it will allow more people to test the new Kernel before
      the upcomming release.
      
      Signed-off-by: default avatarPaul Spooren <mail@aparcar.org>
      493b60d0
    • Paul Spooren's avatar
      bcm63xx: fix booting with Kernel 5.10 · c3ccc452
      Paul Spooren authored
      
      This is a workaround to make the target overall bootable. With this more
      people should be able to test the Kernel 5.10 and report further issues.
      
      Suggested-by: default avatarDaniel González Cabanelas <dgcbueu@gmail.com>
      Signed-off-by: default avatarPaul Spooren <mail@aparcar.org>
      c3ccc452
    • Stijn Tintel's avatar
      ramips: support TP-Link EAP615-Wall · a1b8a4d7
      Stijn Tintel authored
      
      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: default avatarStijn Tintel <stijn@linux-ipv6.be>
      Reviewed-by: default avatarSander Vanheule <sander@svanheule.net>
      Acked-by: default avatarArınç ÜNAL <arinc.unal@arinc9.com>
      a1b8a4d7
  9. Feb 26, 2022
    • Claudiu Beznea's avatar
      at91: remove pm debug features from sama5 kernel config · d52bf5a4
      Claudiu Beznea authored
      
      Remove PM debug features from sama5 kernel config. It is not
      necessary to have it on production code. This also fixes the
      build for sama5 target after commit 97158fe1 ("kernel:
      package ramoops pstore-ram crash log storage)
      
      Fixes: 97158fe1 ("kernel: package ramoops pstore-ram crash log storage")
      Signed-off-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
      d52bf5a4
    • Hannu Nyman's avatar
      ipq806x: Increase kernel size to 4 MB for EA8500/EA7500v1 · ec32c4ef
      Hannu Nyman authored
      
      Increase the kernel size from 3 MB to 4 MB for EA8500 and EA7500v1.
      * modify the common .dtsi
      * modify the kernel size in the image recipes
      
      Define compat-version 2.0 to force factory image usage for sysupgrade.
      Add explanation message. Reenable both devices.
      
      As for 4MiB (and not more): Hannu Nyman noted that:
      "We have lots of ipq806x devices with 4 MB kernel, so will
      need action at that point in future in any case.
      (Assuming that the bootloader did not have a 4 MB limit that
      has been tested...)"
      
      Signed-off-by: default avatarHannu Nyman <hannu.nyman@iki.fi>
      (squashed, added 4MiB notice of support in ipq806x)
      Signed-off-by: default avatarChristian Lamparter <chunkeey@gmail.com>
      ec32c4ef
    • Lech Perczak's avatar
      ath79: support ZTE MF286A/R · 7ac8da00
      Lech Perczak authored
      ZTE MF286A and MF286R are indoor LTE category 6/7 CPE router with simultaneous
      dual-band 802.11ac plus 802.11n Wi-Fi radios and quad-port gigabit
      Ethernet switch, FXS and external USB 2.0 port.
      
      Hardware highlights:
      - CPU: QCA9563 SoC at 775MHz,
      - RAM: 128MB DDR2,
      - NOR Flash: MX25L1606E 2MB SPI Flash, for U-boot only,
      - NAND Flash: W25N01GV 128MB SPI NAND-Flash, for all other data,
      - Wi-Fi 5GHz: QCA9886 2x2 MIMO 802.11ac Wave2 radio,
      - WI-Fi 2.4GHz: QCA9563 3x3 MIMO 802.11n radio,
      - Switch: QCA8337v2 4-port gigabit Ethernet, with single SGMII CPU port,
      - WWAN:
        [MF286A] MDM9230-based category 6 internal LTE modem
        [MF286R] PXA1826-based category 7 internal LTE modem
        in extended  mini-PCIE form factor, with 3 internal antennas and
        2 external antenna connections, single mini-SIM slot.
      - FXS: one external ATA port (handled entirely by modem part) with two
        physical connections in parallel,
      - USB: Single external USB 2.0 port,
      - Switches: power switch, WPS, Wi-Fi and reset buttons,
      - LEDs: Wi-Fi, Test (internal). Rest of LEDs (Phone, WWAN, Battery,
        Signal state) handled entirely by modem. 4 link status LEDs handled by
        the switch on the backside.
      - Battery: 3Ah 1-cell Li-Ion replaceable battery, with charging and
        monitoring handled by modem.
      - Label MAC device: eth0
      
      The device shares many components with previous model, MF286, differing
      mostly by a Wave2 5GHz radio, flash layout and internal LED color.
      In case of MF286A, the modem is the same as in MF286. MF286R uses a
      different modem based on Marvell PXA1826 chip.
      
      Internal modem of MF286A is supported via uqmi, MF286R modem isn't fully
      supported, but it is expected to use comgt-ncm for connection, as it
      uses standard 3GPP AT commands for connection establishment.
      
      Console connection: connector X2 is the console port, with the following
      pinout, starting from pin 1, which is the topmost pin when the board is
      upright:
      - 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.
      
      Installation:
      Due to different flash layout from stock firmware, sysupgrade from
      within stock firmware is impossible, despite it's based on QSDK which
      itself is based on OpenWrt.
      
      STEP 0: Stock firmware update:
      As installing OpenWrt cuts you off from official firmware updates for
      the modem part, it is recommended to update the stock firmware to latest
      version before installation, to have built-in modem at the latest firmware
      version.
      
      STEP 1: gaining root shell:
      
      Method 1:
      This works if busybox has telnetd compiled in the binary.
      If this does not work, try method 2.
      
      Using well-known exploit to start telnetd on your router - works
      only if Busybox on stock firmware has telnetd included:
      - Open stock firmware web interface
      - Navigate to "URL filtering" section by going to "Advanced settings",
        then "Firewall" and finally "URL filter".
      - Add an entry ending with "&&telnetd&&", for example
        "http://hostname/&&telnetd&&".
      - telnetd will immediately listen on port 4719.
      - After connecting to telnetd use "admin/admin" as credentials.
      
      Method 2:
      This works if busybox does not have telnetd compiled in. Notably, this
      is the case in DNA.fi firmware.
      If this does not work, try method 3.
      
      - Set IP of your computer to 192.168.0.22. (or appropriate subnet if
        changed)
      - Have a TFTP server running at that address
      - Download MIPS build of busybox including telnetd, for example from:
        https://busybox.net/downloads/binaries/1.21.1/busybox-mips
        and put it in it's root directory. Rename it as "telnetd".
      - As previously, login to router's web UI and navigate to "URL
        filtering"
      - Using "Inspect" feature, extend "maxlength" property of the input
        field named "addURLFilter", so it looks like this:
        <input type="text" name="addURLFilter" id="addURLFilter" maxlength="332"
          class="required form-control">
      - Stay on the page - do not navigate anywhere
      - Enter "http://aa&zte_debug.sh
      
       192.168.0.22 telnetd" as a filter.
      - Save the settings. This will download the telnetd binary over tftp and
        execute it. You should be able to log in at port 23, using
        "admin/admin" as credentials.
      
      Method 3:
      If the above doesn't work, use the serial console - it exposes root shell
      directly without need for login. Some stock firmwares, notably one from
      finnish DNA operator lack telnetd in their builds.
      
      STEP 2: Backing up original software:
      As the stock firmware may be customized by the carrier and is not
      officially available in the Internet, IT IS IMPERATIVE to back up the
      stock firmware, if you ever plan to returning to stock firmware.
      It is highly recommended to perform backup using both methods, to avoid
      hassle of reassembling firmware images in future, if a restore is
      needed.
      
      Method 1: after booting OpenWrt initramfs image via TFTP:
      PLEASE NOTE: YOU CANNOT DO THIS IF USING INTERMEDIATE FIRMWARE FOR INSTALLATION.
      - Dump stock firmware located on stock kernel and ubi partitions:
      
        ssh root@192.168.1.1: cat /dev/mtd4 > mtd4_kernel.bin
        ssh root@192.168.1.1: cat /dev/mtd9 > mtd9_ubi.bin
      
      And keep them in a safe place, should a restore be needed in future.
      
      Method 2: using stock firmware:
      - Connect an external USB drive formatted with FAT or ext4 to the USB
        port.
      - The drive will be auto-mounted to /var/usb_disk
      - Check the flash layout of the device:
      
        cat /proc/mtd
      
        It should show the following:
        mtd0: 000a0000 00010000 "u-boot"
        mtd1: 00020000 00010000 "u-boot-env"
        mtd2: 00140000 00010000 "reserved1"
        mtd3: 000a0000 00020000 "fota-flag"
        mtd4: 00080000 00020000 "art"
        mtd5: 00080000 00020000 "mac"
        mtd6: 000c0000 00020000 "reserved2"
        mtd7: 00400000 00020000 "cfg-param"
        mtd8: 00400000 00020000 "log"
        mtd9: 000a0000 00020000 "oops"
        mtd10: 00500000 00020000 "reserved3"
        mtd11: 00800000 00020000 "web"
        mtd12: 00300000 00020000 "kernel"
        mtd13: 01a00000 00020000 "rootfs"
        mtd14: 01900000 00020000 "data"
        mtd15: 03200000 00020000 "fota"
        mtd16: 01d00000 00020000 "firmware"
      
        Differences might indicate that this is NOT a MF286A device but
        one of other variants.
      - Copy over all MTD partitions, for example by executing the following:
      
        for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do cat /dev/mtd$i > \
        /var/usb_disk/mtd$i; done
      
        "Firmware" partition can be skipped, it is a concatenation
        of "kernel" and "rootfs".
      
      - If the count of MTD partitions is different, this might indicate that
        this is not a MF286A device, but one of its other variants.
      - (optionally) rename the files according to MTD partition names from
        /proc/mtd
      - Unmount the filesystem:
      
        umount /var/usb_disk; sync
      
        and then remove the drive.
      - Store the files in safe place if you ever plan to return to stock
        firmware. This is especially important, because stock firmware for
        this device is not available officially, and is usually customized by
        the mobile providers.
      
      STEP 3: Booting initramfs image:
      
      Method 1: using serial console (RECOMMENDED):
      - Have TFTP server running, exposing the OpenWrt initramfs image, and
        set your computer's IP address as 192.168.0.22. This is the default
        expected by U-boot. You may wish to change that, and alter later
        commands accordingly.
      - Connect the serial console if you haven't done so already,
      - Interrupt boot sequence by pressing any key in U-boot when prompted
      - Use the following commands to boot OpenWrt initramfs through TFTP:
      
        setenv serverip 192.168.0.22
        setenv ipaddr 192.168.0.1
        tftpboot 0x81000000 openwrt-ath79-nand-zte_mf286a-initramfs-kernel.bin
        bootm 0x81000000
      
        (Replace server IP and router IP as needed). There is no  emergency
        TFTP boot sequence triggered by buttons, contrary to MF283+.
      - When OpenWrt initramfs finishes booting, proceed to actual
        installation.
      
      Method 2: using initramfs image as temporary boot kernel
      This exploits the fact, that kernel and rootfs MTD devices are
      consecutive on NAND flash, so from within stock image, an initramfs can
      be written to this area and booted by U-boot on next reboot, because it
      uses "nboot" command which isn't limited by kernel partition size.
      - Download the initramfs-kernel.bin image
      - After backing up the previous MTD contents, write the images to the
        "firmware" MTD device, which conveniently concatenates "kernel" and
        "rootfs" partitions that can fit the initramfs image:
      
        nandwrite -p /dev/<firmware-mtd> \
        /var/usb_disk/openwrt-ath79-zte_mf286a-initramfs-kernel.bin
      
      - If write is OK, reboot the device, it will reboot to OpenWrt
        initramfs:
      
        reboot -f
      
      - After rebooting, SSH into the device and use sysupgrade to perform
        proper installation.
      
      Method 3: using built-in TFTP recovery (LAST RESORT):
      - With that method, ensure you have complete backup of system's NAND
        flash first. It involves deliberately erasing the kernel.
      - Download "-initramfs-kernel.bin" image for the device.
      - Prepare the recovery image by prepending 8MB of zeroes to the image,
        and name it root_uImage:
      
        dd if=/dev/zero of=padding.bin bs=8M count=1
      
        cat padding.bin openwrt-ath79-nand-zte_mf286a-initramfs-kernel.bin >
        root_uImage
      
      - Set up a TFTP server at 192.0.0.1/8. Router will use random address
        from that range.
      - Put the previously generated "root_uImage" into TFTP server root
        directory.
      - Deliberately erase "kernel" partition" using stock firmware after
        taking backup. THIS IS POINT OF NO RETURN.
      - Restart the device. U-boot will attempt flashing the recovery
        initramfs image, which will let you perform actual installation using
        sysupgrade. This might take a considerable time, sometimes the router
        doesn't establish Ethernet link properly right after booting. Be
        patient.
      - After U-boot finishes flashing, the LEDs of switch ports will all
        light up. At this moment, perform power-on reset, and wait for OpenWrt
        initramfs to finish booting. Then proceed to actual installation.
      
      STEP 4: Actual installation:
      - Set your computer IP to 192.168.1.22/24
      - scp the sysupgrade image to the device:
      
        scp openwrt-ath79-nand-zte_mf286a-squashfs-sysupgrade.bin \
        root@192.168.1.1:/tmp/
      
      - ssh into the device and execute sysupgrade:
      
        sysupgrade -n /tmp/openwrt-ath79-nand-zte_mf286a-squashfs-sysupgrade.bin
      
      - Wait for router to reboot to full OpenWrt.
      
      STEP 5: WAN connection establishment
      Since the router is equipped with LTE modem as its main WAN interface, it
      might be useful to connect to the Internet right away after
      installation. To do so, please put the following entries in
      /etc/config/network, replacing the specific configuration entries with
      one needed for your ISP:
      
      config interface 'wan'
              option proto 'qmi'
              option device '/dev/cdc-wdm0'
              option auth '<auth>' # As required, usually 'none'
              option pincode '<pin>' # If required by SIM
              option apn '<apn>' # As required by ISP
              option pdptype '<pdp>' # Typically 'ipv4', or 'ipv4v6' or 'ipv6'
      
      For example, the following works for most polish ISPs
      config interface 'wan'
              option proto 'qmi'
              option device '/dev/cdc-wdm0'
              option auth 'none'
              option apn 'internet'
              option pdptype 'ipv4'
      
      The required minimum is:
      config interface 'wan'
              option proto 'qmi'
              option device '/dev/cdc-wdm0'
      In this case, the modem will use last configured APN from stock
      firmware - this should work out of the box, unless your SIM requires
      PIN which can't be switched off.
      
      If you have build with LuCI, installing luci-proto-qmi helps with this
      task.
      
      Restoring the stock firmware:
      
      Preparation:
      If you took your backup using stock firmware, you will need to
      reassemble the partitions into images to be restored onto the flash. The
      layout might differ from ISP to ISP, this example is based on generic stock
      firmware
      The only partitions you really care about are "web", "kernel", and
      "rootfs". These are required to restore the stock firmware through
      factory TFTP recovery.
      
      Because kernel partition was enlarged, compared to stock
      firmware, the kernel and rootfs MTDs don't align anymore, and you need
      to carve out required data if you only have backup from stock FW:
      - Prepare kernel image
        cat mtd12_kernel.bin mtd13_rootfs.bin > owrt_kernel.bin
        truncate -s 4M owrt_kernel_restore.bin
      - Cut off first 1MB from rootfs
        dd if=mtd13_rootfs.bin of=owrt_rootfs.bin bs=1M skip=1
      - Prepare image to write to "ubi" meta-partition:
        cat mtd6_reserved2.bi mtd7_cfg-param.bin mtd8_log.bin mtd9_oops.bin \
        mtd10_reserved3.bin mtd11_web.bin owrt_rootfs.bin > \
        owrt_ubi_ubi_restore.bin
      
      You can skip the "fota" partition altogether,
      it is used only for stock firmware update purposes and can be overwritten
      safely anyway. The same is true for "data" partition which on my device
      was found to be unused at all. Restoring mtd5_cfg-param.bin will restore
      the stock firmware configuration you had before.
      
      Method 1: Using initramfs:
      This method is recmmended if you took your backup from within OpenWrt
      initramfs, as the reassembly is not needed.
      - Boot to initramfs as in step 3:
      - Completely detach ubi0 partition using ubidetach /dev/ubi0_0
      - Look up the kernel and ubi partitions in /proc/mtd
      - Copy over the stock kernel image using scp to /tmp
      - Erase kernel and restore stock kernel:
        (scp mtd4_kernel.bin root@192.168.1.1:/tmp/)
        mtd write <kernel_mtd> mtd4_kernel.bin
        rm mtd4_kernel.bin
      - Copy over the stock partition backups one-by-one using scp to /tmp, and
        restore them individually. Otherwise you might run out of space in
        tmpfs:
      
        (scp mtd3_ubiconcat0.bin root@192.168.1.1:/tmp/)
      
        mtd write <ubiconcat0_mtd> mtd3_ubiconcat0.bin
        rm mtd3_ubiconcat0.bin
      
        (scp mtd5_ubiconcat1.bin root@192.168.1.1:/tmp/)
      
        mtd write <ubiconcat1_mtd> mtd5_ubiconcat1.bin
        rm mtd5_ubiconcat1.bin
      
      - If the write was correct, force a device reboot with
      
        reboot -f
      
      Method 2: Using live OpenWrt system (NOT RECOMMENDED):
      - Prepare a USB flash drive contatining MTD backup files
      - Ensure you have kmod-usb-storage and filesystem driver installed for
        your drive
      - Mount your flash drive
      
        mkdir /tmp/usb
      
        mount /dev/sda1 /tmp/usb
      
      - Remount your UBI volume at /overlay to R/O
      
        mount -o remount,ro /overlay
      
      - Write back the kernel and ubi partitions from USB drive
      
        cd /tmp/usb
        mtd write mtd4_kernel.bin /dev/<kernel_mtd>
      
        mtd write mtd9_ubi.bin /dev/<kernel_ubi>
      
      - If everything went well, force a device reboot with
        reboot -f
      
      Last image may be truncated a bit due to lack of space in RAM, but this will happen over "fota"
      MTD partition which may be safely erased after reboot anyway.
      
      Method 3: using built-in TFTP recovery:
      This method is recommended if you took backups using stock firmware.
      - Assemble a recovery rootfs image from backup of stock partitions by
        concatenating "web", "kernel", "rootfs" images dumped from the device,
        as "root_uImage"
      - Use it in place of "root_uImage" recovery initramfs image as in the
        TFTP pre-installation method.
      
      Quirks and known issuesa
      - It was observed, that CH340-based USB-UART converters output garbage
        during U-boot phase of system boot. At least CP2102 is known to work
        properly.
      - Kernel partition size is increased to 4MB compared to stock 3MB, to
        accomodate future kernel updates - at this moment OpenWrt 5.10 kernel
        image is at 2.5MB which is dangerously close to the limit. This has no
        effect on booting the system - but keep that in mind when reassembling
        an image to restore stock firmware.
      - uqmi seems to be unable to change APN manually, so please use the one
        you used before in stock firmware first. If you need to change it,
        please use protocok '3g' to establish connection once, or use the
        following command to change APN (and optionally IP type) manually:
        echo -ne 'AT+CGDCONT=1,"IP","<apn>' > /dev/ttyUSB0
      - The only usable LED as a "system LED" is the blue debug LED hidden
        inside the case. All other LEDs are controlled by modem, on which the
        router part has some influence only on Wi-Fi LED.
      - Wi-Fi LED currently doesn't work while under OpenWrt, despite having
        correct GPIO mapping. All other LEDs are controlled by modem,
        including this one in stock firmware. GPIO19, mapped there only acts
        as a gate, while the actual signal source seems to be 5GHz Wi-Fi
        radio, however it seems it is not the LED exposed by ath10k as
        ath10k-phy0.
      - GPIO5 used for modem reset is a suicide switch, causing a hardware
        reset of whole board, not only the modem. It is attached to
        gpio-restart driver, to restart the modem on reboot as well, to ensure
        QMI connectivity after reboot, which tends to fail otherwise.
      - Modem, as in MF283+, exposes root shell over ADB - while not needed
        for OpenWrt operation at all - have fun lurking around.
        The same modem module is used as in older MF286.
      
      Signed-off-by: default avatarLech Perczak <lech.perczak@gmail.com>
      7ac8da00
    • Arınç ÜNAL's avatar
      ramips: mt7621-dts: add pinctrl properties for ethernet · 7774b860
      Arınç ÜNAL authored
      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: default avatarArınç ÜNAL <arinc.unal@arinc9.com>
      7774b860
    • Arınç ÜNAL's avatar
      ramips: mt7621-dts: enable flow control on port@6 · 704c8426
      Arınç ÜNAL authored
      
      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: default avatarArınç ÜNAL <arinc.unal@arinc9.com>
      Tested-by: default avatarSungbo Eo <mans0n@gorani.run>
      704c8426
    • Arınç ÜNAL's avatar
      ramips: mt7621-dts: fix switch@1f warnings · 2b202185
      Arınç ÜNAL authored
      
      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: default avatarArınç ÜNAL <arinc.unal@arinc9.com>
      2b202185
    • Alex Henrie's avatar
      ath79: add Zyxel EMG2926-Q10A · fe1ecf1f
      Alex Henrie authored
      
      The Zyxel EMG2926-Q10A is 99% the Zyxel NBG6716, but the bootloader
      expects a different product name when flashing over TFTP. Also, the
      EMG2926-Q10A always has 128 MiB of NAND flash whereas the NBG6716
      reportedly can have either 128 MiB or 256 MiB.
      
      Signed-off-by: default avatarAlex Henrie <alexhenrie24@gmail.com>
      fe1ecf1f
Loading