openwrt/openwrt.git
19 months agohostapd: don't select indoor channel on outdoor operation
David Bauer [Fri, 9 Sep 2022 23:06:02 +0000 (01:06 +0200)]
hostapd: don't select indoor channel on outdoor operation

Don't select channels designated for exclusive-indoor use when the
country3 element is set on outdoor operation.

Signed-off-by: David Bauer <mail@david-bauer.net>
19 months agowireless-regdb: update to 2022-08-12
Nick Hainke [Sat, 17 Sep 2022 06:05:47 +0000 (08:05 +0200)]
wireless-regdb: update to 2022-08-12

Changes:
9dc9c89 wireless-regdb: update regulatory database based on preceding changes
442bc25 wireless-regdb: update 5 GHz rules for PK and add 60 GHz rule
daee7f3 wireless-regdb: add 5 GHz rules for GY

Signed-off-by: Nick Hainke <vincent@systemli.org>
19 months agolinux-firmware: update to 20220913
Nick Hainke [Sat, 17 Sep 2022 06:30:00 +0000 (08:30 +0200)]
linux-firmware: update to 20220913

Changes:
f09bebf amdgpu: update yellow carp DMCUB firmware
db6db36 amdgpu: add firmware for VCN 3.1.2 IP block
3647da5 amdgpu: add firmware for SDMA 5.2.6 IP block
639b5c1 amdgpu: add firmware for PSP 13.0.5 IP block
7658946 amdgpu: add firmware for GC 10.3.6 IP block
427ca6c amdgpu: add firmware for DCN 3.1.5 IP block
edf9a2b qcom: rename Lenovo ThinkPad X13s firmware paths
9ebd5a5 rtw89: 8852c: update fw to v0.27.42.0
7546432 rtw89: 8852c: update fw to v0.27.36.0
2f2f018 Mellanox: Add new mlxsw_spectrum firmware xx.2010.3146
706a462 amdgpu: update beige goby VCN firmware
09ec438 amdgpu: update dimgrey cavefish VCN firmware
647021b amdgpu: update navy flounder VCN firmware
3c1662d amdgpu: update sienna cichlid VCN firmware
d3c9228 rtl_bt: Update RTL8852C BT USB firmware to 0xDFB8_5A33
a1c4b15 mediatek: reference the LICENCE file for MediaTek firmwares

Signed-off-by: Nick Hainke <vincent@systemli.org>
19 months agolinux-firmware: update to 20220815
Nick Hainke [Sat, 17 Sep 2022 06:23:39 +0000 (08:23 +0200)]
linux-firmware: update to 20220815

Changes:
12ca075 mediatek: Add new mt8186 SOF firmware
aed71f2 ice: Update package to 1.3.30.0
1ee415b QCA: Update Bluetooth WCN685x 2.1 firmware to 2.1.0-00438
c58f001 brcm: Add nvram for Lenovo Yoga Tablet 2 830F/L and 1050F/L tablets
d4a4224 brcm: Add nvram for the Xiaomi Mi Pad 2 tablet
7220731 brcm: Add nvram for the Asus TF103C tablet
89ec619 Add amd-ucode README file
4f8f67e qca: Update firmware files for BT chip WCN6750.
        This commit will update required firmware files for WCN6750.
e6857b6 amdgpu: Update Yellow Carp VCN firmware
e6185d5 linux-firmware: Update firmware file for Intel Bluetooth 9462
140beaf linux-firmware: Update firmware file for Intel Bluetooth 9462
045847e linux-firmware: Update firmware file for Intel Bluetooth 9560
f7f3d1f linux-firmware: Update firmware file for Intel Bluetooth 9560
45c5e53 linux-firmware: Update firmware file for Intel Bluetooth AX201
1068c45 linux-firmware: Update firmware file for Intel Bluetooth AX201
b93bf2c linux-firmware: Update firmware file for Intel Bluetooth AX211
31d24ca linux-firmware: Update firmware file for Intel Bluetooth AX211
447ca4a linux-firmware: Update firmware file for Intel Bluetooth AX210
87d07fd linux-firmware: Update firmware file for Intel Bluetooth AX200
63a87d2 linux-firmware: Update firmware file for Intel Bluetooth AX201
a45053c Mellanox: Add new mlxsw_spectrum firmware xx.2010.3020
4ae4ae8 qcom: Add firmware for Lenovo ThinkPad X13s
feda199 linux-firmware: Add firmware for Cirrus CS35L41
a4235e0 i915: Add GuC v70.4.1 for DG2
3ab394a i915: Add DMC v2.07 for DG2
150864a amdgpu partially revert "amdgpu: update beige goby to release 22.20"
56cf646 mediatek: Update mt8183/mt8192/mt8195 SCP firmware
4421586 amdgpu: update renoir to release 22.20
06cead1 amdgpu: update beige goby to release 22.20
d3e37b7 amdgpu: update yellow carp to release 22.20
9149732 amdgpu: update dimgrey cavefish to release 22.20
c2f5699 amdgpu: update vega20 to release 22.20
c3afe6a amdgpu: update vega12 to release 22.20
e840fe5 amdgpu: update raven to release 22.20
efe98d4 amdgpu: update navy flounder to release 22.20
5f13921 amdgpu: update vega10 to release 22.20
8da4640 amdgpu: update sienna cichlid to release 22.20
3fbfd89 amdgpu: update navi14 to release 22.20
8fe4b42 amdgpu: update green sardine to release 22.20
ca36bb9 amdgpu: update vangogh to release 22.20
21ba56c amdgpu: update navi12 to release 22.20
e9918d2 amdgpu: update navi10 to release 22.20
f379030 amdgpu: update picasso to release 22.20
1826c07 amdgpu: update aldebaran to release 22.20
1cbf1c6 amdgpu: update psp 13.0.8 TA firmware
35bb3bd WHENCE: Fix the dangling symlinks fix
84661a3 amdgpu: update DMCUB firmware for DCN 3.1.6
dfa2931 WHENCE: Correct dangling symlinks

Signed-off-by: Nick Hainke <vincent@systemli.org>
19 months agorealtek: move Netgear recipe to subtarget Makefile
Olliver Schinagl [Tue, 13 Sep 2022 14:52:50 +0000 (16:52 +0200)]
realtek: move Netgear recipe to subtarget Makefile

There seems to be no reason to have the Netgear switches as part of
the main Makefile. Move it to its subtarget-specific Makefile since
it is only applicable there.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
[update commit message]
Signed-off-by: Sander Vanheule <sander@svanheule.net>
19 months agorealtek: move hpe_1920 recipe to common.mk
Sander Vanheule [Sat, 17 Sep 2022 20:20:30 +0000 (22:20 +0200)]
realtek: move hpe_1920 recipe to common.mk

Currently supported HPE 1920 devices all have an RTL838x SoC, but there
are larger switches with RTL839x SoCs, although currently not supported.
Move the build recipe to common.mk so the larger devices can also make
use of the recipe, while moving it out of the main Makefile.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
19 months agorealtek: merge duplicated DGS-1210 recipes
Sander Vanheule [Sat, 17 Sep 2022 20:06:37 +0000 (22:06 +0200)]
realtek: merge duplicated DGS-1210 recipes

The D-Link DGS-1210 device series currently has supported devices with
both RTL838x and RTL839x SoCs. An image build recipe has been defined in
both subtarget makefiles, but these are mostly identical, save for the
SOC variable.

Move the SOC variable from the DGS-1210 build recipes to the applicable
devices, and put the remaining duplicate code in a shared Makefile.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
19 months agorealtek: add support for DGS-1210-52
Markus Stockhausen [Sat, 17 Sep 2022 17:12:19 +0000 (19:12 +0200)]
realtek: add support for DGS-1210-52

Hardware specification
----------------------

* RTL8393M SoC, 1 MIPS 34Kc core @ 700MHz
* 128MB DRAM
* 32MB NOR Flash
* 48 x 10/100/1000BASE-T ports
  - 6 x External PHY with 8 ports (RTL8218D)
* 4 x Gigabit RJ45/SFP Combo ports
  - External PHY with 4 SFP ports (RTL8214FC)
* Power LED
* Reset button on front panel
* UART (115200 8N1) via unpopulated standard 0.1" pin header marked J14

The gpio-restart node is not required but it does reset the switch.

TODO: The 4 combo ports attached to the RTL8214FC are not detect
properly. Linux kernel reports 49 and 50 as "External RTL8393 SERDES"
and 51 and 52 as "RTL8218B (external)". Those ports only work if
u-boot initialize it (for example, loading initramfs image using one
of those ports). A patch to PHY detection is needed for full support.

The firmware recovery using U-Boot is broken for all DGS-1210 tested
devices as pressing RESET does not trigger it (only if pressed from a
running stock image)

UART pinout
-----------

[o]ooo|J14
 | ||`------ GND
 | |`------- RX
 | `-------- TX
 `---------- Vcc (3V3)

Installation using OEM upgrade
------------------------------

1. Make sure you are running OEM firmware in image2 slot (logged as admin):
   - > config firmware image_id 2 boot_up
   - > reboot
2. Install squashfs-factory_image1.bin to image1 using (logged as admin):
   - > download firmware_fromTFTP <tftpserver> factory_image1.bin
   - > config firmware image_id 1 boot_up
   - > reboot

Installation using serial interface
-----------------------------------

