Commit Graph

27721 Commits

Author SHA1 Message Date
Tomasz Maciej Nowak 909cc6ef5f x86: remove bootloader upgrade from preinit
This hack was to bring all existing installations to the newest GRUB
version as fast as possible. Since 19.07.x is EoL we can assume this
task is completed. Now sysupgrade will solely be responsible for
bootloader upgrade.

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
2023-02-26 22:22:48 +01:00
Daniel González Cabanelas be0f1c1b26 mvebu: add support for Buffalo LinkStation LS220DE
The Buffalo LinkStation LS220DE is a dual bay NAS, based on Marvell
Armada 370

Hardware:
   SoC:         Marvell Armada 88F6707
   CPU:         Cortex-A9 800 MHz, 1 core
   Flash 1:     SPI-NOR 1 MiB (U-Boot)
   Flash 2:     NAND 512 MiB (OS)
   RAM:         DDR3 256 MiB
   Ethernet:    1x 1GbE
   USB:         1x 2.0
   SATA:        2x 3Gb/s
   LEDs/Input:  5x / 2x (1x button, 1x slide-switch)
   Fan:         1x casing

Flash instructions, from hard drive:
  1. Get access to the "boot" partition at the hard drive where the stock
     firmware is installed. It can be done with acp-commander or by
     plugging the hard drive to a computer.
  2. Backup the stock uImage:
         mv /boot/uImage.buffalo /boot/uImage.buffalo.bak
  3. Move and rename the Openwrt initramfs image to the boot partition:
         mv openwrt-initramfs-kernel.bin /boot/uImage.buffalo
  4. Power on the Linkstation with the hardrive inside. Now Openwrt will
     boot, but still not installed.
  5. Connect via ssh to OpenWrt:
         ssh root@192.168.1.1
  6. Rename boot files inside boot partition
         mount -t ext3 /dev/sda1 /mnt
         mv /mnt/uImage.buffalo /mnt/uImage.buffalo.openwrt.bak
         mv /mnt/initrd.buffalo /mnt/initrd.buffalo.bak
  7. Format ubi partitions at the NAND flash ("kernel_ubi" and "ubi"):
         ubiformat /dev/mtd0 -y
         ubidetach -p /dev/mtd1
         ubiformat /dev/mtd1 -y
  8. Flash the sysupgrade image:
         sysupgrade -n openwrt-squashfs-sysupgrade.bin
  9. Wait until it finish, the device will reboot with OpenWrt installed
     on the NAND flash.

Restore the stock firmware:
  1. Take the hard drive used for the installation and restore boot backup
     files to their original names:
         mount -t ext3 /dev/sda1 /mnt
         mv /mnt/uImage.buffalo.bak /mnt/uImage.buffalo
         mv /mnt/initrd.buffalo.bak /mnt/initrd.buffalo
  2. Boot from the hard drive and perform a stock firmware update using
     the Buffalo utility. The NAND will be restored to the original
     state.

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
2023-02-26 22:22:48 +01:00
Tim Harvey 107f7374c9 octeontx: switch to Kernel 5.15
Switch over from testing version.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2023-02-26 18:15:33 +01:00
Karl Chan 5c04c3943e ramips: Alternative name Asus RT-AC750L for Asus RT-AC1200V2
The Asus RT-AC750L is identical to the already supported Asus RT-AC1200V2. Use the ALT0 buildroot tags to show both devices.

Reference : https://forum.openwrt.org/t/asus-rt-ac750l-is-the-same-as-rt-ac1200-v2/151783

Signed-off-by: Karl Chan <exkc@exkc.moe>
2023-02-26 17:46:27 +01:00
Daniel González Cabanelas ed64c33235 ipq40xx: Linksys MR8300: fix the USB port power
The USB port on the MR8300 randomly fails to feed bus-powered devices.

This is caused by a misconfigured pinmux. The GPIO68 should be used to
enable the USB power (active low), but it's inside the NAND pinmux.

This GPIO pin was found in the original firmware at a startup script in
both MR8300 and EA8300. Therefore apply the fix for both boards.

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
Reviewed-by: Robert Marko <robimarko@gmail.com>
2023-02-25 20:33:40 +01:00
Felix Baumann 688697889c ramips: correct the PCIe port number for some mt7621 devices
MT7621 uses a new PCIe driver in the 5.15+ kernel. Allocating wrong PCIe
port will cause the PCIe NIC to not work properly. This commit fixes
the wrong port numbers on Netgear R6220, WAC104 and WNDR3700 v5.

According to bootlog, MT7612E (5GHz) is connected to pcie0, and
MT7603E (2GHz) is connected to pcie2:
[2.758986] mt7621-pci 1e140000.pcie: pcie1 no card, disable it (RST & CLK)
[2.772862] mt7621-pci 1e140000.pcie: PCIE0 enabled
[2.782579] mt7621-pci 1e140000.pcie: PCIE2 enabled
...
[3.009151] pci 0000:01:00.0: [14c3:7662] type 00 class 0x028000
[3.125715] pci 0000:02:00.0: [14c3:7603] type 00 class 0x028000

