Commit Graph

64 Commits

Author SHA1 Message Date
Robert Marko d442790bbf generic: 6.1: backport Qualcomm CPUFreq NVMEM changes
Currently, IPQ807x is using CPUFreq NVMEM for dealing with different SoC
SKU-s having different frequency limits, and we are keeping the patches
for it in ipq807x target.

However, we managed to upstream a big cleanup of the driver in order to
make it possible for other SMEM based targets to be added to CPUFreq NVMEM.

IPQ806x will be using CPUFreq NVMEM and depends on these changes as well,
so lets put them in generic backport to avoid code duplication.

This replaces the older patches in ipq807x.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-06-07 13:16:13 +02:00
Robert Marko 4747b96287
ipq807x: mark MDT loader fix as backport
MDT loader fix for remoteproc was already merged, so mark it as a backport
with the future 6.5 kernel version.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-06-06 20:08:10 +02:00
Robert Marko 9ba5e03c24
ipq807x: refresh kernel config
Refresh the kernel config as multiple options were disabled in the generic
config since 6.1 was added to ipq807x.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-06-06 20:08:10 +02:00
Robert Marko 818200fec1
ipq807x: renumber upstreamed patches
We are running out of 00xx numbers to put backports into, so lets just
renumber all of the upstreamed patches back to 0000 and onwards.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-06-06 20:08:00 +02:00
Petr Štetiar a3ee2bf9a1
Revert "ipq807x: add initial support for prpl Foundation Haze board"
This reverts commit 48603a271e as this
was commited by accident, its still work in progress.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2023-06-05 11:46:47 +02:00
Petr Štetiar 48603a271e
ipq807x: add initial support for prpl Foundation Haze board
Haze is prpl Foundation's reference board (WNC LVRP).

Board info:

 - IPQ8072A SoC
 - 2 GiB RAM
 - 4 GiB eMMC
 - 8MiB SPI NOR (MX25U6435F)

 - 3x 1GigE ports (QCA8075)
 - 1x 10GigE port (AQR113C)
 - 1x SFP cage

 - WiFi 6GHz 160MHz (QCN9074)
 - WiFi 5GHz 80+80MHz (QCN5054)
 - WiFi 2.4G (QCN5024)

 - ARM Standard 20-pin 2.54mm/0.1" JTAG (1V8 !!!)
 - Bluetooth v5.0 + EDR with integrated Class 1 PA (CYW20704)
 - 1x M.2 B-key socket with PCIe 3.0
 - 1x USB 3.0 port
 - UART 4-pin 3V3(arrow),RX,TX,GND (115200 8N1)
 - Reset and WPS buttons

Flashing instructions:

 1. From U-Boot boot OpenWrt using initramfs image:

    IPQ807x# tftpboot openwrt-ipq807x-generic-prpl_haze-initramfs-uImage.itb && bootm

 2. In OpenWrt running from initramfs execute sysupgrade:

    root@OpenWrt:/# sysupgrade -n /tmp/openwrt-ipq807x-generic-prpl_haze-squashfs-sysupgrade.bin

Work in progress/known issues:

 * SFP feature not implemented/tested
 * M.2 feature not implemented/tested
 * Bluetooth feature not implemented/tested
 * 6GHz wireless should be working, but not tested
 * MAC address assigments for LAN interfaces

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2023-06-05 08:31:43 +02:00
Petr Štetiar a9be186466
ipq807x: image: factor out common eMMC bits
For better maintainability and reusability.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2023-06-05 08:31:40 +02:00
Petr Štetiar fdea7cb617
ipq807x: image: cleanup unused variables
BLOCKSIZE and PAGESIZE seems to be unused on qnap_301w and zyxel_nbg7815
device which use eMMC storage.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2023-06-05 08:31:39 +02:00
Robert Marko 39e1adc841
ipq807x: remove 5.15 support
Now that 6.1 is the default kernel, there is no reason to keep 5.15 around
as I dont plan to maintain it anymore so lets remove it.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-06-04 03:14:30 +02:00
Robert Marko d1e452da92
ipq807x: switch to kernel 6.1
Now that 6.1 kernel is working fine on ipq807x , lets switch to 6.1 as the
default kernel as its increasingly hard to keep backporting upstreamed
changes to 5.15.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-06-04 03:14:27 +02:00
Robert Marko 10be819a16
ipq807x: 6.1: fix I/O WRITE_ZEROES errors on some eMMC devices
Linux 5.19 added a feature where if there is TRIM support being advertised
on eMMC kernel will use TRIM to offload erasing to zero.

However, like always there are eMMC IC-s that advertise TRIM and kind of
work but trying to use TRIM for offloading will cause I/O errors like:
[   18.085950] I/O error, dev loop0, sector 596 op 0x9:(WRITE_ZEROES) flags 0x800 phys_seg 0 prio class 2

So, lets utilize the kernel MMC quirks DB to disable TRIM for eMMC models
that are known to cause this.

This will fix the WRITE_ZEROES error on:
Qnap 301W which uses Micron MTFC4GACAJCN-1M
Zyxel NBG7815 which uses Kingston EMMC04G-M627

Tested-By: Enrico Mioso <mrkiko.rs@gmail.com> # NBG7815
Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-06-01 19:23:25 +02:00
Robert Marko 61ff33c1c2
ipq807x: enable selecting 6.1 as testing kernel
Allow selecting 6.1 as the testing kernel on ipq807x.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-05-28 08:57:10 +02:00
Robert Marko 09085d1740
ipq807x: 6.1: fix remoteproc booting
In 6.1 booting the remoteprocessor that is actually running the WLAN
unfortunatelly broke, so after a long time bisecting we managed to track it
down to commit ("soc: qcom: mdt_loader: Always invoke PAS mem_setup").

Luckily adding back the relocation check and not making an SCM call
qcom_scm_pas_mem_setup() restored the functionality.

Ansuel has sent the patch upstream.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-05-28 08:57:10 +02:00
Robert Marko 3790a0f942
ipq807x: 6.1: refresh kernel config
Refresh kernel config by running kernel_menuconfig.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-05-28 08:57:09 +02:00
Robert Marko 4fa8fec6c0
ipq807x: 6.1: refresh patches
Manually refresh tsens, PCI and CPR patches to apply and compile.
Then run automatic refresh on rest of the patches.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-05-28 08:57:09 +02:00
Robert Marko 8195922526
ipq807x: drop upstreamed patches
Drop all of the patches that have been already been included in kernel 6.1.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-05-28 08:57:09 +02:00
Robert Marko 4eda3e8b9a
ipq807x: 6.1: copy patches and config from 5.15
Copy patches and config from kernel 5.15 to start preparing kernel 6.1
support.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-05-28 08:57:09 +02:00
Robert Marko bc66c05280
ipq807x: mark merged patches as backports
These 3 patches have been merged upstream, so mark them as backports
along with the kernel version they have been merged into.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-05-28 08:57:08 +02:00
Antti Nykänen 07c45c0859 ipq807x: add support for Compex WPQ873
The Compex WPQ873 is a development board with two M.2 B-key
 slots for cellular modems.