1. Press Escape key during `Hit Esc key to stop autoboot` prompt
2. Press CTRL+C keys to get into real U-Boot prompt
3. Init network with `rtk network on` command
4. Load image with `tftpboot 0x8f000000 openwrt-realtek-rtl839x-d-link_dgs-1210-52-initramfs-kernel.bin` command
5. Boot the image with `bootm` command

Once booted the initramfs, install the squashfs-sysupgrade.bin as a
normal OpenWrt system.

Dual-boot with stock firmware using writable u-boot-env
-------------------------------------------------------

From stock to OpenWrt / boot image 1 (CLI as admin):
   - > config firmware image_id 1 boot_up
   - > reboot

From OpenWrt to stock / boot image 2: (shell as root)
   - # fw_setenv bootcmd 'run addargs ; bootm 0xb4e80000'
   - # fw_setenv image '/dev/mtdblock7'
   - # reboot

Debrick using serial interface
------------------------------

1. Press Escape key during `Hit Esc key to stop autoboot` prompt
2. In a Windows PC, run 'D-Link Network Assistant v2.0.2.4'. It should
   detect the switch
3. Flash the firmware.

Back to stock firmware using dual-boot
--------------------------------------

If you have serial interface, you can change u-boot env vars
interrupting the boot process. If not but you are running OpenWrt, you
can dual-boot (as mentioned eariler) and skip to step 4:

1. Press Escape key during `Hit Esc key to stop autoboot` prompt
2. Press CTRL+C keys to get into real U-Boot prompt
3. Boot the image 2:
   - set image /dev/mtdblock7; run addargs; bootm 0xb4e80000
4. Once booted, log as admin and change the boot image to 2
   - > config firmware image_id 2 boot_up
   - > reboot
5. After the boot, flash image1 with the vendor image

Back to stock firmware using DNA
--------------------------------

1. From an OpenWrt:
   - # fw_setenv bootstop on
   - # reboot
2. In a Windows PC, run 'D-Link Network Assistant v2.0.2.4'. It should
   detect the switch
3. Flash the firmware.

It has been developed and tested on device with F3 revision.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
19 months agorealtek: align DT macros in RTL839X with RTL838X
Markus Stockhausen [Sat, 17 Sep 2022 17:06:33 +0000 (19:06 +0200)]
realtek: align DT macros in RTL839X with RTL838X

Add a missing definition to the RTL839X DT.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
19 months agorealtek: D-Link make common DT include generic
Markus Stockhausen [Sat, 17 Sep 2022 17:03:13 +0000 (19:03 +0200)]
realtek: D-Link make common DT include generic

The D-Link DGS device tree was reorganized to better reflect the common
DT parts. The common include is named SOC specific (838X) and it seemed
like a good choice to add another common include in the future for the
RTL839X devices. From the current point of view this option is not really
needed.

1. The common part only includes data that matches RTL839X devices too.
2. The Panasonic DT structure avoids including the basic DTSI inside the
   common DTSI.

Taking simplicity of the Panasonic include logic and in perparation to
provide DGS-1210-52 support it makes sense to harmonize this.

- rename common include to reflect its content
- move the link to the root DTSI directly to the device specific DTS

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
19 months agoramips: 5.15: add disabled PINCTRL_AW9523
Sungbo Eo [Sat, 17 Sep 2022 18:06:18 +0000 (03:06 +0900)]
ramips: 5.15: add disabled PINCTRL_AW9523

Otherwise kernel 5.15 will fail to build on subtargets except for mt7621
that has enabled the config.
The disabled PINCTRL_AW9523 config disappears after a refresh, it needs
to be added back manually.

Fixes: 675cf7557829 ("ramips: add config-5.15 for mt7620 subtarget")
Fixes: 001176994a58 ("ramips: add config-5.15 for mt76x8 subtarget")
Fixes: b9d9f33c330e ("ramips: add config-5.15 for rt288x subtarget")
Fixes: 0164dc0c2563 ("ramips: add config-5.15 for rt305x subtarget")
Fixes: ef59da866982 ("ramips: add config-5.15 for rt3883 subtarget")
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
19 months agoramips: 5.15: refresh subtarget kconfigs
Sungbo Eo [Sat, 17 Sep 2022 18:06:00 +0000 (03:06 +0900)]
ramips: 5.15: refresh subtarget kconfigs

Refresh config with `make kernel_oldconfig`.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
19 months agoath79: specify factory.bin recipe for ASUS RP-AC51
Sungbo Eo [Sat, 17 Sep 2022 16:07:32 +0000 (01:07 +0900)]
ath79: specify factory.bin recipe for ASUS RP-AC51

Currently factory.bin image recipe of ASUS RP-AC51 is not specified
explicitly and is thus set to the leaked one from the device recipe
right above, i.e. ASUS PL-AC56. Fix it to avoid potential breakage.

Fixes: 416d4483e878 ("ath79: add support for ASUS RP-AC51")
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
19 months agomac80211: rt2x00: fix typo
Sungbo Eo [Mon, 31 Jan 2022 17:53:59 +0000 (02:53 +0900)]
mac80211: rt2x00: fix typo

Add missing semicolon and refresh patches.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
19 months agoltq-[a|v]dsl-app: provide ltq-dsl-app
Andre Heider [Fri, 2 Sep 2022 07:48:22 +0000 (09:48 +0200)]
ltq-[a|v]dsl-app: provide ltq-dsl-app

This makes it easier for packages to depend on any
lantiq/intel/maxlinear compatible dsl daemon.

Signed-off-by: Andre Heider <a.heider@gmail.com>
19 months agoltq-vdsl-app: rename to ltq-vdsl-vr9-app
Andre Heider [Tue, 23 Aug 2022 13:18:49 +0000 (15:18 +0200)]
ltq-vdsl-app: rename to ltq-vdsl-vr9-app

This matches the scheme used by other target packages and will avoid
confusion with any future version.

Signed-off-by: Andre Heider <a.heider@gmail.com>
19 months agolantiq: rename ltq-vdsl folder to ltq-vdsl-vr9
Andre Heider [Fri, 15 Jul 2022 12:32:59 +0000 (14:32 +0200)]
lantiq: rename ltq-vdsl folder to ltq-vdsl-vr9

Now PKG_NAME matches the folder name, and this will avoid confusion with
any future version.

Signed-off-by: Andre Heider <a.heider@gmail.com>
19 months agolantiq: rename ltq-vdsl-mei folder to ltq-vdsl-vr9-mei
Andre Heider [Fri, 15 Jul 2022 12:30:29 +0000 (14:30 +0200)]
lantiq: rename ltq-vdsl-mei folder to ltq-vdsl-vr9-mei

Now PKG_NAME matches the folder name, and this will avoid confusion with
any future version.

Signed-off-by: Andre Heider <a.heider@gmail.com>
19 months agokernel: bump 5.10 to 5.10.143
John Audia [Thu, 15 Sep 2022 13:56:36 +0000 (09:56 -0400)]
kernel: bump 5.10 to 5.10.143

All patches automatically rebased.

Signed-off-by: John Audia <therealgraysky@proton.me>
19 months agokernel: bump 5.15 to 5.15.68
John Audia [Thu, 15 Sep 2022 12:07:08 +0000 (08:07 -0400)]
kernel: bump 5.15 to 5.15.68

All patches automatically rebased

Build system: x86_64
Build-tested: bcm2711/RPi4B, mt7622/RT3200
Run-tested: bcm2711/RPi4B, mt7622/RT3200

Signed-off-by: John Audia <therealgraysky@proton.me>
19 months agomac80211: clean and submit a bunch of rt2x00 patches
Daniel Golle [Fri, 16 Sep 2022 23:33:30 +0000 (00:33 +0100)]
mac80211: clean and submit a bunch of rt2x00 patches

Clean and submit patches, mostly related to MT7620 to linux-wireless
mailing list:
https://patchwork.kernel.org/project/linux-wireless/list/?series=677770

Replace local patches with now submitted versions.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
19 months agopackages: libusb: add package 'fxload' (from libusb examples)
Daniel Golle [Wed, 14 Sep 2022 19:16:50 +0000 (20:16 +0100)]
packages: libusb: add package 'fxload' (from libusb examples)

The 'fxload' tool contained in the examples provided with libusb is
actually useful and turns out to be the only way to load firmware into
some rather ancient EZ-USB microcontrollers made by Cypress (formerly
Anchor Chips).
The original 'fxload' tool from hotplug-linux has been abandonned long
ago and requires usbfs to be mounted in /proc/bus/usb/ (like it was in
Linux 2.4...).
Hence the best option is to package the modern 'fxload' from the libusb
examples which (unsurprisingly) uses libusb and works on modern
systems.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
19 months agounetd: add missing init script
Felix Fietkau [Fri, 16 Sep 2022 20:02:28 +0000 (22:02 +0200)]
unetd: add missing init script

Signed-off-by: Felix Fietkau <nbd@nbd.name>
19 months agounetd: update to the latest version
Felix Fietkau [Fri, 16 Sep 2022 19:57:57 +0000 (21:57 +0200)]
unetd: update to the latest version

e065a7627a46 pex: update last query sent timestamp
6c888f897862 unet-cli: add stun server list editing support

Signed-off-by: Felix Fietkau <nbd@nbd.name>
19 months agounetd: update to the latest version
Felix Fietkau [Fri, 16 Sep 2022 19:11:05 +0000 (21:11 +0200)]
unetd: update to the latest version