Tested-by: Maximilian Baumgartner <aufhaxer@googlemail.com>
Signed-off-by: Shiji Yang <yangshiji66@qq.com>
[felix.bau@gmx.de: adjust commit message for Netgear devices]
Signed-off-by: Felix Baumann <felix.bau@gmx.de>
2023-02-25 20:21:36 +01:00
Daniel Golle aa41f4a395 mvebu: setup effective thermal zones on Puzzle M901 and M902
Assign fan with 4 active cooling levels to be used for the main CPU as
well as external SerDes units.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-02-25 19:01:40 +00:00
Daniel Golle ea33a5def5 mvebu: puzzle: fix fan thermal cooling driver
Several fixes for the Puzzle WT61P803 hwmon driver were needed to make
it behave well as thermal cooling device:
 - wire-up cooling device with OF node in device tree
 - properly parse cooling-levels (u32 with range check vs. u8)
 - actually use cooling-levels
 - keep current state and only write to uC if state has changed
   (avoids flooding the uC with commands which will result in uC crashing)

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-02-25 19:01:40 +00:00
Xinfa Deng dd8a4a8c34 ath79: add support for GL.iNet GL-X1200
This patch adds supports for GL-X1200.

Specification:
	- SOC: QCA9563 (775MHz)
	- Flash: 16 MiB
	- RAM: 128 MiB DDR2
	- Ethernet: 4x 1Gbps LAN + 1x 1Gbps WAN
	- Wireless: QCA9563(2.4GHz) and QCA9886(5GHz)
	- SIM: 2x SIM card slots
	- MicroSD: 1x microSD slot
	- Antenna: 2x external 5dBi antennas
	- USB: 1x USB 2.0 port
	- Button: 1x reset button
	- LED: 16x LEDs (3x GPIO controllable)
	- UART: 1x UART on PCB (JP1: 3.3V, RX, TX, GND)
	- OEM U-Boot supplies HTTP/GUI access

Implementation Notes
====================

Both the NOR and NAND variants boot off a NOR-based kernel,
consistent with the OEM's firmware.

The mode LEDs are
    * Boot, Running   system
    * Failsafe        2G
    * Upgrade         5G

Installation
============

Using sysupgrade
----------------

sysupgrade may be used to install a NAND image on a device running
a NAND image or a NOR image on a device running a NOR image. It is
recommended to *not* preserve config when upgrading from OEM firmware
or previous versions of OpenWrt. No supported sysupgrade path should
require "force". Transitioning from NOR to NAND can be accomplished

Using U-Boot
------------

The OEM U-Boot can be put into a graphical, firmware-upload mode by
holding down the button on the side of the router while applying power
and for a bit more than five seconds following with the current OEM
U-Boot. The power LED will come on, then the 5G LED will flash five
times, about once a second.  When the 5G LED stops flashing and the
2G LED lights solid, the router's U-Boot will provide an upload page
at http://192.168.1.1/ Either a browser may be used to upload an image,
or a utility such as curl may be used:

curl -X POST -F gl_firmware=\@*-nand-squashfs-factory.img \
         http://192.168.1.1/index.html
or
    curl -X POST -F gl_firmware=\@*-nor-squashfs-sysupgrade.bin \
         http://192.168.1.1/index.html

Note that NOR vs. NAND is based on the file name extension.

Signed-off-by: Xinfa Deng <xinfa.deng@gl-inet.com>
2023-02-25 14:31:42 +01:00
Rafał Miłecki eaf5c85fd3 bcm47xx: switch default kernel to the 5.15
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-02-24 12:06:10 +01:00
Rafał Miłecki ee85786b43 bcm47xx: relocate LZMA loader #2
Increased size of the 5.15 kernel requires bumping BZ_TEXT_START again.
Without this CFE hangs at the:
Starting program at 0x80001000

This fixes booting 5.15 based mips74k images on:
1. BCM4706 (Luxul XWR-1750)
2. BCM5357B0 (Linksys E1000 V2.1)
3. BCM47186B0 (Luxul XWR-600)
4. BCM5358 (Linksys E2500 V3)

It isn't needed but also doesn't break:
1. BCM5354 (Asus WL-500gP V2)

Ref: 4cd97e4760 ("bcm47xx: relocate LZMA loader")
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
2023-02-24 12:05:14 +01:00
Hauke Mehrtens 218f425b61 kernel: Add CONFIG_PPC_QUEUED_SPINLOCKS configuration option
The CONFIG_PPC_QUEUED_SPINLOCKS configuration option is not defined for
kernel 5.15, it is defined for kernel 5.10.