Device info:
 - IPQ8072A SoC
 - 512MiB RAM
 - 256MiB NAND flash
 - 8MiB SPI NOR
 - 3x 1GigE ports
 - 1x 2.5GigE port
 - 2.4GHz/5GHz AX WLAN
 - 1x USB 3.0 port
 - 1x M.2 B-key socket with PCIe 3.0
 - 1x M.2 B-key socket with PCIe 2.0 and USB 3.0
 - 4x SIM card slots
 - Bluetooth LE 5.0 (QCA4024)

Prerequisites
1) TFTP server
2) 3.3V USB to TTL cable for UART console
   2.54mm pitch 4-pin header for UART is readily provided on board, no modifications are necessary to access it
   TTL connector pinout: 2=TX, 3=RX, 4=GND
   Arrow marks pin 1 which is 3.3V
   Serial port settings: 115200 8N1 no flow control

The device will most likely ship with a QSDK-based firmware.

1. Power on device and interrupt u-boot to obtain u-boot CLI

2. set serverip to IP address of the TFTP server, for example:

        `setenv serverip 192.168.1.10`

3. Download image from TFTP server:

        `tftpboot 0x44000000 openwrt-ipq807x-generic-compex_wpq873-squashfs-factory.ubi`

4. Flash ubi image to both partitions and reset:

        `sf probe
         imxtract 0x44000000 ubi
         nand device 0
         nand erase 0x0 0x3400000
         nand erase 0x3c00000 0x3400000
         nand write $fileaddr 0x0 $filesize
         nand write $fileaddr 0x3c00000 $filesize
         reset`

Afterwards, you can use sysupgrade to flash new OpenWRT images.

Signed-off-by: Antti Nykänen <antti.nykanen@nokia.com>
2023-05-26 13:05:02 +03:00
John Audia 228e0e1039 kernel: bump 5.15 to 5.15.111
Removed upstreamed:
	01. backport-5.15/424-v6.4-0001-mtd-core-provide-unique-name-for-nvmem-device-take-t.patch
	02. backport-5.15/424-v6.4-0002-mtd-core-fix-nvmem-error-reporting.patch
	03. generic-backport/424-v6.4-0003-mtd-core-fix-error-path-for-nvmem-provider.patch
	04. generic-backport/828-v6.4-0001-of-Fix-modalias-string-generation.patch
	05. bcm4908/patches-5.15/031-v5.17-0002-arm64-dts-broadcom-bcm4908-add-DT-for-Netgear-RAXE50.patch
	06. bcm4908/patches-5.15/033-v6.0-0001-arm64-dts-Add-DTS-files-for-bcmbca-SoC-BCM63158.patchgit
	07. bcm4908/patches-5.15/033-v6.0-0002-arm64-dts-Add-DTS-files-for-bcmbca-SoC-BCM4912.patchgita
	08. bcm4908/patches-5.15/033-v6.0-0010-arm64-dts-Add-base-DTS-file-for-bcmbca-device-Asus-G.patchgit
	09. bcm4908/patches-5.15/034-v6.1-0005-arm64-dts-Move-BCM4908-dts-to-bcmbca-folder.patch
	10. bcm4908/patches-5.15/036-v6.4-0002-arm64-dts-broadcom-bcmbca-bcm4908-fix-NAND-interrupt.patch
	11. bcm4908/patches-5.15/036-v6.4-0004-arm64-dts-broadcom-bcmbca-bcm4908-fix-procmon-nodena.patch
	12. ipq806x/patches-5.15/104-v6.0-06-ARM-dts-qcom-ipq8064-reduce-pci-IO-size-to-64K.patch

Manually rebased:
	bcm27xx/patches-5.15/950-0078-BCM2708-Add-core-Device-Tree-support.patch
	bcm27xx/patches-5.15/950-0547-ARM-dts-Add-Pi-Zero-2-support.patch
	bcm4908/patches-5.15/033-v6.0-0001-arm64-dts-Add-DTS-files-for-bcmbca-SoC-BCM63158.patchgit
	bcm4908/patches-5.15/033-v6.0-0002-arm64-dts-Add-DTS-files-for-bcmbca-SoC-BCM4912.patchgit
	bcm4908/patches-5.15/030-v5.16-0001-arm64-dts-broadcom-bcm4908-Fix-NAND-node-name.patch
	bcm4908/patches-5.15/032-v5.18-0002-arm64-dts-broadcom-bcm4908-add-pinctrl-binding.patch
	bcm4908/patches-5.15/032-v5.18-0003-arm64-dts-broadcom-bcm4908-add-watchdog-block.patch
	bcm4908/patches-5.15/032-v5.18-0004-arm64-dts-broadcom-bcm4908-add-I2C-block.patch
	bcm4908/patches-5.15/033-v6.0-0003-ARM64-dts-Add-DTS-files-for-bcmbca-SoC-BCM6858.patchgit
	bcm4908/patches-5.15/033-v6.0-0008-arm64-dts-broadcom-bcm4908-Fix-timer-node-for-BCM490.patchgit
	bcm4908/patches-5.15/034-v6.1-0001-arm64-dts-broadcom-bcm4908-add-remaining-LED-pins.patch
	bcm4908/patches-5.15/034-v6.1-0002-arm64-dts-broadcom-bcm4908-add-LEDs-controller-block.patch
	bcm4908/patches-5.15/034-v6.1-0003-arm64-dts-broadcom-bcm4908-add-Asus-GT-AC5300-LEDs.patch
	bcm4908/patches-5.15/034-v6.1-0004-arm64-dts-bcmbca-update-BCM4908-board-dts-files.patch

All other patches automatically rebased.

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

01. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.111&id=77112d23a671697f0f70695ab901f807e15d2093
02. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.111&id=fe07b3b5af01f42b291f5da0da09d047f50b33a6
03. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.111&id=273be36e420924237f6c9d43cdad96718c13dd52
04. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.111&id=fe8ab85ed4958e58e991bba0aa0a655b552b0273
05. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.111&id=6ae67829fa5e9e71f458f69db42f0e216225616a
06. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.111&id=1994284cb9226b65ca3a6744ce3320218b584f26
07. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.111&id=a46878476c5549a4fde15a31922ce80a50b23492
08. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.111&id=112ff0f2530549d50510f116474924f9c4fad590
09. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.111&id=7c253e98685e6d884d12e2618ef4d2ad90b4fbd7
10. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.111&id=8444b46e163aa9559a0af0381a1d230ec4146eb2
11. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.111&id=6d1af517817a760d7af3dee0fc4603645485495c
12. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.111&id=cc4f0e168a5630ad0491ac5328f1a89f3cf3d04e

Signed-off-by: John Audia <therealgraysky@proton.me>
2023-05-13 22:38:35 +02:00
John Audia 45f5115253 kernel: bump 5.15 to 5.15.109
Removed upstreamed:
	backport-5.15/743-v6.3-0005-net-dsa-b53-mmap-add-phy-ops.patch[1]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.109&id=357fa038d93d0e9159a0f0d45bae0f8654e2ade5

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

Signed-off-by: John Audia <therealgraysky@proton.me>
2023-04-30 00:02:47 +02:00
Rafał Miłecki 9a62b3977f kernel: backport NVMEM patch for U-Boot env data "ethaddr" cell
Adjust our local code to avoid breakage.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-04-06 12:21:29 +02:00
Alexandru Gagniuc 7801161c4b ipq807x: add support for Netgear WAX218
Netgear WAX218 is a 802.11ax AP claiming AX3600 support. It is wall
or ceiling mountable. It can be powered via PoE, or a 12 V adapter.

The board has footprints for 2.54mm UART headers. They're difficult to
solder because the GND is connected to a large copper plane. Only try
soldering if you are very skilled. Otherwise, use pogo pins.

Specifications:
---------------
    * CPU: Qualcomm IPQ8072A Quad core Cortex-A53 2.2GHz
    * RAM: 366 MB of RAM available to OS, not sure of total amount
    * Storage: Macronix MX30UF2G18AC 256MB NAND
    * Ethernet:
            * 2.5G RJ45 port (QCA8081) with PoE input
    * WLAN:
            * 2.4GHz/5GHz with 8 antennas
    * LEDs:
            * Power (Amber)
            * LAN (Blue)
            * 2G WLAN (Blue)
            * 5G WLAN (Blue)
    * Buttons:
            * 1x Factory reset
    * Power: 12V DC Jack
    * UART: Two 4-pin unpopulated headers near the LEDs
            * "J2 UART" is the CPU UART, 3.3 V level

Installation:
=============

Web UI method
-------------

Flashing OpenWRT using the vendor's Web UI is problematic on this
device. The u-boot mechanism for communicating the active rootfs is
antiquated and unreliable. Instead of setting the kernel commandline,
it relies on patching the DTS partitions of the nand node. The way
partitions are patched is incompatible with newer kernels.

Newer kernels use the SMEM partition table, which puts "rootfs" on
mtd12. The vendor's Web UI will flash to either mtd12 or mtd14. One
reliable way to boot from mtd14 and avoid boot loops is to use an
initramfs image.

 1. In the factory web UI, navigate to System Manager -> Firmware.
 2. In the "Local Firmware Upgrade" section, click Browse
 3. Navigate and select the 'web-ui-factory.fit' image
 4. Click "Upload"
 5. On the following page, click on "Proceed"

The flash proceeds at this point and the system will reboot
automatically to OpenWRT.

 6. Flash the 'nand-sysupgrade.bin' using Luci or the commandline

SSH method
----------

Enable SSH using the CLI or Web UI. The root account is locked out to
ssh, and the admin account defaults to Netgear's CLI application.
So we need to get creative:

First, make sure the device boots from the second firmware partition:

    ssh -okexalgorithms=diffie-hellman-group14-sha1 admin@<ipaddr> \
        /usr/sbin/fw_setenv active_fw 1

Then reboot the device, and run the update:

    scp -O -o kexalgorithms=diffie-hellman-group14-sha1 \
        -o hostkeyalgorithms=ssh-rsa \
        netgear_wax218-squashfs-nand-factory.ubi \
        admin@<ipaddr>:/tmp/openwrt.ubi

    ssh -okexalgorithms=diffie-hellman-group14-sha1 admin@<ipaddr> \
        /usr/sbin/ubiformat /dev/mtd12 -f /tmp/openwrt.ubi

    ssh -okexalgorithms=diffie-hellman-group14-sha1 admin@<ipaddr> \
        /usr/sbin/fw_setenv active_fw 0

Now reboot the device, and it should boot into a ready-to-use OpenWRT.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Robert Marko <robimarko@gmail.com>
Tested-by: Francisco G Luna <frangonlun@gmail.com>
2023-03-20 11:40:36 -05:00
John Audia d6d8851d12 kernel: bump 5.15 to 5.15.100
Manually rebased:
        bcm27xx/patches-5.15/950-0421-Support-RPi-DPI-interface-in-mode6-for-18-bit-color.patch
        bcm27xx/patches-5.15/950-0706-media-i2c-imx219-Scale-the-pixel-clock-rate-for-the-.patch
        ramips/patches-5.15/810-uvc-add-iPassion-iP2970-support.patch