21360a1b1ce6 cli: fix typo
abfebece0af1 wg-linux: ship a copy of linux/wireguard.h
1cbb1a543cb3 pex: reduce unnecessary ping traffic
0c2f39e52d5d pex: remove pex event debug spam
dcf1362c2104 pex: add support for sending/receiving global PEX messages via unix socket
df5f70b8858c ubus: notify on network updates
e58a56697131 add DHT discovery service
be175767bc67 pex: keep active pex hosts after the specified timeout
543e4a3d2ed7 pex: move rx header check to callback function
395659b9c415 pex: move raw ip send code to sendto_rawudp() in utils.c
dda15ea8b3b2 pex: add utility function to get the sockets based on type / address family
e88f2cd4d3f0 utils: add support for passings address family to network_get_endpoint()
639cdcdf6eda pex: add support for figuring out the external data port via STUN servers
9144339ebe1f pex: improve handling of a longer list of PEX hosts
38212218ecdd unet-cli: add DHT support
0d37ca75434d pex: automatically create host entries from incoming endpoint port notifications
035fcc56ef60 host: keep multiple endpoint candidates, one for each type
a089e8ae7504 pex: avoid sending a query to a host more than once every 15 seconds

Signed-off-by: Felix Fietkau <nbd@nbd.name>
19 months agounetd: select unetd from unet-cli instead of depending on it
Felix Fietkau [Fri, 16 Sep 2022 15:06:05 +0000 (17:06 +0200)]
unetd: select unetd from unet-cli instead of depending on it

Some people may explicitly want to select unet-cli for admin purposes

Signed-off-by: Felix Fietkau <nbd@nbd.name>
19 months agowolfssl: add libwolfssl-cpu-crypto package
Eneas U de Queiroz [Mon, 8 Aug 2022 00:56:50 +0000 (21:56 -0300)]
wolfssl: add libwolfssl-cpu-crypto package

libwolfssl-cpu-crypto is a variant of libwolfssl with support for
cryptographic CPU instructions on x86_64 and aarch64.

On aarch64, wolfSSL does not perform run-time detection, so the library
will crash when the AES functions are called.  A preinst script attempts
to check for support by querying /proc/cpuinfo, if installed in a
running system.  When building an image, the script will check the
DISTRIB_TARGET value in /etc/openwrt_release, and will abort
installation if target is bcm27xx.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
19 months agorpcd: update to latest Git HEAD
Jo-Philipp Wich [Mon, 12 Sep 2022 11:48:40 +0000 (13:48 +0200)]
rpcd: update to latest Git HEAD

e80d0b2 ucode: pass-through `ubus_rpc_session` argument
0d02243 ucode: initialize module search path early

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
19 months agoucode: update to latest Git HEAD
Jo-Philipp Wich [Mon, 5 Sep 2022 08:50:39 +0000 (10:50 +0200)]
ucode: update to latest Git HEAD

cc4eb79 ubus: support obtaining numeric error code
01c412c ubus: add toplevel constants for ubus status codes
8e240fa ubus: allow object method call handlers to return a numeric status code
5cdddd3 lib: add limit support to split() and replace()
0ba9c3e fs: add optional third permission argument to fs.open()
c1f7b3b lib: remove fixed capture group limit in match() and regex replace()

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
19 months agokernel: mhi: backport upstream patch
Koen Vandeputte [Tue, 13 Sep 2022 11:44:17 +0000 (13:44 +0200)]
kernel: mhi: backport upstream patch

This patch will print the name of the modem in the bootlog
during probing.

This allows to verify that the exact model was loaded and not some
generic type.

The only other way to do this is by enabling dynamic debugging
which is disabled by default in OpenWRT

Signed-off-by: Koen Vandeputte <koen.vandeputte@citymesh.com>
19 months agomac80211: merge upstream fixes
Koen Vandeputte [Mon, 22 Aug 2022 09:18:35 +0000 (11:18 +0200)]
mac80211: merge upstream fixes

fetched from upstream kernel v5.15.67

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
19 months agomac80211: merge pending fixes for tx queueing issues
Felix Fietkau [Thu, 15 Sep 2022 14:38:18 +0000 (16:38 +0200)]
mac80211: merge pending fixes for tx queueing issues

Fixes a potential deadlock and a tx queue hang on STA assoc

Signed-off-by: Felix Fietkau <nbd@nbd.name>
19 months agomt76: update to the latest version
Felix Fietkau [Thu, 15 Sep 2022 11:35:52 +0000 (13:35 +0200)]
mt76: update to the latest version

94eb0bc1374d wifi: mt76: testmode: use random payload for tx packets
f8ece810002b wifi: mt76: add rx_check callback for usb devices
67fbdb7bed90 wifi: mt76: mt7921e: fix race issue between reset and suspend/resume
a9b09dd2715f wifi: mt76: mt7921s: fix race issue between reset and suspend/resume
ee3eb0d6d52e wifi: mt76: mt7921u: fix race issue between reset and suspend/resume
9706ccef5447 wifi: mt76: mt7921u: remove unnecessary MT76_STATE_SUSPEND
74a29eb4f714 wifi: mt76: mt7921: move mt7921_rx_check and mt7921_queue_rx_skb in mac.c
f49e06c4cfce wifi: mt76: sdio: fix the deadlock caused by sdio->stat_work
322656141fa4 wifi: mt76: sdio: poll sta stat when device transmits data
dee0a3cbfb03 wifi: mt76: mt7915: fix an uninitialized variable bug
9dd7be2c5164 wifi: mt76: mt7921: fix use after free in mt7921_acpi_read()
0ad02c9a4512 wifi: mt76: sdio: add rx_check callback for sdio devices
fe85e5ccbaca wifi: mt76: sdio: fix transmitting packet hangs
206c7ebd7464 wifi: mt76: mt7615: add mt7615_mutex_acquire/release in mt7615_sta_set_decap_offload
bf79f5d73e4f wifi: mt76: mt7915: fix possible unaligned access in mt7915_mac_add_twt_setup
c4132ab0bea2 wifi: mt76: connac: fix possible unaligned access in mt76_connac_mcu_add_nested_tlv
52eec74986cf wifi: mt76: mt7663s: add rx_check callback
019ef069e754 wifi: mt76: mt76_usb.mt76u_mcu.burst is always false remove related code
0a392ca03db8 wifi: mt76: mt7921: add mt7921_mutex_acquire at mt7921_[start, stop]_ap
fbb3554b6236 wifi: mt76: mt7921: add mt7921_mutex_acquire at mt7921_sta_set_decap_offload
b55a4eb2ee21 wifi: mt76: mt7921: fix the firmware version report
2d72c9a74011 wifi: mt76: move move mt76_sta_stats to mt76_wcid
873365b06c5c wifi: mt76: add PPDU based TxS support for WED device
0c64a80a61c2 wifi: mt76: connac: fix in comment
d11f971a452e wifi: mt76: mt7921: get rid of the false positive reset
2ac22300c7ac wifi: mt76: mt7915: fix mcs value in ht mode
5e45533e4ba2 wifi: mt76: fix uninitialized pointer in mt7921_mac_fill_rx
e06376af21dd wifi: mt76: mt7915: do not check state before configuring implicit beamform
0c0bda4aea05 wifi: mt76: mt7921: reset msta->airtime_ac while clearing up hw value
cddc4b43ea93 wifi: mt76: mt7921e: fix rmmod crash in driver reload test
ebbd68842ee0 wifi: mt76: mt7921: introduce Country Location Control support
763a1d90133b wifi: mt76: mt7921e: fix random fw download fail

Signed-off-by: Felix Fietkau <nbd@nbd.name>
19 months agomediatek: build USB XHCI support as module
Daniel Golle [Wed, 14 Sep 2022 19:23:17 +0000 (20:23 +0100)]
mediatek: build USB XHCI support as module

Instead of always including the XHCI driver in the kernel on all
MediaTek boards, selectively include the kernel module only on boards
which actually make use of USB functionality.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
19 months agorealtek: rtl838x: Fix ethernet polling timeout on probe
Olliver Schinagl [Wed, 31 Aug 2022 15:20:52 +0000 (17:20 +0200)]
realtek: rtl838x: Fix ethernet polling timeout on probe

Due to an oversight we accidentally inverted the timeout check. This
patch corrects this.