This fixes the compilation of mpc85xx/p2020 with kernel 5.15.

Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2023-02-23 22:22:27 +01:00
Rafał Miłecki b4ae914037 kernel: backport NVMEM late fixes from v6.2
They were backported to stable kernels but we backport more stuff on our
own so we have to pick up few remaining.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-02-23 09:50:01 +01:00
Nick Hainke 9837f81bae mpc85xx: switch default kernel to 5.15
The default kernel should be switched to 5.15 in order to enable testing
by a broader audience.

Tested on TP-Link TL-WDR4900 v1.

Acked-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Signed-off-by: Nick Hainke <vincent@systemli.org>
2023-02-22 23:39:01 +01:00
Robert Marko 00c5276659
mvebu: mochabin: enlarge PCI memory window
Armada 7040 uses a rather small 15MB memory window for every PCI adapter,
however this is not sufficient for Qualcomm QCA6390 802.11ax cards that
are shipped along with the OpenWrt WLAN model of MOCHAbin as ath11k
requires at least 16MB of memory.

So, similar to what MACCHIATOBin has been doing for years, lets move
to using the second PCIe 2 memory window and expand it to 128MB to
make it future proof.

This has been already sent upstream [1].
[1] https://lore.kernel.org/linux-arm-kernel/20230219121418.1395401-1-robert.marko@sartura.hr/

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2023-02-21 17:15:40 +01:00
Rafał Miłecki 52ddb38469 kernel: update NVMEM subsystem to the v6.3
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-02-21 11:58:47 +01:00
Pawel Dembicki bfa5e4e4eb
mcp85xx: Switch TP-Link TL-WDR4900 v1 to DSA
This patch introduces DSA support for TP-Link TL-WDR4900 v1 switch.
Swconfig driver for QCA8327 switch is removed because this router is
only one device which use Qualcom swconfig switch.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Tested-by: Nick Hainke <vincent@systemli.org> # TP Link WDR4900 v1 (5.15)
2023-02-20 12:04:44 +01:00
Pawel Dembicki f56ef4c040
mpc85xx: refresh kernel config
It was done by "make kernel_oldconfig" command for 5.10 and 5.15.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
2023-02-20 12:04:43 +01:00
Andre Heider 7ae4716243 toolchain: remove installing twice in the "initial" subdir
This was apparently introduced to recreate the toolchain (wipe
staging_dir/toolchain*, but keep build_dir/toolchain*, followed by a
`make toolchain/compile`).

But it leaves leftovers and causes re-links to happen at src_install phase,
because of the changed paths, possibly adding yet another source of issues.

With the prior commits removing various hacks related to the "initial"
folder we can remove installing it twice altogether.

The recreated toolchain is exactly the same as before.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-02-19 19:44:39 +01:00
Shiji Yang 68004f1942 ramips: add alternative device name for Wiflyer WF3526-P
Wiflyer WF3526-P and Zbtlink ZBT-WE1326 have the same circuit design.
Installing the misunderstading firmware of ZBT-WE3526 will cause Wi-Fi
not work due to allocate the wrong pcie port. Add alternative name to
help users easily build or download the correct firmware.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2023-02-19 18:37:55 +01:00
Shiji Yang c77913be5b ramips: correct the PCIe port number for Zbtlink ZBT-WE1326
MT7621 gets a new PCIe driver in the 5.15+ kernel. Allocating wrong PCIe
port will cause the PCIe NIC to not work properly. This commit fixes
the wrong port numbers on Zbtlink ZBT-WE1326.

According to the bootlog, MT7612E (5 GHz) is connected to pcie1, and
MT7603E (2 GHz) is connected to pcie2:
[4.197658] mt7621-pci 1e140000.pcie: pcie0 no card, disable it (RST & CLK)
[4.204609] mt7621-pci 1e140000.pcie: PCIE1 enabled
[4.209476] mt7621-pci 1e140000.pcie: PCIE2 enabled
...
[4.307988] pci 0000:01:00.0: [14c3:7662] type 00 class 0x028000
[4.367206] pci 0000:02:00.0: [14c3:7603] type 00 class 0x028000

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2023-02-19 18:37:55 +01:00
Christian Marangi 01262c921c
tools/squashfs: rename to squashfs3-lzma
The name of squashfs is confusing since in reality it's a really old
version using an old lzma library. This tools is used for old ath79
netgear target and to produde a fake squasfs3 image needed for some
specific bootloader from some OEM (AVM for example)