Removed upstreamed:
        bcm27xx/patches-5.15/950-0707-drm-vc4-For-DPI-MEDIA_BUS_FMT_RGB565_1X16-is-mode-1-.patch[1]
        bcm27xx/patches-5.15/950-0596-drm-vc4-dpi-Add-option-for-inverting-pixel-clock-and.patch[2]
        ipq807x/0006-v5.16-arm64-dts-qcom-Fix-IPQ8074-PCIe-PHY-nodes.patch [3]
        ipq807x/0034-v6.1-arm64-dts-qcom-ipq8074-fix-PCIe-PHY-serdes-size.patch [4]
        ipq807x/0103-arm64-dts-qcom-ipq8074-fix-Gen2-PCIe-QMP-PHY.patch [5]
        ipq807x/0104-arm64-dts-qcom-ipq8074-fix-Gen3-PCIe-QMP-PHY.patch [6]
        ipq807x/0105-arm64-dts-qcom-ipq8074-correct-Gen2-PCIe-ranges.patch [7]
        ipq807x/0108-arm64-dts-qcom-ipq8074-fix-Gen3-PCIe-node.patch [8]
        ipq807x/0109-arm64-dts-qcom-ipq8074-correct-PCIe-QMP-PHY-output-c.patch [9]
        ipq807x/0132-arm64-dts-qcom-ipq8074-correct-USB3-QMP-PHY-s-clock-.patch [10]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.99&id=d2991e6b30020e286f2dd9d3b4f43548c547caa6
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/drivers/gpu/drm/vc4/vc4_dpi.c?h=v5.15.100&id=8e04aaffb6de5f1ae61de7b671c1531172ccf429
3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/arm64/boot/dts/qcom/ipq8074.dtsi?h=v5.15.99&id=a55a645aa303a3f7ec37db69822d5420657626da
4. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/arm64/boot/dts/qcom/ipq8074.dtsi?h=v5.15.99&id=d9df682bcea57fa25f37bbf17eae56fa05662635
5. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/arm64/boot/dts/qcom/ipq8074.dtsi?h=v5.15.99&id=7e6eeb5fb3aa9e5feffdb6e137dcc06f5f6410e1
6. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/arm64/boot/dts/qcom/ipq8074.dtsi?h=v5.15.99&id=e88204931d9a60634cd50bbc679f045439c4b91d
7.  https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/arm64/boot/dts/qcom/ipq8074.dtsi?h=v5.15.99&id=1563af0f28afd3b6d64ac79a2aecced3969c90bf
8. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/arm64/boot/dts/qcom/ipq8074.dtsi?h=v5.15.99&id=feb8c71f015d416f1afe90e1f62cf51e47376c67
9. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/arm64/boot/dts/qcom/ipq8074.dtsi?h=v5.15.99&id=69c7a270357a7d50ffd3471b14c60250041200e3
10. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/arm64/boot/dts/qcom/ipq8074.dtsi?h=v5.15.99&id=dd3d021ae5471d98adf81f1e897431c8657d0a18

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

Signed-off-by: John Audia <therealgraysky@proton.me>
Tested-by: Robert Marko <robimarko@gmail.com> #ipq807x/Dynalink WRX36
Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> #ipq807x/ax3600, x86_64/FW-7543B, ath79/tl-wdr3600, ipq806x/g10, ipq806x/nbg6817
2023-03-18 12:52:17 +01:00
INAGAKI Hiroshi 1cd8dfe659 ipq807x: don't generate factory.ubi for Buffalo WXR-5950AX12
On WXR-5950AX12, squashfs-factory.ubi is unnecessary for OpenWrt
installation and other purposes, so drop it from IMAGES and don't
generate to prevent confusion of users.

Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2023-03-04 13:12:40 +01:00
Nick Hainke 7c5e847827 kernel: move CONFIG_PAGE_POOL to generic
Move "# CONFIG_PAGE_POOL is not set" to generic.

Suggested-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Nick Hainke <vincent@systemli.org>
2023-03-04 10:20:58 +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
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
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
INAGAKI Hiroshi f5d962f9b3
ipq807x: enable regulator-fixed driver
Enable regulator-fixed to define the regulator of USB vbus on Buffalo
WXR-5950AX12.

Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2023-02-12 01:18:35 +01:00
John Audia 3c0676911b kernel: bump 5.15 to 5.15.93
All 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-11 23:39:30 +01:00
Felix Baumann abdb9f327e
ipq807x: fix dts whitespace
Replace blanks with tabs

Signed-off-by: Felix Baumann <felix.bau@gmx.de>
2023-02-09 03:03:51 +01:00
Robert Marko bd9844a6fd ipq807x: refresh kernel config
Refresh the ipq807x kernel config to keep it up to date and in sync with
the generic one.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-02-07 11:22:50 +01:00
Rosen Penev 059263dd6e ipq807x: remove libwolfsslcpu-crypto dependency
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-02-04 02:35:03 +01:00
Rosen Penev 2630e5063d treewide: replace wpad-basic-wolfssl default
The newly merged mbedtls backend is smaller and has fewer ABI related
issues than the wolfSSL one.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-02-04 02:35:03 +01:00
John Audia 59fe39f6fc kernel: bump 5.15 to 5.15.91
Manually rebased:
  pending-5.15/103-kbuild-export-SUBARCH.patch

All other 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-03 09:34:32 +01:00
Hannu Nyman 91add68e50
ipq807x: Enable CPU frequency scaling stats
Enable the CPU frequency scaling statistics in kernel config.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Reviewed-by: Robert Marko <robimarko@gmail.com>
2023-01-31 16:33:21 +01:00
André Valentin 5dee596501
ipq807x: Add ZyXEL NBG7815
ZyXEL NBG7815 is a premium 802.11ax "tri"-band router/AP.
Specifications:
* CPU: Qualcomm IPQ8072A Quad core Cortex-A53 2.2GHz
* RAM: 1 GB 2x Nanya NT5CC256M16ER-EK
* Storage:
        * 8MB serial flash Winbond W25Q64DW
        * 4GB eMMC flash Kingston EMMC04G-M627
* Ethernet:
        * 4x1G RJ45 ports (QCA8074A) with 1x status LED per port
        * 1x2.5G RJ45 port (QCA8081) with 1x status LED
        * 1x10G RJ45 port (AQR113C) with 1x status LED
* Switch: Qualcomm Atheros QCA8075
* WLAN:
        * 2.4GHz: Qualcomm QCN5024 4x4@40MHz 802.11b/g/n/ax 1147 Mbps PHY rate
        * 2x 5GHz: Qualcomm QCN5054 4x4 802.11a/b/g/n/ac/ax 2402 PHY rate
* Bluetooth CSR8811 using HSUART, currently unsupported
* USB: 1x USB3.0 Type-A port
* LED-s currently not supported:
        * White
        * Dark Blu
        * Amber
        * Purple
        * Purple and dark blue
        * Red
* Buttons:
        * 1x Soft reset
* Power: 12V DC Jack

Installation instructions:
* Disconnect WAN
* Reset device to factory defaults by pushing reset button 15 sec,
  LEDs should lit orange color.
* After 5-10 minutes, when the LEDs turn constant dark blue,
  put your LAN cable and connect at address 192.168.123.1 by telnet on port 23
* Login with
  NBG7815 login: root
  password: nbg7815@2019