Fixes: 9cec4a0ea45b ("realtek: Use built-in functionality for timeout loop")
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
[ wrap poll_timeout line to 80 char ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
19 months agoarmvirt: make 5.15 kernel default
Petr Štetiar [Fri, 22 Apr 2022 06:17:13 +0000 (08:17 +0200)]
armvirt: make 5.15 kernel default

In order to begin testing of upcoming kernel.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
19 months agomalta: make 5.15 kernel default
Petr Štetiar [Fri, 22 Apr 2022 06:17:13 +0000 (08:17 +0200)]
malta: make 5.15 kernel default

In order to begin testing of upcoming kernel.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
19 months agompc85xx: Add 5.15 kernel as testing and fix configs
Wojciech Dubowik [Wed, 14 Sep 2022 10:13:10 +0000 (12:13 +0200)]
mpc85xx: Add 5.15 kernel as testing and fix configs

Build system: x86_64
Build-tested: generic
Run-tested: generic/TL-WDR4900 v1 board from TP-Link

Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@westermo.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [un-dmarc]
19 months agompc85xx: Copy over kernel 5.10 patches and config to 5.15
Wojciech Dubowik [Wed, 14 Sep 2022 10:12:06 +0000 (12:12 +0200)]
mpc85xx: Copy over kernel 5.10 patches and config to 5.15

Split patches for better change visibility.

Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@westermo.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [un-dmarc, commit description]
19 months agotegra: add kernel 5.15 support
Tomasz Maciej Nowak [Tue, 13 Sep 2022 20:38:09 +0000 (22:38 +0200)]
tegra: add kernel 5.15 support

- refresh config
- disable suspend as it's pointless in the sope of OpenWrt
- enable CPU frequency scaling

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
19 months agotegra: copy patches and config for kernel 5.15
Tomasz Maciej Nowak [Tue, 13 Sep 2022 20:38:08 +0000 (22:38 +0200)]
tegra: copy patches and config for kernel 5.15

Simple copy to better illustrate the forthcoming changes.

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
19 months agobcm53xx: update NVMEM driver for NVRAM
Rafał Miłecki [Wed, 14 Sep 2022 12:20:38 +0000 (14:20 +0200)]
bcm53xx: update NVMEM driver for NVRAM

Include support for NVMEM cells.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
19 months agorealtek: Use built-in functionality for timeout loop
Olliver Schinagl [Wed, 31 Aug 2022 15:20:52 +0000 (17:20 +0200)]
realtek: Use built-in functionality for timeout loop

In commit 81e3017609be ("realtek: clean up rtl838x MDIO busy wait loop")
a hand-crafted loop was created, that nearly exactly replicate the
iopoll's `read_poll_timeout` functionality.

Use that instead.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
19 months agoscripts: add clean of build dir to dl_cleanup script
Ansuel Smith [Tue, 6 Jul 2021 01:28:55 +0000 (03:28 +0200)]
scripts: add clean of build dir to dl_cleanup script

Improve dl_cleanup by adding an option to also clean the build directory
related to the downloaded package.
The script will check every directory in build_dir/ and check if any
old package is present there. If outdated package are found, the old
one are cleared leaving only the last one.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
19 months agoscripts: assume dl/ the default dir for dl_cleanup script
Ansuel Smith [Tue, 6 Jul 2021 01:25:06 +0000 (03:25 +0200)]
scripts: assume dl/ the default dir for dl_cleanup script

Assume dl/ the default dl dir and make it configurable if someone have that in
a different place.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
19 months agoscripts: add additional regex for dl_cleanup
Ansuel Smith [Thu, 31 Mar 2022 19:15:51 +0000 (21:15 +0200)]
scripts: add additional regex for dl_cleanup

Add additional regex for dl_cleanup script to handle
case with xxx-v1.2a and xxx-v1.2.3a

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
19 months agolibcap: use more compatible shebang
Ilya Katsnelson [Tue, 7 Jun 2022 07:23:31 +0000 (10:23 +0300)]
libcap: use more compatible shebang

Patch a script to use a shebang that works on systems that don't have
a /bin/bash, e.g. NixOS or GuixSD.

Signed-off-by: Ilya Katsnelson <me@0upti.me>
19 months agotools/bc: use more compatible shebang
Ilya Katsnelson [Thu, 8 Sep 2022 09:04:05 +0000 (12:04 +0300)]
tools/bc: use more compatible shebang

Update the existing patch to use a shebang that works on systems that
don't have a /bin/bash, e.g. NixOS or GuixSD.

Signed-off-by: Ilya Katsnelson <me@0upti.me>
19 months agokernel: netsupport: Add FQ-PIE as an optional sched kmod and extract PIE
Kabuli Chana [Sun, 7 Aug 2022 23:05:51 +0000 (17:05 -0600)]
kernel: netsupport: Add FQ-PIE as an optional sched kmod and extract PIE

add Flow Queuing with Proportional Integral controller Enhanced (FQ-PIE) as an
optional kmod in network support and extract sched-pie from kmod-sched to
allow dependency on just kmod-sched-pie (PIE).

Signed-off-by: Kabuli Chana <newtownBuild@gmail.com>
19 months agomt7621: fix Linksys E7350 GPIO
Rosen Penev [Mon, 12 Sep 2022 07:59:13 +0000 (00:59 -0700)]
mt7621: fix Linksys E7350 GPIO

When converting this device to use both GMACs, I mistakenly removed
state_default, which prevented GPIO LEDs and keys from being used.

Fixes: f4eef5f2a184 ("ramips: add support for Linksys E7350")
Signed-off-by: Rosen Penev <rosenp@gmail.com>
19 months agomt7621: fix Belkin RT1800 GPIO
Rosen Penev [Mon, 12 Sep 2022 07:55:58 +0000 (00:55 -0700)]
mt7621: fix Belkin RT1800 GPIO

When converting this device to use both GMACs, I mistakenly removed
state_default, which prevented GPIO LEDs and keys from being used.

Add back and and extra LEDs that were missing.

Tested all LEDs by turning them on.

Fixes: 26a6a6a60ba7 ("ramips: add support for Belkin RT1800")
Signed-off-by: Rosen Penev <rosenp@gmail.com>
19 months agoCI: include automatic Pull Request Labeler
Piotr Dymacz [Mon, 20 Jun 2022 11:13:30 +0000 (13:13 +0200)]
CI: include automatic Pull Request Labeler

This adds GitHub CI action which makes use of 'Labeler', allowing
automatic labeling of new PRs, based on the modified files paths.

Below labels are supported and more can be added later:
- 'target/*'
- 'target/imagebuilder'
- 'kernel'
- 'core packages'
- 'build/scripts/tools'
- 'toolchain'
- 'GitHub/CI'

For more information:
https://github.com/marketplace/actions/labeler

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
19 months agorealtek: add support for TP-Link SG2210P
Alexandru Gagniuc [Sat, 20 Aug 2022 18:49:52 +0000 (13:49 -0500)]
realtek: add support for TP-Link SG2210P

Add support for the TP-Link SG2210P switch. This is an RTL8380 based
switch with eight RJ-45 ports with 802.3af PoE, and two SFP ports.

This device shares the same board with the SG2008P and SG2008. To
model this, declare all the capabilities in the sg2xxx dtsi, and
disable unpopulated on the lower end models.

Specifications:
---------------
 - SoC:       Realtek RTL8380M
 - Flash:     32 MiB SPI flash (Vendor varies)
 - RAM:       256 MiB (Vendor varies)
 - Ethernet:  8x 10/100/1000 Mbps with PoE (all ports)
              2x SFP ports
 - Buttons:   1x "Reset" button on front panel
 - Power:     53.5V DC barrel jack
 - UART:      1x serial header, unpopulated
 - PoE:       2x TI TPS23861 I2C PoE controller

Works:
------
  - (8) RJ-45 ethernet ports
  - (2) SFP ports (with caveats)
  - Switch functions
  - System LED

Not yet enabled:
----------------
  - Power-over-Ethernet (driver works, but doesn't enable "auto" mode)
  - PoE LEDs

Enabling SFP ports:
-------------------

The SFP port control lines are hardwired, except for tx-disable. These
lines are controller by the RTL8231 in shift register mode. There is
no driver support for this yet.

However, to enable the lasers on SFP1 and SFP2 respectively:

    echo 0x0510ff00 > /sys/kernel/debug/rtl838x/led/led_p_en_ctrl
    echo      0x140 > /sys/kernel/debug/rtl838x/led/led_sw_p_ctrl.26
    echo      0x140 > /sys/kernel/debug/rtl838x/led/led_sw_p_ctrl.24

Install via serial console/tftp:
--------------------------------

The footprints R27 (0201) and R28 (0402) are not populated. To enable
serial console, 50 ohm resistors should be soldered -- any value from
0 ohm to 50 ohm will work. R27 can be replaced by a solder bridge.

The u-boot firmware drops to a TP-Link specific "BOOTUTIL" shell at
38400 baud. There is no known way to exit out of this shell, and no
way to do anything useful.

Ideally, one would trick the bootloader into flashing the sysupgrade
image first. However, if the image exceeds 6MiB in size, it will not
work. The sysupgrade image can also be flashed. To install OpenWrt:

Prepare a tftp server with:
 1. server address: 192.168.0.146
 2. the image as: "uImage.img"

Power on device, and stop boot by pressing any key.
Once the shell is active:
 1. Ground out the CLK (pin 16) of the ROM (U7)
 2. Select option "3. Start"
 3. Bootloader notes that "The kernel has been damaged!"
 4. Release CLK as sson as bootloader thinks image is corrupted.
 5. Bootloader enters automatic recovery -- details printed on console
 6. Watch as the bootloader flashes and boots OpenWrt.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
[OpenWrt capitalisation in commit message]
Signed-off-by: Sander Vanheule <sander@svanheule.net>
19 months agorealtek: rtl8380-tl-sg2xxx: use a single "firmware" partition
Alexandru Gagniuc [Sat, 10 Sep 2022 20:48:22 +0000 (15:48 -0500)]
realtek: rtl8380-tl-sg2xxx: use a single "firmware" partition

The "firmware" partition was assembled from two contiguous partitions.
This complexity is unnecessary. Instead of using mtd-concat over
"sys" and "usrimg1", simply declare the "firmware" partition to cover
the flash space instead.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
19 months agorealtek: tl-sg2xxx: read MAC address from nvmem-cells
Alexandru Gagniuc [Sat, 20 Aug 2022 23:22:40 +0000 (18:22 -0500)]
realtek: tl-sg2xxx: read MAC address from nvmem-cells

The TP-Link RTL83xx based switches have their MAC address programmed
in the "para" partition. While in theory, the format of this partition
is dynamic, in practice, the MAC address appears to be located at a
consistent address. Thus, use nvmem-cells to read this MAC address.

The main MAC is required for deriving the MAC address of the switch
ports. Instead of reading it via mtd_get_mac_binary(), alias the
ethernet0 node as the label-mac-device, and use get_mac_label().

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
19 months agorealtek: rtl838x: label switch port dts nodes
Alexandru Gagniuc [Mon, 29 Aug 2022 14:25:55 +0000 (09:25 -0500)]
realtek: rtl838x: label switch port dts nodes

Although PHY nodes are labeled, the port nodes were not. Labeling of
ports is useful for 'status = "disabled"' ports, which is supported
since commit 9a7f17e11f5d ("realtek: ignore disabled switch ports")

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
19 months agorealtek: split TP-Link SG2000 series devicetree
Alexandru Gagniuc [Sat, 20 Aug 2022 21:10:42 +0000 (16:10 -0500)]
realtek: split TP-Link SG2000 series devicetree

The TP-Link TL-SG2008, TL-SG2008P, and TL-SG2210P use the same board.
The main difference is that some footprints are not populated in the
lower-end models. To model this with minimal duplication, move the
devicetree to a common dtsi, leaving out just the board name.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
[remove port relabelling from commit message, already merged with commit
 18a2b29aa1c9 ("realtek: tl-sg2008p: fix labeling of lan ports")]
Signed-off-by: Sander Vanheule <sander@svanheule.net>
19 months agouboot-mediatek: fix extraneous right parens
Petr Štetiar [Tue, 13 Sep 2022 07:06:50 +0000 (09:06 +0200)]
uboot-mediatek: fix extraneous right parens

Fixes following warning:

 Makefile:310: extraneous text after 'ifeq' directive

Signed-off-by: Petr Štetiar <ynezz@true.cz>
19 months agoscripts/download.pl: fix downloads with wget
Petr Štetiar [Tue, 13 Sep 2022 05:40:37 +0000 (07:40 +0200)]
scripts/download.pl: fix downloads with wget

Several users of wget for downloads (curl is not available in the
system) have reported broken download functionality:

 wget --tries=5 --timeout=20 --output-document=-  https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.10.142.tar.xz
 http://: Invalid host name.

Thats all happening due to '' was passed as an argument, which got later
expanded to http://.

In the context of a list constructor '' is not nothing, it is an empty
string element.  So fix it by using () as it will yield "nothing" and
thus not introduce an empty string element.

Fixes: #10692
Fixes: 90c6e3aedf16 ("scripts: always check certificates")
Signed-off-by: Jo-Philipp Wich <jo@mein.io> [shellwords() -> ()]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
19 months agoscripts/download.pl: silence can't exec curl warning
Petr Štetiar [Tue, 13 Sep 2022 05:38:10 +0000 (07:38 +0200)]
scripts/download.pl: silence can't exec curl warning

When running build in verbose mode `make V=s` we can see a lot of
following warnings when curl is not available in the system:

 Can't exec "curl": No such file or directory at scripts/download.pl line 77.

So lets fix it by redirecting of the stderr to null hole.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
19 months agotoolchain: Include ./include/fortify for external musl toolchain
Hauke Mehrtens [Sun, 11 Sep 2022 22:31:43 +0000 (00:31 +0200)]
toolchain: Include ./include/fortify for external musl toolchain

When building with an external toolcahin with musl also include
./include/fortify by default. This is also done when we build with the
internal toolchain using musl libc.

Without this extra include the fortify source feature is not working
when using an external musl toolchain. All binaries were compiled
without fortify source when an external musl toolchain was used. All
binaries release done by the OpenWrt project use the internal toolcahin
where fortify source is working.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
19 months agotoolchain: Select USE_SSTRIP with external musl toolchain
Hauke Mehrtens [Sun, 11 Sep 2022 22:29:00 +0000 (00:29 +0200)]
toolchain: Select USE_SSTRIP with external musl toolchain

When we use the internal toolchain USE_SSTRIP will be selected by
default for musl libc and USE_STRIP when glibc is used. Do the same when
an external toolchain is used. USE_GLIBC will also be set for external
toolchain builds based on the EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC setting.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
19 months agomac80211: rt2x00: experimental improvements for MT7620 wifi
Daniel Golle [Thu, 28 Jul 2022 11:40:12 +0000 (13:40 +0200)]
mac80211: rt2x00: experimental improvements for MT7620 wifi

Serge Vasilugin reports:

To improve mt7620 built-in wifi performance some changes:
1. Correct BW20/BW40 switching (see comments with mark (1))
2. Correct TX_SW_CFG1 MAC reg from v3 of vendor driver see
https://gitlab.com/dm38/padavan-ng/-/blob/master/trunk/proprietary/rt_wifi/rtpci/3.0.X.X/mt76x2/chips/rt6352.c#L531
3. Set bbp66 for all chains.
4. US_CYC_CNT init based on Programming guide, default value was 33 (pci),
   set chipset bus clock with fallback to cpu clock/3.
5. Don't overwrite default values for mt7620.
6. Correct some typos.
7. Add support for external LNA:
    a) RF and BBP regs never be corrected for this mode
    b) eLNA is driven the same way as ePA with mt7620's pin PA