Rename squashfs tool to squasfs3-lzma to better describe it.
Rename the installed bin from mksquashfs-lzma to mksquashfs3-lzma.
Use tar transform to migrate the root directory in tar to the new
naming.
Drop redundant PKG_CAT variable not needed anymore.
Also update any user of this tool.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-02-18 21:11:36 +01:00
Brian Norris 46ea81ba99 ipq40xx: chromium: Enable kmod-ramoops by default
Chromium devices (like Google WiFi) have ramoops memory reserved by the
bootloader. Let's enable the ramoops kernel module by default, so we get
better crash logging.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2023-02-18 19:58:22 +01:00
Brian Norris a79abd813d ipq806x: chromium: Enable kmod-ramoops by default
Chromium devices (like OnHub) have ramoops memory reserved by the
bootloader. Let's enable the ramoops kernel module by default, so we get
better crash logging.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2023-02-18 19:58:22 +01:00
Arınç ÜNAL efbb623deb ramips: add support for Huasifei WS1208V2
The Huasifei WS1208V2 is an AC1200 router featuring 5 Ethernet ports with a
Quectel RM520N-GL cellular modem which supports QMI and MBIM modes.

Specifications:
- MT7621AT, 256 MiB RAM, 16 MiB SPI Flash
- MT7603EN 2.4 GHz & MT7612EN 5 GHz WLAN
- Quectel RM520N-GL Cellular Modem
- 2 WLAN & 4 Cellular Antennas
- 5 Gigabit Ethernet Ports
- 1 USB 2.0 port
- 1 PCI-E Slot
- 1 M.2 slot
- 1 SIM card slot
- 1 SD card slot

Installation:
- Install sysupgrade image via ROOter OS.

TFTP Recovery:
- Connect to serial console.
- Boot initramfs image by choosing option 1 when U-Boot prompts.
- Install sysupgrade image via OpenWrt.

Link: https://www.huasifei.com/a/Products/5G%20CPE/240.html
Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
2023-02-18 19:56:37 +01:00
John Audia 461072fc7b kernel: bump 5.10 to 5.10.168
Manually rebased:
  backport-5.10/804-v5.14-0001-nvmem-core-allow-specifying-of_node.patch

Removed upstreamed:
  generic-backport/807-v5.17-0003-nvmem-core-Fix-a-conflict-between-MTD-and-NVMEM-on-w.patch[1]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.168&id=34ec4c7831c416ac56619477f1701986634a7efc

Build system: x86_64
Build-tested: ramips/tplink_archer-a6-v3
Run-tested: ramips/tplink_archer-a6-v3

Signed-off-by: John Audia <therealgraysky@proton.me>
2023-02-18 17:41:23 +01:00
Michael Pratt 6f6d24a00a ramips: add label MAC address for EPG600 and ESR600
set label mac for the current ESR600 and new EPG600
using the board.d scripts

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2023-02-18 16:55:35 +01:00
Michael Pratt 4ef86c620f ramips: add support for Senao Engenius EPG600
FCC ID: A8J-EPG600

Engenius EPG600 is an indoor wireless router with
1 Gb ethernet switch, dual-band wireless,
internal antenna plates, USB, and phone lines (not supported)

this board is a Senao device:
the hardware is equivalent to EnGenius ESR600 (except for phone lines)
the software is Senao SDK which is based on openwrt and uboot
which uses the legacy Senao header with Vendor / Product IDs
to verify the firmware upgrade image.

**Specification:**

  - MT7620 SOC		MIPS 24kec, 2.4 GHz WMAC, 2x2
  - RT5592N WLAN	PCI chip, 5 GHz, 2x2
  - QCA8337N Gb SW	RGMII GbE, SW P0 -- SOC P5, 5 LEDs
  - 40 MHz clock
  - 16 MB FLASH		MX25L12845EMI-10G
  - 64 MB RAM		NT5TU32M16
  - UART console	J2, populated
  - USB 2.0 port	direct to SOC
  - 6 GPIO LEDs		power, 2G, 5G, wps2g, wps5g, line
  - 3 buttons		reset, wps, "reg" (registeration)
  - 4 antennas		internal omni-directional plates

NOT YET SUPPORTED: VoIP

  - Si3050-FT + Si3019-FT	Voice DAA, SPI control, PCM data
  - Phone Ports "TEL", "LINE"	RJ11, 4P2C (2 pins)

**MAC addresses:**

  MAC address labeled as MAC ADDRESS
  MACs present in both wifi cal data and uboot environment

  eth0.1/phy1	----	*:82	rf 0x4
  phy0		----	*:83	factory 0x4
  eth0.2	MAC	*:b8	"wanaddr"

**Installation:**

  Method 1: Firmware upgrade page:

    (if you cannot access the APs webpage)
    factory reset with the reset button
    connect ethernet to a computer
    OEM webpage at 192.168.0.1
    username and password 'admin'

    Navigate to gear icon, "Device Management", "Tools"
    select the factory.dlf image
    Upload and verify checksum

  Method 2: Serial to upload initramfs:

    Follow directions for TFTP recovery
    upload and boot initramfs and do a sysupgrade