* cd /tmp/ApplicationData
* wget -O openwrt-ipq807x-generic-zyxel_nbg7815-squashfs-sysupgrade.bin http://...
* wget https://github.com/itorK/nbg7815_tools/blob/main/flash_to_openwrt.sh
* run flash_to_openwrt.sh
If you can't use wget, you can transfer the files via nc.
See https://openwrt.org/inbox/toh/zyxel/nbg7815_armor_g5 for installation details.

Bluetooth usage:
* you need at least package bluez-utils, recommended bluez-daemon
* run following commands to enable and start
  hciattach  /dev/ttyMSM1 bcsp
  hciconfig hci0 up

Many thanks to itorK for his work on this device:
https://github.com/itorK/openwrt/tree/nbg7815

Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: André Valentin <avalentin@marcant.net>
2023-01-19 13:26:15 +01:00
André Valentin 952c738c0f
ipq807x: add nvmem uboot-env support
Enabling kernel symbol CONFIG_NVMEM_U_BOOT_ENV allows to use u-boot
environement variable ethaddr with nvmen. That way it is possible to assign
the MAC address to the ethernet device driver.

Example of usage in dts:
....
	partition@600000 {
			compatible = "u-boot,env";
			label = "0:appsblenv";
			reg = <0x600000 0x10000>;

			macaddr_lan: ethaddr {
			};
	};
....
&dp5 {
	status = "okay";
	phy-handle = <&qca8081>;
	label = "wan";
	nvmem-cells = <&macaddr_lan>;
	nvmem-cell-names = "mac-address-ascii";
	mac-address-increment = <1>;
};

This is needed for Zyxel NBG7815.

Signed-off-by: André Valentin <avalentin@marcant.net>
2023-01-19 13:26:15 +01:00
Dirk Buchwalder 26c095cb4d ipq807x: add Dynalink DL-WRX36
Dynalink DL-WRX36 is a AX WIFI router with 4 1G and 1 2.5G ports.

Specifications:

    •     CPU: Qualcomm IPQ8072A Quad core Cortex-A53 2.2GHz
    •     RAM: 1024MB of DDR3
    •     Storage: 256MB Nand
    •     Ethernet: 4x 1G RJ45 ports (QCA8075) + 1 2.5G Port (QCA8081)
    •     WLAN:
          2.4GHz: Qualcomm QCN5024 2x2 802.11b/g/n/ax 1174 Mbps PHY rate
          5GHz: Qualcomm QCN5054 4x4 802.11a/b/g/n/ac/ax 2402 PHY rate
    •     1x USB 3.0

    •     1 gpio-controlled dual color led (blue/red)

            • Buttons: 1x soft reset / 1x WPS
            • Power: 12V DC jack

        A poulated serial header is onboard (J1004)
        the connector size is a 4-pin 2.0 mm JST PH.
        RX/TX is working, u-boot bootwait is active, secure boot is enabled.

        Notes:
	- Serial is completely deactivated in the stock firmware image.
	- This commit adds only single partition support, that means
	  sysupgrade is upgrading the current rootfs partition.
	- Installation can be done by serial connection or
	  SSH access on OEM firmware

	Installation Instructions:

	Most part of the installation is performed from an initramfs image
	running OpenWrt, and there are two options to boot it.

	Boot initramfs option 1: Using serial connection (3.3V)
	1. Stop auto boot to get to U-boot shell
	2. Transfer initramfs image to device
	   (openwrt-ipq807x-generic-dynalink_dl-wrx36-initramfs-uImage.itb)
	   Tested using TFTP and a FAT-formatted USB flash drive.
	3. Boot the initramfs image
	   # bootm

	Boot initramfs option 2: From SSH access on OEM firmware
	1. Copy the initramfs image to a FAT-formatted flash drive
	   (tested on single-partition drive) and connect it to device USB port.
	2. Change boot command so it loads the initramfs image on next boot
	   Fallback to OEM firmware is provided.
	   # fw_setenv bootcmd 'usb start && fatload usb 0:1 0x44000000 openwrt-ipq807x-generic-dynalink_dl-wrx36-initramfs-uImage.itb && bootm 0x44000000; bootipq'
	3. Reboot the device to boot the initramfs
	   # reboot

	Install OpenWrt from initramfs image:
	1. Use SCP (or other way) to transfer OpenWrt factory image
	2. Connect to device using SSH (on a LAN port)
	3. Check MTD partition table.
	   rootfs and rootfs_1 should be mtd18 and mtd20
	   depending on current OEM slot.
	   # cat /proc/mtd
	4. Do a ubiformat to both rootfs partitions:
	   # ubiformat /dev/mtd18 -y -f /path_to/factory_image
	   # ubiformat /dev/mtd20 -y -f /path_to/factory_image
	5. Set U-boot env variable: mtdids
	   # fw_setenv mtdids 'nand0=nand0'
	6. Get offset of mtd18 to determine current OEM slot
	   - If current OEM slot is 1, offset is 16777216  (0x1000000)
	   - If current OEM slot is 2, offset is 127926272 (0x7a00000)
	   # cat /sys/class/mtd/mtd18/offset
	7. Set U-boot env variable: mtdparts
	   If current OEM slot is 1, run:
	   # fw_setenv mtdparts 'mtdparts=nand0:0x6100000@0x1000000(fs),0x6100000@0x7a00000(fs_1)'
	   If current OEM slot is 2, run:
	   # fw_setenv mtdparts 'mtdparts=nand0:0x6100000@0x7a00000(fs),0x6100000@0x1000000(fs_1)'
	8. Set U-boot env variable: bootcmd
	   # fw_setenv bootcmd 'setenv bootargs console=ttyMSM0,115200n8 ubi.mtd=rootfs rootfstype=squashfs rootwait; ubi part fs; ubi read 0x44000000 kernel; bootm 0x44000000#config@rt5010w-d350-rev0'
	9. Reboot the device
	   # reboot

        Note: this PR adds only single partition support, that means sysupgrade is
              upgrading the current rootfs partition

Signed-off-by: Dirk Buchwalder <buchwalder@posteo.de>
2023-01-16 12:42:23 +01:00
Matthew Hagan 6e03304c76 ipq807x: add Edgecore EAP102
The Edgecore EAP102 is a wall/ceiling mountable AP. The AP can be
powered by either PoE or AC adapter.

Device info:
 - IPQ8071-A SoC
 - 1GiB RAM
 - 256MiB NAND flash
 - 32MiB SPI NOR
 - 2 Ethernet ports
 - 1 Console port
 - 2GHz/5GHz AX WLAN
 - 2 USB 2.0 ports

Install instructions:

Prerequistes - TFTP server, preferrably within 192.168.1.0/24
	       Console cable plugged in (115200 8N1 no flow control)

1. Power on device and interrupt u-boot to obtain u-boot CLI

2. set serverip to IP address of the TFTP server:

	`setenv serverip 192.168.1.250`

3. Download image from TFTP server:

	`tftpboot 0x44000000 openwrt-ipq807x-generic-edgecore_eap102-squashfs-nand-factory.ubi`

4. Flash ubi image to both partitions and reset:

	`sf probe
	 imxtract 0x44000000 ubi
	 nand device 0
	 nand erase 0x0 0x3400000
	 nand erase 0x3c00000 0x3400000
	 nand write $fileaddr 0x0 $filesize
	 nand write $fileaddr 0x3c00000 $filesize
	 reset`

Signed-off-by: Matthew Hagan <mnhagan88@gmail.com>
2023-01-16 12:42:23 +01:00
Robert Marko 2ddb2057cd ipq807x: Add Xiaomi AX9000
Xiaomi AX9000 is a premium 802.11ax "tri"-band router/AP.
Specifications:
* CPU: Qualcomm IPQ8072A Quad core Cortex-A53 2.2GHz
* RAM: 1024MB of DDR3
* Storage: 256MB of parallel NAND
* Ethernet:
	* 4x1G RJ45 ports (QCA8075) with 1x status LED per port
	* 1x2.5G RJ45 port (QCA8081) with 1x status LED
* WLAN:
	* PCI based Qualcomm QCA9889 1x1 802.11ac Wawe 2 for IoT
	* 2.4GHz: Qualcomm QCN5024 4x4@40MHz 802.11b/g/n/ax 1147 Mbps PHY rate
	* 5.8GHz: Qualcomm QCN5054 4x4@80MHz or 2x2@160MHz 802.11a/b/g/n/ac/ax 2402Mbps PHY rate
	* 5GHz: PCI based Qualcomm QCN9024 4x4@160MHz 802.11a/b/g/n/ac/ax 4804Mbps PHY rate
* USB: 1x USB3.0 Type-A port
* LED-s:
	* System (Blue and Yellow)
	* Network (Blue and Yellow)
	* RGB light bar on top in X shape
* Buttons:
	* 1x Power switch
	* 1x Soft reset
	* 1x Mesh button
* Power: 12V DC Jack

Installation instructions:

Obtaining SSH access is mandatory
https://openwrt.org/inbox/toh/xiaomi/ax9000#obtain_ssh_access

Installation is done by the ubiformat method, through SSH:
1. Open an SSH shell to the router
2. Copy the file openwrt-ipq807x-generic-xiaomi_ax9000-initramfs-factory.ubi to the /tmp directory
3. Check which rootfs partition is your router booted in (0 = rootfs | 1 = rootfs_1):
nvram get flag_boot_rootfs

4. Find the rootfs and rootfs_1 mtd indexes respectively:
cat /proc/mtd
Please confirm if mtd21 and mtd22 are the correct indexes from above!

5. Use the command ubiformat to flash the opposite mtd with UBI image:

If nvram get flag_boot_rootfs returned 0:
ubiformat /dev/mtd22 -y -f /tmp/openwrt-ipq807x-generic-xiaomi_ax9000-initramfs-factory.ubi && nvram set flag_boot_rootfs=1 && nvram set flag_last_success=1 && nvram commit

otherwise:
ubiformat /dev/mtd21 -y -f /tmp/openwrt-ipq807x-generic-xiaomi_ax9000-initramfs-factory.ubi && nvram set flag_boot_rootfs=0 && nvram set flag_last_success=0 && nvram commit

6. Reboot the device by:
reboot

Previous commands flashed an ubinized OpenWrt initramfs that will serve as the intermediate step
since OpenWrt uses unified rootfs in order to fully utilize NAND and provide enough space for packages.
Continue in order to pernamently flash OpenWrt:

7. SSH into OpenWrt from one of the LAN ports
8. Copy the file openwrt-ipq807x-generic-xiaomi_ax9000-squashfs-sysupgrade.bin to the /tmp directory
9. Sysupgrade the device:
sysupgrade -n /tmp/openwrt-ipq807x-generic-xiaomi_ax9000-squashfs-sysupgrade.bin

Device will reboot with OpenWrt, and then sysupgrade can be used to upgrade the device when desired.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-01-16 12:42:23 +01:00
Dirk Buchwalder bd17683261 ipq807x: add QNAP 301w
QNAP 301w is a AX WIFI router with 4 1G and 2 10G ports.