but vendor driver explicitly pin PA to gpio mode (for forrect calibration?)
so I'm not sure that request for pa_pin in dts-file will be enough

First 5 changes (really 2) improve performance for boards w/o eLNA/ePA.
Changes 7 add support for eLNA

Configuration w/o eLAN/ePA and with eLNA show results
tx/rx (from router point of view) for each stream:
 35-40/30-35 Mbps for HT20
 65-70/60-65 Mbps for HT40

Yes. Max results for 2T2R client is 140-145/135-140
with peaks 160/150, It correspond to mediatek driver results.
Boards with ePA untested.

Reported-by: Serge Vasilugin <vasilugin@yandex.ru>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
19 months agomac80211: add patch descriptions to rt2x00 patches
Daniel Golle [Mon, 12 Sep 2022 20:21:05 +0000 (21:21 +0100)]
mac80211: add patch descriptions to rt2x00 patches

Prepare patches for sending upstream by adding patch descriptions
generated from the original OpenWrt commits adding each patch.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
19 months agounetd: only depend on bpf-headers if BPF toolchain support is available
Felix Fietkau [Mon, 12 Sep 2022 19:30:54 +0000 (21:30 +0200)]
unetd: only depend on bpf-headers if BPF toolchain support is available

If BPF is unavailable, unetd can be built without it (by disabling VXLAN support).

Signed-off-by: Felix Fietkau <nbd@nbd.name>
19 months agoramips: add support for ZyXEL Keenetic 4G Rev.B Device
Sergei Burakov [Fri, 20 May 2022 13:20:23 +0000 (16:20 +0300)]
ramips: add support for ZyXEL Keenetic 4G Rev.B Device

Specification:
SoC: RT5350
CPU Frequency: 360 MHz
Flash Chip: Macronix MX25L6406E (8192 KiB)
RAM: Winbond W9825G6JH-6 (32768 KiB)
3x 10/100 Mbps Ethernet (2x LAN, 1x WAN)
1x external antenna
UART (J1) header on PCB (57800 8n1)
Wireless: SoC-intergated: 2.4GHz 802.11bgn
USB: Yes
8x LED, 2x button

Flash instruction:
Configure PC with static IP 192.168.99.8/24 and start TFTP server.
Rename "openwrt-ramips-rt305x-zyxel_keenetic-4g-b-squashfs-sysupgrade.bin"
to "rt305x_firmware.bin" and place it in TFTP server directory.
Connect PC with one of LAN ports, press the reset button, power up
the router and keep button pressed until power LED start blinking.
Router will download file from TFTP server, write it to flash and reboot.

Signed-off-by: Sergei Burakov <senior.anonymous@mail.ru>
19 months agomediatek: unset CONFIG_CMDLINE_OVERRIDE for all targets but mt7629
Daniel Golle [Mon, 12 Sep 2022 13:10:26 +0000 (14:10 +0100)]
mediatek: unset CONFIG_CMDLINE_OVERRIDE for all targets but mt7629

The newly introduced config symbol CONFIG_CMDLINE_OVERRIDE is only set
for mt7629 for now which breaks automated build on all other mediatek
subtargets. Make sure the symbol is configured as 'is not set' for all
remaining subtargets.

Fixes: c27279dc26 ("mediatek: add support for ipTIME A6004MX Add basic support for ipTIME A6004MX.")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
19 months agomediatek: add support for ipTIME A6004MX Add basic support for ipTIME A6004MX.
Yoonji Park [Mon, 6 Jun 2022 07:44:48 +0000 (07:44 +0000)]
mediatek: add support for ipTIME A6004MX Add basic support for ipTIME A6004MX.

Hardware:
SoC: MediaTek MT7629 Cortex-A7 (ARMv7 1.25GHz, Dual-Core)
RAM: DDR3 128MB
Flash: Macronix MX35LF1GE4AB (SPI-NAND 128MB)
WiFi: MediaTek MT7761N (2.4GHz) / MediaTek MT7762N (5GHz) - no driver
Ethernet: SoC (WAN) / MediaTek MT7531 (LAN x4)
UART: [GND, RX, TX, 3.3V] (115200)

Installation:
- Flash recovery image with TFTP recovery

Revert to stock firmware:
- Flash stock firmware with TFTP recovery