**TFTP recovery:**

  Requires UART serial console, reset button does nothing

  rename initramfs-kernel.bin to 'uImageEPG600'
  make available on TFTP server at 192.168.99.8
  power board, interrupt boot with "4"
  execute `tftpboot` and `bootm` (with the load address)

**Return to OEM:**

  Images from OEM are provided, but not compatible
  with openwrt sysupgrade. So it must be modified.

  Alternatively, back up all mtd partitions before flashing

**Note on switch registers:**

  The necessary registers needed for the QCA8337 switch
  can be read from interrupted boot (tftpboot, bootm)
  by using the following lines in the switch driver ar8327.c
  in the function 'ar8327_hw_config_of'
  where 'qca,ar8327-initvals' is parsed from DTS
  before the new register values are written:

    pr_info("0x04 %08x\n", ar8xxx_read(priv, AR8327_REG_PAD0_MODE));
    pr_info("0x08 %08x\n", ar8xxx_read(priv, AR8327_REG_PAD5_MODE));
    pr_info("0x0c %08x\n", ar8xxx_read(priv, AR8327_REG_PAD6_MODE));
    pr_info("0x10 %08x\n", ar8xxx_read(priv, AR8327_REG_POWER_ON_STRAP));

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2023-02-18 16:55:35 +01:00
Michael Pratt 6b07d0c077 ramips: mt7620: split gsw hw_init to mac_init, ephy_init
in order for the option ephy-disable to work
without also needing ephy-base option,
we have to skip all the lines that write to mdio addresses that
assume those addresses do not have an external switch.

Otherwise, ephy ports will be disabled in hardware,
but register writes still happen as if they are enabled.

Split the functions so that other things are done first,
and ephy port setup can be skipped with a simple "return".

Tested on Engenius EPG600 (MT7620A ver:2 eco:3)
with QCA8337 external switch

Ref: cc6fd6fbb5 ("ramips: mt7620: add ephy-disable option to switch driver")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
2023-02-18 16:55:35 +01:00
Karol Przybylski 71a22ef175 ipq807x: Add bluetooth driver to zyxel nbg7815
Zyxel NBG7815 supports bluetooth with blsp1_uart3.
Configuration are already added to dts file, device needs only module to working bluetooth properly.
Tested at below posts:
https://forum.openwrt.org/t/openwrt-support-for-armor-g5-nbg7815/98598/259?u=itork

Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Karol Przybylski <karol.przybylski@esm-technology.pl>
2023-02-18 16:23:31 +01:00
Karl Chan 8ef81b4a19 ramips: fix the name of ASUS AX54 because it has dupilcated twice
The name of ASUS AX54 has dupilcated in the DEVICE_ALT0_VENDOR/DEVICE_ALT0_MODEL

Signed-off-by: Karl Chan <exkc@exkc.moe>
2023-02-18 16:01:30 +01:00
Marcel Ziswiler f6d2a23cbc mediatek: add support for Netgear WAX206
Specifications:
* SoC: MediaTek MT7622BV
* RAM: DDR3 512 MiB (Nanya NT5CC256M16ER-EK)
* Flash: SPI-NAND 256 MiB (Toshiba TC58CVG1S3HRAIJ)
* Wi-Fi 2.4/5 GHz 4T4R:
  * 2.4 GHz: MediaTek MT7622BV
  * 5 GHz: MediaTek MT7915AN/MT7975AN
* Ethernet: 4x 10/100/1000 Mbps LAN,
            1x 10/100/1000/2500 Mbps WAN (Realtek RTL8221B PHY)
* Switch: MediaTek MT7531AE
* LEDs/Keys: 8/1 (Power, Internet, LAN1, LAN2, LAN3, LAN4,
             Wifin and Wifia dual-colour LEDs + Reset pin)
* UART: Marked J19 on board VCC GND TX RX, beginning from "1". 3.3v,
        115200n8
* Power: 12 VDC, 2.5 A

Installation:
* Flash the factory image through the stock web interface, or TFTP to
  the bootloader. NMRP can be used to TFTP without opening the case.
* U-Boot allows booting an initramfs image via TFTP as follows:
  setenv ipaddr 192.168.1.1
  setenv serverip 192.168.1.100
  tftpboot openwrt-mediatek-mt7622-netgear_wax206-initramfs-recovery.itb
  bootm

Known Limitations:
* The 2.5G WAN port labeled 'wan' only works for speeds up to 1G at the
  moment. If connected to a multi-gig port the speed has to be manually
  set to 1G/full either for the switch port or in OpenWrt. For example
  add the following to /etc/rc.local to set it on boot:
  /usr/sbin/ethtool -s wan speed 1000 duplex full

Revert to stock firmware:
* Flash the stock firmware to the bootloader using TFTP/NMRP.

