Commit Graph

28621 Commits

Author SHA1 Message Date
Daniel Golle 1eb67cb070 mediatek: filogic: restore non-const type in pinctrl-mt7988 driver
When building with Linux 5.15 the 'const' type results in warnings.
Restore the original non-const type in those cases.

Fixes: 36d0aa9c2d ("mediatek: filogic: sync pinctrl-mt7988 with MediaTek SDK")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-08-03 23:34:22 +01:00
Daniel Golle 64b99802a6 mediatek: filogic: update MT7988 device tree
* move ethernet to mt7988a.dtsi
 * move switch definition to mt7988a.dtsi
 * add PHY LEDs

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-08-03 15:47:51 +01:00
Daniel Golle 36d0aa9c2d mediatek: filogic: sync pinctrl-mt7988 with MediaTek SDK
Update pinctrl driver for the MT7988 with driver from mtk-openwrt-feeds.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-08-03 15:47:51 +01:00
Stefan Kalscheuer 801c67b4e0 mvebu: add kernel 6.1 as testing kernel
With an initial set of patches and configs in place let's start testing
with kernel 6.1.

Run-tested on the cortexa9 subtarget (WRT1900ACS, Turris Omnia)

Tested-by: Etienne Champetier <champetier.etienne@gmail.com>
Signed-off-by: Stefan Kalscheuer <stefan@stklcode.de>
2023-08-02 16:21:19 +02:00
Stefan Kalscheuer b1993f362a mvebu: copy 5.15 kconfigs to 6.1
Start 6.1 migration with a full copy of the current stable config.

Signed-off-by: Stefan Kalscheuer <stefan@stklcode.de>
2023-08-02 16:21:19 +02:00
Stefan Kalscheuer 7f257296ec mvebu: refresh patches for 6.1
Remove the following patches:
100-ARM-dts-turris-omnia-configure-LED-0-pin-function-to [1]
101-ARM-dts-turris-omnia-enable-LED-controller-node [2]
702-net-next-ethernet-marvell-mvnetaMQPrioOffload [3]
703-net-next-ethernet-marvell-mvnetaMQPrioFlag [4]
704-net-next-ethernet-marvell-mvnetaMQPrioQueue [5]
705-net-next-ethernet-marvell-mvnetaMQPrioTCOffload [6]
710-v6.2-phy-marvell-phy-mvebu-a3700-comphy-Reset-COMPHY-regi [7]

Manually rebased:
902-drivers-mfd-Add-a-driver-for-IEI-WT61P803-PUZZLE-MCU

All other patches automatically rebased

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=94a29bffdd59498382131fd428fed221f5c96def
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=40624346b7ae0c2b1209fc9993ea30699e512c50
[3] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=75fa71e3acadbb4ab5eda18505277eb9a1f69b23
[4] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=e7ca75fe6662f78bfeb0112671c812e4c7b8e214
[5] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=e9f7099d0730341b24c057acbf545dd019581db6
[6] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=2551dc9e398c37a15e52122d385c29a8b06be45f
[7] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=cd1e1735aeab49abc679218a79ee764c0d394880

Signed-off-by: Stefan Kalscheuer <stefan@stklcode.de>
2023-08-02 16:21:19 +02:00
Stefan Kalscheuer 04f6d674f6 mvebu: copy 5.15 patches to 6.1
To start migration to Kernel 6.1 we copy all existing patches from 5.15.

Signed-off-by: Stefan Kalscheuer <stefan@stklcode.de>
2023-08-02 16:21:19 +02:00
Daniel Golle dc4aafb309 mediatek: filogic: enable driver for MediaTek XS-PHY
Enable driver for MediaTek SuperSpeedPlus XS-PHY transceiver for the
USB3.1 GEN2 controllers found in the MT7988 SoC.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-07-31 18:05:22 +01:00
Robert Marko 5757b21db0 qualcommax: ipq807x: fix Gen2 PCIe port
Gen2 PCIe port recently got broken on IPQ807x during update to 6.1.39 as
upstream backported:
("PCI: qcom: Remove PCIE20_ prefix from register definitions") [1]

So, fix it by adding a pending upstream fix for it [2].

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/drivers/pci/controller/dwc/pcie-qcom.c?h=v6.1.39&id=db962c7a711c3393a80a18219960cd54fb33c53d
[2] https://patchwork.kernel.org/project/linux-arm-msm/patch/20230724063429.3980462-1-quic_srichara@quicinc.com/

Fixes: fec22f8375 ("kernel: bump 6.1 to 6.1.39")
Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-07-31 12:08:34 +02:00
John Audia c4a5fe6cee kernel: bump 6.1 to 6.1.42
Manually rebased:
	generic/pending-6.1/203-kallsyms_uncompressed.patch

All other patches automatically rebased.

Changelog: https://lore.kernel.org/stable/2023072749-gumming-selector-a081@gregkh/

Build system: x86/64
Build-tested: x86/64/AMD Cezanne
Run-tested: x86/64/AMD Cezanne

