openwrt/staging/chunkeey.git
22 months agoipq40xx: dynamically build board-2.bin for 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>
22 months agoipq40xx: RT-AC58U: Try ARTIFACTS for install.trx
Christian Lamparter [Sat, 8 Jan 2022 18:29:13 +0000 (19:29 +0100)]
ipq40xx: RT-AC58U: Try ARTIFACTS for install.trx

Previous attempts of generating an "IMAGES" based approaches
to provide a ready-to-go image that can be flashed through
the vendor firmware's WEB-UI or via the bootloader Option 1
in order to perform a serial-console-less installation all
had the downsides. Either they rendered the INITRAMFS unusable
for the bootloader option 2, or broke the IMAGEBUILDER.

This hopefully does neither. The IMAGE_SIZE was changed to
account for the added 64 Byte U-Boot header.

WARNING: Hmm, this could/did break if the initramfs isn't available...
(But let's not forget it again that this is dangerous)

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
22 months agobase-files: leds: do reverse lookup in get_dt_led()
Christian Lamparter [Wed, 20 Oct 2021 22:35:29 +0000 (00:35 +0200)]
base-files: leds: do reverse lookup in get_dt_led()

In order to match the "label"-less DT properties we have to get
creative. In theory the dt-node should have everything (i.e.:
color, function and function-enumerator) to make the device-name
in /sys/class/leds. But thanks to color being a binary value
and not a "string", we would have to maintain a lookup table that
keeps in sync with the dt-binding.

It's much easier to use the "uevent" property of every led-class
device and do reverse lookup with it by comparing the OF_FULLNAME
with the alias pathname.

(This works with gpio-leds ... let's see where it breaks)

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
22 months agoath79: add Cisco Meraki MR18
Christian Lamparter [Fri, 30 Jul 2021 15:59:25 +0000 (17:59 +0200)]
ath79: add Cisco Meraki MR18

Specifications:

SOC:    Atheros/Qualcomm QCA9557-AT4A @ 720MHz
RAM:    2x Winbond W9751G6KB-25 (128 MiB)
FLASH:  Hynix H27U1G8F2BTR-BC TSOP48 ONFI NAND (128 MiB)
WIFI1:  Atheros AR9550 5.0GHz (SoC)
WIFI2:  Atheros AR9582-AR1A 2.4GHz
WIFI2:  Atheros AR9582-AR1A 2.4GHz + 5GHz
PHYETH: Atheros AR8035-A, 802.3af PoE capable Atheros (1x Gigabit LAN)
LED:    1x Power-LED, 1 x RGB Tricolor-LED
INPUT:  One Reset Button
UART:   JP1 on PCB (Labeled UART), 3.3v-Level, 115200n8
        (VCC, RX, TX, GND - VCC is closest to the boot set jumper
 under the console pins.)

Flashing instructions:

Depending on the installed firmware, there fastly different methods
to flash a MR18. These have been documented on:
<https://openwrt.org/toh/meraki/mr18>

Note: upgrades from AR71XX are possible, but require the force
sysupgrade option.

The LEDs has changed since AR71XX. The white LED is now used during
the boot and when upgrading instead of the green tricolor LED.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
22 months agoath79: add Cisco Meraki Z1
Christian Lamparter [Wed, 23 Jun 2021 20:46:52 +0000 (22:46 +0200)]
ath79: add Cisco Meraki Z1

Specifications:

SOC: Atheros AR9344 @ 560MHz
RAM: 2x Winbond W9751G6KB-25 (128 MiB)
FLASH: Hynix H27U1G8F2BTR (128 MiB)
WIFI1: Atheros AR9340 5.0GHz (SoC)
WIFI2: Atheros AR9280 2.4GHz
SWITCH: Atheros AR8236 (5x Gigabit (1x WAN, 4x LAN)
LED: 1x Power-LED, 1 x RGB Tricolor-LED
INPUT: One Reset Button
USB: One USB 2.0 Port
UART: JP1 on PCB (Labeled UART), 3.3v-Level, 115200n8
        (GND, TX, RX, VCC - GND is next to the UART silk screen)

Flashing Instructions:

Since this device is brought over from an old AR71xx, there's
already a wiki-page with detailed instructions:
<https://openwrt.org/toh/meraki/z1>

The gist:
1. Get a root-shell on the device (see wiki). (needs UART access)
2. make a backup (to a PC/safe location) of the existing Meraki
   firmware.
3. copy over the OpenWrt initramfs kernel for the Z1.
   This gets written into the kernel NAND partition.
   (Verify that written image is complete!)

After the following reboot and successfull boot of the staging
OpenWrt initramfs image:

4. copy over the sysupgrade.bin for the router and use sysupgrade
   to make the installation permanent.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
22 months agoath79: ar934x: still advertise subpage on soft ecc
Christian Lamparter [Sat, 31 Jul 2021 01:33:03 +0000 (03:33 +0200)]
ath79: ar934x: still advertise subpage on soft ecc

This sort of reverts Koen Vandeputte's commit
6561ca1fa51 ("ath79: ar934x: fix mounting issues if subpage is not supported")

since it does not work on the MR18 as the UBI is coming from
Meraki in that way and it used to work with AR71XX before.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
22 months agoath79: nand: enable software BCH support
Christian Lamparter [Sat, 31 Jul 2021 21:16:05 +0000 (23:16 +0200)]
ath79: nand: enable software BCH support

This is necessary to support the Meraki MR18 and likely Z1
as well.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
22 months agoapm821xx: disable Netgear WNDR4700
Christian Lamparter [Tue, 11 Aug 2020 17:14:48 +0000 (19:14 +0200)]
apm821xx: disable Netgear WNDR4700

This patch disables the Netgear WNDR4700 image, because as it turns
out that neither gzipped nor xz'd zImages would work. The reason for
the crash is that there are sevaral problems with Netgear's "bootcmd":

> if loadn_dniimg 0 0x180000 0x4e0000 && chk_dniimg 0x4e0000; then nand read 0x800000 0x180000 0x20000;bootm 0x500000 - 0x800040;else fw_recovery; fi"

This loads the dni-image starting offset 0x180000 from the NAND
flash (which is the DTB partition) to 0x4e0000 in the RAM. It then
checks whenever the provided image is "valid". If it is then it
reads the DTB again to 0x800000 in the RAM and starts the extraction
and boot process. (If the image wasn't valid then it starts the
automated firmware recovery).

The issues here are that first: the kernel image gets "squeezed"
between 0x500040 and 0x7fffff... And second, the decompressor
only has area 0x0 - 0x500000 for decompression.

Hence it would be much easier to "fix" the bootcmd by providing
new values (which have been successfully tested with the original
Netgear WNDR4700 v1.0.0.56 firmware) for the RAM locations and
make full use of the fact that loadn_dniimg loads the DTB as well.

This needs to be done only once. Just connect a serial adapter to
interface with uboot and overwrite (and save) the new bootcmd.

WARNING: The serial port needs a TTL/RS-232 3.3v level converter!

Steps:
 0. Power-off the WNDR4700
 1. Connect the serial interface (you need to open the WNDR4700)
 2. Power-up the WNDR4700
 3. Monitor the boot-sequence and hit "Enter"-key when it says:

  "Hit any key to stop autoboot" (Be quick, you have a ~2 second window)

 4. in the Prompt enter the following commands (copy & paste)

 setenv bootcmd "if loadn_dniimg 0 0x180000 0xae0000 && chk_dniimg 0xae0000; then bootm 0xb00000 - 0xae0040;else fw_recovery; fi"
 saveenv
 run bootcmd

Note: This new bootcmd will also unbrick devices that were bricked
by the bigger 4.19/5.4 kernels recently before the buildbot was
instructed to skip it.

Note2: This method was tested with a WNDR4700. A big kernel with most
debug features enabled on v5.4.52 measured 3.10 MiB when compressed
with lzma. The uncompressed kernel is 9.83 MiB. This is over the 3 MiB,
the device reserves for the kernel... But it booted! For bigger kernels,
the device needs repartitioning of the the ubi partition due to the
kernel+dtb not fitting into the partition.

Note3: For initramfs development. I would advice to load the initramfs
images to 0x800000 (or higher). i.e.: tftp 800000 wndr4700.bin

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
22 months agolldpd: always depend on libbsd
Guilherme Janczak [Mon, 9 May 2022 13:10:25 +0000 (13:10 +0000)]
lldpd: always depend on libbsd

lldpd calls setproctitle() and strtonum(); its configure.ac script has
fallbacks for when they're not found, but they should come from libbsd
instead.

Signed-off-by: Guilherme Janczak <guilherme.janczak@yandex.com>
22 months agoipq40xx: add support for Linksys WHW01 v1
Peter Adkins [Wed, 9 Jun 2021 20:35:46 +0000 (21:35 +0100)]
ipq40xx: add support for Linksys WHW01 v1

This patch adds support for Linksys WHW01 v1 ("Velop") [FCC ID Q87-03331].

Specification
-------------

SOC:             Qualcomm IPQ4018
WiFi 1:          Qualcomm QCA4019 IEEE 802.11b/g/n
WiFi 2:          Qualcomm QCA4019 IEEE 802.11a/n/ac
Bluetooth:       Qualcomm CSR8811 (A12U)
Ethernet:        Qualcomm QCA8072 (2-port)
SPI Flash 1:     Mactronix MX25L1605D (2MB)
SPI Flash 2:     Winbond W25M02GV (256MB)
DRAM:            Nanya NT5CC128M16IP-DI (256MB)
LED Controller:  NXP PCA963x (I2C)
Buttons:         Single reset button (GPIO).

Notes
-----

There does not appear to be a way to trigger TFTP recovery without entering
U-Boot. The device must be opened to access the serial console in order to
first flash OpenWrt onto a device from factory.

The device has automatic recovery backed by a second set of partitions on
the larger of the two SPI flash ICs. Both the primary and secondary must
be flashed to prevent accidental rollback to "factory" after 3 failed boot
attempts.

Serial console
--------------

A serial console is available on the following pins of the populated J2
connector on the device mainboard (115200 8n1).

(<-- Top of PCB / Device)

  J2
  [o o o o o o]
       |   | |
       |   |  `-- GND
       |    `---- TX
       `--------- RX

Installation instructions
-------------------------

1. Setup TFTP server with server IP set to 192.168.1.236.
2. Copy compiled `...squashfs-factory.bin` to `nodes-jr.img` in tftp root.
3. Connect to console using pinout detailed in the serial console section.
4. Power on device and press enter when prompted to drop into U-Boot.
5. Flash first partition device via `run flashimg`.
6. Once complete, reset device and allow to power up completely.
7. Once comfortable with device upgrade reboot and drop back into U-Boot.
8. Flash the second partition (recovery) via `run flashimg2`.

Revert to "factory"
-------------------

1. Download latest firmware update from vendor support site.
2. Copy extracted `.img` file to `nodes-jr.img` in tftp root.
3. Connect to console using pinout detailed in the serial console section.
4. Power on device and press enter when prompted to drop into U-Boot.
5. Flash first partition device via `run flashimg`.
6. Once complete, reset device and allow to power up completely.
7. Once comfortable with device upgrade reboot and drop back into U-Boot.
8. Flash the second partition (recovery) via `run flashimg2`.

Signed-off-by: Peter Adkins <peter@sunkenlab.com>
(calibration from nvmem, updated to 5.10+5.15)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
22 months agoipq40xx: mikrotik: dont include ath10k-board-qca4019 by default
Robert Marko [Sat, 14 May 2022 18:30:44 +0000 (20:30 +0200)]
ipq40xx: mikrotik: dont include ath10k-board-qca4019 by default

Since MikroTik subtarget now uses dynamic BDF loading its crucial that it
doesnt include the board-2.bin at all which is provided by the
ath10k-board-qca4019 package.

So to resolve this dont include the ath10k-board-qca4019 package on the
MikroTik subtarget.

Signed-off-by: Robert Marko <robimarko@gmail.com>
22 months agoipq-wifi: remove packaged BDF-s for MikroTik devices
Robert Marko [Tue, 30 Nov 2021 09:25:52 +0000 (10:25 +0100)]
ipq-wifi: remove packaged BDF-s for MikroTik devices

Since we now provide the BDF-s for MikroTik IPQ40xx devices on the fly,
there is noneed to include package and ship them like we do now.

This also resolves the performance issues that happen as MikroTik
changes the boards and ships them under the same revision but they
actually ship with and require a different BDF.

Signed-off-by: Robert Marko <robimarko@gmail.com>
22 months agoipq40xx: mikrotik: provide BDF-s on demand
Robert Marko [Tue, 30 Nov 2021 09:27:50 +0000 (10:27 +0100)]
ipq40xx: mikrotik: provide BDF-s on demand

Since we now can pass the API 1 BDF-s aka board.bin to the ath10k
driver per radio lets use that to provide the BDF-s for MikroTik devices.

This also resolves the performance issues that happen as MikroTik changes
the boards and ships them under the same revision but they actually ship
with and require a different BDF.

Signed-off-by: Robert Marko <robimarko@gmail.com>
22 months agomac80211: ath10k: backport bus and device specific API 1 BDF selection
Robert Marko [Tue, 30 Nov 2021 09:37:41 +0000 (10:37 +0100)]
mac80211: ath10k: backport bus and device specific API 1 BDF selection

Some ath10k IPQ40xx devices like the MikroTik hAP ac2 and ac3 require the
BDF-s to be extracted from the device storage instead of shipping packaged
API 2 BDF-s.

This is required as MikroTik has started shipping boards that require BDF-s
to be updated, as otherwise their WLAN performance really suffers.
This is however impossible as the devices that require this are release under
the same revision and its not possible to differentiate them from devices
using the older BDF-s.

In OpenWrt we are extracting the calibration data during runtime and we are
able to extract the BDF-s in the same manner, however we cannot package the
BDF-s to API 2 format on the fly and can only use API 1 to provide BDF-s on
the fly.
This is an issue as the ath10k driver explicitly looks only for the board.bin
file and not for something like board-bus-device.bin like it does for pre-cal
data.
Due to this we have no way of providing correct BDF-s on the fly, so lets
extend the ath10k driver to first look for BDF-s in the board-bus-device.bin
format, for example: board-ahb-a800000.wifi.bin
If that fails, look for the default board file name as defined previously.

So, backport the upstream ath10k patch.

Signed-off-by: Robert Marko <robimarko@gmail.com>
22 months agoath10k-ct: update to 2022-05-13
Robert Marko [Sat, 14 May 2022 18:14:14 +0000 (20:14 +0200)]
ath10k-ct: update to 2022-05-13

Update ath10k-ct to the latest version which includes the backported
ath10k commit for requesting API 1 BDF-s with a unique name like caldata.

Signed-off-by: Robert Marko <robimarko@gmail.com>
22 months agotools/elfutils: drop HOST_BUILD_DEPENDS
Stijn Tintel [Wed, 18 May 2022 23:28:42 +0000 (02:28 +0300)]
tools/elfutils: drop HOST_BUILD_DEPENDS

This is only effective for host build of normal packages, not tools.

Fixes: ad79b9271949 ("elfutils: move host build to tools")
Reported-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
22 months agotools/elfutils: only build required components
Stijn Tintel [Wed, 18 May 2022 22:53:49 +0000 (01:53 +0300)]
tools/elfutils: only build required components

Building all of the components results in strip being installed in
staging_dir/host/bin. This strip binary will take precedence over
binutils strip that is installed in the toolchain directory.

This will not work on host systems that do not have libdw installed, as
we do not set HOST_LDFLAGS to override rpath to staging_dir/host/lib.
However, rather than overriding rpath, we should just avoid using
elfutils strip entirely.

Override the SUBDIRS variable in the Makefile to only build and install
the libraries we require for dwarves and frr.

Fixes the following build failure in toolchain/gdb:
strip: error while loading shared libraries: libdw.so.1: cannot open shared object file: No such file or directory

Fixes: ad79b9271949 ("elfutils: move host build to tools")
Reported-by: Dominick Grift <dominick.grift@defensec.nl>
Reported-by: Lucian Cristian <lucian.cristian@gmail.com>
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
22 months agotools/elfutils: depend on m4
Stijn Tintel [Wed, 18 May 2022 13:15:09 +0000 (16:15 +0300)]
tools/elfutils: depend on m4

Some buildbots fail to build elfutils due to m4 being missing. Add m4 as
a dependency for elfutils to fix this.

Fixes: ad79b9271949 ("elfutils: move host build to tools")
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
22 months agokernel: add KERNEL_BPF_EVENTS config option
Stijn Tintel [Sun, 20 Feb 2022 01:32:23 +0000 (03:32 +0200)]
kernel: add KERNEL_BPF_EVENTS config option

This is required to use BPF maps of type BPF_MAP_TYPE_PERF_EVENT_ARRAY
for sending data from BPF programs to user-space for post-processing
or logging.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
22 months agoconfig: limit CONFIG_DEBUG_INFO to top-level generic configs
Tony Ambardar [Sun, 20 Sep 2020 12:30:30 +0000 (05:30 -0700)]
config: limit CONFIG_DEBUG_INFO to top-level generic configs

Remove redundant target-level entries, noting that these settings will be
configured from "Kernel build options" of Kconfig.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
[remove from new configs introduced after patch submission]
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
22 months agobuild: add option KERNEL_DEBUG_INFO_BTF
Tony Ambardar [Sun, 26 Jul 2020 14:51:34 +0000 (07:51 -0700)]
build: add option KERNEL_DEBUG_INFO_BTF

Generate BTF (BPF Type Format) information from DWARF debug info. This is
embedded in the kernel and exported via sysfs as /sys/kernel/btf/vmlinux.
BTF data enhances kernel portability and introspection for BPF programs.

Selecting this also enables the dwarves host package which provides the
pahole tool used for BTF encoding.

Test using: "bpftool btf dump file /sys/kernel/btf/vmlinux format c"

This needs to depend on KERNEL_DEBUG_INFO_REDUCED not being set,
otherwise we can enable both KERNEL_DEBUG_INFO_BTF and
KERNEL_DEBUG_INFO_REDUCED, which will result in undefined behaviour.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
[split DEBUG_INFO_REDUCED into separate commit, add dependency]
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
22 months agokernel: add DEBUG_INFO_REDUCED config option
Stijn Tintel [Sun, 20 Feb 2022 01:09:55 +0000 (03:09 +0200)]
kernel: add DEBUG_INFO_REDUCED config option

Add DEBUG_INFO_REDUCED as a kernel config option and remove it from the
kernel configs. This is in preparation of the upcoming option to enable
BTF typeinfo, which is incompatible with DEBUG_INFO_REDUCED.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
22 months agolayerscape/armv8_64b: enable DEBUG_INFO_REDUCED
Stijn Tintel [Fri, 25 Feb 2022 12:09:20 +0000 (14:09 +0200)]
layerscape/armv8_64b: enable DEBUG_INFO_REDUCED

We currently enable DEBUG_INFO_REDUCED for all targets via the generic
kernel config. There is only one subtarget, layerscape/armv8_64b, that
overrides this setting. As there is no explanation for this in the
commit message that introduced this, and question to its author went
unanswered, let's simply drop this symbol from the subtarget config.
This way, we have consistency across the tree, and we do not have to
introduce a special case when moving this symbol to an OpenWrt kernel
config option.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
22 months agokernel: backport build fix for tools/resolve_btfids
Stijn Tintel [Tue, 29 Mar 2022 11:27:47 +0000 (14:27 +0300)]
kernel: backport build fix for tools/resolve_btfids

Building tools/resolve_btfids requires libelf and zlib. Without this
build fix, the kernel build system will not find these dependencies.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
22 months agotools/dwarves: add host package
Tony Ambardar [Tue, 24 Nov 2020 22:15:09 +0000 (14:15 -0800)]
tools/dwarves: add host package

dwarves is a set of tools that use the debugging information inserted in
ELF binaries by compilers such as GCC. Utilities in the dwarves suite
include pahole, which can be used to find alignment holes in structs and
classes, and also extracts other information such as CPU cacheline
alignment, helping pack those structures to achieve more cache hits.

These tools are also used to encode and read the BTF type information
format used with the bpf syscall, making this a Linux build dependency
when using kernel BTF information.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
[bump to 1.23, add elfutils dep, drop host lib usage, drop cmake release
target, use RM macro]
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
22 months agobuild: use KBUILD_HOSTLDFLAGS
Stijn Tintel [Tue, 29 Mar 2022 13:32:25 +0000 (16:32 +0300)]
build: use KBUILD_HOSTLDFLAGS

According to the GNU make manual, specifying library paths should be
done in LDFLAGS rather than LDLIBS. Replace KBUILD_HOSTLDLIBS with
KBUILD_HOSTLDFLAGS to pass the host lib directory.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
22 months agobuild: drop HOST_LOADLIBES
Stijn Tintel [Tue, 29 Mar 2022 13:28:21 +0000 (16:28 +0300)]
build: drop HOST_LOADLIBES

HOST_LOADLIBES was renamed to KBUILD_HOSTLDLIBS in kernel 4.19. As the
oldest kernel version we support is 5.10, cleanup HOST_LOADLIBES use.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
22 months agobpf-headers: drop HOST_LOADLIBES
Stijn Tintel [Tue, 29 Mar 2022 13:30:31 +0000 (16:30 +0300)]
bpf-headers: drop HOST_LOADLIBES

HOST_LOADLIBES was renamed to KBUILD_HOSTLDLIBS in kernel 4.19. As the
oldest kernel version we support is 5.10, cleanup HOST_LOADLIBES use.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
22 months agoelfutils: move host build to tools
Stijn Tintel [Mon, 28 Mar 2022 15:40:30 +0000 (18:40 +0300)]
elfutils: move host build to tools

The upcoming dwarves host package requires elfutils. As dependencies for
tools must exist in tools, we need to move elfutils host build there.

As there is at least one package that depends on this, and there is no
proper way to create such dependency in the build system, build it
unconditionally when not building on macOS.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
22 months agokernel: add missing dependency to KERNEL_RPI_AXIPERF
Stijn Tintel [Wed, 18 May 2022 10:31:05 +0000 (13:31 +0300)]
kernel: add missing dependency to KERNEL_RPI_AXIPERF

This symbol is added by the bcm27xx target patches so it should depend
on that target.

Fixes: efd9463dcfe2 ("kernel: add missing symbol for bcm27xx")
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
23 months agokernel: add missing symbol for bcm27xx
Stijn Tintel [Tue, 17 May 2022 17:50:31 +0000 (20:50 +0300)]
kernel: add missing symbol for bcm27xx

When KERNEL_PERF_EVENTS is enabled in OpenWrt, the RPI_AXIPERF symbol is
exposed. Add a build option for it to fix build failures with
KERNEL_PERF_EVENTS enabled.

Fixes: 20ea6adbf199 ("bcm27xx: add support for linux v5.15")
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
23 months agobcm27xx: add CPU_FREQ_GOV_SCHEDUTIL
John Audia [Tue, 17 May 2022 13:31:59 +0000 (15:31 +0200)]
bcm27xx: add CPU_FREQ_GOV_SCHEDUTIL

This is enabled upstream for bcm2709, bcm2710 and bcm2711.
https://github.com/raspberrypi/linux/blob/dff79e31c3b05a50f725442c1fc19a6194491523/arch/arm/configs/bcm2709_defconfig#L51
https://github.com/raspberrypi/linux/blob/dff79e31c3b05a50f725442c1fc19a6194491523/arch/arm/configs/bcm2711_defconfig#L51

Signed-off-by: John Audia <graysky@archlinux.us>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
23 months agobcm27xx: remove linux 5.10 configs
Álvaro Fernández Rojas [Tue, 17 May 2022 13:22:13 +0000 (15:22 +0200)]
bcm27xx: remove linux 5.10 configs

Sorry, I missed these when removing linux v5.10 support...

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
23 months agobcm27xx: remove linux 5.10 compatibility
Álvaro Fernández Rojas [Tue, 17 May 2022 13:02:39 +0000 (15:02 +0200)]
bcm27xx: remove linux 5.10 compatibility

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
23 months agobcm27xx: switch to 5.15
Álvaro Fernández Rojas [Tue, 17 May 2022 13:01:26 +0000 (15:01 +0200)]
bcm27xx: switch to 5.15

I tested it locally and I couldn't find any regressions, so let's give this a
wider test :).

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
23 months agobcm27xx: add support for linux v5.15
Álvaro Fernández Rojas [Mon, 16 May 2022 21:40:32 +0000 (23:40 +0200)]
bcm27xx: add support for linux v5.15

Build system: x86_64
Build-tested: bcm2708, bcm2709, bcm2710, bcm2711
Run-tested: bcm2708/RPiB+, bcm2709/RPi3B, bcm2710/RPi3B, bcm2711/RPi4B

Signed-off-by: Marty Jones <mj8263788@gmail.com>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
23 months agobcm27xx-gpu-fw: update to latest version
Álvaro Fernández Rojas [Tue, 17 May 2022 12:20:02 +0000 (14:20 +0200)]
bcm27xx-gpu-fw: update to latest version

Latest GPU FW contains multiple fixes and improvements.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
23 months agobcm27xx-userland: update to latest version
Álvaro Fernández Rojas [Tue, 17 May 2022 12:56:28 +0000 (14:56 +0200)]
bcm27xx-userland: update to latest version

The latest version contains some fixes and additions.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
23 months agokernel: Add missing devm_regulator_get_exclusive()
Hauke Mehrtens [Mon, 16 May 2022 22:57:04 +0000 (00:57 +0200)]
kernel: Add missing devm_regulator_get_exclusive()

This backports a patch from Linux 5.10.116 to fix a compile problem
introduced in 5.10.114.

drivers/usb/phy/phy-generic.c could not find
devm_regulator_get_exclusive().

Fixes: 8592df67f40b ("kernel: bump 5.10 to 5.10.114")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
23 months agokernel: bump 5.15 to 5.15.40
John Audia [Sun, 15 May 2022 21:33:44 +0000 (17:33 -0400)]
kernel: bump 5.15 to 5.15.40

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>
23 months agokernel: bump 5.15 to 5.15.39
John Audia [Thu, 12 May 2022 12:32:29 +0000 (08:32 -0400)]
kernel: bump 5.15 to 5.15.39

Removed upstreamed:
  backport-5.15/850-v5.17-0001-PCI-pci-bridge-emul-Add-description-for-class_revisi.patch
  backport-5.15/850-v5.17-0002-PCI-pci-bridge-emul-Add-definitions-for-missing-capa.patch
  backport-5.15/850-v5.17-0003-PCI-aardvark-Add-support-for-DEVCAP2-DEVCTL2-LNKCAP2.patch
  backport-5.15/850-v5.17-0004-PCI-aardvark-Clear-all-MSIs-at-setup.patch
  backport-5.15/850-v5.17-0005-PCI-aardvark-Comment-actions-in-driver-remove-method.patch
  backport-5.15/850-v5.17-0006-PCI-aardvark-Disable-bus-mastering-when-unbinding-dr.patch
  backport-5.15/850-v5.17-0007-PCI-aardvark-Mask-all-interrupts-when-unbinding-driv.patch
  backport-5.15/850-v5.17-0008-PCI-aardvark-Fix-memory-leak-in-driver-unbind.patch
  backport-5.15/850-v5.17-0009-PCI-aardvark-Assert-PERST-when-unbinding-driver.patch
  backport-5.15/850-v5.17-0010-PCI-aardvark-Disable-link-training-when-unbinding-dr.patch
  backport-5.15/850-v5.17-0011-PCI-aardvark-Disable-common-PHY-when-unbinding-drive.patch
  pending-5.15/850-0001-PCI-aardvark-Replace-custom-PCIE_CORE_INT_-macros-wi.patch
  pending-5.15/850-0004-PCI-aardvark-Rewrite-IRQ-code-to-chained-IRQ-handler.patch
  pending-5.15/850-0005-PCI-aardvark-Check-return-value-of-generic_handle_do.patch
  pending-5.15/850-0006-PCI-aardvark-Make-MSI-irq_chip-structures-static-dri.patch
  pending-5.15/850-0007-PCI-aardvark-Make-msi_domain_info-structure-a-static.patch
  pending-5.15/850-0008-PCI-aardvark-Use-dev_fwnode-instead-of-of_node_to_fw.patch
  pending-5.15/850-0009-PCI-aardvark-Refactor-unmasking-summary-MSI-interrup.patch
  pending-5.15/850-0010-PCI-aardvark-Add-support-for-masking-MSI-interrupts.patch
  pending-5.15/850-0011-PCI-aardvark-Fix-setting-MSI-address.patc
  pending-5.15/850-0012-PCI-aardvark-Enable-MSI-X-support.patch
  pending-5.15/850-0013-PCI-aardvark-Add-support-for-ERR-interrupt-on-emulat.patch
  pending-5.15/850-0015-PCI-aardvark-Optimize-writing-PCI_EXP_RTCTL_PMEIE-an.patch
  pending-5.15/850-0016-PCI-aardvark-Add-support-for-PME-interrupts.patch
  pending-5.15/850-0017-PCI-aardvark-Fix-support-for-PME-requester-on-emulat.patch
  pending-5.15/850-0018-PCI-aardvark-Use-separate-INTA-interrupt-for-emulate.patch
  pending-5.15/850-0019-PCI-aardvark-Remove-irq_mask_ack-callback-for-INTx-i.patch
  pending-5.15/850-0020-PCI-aardvark-Don-t-mask-irq-when-mapping.patch
  pending-5.15/850-0021-PCI-aardvark-Drop-__maybe_unused-from-advk_pcie_disa.patch
  pending-5.15/850-0022-PCI-aardvark-Update-comment-about-link-going-down-af.patch

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>
23 months agokernel: bump 5.10 to 5.10.115
John Audia [Thu, 12 May 2022 17:04:51 +0000 (13:04 -0400)]
kernel: bump 5.10 to 5.10.115

Removed upstreamed:
  backport-5.10/850-v5.17-0004-PCI-aardvark-Clear-all-MSIs-at-setup.patch
  pending-5.10/850-0002-PCI-aardvark-Fix-reading-MSI-interrupt-number.patch

All other patches automatically rebased.

Build system: x86_64
Build-tested: bcm2711/RPi4B

Signed-off-by: John Audia <therealgraysky@proton.me>
23 months agokernel: bump 5.10 to 5.10.114
John Audia [Mon, 9 May 2022 08:07:21 +0000 (04:07 -0400)]
kernel: bump 5.10 to 5.10.114

All patches automatically rebased.

Build system: x86_64
Build-tested: bcm2711/RPi4B
Run-tested: bcm2711/RPi4B

Signed-off-by: John Audia <therealgraysky@proton.me>
23 months agoramips: Add support for SERCOMM NA502S
Andreas Böhler [Mon, 22 Mar 2021 00:01:44 +0000 (01:01 +0100)]
ramips: Add support for SERCOMM NA502S

The SERCOMM NA502s is a smart home gateway manufactured by SERCOMM and sold
under different brands (among others, A1 Telekom Austria SmartHome Premium
Gateway). It has multi-protocol radio support in addition to LAN and WiFi.

Note: BLE and audio are currently unsupported.

Specifications
--------------

  - MT7621ST 880MHz, Single-Core, Dual-Thread
  - MT7603EN 2.4GHz WiFi
  - MT7662EN 5GHz WiFi + BLE
  - 128MiB NAND
  - 256MiB DDR3 RAM
  - SD3503 ZWave Controller
  - EM357 Zigbee Coordinator
  - Telit UMTS module
  - Rechargeable battery
  - speaker and microphone

MAC address assignment
----------------------

LAN MAC is read from the config partition, WiFi 2.4GHz is LAN+2 and matches
the OEM firmware. WiFi 5GHz with LAN+1 is an educated guess since the
OEM firmware does not enable 5GHz WiFi.

Installation
------------
Attach serial console, then boot the initramfs image via TFTP.
Once inside OpenWrt, run sysupgrade -n with the sysupgrade file.

Attention: The device has a dual-firmware design. We overwrite kernel2,
since kernel1 contains an automatic recovery image.

If you get NAND ECC errors and are stuck with bad eraseblocks, try to
erase the mtd partition first with

mtd unlock ubi
mtd erase ubi

This should only be needed once.

Signed-off-by: Andreas Böhler <dev@aboehler.at>
23 months agoramips: add led_source for Asus RT-AC1200 devices
Tamas Balogh [Sun, 1 May 2022 07:45:19 +0000 (09:45 +0200)]
ramips: add led_source for Asus RT-AC1200 devices

this adds the mediatek,led_source dts binding for
Asus RT-AC1200 devices' dtsi, for correct switch LED
behavior.

The dts-binding is introduced in commit:
65dc9e0980255b15402c45b840f239b85be59b3d

Without this, we only have constantly very fast
blinking LEDs, which don't react on any traffic or
LAN events at all.

Signed-off-by: Tamas Balogh <tamasbalogh@hotmail.com>
23 months agowolfssl: bump to v5.3.0-stable
Eneas U de Queiroz [Tue, 10 May 2022 19:39:11 +0000 (16:39 -0300)]
wolfssl: bump to v5.3.0-stable

This is mostly a bug fix release, including two that were already
patched here:
- 300-fix-SSL_get_verify_result-regression.patch
- 400-wolfcrypt-src-port-devcrypto-devcrypto_aes.c-remove-.patch

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
23 months agoIPQ4019: AVM FRITZ!Box 7530: Remove NAND ECC restrictions from DTS
Andreas Böhler [Sun, 15 May 2022 08:50:31 +0000 (10:50 +0200)]
IPQ4019: AVM FRITZ!Box 7530: Remove NAND ECC restrictions from DTS

Some revisions of the FRITZ!7530 use a Toshiba NAND with 8 bit ECC in
contrast to the Macronix NAND with 4 bit ECC. This removes the hardcoded
ECC strength and step size as set in qcom-ipq4019.dtsi, thus relying on the
kernel NAND detection routines to correclty set up the ECC parameters.

Signed-off-by: Andreas Böhler <dev@aboehler.at>
23 months agokernel: add support for Toshiba TC58NVG0S3HTA00 NAND flash
Andreas Böhler [Tue, 12 Apr 2022 09:01:25 +0000 (11:01 +0200)]
kernel: add support for Toshiba TC58NVG0S3HTA00 NAND flash

The Toshiba TC58NVG0S3HTA00 is detected with 64 byte OOB while the flash
has 128 byte OOB. This adds a static NAND ID entry to correct this.

Signed-off-by: Andreas Böhler <dev@aboehler.at>
23 months agoopenssl: bump to 1.1.1o
Eneas U de Queiroz [Tue, 10 May 2022 23:34:57 +0000 (20:34 -0300)]
openssl: bump to 1.1.1o

This release comes with a security fix related to c_rehash.  OpenWrt
does not ship or use it, so it was not affected by the bug.

There is a fix for a possible crash in ERR_load_strings() when
configured with no-err, which OpenWrt does by default.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
23 months agoutil-linux: use meson to build
Rosen Penev [Sat, 30 Apr 2022 01:41:45 +0000 (18:41 -0700)]
util-linux: use meson to build

Compiles faster, is PIC by default, and does not have pkgconfig files
with wrong paths.

Add various fixes to it as it seems cross compilation was never tested.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
23 months agoutil-linux: update to 2.38
Rosen Penev [Mon, 2 May 2022 03:58:33 +0000 (20:58 -0700)]
util-linux: update to 2.38

Various fixes.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
23 months agoath79: ZTE MF286[A,R]: add "Power button blocker" GPIO switch
Lech Perczak [Sat, 14 May 2022 12:50:02 +0000 (14:50 +0200)]
ath79: ZTE MF286[A,R]: add "Power button blocker" GPIO switch

ZTE MF286A and MF286R feature a "power switch override" GPIO in stock
firmware as means to prevent power interruption during firmware update,
especially when used with internal battery.
To ensure that this GPIO is
properly driven as in stock firmware, configure it with userspace GPIO
switch.

It was observed that on some units, the modem would not be
restarted together with the board itself on reboot, this should help
with that as well.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
23 months agoipq40xx: revert Cell-C RTL30VW to legacy caldata extraction
Pawel Dembicki [Wed, 11 May 2022 15:29:21 +0000 (17:29 +0200)]
ipq40xx: revert Cell-C RTL30VW to legacy caldata extraction

This partially reverts
commit cfc13c44595d ("ipq40xx: utilize nvmem-cells for macs & (pre-)calibration data").

After switching to nvmem RTL30VW, wifi was broken:

[   19.118319] ath10k_ahb a000000.wifi: qca4019 hw1.0 target 0x01000000 chip_id 0x003b00ff sub 0000:0000
[   19.118377] ath10k_ahb a000000.wifi: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 0
[   19.130285] ath10k_ahb a000000.wifi: firmware ver 10.4b-ct-4019-fW-13-5ae337bb1 api 5 features mfp,peer-flow-ctrl,txstatus-noack,wmi-10.x-CT,ratemask-CT,regdump-CT,txrate-CT,flush-all-CT,pingpong-CT,ch-regs-CT,nop-CT,set-special-CT,tx-rc-CT,cust-stats-CT,txrate2-CT,beacon-cb-CT,wmi-block-ack-CT,wmi-bcn-rc-CT crc32 6b2b5c5b
[   19.159092] ath10k_ahb a000000.wifi: failed to fetch board data for bus=ahb,vendor=0000,device=0000,subsystem-vendor=0000,subsystem-device=0000,variant=cellc,rtl30vw from ath10k/QCA4019/hw1.0/board-2.bin
[   19.238764] ath10k_ahb a000000.wifi: failed to fetch board-2.bin or board.bin from ath10k/QCA4019/hw1.0
[   19.238847] ath10k_ahb a000000.wifi: failed to fetch board file: -12
[   19.247362] ath10k_ahb a000000.wifi: could not probe fw (-12)
[   20.190797] ath10k_ahb a800000.wifi: qca4019 hw1.0 target 0x01000000 chip_id 0x003b00ff sub 0000:0000
[   20.190853] ath10k_ahb a800000.wifi: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 0
[   20.202893] ath10k_ahb a800000.wifi: firmware ver 10.4b-ct-4019-fW-13-5ae337bb1 api 5 features mfp,peer-flow-ctrl,txstatus-noack,wmi-10.x-CT,ratemask-CT,regdump-CT,txrate-CT,flush-all-CT,pingpong-CT,ch-regs-CT,nop-CT,set-special-CT,tx-rc-CT,cust-stats-CT,txrate2-CT,beacon-cb-CT,wmi-block-ack-CT,wmi-bcn-rc-CT crc32 6b2b5c5b
[   20.231357] ath10k_ahb a800000.wifi: failed to fetch board data for bus=ahb,vendor=0000,device=0000,subsystem-vendor=0000,subsystem-device=0000,variant=cellc,rtl30vw from ath10k/QCA4019/hw1.0/board-2.bin
[   20.317318] ath10k_ahb a800000.wifi: failed to fetch board-2.bin or board.bin from ath10k/QCA4019/hw1.0
[   20.317399] ath10k_ahb a800000.wifi: failed to fetch board file: -12
[   20.326098] ath10k_ahb a800000.wifi: could not probe fw (-12)

Bootloader mangles in NAND partitions and removes precal@X nodes in
working system:

root@OpenWrt:~# echo $(cat /sys/firmware/devicetree/base/soc/spi@78b5000/flash@0/partitions/partition@170000/label)
0:ART
root@OpenWrt:~# ls /sys/firmware/devicetree/base/soc/spi@78b5000/flash@0/partitions/partition@170000/
label  name   reg

Revert to legacy method fixed the problem.

Fixes: cfc13c44595d ("ipq40xx: utilize nvmem-cells for macs & (pre-)calibration data")
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
23 months agoath79: fix I2C on GL-AR300M devices
Ptilopsis Leucotis [Wed, 11 May 2022 16:55:05 +0000 (19:55 +0300)]
ath79: fix I2C on GL-AR300M devices

On GL-AR300M Series GPIO17 described as I2C SDA in Device Tree.
Because of GPIO_OUT_FUNCTION4 register was not initialized on start,
GPIO17 was uncontrollable, it always in high state. According to QCA9531
documentation, default setting of GPIO17 is SYS_RST_L. In order to make
GPIO17 controllable, it should write value 0x00 on bits [15:8] of
GPIO_OUT_FUNCTION4 register, located at 0x1804003C address.

Signed-off-by: Ptilopsis Leucotis <PtilopsisLeucotis@yandex.com>
23 months agolibubox: update to the latest version
Felix Fietkau [Sun, 15 May 2022 13:19:49 +0000 (15:19 +0200)]
libubox: update to the latest version

f2d6752901f2 blob: clear buf->head when freeing a buffer
45210ce14136 list.h: add container_of_safe macro
cfa372ff8aed blobmsg: implicitly reserve space for 0-terminator in string buf alloc
d2223ef9da71 blobmsg: work around false positive gcc -Warray-bounds warnings

Signed-off-by: Felix Fietkau <nbd@nbd.name>
23 months agompc85xx: enable error reporting for RAM and PCIe
Josef Schlehofer [Fri, 6 May 2022 17:13:05 +0000 (19:13 +0200)]
mpc85xx: enable error reporting for RAM and PCIe

All Freescale processors used in this target are capable to detect error
and correction. [1] It can not be used as kernel module. [2] This is
helpful to report hardware errors.

It enables three kernel options:

- EDAC, which is a subsystem
- EDAC_LEGACY_SYSFS, it enables sysfq nodes
- MP85XX, support for Freescale MPC8349, MPC8560, MPC8540, MPC8548, T4240

EDAC is already enabled for following targets:
qoriq, octeon, octeontx and zynq.

[1] https://cateee.net/lkddb/web-lkddb/EDAC.html
[2] https://patchwork.ozlabs.org/patch/554908/

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
23 months agouboot-fritz4040: Add support for Toshiba NAND
Christian Lamparter [Fri, 13 May 2022 19:44:30 +0000 (21:44 +0200)]
uboot-fritz4040: Add support for Toshiba NAND

From Andreas Böhler:

"Some revisions of the FRITZ!7530 use a Toshiba NAND with 8 bit ECC
in contrast to the Macronix NAND with 4 bit ECC.".

Uboot needs to know this in order to have a chance to load from
the NAND.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
23 months agoipq-wifi: drop upstreamed board-2.bin
Christian Lamparter [Fri, 13 May 2022 20:25:36 +0000 (22:25 +0200)]
ipq-wifi: drop upstreamed board-2.bin

The BDFs for the:
Aruba AP-303
ASUS RT-AC42U
AVM FRITZ!Repeater 1200
Buffalo WTR-M2133HP
Cell C RTL30VW
D-Link DAP-2610
EnGenius EAP2200
EnGenius EMD1
EnGenius EMR3500
EnGenius EMR5000
EZVIZ CS-W3-WD1200G EUP
Google Wifi
Linksys MR8300 V1.0
Luma WRTQ-329ACN
MobiPromo CM520-79F
NEC Platforms WG2600HP3
Plasma Cloud PA1200 (updated version)
Plasma Cloud PA2200
ZTE MF286D

were upstreamed to the ath10k-firmware repository
and landed in linux-firmware.git.

Furthermore the BDFs for the:
8devices Habanero
OpenMesh A62
OpenMesh A42
AVM FRITZ!Box 4040

have been updated.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
23 months agolinux-firmware: take linux-firmware.git's qca99x0 boardfile
Christian Lamparter [Fri, 13 May 2022 20:07:59 +0000 (22:07 +0200)]
linux-firmware: take linux-firmware.git's qca99x0 boardfile

Kalle Valo managed to add the qca9980's boardfile in the
upstream repository. Sourcing the file from his repository
is no longer needed.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
23 months agolinux-firmware: Update to version 20220509
Christian Lamparter [Fri, 13 May 2022 19:55:46 +0000 (21:55 +0200)]
linux-firmware: Update to version 20220509

git log --pretty=oneline --abbrev-commit 20220411..20220509 (sorted)

amdgpu:
480d6c2 amdgpu: update dcn_3_1_6_dmcub firmware
b4994be amdgpu: update gc_10_3_7_rlc firmware
61eb408 amdgpu: update psp_13_0_8 firmware
fcf9d8c amdgpu: update yellow carp DMCUB firmware

ath10k:
73743b8 ath10k: QCA4019 hw1.0: update board-2.bin
6ad0930 ath10k: QCA6174 hw3.0: update board-2.bin
729bd7f ath10k: QCA6174 hw3.0: update firmware-6.bin to WLAN.RM.4.4.1-00288-QCARMSWPZ-1
9fce09f ath10k: QCA9888 hw2.0: update board-2.bin
b155d85 ath10k: QCA9888 hw2.0: update firmware-5.bin to 10.4-3.9.0.2-00156
44b8aee ath10k: QCA9984 hw1.0: update board-2.bin
4ad3bd3 ath10k: QCA9984 hw1.0: update firmware-5.bin to 10.4-3.9.0.2-00156
1962cba ath10k: QCA99X0 hw2.0: add board-2.bin

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
23 months agoipq40xx: Lyra: update RGB LED-Controller node for 5.10+
Christian Lamparter [Sat, 7 May 2022 17:41:55 +0000 (19:41 +0200)]
ipq40xx: Lyra: update RGB LED-Controller node for 5.10+

Add the reg and color property to each channel node. This
update is to accommodate the multicolor framework.

Refer to:
<https://lore.kernel.org/all/20200622185919.2131-9-dmurphy@ti.com>
<https://lore.kernel.org/all/20210818070209.1540451-1-michal.vokac@ysoft.com>

Note:

There is only a single extremely bright RGB-LED.
The RGB-color channels (i.e.: blue-0, blue-1 and blue-2)
are running in parallel to increase the current delivery
beyond what a single PWM-output on the LED controller
could do.

BugLink: https://github.com/openwrt/openwrt/issues/9851
Reported-By: Thomas Bøge <thomas@boegenielsen.dk>
Tested-By: Thomas Bøge <thomas@boegenielsen.dk>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
23 months agoapm821xx: use nested fixed-partitions
Christian Lamparter [Sat, 14 May 2022 08:44:58 +0000 (10:44 +0200)]
apm821xx: use nested fixed-partitions

This makes it possible to fix Netgear WNDAP620+660 DTS ugliness.
Bring back the dtb and firmware partitions for the WNDR4700.
Thank you, mans0n.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
23 months agobcm53xx: remove MR32's specific get_leds_dt code
Christian Lamparter [Wed, 9 Mar 2022 19:20:20 +0000 (20:20 +0100)]
bcm53xx: remove MR32's specific get_leds_dt code

the existing diag.sh code will pick up the LED
by itself. This is not/no longer needed.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
23 months agolantiq: xway: disable unused switch drivers
Aleksander Jan Bajkowski [Tue, 21 Dec 2021 21:57:27 +0000 (22:57 +0100)]
lantiq: xway: disable unused switch drivers

None of the devices supported by target xway are using Realtek
RTL8366S, RTL8367A and RTL8367B switches. The switches mentioned
earlier were enabled when bumping the kernel version to 3.7 in
commit 3a948770cf46 ("add linux-v3.7").

Switches used by individual devices are listed below.

Device Switch PHY
Arcadyan ARV4510PW Infineon ADM6996I int. switch
Arcadyan ARV4519PW Atheros AR8216 int. switch
Arcadyan ARV7506PW11 Realtek RTL8306G int. switch
Arcadyan ARV7510PW22 Atheros AR8216 int. switch
Arcadyan ARV7518PW Atheros AR8216 int. switch
Arcadyan ARV7519PW Atheros RTL8306G int. switch
Arcadyan ARV7525PW N/A IC+ IP101A
Arcadyan ARV752DPW Realtek RTL8306G int. switch
Arcadyan ARV752DPW22 Atheros AR8216 int. switch
Arcadyan ARV8539PW22 Atheros AR8216 int. switch
AVM Fritzbox 7312 int. SoC Atheros AR8030-A
AVM Fritzbox 7320 int. SOC Lantiq PEF7071V
AudioCodes MediaPack MP-252 Infineon ADM6996I int. switch
BT Home Hub 2B Infineon ADM6996I int. switch
BT Home Hub 3A Infineon PSB6972 Lantiq PEF7071V
Buffalo WBMR-HP-G300H-A Atheros AR8316 int. switch
Buffalo WBMR-HP-G300H-B Atheros AR8316 int. switch
Lantiq EASY50712 Infinein ADM6996I int. switch
Netgear DGN3500 Realtek RTL8366RB int. switch
Netgear DGN3500B Realtek RTL8366RB int. switch
Siemens Gigaset sx76x Infineon ADM6996I int. switch
ZTE H201L Realtek RTL8306G int. switch
ZyXEL P-2601HN-F1 Realtek RTL8306E int. switch
ZyXEL P-2601HN-F3 Realtek RTL8306E int. switch

Reduces uncompressed kernel size by 36 kB.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
(checkpatch.pl fixes)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
23 months agoramips: fix booting on Samknows SK-WB8
Piotr Dymacz [Fri, 13 May 2022 11:35:59 +0000 (13:35 +0200)]
ramips: fix booting on Samknows SK-WB8

This fixes a well known "LZMA ERROR 1" error, reported previously on
numerous of similar devices.

Fixes: #9824
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
23 months agoimage: drop unused 'BuildKernel/MkFIT'
Piotr Dymacz [Fri, 1 Apr 2022 15:35:42 +0000 (17:35 +0200)]
image: drop unused 'BuildKernel/MkFIT'

The 'MkFIT' recipe is no longer used across whole codebase.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
23 months agorealtek: do not reset SerDes on link change
Birger Koblitz [Sun, 24 Apr 2022 20:01:31 +0000 (22:01 +0200)]
realtek: do not reset SerDes on link change

Do not reset the RTL930x SerDes on link changes, instead set up
the SDS with internal PHYs for the SFP+ ports only.
This fixes the 8 1GBit ports on the Zyxel XGS1250 which
do not work without this patch.

A complete SerDes reset was performed on all SerDes links. For copper
1Gbit ports, this is commonly a single XGMII link to an RTL8218D. There
is however no support for setting up the XGMII link on RTL9300/RTL9310,
thereby wiping the (RX/TX) setup done by u-boot and breaking the 1GBit
ports. No SerDes reset should be done for these links.

The handling of SGMII/HiSGMII, 1000BX or 10GR links is actually entirely
different. All these modes need to be suitably RX calibrated and the
pre- main and post- amplifiers set up properly for TX.

The 10GBit SFP+ fiber links are recalibrated instead of reset, which
e.g. is necessary when someone pulls a module out and puts another in.
This makes swapping out 10GBit fiber modules possible. 1GBit modules are
not yet supported, nor any modules with an internal phy.

Tested-by: Stijn Segers <foss@volatilesystems.org>
Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
[rewrite commit message based on discussion]
Link: http://lists.infradead.org/pipermail/openwrt-devel/2022-May/038623.html
Signed-off-by: Sander Vanheule <sander@svanheule.net>
23 months agokernel: bump 5.15 to 5.15.38
Rui Salvaterra [Mon, 9 May 2022 08:41:30 +0000 (09:41 +0100)]
kernel: bump 5.15 to 5.15.38

Deleted (upstreamed):
mediatek/patches-5.15/120-10-v5.18-mtd-nand-fix-ecc-parameters-for-mt7622.patch [1]

Other patches automatically rebased.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.38&id=3ec920d755ae69c201b358e8d8e96c32f51145d8

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
23 months agokernel: bump 5.15 to 5.15.37
Rui Salvaterra [Sun, 1 May 2022 21:23:46 +0000 (22:23 +0100)]
kernel: bump 5.15 to 5.15.37

Patches automatically rebased.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
23 months agokernel: bump 5.15 to 5.15.36
Rui Salvaterra [Sat, 30 Apr 2022 23:40:39 +0000 (00:40 +0100)]
kernel: bump 5.15 to 5.15.36

Patches automatically rebased.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
23 months agoramips: add support for Cudy X6
Alessio Prescenzo [Wed, 22 Sep 2021 14:45:19 +0000 (16:45 +0200)]
ramips: add support for Cudy X6

Specifications:

SoC: MediaTek MT7621
RAM: 256 MB
Flash: 32 MB
WiFi: MediaTek MT7915E
Switch: 1 WAN, 4 LAN (Gigabit)
Ports: 1 USB 3.0
Buttons: Reset, WPS
LEDs: Power, System, Wan, Lan 1-4, WiFi 2.4G, WiFi 5G, WPS, USB
Power: DC 12V 1A tip positive
Installation:

Download and flash the manufacturer's built OpenWRT image available at
http://www.cudytech.com/openwrt_software_download
Install the new OpenWRT image via luci (System -> Backup/Flash firmware)
Be sure to NOT keep settings. The force upgrade may need to be checked
due to differences in router naming conventions.

Recovery:

Loads only signed manufacture firmware due to bootloader RSA verification
serve tftp-recovery image as /recovery.bin on 192.168.1.88/24
connect to any lan ethernet port
power on the device while holding the reset button
wait at least 8 seconds before releasing reset button for image to
download

Signed-off-by: Alessio Prescenzo <alessioprescenzo@gmail.com>
[ensure unique wireless MAC, fix GPIO pingroup]
Signed-off-by: David Bauer <mail@david-bauer.net>
23 months agorealtek: Trap all frames with switch as destination to CPU-port
Birger Koblitz [Sun, 24 Apr 2022 18:37:33 +0000 (20:37 +0200)]
realtek: Trap all frames with switch as destination to CPU-port

This fixes a bug where frames sent to the switch itself were
flooded to all ports unless the MAC address of the CPU-port
was learned otherwise.

Tested-by: Wenli Looi <wlooi@ucalgary.ca>
Tested-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
[fix code formatting]
Signed-off-by: Sander Vanheule <sander@svanheule.net>
23 months agorealtek: add support for ZyXEL GS1900-16
Raylynn Knight [Sun, 10 Apr 2022 07:26:59 +0000 (03:26 -0400)]
realtek: add support for ZyXEL GS1900-16

The ZyXEL GS1900-16 is a 16 port gigabit switch similar to other GS1900 switches.

Specifications
--------------
* Device:    ZyXEL GS1900-16
* SoC:       Realtek RTL8382M 500 MHz MIPS 4KEc
* Flash:     16 MiB Macronix MX25L12835F
* RAM:       128 MiB DDR2 SDRAM Nanya NT5TU128M8HE
* Ethernet:  16x 10/100/1000 Mbps
* LEDs:      1 PWR LED (green, not configurable)
             1 SYS LED (green, configurable)
             16 ethernet port link/activity LEDs (green, SoC controlled)
* Buttons:   1 "RESET" button on front panel
* Power      120-240V AC C13
* UART:      1 serial header (J12) with populated standard pin connector on
             the right back of the PCB.
             Pinout (front to back):
             + Pin 1 - VCC marked with white dot
             + Pin 2 - RX
             + Pin 3 - TX
             + PIn 4 - GND

Serial connection parameters:  115200 8N1.

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

OEM upgrade method:

* Log in to OEM management web interface
* Navigate to Maintenance > Firmware
* Select the HTTP radio button
* Select the Active radio button
* Use the browse button to locate the
realtek-generic-zyxel_gs1900-16-initramfs-kernel.bin
file amd select open so File Path is update with filename.
* Select the Apply button. Screen will display "Prepare
for firmware upgrade ...".
*Wait until screen shows "Do you really want to reboot?"
then select the OK button
* Once OpenWrt has booted, scp the sysupgrade image to /tmp and flash it:
   > sysupgrade -n /tmp/realtek-generic-zyxel_gs1900-16-squashfs-sysupgrade.bin
   it may be necessary to restart the network (/etc/init.d/network restart) on
   the running initramfs image.

U-Boot TFTP method:

* Configure your client with a static 192.168.1.x IP (e.g. 192.168.1.10).
* Set up a TFTP server on your client and make it serve the initramfs image.
* Connect serial, power up the switch, interrupt U-boot by hitting the
  space bar, and enable the network:
   > rtk network on
* Since the GS1900-16 is a dual-partition device, you want to keep the OEM
  firmware on the backup partition for the time being. OpenWrt can only boot
  from the first partition anyway (hardcoded in the DTS). To make sure we are
  manipulating the first partition, issue the following commands:
  > setsys bootpartition 0
  > savesys
* Download the image onto the device and boot from it:
   > tftpboot 0x84f00000 192.168.1.10:openwrt-realtek-generic-zyxel_gs1900-16-initramfs-kernel.bin
   > bootm
* Once OpenWrt has booted, scp the sysupgrade image to /tmp and flash it:
   > sysupgrade -n /tmp/openwrt-realtek-generic-zyxel_gs1900-16-squashfs-sysupgrade.bin
   it may be necessary to restart the network (/etc/init.d/network restart) on
   the running initramfs image.

Signed-off-by: Raylynn Knight <rayknight@me.com>
[removed duplicate patch title, align RAM specification]
Signed-off-by: Sander Vanheule <sander@svanheule.net>
23 months agokernel: backports: add Huawei MA5671A tx-fault workaround
Matthew Hagan [Wed, 4 May 2022 07:26:44 +0000 (08:26 +0100)]
kernel: backports: add Huawei MA5671A tx-fault workaround

This workaround will allow the MA5671A to function, ignoring the
persistently asserted tx-fault.

Signed-off-by: Matthew Hagan <mnhagan88@gmail.com>
(added 5.15 backport)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
23 months agoapm821xx: add support for kernel 5.15 for testing
Christian Lamparter [Thu, 5 May 2022 16:16:25 +0000 (18:16 +0200)]
apm821xx: add support for kernel 5.15 for testing

This patch copies over refreshed config and patches from 5.10
with the following changes:

 - dropped superfluous tc654/tc655 variant detection patch
   (tc654 support will become available upstream starting with
   5.17-rc7+).

 - dropped xhci msi(x) workaround... as the broken MSI(X)
   is now gone.

 - dropped dwc2 workaround since the driver was fixed and it
   works without it.

Please note: Netgear WNDAP660 & WNDAP620 users:

Due to the kernel's size increase, uboot will likely break
because it is overwrite the kernel during decompression.

To fix this (and debrick affected devices, no reflash
necessary), attach the RJ45-Serial-Console cable and
enter the following in the uboot prompt during bootup:

 setenv kernel_addr_r 1100000
 saveenv
 run bootcmd

to restore the old/previous behavior:

 setenv kernel_addr_r 600000
 saveenv
 run bootcmd

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
23 months agokernel: usb-xhci-pci-renesas: remove LINUX_5_10 dependency symbol
Christian Lamparter [Thu, 5 May 2022 19:15:57 +0000 (21:15 +0200)]
kernel: usb-xhci-pci-renesas: remove LINUX_5_10 dependency symbol

With 5.4 out of the picture, remove LINUX_5_10 here. This is
needed for the WNDR4700 as otherwise kmod-usb3 isn't available
for 5.15.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
23 months agogeneric: 5.15: add missing symbol
Christian Lamparter [Thu, 5 May 2022 18:19:32 +0000 (20:19 +0200)]
generic: 5.15: add missing symbol

Found during apm821xx refresh.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
23 months agokernel/x86: move x86' specific watchdogs to the x86 target
Christian Lamparter [Sun, 1 May 2022 12:10:43 +0000 (14:10 +0200)]
kernel/x86: move x86' specific watchdogs to the x86 target

upstream linux have these watchdogs locked behind X86.
These will not build on other architectures. So move them
to target/linux/x86/modules.mk

drivers/watchdog/Kconfig:

|config F71808E_WDT
| tristate "Fintek F718xx, F818xx Super I/O Watchdog"
| depends on X86
|[...]
|config IT87_WDT
| tristate "IT87 Watchdog Timer"
| depends on X86
|[...]
|config ITCO_WDT
| tristate "Intel TCO Timer/Watchdog"
| depends on (X86 || IA64) && PCI
|[...]
|config W83627HF_WDT
| tristate "Watchdog timer for W83627HF/W83627DHG and compatibles"
| depends on X86
|[...]

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
23 months agox86: detangle meraki-mx100 / nu801 build confusion
Christian Lamparter [Sun, 1 May 2022 12:10:35 +0000 (14:10 +0200)]
x86: detangle meraki-mx100 / nu801 build confusion

Grommish reported the dreaded build error that happend with 5.4
since the kernel didn't have the cgpio v2 interface. His reason
for the removed 5.4 was that the octeon target had a memory leak
issue, so he had to backport the removed 5.4 kernel for his tests.

Chen Minqiang chimed in and noted that no matter what (i.e.
@TARGET_x86 in depends) didn't prevent the package from being build
on other targets.

From what I can tell, the reason for this was that +nu801 meant
that kmod-meraki-mx100 pulled in an unconditional dependency as
part of to the kernel build.

|scripts/package-metadata.pl mk tmp/.packageinfo
|
|$(curdir)/kernel/linux/compile += $(curdir)/firmware/linux-firmware/compile \
| $(curdir)/firmware/prism54-firmware/compile \
| $(curdir)/kernel/gpio-button-hotplug/compile \
| >>> $(curdir)/system/gpio-cdev/nu801/compile <<<

change this by making the dependency conditional on the
meraki-mx100 module itself. Note that the nu801 enables/sets
the  KCONFIG for the cgpio v2 interface itself, since the
userspace program and not the kernel meraki-mx100 relies on it.

Reference: <https://github.com/openwrt/openwrt/commit/eeb8fd4ce7e9>
Reported-by: Grommish <grommish@gmail.com>
Reported-by: Chen Minqiang <ptpt52@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
23 months agox86: add ib700wdt module for x86 qemu watchdogs
Christian Lamparter [Sun, 1 May 2022 12:10:25 +0000 (14:10 +0200)]
x86: add ib700wdt module for x86 qemu watchdogs

QEMU+Libvirt can emulate the ib700wdt watchdogs
which due to its I/O-Port mapping makes it x86
specific.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
23 months agoarmvirt: 64: enable driver for QEMU' supported watchdog
Christian Lamparter [Sun, 1 May 2022 12:10:18 +0000 (14:10 +0200)]
armvirt: 64: enable driver for QEMU' supported watchdog

QEMU can emulate several watchdogs:
aspeed SoC, i6300esb, ib700wdt, imx2, cmsdk-apb and sbsa_gwdt.

Out of these, the ARM SBSA Generic Watchdog (sbsa_gwdt)
makes the most sense for the armvirt' 64 target. Both imx2 and
aspeed are guarded by special vendor specific CONFIG_ in the
upstream kernel.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
23 months agokernel: provide i6300esb for qemu/libvirt
Christian Lamparter [Sun, 1 May 2022 12:10:07 +0000 (14:10 +0200)]
kernel: provide i6300esb for qemu/libvirt

the Intel i6300esb is QEMU's default watchdog. And unlike
the real "Intel i6300ESB I/O Controller hub" hardware, the
i6300esb watchdog driver works on non-x86 targets like for
ARM (armvirt 32bit) and potentially virtual PowerPC and MIPS
targets (if there was any).

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
23 months agokernel: fix corrupted padding on small packets with mt753x dsa
Felix Fietkau [Fri, 6 May 2022 19:54:48 +0000 (21:54 +0200)]
kernel: fix corrupted padding on small packets with mt753x dsa

Signed-off-by: Felix Fietkau <nbd@nbd.name>
23 months agokernel: backport flow offload fixes to 5.10
Felix Fietkau [Fri, 6 May 2022 13:49:58 +0000 (15:49 +0200)]
kernel: backport flow offload fixes to 5.10

Signed-off-by: Felix Fietkau <nbd@nbd.name>
23 months agokernel: fix flow offload issues with pppoe
Felix Fietkau [Fri, 6 May 2022 13:49:58 +0000 (15:49 +0200)]
kernel: fix flow offload issues with pppoe

sync xt_FLOWOFFLOAD code with latest version of nft_flow_offload

Signed-off-by: Felix Fietkau <nbd@nbd.name>
23 months agoipq40xx: consolidate ar40xx driver files
Sungbo Eo [Wed, 4 May 2022 15:54:43 +0000 (00:54 +0900)]
ipq40xx: consolidate ar40xx driver files

Commit f4fb63d2ab4f ("ipq40xx: 5.10: move AR40xx to MDIO drivers") moved
the ar40xx driver files to kernel version specific directories to place
them in different subdirectory in kernel tree. But now kernel 5.4 is
gone and there is no reason to keep them separate. Move them back to
common files/ directory.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
23 months agoipq40xx: 5.15: fix ar40xx driver
Nick Hainke [Sun, 1 May 2022 19:06:52 +0000 (21:06 +0200)]
ipq40xx: 5.15: fix ar40xx driver

Also apply commit ab7e53e5cce7 ("ipq40xx: 5.10: fix ar40xx driver") to
5.15 driver.

The commit fixes the data corruption on TX packets. Packets are
transmitted, but their contents are replaced with zeros. This error is
caused by the lack of guard (50 ms) intervals between calibration phases.
This error is treated by adding mdelay(50) to the calibration function
code. In the original qca-ssda code, these mdelays were existing, but in
the ar41xx.c they are gone.

Fixes: 87318eb17936 ("ipq40xx: 5:15: copy config and patch from 5.10")
Signed-off-by: Nick Hainke <vincent@systemli.org>
23 months agoramips: add i2c in dts for GL-MT300N-V2
Ptilopsis Leucotis [Sat, 30 Apr 2022 20:57:04 +0000 (23:57 +0300)]
ramips: add i2c in dts for GL-MT300N-V2

According wiki https://docs.gl-inet.com/en/2/hardware/mt300n-v2/
GL-MT300N-V2 have I2C interface on GPIO4, GPIO5.
Adding I2C in device tree make possible using I2C on this device.

Signed-off-by: Ptilopsis Leucotis <PtilopsisLeucotis@yandex.com>
23 months agoipq806x: add support for Arris TR4400 v2 / RAC2V1A
Rodrigo Balerdi [Thu, 7 Apr 2022 06:18:59 +0000 (03:18 -0300)]
ipq806x: add support for Arris TR4400 v2 / RAC2V1A

Hardware specs:
  SoC: Qualcomm IPQ8065 (dual core Cortex-A15)
  RAM: 512 MB DDR3
  Flash: 256 MB NAND, 32 MB NOR
  WiFi: QCA9983 2.4 GHz, QCA9984 5 GHz
  Switch: QCA8337
  Ethernet: 5x 10/100/1000 Mbit/s
  USB: 1x USB 3.0 Type-A
  Buttons: WPS, Reset
  Power: 12 VDC, 2.5 A

Ethernet ports:
  1x WAN: connected to eth2
  4x LAN: connected via the switch to eth0 and eth1
          (eth0 is disabled in OEM firmware)

MAC addresses (OEM and OpenWrt):
  fw_env @ 0x00  d4:ab:82:??:??:?a  LAN (eth1)
  fw_env @ 0x06  d4:ab:82:??:??:?b  WAN (eth2)
  fw_env @ 0x0c  d4:ab:82:??:??:?c  WLAN 2.4 GHz (ath1)
  fw_env @ 0x12  d4:ab:82:??:??:?d  WLAN 5 GHz (ath0)
  fw_env @ 0x18  d4:ab:82:??:??:?e  OEM usage unknown (eth0 in OpenWrt)

  OID d4:ab:82 is registered to:
  ARRIS Group, Inc., 6450 Sequence Drive, San Diego CA 92121, US

More info:
  https://openwrt.org/inbox/toh/arris/tr4400_v2

IMPORTANT:

This port requires moving the 'fw_env' partition prior to first boot to
consolidate 70% of the usable space in flash into a contiguous partition.
'fw_env' contains factory-programmed MAC addresses, SSIDs, and passwords.
Its contents must be copied to 'rootfs_1' prior to booting via initramfs.
Note that the stock 'fw_env' partition  will be wiped during sysupgrade.

A writable 'stock_fw_env' partition pointing to the old, stock location
is included in the port to help rolling back this change if desired.

Installation:

- Requires serial access and a TFTP server.
- Fully boot stock, press ENTER, type in:
mtd erase /dev/mtd21
dd if=/dev/mtd22 bs=128K count=1 | mtd write - /dev/mtd21
umount /config && ubidetach -m 23 && mtd erase /dev/mtd23
- Reboot and interrupt U-Boot by pressing a key, type in:
set mtdids 'nand0=nand0'
set mtdparts 'mtdparts=nand0:155M@0x6500000(mtd_ubi)'
set bootcmd 'ubi part mtd_ubi && ubi read 0x44000000 kernel && bootm'
env save
- Setup TFTP server serving initramfs image as 'recovery.bin', type in:
set ipaddr 192.168.1.1
set serverip 192.168.1.2
tftpboot recovery.bin && bootm
- Use sysupgrade to install squashfs image.

This port is based on work done by AmadeusGhost <amadeus@jmu.edu.cn>.

Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
[add 5.15 changes for 0069-arm-boot-add-dts-files.patch]
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
23 months agopackages: nvram: add NVRAM quirks for bcm53xx target
Arınç ÜNAL [Wed, 4 May 2022 08:34:29 +0000 (11:34 +0300)]
packages: nvram: add NVRAM quirks for bcm53xx target

Add NVRAM quirks script for the bcm53xx target. Split NVRAM quirks for the
bcm47xx and bcm53xx targets. Move clear partialboot NVRAM quirk for Linksys
EA9500 here. Add set wireless LED behaviour quirk for Asus RT-AC88U.

Use boot() instead of start() as nvram commands are meant to be executed
only once, at boot.

Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
23 months agofirewall: config: remove restictions on DHCPv6 allow rule
Tiago Gaspar [Wed, 4 May 2022 09:36:07 +0000 (10:36 +0100)]
firewall: config: remove restictions on DHCPv6 allow rule

Remove restrictions on source and destination addresses, which aren't
specified on RFC8415, and for some reason in openwrt are configured
to allow both link-local and ULA addresses.
As cleared out in issue #5066 there are some ISPs that use Gloabal
Unicast addresses, so fix this rule to allow them.

Fixes: #5066
Signed-off-by: Tiago Gaspar <tiagogaspar8@gmail.com>
[rebase onto firewall3, clarify subject, bump PKG_RELEASE]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
23 months agoltq-vdsl-app: disconnect when service is stopped
Jan Hoffmann [Wed, 27 Apr 2022 17:40:50 +0000 (19:40 +0200)]
ltq-vdsl-app: disconnect when service is stopped

Stop the connection when the control daemon is terminated. The code is
a modified version of the termination routine in version 4.23.1 of the
daemon (which doesn't support VR9 modems anymore).

This could also be implemented by calling the acos and acs commands via
dsl_cpe_pipe.sh in the init script. However, doing it in the daemon
itself has the advantage of also working if it is terminated in another
way (for example during sysupgrade).

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
23 months agoltq-vdsl/ltq-adsl: fix elapsed time calculation
Jan Hoffmann [Mon, 25 Apr 2022 19:52:39 +0000 (21:52 +0200)]
ltq-vdsl/ltq-adsl: fix elapsed time calculation

The driver maintains elapsed times by repeatedly accumulating the time
since the previous update in a loop. For the elapsed showtime time, the
time difference is truncated to seconds before adding it, leading to a
sizable error over time.

Move the truncation to before calculation of the time difference in
order to remove this error. Also maintain the total elapsed time in the
same way in full seconds, to prevent the unsigned 32-bit counter from
wrapping around after about 50 days.

Testing on a VR9 device shows that the reported line uptime now matches
the actual elapsed wall time. The ADSL variant is only compile-tested,
but it should also work as the relevant code is identical.

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
23 months agoltq-atm/ltq-ptm: avoid unnecessary build dependencies
Jan Hoffmann [Mon, 25 Apr 2022 19:43:50 +0000 (21:43 +0200)]
ltq-atm/ltq-ptm: avoid unnecessary build dependencies

Right now, both ltq-adsl-mei and ltq-vdsl-mei are always built, even
when they aren't necessary for the selected variant. This can cause the
build to fail, for example ltq-vdsl-mei doesn't build successfully here
on xway target due to the vectoring callback.

Make these dependencies conditional on the specific package variants,
so they are only built when actually needed.

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
Tested-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
23 months agouqmi: update to git HEAD
Daniel Golle [Wed, 4 May 2022 00:32:17 +0000 (01:32 +0100)]
uqmi: update to git HEAD

 56cb2d4 nas: add decoding of cell_id
 9a9019a uqmi: wms - added storage to read text messages

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
23 months agofstools: update to git HEAD
Daniel Golle [Tue, 3 May 2022 01:10:37 +0000 (02:10 +0100)]
fstools: update to git HEAD

 9e11b37 fstools: remove SELinux restorecon hack

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
23 months agoprocd: update to git HEAD
Daniel Golle [Tue, 3 May 2022 01:07:40 +0000 (02:07 +0100)]
procd: update to git HEAD

 652e6df init: restore SELinux labels after policy is loaded

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
23 months agobase-files: simplify restorecon logic
Daniel Golle [Mon, 2 May 2022 20:07:16 +0000 (21:07 +0100)]
base-files: simplify restorecon logic

Remove forgotten redundant selinuxenabled call and skip the whole
thing in case $IPKG_INSTROOT is set as labels are anyway applied only
later on in fakeroot when squashfs is created.

Fixes: 6d7272852e ("base-files: add missing $IPKG_INSTROOT to restorecon call")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
23 months agoselinux-policy: update to version 1.1
Dominick Grift [Sat, 16 Apr 2022 13:10:39 +0000 (15:10 +0200)]
selinux-policy: update to version 1.1

try to clean up some labeling inconsistencies
iwinfo loose ends
ucode loose ends
Makefile: adjust mintesttgt (adds blockmount/blockd)
nftables: reads inherited netifd pipe
ucode: reads inherited netifd pipes
mountroot: fowner
sandbox: writes inherited dropbear pipes
unbound related to /tmp/etc/ssl
unbound loose ends
adds a sslconftmpfile for /tmp/etc/ssl
README: maintain a wish list in the README
iwinfo: netifd forgot write
gptfdisk loose ends
iwinfo: netifd wpad reads/writes inherited netifd fifo files
netifd (mac80211.sh) executes iwinfo
luci: executes wireguard
luci-cgi: audits xtables execute access
rcuhttpd: lists ssl certfile dirs
iwinfo, wifi,nftables usage of ttyd pty if available
urandomseed: seedrng needs cap_sys_admin
iwinfo iwinfo, nftables and some chronyd rules related to ntp nts server
nftables, wifi and adds iwinfo skel
nftables, rpcd, ucode
nftables, ucode and seedrng ucode, fw3/nftables, luci
adds ucode skel and some fw3/nftables related
urandomseed: some seedrng rules
fw3 adds some support for fw4
urandomseed: /etc/seedrng is for seed.credit
hotplugcal: runs ucode which is interpreter like
adds a nftables skeleton and makes xtables optional
agent: allow all agents to write inherited dropbear pipes
urandomseed: this seems to be replaced by seedrng
kmodloader: label /etc/modules.conf kmodloader.conffile
Revert "shelexecfile: remove auditallow rule"
Makefile: sort the modules to process by secilc
Moves back to git.defensec.nl
unbound odhcpd (ip) reads net proc
tcp dump
shelexecfile: remove auditallow rule
rrd.cil: fixes indent
Target rddtool from cgi-io instead of runnit it without transition
rrd.cil related
rrd, rpcd, cgiio clean ups related to luci-app-statistics
Rules for rrd files and luci-statistics
unboundcontrol ordering
Several missing permissions
blockmount, dnsmasq, hotplugcall, rpcd, unbound
adds mctp_socket (linux 5.15)
ip: forgot tc-tiny type transition to go along with the fc spec
ip: adds a fc spec for tc-tiny (called by sqm)
adds ttyACM fc spec and various assorted loose ends
.gitattributes: do not export the github workflows
workflow use selinux 3.3

project moved back to https://git.defensec.nl/selinux-policy.git

Signed-off-by: Dominick Grift <dominick.grift@defensec.nl>
23 months agoipq40xx: fix BDF file for pcie wifi chip on the GL.Inet GL-B2200
Enrico Mioso [Thu, 28 Apr 2022 06:57:24 +0000 (08:57 +0200)]
ipq40xx: fix BDF file for pcie wifi chip on the GL.Inet GL-B2200

After the switch to pre-calibration, ath10k would fail to initialize
the PCIE Wi-Fi on the GL-B200 as follows:

ath10k_pci 0000:01:00.0: enabling device (0140 -> 0142)
ath10k_pci 0000:01:00.0: qca9888 hw2.0 target 0x01000000 chip_id 0x00000000 sub 0000:0000
[...]
ath10k_pci 0000:01:00.0: failed to fetch board data for bus=pci,bmi-chip-id=0,bmi-board-id=16,variant=GL-B2200 from ath10k/QCA9888/hw2.0/board-2.bin
ath10k_pci 0000:01:00.0: failed to fetch board-2.bin or board.bin from ath10k/QCA9888/hw2.0
ath10k_pci 0000:01:00.0: failed to fetch board file: -12
ath10k_pci 0000:01:00.0: could not probe fw (-12)

Repackage the BDF file after renaming relevant fields and files to
allow for the Wi-Fi interface to start again.

Fixes: 80d34d9d593 ("ipq40xx: document pcie wifi chip on the GL.Inet GL-B2200")
CC: Christian Lamparter <chunkeey@gmail.com>
CC: Robert Marko <robimarko@gmail.com>
Reviewed-by: Robert Marko <robert.marko@sartura.hr>
Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>