References to WAX206 GPL source:
https://www.downloads.netgear.com/files/GPL/WAX206_V1.0.4.0_Source.rar

* openwrt/target/linux/mediatek/dts/mt7622-netgear-wax206.dts
  DTS file for this device.
* openwrt/target/linux/mediatek/image/mt7622.mk
  Image creation code for this device

Signed-off-by: Marcel Ziswiler <marcel@ziswiler.com>
[fix WAN port (1G only), adjust partition layout, adjust image creation]
Signed-off-by: Thomas Kupper <thomas.kupper@gmail.com>
2023-02-18 15:46:45 +01:00
John Audia 4536c76b55 kernel: bump 5.15 to 5.15.94
Patches automatically rebased.

Build system: x86_64
Build-tested: bcm2711/RPi4B, filogic/xiaomi_redmi-router-ax6000-ubootmod
Run-tested: bcm2711/RPi4B, filogic/xiaomi_redmi-router-ax6000-ubootmod

Signed-off-by: John Audia <therealgraysky@proton.me>
2023-02-18 15:06:04 +01:00
Shiji Yang 748f7f1b9c ramips: backport mt7621 PCIs initialization delay patch
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.
Some devices like ZBT WE1326 and ZBT WF3526-P and some Netgear models need
to delay phy port initialization after calling the mt7621_pcie_init_port()
driver function to get into reliable boots for both warm and hard resets.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2023-02-18 11:41:54 +02:00
Paul Spooren c0683ec458 kernel: 5.15: refresh patches
This commit fixes the following commit

    f584fb2f7e kernel: import accepted MediaTek Ethernet patches

Unrefreshed patches caused the CI to fail.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2023-02-17 18:30:30 +01:00
Christian Marangi 86ecf7bd39
Revert "ipq806x: disable ea8500 image by default"
This reverts commit c4a9a67de8.

Device is now fixed and works correctly with kernel 5.15.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-02-17 04:27:16 +01:00
Christian Marangi e12ff74ba1
Revert "ipq806x: disable ea8500 image by default"
This reverts commit 5384c9337f.

Device is now fixed and works correctly with kernel 5.15.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-02-17 04:27:15 +01:00
Christian Marangi 2ddf479cc7
ipq806x: 5.10: refresh patches
Refresh patches for kernel 5.10

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-02-17 04:27:15 +01:00
Christian Marangi 9a24040d20
ipq806x: fix Linksys EAX500 family devices dead Ethernet switch
With 5.15 kernel version Linksys EAX500 family devices suffered from a
big regression where the Ethernet switch became silent and started to
malfunction.

It was discovered later that the cause was not really the kernel upgrade
itself but a hackish implementation of the hw implementation of these
special routers.

In the original Linksys source code, GPIO 63 was handled in a special way
and was reset on reboot.

Normally GPIO 63 is used for pcie2 reset but in every device we support,
pcie2 is actually never used as nothing is attached to it.

Linksys rerouted GPIO 63 to the switch reset pin and deviates from
common hw implementation.

Till now it was used an hack to handle this case... It was set pcie3 as
working (while actually nothing was connected), set it to output low
(for assert-deassert from the pcie init code) and be done with it.
The result was that the GPIO was reset for enough time in early boot and
everything worked correctly.
This hack implementation was born to fail from the very start and in
kernel 5.15 finally problem arised.

In 5.15 pcie code changed and now the GPIO reset pin is not asserted as
probe won't fail if nothing is connected to the line (the old behaviour)
This result in the switch hold the reset pin and the Ethernet switch
dead.

On top of that with 5.15 code got optimized and simply attaching the
GPIO reset to the mdio wasn't enough as the switch require at least 10ms
to be correctly reset.

So implement finally a correct solution where:
- pcie2 is correctly disabled (nothing attached, unused)
- drop the wrong output-low for pcie2 reset pin
- define GPIO 63 as switch reset
- Add the reset-gpios to the mdio0 node
- Set the reset-post-delay-us to 12ms to correctly give time the switch
  to reset

Fixes: #10983
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-02-17 04:27:15 +01:00
Rodrigo B. de Sousa Martins 77d061167c ramips: Switch default kernel to 5.15
I tested kernel 5.15 on my device for several times without any problems.
In my tests, 5.15 kernel has performance improvements such MGLRU.
Finally, initial kernel 6.1 support is imminent. All ramips subtargets have
5.15 as testing kernel. So, it's time to change.

Tested on my Archer C6 v3.2 (mt7621)

Signed-off-by: Rodrigo B. de Sousa Martins <rodrigo.sousa.577@gmail.com>
[reformat commit subject and message]
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2023-02-17 16:31:53 +02:00
Mikhail Zhilkin 51e5f22096 ramips: fix wrong pcie port number for Arcadyan devices
Wrong pcie port number for WLAN causes missing 5g WLAN interface with 5.15
kernel. This changes port from pcie0 to pcie1 in dtsi.