Signed-off-by: John Audia <therealgraysky@proton.me>
2023-07-30 18:53:00 +02:00
John Audia 8590531048 kernel: bump 5.15 to 5.15.123
Manually rebased:
	bcm4908/patches-5.15/071-v6.1-0001-net-broadcom-bcm4908_enet-handle-EPROBE_DEFER-when-g.patch
	bcm53xx/patches-5.15/180-usb-xhci-add-support-for-performing-fake-doorbell.patch
	ipq40xx/patches-5.15/902-dts-ipq4019-ap-dk04.1.patch[*]

Removed upstreamed:
	backport-5.15/735-v6.5-net-bgmac-postpone-turning-IRQs-off-to-avoid-SoC-han.patch[1]
	backport-5.15/817-v6.5-01-leds-trigger-netdev-Recheck-NETDEV_LED_MODE_LINKUP-o.patch[2]
	pending-5.15/143-jffs2-reduce-stack-usage-in-jffs2_build_xattr_subsys.patch[3]
	pending-5.15/160-workqueue-fix-enum-type-for-gcc-13.patch[4]
	bcm53xx/patches-5.15/036-v6.5-0003-ARM-dts-BCM5301X-Drop-clock-names-from-the-SPI-node.patch[5]
	bcm53xx/patches-5.15/036-v6.5-0015-ARM-dts-BCM5301X-fix-duplex-full-full-duplex.patch[6]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.123&id=02474292a44205c1eb5a03634ead155a3c9134f4
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.123&id=86b93cbfe104e99fd3d25a49748b99fb88101573
3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.123&id=79b9ab357b6f5675007f4c02ff8765cbd8dc06a2
4. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.123&id=d528faa9e828b9fc46dfb684a2a9fd8c2e860ed8
5. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.123&id=5899bc4058e89d5110a23797ff94439c53b77c25
6. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.123&id=95afd2c7c7d26087730dc938709e025a303e5499

Build system: x86/64
Build-tested: ramips/tplink_archer-a6-v3
Run-tested: ramips/tplink_archer-a6-v3

Co-authored-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John Audia <therealgraysky@proton.me>
[rebased ipq40xx/patches-5.15/902-dts-ipq4019-ap-dk04.1.patch ]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2023-07-30 18:02:47 +02:00
Shiji Yang 96010bb17c ramips: mt7621-wdt: use phandle to access system controller registers
These patches allow the driver to access some watchdog registers via a
phandle to the system controller node[1]. To apply these changes, we
need to add "mediatek,sysctl" to the SoC dtsi. This commit also remove
the redundent clocks, interrupts and resets properties.

[1] https://lore.kernel.org/all/20230214103936.1061078-2-sergio.paracuellos@gmail.com

Tested on Motorola MWR03 (MT7628)

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2023-07-30 13:09:23 +02:00
Shiji Yang 1f818b09f8 ramips: add proper system clock and reset driver support for legacy SoCs
This series of upstream patches properly implement a clock and reset
driver for old ralink SoCs[1]. And it includes some related fixes[2] and
improvements[3][4]. All patches have been merged into linux-next. They
will be part of upcoming Linux 6.5. In order to switch to the new system
controller driver, all clocks and resets properties in SoC dtsi have been
updated, and kernel symbol "CONFIG_CLK_MTMIPS" have been added to the
kernel config files.

[1] https://lore.kernel.org/all/20230619040941.1340372-1-sergio.paracuellos@gmail.com
[2] https://lore.kernel.org/all/20230622-mips-ralink-clk-wuninitialized-v1-1-ea9041240d10@kernel.org
[3] https://lore.kernel.org/all/OSYP286MB03120BABB25900E113ED42B7BC5CA@OSYP286MB0312.JPNP286.PROD.OUTLOOK.COM
[4] https://lore.kernel.org/all/TYAP286MB03151148AF8C054621DD55C3BC23A@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM

Tested on Motorola MWR03 (MT7628)
Tested on Haier HW-L1W (MT7620)

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2023-07-30 13:09:23 +02:00
Shiji Yang 8cacf2bda8 ramips: add proper system clock and reset driver support for mt7621
This series of upstream patches makes the system controller node as a
reset provider[1][2], and it also includes some clock and reset driver
fixes[3][4]. Meanwhile, all clocks and resets properties in the SoC
device tree have been updated to be compatible with the new driver.

[1] https://lore.kernel.org/r/20220110114930.1406665-2-sergio.paracuellos@gmail.com
[2] https://lore.kernel.org/r/20220210094859.927868-2-sergio.paracuellos@gmail.com
[3] https://lore.kernel.org/r/20221217074806.3225150-1-sergio.paracuellos@gmail.com
[4] https://lore.kernel.org/r/20230206083305.147582-1-sergio.paracuellos@gmail.com

Tested on RAISECOM MSG1500 X.00

Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2023-07-30 13:09:23 +02:00
Rafał Miłecki 3eebb91317 kernel: backport proper fix for mtd preventing devices probing
Improper of_platform_populate() call caused issue with probing devices
drivers.

