openwrt/staging/chunkeey.git
2 years agoipq40xx: dynamically build board-2.bin for Mikrotik mikrotik
Christian Lamparter [Sun, 6 Feb 2022 00:42:01 +0000 (01:42 +0100)]
ipq40xx: dynamically build board-2.bin for Mikrotik

Mikrotik devices ship with the boardfile data right on the board itself.
This script takes the data from the sysfs firmware "wlan_data" to
generate a custom board-2.bin for the ath10k driver to work with.

The qcom,ath10k-calibration-variant in each device's device-tree file
are being removed as well.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agoapm821xx: add alternative names for supported devices
Christian Lamparter [Sun, 13 Feb 2022 12:29:23 +0000 (13:29 +0100)]
apm821xx: add alternative names for supported devices

with the introduction of the DEVICE_ALTX_VENDOR, DEVICE_ALTX_MODEL
multiple/sibiling devices can seemingly supported by one device entry.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agoksmbd: add out-of-tree module
Rosen Penev [Tue, 21 Dec 2021 01:58:38 +0000 (17:58 -0800)]
ksmbd: add out-of-tree module

ksmbd is an upstream linux alternative to Samba which is lighterweight
and more performant, especially on underpowered devices.

Moving it here from the packages feed as it is now an upstream kernel
module. Also easier to update as version updates can be coordinated better

The next LTS kernel (5.15) has this included. A depend on kernel < 5.15
will need to be added later.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agolinux/modules: split up oid_registry
Rosen Penev [Thu, 10 Feb 2022 02:58:29 +0000 (18:58 -0800)]
linux/modules: split up oid_registry

This will be needed by ksmbd in a following commit.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agotarget/linux: add help text to kernel config
Rosen Penev [Thu, 10 Feb 2022 02:46:15 +0000 (18:46 -0800)]
target/linux: add help text to kernel config

These options will be used for ksmbd. Once kernel 5.15
makes it in, this patch can go away.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agox86: fix support for Sophos SG/XG wireless products
Raylynn Knight [Thu, 10 Feb 2022 07:25:27 +0000 (02:25 -0500)]
x86: fix support for Sophos SG/XG wireless products

Correct typo that caused network interfaces for Sophos
SG/XG wireless devices to not be configured properly.

Tested on Sophos SG 135wr2, Sophos XG 125wr2 and
Sophos SG 105wr1

Signed-off-by: Raylynn Knight <rayknight@me.com>
2 years agomvebu: mark all mtd partitions on GL.iNet GL-MV1000 read-only
Enrico Mioso [Thu, 10 Feb 2022 13:35:49 +0000 (14:35 +0100)]
mvebu: mark all mtd partitions on GL.iNet GL-MV1000 read-only

On this device, two of the three defined MTD partitions are
automatically set to read-only, since they do not end at an
erase/write block boundary.

In particular, the only partition remaining writable is the
one holding the u-boot bootloader.

Mark all of the partitions read-only, at least until a better
understanding of why the layout has been laid out this way is
gained.

Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
2 years agoipq40xx: limit available radio channels for GL.iNet GL-B2200
Enrico Mioso [Fri, 11 Feb 2022 09:46:00 +0000 (10:46 +0100)]
ipq40xx: limit available radio channels for GL.iNet GL-B2200

The PCIe and built-in 5GHZ radios are meant to operate on different
frequency bands. The hardware enforces this via RF filters.
Add this information to allow software enforcing it as well.
Credits to Piotr Dymacz for the invaluable help.

Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
2 years agoipq806x: TP-Link VR2600v convert legacy partitioning
Christian Lamparter [Sun, 6 Feb 2022 16:21:08 +0000 (17:21 +0100)]
ipq806x: TP-Link VR2600v convert legacy partitioning

This device still had the legacy flash partitioning.
This is a problem, because neither the nvmem-cells
for mac-address and calibration. Nor the denx,uimage
mtd-splitter compatible would be picked up.

The patch also changes the node-names of the flash
and partition nodes to hopefully meet all the
current FDT trends.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agobuild: store source_date_epoch as integer
Paul Spooren [Sun, 29 Aug 2021 03:10:57 +0000 (17:10 -1000)]
build: store source_date_epoch as integer

The value is retreived from a env variable which defaults to be read as
a string. However the SOURCE_DATE_EPOCH is a unix timestamp aka integer.

Fix this to allow downstream tools to parse the value directly.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2 years agokernel: fix a race condition leading to a crash in hw flow offloading
Felix Fietkau [Mon, 14 Feb 2022 12:58:38 +0000 (13:58 +0100)]
kernel: fix a race condition leading to a crash in hw flow offloading

flowtable->net was initialized too late, and this could be triggered even
without hardware offload support on the device

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agokernel: fix copy&paste mistake in bridge offload code
Felix Fietkau [Mon, 14 Feb 2022 11:39:58 +0000 (12:39 +0100)]
kernel: fix copy&paste mistake in bridge offload code

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoramips: mt7621: do memory detection on KSEG1
Chuanhong Guo [Thu, 10 Feb 2022 15:09:46 +0000 (23:09 +0800)]
ramips: mt7621: do memory detection on KSEG1

It's reported that current memory detection code occasionally detects
larger memory under some bootloaders.
Current memory detection code tests whether address space wraps around
on KSEG0, which is unreliable because it's cached.

Rewrite memory size detection to perform the same test on KSEG1 instead.
While at it, this patch also does the following two things:
1. use a fixed pattern instead of a random function pointer as the magic
   value.
2. add an additional memory write and a second comparison as part of the
   test to prevent possible smaller memory detection result due to
   leftover values in memory.

Fixes: 6d91ddf517 ("ramips: mt7621: add support for memory detection")
Reported-by: Rui Salvaterra <rsalvaterra@gmail.com>
Tested-by: Rui Salvaterra <rsalvaterra@gmail.com>
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2 years agoprocd: simplify uxc init script
Daniel Golle [Sun, 13 Feb 2022 23:26:45 +0000 (23:26 +0000)]
procd: simplify uxc init script

'uxc boot' is inteded to be called multiple times, so there is not need
to guard the first call on boot -- the actual code anyway didn't do
that, so just remove it.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agokernel: remove 640-bridge-only-accept-EAP-locally.patch
Felix Fietkau [Sat, 12 Feb 2022 22:47:38 +0000 (23:47 +0100)]
kernel: remove 640-bridge-only-accept-EAP-locally.patch

The issue of EAP frames sent to group address (or the wrong address) has been
addressed in mac80211, so this hack is no longer needed

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agokernel: add a fast path for the bridge code
Felix Fietkau [Sat, 12 Feb 2022 22:18:51 +0000 (23:18 +0100)]
kernel: add a fast path for the bridge code

This caches flows between MAC addresses on separate ports, including their VLAN
in order to bypass the normal bridge forwarding code.
In my test on MT7622, this reduces LAN->WLAN bridging CPU usage by 6-10%,
potentially even more on weaker platforms

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agotcpdump: Fix CVE-2018-16301
Hauke Mehrtens [Sat, 12 Feb 2022 22:13:47 +0000 (23:13 +0100)]
tcpdump: Fix CVE-2018-16301

This fixes the following security problem:
The command-line argument parser in tcpdump before 4.99.0 has a buffer
overflow in tcpdump.c:read_infile(). To trigger this vulnerability the
attacker needs to create a 4GB file on the local filesystem and to
specify the file name as the value of the -F command-line argument of
tcpdump.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agomac80211: fix rekey failure in drivers with 802.3 decap offload
Felix Fietkau [Sat, 12 Feb 2022 22:03:33 +0000 (23:03 +0100)]
mac80211: fix rekey failure in drivers with 802.3 decap offload

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agofirewall4: update to latest Git HEAD
Jo-Philipp Wich [Fri, 11 Feb 2022 19:41:23 +0000 (20:41 +0100)]
firewall4: update to latest Git HEAD

53caa1a fw4: resolve zone layer 2 devices for hw flow offloading
9fe58f5 fw4: rework and fix family inheritance logic
8795296 tests: mocklib: fix infinite recursion in wrapped print()
281b1bc tests: change mocked wan interface type to PPPoE
93b710d tests: mocklib: forward compatibility change
1a94915 fw4: only stage reflection rules if all required addrs are known
5c21714 fw4: add device iifname/oifname matches to DSCP and MARK rules
3eacc97 tests: adjust 01_ruleset test case to latest changes

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2 years agoucode: update to latest Git HEAD
Jo-Philipp Wich [Fri, 11 Feb 2022 19:38:35 +0000 (20:38 +0100)]
ucode: update to latest Git HEAD

a29bad9 compiler: fix patchlist corruption on switch statement syntax errors
86f0662 lib: change `ord()` to always return single byte value
116a8ce vallist: fix storing/retrieving short strings with 8bit byte value

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2 years agokernel: bump 5.10 to 5.10.100
John Audia [Fri, 11 Feb 2022 12:06:23 +0000 (07:06 -0500)]
kernel: bump 5.10 to 5.10.100

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 <graysky@archlinux.us>
2 years agokernel: bump 5.10 to 5.10.99
John Audia [Tue, 8 Feb 2022 19:25:03 +0000 (14:25 -0500)]
kernel: bump 5.10 to 5.10.99

Had to update generic defconfig (make kernel_menuconfig CONFIG_TARGET=generic)
for this bump, but since that only modifies the target defined in .config,
and since that target also needed to be updated for unrelated reasons, manually
propagated the newly added symbol to the generic config.

Removed upstreamed:
    pending-5.10/860-Revert-ASoC-mediatek-Check-for-error-clk-pointer.patch[1]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.99&id=080f371d984e8039c66db87f3c54804b0d172329

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

Signed-off-by: John Audia <graysky@archlinux.us>
2 years agokernel: bump 5.10 to 5.10.98
John Audia [Sun, 6 Feb 2022 16:51:17 +0000 (11:51 -0500)]
kernel: bump 5.10 to 5.10.98

Manually rebased:
bcm27xx/patches-5.10/950-0675-drm-vc4-hdmi-Drop-devm-interrupt-handler-for-CEC-int.patch

All other patches automatically rebased.

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

Signed-off-by: John Audia <graysky@archlinux.us>
2 years agoramips: add support for ELECOM WRC-2533GS2
INAGAKI Hiroshi [Sat, 5 Feb 2022 10:09:11 +0000 (19:09 +0900)]
ramips: add support for ELECOM WRC-2533GS2

ELECOM WRC-2533GS2 is a 2.4/5 GHz band 11ac (Wi-Fi 5) router, based on
MT7621A.

Specification:

- SoC : MediaTek MT7621A
- RAM : DDR3 128 MiB (NT5CC64M16GP-DI)
- Flash : SPI-NOR 16 MiB (MX25L12835FM2I-10G)
- WLAN : 2.4/5GHz 4T4R (2x MediaTek MT7615)
- Ethernet : 10/100/1000 Mbps x5
  - Switch : MediaTek MT7530 (SoC)
- LEDs/Keys : 4x/6x (2x buttons, 1x slide-switch)
- UART : through-hole on PCB
  - J4: 3.3V, GND, TX, RX from ethernet port side
  - 57600n8