[1.166330] mt7621-pci 1e140000.pcie: pcie0 no card, disable it (RST & CLK)
[1.180073] mt7621-pci 1e140000.pcie: pcie2 no card, disable it (RST & CLK)
[1.193889] mt7621-pci 1e140000.pcie: PCIE1 enabled

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
2023-02-17 16:30:32 +02:00
Robert Marko 8c3bcc1989
ipq807x: move AQR driver from built-in to kmod
ipq807x does not compile-in hwmon core, and this is leading to the hwmon
code in AQR driver not being compiled due to IS_REACHABLE(CONFIG_HWMON)
evaluating to false as hwmon is being built as a module.

So, lets not compile-in Aquantia PHY driver so it can be included as kmod
instead to have functioning hwmon.

This allows using the thermal sensors in AQR-s as thermal zones for
cooling devices like fans.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-02-15 23:29:01 +01:00
Rafał Miłecki f06bd5bdb8 bcm4908: refactor packet steering init
Replace a standalone init.d script with a platform implementation as
supported by netifd. This avoids a race between netifd and target
specific setups.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-02-15 19:44:11 +01:00
Rafał Miłecki 56a93f9873 bcm53xx: fix shebang in packet_steering.sh
Fixes: 6e555ac3ad ("bcm53xx: refactor packet steering init")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-02-15 19:44:11 +01:00
Rafał Miłecki 6e555ac3ad bcm53xx: refactor packet steering init
Replace a standalone init.d script with a platform implementation as
supported by netifd. This avoids a race between netifd and target
specific setups.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-02-15 14:25:57 +01:00
Daniel Golle f584fb2f7e kernel: import accepted MediaTek Ethernet patches
Import some accepted and pending upstream patches for mtk_eth_soc,
replacing some semantically equivalent local patches and fixing issues
when operating the PCS in 1G SGMII mode.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-02-15 03:28:09 +00:00
Daniel Golle 80196f4e3c mediatek: mtk_thermal: replace with upstream patch
Replace local patch adding thermal support for MT7986 with version
accepted upstream.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-02-15 03:28:09 +00:00
Daniel Golle e8625c89ef treewide: replace /sys/devices/virtual/ubi by /sys/class/ubi
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>
2023-02-15 03:27:59 +00:00
INAGAKI Hiroshi f490295bf2
ipq807x: add support for Buffalo WXR-5950AX12
Buffalo WXR-5950AX12 is a 2.4/5 GHz band 11ax (Wi-Fi 6) router, based on
IPQ8074A.

Specification:

- SoC         : Qualcomm IPQ8074A
- RAM         : DDR3 1024 MiB (2x Nanya NT5CC256M16ER-EK)
- Flash       : RAW NAND 256 MiB (Winbond W29N02GZBIBA)
- WLAN        : 2.4/5 GHz (IPQ8074A)
- Ethernet    : 5 ports
  - WAN       : 100/1000/2500/10000 Mbps x1 (AQR113C)
  - LAN       : 100/1000/2500/10000 Mbps x1 (AQR113C),
                10/100/1000 Mbps x3 (QCA8075)
- LED/Keys    : 8x/5x
- UART        : pin header on PCB (J7)
  - assignment: 3.3V, GND, TX, RX from disc marking
  - settings  : 115200n8
- Power       : 12 VDC, 4 A

Flash instruction using initramfs image:

1. Prepare TFTP server with IP address 192.168.11.10
2. Rename OpenWrt initramfs image to "WXR-5950AX12-initramfs.uImage and
   place it to TFTP directory
3. Hold AOSS (WPS) button and power on WXR-5950AX12
4. WXR-5950AX12 downloads initramfs image from TFTP server and boots
   with it automatically
5. Upload sysupgrade image to WXR-5950AX12 and perform sysupgrade
6. Wait ~120 seconds to complete flashing

Partition layout:

0x000000000000-0x000000100000 : "0:sbl1"
0x000000100000-0x000000200000 : "0:mibib"
0x000000200000-0x000000280000 : "0:bootconfig"
0x000000280000-0x000000300000 : "0:bootconfig1"
0x000000300000-0x000000600000 : "0:qsee"
0x000000600000-0x000000900000 : "0:qsee_1"
0x000000900000-0x000000980000 : "0:devcfg"
0x000000980000-0x000000a00000 : "0:devcfg_1"
0x000000a00000-0x000000a80000 : "0:apdp"
0x000000a80000-0x000000b00000 : "0:apdp_1"
0x000000b00000-0x000000b80000 : "0:rpm"
0x000000b80000-0x000000c00000 : "0:rpm_1"
0x000000c00000-0x000000c80000 : "0:cdt"
0x000000c80000-0x000000d00000 : "0:cdt_1"
0x000000d00000-0x000000d80000 : "0:appsblenv"
0x000000d80000-0x000000e80000 : "0:appsbl"
0x000000e80000-0x000000f80000 : "0:appsbl_1"
0x000000f80000-0x000001000000 : "0:art"
0x000001000000-0x000001080000 : "0:art_1"
0x000001080000-0x000001100000 : "0:orgdata"
0x000001100000-0x000001180000 : "0:orgdata_1"
0x000001180000-0x000005180000 : "rootfs"
0x000005180000-0x000009180000 : "rootfs_recover"
0x000009180000-0x000010000000 : "user_property"

