openwrt/openwrt.git
2 years agoprocd: make rpcd dependency conditional
Felix Fietkau [Thu, 4 Nov 2021 15:54:29 +0000 (16:54 +0100)]
procd: make rpcd dependency conditional

Avoids building rpcd when not needed

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agobuild: fix host package unpack if git-src is used
Felix Fietkau [Thu, 4 Nov 2021 14:54:27 +0000 (15:54 +0100)]
build: fix host package unpack if git-src is used

If the package download step is skipped, it needs to be performed for the host
build instead.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agobuild: add SUBDIR_MAKE_DEBUG variable to make it easier to debug package makefiles
Felix Fietkau [Thu, 4 Nov 2021 14:53:50 +0000 (15:53 +0100)]
build: add SUBDIR_MAKE_DEBUG variable to make it easier to debug package makefiles

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agobcm4908: fix calculation of new cferam index
Sungbo Eo [Sun, 1 Aug 2021 13:17:04 +0000 (22:17 +0900)]
bcm4908: fix calculation of new cferam index

The arithmetic expansion fails when idx becomes a two digit number.
Fix this by relying on expr command.

root@OpenWrt:/# echo $(((028 + 0) % 1000))
/bin/ash: arithmetic syntax error
root@OpenWrt:/# echo $(($(expr 028 + 0) % 1000))
28

Fixes: a6a0b252baa6 ("bcm4908: add sysupgrade support")
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2 years agoomcproxy: bump to git HEAD
Stijn Tintel [Thu, 4 Nov 2021 13:04:45 +0000 (15:04 +0200)]
omcproxy: bump to git HEAD

 bfba2aa groups: use uloop_timeout_remaining64

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2 years agoprocd: bump to git HEAD
Stijn Tintel [Thu, 4 Nov 2021 13:01:53 +0000 (15:01 +0200)]
procd: bump to git HEAD

 0ee8e73 trigger: use uloop_timeout_remaining64

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2 years agorpcd: bump to git HEAD
Stijn Tintel [Thu, 4 Nov 2021 11:21:47 +0000 (13:21 +0200)]
rpcd: bump to git HEAD

 20bf958 session: use uloop_timeout_remaining64
 d11ffe9 session: use blobmsg_get_u64 for RPC_DUMP_EXPIRES

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2 years agolibubox: bump to git HEAD
Stijn Tintel [Thu, 4 Nov 2021 11:18:13 +0000 (13:18 +0200)]
libubox: bump to git HEAD

 123e976 uloop: restore return type of uloop_timeout_remaining
 3344157 uloop: add uloop_timeout_remaining64
 c87d3e1 lua/uloop: use uloop_timeout_remaining64
 c86a894 uloop: deprecate uloop_timeout_remaining

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2 years agohostapd: support qos_map_set without CONFIG_INTERWORKING
Felix Fietkau [Thu, 4 Nov 2021 10:45:18 +0000 (11:45 +0100)]
hostapd: support qos_map_set without CONFIG_INTERWORKING

This feature is useful on its own even without full interworking support

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agobcm53xx: add first 5.17 DTS changes
Rafał Miłecki [Thu, 4 Nov 2021 06:00:21 +0000 (07:00 +0100)]
bcm53xx: add first 5.17 DTS changes

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2 years agolibubox: bump to git HEAD
Stijn Tintel [Wed, 3 Nov 2021 23:55:05 +0000 (01:55 +0200)]
libubox: bump to git HEAD

 be3dc72 uloop: avoid integer overflow in tv_diff

Fixes: FS#3943
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2 years agoconfig: Activate SECCOMP also on MIPS 64
Hauke Mehrtens [Mon, 1 Nov 2021 13:48:22 +0000 (14:48 +0100)]
config: Activate SECCOMP also on MIPS 64

This activates SECCOMP also on mips64 and mips64el.

This was working fine in a basic test in qemu.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agotoolchain: Allow sanitizer on mips and mipsel
Hauke Mehrtens [Sun, 31 Oct 2021 16:40:06 +0000 (17:40 +0100)]
toolchain: Allow sanitizer on mips and mipsel

Support for libsanitizer on MIPS 32 and MIPSEL 32 was added with GCC 9.
MIPS 64 and ARC are still not supported.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agobinutils: Update to version 2.37
Hauke Mehrtens [Sun, 31 Oct 2021 17:25:36 +0000 (18:25 +0100)]
binutils: Update to version 2.37

This matches the version used in the toolchain.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agostrace: Update to version 5.14
Hauke Mehrtens [Sun, 31 Oct 2021 16:39:50 +0000 (17:39 +0100)]
strace: Update to version 5.14

Explicitly deactivate libselinux, otherwise we get a hard dependency to
libselinux.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agovalgrind: Activate also on MIPS 64
Hauke Mehrtens [Mon, 1 Nov 2021 13:47:02 +0000 (14:47 +0100)]
valgrind: Activate also on MIPS 64

This activates valgrind also on mips64 and mips64el.

This was working fine in a basic test in qemu.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agovalgrind: Update to version 3.18.1
Hauke Mehrtens [Sun, 31 Oct 2021 16:39:23 +0000 (17:39 +0100)]
valgrind: Update to version 3.18.1

This version has some improvements for musl.
This version works fine for me on MIPS 32 BE without MIPS16 even on musl.

The additional patch is needed to make valgrind use the correct syscall
numbers for new syscalls like clock_gettime64. The MIPS architecture
uses special syscall ranges which are different from most other systems.
The patch is pending upstream: https://bugs.kde.org/show_bug.cgi?id=444781

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agogdb: Update to version 11.1
Hauke Mehrtens [Sun, 31 Oct 2021 16:38:57 +0000 (17:38 +0100)]
gdb: Update to version 11.1

GDB 11.1 now depends on gmp.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agotoolchain: gdb: Update to version 11.1
Hauke Mehrtens [Sun, 31 Oct 2021 16:37:59 +0000 (17:37 +0100)]
toolchain: gdb: Update to version 11.1

The removed patch was already applied upstream.