TFTP Recovery method:
1. Unplug the router
2. Hold the reset button and plug in
3. Release when the power LED stops flashing and go off
4. Set your computer IP address manually to 192.168.0.x / 255.255.255.0
5. Flash image with TFTP client to 192.168.0.1

Signed-off-by: Yoonji Park <koreapyj@dcmys.kr>
19 months agokernel: add support for mtdsplit-fit offset
Yoonji Park [Sun, 5 Jun 2022 18:04:18 +0000 (18:04 +0000)]
kernel: add support for mtdsplit-fit offset

Support devices that has vendor custom header before FIT image.

Some devices has vendor custom header before FIT image. In this case mtd-
split can not find FIT image and it results in rootfs mount failure.
Please refer iptime,a6004mx device for further examples.

Signed-off-by: Yoonji Park <koreapyj@dcmys.kr>
19 months agofirmware-utils: update to git HEAD
Daniel Golle [Mon, 12 Sep 2022 00:43:04 +0000 (01:43 +0100)]
firmware-utils: update to git HEAD

 0c92b20 iptime-crc32: add support for A6004MX

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
19 months agoxdp-tools: don't rely on host bpf headers
Daniel Golle [Mon, 12 Sep 2022 00:13:59 +0000 (01:13 +0100)]
xdp-tools: don't rely on host bpf headers

xdp-tools build currently breaks on build hosts which do not have
libbpf headers installed because the build system wrongly tries to
use the host's include path.
Properly pass path to libbpf headers to xdp-tools build system to
fix build e.g. on the buildbots.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
19 months agomediatek: disable unsupported background radar detection
Shiji Yang [Wed, 7 Sep 2022 08:08:33 +0000 (16:08 +0800)]
mediatek: disable unsupported background radar detection

MT7915 requires an additional antenna for background radar scanning.
Disable this feature in the following devices that do not have a
separate DFS antenna:
  linksys,e8450
  ruijie,rg-ew3200gx-pro
  xiaomi,redmi-router-ax6s

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
19 months agoramips: disable unsupported background radar detection
Shiji Yang [Wed, 7 Sep 2022 08:08:33 +0000 (16:08 +0800)]
ramips: disable unsupported background radar detection

Background radar detection is not supported on devices that
using MT7905, so disable this feature in the following devices:
  asus,rt-ax53u
  jcg,q20
  tplink,eap615-wall-v1
  xiaomi,mi-router-cr6606
  xiaomi,mi-router-cr6608
  xiaomi,mi-router-cr6609
  yuncore,ax820

Devices with MT7915 lacking a DFS antenna also do not support
background DFS:
  totolink,x5000r
  cudy,x6

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
19 months agoramips: use lzma-loader on Sitecom WLR-6000
Jasper Scholte [Wed, 17 Aug 2022 19:30:04 +0000 (21:30 +0200)]
ramips: use lzma-loader on Sitecom WLR-6000

Fixes the boot loader LZMA decompression issue:
LZMA ERROR 1 - must RESET board to recover

Signed-off-by: Jasper Scholte <NightNL@outlook.com>
19 months agoath79: Make patches apply again
Hauke Mehrtens [Sun, 11 Sep 2022 20:17:47 +0000 (22:17 +0200)]
ath79: Make patches apply again

The patch adding support for LEDs connected to a reset controller did
not apply any more, refresh it on top of current master.

Fixes: 53fc987b2552 ("generic: move ledbar driver from mediatek target")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
19 months agoath79: add support for TP-Link TL-WR941ND v5
Will Moss [Wed, 3 Aug 2022 11:16:35 +0000 (11:16 +0000)]
ath79: add support for TP-Link TL-WR941ND v5

Specifications:
- SoC: ar9341
- RAM: 32M
- Flash: 4M
- Ethernet: 5x FE ports
- WiFi: ar9341-wmac

Flash instruction:
Upload generated factory firmware on vendor's web interface.

This device is very similar to the TL-WR841N v8, only two LED GPIOs are
different.
Buttons configuration is similar to TL-WR842ND v2 but both buttons are
active low.

Signed-off-by: Will Moss <willormos@gmail.com>
19 months agoath79: add support for TP-Link Deco S4
Nick French [Sat, 13 Aug 2022 17:09:50 +0000 (12:09 -0500)]
ath79: add support for TP-Link Deco S4

Add support for TP-Link Deco S4 wifi router

The label refers to the device as S4R and the TP-Link firmware
site calls it the Deco S4 v2. (There does not appear to be a v1)

Hardware (and FCC id) are identical to the Deco M4R v2 but the
flash layout is ordered differently and the OEM firmware encrypts
some config parameters (including the label mac address) in flash

In order to set the encrypted mac address, the wlan's caldata
node is removed from the DTS so the mac can be decrypted with
the help of the uencrypt tool and patched into the wlan fw
via hotplug

Specifications:
SoC: QCA9563-AL3A
RAM: Zentel A3R1GE40JBF
Wireless 2.4GHz: QCA9563-AL3A (main SoC)
Wireless 5GHz: QCA9886
Ethernet Switch: QCA8337N-AL3C
Flash: 16 MB SPI NOR

UART serial access (115200N1) on board via solder pads:
RX = TP1 pad
TX = TP2 pad
GND = C201 (pad nearest board edge)

The device's bootloader and web gui will only accept images that
were signed using TP-Link's RSA key, however a memory safety bug
in the bootloader can be leveraged to install openwrt without
accessing the serial console. See developer forum S4 support page
for link to a "firmware" file that starts a tftp client, or you
may generate one on your own like this:
```
python - > deco_s4_faux_fw_tftp.bin <<EOF
import sys
from struct import pack

b = pack('>I', 0x00008000) + b'X'*16 + b"fw-type:" \
  + b'x'*256 + b"S000S001S002" + pack('>I', 0x80060200) \

b += b"\x00"*(0x200-len(b)) \
  + pack(">33I", *[0x3c0887fc, 0x35083ddc, 0xad000000, 0x24050000,
                   0x3c048006, 0x348402a0, 0x3c1987f9, 0x373947f4,
                   0x0320f809, 0x00000000, 0x24050000, 0x3c048006,
                   0x348402d0, 0x3c1987f9, 0x373947f4, 0x0320f809,
                   0x00000000, 0x24050000, 0x3c048006, 0x34840300,
                   0x3c1987f9, 0x373947f4, 0x0320f809, 0x00000000,
                   0x24050000, 0x3c048006, 0x34840400, 0x3c1987f9,
                   0x373947f4, 0x0320f809, 0x00000000, 0x1000fff1,
                   0x00000000])

b += b"\xff"*(0x2A0-len(b)) + b"setenv serverip 192.168.0.2\x00"
b += b"\xff"*(0x2D0-len(b)) + b"setenv ipaddr 192.168.0.1\x00"
b += b"\xff"*(0x300-len(b)) + b"tftpboot 0x81000000 initramfs-kernel.bin\x00"
b += b"\xff"*(0x400-len(b)) + b"bootm 0x81000000\x00"
b += b"\xff"*(0x8000-len(b))

sys.stdout.buffer.write(b)
EOF
```

Installation:
1. Run tftp server on pc with static ip 192.168.0.2
2. Place openwrt "initramfs-kernel.bin" image in tftp root dir
3. Connect pc to router ethernet port1
4. While holding in reset button on bottom of router, power on router
5. From pc access router webgui at http://192.168.0.1
6. Upload deco_s4_faux_fw_tftp.bin
7. Router will load and execture in-memory openwrt
8. Switch pc back to dhcp or static 192.168.1.x
9. Flash openwrt sysupgrade image via luci/ssh at 192.168.1.1

Revert to stock:
Press and hold reset button while powering device to start the
bootloader's recovery mode, where stock firmware can be uploaded
via web gui at 192.168.0.1

Please note that one additional non-github commits is also needed:
firmware-utils: add tplink-safeloader support for Deco S4

Signed-off-by: Nick French <nickfrench@gmail.com>
19 months agofirmware-utils: update to git HEAD
Hauke Mehrtens [Sun, 11 Sep 2022 19:46:12 +0000 (21:46 +0200)]
firmware-utils: update to git HEAD

 71e1db6 tplink-safeloader: add TP-Link Deco S4 v2 support

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
19 months agoath79: add support for Senao Watchguard AP100
Michael Pratt [Tue, 2 Nov 2021 17:41:41 +0000 (13:41 -0400)]
ath79: add support for Senao Watchguard AP100

FCC ID: U2M-CAP2100AG

WatchGuard AP100 is an indoor wireless access point with
1 Gb ethernet port, dual-band but single-radio wireless,
internal antenna plates, and 802.3at PoE+

this board is a Senao device:
the hardware is equivalent to EnGenius EAP300 v2
the software is modified Senao SDK which is based on openwrt and uboot
including image checksum verification at boot time,
and a failsafe image that boots if checksum fails

**Specification:**

  - AR9344 SOC          MIPS 74kc, 2.4 GHz AND 5 GHz WMAC, 2x2
  - AR8035-A EPHY       RGMII GbE with PoE+ IN
  - 25 MHz clock
  - 16 MB FLASH         mx25l12805d
  - 2x 64 MB RAM
  - UART console        J11, populated
  - GPIO watchdog       GPIO 16, 20 sec toggle
  - 2 antennas          5 dBi, internal omni-directional plates
  - 5 LEDs              power, eth0 link/data, 2G, 5G
  - 1 button            reset