- Power : 12 VDC, 1.5 A

Flash instruction using factory image:

1. Boot WRC-2533GS2 normally with "Router" mode
2. Access to "http://192.168.2.1/" and open firmware update page
   ("ファームウェア更新")
3. Select the OpenWrt factory image and click apply ("適用") button
4. Wait ~120 seconds to complete flashing

MAC Addresses:

LAN : 04:AB:18:xx:xx:FB (Factory, 0xFFF4 (hex))
WAN : 04:AB:18:xx:xx:FC (Factory, 0xFFFA (hex))
2.4 GHz : 04:AB:18:xx:xx:FD (Factory, 0x4    (hex))
5 GHz : 04:AB:18:xx:xx:FE (Factory, 0x8004 (hex))

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2 years agoramips: move MAC configs to device dts from wrc-gs-2pci.dtsi
INAGAKI Hiroshi [Sat, 5 Feb 2022 09:57:14 +0000 (18:57 +0900)]
ramips: move MAC configs to device dts from wrc-gs-2pci.dtsi

The locations of MAC addresses in mtd for LAN/WAN on ELECOM WRC-2533GS2
are changed from the other WRC-GS/GST devices with 2x PCIe. So move the
related configurations in mt7621_elecom_wrc-gs-2pci.dtsi to dts of each
model.

- WRC-1750GS
- WRC-1750GSV
- WRC-1750GST2
- WRC-1900GST
- WRC-2533GST
- WRC-2533GST2

  -> LAN: 0xE000, WAN: 0xE006

- WRC-2533GS2

  -> LAN: 0xFFF4, WAN: 0xFFFA

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2 years agoramips: update WLAN MAC address of ipTIME A3004T
Sungbo Eo [Sun, 30 Jan 2022 23:38:16 +0000 (08:38 +0900)]
ramips: update WLAN MAC address of ipTIME A3004T

Reported MAC addresses:

| interface |    MAC address    |     source     | comment
|-----------|-------------------|----------------|---------
|       LAN | 90:xx:xx:18:xx:1F |                | [1]
|       WAN | 90:xx:xx:18:xx:1D |                |
|   WLAN 2G | 92:xx:xx:48:xx:1C |                |
|   WLAN 5G | 90:xx:xx:18:xx:1C | factory 0x4    |
|           | 90:xx:xx:18:xx:1C | config ethaddr |

[1] Used in this patch as WLAN 2G MAC address with the local bit set

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2 years agoramips: add support for ipTIME AX2004M
Sungbo Eo [Sat, 29 Jan 2022 14:25:32 +0000 (23:25 +0900)]
ramips: add support for ipTIME AX2004M

ipTIME AX2004M is an 802.11ax (Wi-Fi 6) router, based on MediaTek
MT7621A.

Specifications:
* SoC: MT7621A
* RAM: 256 MiB
* Flash: NAND 128 MiB
* Wi-Fi:
  * MT7915D: 2.4/5 GHz (DBDC)
* Ethernet: 5x 1GbE
  * Switch: SoC built-in
* USB: 1x 3.0
* UART: J4 (115200 baud)
  * Pinout: [3V3] (TXD) (RXD) (GND)

MAC addresses:

| interface |    MAC address    |     source     | comment
|-----------|-------------------|----------------|---------
|       LAN | 58:xx:xx:00:xx:9B |                | [1]
|       WAN | 58:xx:xx:00:xx:99 |                |
|   WLAN 2G | 58:xx:xx:00:xx:98 | factory 0x4    |
|   WLAN 5G | 5A:xx:xx:40:xx:98 |                |
|           | 58:xx:xx:00:xx:98 | config ethaddr |

[1] Used in this patch as WLAN 5G MAC address with the local bit set

Load addresses:
* stock
  * 0x80010000: FIT image
  * 0x81001000: kernel image -> entry
* OpenWrt
  * 0x80010000: FIT image
  * 0x82000000: uncompressed kernel+relocate image
  * 0x80001000: relocated kernel image -> entry

Notes:
* This device has a dual-boot partition scheme, but this firmware works
  only on boot partition 1. The stock web interface will flash only on the
  inactive boot partition, but the recovery web page will always flash on
  boot partition 1.

Installation via recovery mode:
1.  Press reset button, power up the device, wait >10s for CPU LED
    to stop blinking.
2.  Upload recovery image through the recovery web page at 192.168.0.1.

Revert to stock firmware:
1.  Install stock image via recovery mode.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2 years agoocteon: switch to Kernel 5.10
Paul Spooren [Thu, 30 Sep 2021 05:23:45 +0000 (19:23 -1000)]
octeon: switch to Kernel 5.10

Acked-by: Stijn Tintel <stijn@linux-ipv6.be>
Signed-off-by: Paul Spooren <mail@aparcar.org>
2 years agotarget/linux: add missing symbol
Rosen Penev [Sat, 29 Jan 2022 22:49:04 +0000 (14:49 -0800)]
target/linux: add missing symbol

Found when building the qoriq target.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agotools/cmake: add MAKE config variable
Rosen Penev [Thu, 10 Feb 2022 01:15:14 +0000 (17:15 -0800)]
tools/cmake: add MAKE config variable

Makes sure that Ninja from staging_dir is used and nowhere else.

Reported by reproducible builds project. Builds have been failing ever
since tools/cmake started using Ninja.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agoqosify: update to the latest version
Felix Fietkau [Thu, 10 Feb 2022 20:07:47 +0000 (21:07 +0100)]
qosify: update to the latest version

e230e71e0a12 map: fix copy-paste error in codepoints map
580d2ccf89f3 bpf: declare tcp_ports/udp_ports without typedef
8d6c19a81f3f ubus: fix a use-after-free bug

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agomt7622: linksys-e8450: enable using mt7531 switch irq
Daniel Golle [Thu, 10 Feb 2022 14:12:45 +0000 (14:12 +0000)]
mt7622: linksys-e8450: enable using mt7531 switch irq

Turns out the MT7531 switch IRQ line is connected to GPIO#53 just like
on the BPi-R64, so this seems to be part of the reference design and
will probably apply to most MT7622+MT7531 boards.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agomt7622: bpi-r64: enable using mt7531 switch irq
Daniel Golle [Thu, 10 Feb 2022 13:48:10 +0000 (13:48 +0000)]
mt7622: bpi-r64: enable using mt7531 switch irq

Now that we support link-state-change interrupts, wire up MT7531 IRQ
line which is connected to GPIO#53 according to the schematics [1].

As a result, PHY state no longer needs to be polled on that board.

[1]: https://forum.banana-pi.org/t/bpi-r64-mt7622-schematic-diagram-public/10118
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agokernel: backport MT7530 IRQ support
DENG Qingfang [Thu, 10 Feb 2022 05:59:46 +0000 (13:59 +0800)]
kernel: backport MT7530 IRQ support

Support MT7530 PHY link change interrupts, and enable for MT7621.

For external MT7530, a GPIO IRQ line is required, which is
board-specific, so it should be added to each DTS. In case the
interrupt-controller property is missing, it will fall back to
polling mode.

Signed-off-by: DENG Qingfang <dqfext@gmail.com>
2 years agoath25: switch to 5.10 Kernel
Paul Spooren [Mon, 27 Dec 2021 21:10:45 +0000 (22:10 +0100)]
ath25: switch to 5.10 Kernel

Tested-by: Chuanhong Guo <gch981213@gmail.com>
Signed-off-by: Paul Spooren <mail@aparcar.org>
2 years agokernel: backport MediaTek Ethernet PHY driver
DENG Qingfang [Thu, 3 Feb 2022 12:07:04 +0000 (20:07 +0800)]
kernel: backport MediaTek Ethernet PHY driver

Add support for MediaTek Gigabit Ethernet PHYs found in MT7530 and
MT7531. Fix some link up/down issues.
The errornous check for the PHY mode which broke things with MT7531
has been removed as suggested by patch
 net: phy: mediatek: remove PHY mode check on MT7531
As a result, things are working fine now on MT7622+MT7531 as well.

Signed-off-by: DENG Qingfang <dqfext@gmail.com>
Tested-by: Daniel Golle <daniel@makrotopia.org>
Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
2 years agometa: drop issue_template
Jo-Philipp Wich [Wed, 9 Feb 2022 16:26:58 +0000 (17:26 +0100)]
meta: drop issue_template

The contents do not apply anymore now that the switch to Github issue
has been decided.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2 years agokernel: generic: select the fq_codel qdisc by default
Rui Salvaterra [Sun, 19 Dec 2021 19:29:58 +0000 (19:29 +0000)]
kernel: generic: select the fq_codel qdisc by default

The kernel configuration allows us to select a default qdisc. Let's do this for
5.10 (as 5.4 is on its way out) and get rid of the hacky patch we've been
carrying.

Acked-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2 years agoucode: update to latest Git HEAD
Jo-Philipp Wich [Tue, 8 Feb 2022 22:44:47 +0000 (23:44 +0100)]
ucode: update to latest Git HEAD

a317c17 compiler: fix incorrect loop break targets

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2 years agoramips: move KERNEL_LOADADDR into Device/Default
Sungbo Eo [Wed, 2 Feb 2022 15:10:04 +0000 (00:10 +0900)]
ramips: move KERNEL_LOADADDR into Device/Default

Commit f4a79148f8cb ("ramips: add support for ipTIME AX2004M") was
reverted due to KERNEL_LOADADDR leakage, and it seems the problem can be
mitigated by moving the variable definition into Device/Default. By this,
KERNEL_LOADADDR redefined in a device recipe will not be leaked into the
subsequent device recipes anymore and thus will remain as a per-device
variable.

Ref: cd6a6e3030ff ("Revert "ramips: add support for ipTIME AX2004M"")
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2 years agoipq806x: Enlarge D7800 flash - use netgear partition
Mike Lothian [Mon, 17 May 2021 09:15:20 +0000 (10:15 +0100)]
ipq806x: Enlarge D7800 flash - use netgear partition

Increase the available flash memory size in Netgear R7800
by repurposing the unused "netgear" partition that is
located after the firmware partition.

Available flash space for kernel+rootfs+overlay increases
by 68 MB from 32 MB to 100 MB.

In a typical build, overlay space increases from 15 to 85,
increasing the package installation possibilities greatly.

Reverting to the OEM firmware is still possible, as the OEM
firmware contains logic to initialise the "netgear" partition
if its contents do not match expectations. In OEM firmware,
"netgear" contains 6 UBI sub-partitions that are defined in
/etc/netgear.cfg and initialisation is done by /etc/preinit

This is based on https://github.com/openwrt/openwrt/commit/fb8a578aa70572b3e56b64d296e22c2931e77b69

Signed-off-by: Mike Lothian <mike@fireburn.co.uk>
2 years agowireguard-tools: allow generating private_key
Leonardo Mörlein [Wed, 15 Sep 2021 01:09:18 +0000 (03:09 +0200)]
wireguard-tools: allow generating private_key