gdb now mandatory depends on gmp, tell configure where to find it
explicitly. We already build gmp in the tools directory for gcc. Also
make it use mpfr and mpc as we also build both of them.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agoipq40xx: disable some devices due to kernel size
Robert Marko [Wed, 3 Nov 2021 15:45:38 +0000 (16:45 +0100)]
ipq40xx: disable some devices due to kernel size

Disable some of the ipq40xx devices due to their kernel size limitations.

These devices fail to build with kernel 5.10 and full buildbot config.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
[keep gl-b1300/gl-s1300 enabled, extend commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2 years agoipq40xx: switch to kernel 5.10
Adrian Schmutzler [Wed, 3 Nov 2021 21:02:42 +0000 (22:02 +0100)]
ipq40xx: switch to kernel 5.10

There have been enough tests and new developments require the new
kernel, so let's update it.

There is a bunch of devices that do not build anymore due to
kernel size limitations. These are disabled in a subsequent commit.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2 years agohostapd: add wmm qos map set by default
Felix Fietkau [Wed, 3 Nov 2021 21:40:53 +0000 (22:40 +0100)]
hostapd: add wmm qos map set by default

This implements the mapping recommendations from RFC8325, with an
update from RFC8622. This ensures that DSCP marked packets are properly
sorted into WMM classes.
The map can be disabled by setting iw_qos_map_set to something invalid
like 'none'

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agovti: squash vtiv4 and vtiv6 packages into vti
Florian Eckert [Wed, 27 Oct 2021 13:54:25 +0000 (15:54 +0200)]
vti: squash vtiv4 and vtiv6 packages into vti

This change adds the same package behaviour as gre package.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2 years agoqosify: add missing config option for nat support
Felix Fietkau [Wed, 3 Nov 2021 18:41:03 +0000 (19:41 +0100)]
qosify: add missing config option for nat support

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoqosify: include nls.mk to avoid build error with full NLS support enabled
Felix Fietkau [Wed, 3 Nov 2021 17:54:04 +0000 (18:54 +0100)]
qosify: include nls.mk to avoid build error with full NLS support enabled

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoimx: remove obsolete Kernel 5.4
Piotr Dymacz [Wed, 13 Oct 2021 12:44:51 +0000 (14:44 +0200)]
imx: remove obsolete Kernel 5.4

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2 years agoimx: update subtargets default kernel configs for 5.10
Piotr Dymacz [Thu, 8 Apr 2021 23:56:07 +0000 (01:56 +0200)]
imx: update subtargets default kernel configs for 5.10

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2 years agoimx: make kernel 5.10 default version
Piotr Dymacz [Thu, 8 Apr 2021 23:51:17 +0000 (01:51 +0200)]
imx: make kernel 5.10 default version

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2 years agoimx: introduce 'cortexa7' subtarget
Piotr Dymacz [Wed, 31 Mar 2021 07:44:36 +0000 (09:44 +0200)]
imx: introduce 'cortexa7' subtarget

This adds some essential files required by new 'cortexa7' subtarget,
dedicated for Cortex-A7 based NXP i.MX series. For now, the kernel
config-default focuses only on the i.MX 6UL family, as the following
changeset will introduce support for i.MX 6ULL based device. Support
for more platforms (e.g. i.MX 7) might be enabled later, while adding
more devices.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2 years agouboot-imx: set BUILD_SUBTARGET to 'cortexa9'
Piotr Dymacz [Sun, 28 Mar 2021 22:48:15 +0000 (00:48 +0200)]
uboot-imx: set BUILD_SUBTARGET to 'cortexa9'

All currently supported devices belong to the imx/cortexa9 subtarget.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2 years agouboot-envtools: move imx to imx_cortexa9
Piotr Dymacz [Wed, 13 Oct 2021 12:52:43 +0000 (14:52 +0200)]
uboot-envtools: move imx to imx_cortexa9

Subtarget-specific files under 'uboot-envtools' package are supported
since 6f3a05ebb0 ("uboot-envtools: support uci-default config also per
subtargets").

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2 years agoimx: split into arch-specific subtargets
Piotr Dymacz [Sun, 28 Mar 2021 22:33:20 +0000 (00:33 +0200)]
imx: split into arch-specific subtargets

Modern NXP i.MX series includes several different families, based on
single- or multi-core Arm Cortex-A CPUs. To be able to support more
families within a single target, we split the 'imx' in arch-specific
subtargets, starting with 'cortexa9' for the Cortex-A9 based i.MX 6,
already supported by the original 'imx6' target.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2 years agouboot-imx6: rename to 'uboot-imx'
Piotr Dymacz [Sun, 28 Mar 2021 16:51:58 +0000 (18:51 +0200)]
uboot-imx6: rename to 'uboot-imx'

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2 years agouboot-envtools: rename 'imx6' to 'imx'
Piotr Dymacz [Sun, 28 Mar 2021 16:11:23 +0000 (18:11 +0200)]
uboot-envtools: rename 'imx6' to 'imx'

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2 years agokobs-ng: update dependencies after 'imx6' -> 'imx' rename
Piotr Dymacz [Sun, 28 Mar 2021 16:03:23 +0000 (18:03 +0200)]
kobs-ng: update dependencies after 'imx6' -> 'imx' rename

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2 years agokernel: update dependencies after 'imx6' -> 'imx' rename
Piotr Dymacz [Sun, 28 Mar 2021 15:07:02 +0000 (17:07 +0200)]
kernel: update dependencies after 'imx6' -> 'imx' rename

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2 years agoimx6: rename target to 'imx'
Piotr Dymacz [Sun, 28 Mar 2021 14:56:18 +0000 (16:56 +0200)]
imx6: rename target to 'imx'

This is first step in migrating to a generic i.MX target which in the
next steps will also get divided into arch-specific subtargets.

In the result, this will make it possible to support, within a single
target, also other modern NXP i.MX families, like the i.MX 7, i.MX 8
or recently introduced i.MX 9.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2 years agoimx6: refresh and update target kernel configs
Piotr Dymacz [Sun, 28 Mar 2021 14:46:21 +0000 (16:46 +0200)]
imx6: refresh and update target kernel configs

This is a minor extension of the commit 26ae69fd03 ("imx6: refresh
kernel config with 5.10 symbols"), with correct and full disable of
the Arm Cortex-A7 based i.MX 6UL and 6UL{L,Z} families support and
re-enable of the Cortex-A9 based i.MX 6L{S,X}.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2 years agoimx6: image: fix Gateworks Ventana boot script filename
Piotr Dymacz [Sat, 26 Jun 2021 03:58:42 +0000 (05:58 +0200)]
imx6: image: fix Gateworks Ventana boot script filename

U-Boot for the Gateworks Ventana includes filename of the boot script in
the default/embedded environment (see 'include/configs/gw_ventana.h' in
the U-Boot sources).

This restores the old boot script filename ('6x_bootscript-ventana'),
making Ventana boards boot again.

Fixes: 8dba71dd33 ("imx6: image: drop BOOT_SCRIPT and fix DEVICE_NAME")
Reported-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2 years agoath79: add support for Netgear R6100
Piotr Dymacz [Fri, 17 Sep 2021 12:52:04 +0000 (14:52 +0200)]
ath79: add support for Netgear R6100

Netgear R6100 is a dual-band Wi-Fi 5 (AC1200) router based on Qualcomm
Atheros (AR9344 + QCA9882) platform. Support for this device was first
introduced in 15f6f67d18 (ar71xx). FCC ID: PY312400225.

Specifications:

- Atheros AR9344 (560 MHz)
- 128 MB of RAM (DDR2)
- 128 MB of flash (parallel NAND)
- 2T2R 2.4 GHz Wi-Fi (AR9344)
- 2T2R 5 GHz Wi-Fi (QCA9882)
- 5x 10/100 Mbps Ethernet (AR9344)
- 4x internal antenna
- 1x USB 2.0 (GPIO-controlled power)
- 6x LED, 3x button (reset, Wi-Fi, WPS)
- UART (4-pin, 2.54 mm pitch) header on PCB
- 1x mechanical power switch
- DC jack for main power input (12 V)

WARNING: sysupgrade from older stable releases is not possible, fresh
installation (via vendor's GUI or TFTP based recovery) is required.
Reason for that is increased kernel partition size.

Installation:

Use the 'factory' image under vendor's GUI or via TFTP U-Boot recovery.
You can use the 'nmrpflash' tool at a boot time, before kernel is loaded
or start it manually by pressing the 'reset' button for ~20 seconds from
powering up the device (U-Boot will start TFTP server on 192.168.1.1,
use TFTP client to send the image).

Signed-off-by: Enrico Mioso <mrkiko.rs@gmail.com>
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2 years agobcm4908: add testing support for kernel 5.10
Rafał Miłecki [Wed, 3 Nov 2021 11:12:52 +0000 (12:12 +0100)]
bcm4908: add testing support for kernel 5.10

CONFIG_COMPAT_32BIT_TIME is a new symbol and has to be set to avoid:
Provide system calls for 32-bit time_t (COMPAT_32BIT_TIME) [N/y/?] (NEW)

CONFIG_RELOCATABLE needs to be enabled to make kernel start booting.
That raises a question: do we really need CONFIG_EXPERT=y ?

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2 years agobcm4908: prepare kernel 5.10 support
Rafał Miłecki [Wed, 3 Nov 2021 08:33:48 +0000 (09:33 +0100)]
bcm4908: prepare kernel 5.10 support

It compiles but *doesn't* boot so it isn't enabled yet.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2 years agopistachio: Take bootargs from device tree
Hauke Mehrtens [Sun, 24 Oct 2021 23:48:17 +0000 (01:48 +0200)]
pistachio: Take bootargs from device tree

The boot arguments are copied into the device tree by the boot loader
and taken from the device tree by the kernel.
The code which takes the boot arguments from the different sources was
reworked with kernel 5.5.

We have to activate CONFIG_MIPS_CMDLINE_DTB_EXTEND to take the boot
arguments from the device tree.

This makes the system boot on the board again.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agopistachio: Make kernel 5.10 patches apply
Hauke Mehrtens [Sun, 24 Oct 2021 18:59:54 +0000 (20:59 +0200)]
pistachio: Make kernel 5.10 patches apply

Make the patches apply on kernel 5.10 and refresh the patches and the
kernel configuration on top of kernel 5.10.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agopistachio: Copy kernel 5.4 patches to 5.10
Hauke Mehrtens [Sun, 24 Oct 2021 18:31:08 +0000 (20:31 +0200)]
pistachio: Copy kernel 5.4 patches to 5.10

This just copies the patches and the configuration from kernel 5.4 to
kernel 5.10.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agopistachio: Fix FIT image configuration name
Hauke Mehrtens [Sun, 24 Oct 2021 18:13:23 +0000 (20:13 +0200)]
pistachio: Fix FIT image configuration name

The pistachio U-Boot expects a default configuration with the name
config@1 in the FIT image. The default was changed in OpenWrt some
months ago.
This makes the board boot again.

Fixes: 9f714398e060 ("build: use config-1 instead of config@1 as default")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agokernel: Set some options in generic configuration
Hauke Mehrtens [Sun, 24 Oct 2021 18:42:06 +0000 (20:42 +0200)]
kernel: Set some options in generic configuration

Add CONFIG_USB_ETH and CONFIG_PWM_JZ4740 to generic kernel
configuration.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agostrace: remove code coverage makefile var
Rosen Penev [Wed, 20 Oct 2021 23:27:49 +0000 (16:27 -0700)]
strace: remove code coverage makefile var

It relies on a custom ax_code_coverage.m4 file included with strace.
Unfortunately, this conflicts with the one included with
autoconf-macros. Instead of creating a huge patch to fix it, just remove
the variable as code coverage is not used here.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agokernel: 5.10: simplify logic in packet mangling patch
Mathias Kresin [Sat, 23 Oct 2021 19:14:04 +0000 (21:14 +0200)]
kernel: 5.10: simplify logic in packet mangling patch

I had quite a hard time to understand what the change to net/core/dev.c
is supposed to do.

Simplify the change by returning NETDEV_TX_OK in case a eth_mangle_tx
callback was set but returned NULL instead of setting the return value
in the else branch.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2 years agokernel: 5.10: packet mangling code only for ar8216 driver
Mathias Kresin [Sat, 23 Oct 2021 19:14:03 +0000 (21:14 +0200)]
kernel: 5.10: packet mangling code only for ar8216 driver

Only the ar8216 switch driver uses the packet mangling code.

Update the kernel configs accordingly.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2 years agokernel: 5.10: fix ar8216 vlans
Mathias Kresin [Sat, 23 Oct 2021 19:14:02 +0000 (21:14 +0200)]
kernel: 5.10: fix ar8216 vlans

ar8216 switches have a hardware bug, which renders normal 802.1q support
unusable. Packet mangling is required to fix up the vlan for incoming
packets.

The patch was ommited at the time kernel 5.10 support was added but is
still required for ar8216 switches.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2 years agouml: add Kernel 5.10 support via testing
Paul Spooren [Thu, 21 Oct 2021 00:48:06 +0000 (14:48 -1000)]
uml: add Kernel 5.10 support via testing

Add the latest default Kernel for testing. This step is required to keep
UML in tree for the next release.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2 years agouml: build target again via the Buildbots
Paul Spooren [Thu, 21 Oct 2021 01:07:25 +0000 (15:07 -1000)]
uml: build target again via the Buildbots

The UML target been outdated for a long time. Instead of just carrying
unmaintained code we should build it again and allow people and CIs to
use it for testing.

This commit removes the `source-only` feature which disables building.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2 years agouml: drop 32Bit host build support
Paul Spooren [Wed, 20 Oct 2021 03:41:08 +0000 (17:41 -1000)]
uml: drop 32Bit host build support

This step drops support host build systems other than x86/64 to allow
two Kernel configuration in parallel. With this commit the setup follow
the config style of all other targets.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2 years agouml: update README to usable examples
Paul Spooren [Wed, 20 Oct 2021 03:34:26 +0000 (17:34 -1000)]
uml: update README to usable examples

The current `uml` README is terribly outdated and non of the examples
work by default. Fix that and while at it convert it to Markdown.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2 years agotools/libressl: update to 3.4.1
Rosen Penev [Wed, 22 Sep 2021 07:49:33 +0000 (00:49 -0700)]
tools/libressl: update to 3.4.1

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agobuild: fix ldconfig executable error in python
Damien Mascord [Mon, 1 Nov 2021 09:06:20 +0000 (20:06 +1100)]
build: fix ldconfig executable error in python

The empty executable is causing problems with meson builds, due to the
error: OSError: [Errno 8] Exec format error: 'ldconfig'

This patch changes the empty ldconfig stub to symlink to /bin/true to
work around this issue.

Fixes: FS#4117
Fixes: 3bd31cc4d2ff ("tools/meson: update to 0.60.0")
Signed-off-by: Damien Mascord <tusker@tusker.org>
Tested-by: Aleksander Jan Bajkowski <olek2@wp.pl> # Tested on Debian 11
Tested-By: Lucian Cristian <lucian.cristian@gmail.com>
Tested-By: Baptiste Jonglez <git@bitsofnetworks.org>
Cc: Rosen Penev <rosenp@gmail.com>
2 years agoqosify: add missing dependency
Felix Fietkau [Tue, 2 Nov 2021 09:57:06 +0000 (10:57 +0100)]
qosify: add missing dependency

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoinclude/bpf.mk: fix compile for big-endian targets
Felix Fietkau [Tue, 2 Nov 2021 09:39:35 +0000 (10:39 +0100)]
include/bpf.mk: fix compile for big-endian targets

llvm-opt and llc need endian flags in the target as well

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agobpf-headers: unset PKG_CONFIG_PATH
Felix Fietkau [Tue, 2 Nov 2021 09:36:14 +0000 (10:36 +0100)]
bpf-headers: unset PKG_CONFIG_PATH

This fixes an issue where the kernel would pick up an incompatible target
libyaml for building host tools

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoinclude/bpf.mk: fix typo
Felix Fietkau [Tue, 2 Nov 2021 08:56:10 +0000 (09:56 +0100)]
include/bpf.mk: fix typo

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoiproute2: Avoid unnecessary package rebuilds
Eneas U de Queiroz [Thu, 21 Oct 2021 13:35:41 +0000 (10:35 -0300)]
iproute2: Avoid unnecessary package rebuilds

Build the tc-mod-iptables before the tc-tiny and tc-full packages.

This avoids unnecessary package rebuild when calling make back to back.
Before this change, tc-mod-iptables will be built after the main tc
binary packages.

Both tc-tiny and tc-full depend on tc-mod-ipables.  If make is called
after the packages are already built, it will check the timestamps of
both packages, and will rebuild the main binaries, since the module
package will be newer than the tc package.

Calling BuildPackage,mod-iptables first ensures that its variant gets
built before the other packages' variants.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2 years agof2fstools: set each library package VARIANT
Eneas U de Queiroz [Sun, 17 Oct 2021 15:34:05 +0000 (12:34 -0300)]
f2fstools: set each library package VARIANT

Set the different libf2fs packages's VARIANT, so that the right settings
will be used by each different variant, if they are both being built.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2 years agohostapd: avoid unnecessary package rebuilds
Eneas U de Queiroz [Fri, 15 Oct 2021 16:39:19 +0000 (13:39 -0300)]
hostapd: avoid unnecessary package rebuilds

Package hostapd-common is a dependency of every other package defined in
hostpad Makefile.  It is currently built next to the bottom of that
Makefile's package list.

If you run make back to back, then check-compile will compare the
hostapd-common timestamp to the variant being compiled, to decide if the
varint needs to be rebuilt or not.  Since the hostapd-conf package is
built towards the end of the list, it will be newer than most of the
variants, causing unnecessary package rebuilds.

Move it to the top, so that its timestamp will be older than dependent
packages, avoiding unnecessary rebuild of every selected variant.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2 years agobuild: avoid rebuilds of unset VARIANT packages
Eneas U de Queiroz [Fri, 22 Oct 2021 19:12:10 +0000 (16:12 -0300)]
build: avoid rebuilds of unset VARIANT packages

If a Makefile defines some packages with VARIANT set, and others without
it, the latter will be built once for every different VARIANT set, each
build trumping the previous one.

Avoid rebuilds by only building unnamed variant packages when the first
variant is built.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2 years agobuild: kernel: avoid unnecessary package rebuilds
Eneas U de Queiroz [Fri, 15 Oct 2021 13:30:05 +0000 (10:30 -0300)]
build: kernel: avoid unnecessary package rebuilds

The $(LINUX_DIR)/.config timesptamp changes between runs of
make target/compile and make target/install (which builds the image).

Kernel-dependent packages and out of tree modules are built in between
those runs, and they check the .config timestamp to decide if they need
to be rebuilt.

Save the target/compile .config to use its timestamp if the file does
not change between runs.  That way the subsequent kernel packages are
not unnecessarily rebuilt when you run 'make' back to back.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2 years agodownload: improve handling of invalid local files
Eneas U de Queiroz [Thu, 19 Aug 2021 21:14:22 +0000 (18:14 -0300)]
download: improve handling of invalid local files

4e19cbc5533: [download: handle possibly invalid local tarballs] added a
FORCE rule to downloaded files, so that they will be always checked by
download.pl.

As a side-effect, check-compile will fail, forcing unnecessary package
rebuilds.
The check-compile.txt log shows (for libxml2 for example):
  Considering target file '.../dl/libxml2-2.9.12.tar.gz'.
    ...
    prerequisite 'FORCE' of target '.../dl/libxml2-2.9.12.tar.gz' does
    not exist.
    Must remake target '.../dl/libxml2-2.9.12.tar.gz'.
    ...
   Giving up on target file '...libxml2-2.9.12/.prepared_...'.
   Giving up on target file '...libxml2-2.9.12/.configured_...'.
   Giving up on target file '...libxml2-2.9.12/.built'.
   Giving up on target file '...stamp/.libxml2_installed'.
  Giving up on target file '.compile'.

Then the package is rebuilt even if it is not otherwise needed.

To fix this, instead of always forcing the download target to be remade,
check its hash first: if it matches, then the FORCE is not added.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2 years agoqosify: fix package section/category
Felix Fietkau [Mon, 1 Nov 2021 19:16:52 +0000 (20:16 +0100)]
qosify: fix package section/category

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoprocd: update to git HEAD
Daniel Golle [Mon, 1 Nov 2021 17:57:32 +0000 (17:57 +0000)]
procd: update to git HEAD

 1056fc4 jail: elf: Use 64 bit variables for elf offsets
 c1976e5 jail: elf: Remove MIPS 64 warning

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agokernel: remove custom partition name patch
Daniel Golle [Mon, 1 Nov 2021 16:17:45 +0000 (16:17 +0000)]
kernel: remove custom partition name patch

Don't patch the kernel to expose the partition name in sysfs as it is
already exposed via 'uevent'.
All previous users have been converted to use 'uevent', so we can
safely drop the custom patch.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agofstools: update to git HEAD
Daniel Golle [Mon, 1 Nov 2021 16:17:03 +0000 (16:17 +0000)]
fstools: update to git HEAD

 19fd7fc libfstools: make sure file is closed on error
 d390744 libfstools: use uevent instead of relying on custom kernel patch

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agobase-files: drop get_partition_by_name shell function
Daniel Golle [Mon, 1 Nov 2021 14:03:42 +0000 (14:03 +0000)]
base-files: drop get_partition_by_name shell function

find_mmc_part provides a better alternative and all users of
get_partition_by_name have been removed.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agomediatek: mt7623: make use of find_mmc_part
Daniel Golle [Mon, 1 Nov 2021 14:03:25 +0000 (14:03 +0000)]
mediatek: mt7623: make use of find_mmc_part

Use find_mmc_part instead of previously introduced
get_partition_by_name which requires a custom kernel patch.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agomediatek: mt7622: make use of find_mmc_part
Daniel Golle [Mon, 1 Nov 2021 14:02:41 +0000 (14:02 +0000)]
mediatek: mt7622: make use of find_mmc_part

Use find_mmc_part instead of previously introduced
get_partition_by_name which requires a custom kernel patch.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agouboot-envtools: mt7622: make use of find_mmc_part
Daniel Golle [Mon, 1 Nov 2021 14:00:57 +0000 (14:00 +0000)]
uboot-envtools: mt7622: make use of find_mmc_part

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agobase-files: allow specifiying rootdev for find_mmc_part
Daniel Golle [Mon, 1 Nov 2021 13:58:20 +0000 (13:58 +0000)]
base-files: allow specifiying rootdev for find_mmc_part

Some devices got more than one mmc device.
Allow specifying the root device as 2nd parameter of find_mmc_part so
scripts can avoid matching irrelevant partitions on wrong mmc device.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agobuild: fix bpf toolchain dependency for qosify
Felix Fietkau [Mon, 1 Nov 2021 17:40:03 +0000 (18:40 +0100)]
build: fix bpf toolchain dependency for qosify

Add hidden symbols to fix defaults with CONFIG_DEVEL unset

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoqosify: add package for simple qos based on ebpf+cake
Felix Fietkau [Mon, 1 Nov 2021 15:35:16 +0000 (16:35 +0100)]
qosify: add package for simple qos based on ebpf+cake

qosify is simple daemon for setting up and managing CAKE along with a custom
eBPF based classifier that sets DSCP fields of packets.

It is configured via UCI and it supports the following features:
- simple TCP/UDP port based mapping
- IP address based mapping
- priority boosting based on average packet size
- bulk flow detection based on number of packets per second
- dynamically add IP entries with timeout

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agobpf-headers: add a package with kernel headers for ebpf
Felix Fietkau [Tue, 26 Oct 2021 18:41:22 +0000 (20:41 +0200)]
bpf-headers: add a package with kernel headers for ebpf

In order to genererate suitable kernel headers, a 5.10 kernel tree is
prepared with a default config for mips. The arch is forced to mips in
order to avoid issues with inline asm on various architectures in a way
that doesn't involve relying on the host toolchain/headers.
It also has the advantage of supporting both endian types

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoconfig: add choice for selecting the LLVM toolchain type
Felix Fietkau [Mon, 1 Nov 2021 14:36:36 +0000 (15:36 +0100)]
config: add choice for selecting the LLVM toolchain type

This is global for all BPF based packages

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agobuild: add HOST_OS_LINUX and HOST_OS_MACOS config symbols
Felix Fietkau [Wed, 27 Oct 2021 09:47:52 +0000 (11:47 +0200)]
build: add HOST_OS_LINUX and HOST_OS_MACOS config symbols

This can be used to simplify host os tests in various places

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agodnsmasq: fix jail mount in case of ignore_hosts_dir being set
Daniel Golle [Mon, 1 Nov 2021 11:59:46 +0000 (11:59 +0000)]
dnsmasq: fix jail mount in case of ignore_hosts_dir being set

Commit a2fcd3900c ("dnsmasq: improve init script") broke the existing
handling for hosts_dir. Remove the redundant mount again to fix it.

Reported-by: Hartmut Birr <e9hack@gmail.com>
Fixes: a2fcd3900c ("dnsmasq: improve init script")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agoubus: update to the latest version
Felix Fietkau [Mon, 1 Nov 2021 10:59:41 +0000 (11:59 +0100)]
ubus: update to the latest version

b743a331421d ubusd: log ACL init errors
2099bb3ad997 libubus: use list_empty/list_first_entry in ubus_process_pending_msg
ef038488edc3 libubus: process pending messages in data handler if stack depth is 0
a72457b61df0 libubus: increase stack depth for processing obj msgs

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoipq40xx: add support for Netgear SRR60/SRS60 and RBR50/RBS50
Davide Fioravanti [Wed, 2 Sep 2020 00:10:16 +0000 (02:10 +0200)]
ipq40xx: add support for Netgear SRR60/SRS60 and RBR50/RBS50

The Netgear SRS60 and SRR60 (sold together as SRK60) are two almost
identical AC3000 routers. The SRR60 has one port labeled as wan while
the SRS60 not. The RBR50 and RBS50 (sold together as RBK50) have a
different external shape but they have an USB 2.0 port on the back.

This patch has been tested only on SRS60 and RBR50, but should work
on SRR60 and RBS50.

Hardware
--------
SoC:   Qualcomm IPQ4019 (717 MHz, 4 cores 4 threads)
RAM:   512MB DDR3
FLASH: 4GB EMMC
ETH:
  - 3x 10/100/1000 Mbps Ethernet
  - 1x 10/100/1000 Mbps Ethernet (WAN)
WIFI:
  - 2.4GHz: 1x IPQ4019 (2x2:2)
  - 5GHz:   1x IPQ4019 (2x2:2)
  - 5GHz:   1x QCA9984 (4x4:4)
  - 6 internal antennas
BTN:
  - 1x Reset button
  - 1x Sync button
  - 1x ON/OFF button
LEDS:
  - 8 leds controlled by TLC59208F (they can be switched on/off
    independendently but the color can by changed by GPIOs)
  - 1x Red led (Power)
  - 1x Green led (Power)
UART:
  - 115200-8-N-1

Everything works correctly.

Installation
------------
These routers have a dual partition system. However this firmware works
only on boot partition 1 and the OEM web interface will always flash on
the partition currently not booted.

The following steps will use the SRS60 firmware, but you have to chose
the right firmware for your router.

There are 2 ways to install Openwrt the first time:

1) Using NMRPflash
 1. Download nmrpflash (https://github.com/jclehner/nmrpflash)
 2. Put the openwrt-ipq40xx-generic-netgear_srs60-squashfs-factory.img
file in the same folder of the nmrpflash executable
 3. Connect your pc to the router using the port near the power button.
 4. Run "nmrpflash -i XXX -f openwrt-ipq40xx-generic-netgear_srs60-squashfs-factory.img".
Replace XXX with your network interface (can be identified by
running "nmrpflash -L")
 5. Power on the router and wait for the flash to complete. After about
a minute the router should boot directly to Openwrt. If nothing
happens try to reboot the router. If you have problems flashing
try to set "10.164.183.253" as your computer IP address

2) Without NMRPflash
The OEM web interface will always flash on the partition currently not
booted, so to flash OpenWrt for the first time you have to switch to
boot partition 2 and then flash the factory image directly from the OEM
web interface.

To switch on partition 2 you have to enable telnet first:
 1. Go to http://192.168.1.250/debug.htm and check "Enable Telnet".
 2. Connect through telent ("telnet 192.168.1.250") and login using
admin/password.

To read the current boot_part:
artmtd -r boot_part

To write the new boot_part:
artmtd -w boot_part 02

Then reboot the router and then check again the current booted
partition

Now that you are on boot partition 2 you can flash the factory Openwrt
image directly from the OEM web interface.

Restore OEM Firmware
--------------------
 1. Download the stock firmware from official netgear support.
 2. Follow the nmrpflash procedure like above, using the official
Netgear firmware (for example SRS60-V2.2.1.210.img)

        nmrpflash -i XXX -f SRS60-V2.2.1.210.img

Notes
-----
1) You can check and edit the boot partition in the Uboot shell using
the UART connection.
"boot_partition_show" shows the current boot partition
"boot_partition_set 1" sets the current boot partition to 1

2) Router mac addresses:

   LAN XX:XX:XX:XX:XX:69
   WAN XX:XX:XX:XX:XX:6a
   WIFI 2G XX:XX:XX:XX:XX:69
   WIFI 5G XX:XX:XX:XX:XX:6b
   WIFI 5G (2nd) XX:XX:XX:XX:XX:6c

   LABEL XX:XX:XX:XX:XX:69

Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
Signed-off-by: Robert Marko <robimarko@gmail.com>
[added 5.10 changes for 901-arm-boot-add-dts-files.patch, moved
sysupgrade mmc.sh to here and renamed it, various dtsi changes]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agobase-files: add minimal mmc support
Davide Fioravanti [Tue, 1 Sep 2020 23:18:16 +0000 (01:18 +0200)]
base-files: add minimal mmc support

Added minimal mmc support for helper functions:

 - find_mmc_part: Look for a given partition name. Returns the
coresponding partition path
 - caldata_extract_mmc: Look for a given partition name and then
extracts the calibration data
 - mmc_get_mac_binary: Returns the mac address from a given partition
name and offset

Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
Signed-off-by: Robert Marko <robimarko@gmail.com>
[replace dd with caldata_dd, moved sysupgrade mmc to orbi]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agoipq40xx: enable CONFIG_CMDLINE_PARTITION and CONFIG_LEDS_TLC591XX
Davide Fioravanti [Tue, 1 Sep 2020 22:55:11 +0000 (00:55 +0200)]
ipq40xx: enable CONFIG_CMDLINE_PARTITION and CONFIG_LEDS_TLC591XX

CONFIG_CMDLINE_PARTITION:
Some devices with mmc like the Netgear Orbi Pro SRS60 or Netgear Orbi
RBR50 needs to hardcode the partitions layout in the cmdline boot
correctly

CONFIG_LEDS_TLC591XX:
This is needed for the led driver found in the Netgear Orbi Pro SRS60

Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
Signed-off-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Shang Jia <jiash416@gmail.com>
[added 5.10 config]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agorealtek: backport GPIO IRQ index fix
Sander Vanheule [Sun, 31 Oct 2021 13:41:54 +0000 (14:41 +0100)]
realtek: backport GPIO IRQ index fix

Backport the patch queued upstream for 5.16. The patch differs slightly
from the upstream patch due to an upstream change that added a
convenience function.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
2 years agokernel/modules: prevent bonding driver to create default bond0 interface
Florian Eckert [Wed, 8 Sep 2021 12:14:27 +0000 (14:14 +0200)]
kernel/modules: prevent bonding driver to create default bond0 interface

When loading the bonding driver, bonding interface are automatically
created on bonding module load.

> ip a s bond0
> 14: bond0: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN
> group default qlen 1000
>    link/ether a6:f2:20:64:c1:b9 brd ff:ff:ff:ff:ff:ff

This is not necessary in openwrt as we do not use this created interface.
The netifd creates a bonding interface based on its network configuration
name and configures this over the netifd bonding proto handler.

In order to keep the overview of the interfaces clear, bonding
interfaces should not be created automatically when loading this module,
because they are not used anyway.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2 years agoelfutils: enable host build
Lucian Cristian [Tue, 31 Aug 2021 07:04:36 +0000 (10:04 +0300)]
elfutils: enable host build

frr 8.0 needs host libelf dev
add option for host build
tested on x86, ramips, kirkwood

Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
[changed commit author's email]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agoipq40xx: fix sleep clock
Pavel Kubelun [Mon, 6 May 2019 17:59:40 +0000 (20:59 +0300)]
ipq40xx: fix sleep clock

It seems like sleep_clk was copied from ipq806x.
Fix ipq40xx sleep_clk to the value QSDK defines.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [5.4+5.10]
2 years agoapm821xx: MBL: MR24: fetch IP address over dhcp by default
Christian Lamparter [Mon, 11 Feb 2019 16:30:07 +0000 (17:30 +0100)]
apm821xx: MBL: MR24: fetch IP address over dhcp by default

This patch changes the default network configuration
to fetch the IP addresses over dhcp instead of being
statically assigned.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agoath79: fix UBNT Aircube AC gpios
Nicolò Veronese [Sun, 17 Oct 2021 01:14:41 +0000 (03:14 +0200)]
ath79: fix UBNT Aircube AC gpios

GPIOs on the Aircube AC are wrong:
 - Reset GPIO moved from 17 to 12
 - PoE Pass Through GPIO for Aircube AC is 3

Fixes: 491ae3357e10 ("ath79: add support for Ubiquiti airCube AC")
Signed-off-by: Nicolò Veronese <nicveronese@gmail.com>
2 years agoath79: add support for Letv LBA-047-CH
Shiji Yang [Tue, 28 Sep 2021 16:25:01 +0000 (00:25 +0800)]
ath79: add support for Letv LBA-047-CH

Specifications:
SOC: QCA9531 650 MHz
ROM: 16 MiB Flash (Winbond W25Q128FV)
RAM: 128 MiB DDR2 (Winbond W971GG6SB)
LAN: 10/100M *2
WAN: 10/100M *1
LED: BGR color *1

Mac address:
label C8:0E:77:xx:xx:68 art@0x0
lan C8:0E:77:xx:xx:62 art@0x6
wan C8:0E:77:xx:xx:68 art@0x0    (same as the label)
wlan C8:0E:77:xx:xx:B2 art@0x1002 (load automatically)

TFTP installation:
* Set local IP to 192.168.67.100 and open tftpd64, link lan
  port to computer.
  Rename "xxxx-factory.bin" to
  "openwrt-ar71xx-generic-ap147-16M-rootfs-squashfs.bin".
* Make sure firmware file is in the tftpd's directory, push
  reset button and plug in, hold it for 5 seconds, and then
  it will download firmware from tftp server automatically.

More information:
* This device boot from flash@0xe80000 so we need a okli
  loader to deal with small kernel partition issue. In order
  to make full use of the storage space, connect a part of the
  previous kernel partition to the firmware.

  Stock                          Modify
  0x000000-0x040000(u-boot)      0x000000-0x040000(u-boot)
  0x040000-0x050000(u-boot-env)  0x000000-0x050000(u-boot-env)
  0x050000-0xe80000(rootfs)      0x050000-0xe80000(firmware part1)
  0xe80000-0xff0000(kernel)      0xe80000-0xe90000(okli-loader)
                                 0xe90000-0xff0000(firmware part2)
  0xff0000-0x1000000(art)        0xff0000-0x1000000(art)

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2 years agoath79: add support for Dongwon T&I DW02-412H
Jihoon Han [Fri, 1 Oct 2021 05:53:06 +0000 (14:53 +0900)]
ath79: add support for Dongwon T&I DW02-412H

Dongwon T&I DW02-412H is a 2.4/5GHz band 11ac (WiFi-5) router, based on
Qualcomm Atheros QCA9557.

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

- SoC: Qualcomm Atheros QCA9557-AT4A
- RAM: DDR2 128MB
- Flash: SPI NOR 2MB (Winbond W25Q16DVSSIG / ESMT F25L16PA(2S)) +
         NAND 64/128MB
- WiFi:
  - 2.4GHz: QCA9557 WMAC
  - 5GHz: QCA9882-BR4A
- Ethernet: 5x 10/100/1000Mbps
  - Switch: QCA8337N-AL3C
- USB: 1x USB 2.0
- UART:
  - JP2: 3.3V, TX, RX, GND (3.3V is the square pad) / 115200 8N1

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

1.  Connect a serial interface to UART header and
    interrupt the autostart of kernel.
2.  Transfer the factory image via TFTP and write it to the NAND flash.
3.  Update U-Boot environment variable.
    > tftpboot 0x81000000 <your image>-factory.img
    > nand erase 0x1000000
    > nand write 0x81000000 0x1000000 ${filesize}
    > setenv bootpart 2
    > saveenv

Revert to stock firmware
--------------

1.  Revert to stock U-Boot environment variable.
    > setenv bootpart 1
    > saveenv

MAC addresses as verified by OEM firmware
--------------

   WAN: *:XX (label)
   LAN: *:XX + 1
  2.4G: *:XX + 3
    5G: *:XX + 4

The label MAC address was found in art 0x0.

Credits
--------------

Credit goes to the @manatails who first developed how to port OpenWRT
to this device and had a significant impact on this patch.

And thanks to @adschm and @mans0n for guiding me to revise the code
in many ways.

Signed-off-by: Jihoon Han <rapid_renard@renard.ga>
Reviewed-by: Sungbo Eo <mans0n@gorani.run>
Tested-by: Sungbo Eo <mans0n@gorani.run>
2 years agokernel: add support for ESMT F25L16PA(2S) SPI-NOR
Jihoon Han [Fri, 1 Oct 2021 05:52:19 +0000 (14:52 +0900)]
kernel: add support for ESMT F25L16PA(2S) SPI-NOR

This fixes support for Dongwon T&I DW02-412H which uses F25L16PA(2S) flash.

Signed-off-by: Jihoon Han <rapid_renard@renard.ga>
Reviewed-by: Sungbo Eo <mans0n@gorani.run>
[refresh patches]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2 years agobuild: fix various typos
Josh Soref [Sun, 26 Sep 2021 21:58:59 +0000 (17:58 -0400)]
build: fix various typos

Fix typos in comment and user-facing help text.

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
[split out config changes, adjust commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2 years agoscripts: fix various typos
Josh Soref [Sun, 26 Sep 2021 21:58:59 +0000 (17:58 -0400)]
scripts: fix various typos

This only affects typos in comments or user-facing output.

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
[only picks changes to scripts, drop "commandline" replacement,
 fix case for "arbitrary", improve commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2 years agoipq806x: ecw5410: use bootloader provided MAC-s
Robert Marko [Sun, 31 Oct 2021 13:33:15 +0000 (14:33 +0100)]
ipq806x: ecw5410: use bootloader provided MAC-s

Currently, we are overriding the bootloader provided MAC-s as the ethernet
aliases are reversed so MAC-s were fixed up in userspace.
There is no need to do that as we can just fix the aliases instead and get
rid of MAC setting via userspace helper.

Fixes: 59f0a0f ("ipq806x: add Edgecore ECW5410 support")
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2 years agoipq806x: ecw5410: fix PCI1 radio caldata
Robert Marko [Sun, 31 Oct 2021 11:27:23 +0000 (12:27 +0100)]
ipq806x: ecw5410: fix PCI1 radio caldata

ECW5410 has 2 QCA9984 cards, one per PCI controller.
They are located at PCI adresses 0001:01:00.0 and 0002:01:00.0.

Currently, pre-cal is not provided for 0001:01:00.0 at all,but for
0000:01:00.0 which is incorrect and causes the ath10k driver to not
be able to fetch the BMI ID and use that to fetch the proper BDF but
rather fail with:
[   12.029708] ath10k 5.10 driver, optimized for CT firmware, probing pci device: 0x46.
[   12.031816] ath10k_pci 0001:01:00.0: enabling device (0140 -> 0142)
[   12.037660] ath10k_pci 0001:01:00.0: pci irq msi oper_irq_mode 2 irq_mode 0 reset_mode 0
[   13.173898] ath10k_pci 0001:01:00.0: qca9984/qca9994 hw1.0 target 0x01000000 chip_id 0x00000000 sub 168c:cafe
[   13.174015] ath10k_pci 0001:01:00.0: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 0
[   13.189304] ath10k_pci 0001:01:00.0: firmware ver 10.4b-ct-9984-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 crc35
[   15.492322] ath10k_pci 0001:01:00.0: failed to fetch board data for bus=pci,vendor=168c,device=0046,subsystem-vendor=168c,subsystem-device=cafe,variant=Edgecore-ECW541 from ath10k/QCA9984/hw1.0/board-2.bin
[   15.543883] ath10k_pci 0001:01:00.0: failed to fetch board-2.bin or board.bin from ath10k/QCA9984/hw1.0
[   15.543920] ath10k_pci 0001:01:00.0: failed to fetch board file: -12
[   15.552281] ath10k_pci 0001:01:00.0: could not probe fw (-12)

So, provide the pre-cal for the actual PCI card and not the non-existent
one.

Fixes: 59f0a0f ("ipq806x: add Edgecore ECW5410 support")
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2 years agoipq806x: ecw5410: drop GPIO based MDIO1 node
Robert Marko [Sun, 31 Oct 2021 10:38:31 +0000 (11:38 +0100)]
ipq806x: ecw5410: drop GPIO based MDIO1 node

It looks like this is a leftover before there was a proper MDIO driver.
Since both PHY-s are connected to the HW MDIO bus there is no reason for
this to exist anymore, especially since it uses the same pins as the HW
controller and has the pinmux for the set to "MDIO" so this worked by
pure luck as GPIO MDIO would probe first and override the HW driver.

Move the GMAC3 to simply use the same MDIO bus phandle.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>