**MAC addresses:**

  Label has no MAC
  Only one Vendor MAC address in flash at art 0x0

  eth0 ---- *:e5 art 0x0 -2
  phy0 ---- *:e5 art 0x0 -2

**Installation:**

  Method 1: OEM webpage

    use OEM webpage for firmware upgrade to upload factory.bin

  Method 2: root shell

    It may be necessary to use a Watchguard router to flash the image to the AP
    and / or to downgrade the software on the AP to access SSH
    For some Watchguard devices, serial console over UART is disabled.

  NOTE: DHCP is not enabled by default after flashing

**TFTP recovery:**

  reset button has no function at boot time
  only possible with modified uboot environment,
  (see commit message for Watchguard AP300)

**Return to OEM:**

  user should make backup of MTD partitions
  and write the backups back to mtd devices
  in order to revert to OEM reliably

  It may be possible to use sysupgrade
  with an OEM image as well...
  (not tested)

**OEM upgrade info:**

  The OEM upgrade script is at /etc/fwupgrade.sh

  OKLI kernel loader is required because the OEM software
  expects the kernel to be no greater than 1536k
  and the factory.bin upgrade procedure would otherwise
  overwrite part of the kernel when writing rootfs.

**Note on eth0 PLL-data:**

  The default Ethernet Configuration register values will not work
  because of the external AR8035 switch between
  the SOC and the ethernet port.

  For AR934x series, the PLL registers for eth0
  can be see in the DTSI as 0x2c.
  Therefore the PLL registers can be read from uboot
  for each link speed after attempting tftpboot
  or another network action using that link speed
  with `md 0x1805002c 1`.

  The clock delay required for RGMII can be applied
  at the PHY side, using the at803x driver `phy-mode`.
  Therefore the PLL registers for GMAC0
  do not need the bits for delay on the MAC side.
  This is possible due to fixes in at803x driver
  since Linux 5.1 and 5.3

**Note on WatchGuard Magic string:**

  The OEM upgrade script is a modified version of
  the generic Senao sysupgrade script
  which is used on EnGenius devices.

  On WatchGuard boards produced by Senao,
  images are verified using a md5sum checksum of
  the upgrade image concatenated with a magic string.
  this checksum is then appended to the end of the final image.

  This variable does not apply to all the senao devices
  so set to null string as default

Tested-by: Steve Wheeler <stephenw10@gmail.com>
Signed-off-by: Michael Pratt <mcpratt@pm.me>
19 months agoath79: add support for Senao WatchGuard AP200
Michael Pratt [Sat, 12 Jun 2021 19:08:18 +0000 (15:08 -0400)]
ath79: add support for Senao WatchGuard AP200

FCC ID: U2M-CAP4200AG

WatchGuard AP200 is an indoor wireless access point with
1 Gb ethernet port, dual-band wireless,
internal antenna plates, and 802.3at PoE+

this board is a Senao device:
the hardware is equivalent to EnGenius EAP600
the software is modified Senao SDK which is based on openwrt and uboot
including image checksum verification at boot time,
and a failsafe image that boots if checksum fails

**Specification:**

  - AR9344 SOC MIPS 74kc, 2.4 GHz WMAC, 2x2
  - AR9382 WLAN PCI card 168c:0030, 5 GHz, 2x2, 26dBm
  - AR8035-A EPHY RGMII GbE with PoE+ IN
  - 25 MHz clock
  - 16 MB FLASH mx25l12805d
  - 2x 64 MB RAM
  - UART console        J11, populated
  - GPIO watchdog       GPIO 16, 20 sec toggle
  - 4 antennas          5 dBi, internal omni-directional plates
  - 5 LEDs              power, eth0 link/data, 2G, 5G
  - 1 button            reset

**MAC addresses:**

  Label has no MAC
  Only one Vendor MAC address in flash at art 0x0

  eth0 ---- *:be art 0x0 -2
  phy1 ---- *:bf art 0x0 -1
  phy0 ---- *:be art 0x0 -2

**Installation:**

  Method 1: OEM webpage

    use OEM webpage for firmware upgrade to upload factory.bin

  Method 2: root shell

    It may be necessary to use a Watchguard router to flash the image to the AP
    and / or to downgrade the software on the AP to access SSH
    For some Watchguard devices, serial console over UART is disabled.

  NOTE: DHCP is not enabled by default after flashing

**TFTP recovery:**

  reset button has no function at boot time
  only possible with modified uboot environment,
  (see commit message for Watchguard AP300)

**Return to OEM:**

  user should make backup of MTD partitions
  and write the backups back to mtd devices
  in order to revert to OEM reliably

  It may be possible to use sysupgrade
  with an OEM image as well...
  (not tested)

**OEM upgrade info:**

  The OEM upgrade script is at /etc/fwupgrade.sh

  OKLI kernel loader is required because the OEM software
  expects the kernel to be no greater than 1536k
  and the factory.bin upgrade procedure would otherwise
  overwrite part of the kernel when writing rootfs.

**Note on eth0 PLL-data:**

  The default Ethernet Configuration register values will not work
  because of the external AR8035 switch between
  the SOC and the ethernet port.

  For AR934x series, the PLL registers for eth0
  can be see in the DTSI as 0x2c.
  Therefore the PLL registers can be read from uboot
  for each link speed after attempting tftpboot
  or another network action using that link speed
  with `md 0x1805002c 1`.

  The clock delay required for RGMII can be applied
  at the PHY side, using the at803x driver `phy-mode`.
  Therefore the PLL registers for GMAC0
  do not need the bits for delay on the MAC side.
  This is possible due to fixes in at803x driver
  since Linux 5.1 and 5.3

**Note on WatchGuard Magic string:**

  The OEM upgrade script is a modified version of
  the generic Senao sysupgrade script
  which is used on EnGenius devices.

  On WatchGuard boards produced by Senao,
  images are verified using a md5sum checksum of
  the upgrade image concatenated with a magic string.
  this checksum is then appended to the end of the final image.

  This variable does not apply to all the senao devices
  so set to null string as default

Tested-by: Steve Wheeler <stephenw10@gmail.com>
Tested-by: John Delaney <johnd@ankco.net>
Signed-off-by: Michael Pratt <mcpratt@pm.me>
19 months agoath79: add support for Senao WatchGuard AP300
Michael Pratt [Thu, 11 Feb 2021 04:28:49 +0000 (23:28 -0500)]
ath79: add support for Senao WatchGuard AP300

FCC ID: Q6G-AP300

WatchGuard AP300 is an indoor wireless access point with
1 Gb ethernet port, dual-band wireless,
internal antenna plates, and 802.3at PoE+

this board is a Senao device:
the hardware is equivalent to EnGenius EAP1750
the software is modified Senao SDK which is based on openwrt and uboot
including image checksum verification at boot time,
and a failsafe image that boots if checksum fails

**Specification:**

  - QCA9558 SOC MIPS 74kc, 2.4 GHz WMAC, 3x3
  - QCA9880 WLAN PCI card 168c:003c, 5 GHz, 3x3, 26dBm
  - AR8035-A PHY RGMII GbE with PoE+ IN
  - 40 MHz clock
  - 32 MB FLASH S25FL512S
  - 2x 64 MB RAM NT5TU32M16
  - UART console J10, populated
  - GPIO watchdog GPIO 16, 20 sec toggle
  - 6 antennas 5 dBi, internal omni-directional plates
  - 5 LEDs power, eth0 link/data, 2G, 5G
  - 1 button reset

**MAC addresses:**

  MAC address labeled as ETH
  Only one Vendor MAC address in flash at art 0x0

  eth0 ETH  *:3c art 0x0
  phy1 ---- *:3d ---
  phy0 ---- *:3e ---

**Serial console access:**

  For this board, its not certain whether UART is possible
  it is likely that software is blocking console access

  the RX line on the board for UART is shorted to ground by resistor R176
  the resistors R175 and R176 are next to the UART RX pin at J10

  however console output is garbage even after this fix

**Installation:**

  Method 1: OEM webpage

    use OEM webpage for firmware upgrade to upload factory.bin

  Method 2: root shell access

    downgrade XTM firewall to v2.0.0.1
    downgrade AP300 firmware: v1.0.1
    remove / unpair AP from controller
    perform factory reset with reset button
    connect ethernet to a computer
    login to OEM webpage with default address / pass: wgwap
    enable SSHD in OEM webpage settings
    access root shell with SSH as user 'root'
    modify uboot environment to automatically try TFTP at boot time
    (see command below)

    rename initramfs-kernel.bin to test.bin
    load test.bin over TFTP (see TFTP recovery)
    (optionally backup all mtdblocks to have flash backup)
    perform a sysupgrade with sysupgrade.bin

  NOTE: DHCP is not enabled by default after flashing

**TFTP recovery:**

  server ip: 192.168.1.101

  reset button seems to do nothing at boot time...
  only possible with modified uboot environment,
  running this command in the root shell:

  fw_setenv bootcmd 'if ping 192.168.1.101; then tftp 0x82000000 test.bin && bootm 0x82000000; else bootm 0x9f0a0000; fi'

  and verify that it is correct with

  fw_printenv

  then, before boot, the device will attempt TFTP from 192.168.1.101
  looking for file 'test.bin'

  to return uboot environment to normal:

  fw_setenv bootcmd 'bootm 0x9f0a0000'

**Return to OEM:**

  user should make backup of MTD partitions
  and write the backups back to mtd devices
  in order to revert to OEM
  (see installation method 2)

  It may be possible to use sysupgrade
  with an OEM image as well...
  (not tested)