When the uci configuration is created automatically during a very early
stage, where no entropy daemon is set up, generating the key directly is
not an option. Therefore we allow to set the private_key to "generate"
and generate the private key directly before the interface is taken up.

Signed-off-by: Leonardo Mörlein <me@irrelefant.net>
Tested-by: Jan-Niklas Burfeind <git@aiyionpri.me>
2 years agohostapd: refresh patches
David Bauer [Mon, 17 Jan 2022 19:57:05 +0000 (20:57 +0100)]
hostapd: refresh patches

Refresh patches after updating to hostapd v2.10.

Signed-off-by: David Bauer <mail@david-bauer.net>
2 years agohostapd: update to v2.10
David Bauer [Mon, 17 Jan 2022 19:57:04 +0000 (20:57 +0100)]
hostapd: update to v2.10

Upstreamed patches:
020-mesh-make-forwarding-configurable.patch
e6db1bc5da3fd7d5f4dba24aa102543b4749912f
550-WNM-allow-specifying-dialog-token.patch
979f19716539362f8ce60a77bf1b88fdcf5ba8e5
720-ACS-fix-channel-100-frequency.patch
2341585c349231af00cdef8d51458df01bc6965f
741-proxyarp-fix-compilation-with-Hotspot-2.0-disabled.patch
08bdf4f90de61a84ed8f4dd918272dd9d36e2e1f

Compile-tested: wpad-wolfssl hostapd-openssl
Run-tested: ath79-generic

Signed-off-by: David Bauer <mail@david-bauer.net>
Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
2 years agofirewall4: update to latest Git HEAD
Jo-Philipp Wich [Mon, 7 Feb 2022 22:31:45 +0000 (23:31 +0100)]
firewall4: update to latest Git HEAD

a0518b6 fw4: gracefully handle unsupported hardware offloading
ac99eba init: fix boot action in init script

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2 years agohostapd: automatically calculate channel center freq on chan_switch
Felix Fietkau [Mon, 7 Feb 2022 12:11:01 +0000 (13:11 +0100)]
hostapd: automatically calculate channel center freq on chan_switch

Simplifies switching to different channels when on >= VHT80

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agorpcd: update to latest Git HEAD
Jo-Philipp Wich [Mon, 7 Feb 2022 09:31:17 +0000 (10:31 +0100)]
rpcd: update to latest Git HEAD

909f2a0 ucode: adjust to latest ucode api
4c532bf ucode: add ucode interpreter plugin
9c6ba38 treewide: adjust ubus object type names
75a96dc build: honour CMake install prefix in hardcoded paths

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2 years agouhttpd: update to latest Git HEAD
Jo-Philipp Wich [Tue, 23 Nov 2021 18:30:30 +0000 (19:30 +0100)]
uhttpd: update to latest Git HEAD

2f8b136 main: fix leaking -p/-s argument values
881fd3b ucode: adjust to latest ucode api
8b2868e file: specify UTF-8 as charset for dirlists, add option to override
3a5bd84 main: add ucode options to help text
16aa142 examples: add ucode handler example
3ceccd0 ucode: add ucode plugin support
f0f1406 examples: add example Lua handler script
9e87095 listen: avoid invalid memory access

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2 years agofirewall4: update to latest Git HEAD
Jo-Philipp Wich [Thu, 3 Feb 2022 22:47:56 +0000 (23:47 +0100)]
firewall4: update to latest Git HEAD

b54f462 fw4: parse traffic rules before forwarding rules
4d5af8b fw4: consolidate helper code
300c737 fw4: fix applying zone family restrictions to forwardings
eb9c25a tests: implement fs.opendir() mock interface
d30ff48 tests: fix mocked fs.popen() trace log
52831a0 fw4: improve flowtable handling
7cb10c8 fw4: disable "flow_offloading_hw" option for now
b2241a1 fw4: fix enabling NAT reflection rules for DNATs without explicit family

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2 years agoucode: update to latest Git HEAD
Jo-Philipp Wich [Mon, 7 Feb 2022 09:19:02 +0000 (10:19 +0100)]
ucode: update to latest Git HEAD

11adf0c source: convert source objects into proper uc_value_t type
3a49192 treewide: rework function memory model
7edad5c tests: add functional tests for builtin functions
d5003fd lib: fix leaking tokener in uc_json() on parse exception
5d0ecd9 lib: fix infinite loop on empty regexp matches in uc_replace()
3ad57f1 lib: fix infinite loop on empty regexp matches in uc_match()
32d596d lib: fix infinite loop on empty regexp matches in uc_split()
3e3f38d vm: ensure consistent trace output between gcc and clang compiled ucode
3600ded vm: fix leaking function value on call exception
3059295 vm: NULL-initialize pointer to make cppcheck happy
98e59bf source: zero-initialize conversion union to make cppcheck happy
7a65c14 run_tests.sh: change workdir to testcase directory during execution
afec8d7 run_tests.sh: support placing supplemental testcase files
3ada6e0 run_tests.sh: always treat outputs as text data
2cb627f program: rename bytecode load/write functions, track path of executed file
1094ffa lib: fix memory leak in uc_require_ucode()

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2 years agonetifd: update to latest Git HEAD
Jo-Philipp Wich [Mon, 7 Feb 2022 08:17:49 +0000 (09:17 +0100)]
netifd: update to latest Git HEAD

fd4c9e1 system-linux: expose hw-tc-offload ethtool feature in device status dump
3d76f2e system-linux: add wrapper function for creating link config messages
88af2f1 system-linux: delete bridge devices using netlink
85c3548 system-linux: create bridge devices using netlink

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2 years agoRevert "tools/zstd: update to 1.5.2"
Jo-Philipp Wich [Mon, 7 Feb 2022 08:03:13 +0000 (09:03 +0100)]
Revert "tools/zstd: update to 1.5.2"

This reverts commit 8de901ccf7e2b227bd970e9c477f00c15ce6aae9.

Apparently this update breaks tools building.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2 years agoramips: add support for Xiaomi Mi Router CR660x series
Raymond Wang [Sat, 11 Sep 2021 15:54:30 +0000 (23:54 +0800)]
ramips: add support for Xiaomi Mi Router CR660x series

Xiaomi Mi Router CR6606 is a Wi-Fi6 AX1800 Router with 4 GbE Ports.
Alongside the general model, it has three carrier customized models:
CR6606 (China Unicom), CR6608 (China Mobile), CR6609 (China Telecom)

Specifications:
- SoC: MediaTek MT7621AT
- RAM: 256MB DDR3 (ESMT M15T2G16128A)
- Flash: 128MB NAND (ESMT F59L1G81MB)
- Ethernet: 1000Base-T x4 (MT7530 SoC)
- WLAN: 2x2 2.4GHz 574Mbps + 2x2 5GHz 1201Mbps (MT7905DAN + MT7975DN)
- LEDs: System (Blue, Yellow), Internet (Blue, Yellow)
- Buttons: Reset, WPS
- UART: through-hole on PCB ([VCC 3.3v](RX)(GND)(TX) 115200, 8n1)
- Power: 12VDC, 1A

Jailbreak Notes:
1. Get shell access.
   1.1. Get yourself a wireless router that runs OpenWrt already.
   1.2. On the OpenWrt router:
      1.2.1. Access its console.
      1.2.2. Create and edit
             /usr/lib/lua/luci/controller/admin/xqsystem.lua
             with the following code (exclude backquotes and line no.):
```
     1  module("luci.controller.admin.xqsystem", package.seeall)
     2
     3  function index()
     4      local page   = node("api")
     5      page.target  = firstchild()
     6      page.title   = ("")
     7      page.order   = 100
     8      page.index = true
     9      page   = node("api","xqsystem")
    10      page.target  = firstchild()
    11      page.title   = ("")
    12      page.order   = 100
    13      page.index = true
    14      entry({"api", "xqsystem", "token"}, call("getToken"), (""),
103, 0x08)
    15  end
    16
    17  local LuciHttp = require("luci.http")
    18
    19  function getToken()
    20      local result = {}
    21      result["code"] = 0
    22      result["token"] = "; nvram set ssh_en=1; nvram commit; sed -i
's/channel=.*/channel=\"debug\"/g' /etc/init.d/dropbear; /etc/init.d/drop
bear start;"
    23      LuciHttp.write_json(result)
    24  end
```
      1.2.3. Browse http://{OWRT_ADDR}/cgi-bin/luci/api/xqsystem/token
             It should give you a respond like this:
             {"code":0,"token":"; nvram set ssh_en=1; nvram commit; ..."}
             If so, continue; Otherwise, check the file, reboot the rout-
             er, try again.
      1.2.4. Set wireless network interface's IP to 169.254.31.1, turn
             off DHCP of wireless interface's zone.
      1.2.5. Connect to the router wirelessly, manually set your access
             device's IP to 169.254.31.3, make sure
             http://169.254.31.1/cgi-bin/luci/api/xqsystem/token
             still have a similar result as 1.2.3 shows.
   1.3. On the Xiaomi CR660x:
        1.3.1. Login to the web interface. Your would be directed to a
               page with URL like this:
               http://{ROUTER_ADDR}/cgi-bin/luci/;stok={STOK}/web/home#r-
               outer
        1.3.2. Browse this URL with {STOK} from 1.3.1, {WIFI_NAME}
               {PASSWORD} be your OpenWrt router's SSID and password:
               http://{MIROUTER_ADDR}/cgi-bin/luci/;stok={STOK}/api/misy-
               stem/extendwifi_connect?ssid={WIFI_NAME}&password={PASSWO-
               RD}
               It should return 0.
        1.3.3. Browse this URL with {STOK} from 1.3.1:
               http://{MIROUTER_ADDR}/cgi-bin/luci/;stok={STOK}/api/xqsy-
               stem/oneclick_get_remote_token?username=xxx&password=xxx&-
               nonce=xxx
   1.4. Before rebooting, you can now access your CR660x via SSH.
        For CR6606, you can calculate your root password by this project:
        https://github.com/wfjsw/xiaoqiang-root-password, or at
        https://www.oxygen7.cn/miwifi.
        The root password for carrier-specific models should be the admi-
        nistration password or the default login password on the label.
        It is also feasible to change the root password at the same time
        by modifying the script from step 1.2.2.
        You can treat OpenWrt Router however you like from this point as
        long as you don't mind go through this again if you have to expl-
        oit it again. If you do have to and left your OpenWrt router unt-
        ouched, start from 1.3.
2. There's no official binary firmware available, and if you lose the
   content of your flash, no one except Xiaomi can help you.
   Dump these partitions in case you need them:
   "Bootloader" "Nvram" "Bdata" "crash" "crash_log"
   "firmware" "firmware1" "overlay" "obr"
   Find the corespond block device from /proc/mtd
   Read from read-only block device to avoid misoperation.
   It's recommended to use /tmp/syslogbackup/ as destination, since files
   would be available at http://{ROUTER_ADDR}/backup/log/YOUR_DUMP
   Keep an eye on memory usage though.