Fixes: 41e1e838fb ("kernel: backport mtd patch adding of_platform_populate() calls")
Fixes: #10232
Ref: 79af0593a3 ("kernel: switch back 5.15 to fw_devlink=permissive")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-07-30 01:05:49 +02:00
Rafał Miłecki ca8868a511 bcm53xx: backport more DT changes queued for v6.6
Those sort out BCM53573 Ethernet info finally.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-07-29 17:04:53 +02:00
Shiji Yang b4ea49ad44 ramips: pinctrl: support requesting different functions for same group
MT7620 wireless radio needs change the pin group function between
"gpio" and "pa" during the calibration process. However, ralink
pinctrl driver doesn't support requesting different functions for
the same group. This patch enables pinctrl consumers to perform
such operations.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2023-07-29 15:07:11 +01:00
Rafał Miłecki 03b3284805 ramips: use NVMEM cells with mt76 EEPROM for Netgear R6220 & WNDR3700 v5
This uses new upstream DT binding. It's more generic (NVMEM) compared to
the old one (MTD).

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-07-28 19:42:46 +02:00
Rafał Miłecki e6cf959d0e ramips: use fixed layout cell "mac-base" for Netgear WNDR3700 v5
This drops a use of downstream "mac-address-increment".

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-07-28 18:50:39 +02:00
Rafał Miłecki daaa0c1b25 ath79: replace "mac-address-ascii" with "mac-base"
With upstream accepted "mac-base" binding there is no need for a
downstream "mac-address-ascii" workaround anymore.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-07-28 10:28:05 +02:00
Petr Štetiar edd146c920
mediatek: filogic: fix broken sysupgrade script
Changes introduced in commit 54dc1cde48 ("mediatek: filogic: add
support for Xiaomi WR30U") missed to end the case item with mandatory
`;;` which lead to a broken sysupgrade.

Fixes: 54dc1cde48 ("mediatek: filogic: add support for Xiaomi WR30U")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2023-07-28 08:24:11 +02:00
Petr Štetiar ba415af570
ipq807x: prpl-haze: fix sysupgrade flashing from bootloader
While flashing sysupgrade image from U-Boot, then the rootfs_data
overlay filesystem formatting is left for the fstools during firstboot,
but that wont work as mkfs.f2fs is missing in the sysupgrade image:

 mount_root: overlay filesystem in /dev/loop0 has not been formatted yet
 mount_root: no usable overlay filesystem found, using tmpfs overlay
 sh: mkfs.f2fs: not found

 Filesystem                Size      Used Available Use% Mounted on
 /dev/loop0              139.6M     46.9M     92.6M  34% /overlay

 Number  Start (sector)    End (sector)  Size       Code  Name
  20           98850          406349   150.1 MiB   FFFF  rootfs

So lets fix it by adding f2fs support to the sysupgrade image.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2023-07-28 08:19:18 +02:00
Hank Moretti dcdcfc1511 mediatek: filogic: add specific layout for WR30U
Because this device enable NMBM by default, most users use custom
U-Boot with NMBM-Enabled in Chinese forums.

This layout is the same as the ubootmod layout but enabling NMBM.

Signed-off-by: Hank Moretti <mchank9999@gmail.com>
2023-07-27 13:46:26 +02:00
Hank Moretti 54dc1cde48 mediatek: filogic: add support for Xiaomi WR30U
Hardware specification:
  SoC: MediaTek MT7981B 2x A53
  Flash: ESMT F50L1G41LB 128MB
  RAM: NT52B128M16JR-FL 256MB
  Ethernet: 4x 10/100/1000 Mbps
  Switch: MediaTek MT7531AE
  WiFi: MediaTek MT7976C
  Button: Reset, Mesh
  Power: DC 12V 1A

Flash instructions:

1. Get ssh access
   Check this link: https://forum.openwrt.org/t/openwrt-support-for-xiaomi-ax3000ne/153769/22

2. Backup import partitions
   ```
   dev:    size   erasesize  name
   mtd1: 00100000 00020000 "BL2"
   mtd2: 00040000 00020000 "Nvram"
   mtd3: 00040000 00020000 "Bdata"
   mtd4: 00200000 00020000 "Factory"
   mtd5: 00200000 00020000 "FIP"
   mtd8: 02200000 00020000 "ubi"
   mtd9: 02200000 00020000 "ubi1"
   mtd12: 00040000 00020000 "KF"

   ```

   Use these commands blow to backup your stock partitions.
   ```
   nanddump -f /tmp/BL2.bin /dev/mtd1
   nanddump -f /tmp/Nvram.bin /dev/mtd2
   nanddump -f /tmp/Bdata.bin /dev/mtd3
   nanddump -f /tmp/Factory.bin /dev/mtd4
   nanddump -f /tmp/FIP.bin /dev/mtd5
   nanddump -f /tmp/ubi.bin /dev/mtd8
   nanddump -f /tmp/KF.bin /dev/mtd12
   ```
   Then, transfer them to your computer via scp, netcat, tftp
   or others and keep them in a safe place.

3. Setup Nvram
   Get the current stock: `cat /proc/cmdline`

   If you find `firmware=0` or `mtd=ubi`, use these commands:
   ```
   nvram set boot_wait=on
   nvram set uart_en=1
   nvram set flag_boot_rootfs=1
   nvram set flag_last_success=1
   nvram set flag_boot_success=1
   nvram set flag_try_sys1_failed=0
   nvram set flag_try_sys2_failed=0
   nvram commit
   ```

   If you find `firmware=1` or `mtd=ubi1`, use these commands:
   ```
   nvram set boot_wait=on
   nvram set uart_en=1
   nvram set flag_boot_rootfs=0
   nvram set flag_last_success=0
   nvram set flag_boot_success=1
   nvram set flag_try_sys1_failed=0
   nvram set flag_try_sys2_failed=0
   nvram commit
   ```

4. Flash stock-initramfs-factory.ubi
   If you find `firmware=0` or `mtd=ubi`:
   `ubiformat /dev/mtd9 -y -f /tmp/stock-initramfs-factory.ubi`

   If you find `firmware=1` or `mtd=ubi1`:
   `ubiformat /dev/mtd8 -y -f /tmp/stock-initramfs-factory.ubi`

   Then reboot your router, it should boot to the openwrt
   initramfs system now.

5. Setup uboot-env
   Now it will be setup automatically in upgrade process,
   you can skip this step.

   If your `fw_setenv` did not work, you need run this command:
   `echo "/dev/mtd1 0x0 0x10000 0x20000" > /etc/fw_env.config`

   Then setup uboot-env:
   ```
   fw_setenv boot_wait on
   fw_setenv uart_en 1
   fw_setenv flag_boot_rootfs 0
   fw_setenv flag_last_success 1
   fw_setenv flag_boot_success 1
   fw_setenv flag_try_sys1_failed 8
   fw_setenv flag_try_sys2_failed 8
   fw_setenv mtdparts "nmbm0:1024k(bl2),256k(Nvram),256k(Bdata),
   2048k(factory),2048k(fip),256k(crash),256k(crash_log),
   34816k(ubi),34816k(ubi1),32768k(overlay),12288k(data),256k(KF)"
   ```

6. Flash stock-squashfs-sysupgrade.bin
   Use shell command:
   `sysupgrade -n /tmp/stock-squashfs-sysupgrade.bin`
   Or go to luci web.

If you need to change to Openwrt U-Boot layout, do next. If you
do not need, please ignore it.

Change to OpenWrt U-Boot:

1. Flash ubootmod-initramfs-factory.ubi
   Check mtd partitions: `cat /proc/mtd`
   ```
   mtd7: 00040000 00020000 "KF"
   mtd8: 02200000 00020000 "ubi_kernel"
   mtd9: 04e00000 00020000 "ubi"
   ```

   Run following command:
   `ubiformat /dev/mtd8 -y -f /tmp/ubootmod-initramfs-factory.ubi`
   Then reboot your router, it should boot to the openwrt initramfs
   system now.

2. Check mtd again
   ```
   mtd7: 00040000 00020000 "KF"
   mtd8: 07000000 00020000 "ubi"
   ```
   Make sure mtd8 is ubi.

3. Install kmod-mtd-rw
   Run command: `opkg update && opkg install kmod-mtd-rw`
   Or get it in openwrt server, or build it yourself, then install
   it manually

   Then run this command:
   `insmod /lib/modules/$(uname -r)/mtd-rw.ko i_want_a_brick=1`

4. Clean up pstore
   Run Command: `rm -f /sys/fs/pstore/*`

5. Format ubi and create new ubootenv volume
   ```
   ubidetach -p /dev/mtd8; ubiformat /dev/mtd8 -y; ubiattach -p /dev/mtd8
   ubimkvol /dev/ubi0 -n 0 -N ubootenv -s 128KiB
   ubimkvol /dev/ubi0 -n 1 -N ubootenv2 -s 128KiB
   ```

6. (Optional) Add recovery boot feature.
   ```
   ubimkvol /dev/ubi0 -n 2 -N recovery -s 10MiB
   ubiupdatevol /dev/ubi0_2 /tmp/ubootmod-initramfs-recovery.itb
   ```

7. Flash Openwrt U-Boot
   ```
   mtd write /tmp/ubootmod-preloader.bin BL2
   mtd write /tmp/ubootmod-bl31-uboot.fip FIP
   ```

6. Flash ubootmod-squashfs-sysupgrade.itb
   Use shell command:
   `sysupgrade -n /tmp/ubootmod-squashfs-sysupgrade.itb`
   Or go to luci web.

Now everything is done, Enjoy!

Go Back to stock from Openwrt U-Boot:

1. Force flash ubootmod-initramfs-recovery.itb
   Use shell command:
   `sysupgrade -F -n /tmp/ubootmod-initramfs-recovery.itb`
   Or go to luci web.
   Then it should boot to the openwrt initramfs system now.

2. Format ubi and Nvram
   ```
   ubidetach -p /dev/mtd8; ubiformat /dev/mtd8 -y; ubiattach -p /dev/mtd8
   mtd erase Nvram
   ```

3. Install kmod-mtd-rw
   Run command: `opkg update && opkg install kmod-mtd-rw`
   Or get it in openwrt server, or build it yourself, then install
   it manually

   Then run this command:
   `insmod /lib/modules/$(uname -r)/mtd-rw.ko i_want_a_brick=1`

4. Flash stock U-Boot and ubi
   ```
   mtd write /tmp/BL2.bin BL2
   mtd write /tmp/FIP.bin FIP
   mtd write /tmp/ubi.bin ubi
   ```
   Then reboot your router, waiting it finished rollback in minutes.

Go Back to stock from stock layout Openwrt:
   Just run command: `ubiformat /dev/mtd8 -y -f /tmp/ubi.bin`
   Then reboot your router, waiting it finished rollback in minutes.

Notes:
1. Openwrt U-Boot and ubootmod openwrt did not enable NMBM.
   Please make your backup safe.

Signed-off-by: Hank Moretti <mchank9999@gmail.com>
2023-07-27 13:46:16 +02:00
Alexander Friese 6b11f0ec83 ipq4019: fix support for AVM FRITZ!Repeater 3000
new versions of the device have NAND with 8bit ECC
which was not yet supported before. This change removes
ECC restrictions.

Signed-off-by: Alexander Friese <af944580@googlemail.com>
2023-07-26 12:26:45 +02:00
Lu jicong 06d5c773fa rockchip: enable wifi support for NanoPC T4
wifi module: AP6356S (BCM4356) SDIO

Signed-off-by: Lu jicong <jiconglu58@gmail.com>
2023-07-26 12:15:20 +02:00
Lu jicong ac9a2d6a35 rockchip: add FriendlyARM NanoPC T4 support
Hardware
--------
RockChip RK3399 ARM64 (6 cores)
4GB LPDDR3 RAM
1x 1000 Base-T
1 GPIO LED (status)
HDMI 2.0
3.5mm TRRS AV jack
Micro-SD slot
16GB eMMC
1x USB 3.0 Port
2x USB 2.0 Port
1x USB Type-C Port
1x M.2 PCI-E Port
AP6356S (BCM4356) SDIO WiFi & Bluetooth adapter
--------
Note: AP6356S is not supported yet due to the lack of firmware and NVRAM

Signed-off-by: Lu jicong <jiconglu58@gmail.com>
2023-07-26 12:15:20 +02:00
David Bauer 844bb4bfad ipq40xx: add support for Teltonika RUTX50
Hardware
--------
CPU:     Qualcomm IPQ4018
RAM:     256M
Flash:   16MB SPI-NOR (W25Q128)
         128MB SPI-NAND (XTX)
WiFi:    2T2R (2GHz 802.11n ; 5 GHz 802.11ac)
ETH:     4x LAN ; 1x WAN (Gigabit)
CELL:    Quectel RG501Q 3G/4G/5G

UART: Available on the goldfinger connector (Pinout silkscreened)
      115200 8N1 3V3 - Only connect RX / TX / GND

Installation
------------

1. Enable SSH in the Teltonika UI
   (System --> Administration --> Access Control)

2. Check from which partition set the device is currently running from.

   $ cat /proc/boot_info/rootfs/primaryboot

   In case this output reads 0, install a Software update from Teltonika
   first. After upgrade completion, check this file now reads 1 before
   continuing.

2. Transfer the OpenWrt factory image to the device using scp. Use the
   same password (user root!) as used for the Web-UI.

   $ scp -O openwrt-factory.bin root@192.168.1.1:/tmp

3. Connect to the device using ssh as the root user.

4. Install OpenWrt by writing the factory image to flash.

   $ ubiformat /dev/mtd16 -y -f /tmp/openwrt-factory.bin

5. Instruct the bootloaer to boot from the first partition set.

   $ echo 0 > /proc/boot_info/rootfs/primaryboot
   $ cat /proc/boot_info/getbinary_bootconfig > /tmp/bootconfig.bin
   $ cat /proc/boot_info/getbinary_bootconfig1 > /tmp/bootconfig1.bin
   $ mtd write /tmp/bootconfig.bin /dev/mtd2
   $ mtd write /tmp/bootconfig1.bin /dev/mtd3

6. Reboot the device.

   $ reboot

Signed-off-by: David Bauer <mail@david-bauer.net>
2023-07-26 01:17:08 +02:00
David Bauer dbc4be142e ipq40xx: move Teltonika RUT STM32 IO to specific DTS
Prepare to re-use the DTS for the RUTX50.

Signed-off-by: David Bauer <mail@david-bauer.net>
2023-07-26 01:17:08 +02:00
John Audia d91f38a99e kernel: bump 6.1 to 6.1.40
Removed upstreamed:
	generic/backport-6.1/701-v6.5-net-bgmac-postpone-turning-IRQs-off-to-avoid-SoC-han.patch[1]
	generic/pending-6.1/160-workqueue-fix-enum-type-for-gcc-13.patch[2]
	qualcommax/patches-6.1/0022-v6.5-soc-qcom-mdt_loader-Fix-unconditional-call-to-scm_pa.patch[3]

Manually rebased:
	bcm27xx/patches-6.1/950-0359-xhci-quirks-add-link-TRB-quirk-for-VL805.patch
	bcm27xx/patches-6.1/950-0362-usb-xhci-add-VLI_TRB_CACHE_BUG-quirk.patch
	bcm27xx/patches-6.1/950-0390-usb-xhci-add-a-quirk-for-Superspeed-bulk-OUT-transfe.patch
	bcm27xx/patches-6.1/950-0469-usb-xhci-add-XHCI_VLI_HUB_TT_QUIRK.patch
	bcm53xx/patches-6.1/180-usb-xhci-add-support-for-performing-fake-doorbell.patch

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.40&id=685b57a1221c38ec8b456f968264d2496715820c
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.40&id=2d57a1590f4d8c516f5aaf8fd5bb4f52d67275d8
3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.40&id=33f8dff6e1cbba5c2ec85fa5649c0a759a7e685c

Build system: x86/64, filogic/xiaomi_redmi-router-ax6000-ubootmod
Build-tested: x86/64, filogic/xiaomi_redmi-router-ax6000-ubootmod
Run-tested: x86/64

Signed-off-by: John Audia <therealgraysky@proton.me>
2023-07-25 00:24:21 +02:00
John Audia fec22f8375 kernel: bump 6.1 to 6.1.39
Removed upstreamed:
	generic/backport-6.1/803-v6.5-01-leds-trigger-netdev-Recheck-NETDEV_LED_MODE_LINKUP-o.patch[1]
	generic/pending-6.1/143-jffs2-reduce-stack-usage-in-jffs2_build_xattr_subsys.patch[2]
	bcm27xx/patches-6.1/950-0034-drm-bridge-Introduce-pre_enable_upstream_first-to-al.patch[3]
	bcm27xx/patches-6.1/950-0439-nvmem-Use-NVMEM_DEVID_AUTO.patch[4]
	bcm4908/patches-6.1/040-mtd-parsers-refer-to-ARCH_BCMBCA-instead-of-ARCH_BCM.patch[5]
	bcm53xx/patches-6.1/031-v6.5-0003-ARM-dts-BCM5301X-Drop-clock-names-from-the-SPI-node.patch[6]
	bcm53xx/patches-6.1/031-v6.5-0015-ARM-dts-BCM5301X-fix-duplex-full-full-duplex.patch[7]
	mediatek/patches-6.1/351-cpufreq-mediatek-correct-voltages-for-MT7622-and-MT7.patch[8]
	qualcommax/patches-6.1/0008-v6.2-clk-qcom-reset-support-resetting-multiple-bits.patch[9]

Manually rebased:
	bcm27xx/patches-6.1/950-0035-drm-panel-Add-prepare_upstream_first-flag-to-drm_pan.patch
	bcm27xx/patches-6.1/950-0404-drm-panel-panel-ilitek9881c-Add-prepare_upstream_fir.patch
	bcm27xx/patches-6.1/950-0699-Bluetooth-hci_sync-Add-fallback-bd-address-prop.patch
	mediatek/patches-6.1/350-21-cpufreq-mediatek-Add-support-for-MT7988.patch

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.39&id=ab0bd172d6289310a05a0cd15e1432e828d386ae
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.39&id=6df680709d901346831ef8f221cc90a42062c526
3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.39&id=5044e5f2511c9afdf9880d2bb6b9d37dfc345dac
4. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.39&id=e27948f329f7e02591ed1feb9a7710c2ccf89a83
5. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.39&id=ad2928e7f3f6120a0bd18aa1056b3b24068027c5
6. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.39&id=2b55a985727833f37c39911f34096b3fdf2a367d
7. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.39&id=90d4c487cd658b51212eb65ae804ab11af193672
8. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.39&id=7e3ee25e8c7c7be1eacdfc6d9f5f0e550a2af241
9. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.39&id=b20854ef6c4955be3310975a72f02d92cb01d6d4

Build system: x86/64
Build-tested: x86/64
Run-tested: x86/64

Co-authored-by: Hauke Mehrtens <hauke@hauke-m.de>
Co-authored-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: John Audia <therealgraysky@proton.me>
[ rebase bcm27xx and mediatek patches, refresh commit description ]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
[ minor fixup to bcm27xx patches, refresh commit description ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-07-25 00:24:21 +02:00
Felix Fietkau a110de8152 kernel: drop mips highmem offset start overrides
The maximum offset that can be supported is 0x20000000
Do not override it to to something bigger than that on MT7621, as that could
cause issues based on the fixed memory mappings. This makes the last 64 MB
RAM unusable on MT7621 devices with 512 MB but avoids incurring a heavy
performance hit

Fixes: cd2b74e01e ("ramips: mt7621: disable highmem support and remove highmem offset patch")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-07-24 14:45:29 +02:00
Felix Fietkau cd2b74e01e ramips: mt7621: disable highmem support and remove highmem offset patch
On MT7621 it was observed, that enabling highmem support causes a significant
performance drop, as documented in: https://github.com/openwrt/openwrt/issues/13151
By adjusting the highmem start offset, we avoid leaving any RAM unaddressable,
even on devices with 512 MB

Fixes: https://github.com/openwrt/openwrt/issues/13151
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-07-24 13:36:39 +02:00
Rafał Miłecki 79fd3e62b4 bcm53xx: add BCM53573 Ethernet fix sent upstream for v6.6
It seems that DSA-based b53 driver never worked with BCM53573 SoCs and
BCM53125.

In case of swconfig-based b53 this fixes a regression. Switching bgmac
from using mdiobus_register() to of_mdiobus_register() resulted in MDIO
device (BCM53125) having of_node set (see of_mdiobus_register_phy()).
That made downstream b53 driver read invalid data from DT and broke
Ethernet support.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-07-23 22:49:13 +02:00
Christian Marangi 8912e386e3
bcm27xx: update dwc_otc driver with new kthread_complete_and_exit name
Kernel 6.1 renamed and moved complete_and_exit to
kthread_complete_and_exit.

This was just a rename and nothing is changed implementation wise.
Update to the new symbol name to fix compilation error.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-07-23 14:45:18 +02:00
David Bauer 36f7ececc2 mediatek: add missing SPDX header
Signed-off-by: David Bauer <mail@david-bauer.net>
2023-07-22 17:41:22 +02:00
Daniel Golle b1d10e0174 mediatek: filogic: set DEVICE_DTS_LOADADDR for BPi-R3
U-Boot complains that the overlayed DT needs relocation, so set
DEVICE_DTS_LOADADDR to have it relocated.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-07-22 12:31:31 +01:00
David Bauer f0445746f6 mediatek: add support for ZyXEL NWA50AX Pro
Hardware
--------
CPU:    Mediatek MT7981
RAM:    512M DDR4
FLASH:  256M NAND
ETH:    MaxLinear GPY211 (2.5GbE N Base-T)
WiFi:   Mediatek MT7981 (2.4GHz 2T2R:2 5GHz 3T3R:2 802.11ax)
BTN:    1x Reset
LED:    1x Multi-Color

UART Console
------------
Available below the rubber cover next to the ethernet port.

Settings: 115200 8N1

Layout:

<12V> <LAN> GND-RX-TX-VCC

Logic-Level is 3V3. Don't connect VCC to your UART adapter!

Installation Web-UI
-------------------
Upload the Factory image using the devices Web-Interface.

As the device uses a dual-image partition layout, OpenWrt can only
installed on Slot A. This requires the current active image prior
flashing the device to be on Slot B.

In case this is not the case, OpenWrt will boot only one time, returning
to the ZyXEL firmware the second boot.

If this happens, first install a ZyXEL firmware upgrade of any version
and install OpenWrt after that.

Installation TFTP / Recovery
----------------------------
This installation routine is especially useful in case of a bricked
device.

Attach to the UART console header of the device. Interrupt the boot
procedure by pressing Enter.

The bootloader has a reduced command-set available from CLI, but more
commands can be executed by abusing the atns command.

Boot a OpenWrt initramfs image available on a TFTP server at
192.168.1.66. Rename the image to nwa50axpro-openwrt-initramfs.bin.

 $ atnf nwa50axpro-openwrt-initramfs.bin
 $ atna 192.168.1.88
 $ atns "192.168.1.66; tftpboot; setenv fdt_high 0xffffffffffffffff;
   bootm"

Upon booting, set the booted image to the correct slot:

 $ zyxel-bootconfig /dev/mtd9 get-status
 $ zyxel-bootconfig /dev/mtd9 set-image-status 0 valid
 $ zyxel-bootconfig /dev/mtd9 set-active-image 0

Copy the OpenWrt sysupgrade image to the device using scp.
Write the sysupgrade image to NAND using sysupgrade.

 $ sysupgrade -n image.bin

Signed-off-by: David Bauer <mail@david-bauer.net>
2023-07-21 20:28:13 +02:00
Christian Marangi 548c437f7d
ipq806x: reorganize 02_network board.d script
Reorganize 02_network board.d script by splitting setup switch and setup
mac address.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-07-21 14:08:27 +02:00
Christian Marangi 0f1cd99b36
ipq806x: rename kernel files to generic name
Drop 6.1 tag from files directory for ipq806x now that we moved to 6.1
by default.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-07-21 14:08:27 +02:00
Christian Marangi c2635d9b11
ipq806x: 5.15: drop useless kernel patches and dts files
Drop useless 5.15 kernel patches and files now that we moved to kernel
6.1 by default.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-07-21 14:08:26 +02:00
Christian Marangi 8db2ff827b
ipq806x: move to kernel 6.1 by default
Move to kernel 6.1 by default in preparation for DSA introduction.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-07-21 14:08:26 +02:00
Christian Marangi d2a4b87743
ipq806x: 6.1: backport patch fixing broken hwspinlock
Backport merged patch fixing broken hwspinlock due to missing regmap
config for SFPB MMIO implementation.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-07-21 14:08:21 +02:00
Rafał Miłecki 4ad4419490 octeon: use fixed layout cell "mac-base" for Cisco vEdge 1000
This drops a use of downstream "mac-address-increment".

Cc: Christian Svensson <blue@cmd.nu>
Cc: Tommy Nevtelen <tommy@nevtelen.com>
Cc: Viktor Ekmark <viktor@ekmark.se>
Cc: Daniel Wennberg <github@networkninja.se>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Tested-by: Christian Svensson <blue@cmd.nu>
2023-07-21 07:29:40 +02:00
Rafał Miłecki ab9153f2d9 ramips: replace "mac-address-ascii" with "mac-base"
With upstream accepted "mac-base" binding there is no need for a
downstream "mac-address-ascii" workaround anymore.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
[TP-Link EC330-G5u v1 - OK]
Tested-by: Mikhail Zhilkin <csharper2005@gmail.com>
2023-07-21 07:29:40 +02:00
Felix Baumann 9e86a96af5 ath79: move ubnt-xm 64M RAM boards back to generic
return ubnt_rocket-m and ubnt_powerbridge-m back to ath79-generic
They have enough RAM-ressources to not be considered as tiny.

This reverts the commit f4415f7635 partially

Signed-off-by: Felix Baumann <felix.bau@gmx.de>
2023-07-19 08:04:08 +02:00
Rafał Miłecki be7f9ad4dd ramips: fix Ubiquiti EdgeRouter X's MAC address for gmac1
This fixes:
[    0.586649] OF: /ethernet@1e100000/mac@1: #nvmem-cell-cells = 1 found 0

Fixes: 28b6224104 ("ramips: use fixed layout cell "mac-base" for Ubiquiti EdgeRouter X")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2023-07-18 11:27:30 +02:00
Christian Lamparter e9911f10e4 sdk: update SDK Makefile
the SDK's Makefile referenced the old file name.
Update it too.

Fixes: 2d5f7035cf ("sdk: rename README")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2023-07-15 20:58:10 +02:00
Pawel Dembicki b370753fc4 realtek: add support for HPE 1920-8g-poe+
Hardware information:
---------------------

- RTL8380 SoC
- 8 Gigabit RJ45 PoE ports (built-in RTL8218B)
- 2 SFP ports (built-in SerDes)
- RJ45 RS232 port on front panel
- 32 MiB NOR Flash
- 128 MiB DDR3 DRAM
- PT7A7514 watchdog
- PoE chips: Nuvoton M0516LDE + BCM59121

Known issues:
---------------------
- PoE LEDs are uncontrolled.

(Manual taken from f2f09bc002)
Booting initramfs image:
------------------------

- Prepare a FTP or TFTP server serving the OpenWrt initramfs image and
  connect the server to a switch port.

- Connect to the console port of the device and enter the extended
  boot menu by typing Ctrl+B when prompted.

- Choose the menu option "<3> Enter Ethernet SubMenu".

- Set network parameters via the option "<5> Modify Ethernet Parameter".
  Enter the FTP/TFTP filename as "Load File Name" ("Target File Name"
  can be left blank, it is not required for booting from RAM). Note that
  the configuration is saved on flash, so it only needs to be done once.

- Select "<1> Download Application Program To SDRAM And Run".

Initial installation:
---------------------

- Boot an initramfs image as described above, then use sysupgrade to
  install OpenWrt permanently. After initial installation, the
  bootloader needs to be configured to load the correct image file

- Enter the extended boot menu again and choose "<4> File Control",
  then select "<2> Set Application File type".

- Enter the number of the file "openwrt-kernel.bin" (should be 1), and
  use the option "<1> +Main" to select it as boot image.

- Choose "<0> Exit To Main Menu" and then "<1> Boot System".

NOTE: The bootloader on these devices can only boot from the VFS
filesystem which normally spans most of the flash. With OpenWrt, only
the first part of the firmware partition contains a valid filesystem,
the rest is used for rootfs. As the bootloader does not know about this,
you must not do any file operations in the bootloader, as this may
corrupt the OpenWrt installation (selecting the boot image is an
exception, as it only stores a flag in the bootloader data, but doesn't
write to the filesystem).

Example PoE config file (/etc/config/poe):
---------------------
config global
        option budget   '180'

config port
        option enable   '1'
        option id       '1'
        option name     'lan8'
        option poe_plus '1'
        option priority '2'
config port
        option enable   '1'
        option id       '2'
        option name     'lan7'
        option poe_plus '1'
        option priority '2'
config port
        option enable   '1'
        option id       '3'
        option name     'lan6'
        option poe_plus '1'
        option priority '2'
config port
        option enable   '1'
        option id       '4'
        option name     'lan5'
        option poe_plus '1'
        option priority '2'
config port
        option enable   '1'
        option id       '5'
        option name     'lan4'
        option poe_plus '1'
        option priority '2'
config port
        option enable   '1'
        option id       '6'
        option name     'lan3'
        option poe_plus '1'
        option priority '2'
config port
        option enable   '1'
        option id       '7'
        option name     'lan2'
        option poe_plus '1'
        option priority '2'
config port
        option enable   '1'
        option id       '8'
        option name     'lan1'
        option poe_plus '1'
        option priority '2'

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
2023-07-15 17:05:58 +02:00
Carsten Spieß 700f11aaad octeon: ubnt-edgerouter-4/6p: devicetree cleanup
removed redundant eeprom partition nodes from
cn7130_ubnt_edgerouter-4.dts and cn7130_ubnt_edgerouter-6p.dts
as they are identically defined in cn7130_ubnt_edgerouter-e300.dtsi.

Signed-off-by: Carsten Spieß <mail@carsten-spiess.de>
(integrated eeprom referenced node in the .dtsi)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2023-07-15 17:05:58 +02:00