**OEM upgrade info:**

  The OEM upgrade script is at /etc/fwupgrade.sh

  OKLI kernel loader is required because the OEM software
  expects the kernel to be no greater than 1536k
  and the factory.bin upgrade procedure would otherwise
  overwrite part of the kernel when writing rootfs.

**Note on eth0 PLL-data:**

  The default Ethernet Configuration register values will not work
  because of the external AR8035 switch between
  the SOC and the ethernet port.

  For QCA955x series, the PLL registers for eth0 and eth1
  can be see in the DTSI as 0x28 and 0x48 respectively.
  Therefore the PLL registers can be read from uboot
  for each link speed after attempting tftpboot
  or another network action using that link speed
  with `md 0x18050028 1` and `md 0x18050048 1`.

  The clock delay required for RGMII can be applied
  at the PHY side, using the at803x driver `phy-mode`.
  Therefore the PLL registers for GMAC0
  do not need the bits for delay on the MAC side.
  This is possible due to fixes in at803x driver
  since Linux 5.1 and 5.3

**Note on WatchGuard Magic string:**

  The OEM upgrade script is a modified version of
  the generic Senao sysupgrade script
  which is used on EnGenius devices.

  On WatchGuard boards produced by Senao,
  images are verified using a md5sum checksum of
  the upgrade image concatenated with a magic string.
  this checksum is then appended to the end of the final image.

  This variable does not apply to all the senao devices
  so set to null string as default

Tested-by: Alessandro Kornowski <ak@wski.org>
Tested-by: John Wagner <john@wagner.us.org>
Signed-off-by: Michael Pratt <mcpratt@pm.me>
19 months agoath79: fix RGMII delay for ar9344 Senao APs
Michael Pratt [Sat, 12 Jun 2021 19:37:38 +0000 (15:37 -0400)]
ath79: fix RGMII delay for ar9344 Senao APs

after some trial and error, it was discovered
that by setting TX only delay on the AR8035 PHY
that setting GMAC registers is no longer necessary.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
19 months agoath79: rename an engenius DTSI to generic senao name
Michael Pratt [Sat, 12 Jun 2021 19:24:49 +0000 (15:24 -0400)]
ath79: rename an engenius DTSI to generic senao name

Other vendors can use this DTSI, for example, WatchGuard
there are likely several brands that use the same board design
because of outsourcing hardware from Senao.

For example, Watchguard AP300
has the same hardware as Engenius EAP600
so we use ar9344_engenius_exx600.dtsi for that

Signed-off-by: Michael Pratt <mcpratt@pm.me>
19 months agomediatek: fix ledbar of UniFi 6 LR when running custom U-Boot
Daniel Golle [Sun, 11 Sep 2022 19:24:05 +0000 (20:24 +0100)]
mediatek: fix ledbar of UniFi 6 LR when running custom U-Boot

The RGB LED of the UniFi 6 LR v1 doesn't work when using the Openwrt-
built U-Boot. This is because the vendor loader resets the ledbar
controller while our U-Boot doesn't care.
Add reset-gpio so the ledbar driver in Linux will always reset the
ledbar controller.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
19 months agoramips: add support for Ubiquiti UniFi FlexHD
Sven Wegener [Sat, 1 May 2021 11:51:51 +0000 (13:51 +0200)]
ramips: add support for Ubiquiti UniFi FlexHD

Hardware
--------

- SoC: MediaTek MT7621AT with 128 MiB RAM and 32 MiB Flash
- Wi-Fi: MediaTek MT7603 (b/g/n, 2x2) and MediaTek MT7615 (ac, 4x4)
- Bluetooth: CSR8811 (internal USB, install kmod-bluetooth)

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

1. Connect to the booted device at 192.168.1.20 using username/password
   "ubnt".

2. Update the bootloader environment.

   $ fw_setenv devmode TRUE
   $ fw_setenv boot_openwrt "fdt addr \$(fdtcontroladdr);
     fdt rm /signature; bootubnt"
   $ fw_setenv bootcmd "run boot_openwrt"

3. Transfer the OpenWrt sysupgrade image to the device using SCP.

4. Check the mtd partition number for bs / kernel0 / kernel1

   $ cat /proc/mtd

5. Set the bootselect flag to boot from kernel0

   $ dd if=/dev/zero bs=1 count=1 of=/dev/mtdblock4

6. Write the OpenWrt sysupgrade image to both kernel0 as well as kernel1

   $ dd if=openwrt.bin of=/dev/mtdblock6
   $ dd if=openwrt.bin of=/dev/mtdblock7

7. Reboot the device. It should boot into OpenWrt.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
19 months agogeneric: move ledbar driver from mediatek target
Sven Wegener [Mon, 2 May 2022 20:13:14 +0000 (22:13 +0200)]
generic: move ledbar driver from mediatek target

This moves the ledbar driver to generic, to be also used by the ramips target.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
19 months agomediatek: add led count
Sven Wegener [Sat, 12 Jun 2021 19:56:22 +0000 (21:56 +0200)]
mediatek: add led count

The LEDs connected to the MCU are so-called smart LEDs and their signal is
daisy-chained. Because of this, the MCU needs to be told how many LEDs are
connected. It also means the LEDs could be individually controlled, if the MCU
has a command for this.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
19 months agomediatek: add initialization after reset
Sven Wegener [Sat, 12 Jun 2021 19:56:22 +0000 (21:56 +0200)]
mediatek: add initialization after reset

During GPIO initialization the pin state flips and triggers a reset of
the ledbar MCU. It needs to be moved through an initialization sequence
before working correctly.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
19 months agomediatek: add support for reset gpio
Sven Wegener [Sat, 12 Jun 2021 19:56:22 +0000 (21:56 +0200)]
mediatek: add support for reset gpio

Some versions of the ledbar MCU have a reset pin. It needs to be
correctly initialized or we might keep the MCU in reset state.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
19 months agomediatek: support reading more than one byte of response
Sven Wegener [Sat, 12 Jun 2021 19:56:21 +0000 (21:56 +0200)]
mediatek: support reading more than one byte of response

There are commands that return more than one byte of response.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
19 months agomediatek: cast literal value to char
Sven Wegener [Sat, 12 Jun 2021 19:56:21 +0000 (21:56 +0200)]
mediatek: cast literal value to char

Or the comparison against a signed char is always true, because the
literal 0xaa is treated as an unsigned int, to which the signed char is
casted during comparison. 0xaa is above the positive values of a signed
char and negative signed char values result in values larger than 0xaa
when casted to unsigned int.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
19 months agomediatek: correctly log i2c response
Sven Wegener [Sat, 12 Jun 2021 19:56:21 +0000 (21:56 +0200)]
mediatek: correctly log i2c response

The read response is in the i2c_response variable. Also use %hhx format,
because we're dealing with a single char.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
19 months agomediatek: remove gpiod_direction_output()
Sven Wegener [Sat, 12 Jun 2021 19:56:21 +0000 (21:56 +0200)]
mediatek: remove gpiod_direction_output()

It's already set to output with GPIOD_OUT_LOW.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
19 months agomediatek: do not use gpiod_set_raw_value()
Sven Wegener [Sat, 12 Jun 2021 19:56:21 +0000 (21:56 +0200)]
mediatek: do not use gpiod_set_raw_value()

The polarity of the signal is set in the device dts.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
19 months agokernel: modules: package kmod-crypto-essiv
Daniel Golle [Sun, 11 Sep 2022 13:26:25 +0000 (14:26 +0100)]
kernel: modules: package kmod-crypto-essiv

Package kernel module providing ESSIV support for block encryption.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
19 months agoipq40xx: add GL-AP1300 label-mac-device
David Bauer [Sun, 11 Sep 2022 14:23:03 +0000 (16:23 +0200)]
ipq40xx: add GL-AP1300 label-mac-device

Signed-off-by: David Bauer <mail@david-bauer.net>
19 months agoprereq-build: add check for stdlib
Rosen Penev [Fri, 9 Sep 2022 19:31:44 +0000 (12:31 -0700)]
prereq-build: add check for stdlib

One way to solve the python3 dependency check is to install
python3-minimal instead of python3 on Debian based systems.
Unfortunately, this results in a fairly unusable python.

Added check for ntpath, which is how the issue originally presented
itself.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
19 months agoprereq-build: fix python distutils detection
Rosen Penev [Fri, 9 Sep 2022 19:28:08 +0000 (12:28 -0700)]
prereq-build: fix python distutils detection

Debian and by extension Ubuntu packages distutils in a suboptimal way
where import distutils works but none of the methods do.

This alternative check verifies that distutils is actually usable.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
19 months agoipq40xx: add WAN LED mapping for GL-AP1300
David Bauer [Sat, 10 Sep 2022 12:05:34 +0000 (14:05 +0200)]
ipq40xx: add WAN LED mapping for GL-AP1300

Signed-off-by: David Bauer <mail@david-bauer.net>
19 months agoramips: ASUS RT-ACx5P phy[01]radio to phy[01]tpt
David Santamaría Rogado [Fri, 27 May 2022 21:50:10 +0000 (23:50 +0200)]
ramips: ASUS RT-ACx5P phy[01]radio to phy[01]tpt

phy[01]radio leaves the leds always on, if they are set through sysfs the leds
get off.
Set the triggers to phy[01]tpt to make them work.

Signed-off-by: David Santamaría Rogado <howl.nsp@gmail.com>