3. Since UART access is locked ootb, you should get UART access by modify
   uboot env. Otherwise, your router may become bricked.
   Excute these in stock firmware shell:
    a. nvram set boot_wait=on
    b. nvram set bootdelay=3
    c. nvram commit
   Or in OpenWrt:
    a. opkg update && opkg install kmod-mtd-rw
    b. insmod mtd-rw i_want_a_brick=1
    c. fw_setenv boot_wait on
    d. fw_setenv bootdelay 3
    e. rmmod mtd-rw

Migrate to OpenWrt:
 1. Transfer squashfs-firmware.bin to the router.
 2. nvram set flag_try_sys1_failed=0
 3. nvram set flag_try_sys2_failed=1
 4. nvram commit
 5. mtd -r write /path/to/image/squashfs-firmware.bin firmware

Additional Info:
 1. CR660x series routers has a different nand layout compared to other
    Xiaomi nand devices.
 2. This router has a relatively fresh uboot (2018.09) compared to other
    Xiaomi devices, and it is capable of booting fit image firmware.
    Unfortunately, no successful attempt of booting OpenWrt fit image
    were made so far. The cause is still yet to be known. For now, we use
    legacy image instead.

Signed-off-by: Raymond Wang <infiwang@pm.me>
2 years agoath79: add support for Mikrotik LHG 5
Jakob Riepler [Thu, 9 Dec 2021 11:12:37 +0000 (12:12 +0100)]
ath79: add support for Mikrotik LHG 5

The MikroTik LHG 5 series (product codes RBLHG-5nD, RBLHG-5HPnD and
RBLHG-5HPnD-XL) devices are an outdoor 5GHz CPE with a 24.5dBi or 27dBi
integrated antenna built around the Atheros AR9344 SoC.
It is very similar to the SXT Lite5 series which this patch is based
upon.

Specifications:
 - SoC: Atheros AR9344
 - RAM: 64 MB
 - Storage: 16 MB SPI NOR
 - Wireless: Atheros AR9340 (SoC) 802.11a/n 2x2:2
 - Ethernet: Atheros AR8229 switch (SoC), 1x 10/100 port,
    8-32 Vdc PoE in
 - 8 user-controllable LEDs:
  - 1x power (blue)
  - 1x user (white)
  - 1x ethernet (green)
  - 5x rssi (green)

 See https://mikrotik.com/product/RBLHG-5nD for more details.

Notes:
 The device was already supported in the ar71xx target.

Flashing:
 TFTP boot initramfs image and then perform a sysupgrade. Follow common
 MikroTik procedure as in https://openwrt.org/toh/mikrotik/common.

Signed-off-by: Jakob Riepler <jakob+openwrt@chaosfield.at>
2 years agoath79: add partial support for Netgear EX7300v2
Wenli Looi [Sat, 12 Jun 2021 23:32:33 +0000 (16:32 -0700)]
ath79: add partial support for Netgear EX7300v2

Hardware
--------
SoC: QCN5502
Flash: 16 MiB
RAM: 128 MiB
Ethernet: 1 gigabit port
Wireless No1: QCN5502 on-chip 2.4GHz 4x4
Wireless No2: QCA9984 pcie 5GHz 4x4
USB: none

Installation
------------
Flash the factory image using the stock web interface or TFTP the
factory image to the bootloader.

What works
----------
- LEDs
- Ethernet port
- 5GHz wifi (QCA9984 pcie)

What doesn't work
-----------------
- 2.4GHz wifi (QCN5502 on-chip)
  (I was not able to make this work, probably because ath9k requires
  some changes to support QCN5502.)

Signed-off-by: Wenli Looi <wlooi@ucalgary.ca>
2 years agoath79: add support for booting QCN5502 SoC
Wenli Looi [Tue, 15 Jun 2021 09:21:01 +0000 (02:21 -0700)]
ath79: add support for booting QCN5502 SoC

Based on wikidevi, QCN5502 is a "Dragonfly" like QCA9561 and QCA9563.
Treating it as QCA956x seems to work.

Signed-off-by: Wenli Looi <wlooi@ucalgary.ca>
2 years agoath79: add support for TP-Link TL-WR841HP v2
Saiful Islam [Sat, 25 Sep 2021 01:39:52 +0000 (07:39 +0600)]
ath79: add support for TP-Link TL-WR841HP v2

Specifications:
- AR9344 SoC, 8 MB nor flash, 64 MB DDR2 RAM
- 2x2 9dBi antenna, wifi 2.4Ghz 300Mbps
- 4x Ethernet LAN 10/100, 1x Ethernet WAN 10/100
- 1x WAN, 4x LAN, Wifi, PWR, WPS, SYSTEM Leds
- Reset/WPS button
- Serial UART at J4 onboard: 3.3v GND RX TX, 1152008N1

MAC addresses as verified by OEM firmware:

vendor   OpenWrt   address
LAN      eth0      label
WAN      eth1      label + 1
WLAN     phy0      label

The label MAC address was found in u-boot 0x1fc00.

Installation:
To install openwrt,
- set the device's SSID to each of the following lines,
  making sure to include the backticks.
- set the ssid and click save between each line.

`echo "httpd -k"> /tmp/s`
`echo "sleep 10">> /tmp/s`
`echo "httpd -r&">> /tmp/s`
`echo "sleep 10">> /tmp/s`
`echo "httpd -k">> /tmp/s`
`echo "sleep 10">> /tmp/s`
`echo "httpd -f">> /tmp/s`
`sh /tmp/s`

- Now, wait 60 sec.
- After the reboot sequence, the router may have fallen back to
  its default IP address with the default credentials (admin:admin).
- Log in to the web interface and go the the firmware upload page.
  Select "openwrt-ath79-generic-tplink_tl-wr841hp-v2-squashfs-factory.bin"
  and you're done : the system now accepts the openwrt.

Forum support topic:
https://forum.openwrt.org/t/support-for-tplink-tl-wr841hp-v2/69445/

Signed-off-by: Saiful Islam <si87868@gmail.com>
2 years agotools/zstd: update to 1.5.2
Rosen Penev [Mon, 31 Jan 2022 03:03:41 +0000 (19:03 -0800)]
tools/zstd: update to 1.5.2

Switched to building with meson as it's faster and does not need a
dependency on cmake, which takes a long time to build.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agoinclude/meson: fix host build directory
Rosen Penev [Mon, 31 Jan 2022 02:52:15 +0000 (18:52 -0800)]
include/meson: fix host build directory

When using a non default MESON_HOST_BUILD_DIR, HOST_BUILD_DIR is not
appropriate to use. This change matches the target configure section.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agotarget/linux: replace egrep with grep -E
Rosen Penev [Sat, 5 Feb 2022 17:42:42 +0000 (09:42 -0800)]
target/linux: replace egrep with grep -E

egrep is deprecated and replaced by grep -E. The latter is used
throughout the tree.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agobase-files: replace fgrep with grep -F
Rosen Penev [Sat, 5 Feb 2022 17:38:53 +0000 (09:38 -0800)]
base-files: replace fgrep with grep -F

fgrep is deprecated and replaced by grep -F. The latter is used
throughout the tree whereas this is the only usage of the former.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agoipq806x: convert TP-Link Archer VR2600v to denx,uimage
Christian Lamparter [Sun, 6 Feb 2022 13:24:32 +0000 (14:24 +0100)]
ipq806x: convert TP-Link Archer VR2600v to denx,uimage

The recent device-tree modification that added pre-cal
nvmem-cells pushed the device's kernel+dtb over the
allotted 3072k KERNEL_SIZE.

> WARNING: Image file tplink_vr2600v-uImage is too big: 3147214 > 3145728

There was a previous kernel partition size upgrade:
commit 0c967d92b3d9 ("ipq806x: increase kernel partition size for the TP-Link Archer VR2600v")
It has been seemingly upgraded from a 2048k KERNEL_SIZE in the past.
The commit talks about using the MTD_SPLIT_TPLINK_FW. But looking at
the image make recipe, there is no code that adds a TPLINK header.
So instead the board will use "denx,umimage". This requires
MTD_SPLIT_UIMAGE_FW, but this is present thanks to some NEC devices.

(Maybe the MTD_CONFIG_ARGS can be removed as well? But it could be
there because of the padding at the beginning. This needs testing.)

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agokernel: bpf-headers: fix build error when testing kernel is used
Ansuel Smith [Sat, 22 Jan 2022 20:27:49 +0000 (21:27 +0100)]
kernel: bpf-headers: fix build error when testing kernel is used

Now that we have separate files for each kernel version,
only the version/hash for the target kernel are available.
This cause a missing hash error (and wrong kernel version) for
bpf-headers when a testing kernel version is used for the current target.

Fix this error by manually including the kernel version/hash file for the
specific kernel version requested.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2 years agoRevert "kernel: backport MediaTek Ethernet PHY driver"
Hauke Mehrtens [Sat, 5 Feb 2022 17:52:36 +0000 (18:52 +0100)]
Revert "kernel: backport MediaTek Ethernet PHY driver"

This reverts commit 8b4cba53a9402f44da2dced4a78ca065b15dca94.