Notes:

- WXR-5950AX12 has 2x OS images on NAND flash. The 1st image is for
  normal operation and the 2nd one is for recoverying or firmware
  upgrading on stock.

- Stock U-Boot checks MD5 hashes in "fw_hash" volume in each "root*"
  partition when booting. This is just a comparation of hash strings.

  Behaviors:

  - both "fw_hash" volumes exist, hashes are rootfs == rootfs_recover
    ---> boot from rootfs

  - both "fw_hash" volumes exist, hashes are rootfs != rootfs_recover
    ---> boot from rootfs_recover

    Note: this behavior is used for firmware upgrading on stock

  - "fw_hash" volume in rootfs is missing
    ---> boot from rootfs_recover

  - "fw_hash" volume in rootfs_recover is missing
    ---> boot from rootfs

  - "fw_hash" volumes in both root* partition are missing
    ---> boot from rootfs_recover

Reverting to stock firmware:

1. Decrypt official image by buffalo-enc and remove header

   example of decryption:

   $ buffalo-enc -i wxr_5950ax12_jp_305 -o wxr_5950ax12_jp_305.dec \
                 -d -k olaffuB -O 0xc8

   example of removing header (v3.05):

   - before

   $ hexdump -n 64 -v -C wxr_5950ax12_jp_305.dec
   00000000  57 58 52 2d 35 39 35 30  41 58 31 32 5f 33 2e 30  |WXR-5950AX12_3.0|
   00000010  35 5f 31 2e 30 31 5f 4a  50 5f 6a 70 5f 71 63 61  |5_1.01_JP_jp_qca|
   00000020  0a 66 69 6c 65 6c 65 6e  3d 34 35 33 35 30 39 31  |.filelen=4535091|
   00000030  32 0a 55 42 49 23 01 00  00 00 00 00 00 00 00 00  |2.UBI#..........|
   00000040

   - after

   $ hexdump -n 64 -v -C wxr_5950ax12_jp_305.ubi
   00000000  55 42 49 23 01 00 00 00  00 00 00 00 00 00 00 00  |UBI#............|
   00000010  00 00 08 00 00 00 10 00  78 cf c4 91 00 00 00 00  |........x.......|
   00000020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
   00000030  00 00 00 00 00 00 00 00  00 00 00 00 3d 2a 64 fd  |............=*d.|
   00000040

2. Boot WXR-5950AX12 with OpenWrt initramfs image

3. Upload modified stock image to WXR-5950AX12

4. Find partitions "rootfs" and "rootfs_recover"

   example:

   root@OpenWrt:/# cat /proc/mtd
   dev:    size   erasesize  name
   ...
   mtd22: 04000000 00020000 "rootfs"
   mtd23: 04000000 00020000 "rootfs_recover"
   ...

   in this case, "rootfs" is mtd22 and "rootfs_recover" is mtd23

5. Format "rootfs"/"rootfs_recover" partition with the uploaded image

   example:

   ubiformat /dev/mtd22 -f /tmp/wxr_5950ax12_jp_305.ubi
   ubiformat /dev/mtd23 -f /tmp/wxr_5950ax12_jp_305.ubi

6. Remove "rootfs"/"rootfs_data" volume from user_property partition

   example:

   . /lib/upgrade/nand.sh
   UBI=$(nand_attach_ubi user_property)
   ubirmvol /dev/$UBI -N rootfs
   ubirmvol /dev/$UBI -N rootfs_data

7. Reboot

MAC addresses:

LAN    : 50:C4:DD:xx:xx:28 (0:APPSBLENV, ethaddr (text))
WAN    : 50:C4:DD:xx:xx:28 (0:APPSBLENV, ethaddr (text))
2.4 GHz: 50:C4:DD:xx:xx:30 (0:APPSBLENV, wlan0addr (text))
5 GHz  : 50:C4:DD:xx:xx:38 (0:APPSBLENV, wlan1addr (text))

Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2023-02-12 01:18:39 +01:00
INAGAKI Hiroshi d256c0bfd7
ipq807x: merge duplicate network configurations in 02_network
Merge network configurations in 02_network of Dynalink DL-WRX36 and
Xiaomi AX9000.

Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2023-02-12 01:18:39 +01:00