Specifications:

    •     CPU: Qualcomm IPQ8072A Quad core Cortex-A53 2.2GHz
    •     RAM: 1024MB of DDR3
    •     Storage: 4GB eMMC (contains kernel and rootfs) / 8MB NOR
          (contains art and u-boot-env)
    •     Ethernet: 4x 1G RJ45 ports + 2 10G ports (Aquantia AQR113C)
    •     WLAN:
          2.4GHz: Qualcomm QCN5024 4x4 (40 MHz) 802.11b/g/n/ax 1174 Mbps PHY rate
          5GHz: Qualcomm QCN5054 4x4 (80 MHz) or 2x2 (160 MHz) 802.11a/b/g/n/ac/ax 2402 PHY rate

    •     LEDs:
          7 x GPIO-controlled dual color LEDs + 2 GPIO-controlled single color LEDs

            • Buttons: 1x soft reset / 1x WPS
            • Power: 12V DC jack

        A poulated serial header is onboard.
        RX/TX is working, bootwait is active, secure boot is not enabled.

        SSH can be activated in the stock firmware, hold WPS button til the second beep
	(yes the router has a buzzer)
        SSH is available on port 22200, login with user admin and
	password "mac address of the router".

        Installation Instructions:

            • obtain serial access (https://openwrt.org/inbox/toh/qnap/301w#serial)
            • stop auto boot
            • setenv serverip 192.168.10.1
            • setenv ipaddr 192.168.10.10
            • tftpboot the initramfs image
              (openwrt-ipq807x-generic-qnap_301w-initramfs-fit-uImage.itb)
            • bootm

            • make sure that current_entry is set to "0":
              "fw_printenv -n current_entry" should be print "0". If not,
	       do "fw_setenv current_entry 0"
            • copy openwrt-ipq807x-generic-qnap_301w-squashfs-sysupgrade.bin
	          to the device to /tmp folder
            • sysupgrade -n /tmp/openwrt-ipq807x-generic-qnap_301w-squashfs-sysupgrade.bin
              this flashes openwrt to the first kernel and rootfs partition (mmcblk0p1 / mmcblk0p4)
            • reboot

        Note: this leaves the second kernel / rootfs parition untouched. So if you want
              to go back to stock, stop u-boot autoboot, "setenv current_entry 1" ,
	       "saveenv", "bootipq".
              Stock firmware should start from the second partition.
	      Then do a firmwareupgrade in the stock gui, that should overwrite the openwrt
	      in the first partitions

        Make 10G Aquantia phy's work:
              The aquantia phy's need a firmware to work. This can either be loaded
	      in linux with a userspace tool or in u-boot.

              I was not successfull to load the firmware in linux (aq-fw-download) but luckily there is
	      aq_load_fw available in u-boot. But first the right firmware needs to write
	      to the 0:ETHPHYFW mtd partition (it is empty on my device)

              Grab the ethphy firmware image from:
	      https://github.com/kirdesde/nbg7815_gpl/blob/master/target/linux/ipq/ipq807x_64/prebuilt_images/AQR_ethphyfw.mbn
	      and scp that to openwrt.

              Check the 0:ETHPHYFW partition number:
              cat /proc/mtd|grep "0:ETHPHYFW", should be mtd10.

              Backup the 0:ETHPHYFW partition:
              dd if=/dev/mtd10 of=/tmp/ethphyfw.backup, scp ethphyfw.backup to a save place.

              Write the new firmware image to the 0:ETHPHYFW partition:
              "mtd erase /dev/mtd10", "mtd -n write AQR_ethphyfw.mbn /dev/mtd10".

              Reboot to u-boot.

              Check if aq_load_fw is working:

              "aq_load_fw 0", that checks the firmware and if successfull,
	      loads iram and dram to one of the aquantia phy's.

              If that worked, add the aq_load_fw to the bootcmd:
              setenv bootcmd "aq_load_fw 0 && aq_load_fw 8 && bootipq"

              "saveenv"

              "reset"

              Board reboots and the firmware load to both phy's should start and
	      then openwrt boots.

              Check if the 10G ports work.

              Note: lan port labeled "10G-2" is configured as WAN port as per default.
	      All other port are in the br-lan. This can be changed in the network config.

Signed-off-by: Dirk Buchwalder <buchwalder@posteo.de>
2023-01-16 12:42:23 +01:00
Dirk Buchwalder a36fc589fe ipq807x: add Edimax CAX1800
Edimax CAX1800 is a 802.11 ax dual-band AP
with PoE. AP can be ceiling or wall mount.

Specifications:

    •     CPU: Qualcomm IPQ8070A Quad core Cortex-A53 1.4GHz
    •     RAM: 512MB of DDR3
    •     Storage: 128MB NAND (contains rootfs) / 8MB NOR (contains art and uboot-env)
    •     Ethernet: 1x 1G RJ45 port (QCA8072) PoE
    •     WLAN:
          2.4GHz: Qualcomm QCN5024 2x2 802.11b/g/n/ax 574 Mbps PHY rate
          5GHz: Qualcomm QCN5054 2x2 802.11a/b/g/n/ac/ax 1201 PHY rate

    •     LEDs:
          3 x GPIO-controlled System-LEDs
          (form one virtual RGB System-LED)
            black_small_square  Buttons: 1x soft reset
            black_small_square  Power: 12V DC jack or PoE (802.3af )

        An unpopulated serial header is onboard.
        RX/TX is working, bootwait is active, secure boot is not enabled.

        SSH can be activated in the stock firmware, but it drops only
        to a limited shell .

        Installation Instructions:

            black_small_square obtain serial access
            black_small_square stop auto boot

            black_small_square tftpboot the initramfs image (serverip is set to 192.168.99.8 in uboot)
            black_small_square bootm

            black_small_square copy openwrt-ipq807x-generic-edimax_cax1800-squashfs-nand-factory.ubi
	      to the device
            black_small_square write the image to the NAND:
            black_small_square cat /proc/mtd and look for rootfs partition (should be mtd0)
            black_small_square ubiformat /dev/mtd0 -f -y  openwrt-ipq807x-generic-edimax_cax1800-squashfs-
              nand-factory.ubi
            black_small_square reboot

	Note: Device is not using dual partitioning (NAND contains other partitions
        with different manufacture data etc.)
	Draytek VigorAP 960C and Lancom LW-600 both look similar, but I haven't checked them.

Signed-off-by: Dirk Buchwalder <buchwalder@posteo.de>
2023-01-16 12:42:23 +01:00
Zhijun You 8253cb2de5 ipq807x: add Redmi AX6
Redmi AX6 is a budget 802.11ax dual-band router/AP

Specifications:
* CPU: Qualcomm IPQ8071A Quad core Cortex-A53 1.4GHz
* RAM: 512MB of DDR3
* Storage: 128MB NAND
* Ethernet: 4x1G RJ45 ports (QCA8075)
* WLAN:
	* 2.4GHz: Qualcomm QCN5024 2x2 802.11b/g/n/ax 574 Mbps PHY rate
	* 5GHz: Qualcomm QCN5054 4x4@80MHz or 2x2@160MHz 802.11a/b/g/n/ac/ax 2402 PHY rate
* LEDs:
	* System (Blue/Yellow)
	* Network (Blue/Yellow)
*Buttons: 1x soft reset
*Power: 12V DC jack

Installation instructions:

Obtaining SSH access is mandatory
https://openwrt.org/inbox/toh/xiaomi/xiaomi_redmi_ax6_ax3000#ssh_access

Installation is done by the ubiformat method, through SSH:
1. Open an SSH shell to the router
2. Copy the file openwrt-ipq807x-generic-redmi_ax6-initramfs-factory.ubi to the /tmp directory
3. Check which rootfs partition is your router booted in (0 = rootfs | 1 = rootfs_1):
nvram get flag_boot_rootfs

4. Find the rootfs and rootfs_1 mtd indexes respectively:
cat /proc/mtd
Please confirm if mtd12 and mtd13 are the correct indexes from above!

5. Use the command ubiformat to flash the opposite mtd with UBI image:

If nvram get flag_boot_rootfs returned 0:
ubiformat /dev/mtd13 -y -f /tmp/openwrt-ipq807x-generic-redmi_ax6-initramfs-factory.ubi && nvram set flag_boot_rootfs=1 && nvram set flag_last_success=1 && nvram commit

otherwise:
ubiformat /dev/mtd12 -y -f /tmp/openwrt-ipq807x-generic-redmi_ax6-initramfs-factory.ubi && nvram set flag_boot_rootfs=0 && nvram set flag_last_success=0 && nvram commit

6. Reboot the device by:
reboot

Previous commands flashed an ubinized OpenWrt initramfs that will serve as the intermediate step
since OpenWrt uses unified rootfs in order to fully utilize NAND and provide enough space for packages.
Continue in order to pernamently flash OpenWrt:

7. SSH into OpenWrt from one of the LAN ports
8. Copy the file openwrt-ipq807x-generic-redmi_ax6-squashfs-sysupgrade.bin to the /tmp directory
9. Sysupgrade the device:
sysupgrade -n /tmp/openwrt-ipq807x-generic-redmi_ax6-squashfs-sysupgrade.bin

Device will reboot with OpenWrt, and then sysupgrade can be used to upgrade the device when desired.

Signed-off-by: Zhijun You <hujy652@gmail.com>
2023-01-16 12:42:23 +01:00
Robert Marko 8364f08164 ipq807x: add Xiaomi AX3600
Xiaomi AX3600 is a budget 802.11ax dual-band router/AP.
Specifications:
* CPU: Qualcomm IPQ8071A Quad core Cortex-A53 1.4GHz
* RAM: 512MB of DDR3
* Storage: 256MB of parallel NAND
* Ethernet: 4x1G RJ45 ports (QCA8075) with 1x status LED per port
* WLAN:
	* PCI based Qualcomm QCA9889 1x1 802.11ac Wawe 2 for IoT
	* 2.4GHz: Qualcomm QCN5024 2x2 802.11b/g/n/ax 574 Mbps PHY rate
	* 5GHz: Qualcomm QCN5054 4x4@80MHz or 2x2@160MHz 802.11a/b/g/n/ac/ax 2402 PHY rate
* LED-s:
	* System (Blue and Yellow)
	* IoT (Blue)
	* Network (Blue and Yellow)
* Buttons: 1x Soft reset
* Power: 12V DC Jack

Installation instructions:

Obtaining SSH access is mandatory
https://openwrt.org/inbox/toh/xiaomi/xiaomi_ax3600#obtain_ssh_access

Installation is done by the ubiformat method, through SSH:
1. Open an SSH shell to the router
2. Copy the file openwrt-ipq807x-generic-xiaomi_ax3600-initramfs-factory.ubi to the /tmp directory
3. Check which rootfs partition is your router booted in (0 = rootfs | 1 = rootfs_1):
nvram get flag_boot_rootfs

4. Find the rootfs and rootfs_1 mtd indexes respectively:
cat /proc/mtd
Please confirm if mtd12 and mtd13 are the correct indexes from above!

5. Use the command ubiformat to flash the opposite mtd with UBI image:

If nvram get flag_boot_rootfs returned 0:
ubiformat /dev/mtd13 -y -f /tmp/openwrt-ipq807x-generic-xiaomi_ax3600-initramfs-factory.ubi -s 2048 -O 2048 && nvram set flag_boot_rootfs=1 && nvram set flag_last_success=1 && nvram commit

otherwise:
ubiformat /dev/mtd12 -y -f /tmp/openwrt-ipq807x-generic-xiaomi_ax3600-initramfs-factory.ubi -s 2048 -O 2048 && nvram set flag_boot_rootfs=0 && nvram set flag_last_success=0 && nvram commit

6. Reboot the device by:
reboot

Previous commands flashed an ubinized OpenWrt initramfs that will serve as the intermediate step
since OpenWrt uses unified rootfs in order to fully utilize NAND and provide enough space for packages.
Continue in order to pernamently flash OpenWrt:

7. SSH into OpenWrt from one of the LAN ports
8. Copy the file openwrt-ipq807x-generic-xiaomi_ax3600-squashfs-sysupgrade.bin to the /tmp directory
9. Sysupgrade the device:
sysupgrade -n /tmp/openwrt-ipq807x-generic-xiaomi_ax3600-squashfs-sysupgrade.bin

Device will reboot with OpenWrt, and then sysupgrade can be used to upgrade the device when desired.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-01-16 12:42:23 +01:00
Robert Marko bc120521db ipq807x: include kmods for wired networking by default
Include NSS DP and SSDK (Pulled as dependency) by default on ipq807x to
provide wired networking to the target.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-01-16 12:42:23 +01:00
Robert Marko d092dee9ed ipq807x: include ath11k-ahb by default
All of the IPQ807x devices support having 2 radios, so lets include the
required driver as well.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-01-16 12:42:23 +01:00
Robert Marko b5f32064ed ipq807x: add Qualcomm Atheros IPQ807x target
Qualcomm Atheros IPQ807x is a modern WiSoC featuring:
* Quad Core ARMv8 Cortex A-53
	* @ 2.2 GHz (IPQ8072A/4A/6A/8A) Codename Hawkeye
	* @ 1.4 GHz (IPQ8070A/1A) Codename Acorn
* Dual Band simultaneaous IEEE 802.11ax
	* 5G: 8x8/80 or 4x4/160MHz (IPQ8074A/8A)
	* 5G: 4x4/80 or 2x2/160MHz (IPQ8071A/2A/6A)
	* 5G: 2x2/80MHz (IPQ8070A)
	* 2G: 4x4/40MHz (IPQ8072A/4A/6A/8A)
	* 2G: 2x2/40MHz (IPQ8070A/1A)
* 1x PSGMII via QCA8072/5 (Max 5x 1GbE ports)
* 2x SGMII/USXGMII (1/2.5/5/10 GbE) on Hawkeye
* 2x SGMII/USXGMII (1/2.5/5 GbE) on Acorn
* DDR3L/4 32/16 bit up to 2400MT/s
* SDIO 3.0/SD card 3.0/eMMC 5.1
* Dual USB 3.0
* One PCIe Gen2.1 and one PCIe Gen3.0 port (Single lane)
* Parallel NAND (ONFI)/LCD
* 6x QUP BLSP SPI/I2C/UART
* I2S, PCM, and TDMA
* HW PWM
* 1.8V configurable GPIO
* Companion PMP8074 PMIC via SPMI (GPIOS, RTC etc)

Note that only v2 SOC models aka the ones ending with A suffix are
supported, v1 models do not comply to the final 802.11ax and have
lower clocks, lack the Gen3 PCIe etc.

SoC itself has two UBI32 cores for the NSS offloading system, however
currently no offloading is supported.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-01-16 12:42:23 +01:00