This broke the mt7530 on Linksys e8450 (mt7622) for me.
[    1.312943] mt7530 mdio-bus:00 lan1 (uninitialized): failed to connect to PHY: -EINVAL
[    1.320890] mt7530 mdio-bus:00 lan1 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 0
[    1.331163] mt7530 mdio-bus:00 lan2 (uninitialized): failed to connect to PHY: -EINVAL
[    1.339085] mt7530 mdio-bus:00 lan2 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 1
[    1.349321] mt7530 mdio-bus:00 lan3 (uninitialized): failed to connect to PHY: -EINVAL
[    1.357241] mt7530 mdio-bus:00 lan3 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 2
[    1.367452] mt7530 mdio-bus:00 lan4 (uninitialized): failed to connect to PHY: -EINVAL
[    1.375367] mt7530 mdio-bus:00 lan4 (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 3
[    1.385750] mt7530 mdio-bus:00 wan (uninitialized): failed to connect to PHY: -EINVAL
[    1.393575] mt7530 mdio-bus:00 wan (uninitialized): error -22 setting up PHY for tree 0, switch 0, port 4

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agoRevert "kernel: backport MT7530 IRQ support"
Hauke Mehrtens [Sat, 5 Feb 2022 17:52:32 +0000 (18:52 +0100)]
Revert "kernel: backport MT7530 IRQ support"

This reverts commit 3f4301e123f29348b4ad87578d62b7d1f5f210c6.

This broke the mt7530 on Linksys e8450 (mt7622) for me.
[    1.300554] mt7530 mdio-bus:00: no interrupt support

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agoutil-linux: package ipcs command
Stijn Tintel [Fri, 27 Mar 2020 10:40:33 +0000 (12:40 +0200)]
util-linux: package ipcs command

Add a package for util-linux' ipcs command, to show information about
System V inter-process communication facilities.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2 years agokernel: backport MT7530 IRQ support
DENG Qingfang [Thu, 3 Feb 2022 12:07:05 +0000 (20:07 +0800)]
kernel: backport MT7530 IRQ support

Support MT7530 PHY link change interrupts, and enable for MT7621.

Signed-off-by: DENG Qingfang <dqfext@gmail.com>
Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
2 years agokernel: backport MediaTek Ethernet PHY driver
DENG Qingfang [Thu, 3 Feb 2022 12:07:04 +0000 (20:07 +0800)]
kernel: backport MediaTek Ethernet PHY driver

Add support for MediaTek Gigabit Ethernet PHYs found in MT7530.
Fix some link up/down issues.

Signed-off-by: DENG Qingfang <dqfext@gmail.com>
Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
2 years agokernel: backport MT7530 MDB operations
DENG Qingfang [Thu, 3 Feb 2022 12:07:03 +0000 (20:07 +0800)]
kernel: backport MT7530 MDB operations

Use hardware to forward multicast traffic instead of trapping to the
host.

Signed-off-by: DENG Qingfang <dqfext@gmail.com>
Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
2 years agokernel: backport MT7530 VLAN fix
DENG Qingfang [Thu, 3 Feb 2022 12:07:02 +0000 (20:07 +0800)]
kernel: backport MT7530 VLAN fix

Fix FDB learning bugs when VLAN filtering is enabled.

Signed-off-by: DENG Qingfang <dqfext@gmail.com>
Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
2 years agokernel: backport MT7530 ageing time support
DENG Qingfang [Thu, 3 Feb 2022 12:07:01 +0000 (20:07 +0800)]
kernel: backport MT7530 ageing time support

Allow setting ageing time from 1 to 1,048,576 seconds.

Signed-off-by: DENG Qingfang <dqfext@gmail.com>
Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
2 years agokernel: backport MediaTek jumbo frame support
DENG Qingfang [Thu, 3 Feb 2022 12:07:00 +0000 (20:07 +0800)]
kernel: backport MediaTek jumbo frame support

Allow MTU up to 2026 on mediatek, ramips/mt7621 targets.

Signed-off-by: DENG Qingfang <dqfext@gmail.com>
Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
2 years agoocteontx: switch to 5.10 Kernel
Paul Spooren [Sat, 29 Jan 2022 15:09:24 +0000 (16:09 +0100)]
octeontx: switch to 5.10 Kernel

Tested by multiple users and seems to work fine.

Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Tested-by: Daniel Danzberger <daniel@dd-wrt.com>
Signed-off-by: Paul Spooren <mail@aparcar.org>
2 years agoath79: support ZTE MF286
Lech Perczak [Sun, 9 Jan 2022 19:46:53 +0000 (20:46 +0100)]
ath79: support ZTE MF286

ZTE MF286 is an indoor LTE category 6 CPE router with simultaneous
dual-band 802.11ac plus 802.11n Wi-Fi radios and quad-port gigabit
Ethernet switch, FXS and external USB 2.0 port.

Hardware highlights:
- CPU: QCA9563 SoC at 775MHz,
- RAM: 128MB DDR2,
- NOR Flash: MX25L1606E 2MB SPI Flash, for U-boot only,
- NAND Flash: GD5F1G04UBYIG 128MB SPI NAND-Flash, for all other data,
- Wi-Fi 5GHz: QCA9882 2x2 MIMO 802.11ac radio,
- WI-Fi 2.4GHz: QCA9563 3x3 MIMO 802.11n radio,
- Switch: QCA8337v2 4-port gigabit Ethernet, with single SGMII CPU port,
- WWAN: MDM9230-based category 6 internal LTE modem in extended
  mini-PCIE form factor, with 3 internal antennas and 2 external antenna
  connections, single mini-SIM slot. Modem model identified as MF270,
- FXS: one external ATA port (handled entirely by modem part) with two
  physical connections in parallel,
- USB: Single external USB 2.0 port,
- Switches: power switch, WPS, Wi-Fi and reset buttons,
- LEDs: Wi-Fi, Test (internal). Rest of LEDs (Phone, WWAN, Battery,
  Signal state) handled entirely by modem. 4 link status LEDs handled by
  the switch on the backside.
- Battery: 3Ah 1-cell Li-Ion replaceable battery, with charging and
  monitoring handled by modem.
- Label MAC device: eth0

Console connection: connector X2 is the console port, with the following
pinout, starting from pin 1, which is the topmost pin when the board is
upright:
- VCC (3.3V). Do not use unless you need to source power for the
  converer from it.
- TX
- RX
- GND
Default port configuration in U-boot as well as in stock firmware is
115200-8-N-1.

Installation:
Due to different flash layout from stock firmware, sysupgrade from
within stock firmware is impossible, despite it's based on QSDK which
itself is based on OpenWrt.

STEP 0: Stock firmware update:
As installing OpenWrt cuts you off from official firmware updates for
the modem part, it is recommended to update the stock firmware to latest
version before installation, to have built-in modem at the latest firmware
version.

STEP 1: gaining root shell:

Method 1:
This works if busybox has telnetd compiled in the binary.
If this does not work, try method 2.

Using well-known exploit to start telnetd on your router - works
only if Busybox on stock firmware has telnetd included:
- Open stock firmware web interface
- Navigate to "URL filtering" section by going to "Advanced settings",
  then "Firewall" and finally "URL filter".
- Add an entry ending with "&&telnetd&&", for example
  "http://hostname/&&telnetd&&".
- telnetd will immediately listen on port 4719.
- After connecting to telnetd use "admin/admin" as credentials.

Method 2:
This works if busybox does not have telnetd compiled in. Notably, this
is the case in DNA.fi firmware.
If this does not work, try method 3.

- Set IP of your computer to 192.168.1.22.
- Have a TFTP server running at that address
- Download MIPS build of busybox including telnetd, for example from:
  https://busybox.net/downloads/binaries/1.21.1/busybox-mips
  and put it in it's root directory. Rename it as "telnetd".
- As previously, login to router's web UI and navigate to "URL
  filtering"
- Using "Inspect" feature, extend "maxlength" property of the input
  field named "addURLFilter", so it looks like this:
  <input type="text" name="addURLFilter" id="addURLFilter" maxlength="332"
    class="required form-control">
- Stay on the page - do not navigate anywhere
- Enter "http://aa&zte_debug.sh 192.168.1.22 telnetd" as a filter.
- Save the settings. This will download the telnetd binary over tftp and
  execute it. You should be able to log in at port 23, using
  "admin/admin" as credentials.

Method 3:
If the above doesn't work, use the serial console - it exposes root shell
directly without need for login. Some stock firmwares, notably one from
finnish DNA operator lack telnetd in their builds.

STEP 2: Backing up original software:
As the stock firmware may be customized by the carrier and is not
officially available in the Internet, IT IS IMPERATIVE to back up the
stock firmware, if you ever plan to returning to stock firmware.

Method 1: after booting OpenWrt initramfs image via TFTP:
PLEASE NOTE: YOU CANNOT DO THIS IF USING INTERMEDIATE FIRMWARE FOR INSTALLATION.
- Dump stock firmware located on stock kernel and ubi partitions:

  ssh root@192.168.1.1: cat /dev/mtd4 > mtd4_kernel.bin
  ssh root@192.168.1.1: cat /dev/mtd8 > mtd8_ubi.bin

And keep them in a safe place, should a restore be needed in future.

Method 2: using stock firmware:
- Connect an external USB drive formatted with FAT or ext4 to the USB
  port.
- The drive will be auto-mounted to /var/usb_disk
- Check the flash layout of the device:

  cat /proc/mtd

  It should show the following:
  mtd0: 00080000 00010000 "uboot"
  mtd1: 00020000 00010000 "uboot-env"
  mtd2: 00140000 00020000 "fota-flag"
  mtd3: 00140000 00020000 "caldata"
  mtd4: 00140000 00020000 "mac"
  mtd5: 00600000 00020000 "cfg-param"
  mtd6: 00140000 00020000 "oops"
  mtd7: 00800000 00020000 "web"
  mtd8: 00300000 00020000 "kernel"
  mtd9: 01f00000 00020000 "rootfs"
  mtd10: 01900000 00020000 "data"
  mtd11: 03200000 00020000 "fota"

  Differences might indicate that this is NOT a vanilla MF286 device but
  one of its later derivatives.
- Copy over all MTD partitions, for example by executing the following:

  for i in 0 1 2 3 4 5 6 7 8 9 10 11; do cat /dev/mtd$i > \
  /var/usb_disk/mtd$i; done

- If the count of MTD partitions is different, this might indicate that
  this is not a standard MF286 device, but one of its later derivatives.
- (optionally) rename the files according to MTD partition names from
  /proc/mtd
- Unmount the filesystem:

  umount /var/usb_disk; sync

  and then remove the drive.
- Store the files in safe place if you ever plan to return to stock
  firmware. This is especially important, because stock firmware for
  this device is not available officially, and is usually customized by
  the mobile providers.

STEP 3: Booting initramfs image:

Method 1: using serial console (RECOMMENDED):
- Have TFTP server running, exposing the OpenWrt initramfs image, and
  set your computer's IP address as 192.168.1.22. This is the default
  expected by U-boot. You may wish to change that, and alter later
  commands accordingly.
- Connect the serial console if you haven't done so already,
- Interrupt boot sequence by pressing any key in U-boot when prompted
- Use the following commands to boot OpenWrt initramfs through TFTP:

  setenv serverip 192.168.1.22
  setenv ipaddr 192.168.1.1
  tftpboot 0x81000000 openwrt-ath79-nand-zte_mf286-initramfs-kernel.bin
  bootm 0x81000000

  (Replace server IP and router IP as needed). There is no  emergency
  TFTP boot sequence triggered by buttons, contrary to MF283+.
- When OpenWrt initramfs finishes booting, proceed to actual
  installation.

Method 2: using initramfs image as temporary boot kernel
This exploits the fact, that kernel and rootfs MTD devices are
consecutive on NAND flash, so from within stock image, an initramfs can
be written to this area and booted by U-boot on next reboot, because it
uses "nboot" command which isn't limited by kernel partition size.
- Download the initramfs-kernel.bin image
- Split the image into two parts on 3MB partition size boundary, which
  is the size of kernel partition. Pad the output of second file to
  eraseblock size:

  dd if=openwrt-ath79-nand-zte_mf286-initramfs-kernel.bin \
  bs=128k count=24 \
  of=openwrt-ath79-zte_mf286-intermediate-kernel.bin

  dd if=openwrt-ath79-nand-zte_mf286-initramfs-kernel.bin \
  bs=128k skip=24 conv=sync \
  of=openwrt-ath79-zte_mf286-intermediate-rootfs.bin

- Copy over /usr/bin/flash_eraseall and /usr/bin/nandwrite utilities to
  /tmp. This is CRITICAL for installation, as erasing rootfs will cut
  you off from those tools on flash!

- After backing up the previous MTD contents, write the images to the
  respective MTD devices:

  /tmp/flash_eraseall /dev/<kernel-mtd>

  /tmp/nandwrite /dev/<kernel-mtd> \
  /var/usb_disk/openwrt-ath79-zte_mf286-intermediate-kernel.bin

  /tmp/flash_eraseall /dev/<kernel-mtd>

  /tmp/nandwrite /dev/<rootfs-mtd> \
  /var/usb_disk/openwrt-ath79-zte_mf286-intermediate-rootfs.bin

- Ensure that no bad blocks were present on the devices while writing.
  If they were present, you may need to vary the split  between
  kernel and rootfs parts, so U-boot reads a valid uImage after skipping
  the bad blocks. If it fails, you will be left with method 3 (below).
- If write is OK, reboot the device, it will reboot to OpenWrt
  initramfs:

  reboot -f

- After rebooting, SSH into the device and use sysupgrade to perform
  proper installation.

Method 3: using built-in TFTP recovery (LAST RESORT):
- With that method, ensure you have complete backup of system's NAND
  flash first. It involves deliberately erasing the kernel.
- Download "-initramfs-kernel.bin" image for the device.
- Prepare the recovery image by prepending 8MB of zeroes to the image,
  and name it root_uImage:

  dd if=/dev/zero of=padding.bin bs=8M count=1

  cat padding.bin openwrt-ath79-nand-zte_mf286-initramfs-kernel.bin >
  root_uImage

- Set up a TFTP server at 192.0.0.1/8. Router will use random address
  from that range.
- Put the previously generated "root_uImage" into TFTP server root
  directory.
- Deliberately erase "kernel" partition" using stock firmware after
  taking backup. THIS IS POINT OF NO RETURN.
- Restart the device. U-boot will attempt flashing the recovery
  initramfs image, which will let you perform actual installation using
  sysupgrade. This might take a considerable time, sometimes the router
  doesn't establish Ethernet link properly right after booting. Be
  patient.
- After U-boot finishes flashing, the LEDs of switch ports will all
  light up. At this moment, perform power-on reset, and wait for OpenWrt
  initramfs to finish booting. Then proceed to actual installation.

STEP 4: Actual installation:
- scp the sysupgrade image to the device:

  scp openwrt-ath79-nand-zte_mf286-squashfs-sysupgrade.bin \
  root@192.168.1.1:/tmp/

- ssh into the device and execute sysupgrade:

  sysupgrade -n /tmp/openwrt-ath79-nand-zte_mf286-squashfs-sysupgrade.bin

- Wait for router to reboot to full OpenWrt.

STEP 5: WAN connection establishment
Since the router is equipped with LTE modem as its main WAN interface, it
might be useful to connect to the Internet right away after
installation. To do so, please put the following entries in
/etc/config/network, replacing the specific configuration entries with
one needed for your ISP:

config interface 'wan'
        option proto 'qmi'
        option device '/dev/cdc-wdm0'
        option auth '<auth>' # As required, usually 'none'
        option pincode '<pin>' # If required by SIM
        option apn '<apn>' # As required by ISP
        option pdptype '<pdp>' # Typically 'ipv4', or 'ipv4v6' or 'ipv6'

For example, the following works for most polish ISPs
config interface 'wan'
        option proto 'qmi'
        option device '/dev/cdc-wdm0'
        option auth 'none'
        option apn 'internet'
        option pdptype 'ipv4'

If you have build with LuCI, installing luci-proto-qmi helps with this
task.

Restoring the stock firmware:

Preparation:
If you took your backup using stock firmware, you will need to
reassemble the partitions into images to be restored onto the flash. The
layout might differ from ISP to ISP, this example is based on generic stock
firmware.
The only partitions you really care about are "web", "kernel", and
"rootfs". For easy padding and possibly restoring configuration, you can
concatenate most of them into images written into "ubi" meta-partition
in OpenWrt. To do so, execute something like:

cat mtd5_cfg-param.bin mtd6-oops.bin mtd7-web.bin mtd9-rootfs.bin > \
mtd8-ubi_restore.bin

You can skip the "fota" partition altogether,
it is used only for stock firmware update purposes and can be overwritten
safely anyway. The same is true for "data" partition which on my device
was found to be unused at all. Restoring mtd5_cfg-param.bin will restore
the stock firmware configuration you had before.

Method 1: Using initramfs:
- Boot to initramfs as in step 3:
- Completely detach ubi0 partition using ubidetach /dev/ubi0_0
- Look up the kernel and ubi partitions in /proc/mtd
- Copy over the stock kernel image using scp to /tmp
- Erase kernel and restore stock kernel:
  (scp mtd4_kernel.bin root@192.168.1.1:/tmp/)
  mtd write <kernel_mtd> mtd4_kernel.bin
  rm mtd4_kernel.bin
- Copy over the stock partition backups one-by-one using scp to /tmp, and
  restore them individually. Otherwise you might run out of space in
  tmpfs:

  (scp mtd3_ubiconcat0.bin root@192.168.1.1:/tmp/)

  mtd write <ubiconcat0_mtd> mtd3_ubiconcat0.bin
  rm mtd3_ubiconcat0.bin

  (scp mtd5_ubiconcat1.bin root@192.168.1.1:/tmp/)

  mtd write <ubiconcat1_mtd> mtd5_ubiconcat1.bin
  rm mtd5_ubiconcat1.bin

- If the write was correct, force a device reboot with

  reboot -f

Method 2: Using live OpenWrt system (NOT RECOMMENDED):
- Prepare a USB flash drive contatining MTD backup files
- Ensure you have kmod-usb-storage and filesystem driver installed for
  your drive
- Mount your flash drive

  mkdir /tmp/usb

  mount /dev/sda1 /tmp/usb

- Remount your UBI volume at /overlay to R/O

  mount -o remount,ro /overlay

- Write back the kernel and ubi partitions from USB drive

  cd /tmp/usb
  mtd write mtd4_kernel.bin /dev/<kernel_mtd>

  mtd write mtd8_ubi.bin /dev/<kernel_ubi>

- If everything went well, force a device reboot with
  reboot -f

Last image may be truncated a bit due to lack of space in RAM, but this will happen over "fota"
MTD partition which may be safely erased after reboot anyway.

Method 3: using built-in TFTP recovery (LAST RESORT):
- Assemble a recovery rootfs image from backup of stock partitions by
  concatenating "web", "kernel", "rootfs" images dumped from the device,
  as "root_uImage"
- Use it in place of "root_uImage" recovery initramfs image as in the
  TFTP pre-installation method.

Quirks and known issues
- Kernel partition size is increased to 4MB compared to stock 3MB, to
  accomodate future kernel updates - at this moment OpenWrt 5.10 kernel
  image is at 2.5MB which is dangerously close to the limit. This has no
  effect on booting the system - but keep that in mind when reassembling
  an image to restore stock firmware.
- uqmi seems to be unable to change APN manually, so please use the one
  you used before in stock firmware first. If you need to change it,
  please use protocok '3g' to establish connection once, or use the
  following command to change APN (and optionally IP type) manually:
  echo -ne 'AT+CGDCONT=1,"IP","<apn>' > /dev/ttyUSB0
- The only usable LED as a "system LED" is the green debug LED hidden
  inside the case. All other LEDs are controlled by modem, on which the
  router part has some influence only on Wi-Fi LED.
- Wi-Fi LED currently doesn't work while under OpenWrt, despite having
  correct GPIO mapping. All other LEDs are controlled by modem,
  including this one in stock firmware. GPIO19, mapped there only acts
  as a gate, while the actual signal source seems to be 5GHz Wi-Fi
  radio, however it seems it is not the LED exposed by ath10k as
  ath10k-phy0.
- GPIO5 used for modem reset is a suicide switch, causing a hardware
  reset of whole board, not only the modem. It is attached to
  gpio-restart driver, to restart the modem on reboot as well, to ensure
  QMI connectivity after reboot, which tends to fail otherwise.
- Modem, as in MF283+, exposes root shell over ADB - while not needed
  for OpenWrt operation at all - have fun lurking around.
- MAC address shift for 5GHz Wi-Fi used in stock firmware is
  0x320000000000, which is impossible to encode in the device tree, so I
  took the liberty of using MAC address increment of 1 for it, to ensure
  different BSSID for both Wi-Fi interfaces.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
2 years agoath79: kernel: drop _machine_restart again
Lech Perczak [Mon, 10 Jan 2022 23:13:02 +0000 (00:13 +0100)]
ath79: kernel: drop _machine_restart again

Backport patch ("MIPS: ath79: drop _machine_restart again"), which is
required to support GPIO restart handler on ZTE MF286, broken due to
_machine_restart being restored in kernel accidentally, wich causes any
registered restart handlers to not execute, including one from
ath79-reset driver.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
2 years agobcm27xx: update distroconfig.txt for faster RPi4
John Audia [Sun, 23 Jan 2022 09:42:41 +0000 (04:42 -0500)]
bcm27xx: update distroconfig.txt for faster RPi4

Newer RPi 4 Rev 6 (8 GB models and recent 2 GB / 4 GB models) ship with
the so-called C0 processor which can run turbo mode at 1.8 GHz max rather
than 1.5 GHz gracefully.  Add 'arm_boost=1' to pi4 section of to enable.

Note that this setting has no effect on older chips; they continue with
their 1.5 GHz max unless users overclock them.

Ref: https://www.raspberrypi.com/news/bullseye-bonus-1-8ghz-raspberry-pi-4

Signed-off-by: John Audia <graysky@archlinux.us>
2 years agoipq40xx: add Linksys MR8300 WAN port
Julien Cassette [Mon, 17 Jan 2022 18:41:32 +0000 (19:41 +0100)]
ipq40xx: add Linksys MR8300 WAN port

This makes the WAN interface and port appear in
LuCi -> Network -> Switch on Linksys MR8300.
This allows to configure a VLAN on WAN.

Fixes: FS#4227
Signed-off-by: Julien Cassette <julien.cassette@gmail.com>
2 years agoipq40xx: add support for ZTE MF286D
Pawel Dembicki [Tue, 23 Nov 2021 08:10:14 +0000 (09:10 +0100)]
ipq40xx: add support for ZTE MF286D

ZTE MF286D is a LTE router with four gigabit ethernet ports
and integrated QMI mPCIE modem.

Hardware specification:

  - CPU: IPQ4019
  - RAM: 256MB
  - Flash: NAND 128MB + NOR 2MB
  - WLAN1:  Qualcomm Atheros QCA4019 2.4GHz 802.11bgn 2x2:2
  - WLAN2:  Qualcomm Atheros QCA4019 5GHz 802.11anac 2x2:2
  - LTE: mPCIe cat 12 card (Modem chipset MDM9250)
  - LAN: 4 Gigabit Ports
  - USB: 1x USB2.0 (regular port). 1x USB3.0 (mpcie - used by the modem)
  - Serial console: X8 connector 115200 8n1

Known issues:

  - Many LEDs are driven by the modem. Only internal LEDs and wifi LEDs
    are driven by cpu.
  - Wifi LED is triggered by phy0tpt only
  - No VoIP support
  - LAN1/WAN port is configured as WAN
  - ZTE gives only one MAC per device. Use +1/+2/+3 increment for WAN
    and WLAN0/1

Opening the case:

1. Take of battery lid (no battery support for this model, battery cage
   is dummy).
2. Unscrew screw placed behind battery lid.
3. Take off back cover. It attached with multiple plastic clamps.
4. Unscrew four more screws hidden behind back case.
5. Remove front panel from blue chassis. There are more plastic
   clamps.
6. Unscrew two boards, which secures the PCB in the chassis.
7. Extract board from blue chassis.

Console connection (X8 connector):

1. Parameters: 115200 8N1
2. Pin description: (from closest pin to X8 descriptor to farthest)
    - VCC (3.3V)
    - TX
    - RX
    - GND

Install Instructions:

Serial + initramfs:
1. Place OpenWrt initramfs image for the device on a TFTP in
   the server's root. This example uses Server IP: 192.168.1.3
2. Connect serial console (115200,8n1) to X8 connector.
3. Connect TFTP server to RJ-45 port.
4. Stop in u-Boot and run u-Boot commands:
setenv serverip 192.168.1.3
setenv ipaddr 192.168.1.72
set fdt_high 0x85000000
tftp openwrt-ipq40xx-generic-zte_mf286d-initramfs-fit-zImage.itb
bootm $loadaddr
5. Please make backup of original partitions, if you think about revert
   to stock.
6. Login via ssh or serial and remove stock partitions:
ubiattach -m 9
ubirmvol /dev/ubi0 -N ubi_rootfs
ubirmvol /dev/ubi0 -N ubi_rootfs_data
7. Install image via "sysupgrade -n".

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
(cosmetic changes to the commit message)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agogeneric: kernel: add patches with ZTE MF286D modem
Pawel Dembicki [Wed, 12 Jan 2022 08:00:10 +0000 (09:00 +0100)]
generic: kernel: add patches with ZTE MF286D modem

This patch includes patches sent upstream with ZTE MF286D modem
support. It adds support for qmi and serial option driver.

Links to ML:
https://lore.kernel.org/linux-usb/20220111221132.14586-1-paweldembicki@gmail.com/
https://lore.kernel.org/linux-usb/20220111221205.14662-1-paweldembicki@gmail.com/

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
2 years agoipq806x: G10: use ASROCK's wifi calibration data
Christian Lamparter [Thu, 3 Feb 2022 22:22:54 +0000 (23:22 +0100)]
ipq806x: G10: use ASROCK's wifi calibration data

brings back the ath10k QCA9980 wifi nodes to which
it adds ASROCK's wifi calibration data. These are
now provided by the ath10k_firmware.git's board-2.bin.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agolinux-firmware: qca99x0 update package
Christian Lamparter [Thu, 3 Feb 2022 22:15:36 +0000 (23:15 +0100)]
linux-firmware: qca99x0 update package

Kalle Valo ath10k-firmware repository no longer provides the
legacy board.bin files for the qca99x0 chips. Instead he
copied over the codeaurora version and add more board files.

In the future, this board-2.bin should find its way to
linux-firmware.git, which would allow us to remove the
extra download code completely.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agoipq806x: utilize nvmem-cells for pre-calibration data
Christian Lamparter [Mon, 27 Dec 2021 23:30:13 +0000 (00:30 +0100)]
ipq806x: utilize nvmem-cells for pre-calibration data

converts extraction entries from 11-ath10k-caldata into
nvmem-cells in the individual board's device-tree file.

The patch also moves previously existing referenced
nvmem-cells data nodes which were placed at the end
back into the partitions node. As well as removing
some duplicated properties from qcom-ipq8065-xr500.dts's
art (the included nighthawk.dtsi defines those already).

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agoapm821xx: WNDR4700: utilize ath9k nvmem-cells
Christian Lamparter [Sun, 16 Jan 2022 17:42:18 +0000 (18:42 +0100)]
apm821xx: WNDR4700: utilize ath9k nvmem-cells

the WNDR4700 can fetch its calibration data and
mac-addresses directly from the "wifi_data" partition.
This allows us to get rid of the 10-ath9k-eeprom file
for the apm821xx target completely.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agoapm821xx: convert legacy nand partition layout
Christian Lamparter [Sun, 16 Jan 2022 19:13:24 +0000 (20:13 +0100)]
apm821xx: convert legacy nand partition layout

in order to get nvmem-cells to work on AP and routers
(Netgears WNDR4700). The nvmem-cell needs to be within
a fixed-partition dt-node.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agoapm821xx: WNDR4700: delete dead dt definitions
Christian Lamparter [Sun, 16 Jan 2022 17:46:16 +0000 (18:46 +0100)]
apm821xx: WNDR4700: delete dead dt definitions

cooling-{min|max}-level are no longer used.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agokernel: usb: remove left-over LINUX_5_10 dependency symbol
Christian Lamparter [Thu, 3 Feb 2022 21:32:18 +0000 (22:32 +0100)]
kernel: usb: remove left-over LINUX_5_10 dependency symbol

this should have been removed together with linux 5.4 APM821XX
support. Currently, this didn't hurt or broke something. But it
will in the next stable kernel release.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agobpf-headers: fix build error from within the SDK
Felix Fietkau [Fri, 4 Feb 2022 11:48:45 +0000 (12:48 +0100)]
bpf-headers: fix build error from within the SDK

The SDK does not ship the generic platform files. Use relative path for
GENERIC_PLATFORM_DIR to make it work. This points it at the files from
the feed directory instead of the base SDK path

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agotools/meson: update to 0.61.1
Rosen Penev [Mon, 31 Jan 2022 02:57:59 +0000 (18:57 -0800)]
tools/meson: update to 0.61.1

Changelog:

backend_startup_project
Add a man page backend to refman
extract_objects() supports generated sources
Python 3.6 support will be dropped in the next release
Warning if check kwarg of run_command is missing
meson rewrite can modify extra_files
meson rewrite target <target> info outputs target's extra_files
Visual Studio 2022 backend
Support for CMake <3.14 is now deprecated for CMake subprojects
Added support for sccache
install_symlink function

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agoom-watchdog: Drop unused package
Sven Eckelmann [Mon, 31 Jan 2022 13:44:18 +0000 (14:44 +0100)]
om-watchdog: Drop unused package

All devices which used this package migrated to the kernel GPIO-line
watchdog driver and configure it over their DT.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2 years agoramips: Switch Teltonika RUT5xx to kernel GPIO-line watchdog driver
Sven Eckelmann [Mon, 31 Jan 2022 13:39:52 +0000 (14:39 +0100)]
ramips: Switch Teltonika RUT5xx to kernel GPIO-line watchdog driver

The commit 04e91631e050 ("om-watchdog: add support for Teltonika RUT5xx
(ramips)") used the deprecated om-watchdog daemon to handle the GPIO-line
connected watchdog on the Teltonika RUT5xx.

But this daemon has massive problems since commit 30f61a34b4cf
("base-files: always use staged sysupgrade"). The process will always be
stopped on sysupgrades. If the sysupgrade takes slightly longer, the
watchdog is not triggered at the correct time and thus the sysupgrade will
interrupted hard by the watchdog sysupgrade. And this hard interrupt can
easily brick the device when there is no fallback (dual-boot, ...).

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2 years agouboot-mvebu: backport two patches for Marvell A38x
Josef Schlehofer [Fri, 28 Jan 2022 12:39:45 +0000 (13:39 +0100)]
uboot-mvebu: backport two patches for Marvell A38x

This solves issue with DDR training on Turris Omnia.

Log:
********   DRAM initialization Failed (res 0x1)   ********
DDR3 Training Sequence - FAILED
ERROR ### Please RESET the board ###

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2 years agouboot-mvebu: Add U-boot for Turris Omnia
Josef Schlehofer [Fri, 28 Jan 2022 12:37:08 +0000 (13:37 +0100)]
uboot-mvebu: Add U-boot for Turris Omnia

* Add U-boot support for Turris Omnia

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2 years agouboot-mvebu: update to version 2022.01
Josef Schlehofer [Wed, 26 Jan 2022 10:37:13 +0000 (11:37 +0100)]
uboot-mvebu: update to version 2022.01

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Tested-by: Andre Heider <a.heider@gmail.com> # ESPRESSObin
2 years agomt76: update to the latest version
Felix Fietkau [Wed, 22 Dec 2021 20:04:17 +0000 (21:04 +0100)]
mt76: update to the latest version

833b9d7fcf7f mt76: allow drivers to drop rx packets early
f703084f31cb mt76: mt7915: process txfree and txstatus without allocating skbs
047b9a9e78b3 mt76: mt7615: in debugfs queue stats, skip wmm index 3 on mt7663
fea36e02075c mt76: only kick tx queue if frames were queued
8381e54ebfb5 linux-firmware: update firmware for MT7921 WiFi device
d57dadb8c861 Revert "mt76: only kick tx queue if frames were queued"
3a21d6e2153b mt76: mt7663: disable 4addr capability
f1d66cf7a6c5 mt76: connac: fix possible NULL pointer dereference in mt76_connac_get_phy_mode_v2
c9a4146404d4 sync with upstream
4ed8c910b94e mt76: mt7921: fix possible resume failure
bf105aa6cd2f mt76: mt7921: fix network buffer leak by txs missing
e2b454b6fb30 mt76: connac: introduce MCU_EXT macros
5a87f5497c9b mt76: connac: align MCU_EXT definitions with 7915 driver
720ddc32507d mt76: connac: remove MCU_FW_PREFIX bit
da5128a59eda mt76: connac: introduce MCU_UNI_CMD macro
116109bee7cb mt76: connac: introduce MCU_CE_CMD macro
f96fbdf038d5 mt76: connac: rely on MCU_CMD macro
922f0d408413 mt76: mt7915: rely on mt76_connac definitions
b4ae1da1d1e0 mt76: mt7921: reduce log severity levels for informative messages
db105a722b87 mt76: mt7921s: make pm->suspended usage consistent
e2cc063238c0 mt76: mt7921s: fix suspend error with enlarging mcu timeout value
812b73f2f1e0 mt76: mt7915: introduce mt76_vif in mt7915_vif
b041a8a30055 mt76: mt7915: add mu-mimo and ofdma debugfs knobs
b851a3e7839d mt76: mt7921: remove dead definitions
266c7a9f2994 mt76: connac: rely on le16_add_cpu in mt76_connac_mcu_add_nested_tlv
19cc7d83190c mt76: mt7921: clear pm->suspended in mt7921_mac_reset_work
928c4550e413 mt76: mt7921s: make pm->suspended usage consistent [update]
8d6c68a7d0d1 mt76: mt7921: fix possible resume failure [update]
26fb105e538c mt76: mt7921s: fix cmd timeout in throughput test
9db482264389 mt76: mt7921: fix build regression
3edb87cdf138 mt7915: formatting change to sync with upstream
5cad38ba247d mt76: mt7915: add mt7915_mmio_probe() as a common probing function
15f9f88b362a mt76: mt7915: refine register definition
de49cf43ef34 mt76: add MT_RXQ_MAIN_WA for mt7916
6032c35f1306 mt76: mt7915: rework dma.c to adapt mt7916 changes
074d7c5381ed mt76: mt7915: add firmware support for mt7916
27b3253318e7 mt76: mt7915: rework eeprom.c to adapt mt7916 changes
030540246088 mt76: mt7915: enlarge wcid size to 544
400129c69f91 mt76: mt7915: add txfree event v3
cbbb3f65fcd0 mt76: mt7915: update rx rate reporting for mt7916
eb51c4deef0e mt76: mt7915: update mt7915_chan_mib_offs for mt7916
fb4709222028 mt76: mt7915: add mt7916 calibrated data support
e758feeaf1d6 mt76: mt7915: add device id for mt7916
115ea27a5cab mt76: connac: fix sta_rec_wtbl tag len
b3f922266685 mt76: mt7915: rely on mt76_connac_mcu_alloc_sta_req
bac5eda1f5b2 mt76: mt7915: rely on mt76_connac_mcu_alloc_wtbl_req
b44485d5c8ac mt76: mt7915: rely on mt76_connac_mcu_add_tlv routine
9cc58e254d53 mt76: connac: move mt76_connac_mcu_get_cipher in common code
60dcd9f09ff6 mt76: connac: move mt76_connac_chan_bw in common code
a8d0b7d0cc60 mt76: mt7915: rely on mt76_connac_get_phy utilities
4441db30c1c1 mt76: connac: move mt76_connac_mcu_add_key in connac module
794b6f18d0fb mt76: mt7915: fix code defect
9d2a01b6cb60 mt76: set wlan_idx_hi on mt7916
2c89977b32c2 mt76: mt7915: fix kernel build warning
6c4874839830 mt76: make mt76_sar_capa static
215fdcc7ca6c mt76: mt7915: use proper aid value in mt7915_mcu_wtbl_generic_tlv in sta mode
bc254718b40e mt76: mt7915: use proper aid value in mt7915_mcu_sta_basic_tlv
22fcff5ff21a mt76: sdio: lock sdio when it is needed
4669882aa595 mt76: mt7921s: clear MT76_STATE_MCU_RUNNING immediately after reset
944545855e0f mt76: mt7921s: update mt7921s_wfsys_reset sequence
854c8d076a34 mt76: mt7915: move pci specific code back to pci.c
a77da27796f2 mt76: mt7915: fix warning: variable 'base' is used uninitialized
7b5e69961c71 mt76: mt7915: fix warning: variable 'flags' set but not used
b5138e7b89f9 mt76: mt7921: fix a possible race enabling/disabling runtime-pm
af218fbe2500 linux-firmware: update firmware for MT7921 WiFi device
31c19c467950 mt76: mt7915: remove duplicated defs in mcu.h
9198eca1b16f mt76: connac: move mt76_connac_mcu_bss_omac_tlv in connac module
829d87a93a51 mt76: connac: move mt76_connac_mcu_bss_ext_tlv in connac module
50956cf17901 mt76: connac: move mt76_connac_mcu_bss_basic_tlv in connac module
bda40f4e1d5e mt76: mt7915: rely on mt76_connac_mcu_sta_ba_tlv
4728939c1d48 mt76: mt7915: rely on mt76_connac_mcu_wtbl_ba_tlv
e3ae1828068b mt76: mt7915: rely on mt76_connac_mcu_sta_ba
d9e9989eca07 mt76: mt7915: rely on mt76_connac_mcu_wtbl_generic_tlv
168713595fff mt76: mt7915: rely on mt76_connac_mcu_sta_basic_tlv
60394d3e3504 mt76: mt7915: rely on mt76_connac_mcu_sta_uapsd
3a79454d078d mt76: mt7915: rely on mt76_connac_mcu_wtbl_smps_tlv
9ae9aa6c1aea mt76: mt7915: rely on mt76_connac_mcu_wtbl_ht_tlv
fd8cdfab91e4 mt76: mt7915: rely on mt76_connac_mcu_wtbl_hdr_trans_tlv
a92024c5a5b5 mt76: connac: move mt76_connac_mcu_wtbl_update_hdr_trans in connac module
6dc585a3a274 mt76: connac: introduce is_connac_v1 utility routine
0f29d2aa5a72 mt76: connac: move mt76_connac_mcu_set_pm in connac module
dcf408ff8a5e mt76: mt7921: get rid of mt7921_mcu_get_eeprom
77b2a8601fc1 mt76: mt7915: rely on mt76_connac_mcu_start_firmware
65f78dee243a mt76: connac: move mt76_connac_mcu_restart in common module
5adf5b14040b mt76: mt7915: rely on mt76_connac_mcu_patch_sem_ctrl/mt76_connac_mcu_start_patch
69bf1dabe78f mt76: mt7915: rely on mt76_connac_mcu_init_download
951b1ddd370e mt76: connac: move mt76_connac_mcu_gen_dl_mode in mt76-connac module
0826b3992238 mt76: mt7915: rely on mt76_connac_mcu_set_rts_thresh
058de6d36fa9 mt76: connac: move mt76_connac_mcu_rdd_cmd in mt76-connac module
aafda86aed2b mt76: mt7921e: make dev->fw_assert usage consistent
def12bef91a3 mt76: mt7921: forbid the doze mode when coredump is in progress
009414d27d37 mt76: mt76_connac: fix MCU_CE_CMD_SET_ROC definition error
3c5856eca223 mt76: mt7921: set EDCA parameters with the MCU CE command
01a3d73b452e mt76: mt7615: fix a possible race enabling/disabling runtime-pm
123ed864d1ae mt76: mt7921e: process txfree and txstatus without allocating skbs
018f98abba68 mt76: connac: add support for passing the cipher field in bss_info
288e7443e35c mt76: mt7615: update bss_info with cipher after setting the group key
36e1577cb3d3 mt76: mt7915: update bss_info with cipher after setting the group key
d42590d8fcc8 mt76: make cipher in struct mt76_vif u8 instead of enum
11602b8505c6 mt76: mt7615e: process txfree and txstatus without allocating skbs
2ef775c10bd3 linux-firmware: add firmware for MT7916
976ea3879730 mt76: mt7915: add support for passing chip/firmware debug data to user space
d11bd7bd83f4 tools: add support for sending firmware debug data via udp
dc8e2e8dcd34 mt76: mt7921: do not always disable fw runtime-pm
7063127f852b mt76: mt7921: fix a leftover race in runtime-pm
f78f4334b0b2 mt76: mt7615: fix a leftover race in runtime-pm
f1f94d19c160 mt76: mt7915: fix ht mcs in mt7915_mac_add_txs_skb()
c2ff2f0d6d19 mt76: mt7921: fix ht mcs in mt7921_mac_add_txs_skb()
3e7954a0b32e mt76: mt7921s: fix mt7921s_mcu_[fw|drv]_pmctrl
3c2cc9034376 mt76: mt7921e: fix possible probe failure after reboot
f7f6c6dcc6eb mt76: mt7921: fix crash when startup fails.
8656198c925b mt76: sdio: disable interrupt in mt76s_sdio_irq
6204d61ab821 mt76: mt7921: fix endianness issues in mt7921_mcu_set_tx()
68c5aa56f5f2 mt76: mt7921: toggle runtime-pm adding a monitor vif
541e4e8d3c3e mt76: mt7915: set bssinfo/starec command when adding interface
78770f741af9 mt76: mt7915: introduce mt7915_set_radar_background routine
93c03778f92e mt76: mt7915: enable radar trigger on rdd2
4c76a6c3a1f2 mt76: mt7915: introduce rdd_monitor debugfs node
5b94045f927e mt76: mt7915: report radar pattern if detected by rdd2
22094b27ff6a mt76: mt7915: enable radar background detection
4282ca57a143 mt76: connac: move mt76_connac_lmac_mapping in mt76-connac module
0f16c67657a2 mt76: mt7915: add missing DATA4_TB_SPTL_REUSE1 to mt7915_mac_decode_he_radiotap
9a16d33311a7 mt76: mt7921: remove duplicated code in mt7921_mac_decode_he_radiotap
639b55fdc95e mt76: mt7615: add support for LG LGSBWAC02 (MT7663BUN)
ebbd2717a16e mt76: mt7663s: flush runtime-pm queue after waking up the device
37c3bf2256de mt76: mt7603: check sta_rates pointer in mt7603_sta_rate_tbl_update
96959bd15eef mt76: mt7615: check sta_rates pointer in mt7615_sta_rate_tbl_update
4e42e55ce636 mt76: stop the radar detector after leaving dfs channel
8b32439d5a86 mt76: mt7915: fix possible memory leak in mt7915_mcu_add_sta
b4e6f0d6f15a mt76: mt7921s: fix a possible memory leak in mt7921_load_patch
15398f1e8385 mt76: mt7915: fix mcs_map in mt7915_mcu_set_sta_he_mcs()
607eda6eb032 mt76: mt7915: update max_mpdu_size in mt7915_mcu_sta_amsdu_tlv()
69d20f2e6cb0 mt76: mt7915: fix the nss setting in bitrates
c3ffa536249a mt76: sdio: honor the largest Tx buffer the hardware can support
e3e3562f8fa0 mt76: mt7921s: run sleep mode by default
553200cf63fd firmware: update mt7662 firmware to version 2.3
20d1fed838b9 mt76x02: improve mac error check/reset reliability
9b2ac62d6f31 mt76: mt76x02: improve tx hang detection
fae295af31eb mt76: mt7915: fix/rewrite the dfs state handling logic
e0f9479bf893 mt76: mt7615: fix/rewrite the dfs state handling logic
822e1135e7e1 mt76: mt76x02: use mt76_phy_dfs_state to determine radar detector state
f8c0ed1e6bdf mt76: do not always copy ethhdr in reverse_frag0_hdr_trans
ab9b8078427a mt76: dma: initialize skip_unmap in mt76_dma_rx_fill

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agomac80211: backport support for background radar detection
Felix Fietkau [Fri, 28 Jan 2022 13:32:21 +0000 (14:32 +0100)]
mac80211: backport support for background radar detection

Will be used in an upcoming mt76 update

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agomac80211: backport MBSSID/EMA support patches
Felix Fietkau [Fri, 28 Jan 2022 13:13:58 +0000 (14:13 +0100)]
mac80211: backport MBSSID/EMA support patches

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agomac80211: reorganize patches
Felix Fietkau [Fri, 28 Jan 2022 12:51:22 +0000 (13:51 +0100)]
mac80211: reorganize patches

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agomac80211: backport support for ndo_fill_forward_path
Felix Fietkau [Tue, 30 Nov 2021 10:55:46 +0000 (11:55 +0100)]
mac80211: backport support for ndo_fill_forward_path

Will be used in an upcoming mt76 update

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoiptables: add ip{,6}tables-legacy{,-restore,-save} symlinks
Etienne Champetier [Wed, 26 Jan 2022 19:23:23 +0000 (14:23 -0500)]
iptables: add ip{,6}tables-legacy{,-restore,-save} symlinks

Now that we can have both legacy and nft iptables variants
installed at the same time, install the legacy symlinks

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2 years agoiptables: use ALTERNATIVES for ip(6)tables(-nft)
Etienne Champetier [Wed, 26 Jan 2022 22:09:44 +0000 (17:09 -0500)]
iptables: use ALTERNATIVES for ip(6)tables(-nft)

As nftables is now the default, ip(6)tables-nft gets higher priority

The removed symlinks ("$(CP)" line) will now be installed by the
ALTERNATIVES mechanism

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>