openwrt/openwrt.git
2 years agosdk: unset BINARY_FOLDER and DOWNLOAD_FOLDER in final archives
Sven Roederer [Fri, 7 May 2021 19:35:21 +0000 (21:35 +0200)]
sdk: unset BINARY_FOLDER and DOWNLOAD_FOLDER in final archives

Using these config-options to customize the folders used at build-time makes these
folder settings appear in generated archive. This causes the SDK to be not
portable, as it's going to use the build-time folders on the new systems.
The errors vary from passing the build, disk out-of-space to permission denied.

The build-time settings of these folders are passed into the archive via Config.build.
The expected behavior is that the SDK acts after unpacking like these settings have
their defaults, using intree folders. So just filter these folders out when running
convert-config.pl to create Config.build.

This addresses the same issue that's fixed in the previous commit for the imagebuilder.

Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
(cherry picked from commit 1e4b191ac8901328a726ebdc09ebe35da4363521)

2 years agoimagebuilder: unset BINARY_FOLDER and DOWNLOAD_FOLDER in final archive
Sven Roederer [Fri, 7 May 2021 19:35:20 +0000 (21:35 +0200)]
imagebuilder: unset BINARY_FOLDER and DOWNLOAD_FOLDER in final archive

Using these config-options to customize the folders used at build-time
makes these folder settings appear in generated archive. This causes the
imagebuilder to be not portable, as it's going to use the build-time folders
on the new systems. Errors look like:

  mkdir: cannot create directory '/mnt/build': Permission denied
  Makefile:116: recipe for target '_call_image' failed
  make[2]: *** [_call_image] Error 1
  Makefile:241: recipe for target 'image' failed
  make[1]: *** [image] Error 2

The build-time settings of these folders are passed into the archives via
.config file.
The expected behavior is that after unpacking the imagebuilder acts like
these settings have their defaults, using intree folders. So unset the
build-time settings.

Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
(cherry picked from commit 6967903b01ea9f7c9f70d0185c3da276801dd78f)

2 years agobusybox: add SRV support to nslookup_lede.c patch
Perry Melange [Tue, 30 Jul 2019 09:05:22 +0000 (11:05 +0200)]
busybox: add SRV support to nslookup_lede.c patch

Add support for querying and parsing SRV DNS records to nslookup_lede.c

This patch is based on http://lists.busybox.net/pipermail/busybox/2019-June/087359.html

Signed-off-by: Perry Melange <isprotejesvalkata@gmail.com>
[reword subject, bump PKG_RELEASE]
Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit 3a359398f04f3f4c4a42d1ca274bb1a0f0303e05)

2 years agobase-files: shinit: properly handle dashes in service names
Jo-Philipp Wich [Wed, 12 May 2021 10:44:32 +0000 (12:44 +0200)]
base-files: shinit: properly handle dashes in service names

Fixes: FS#3801
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 75ea878d1ba05610121a732dc0abf7c914e83ca1)

2 years agogeneric: platform/mikrotik: release mtd device after use
Thibaut VARÈNE [Tue, 11 May 2021 10:50:21 +0000 (12:50 +0200)]
generic: platform/mikrotik: release mtd device after use

The code uses get_mtd_device_nm() which must be followed by a call to
put_mtd_device() once the handle is no longer used.

This fixes spurious shutdown console messages such as:
[ 2256.334562] Removing MTD device #7 (soft_config) with use count 1

Reported-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
(cherry picked from commit 4e385a27d6c4aab62ef7fc9856f09ebee9632985)

2 years agouqmi: fix network registration loop
Thomas Richard [Tue, 20 Apr 2021 14:49:02 +0000 (16:49 +0200)]
uqmi: fix network registration loop

With some debug in qmi.sh using following patch, some errors are visible
in the registration step
@@ -29,6 +29,7 @@ proto_qmi_init_config() {
 }

 proto_qmi_setup() {
+       set -x
        local interface="$1"
        local dataformat connstat plmn_mode mcc mnc
        local device apn auth username password pincode delay modes pdptype
@@ -224,6 +225,8 @@ proto_qmi_setup() {
                fi
        done

+       registration=$(uqmi -s -d "$device" --get-serving-system)
+
        [ -n "$modes" ] && uqmi -s -d "$device" --set-network-modes "$modes" > /dev/null 2>&1

        echo "Starting network $interface"

During the boot of the system, modem could not start automatically its
network registration.
netifd: wan (9235): + echo 'Waiting for network registration'
netifd: wan (9235): Waiting for network registration
netifd: wan (9235): + local 'registration_timeout=0'
netifd: wan (9235): + uqmi -s -d /dev/cdc-wdm1 --get-serving-system
netifd: wan (9235): + grep '"searching"'
netifd: wan (9235): + uqmi -s -d /dev/cdc-wdm1 --get-serving-system
netifd: wan (9235): + registration='{"registration":"not_registered","plmn_mcc":208,"plmn_mnc":20,"plmn_description":"","roaming":true}'
netifd: wan (9235): + '[' -n  ]
netifd: wan (9235): + echo 'Starting network wan'

As the while loop checks only "searching" pattern, uqmi.sh script quits
searching loop and continues whereas the modem is not registered

Other issue, after X seconds modem stops searching.
netifd: wan (9213): + uqmi -s -d /dev/cdc-wdm0 --get-serving-system
netifd: wan (9213): + grep '"searching"'
netifd: wan (9213): + '[' -e /dev/cdc-wdm0 ]
netifd: wan (9213): + '[' 3 -lt 0 -o 0 '=' 0 ]
netifd: wan (9213): + let registration_timeout++
netifd: wan (9213): + sleep 1
netifd: wan (9213): + uqmi -s -d /dev/cdc-wdm0 --get-serving-system
netifd: wan (9213): + grep '"searching"'
netifd: wan (9213): + uqmi -s -d /dev/cdc-wdm0 --get-serving-system
netifd: wan (9213): + registration='{"registration":"not_registered"}'
netifd: wan (9213): + '[' -n  ]
netifd: wan (9213): + echo 'Starting network wan'
netifd: wan (9213): Starting network wan

If registration_timeout is not expired, registration can be restarted

Signed-off-by: Thomas Richard <thomas.richard@kontron.com>
Tested-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 2eda042d553c23590c9d6ade8a1a17ffcfb4be7c)

2 years agokernel: fix parsing fixed subpartitions
Rafał Miłecki [Thu, 6 May 2021 11:10:17 +0000 (13:10 +0200)]
kernel: fix parsing fixed subpartitions

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit ed4641e9f1ad940cb60187dea09cf17c865efcaf)

2 years agoExtend checks on build prerequisites for building OpenWRT core
Bas Mevissen [Mon, 19 Apr 2021 23:08:19 +0000 (01:08 +0200)]
Extend checks on build prerequisites for building OpenWRT core

OpenWRT requires a number of Perl modules to be installed. It wasn't checking on all of them.
This patch adds checks for Perl FindBin, File::Copy, File::Compare and Thread::Queue modules.

Failing to install these, will have the build break at some point. By adding these to the
prereq-build.mk script, they are checked on forehand.

Tested on a Fedora 33 and 34 (beta) that was freshly installed. Fedora appears to
break up Perl modules into small packages that need to be installed for the build to succeed.

Signed-off-by: Bas Mevissen <abuse@basmevissen.nl>
(cherry picked from commit f68c9474acf9a65b5a9538db8e45c173462487e3)

2 years agokernel: bump 5.4 to 5.4.117
Hauke Mehrtens [Fri, 7 May 2021 20:49:56 +0000 (22:49 +0200)]
kernel: bump 5.4 to 5.4.117

All updated automatically.

Compile-tested on: x86/64, armvirt/32, ath79/generic
Runtime-tested on: x86/64, armvirt/32, ath79/generic

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agotplink-safeloader: fix product_name of TP-Link AD7200
Alex Henrie [Tue, 4 May 2021 03:07:17 +0000 (21:07 -0600)]
tplink-safeloader: fix product_name of TP-Link AD7200

The stock firmware does not accept firmware with "Talon" in the name.

Tested on firmware version 1.0.10 Build 20160902 rel. 57400 which came
preinstalled, as well as latest firmware version 2.0.1 Build 20170103
rel.71053 flashed from
AD7200v1-up-ver2-0-1-P1[20170103-rel71053]_2017-01-04_10.08.28.bin.

Fixes: 1a775a4fd033 ("ipq806x: add support for TP-Link Talon AD7200")
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
[added details about vendor firmware]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit dfef88b6cacceec151ca4ce4bb3dc50c1c5cf1d2)

2 years agodnsmasq: Update to version 2.85
Alan Swanson [Tue, 27 Apr 2021 15:24:05 +0000 (16:24 +0100)]
dnsmasq: Update to version 2.85

Fixes issue with merged DNS requests in 2.83/2.84 not being
retried on the firsts failed request causing lookup failures.

Also fixes the following security problem in dnsmasq:
* CVE-2021-3448:
  If specifiying the source address or interface to be used
  when contacting upstream name servers such as:
  server=8.8.8.8@1.2.3.4, server=8.8.8.8@1.2.3.4#66 and
  server=8.8.8.8@eth0 then all would use the same socket
  bound to the explicitly configured port. Now only
  server=8.8.8.8@1.2.3.4#66 will use the explicitly
  configured port and the others random source ports.

Remove upstreamed patches and update remaining patch.

Signed-off-by: Alan Swanson <reiver@improbability.net>
[refreshed old runtime support patch]
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit 3980daffa4e284377cd1ae803fba78331c1fc40b)

2 years agoltq-dsl-base: Make package nonshared to fix image builder
Hauke Mehrtens [Sun, 2 May 2021 20:59:36 +0000 (22:59 +0200)]
ltq-dsl-base: Make package nonshared to fix image builder

This package depends on the lantiq target and is only build for that
target. A normal package would be build by the SDK builder probably
under a different target and then this package will not be selected.
Mark it as nonshared to build it when the lantiq target gets build.

Fixes: FS#3773, FS#3774
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 454d514f4647d6f1f0d93d8f67abdef94cd66a7d)

2 years agomac80211: Update to version 5.10.34-1
Hauke Mehrtens [Sun, 2 May 2021 16:45:40 +0000 (18:45 +0200)]
mac80211: Update to version 5.10.34-1

The removed patches were applied upstream and are not needed anymore.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 17ac9849d3ff687c8c14d63e46f3e205adc22a3e)

2 years agobusybox: backport fix for CVE-2021-28831
Hauke Mehrtens [Sun, 2 May 2021 15:42:19 +0000 (17:42 +0200)]
busybox: backport fix for CVE-2021-28831

This backports a fix for the low priority CVE-2021-28831:
  decompress_gunzip.c in BusyBox through 1.32.1 mishandles the error bit
  on the huft_build result pointer, with a resultant invalid free or
  segmentation fault, via malformed gzip data.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 13397b2b95b4800fb0a29c3d483fa280d10f0eb0)

2 years agoipq40xx: add support for MikroTik SXTsq 5 ac
Roger Pueyo Centelles [Fri, 23 Oct 2020 14:05:28 +0000 (16:05 +0200)]
ipq40xx: add support for MikroTik SXTsq 5 ac

This commit adds support for the MikroTik SXTsq 5 ac (RBSXTsqG-5acD),
an outdoor 802.11ac wireless CPE with one 10/100/1000 Mbps Ethernet
port.

Specifications:
 - SoC: Qualcomm Atheros IPQ4018
 - RAM: 256 MB
 - Storage: 16 MB NOR
 - Wireless: IPQ4018 (SoC) 802.11a/n/ac 2x2:2, 16 dBi antennae
 - Ethernet: IPQ4018 (SoC) 1x 10/100/1000 port, 10-28 Vdc PoE in
 - 1x Ethernet LED (green)
 - 7x user-controllable LEDs
  · 1x power (blue)
  · 1x user (green)
  · 5x rssi (green)

Note:
 Serial UART is probably available on the board, but it has not been
 tested.

Flashing:
 Boot via TFTP the initramfs image. Then, upload a sysupgrade image
 via SSH and flash it normally. More info at the "Common procedures
 for MikroTik products" page https://openwrt.org/toh/mikrotik/common.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
(cherry picked from commit d1f1e5269ed992e6fc30d575b43b0913c9e58ca2)
[Compile and Run Tested]
Signed-off-by: Nick Hainke <vincent@systemli.org>
2 years agoipq40xx: add MikroTik hAP ac2 support
Robert Marko [Thu, 12 Nov 2020 18:45:22 +0000 (19:45 +0100)]
ipq40xx: add MikroTik hAP ac2 support

This adds support for the MikroTik RouterBOARD RBD52G-5HacD2HnD-TC
(hAP ac²), a  indoor dual band, dual-radio 802.11ac
wireless AP with integrated omnidirectional antennae, USB port and  five
10/100/1000 Mbps Ethernet ports.

See https://mikrotik.com/product/hap_ac2 for more info.

Specifications:
 - SoC: Qualcomm Atheros IPQ4018
 - RAM: 128 MB
 - Storage: 16 MB NOR
 - Wireless:
   · Built-in IPQ4018 (SoC) 802.11b/g/n 2x2:2, 2.5 dBi antennae
   · Built-in IPQ4018 (SoC) 802.11a/n/ac 2x2:2, 2.5 dBi antennae
 - Ethernet: Built-in IPQ4018 (SoC, QCA8075) , 5x 1000/100/10 port,
             passive PoE in
- 1x USB Type A port

Installation:
Boot the initramfs image via TFTP and then flash the sysupgrade
image using "sysupgrade -n"

Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit faea7becafc634dc882f0ad8f9388862ccd5bd0d)
[Compile Tested]
Signed-off-by: Nick Hainke <vincent@systemli.org>
2 years agoath79: force SGMII SerDes mode to MAC operation
David Bauer [Wed, 31 Mar 2021 23:20:45 +0000 (01:20 +0200)]
ath79: force SGMII SerDes mode to MAC operation

The mode on the SGMII SerDes on the QCA9563 is 1000 Base-X by default.
This only allows for 1000 Mbit/s links, however when used with an SGMII
PHY in 100 Mbit/s link mode, the link remains dead.

This strictly has nothing to do with the SerDes calibration, however it
is done at the same point in the QCA reference U-Boot which is the
blueprint for everything happening here. As the current state is more or
less a hack, this should be fine.

This fixes the issues outlined above on a TP-Link EAP-225 Outdoor.

Reported-by: Tom Herbers <freifunk@tomherbers.de>
Tested-by: Tom Herbers <freifunk@tomherbers.de>
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit fbbad9a9a629b388626b477e6cd692c160f63fb3)

2 years agoath79: fix USB power on TP-Link TL-WR810N v1
Tom Stöveken [Thu, 25 Feb 2021 18:49:10 +0000 (19:49 +0100)]
ath79: fix USB power on TP-Link TL-WR810N v1

Before: Kernel reported "usb_vbus: disabling" and the USB was not
        providing power
After:  USB power is switched on, peripheral is powered from the
        device

Signed-off-by: Tom Stöveken <tom@naaa.de>
[squash and tidy up]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit a6f7268dc7519b57251532fe4239412e8acf4ca7)

2 years agokernel: bump 5.4 to 5.4.114
Hauke Mehrtens [Fri, 23 Apr 2021 23:01:21 +0000 (01:01 +0200)]
kernel: bump 5.4 to 5.4.114

Removed because in upstream*
  mvebu/patches-5.4/319-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch

Manually rebased*
  generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch

Added new backport*
  generic/backport-5.4/050-gro-fix-napi_gro_frags-Fast-GRO-breakage-due-to-IP-a.patch

All others updated automatically.

The new backport was included based on this[1] upstream commit that will be
mainlined soon.  This change is needed because Eric Dumazet's check for
NET_IP_ALIGN (landed in 5.4.114) causes huge slowdowns on drivers which use
napi_gro_frags().

Compile-tested on: x86/64, armvirt/64, ath79/generic
Runtime-tested on: x86/64, armvirt/64, ath79/generic

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agoath79: mikrotik: swap RB922UAGS-5HPaCD eth0/1 MACs
Roger Pueyo Centelles [Thu, 29 Apr 2021 09:38:16 +0000 (11:38 +0200)]
ath79: mikrotik: swap RB922UAGS-5HPaCD eth0/1 MACs

Since support for SFP on the MikroTik RouterBOARD 922UAGS-5HPacD was
added by 4387fe00cb, the MAC addresses for eth0 (Ethernet) and eth1
(SFP) were swapped. This patch fixes the 02_network script to assign MAC
addresses correctly, so they match the label and the vendor's OS.

Tested on a RouterBOARD 922UAGS-5HPacD board.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
(cherry picked from commit 14a95b36b1ecd038fffc279878c5a4c51043d709)

2 years agoath79: mikrotik: enable SFP on RB922UAGS-5HPaCD
Roger Pueyo Centelles [Fri, 18 Dec 2020 21:26:55 +0000 (22:26 +0100)]
ath79: mikrotik: enable SFP on RB922UAGS-5HPaCD

This patch enables the SFP cage on the MikroTik RouterBOARD 922UAGS-5HPacD.

GPIO16 (tx-disable-gpios) should be governed by the SFP driver to enable
or disable transmission, but no change is observed. Therefore, it is
left as output high to ensure the SFP module is forced to transmit.

Tested on a RouterBOARD 922UAGS-5HPacD board, with a CISCO GLC-LH-SMD
1310nm module and an unbranded GLC-T RJ45 Gigabit module. PC=>router
iperf3 tests deliver 440/300 Mbps up/down, both via regular eth0 port
or SFP port with RJ45 module. Bridge between eth0 and eth1 delivers
950 Mbps symmetric.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
(cherry picked from commit 4387fe00cb7536d9d341f6d27e465ff0f0b29b1b)

2 years agomac80211: minstrel_ht: fix issue in calculating success probability
Felix Fietkau [Wed, 28 Apr 2021 19:06:36 +0000 (21:06 +0200)]
mac80211: minstrel_ht: fix issue in calculating success probability

Missing braces in a macro were leading to badly working rates sometimes
getting a success probabilty of 1.0

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit 12cb52bd0665da33cb5dc64697f1751a8b33fb05)

2 years agokernel: drop the conntrack rtcache patch
Rui Salvaterra [Thu, 8 Apr 2021 22:57:48 +0000 (23:57 +0100)]
kernel: drop the conntrack rtcache patch

It's in backports-5.4, but it wasn't ever merged. Upstream followed another
approach, with flow offloading, which has much better performance. Drop this
obsolete patch and refresh the kernel patches.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
Acked-by: Stijn Tintel <stijn@linux-ipv6.be>
Acked-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 17576b1b2aeacf0a23bb9a911d675bd324754745)

2 years agoltq-vdsl-app: extent dsl metrics with state_num and power_state_num
Florian Eckert [Tue, 13 Apr 2021 09:30:33 +0000 (11:30 +0200)]
ltq-vdsl-app: extent dsl metrics with state_num and power_state_num

With the old ubus dsl API, the numbers for the individual line_states and
power_states were also returned. These were not ported to the new DSL
C-API. This commit adds the missing information.

For this the internal values are mapped to numbers.

* additional JSON output for state_num:
"state_num": <map_state_number>

Since not all values are meaningful only the following values are
implemented, this can be extended if the future.

* LSTATE_MAP_NOT_INITIALIZED
* LSTATE_MAP_EXCEPTION
* LSTATE_MAP_IDLE
* LSTATE_MAP_SILENT
* LSTATE_MAP_HANDSHAKE
* LSTATE_MAP_FULL_INIT
* LSTATE_MAP_SHOWTIME_NO_SYNC
* LSTATE_MAP_SHOWTIME_TC_SYNC
* LSTATE_MAP_RESYNC

* additinal JSON output for power_level:
"power_state_num": <map_power_satte_number>,

Since there are not so many here, all are mapped.

* PSTATE_MAP_NA,
* PSTATE_MAP_L0,
* PSTATE_MAP_L1,
* PSTATE_MAP_L2,
* PSTATE_MAP_L3,

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
v6:
Add state LSTATE_MAP_NOT_INITILIZED at the beginning of the list
Start the list LSTATE_MAP with -1
Reviewed-by: Andre Heider <a.heider@gmail.com>
(cherry picked from commit 4407d45d9667ab3d376ad4a6b760e07f4dd43e49)

2 years agolantiq: use ActualNetDataRate for speed reporting
Jeroen Peelaerts [Tue, 9 Feb 2021 22:33:51 +0000 (23:33 +0100)]
lantiq: use ActualNetDataRate for speed reporting

Switch to Actual Net Data Rate (ACTNDR) for speed reporting on lantiq VDSL modems

Refer to ITU-T G.997.1 chapter 7.5.2.8

Independent whether retransmission is used or not in a given transmit direction:
-   In L0 state, this parameter reports the Net Data Rate (as specified in G.992.3, G.992.5 or G.993.2) at which the bearer channel is operating.
-   In  L2 state, the parameter contains the Net Data Rate (as specified in G.992.3, G.992.5 or G.993.2) in the previous L0 state.

Signed-off-by: Jeroen Peelaerts <jeroen.peelaerts@gmail.com>
Reviewed-by: Andre Heider <a.heider@gmail.com>
(cherry picked from commit 4f27ea7c33447f4b0c8e577509726927916b9625)

2 years agolantiq: enable G.INP retransmission counters
Jeroen Peelaerts [Sat, 16 May 2020 10:12:46 +0000 (12:12 +0200)]
lantiq: enable G.INP retransmission counters

This commit adds monitoring for a couple of DSL line features that are
present in the lantiq firmware blobs.

* G.INP ON/OFF
* Trellis encoding ON/OFF
* Virtaul Noise ON/OFF
* Bitswap ON/OFF

Difference in size for ltq-vdsl-app = 1k
Difference in size for kmod-ltq-vdsl-vr9 < 1k

Reviewed-by: Andre Heider <a.heider@gmail.com>
Signed-off-by: Jeroen Peelaerts <jeroen.peelaerts@gmail.com>
(cherry picked from commit 48162e4c0c85a7f64d9007565bf5be2c7ace3ada)

2 years agoOpenWrt v21.02.0-rc1: revert to branch defaults
Hauke Mehrtens [Mon, 19 Apr 2021 19:10:17 +0000 (21:10 +0200)]
OpenWrt v21.02.0-rc1: revert to branch defaults

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agoOpenWrt v21.02.0-rc1: adjust config defaults v21.02.0-rc1
Hauke Mehrtens [Mon, 19 Apr 2021 19:10:14 +0000 (21:10 +0200)]
OpenWrt v21.02.0-rc1: adjust config defaults

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agorealtek: allow writing to "u-boot-env2"
Bjørn Mork [Tue, 6 Apr 2021 09:43:05 +0000 (11:43 +0200)]
realtek: allow writing to "u-boot-env2"

U-Boot uses the "bootpartition" variable stored in
"u-boot-env2" to select the active system partition. Allow
updates to enable system switching from OpenWrt.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
(cherry picked from commit 11d24ffe961570533a4fc54a7511d30c17290623)

2 years agorealtek: rename partitions in Netgear DTSI
Stijn Segers [Sun, 28 Feb 2021 21:50:15 +0000 (22:50 +0100)]
realtek: rename partitions in Netgear DTSI

Switch the Netgear DTSI for the Realtek target from the OEM partition
naming scheme to accepted OpenWrt naming practices. A quick git grep for
'u-boot-env' e.g. in the OpenWrt tree turns up almost 500 hits whereas
grepping for 'bdinfo' (the OEM equivalent) returns a meagre 14.

Signed-off-by: Stijn Segers <foss@volatilesystems.org>
(cherry picked from commit 1601b39b6197963e85c441a043702e022779f371)

2 years agorealtek: add ZYXEL_VERS to DEVICE_VARS
Adrian Schmutzler [Mon, 22 Mar 2021 19:58:16 +0000 (20:58 +0100)]
realtek: add ZYXEL_VERS to DEVICE_VARS

Otherwise, the last defined value will be set for all devices.

Fixes: c6c8d597e183 ("realtek: Add generic zyxel_gs1900 image definition")
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 851dadc257b7223f879a3733507e83cfcaae1af1)

2 years agorealtek: enable SerDes NWAY and SGMII negotiation
Bjørn Mork [Sat, 13 Mar 2021 16:45:54 +0000 (17:45 +0100)]
realtek: enable SerDes NWAY and SGMII negotiation

This allows copper SFPs to negotiate speeds lower than 1gig.

Acked-by: Birger Koblitz <mail@birger-koblitz.de>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
(cherry picked from commit 963b2ae702510c11e912c9438fdb9222763a22d5)

2 years agorealtek: enabled Marvell and Realtek PHYs
Bjørn Mork [Sat, 13 Mar 2021 16:45:53 +0000 (17:45 +0100)]
realtek: enabled Marvell and Realtek PHYs

The rtl83xx-phy driver is necessary for proper configuration of the
PHYs if U-Boot hasn't done that.

1000Base-T SFPs often contains a Marvell 88E1111 and will not work
without this driver. Include it by default to support copper SFPs.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
(cherry picked from commit 07bf5aaa4c12d6e7eb797b3871a7586f90a46e67)

2 years agorealtek: enable HWMON for SFP sensors
Bjørn Mork [Sat, 13 Mar 2021 16:45:52 +0000 (17:45 +0100)]
realtek: enable HWMON for SFP sensors

This adds SFP sensors as a hwmon device, allowing readout of
temperatures, DOM and other sensor readings available from the
SFP.  Example from a ZyXEL GS1900-10HP with a DOM capable
1000Base-SX SFP:

root@gs1900-10hp:~# grep . /sys/class/hwmon/hwmon0/*
/sys/class/hwmon/hwmon0/curr1_crit:90
/sys/class/hwmon/hwmon0/curr1_crit_alarm:0
/sys/class/hwmon/hwmon0/curr1_input:4
/sys/class/hwmon/hwmon0/curr1_label:bias
/sys/class/hwmon/hwmon0/curr1_lcrit:0
/sys/class/hwmon/hwmon0/curr1_lcrit_alarm:0
/sys/class/hwmon/hwmon0/curr1_max:85
/sys/class/hwmon/hwmon0/curr1_max_alarm:0
/sys/class/hwmon/hwmon0/curr1_min:0
/sys/class/hwmon/hwmon0/curr1_min_alarm:0
/sys/class/hwmon/hwmon0/in0_crit:3795
/sys/class/hwmon/hwmon0/in0_crit_alarm:0
/sys/class/hwmon/hwmon0/in0_input:3317
/sys/class/hwmon/hwmon0/in0_label:VCC
/sys/class/hwmon/hwmon0/in0_lcrit:2805
/sys/class/hwmon/hwmon0/in0_lcrit_alarm:0
/sys/class/hwmon/hwmon0/in0_max:3465
/sys/class/hwmon/hwmon0/in0_max_alarm:0
/sys/class/hwmon/hwmon0/in0_min:3135
/sys/class/hwmon/hwmon0/in0_min_alarm:0
/sys/class/hwmon/hwmon0/name:sfp_p10
/sys/class/hwmon/hwmon0/power1_crit:708
/sys/class/hwmon/hwmon0/power1_crit_alarm:0
/sys/class/hwmon/hwmon0/power1_input:259
/sys/class/hwmon/hwmon0/power1_label:TX_power
/sys/class/hwmon/hwmon0/power1_lcrit:89
/sys/class/hwmon/hwmon0/power1_lcrit_alarm:0
/sys/class/hwmon/hwmon0/power1_max:501
/sys/class/hwmon/hwmon0/power1_max_alarm:0
/sys/class/hwmon/hwmon0/power1_min:126
/sys/class/hwmon/hwmon0/power1_min_alarm:0
/sys/class/hwmon/hwmon0/power2_crit:1259
/sys/class/hwmon/hwmon0/power2_crit_alarm:0
/sys/class/hwmon/hwmon0/power2_input:404
/sys/class/hwmon/hwmon0/power2_label:RX_power
/sys/class/hwmon/hwmon0/power2_lcrit:6
/sys/class/hwmon/hwmon0/power2_lcrit_alarm:0
/sys/class/hwmon/hwmon0/power2_max:794
/sys/class/hwmon/hwmon0/power2_max_alarm:0
/sys/class/hwmon/hwmon0/power2_min:10
/sys/class/hwmon/hwmon0/power2_min_alarm:0
/sys/class/hwmon/hwmon0/temp1_crit:100000
/sys/class/hwmon/hwmon0/temp1_crit_alarm:0
/sys/class/hwmon/hwmon0/temp1_input:22547
/sys/class/hwmon/hwmon0/temp1_label:temperature
/sys/class/hwmon/hwmon0/temp1_lcrit:-50000
/sys/class/hwmon/hwmon0/temp1_lcrit_alarm:0
/sys/class/hwmon/hwmon0/temp1_max:85000
/sys/class/hwmon/hwmon0/temp1_max_alarm:0
/sys/class/hwmon/hwmon0/temp1_min:-40000
/sys/class/hwmon/hwmon0/temp1_min_alarm:0
/sys/class/hwmon/hwmon0/uevent:OF_NAME=sfp-p10
/sys/class/hwmon/hwmon0/uevent:OF_FULLNAME=/sfp-p10
/sys/class/hwmon/hwmon0/uevent:OF_COMPATIBLE_0=sff,sfp
/sys/class/hwmon/hwmon0/uevent:OF_COMPATIBLE_N=1

Tested-by: Birger Koblitz <mail@birger-koblitz.de>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
(cherry picked from commit 2a912fb63adc3fb3a1ee746589f6df4bb02e4296)

2 years agorealtek: re-enable sfp driver for ZyXEL GS1900-10HP
Bjørn Mork [Sat, 13 Mar 2021 16:45:51 +0000 (17:45 +0100)]
realtek: re-enable sfp driver for ZyXEL GS1900-10HP

There is no need to define a static link or a phy for the sfp
ports.  Using phy-mode and managed properties to  describe the
link to the sfp phy.

We have to keep the now unconnected virtual "phys" because the
switch  driver uses their "phy-is-integrated" property to figure
out which ports to enable as fibre ports.

Acked-by: Birger Koblitz <mail@birger-koblitz.de>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
(cherry picked from commit e8d391bd4650418182d96ca06ccd10d636efcbc3)

2 years agorealtek: need to handle PHY_INTERFACE_MODE_NA for sfps
Bjørn Mork [Sat, 13 Mar 2021 16:45:50 +0000 (17:45 +0100)]
realtek: need to handle PHY_INTERFACE_MODE_NA for sfps

From the validate docs in include/linux/phylink.h:

 When state->interface is PHY_INTERFACE_MODE_NA, phylink expects the
 MAC driver to return all supported link modes.

Tested-by: Birger Koblitz <mail@birger-koblitz.de>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
(cherry picked from commit 785d830e889ba18793acf369e447d704269169af)

2 years agorealtek: fix link-state interrupt
Bjørn Mork [Sat, 13 Mar 2021 16:45:49 +0000 (17:45 +0100)]
realtek: fix link-state interrupt

This bug was the root cause for the failing sfp driver.

Acked-by: Birger Koblitz <mail@birger-koblitz.de>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
(cherry picked from commit b8e473d18c6af2abf0d047247fdbe6d178228ac0)

2 years agorealtek: Add ZyXEL GS1900-8
Hauke Mehrtens [Wed, 27 Jan 2021 21:16:11 +0000 (22:16 +0100)]
realtek: Add ZyXEL GS1900-8

The ZyXEL GS1900-8 is a 8 port switch without any PoE functionality or
SFP ports, but otherwise similar to the other GS1900 switches.

Specifications
--------------
* Device:    ZyXEL GS1900-8 v1.2
* SoC:       Realtek RTL8380M 500 MHz MIPS 4KEc
* Flash:     Macronix MX25L12835F 16 MiB
* RAM:       Nanya NT5TU128M8GE-AC 128 MiB DDR2 SDRAM
* Ethernet:  8x 10/100/1000 Mbit
* LEDs:      1 PWR LED (green, not configurable)
             1 SYS LED (green, configurable)
             8 ethernet port status LEDs (green, SoC controlled)
* Buttons:   1 on-off glide switch at the back (not configurable)
             1 reset button at the right side, behind the air-vent
               (not configurable)
             1 reset button on front panel (configurable)
* Power      12V 1A barrel connector
* UART:      1 serial header (JP2) with populated standard pin connector on
             the left side of the PCB, towards the back. Pins are labelled:
             + VCC (3.3V)
             + TX (really RX)
             + RX (really TX)
             + GND
             the labelling is done from the usb2serial connector's point of
             view, so RX/ TX are mixed up.

Serial connection parameters for both devices: 115200 8N1.

Installation
------------
Instructions are identical to those for the GS1900-10HP and GS1900-8HP.

* 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-10HP is a dual-partition device, you want to keep the
  OEM firmware on the backup partition for the time being. OpenWrt can
  only boot off 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-8-initramfs-kernel.bin
  > bootm
* Once OpenWrt has booted, scp the sysupgrade image to /tmp and flash it:
  > sysupgrade /tmp/openwrt-realtek-generic-zyxel_gs1900-8-squashfs-sysupgrade.bin

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit e6ba970b6ef2289a2a4d3dd6c0c158ee8d10160f)

2 years agorealtek: Add generic zyxel_gs1900 image definition
Hauke Mehrtens [Wed, 24 Feb 2021 21:03:39 +0000 (22:03 +0100)]
realtek: Add generic zyxel_gs1900 image definition

Add a new common device definition for the Zyxel GS1900 line of
switches.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit c6c8d597e18300cd679bf5ea88a46ed18709da01)

2 years agorealtek: drop ethtool log noise
Bjørn Mork [Thu, 11 Mar 2021 12:35:38 +0000 (13:35 +0100)]
realtek: drop ethtool log noise

Demote a number of debugging printk's to pr_debug to avoid log
nosie.  Several of these functions are called as a result of
userspace activity.  This can cause a lot of log noise when
userspace does periodic polling.

Most of this could probably be removed completely, but let's
keep it for now since these drivers are still in development.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
(cherry picked from commit ba220ad2fd915aaed2e9c850a84078c5c5977d3e)

2 years agouboot-envtools: add support for ZyXEL GS-1900-8HP v1 and v2
Stijn Segers [Thu, 18 Feb 2021 23:22:26 +0000 (00:22 +0100)]
uboot-envtools: add support for ZyXEL GS-1900-8HP v1 and v2

This adds the necessary nuts and bolts for the uboot settings for both the ZyXEL GS1900-8HP v1 and v2.

Signed-off-by: Stijn Segers <foss@volatilesystems.org>
(cherry picked from commit b5bc53813d28cb4229f9800a36c1e600a239e6a9)

2 years agobase-files: fix status display command
Alexander Egorenkov [Sun, 28 Mar 2021 08:45:08 +0000 (10:45 +0200)]
base-files: fix status display command

If service() is called w/o parameter then the status display for services
with multiple instances is incorrect. E.g. samba4 or wpad have 2 instances.

root@OpenWrt:~# /etc/init.d/samba4 status
running
root@OpenWrt:~# /etc/init.d/wpad status
running

Before change:
/etc/init.d/samba4                 enabled         stopped
/etc/init.d/wpad                   enabled         stopped

After change:
/etc/init.d/samba4                 enabled         running
/etc/init.d/wpad                   enabled         running

Signed-off-by: Alexander Egorenkov <egorenar-dev@posteo.net>
(cherry picked from commit 9318f61556c5443eb66eec7e26715b00f0df86fc)

2 years agozram-swap: bail out early if the kernel doesn't support swap
Rui Salvaterra [Thu, 1 Apr 2021 13:36:33 +0000 (14:36 +0100)]
zram-swap: bail out early if the kernel doesn't support swap

Since KERNEL_SWAP is only enabled by default for !SMALL_FLASH targets, we need
to check if the current kernel supports swap before trying to configure
zram-swap, as opkg can't check for kernel dependencies.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
(cherry picked from commit 565dfeb1280343fb3f838581169e5d7a1c947862)

2 years agouboot-imx6: define 'BUILD_DEVICES' for Toradex Apalis
Piotr Dymacz [Thu, 7 Jan 2021 16:30:49 +0000 (17:30 +0100)]
uboot-imx6: define 'BUILD_DEVICES' for Toradex Apalis

Without 'BUILD_DEVICES' defined, the U-Boot related package won't be
automatically selected when building for Toradex Apalis device.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
(cherry picked from commit 8c3383799a496fda5cfa31000b65c9b8565cf575)

2 years agoumdns: add missing syscalls to seccomp filter
Daniel Golle [Sat, 10 Apr 2021 16:30:49 +0000 (17:30 +0100)]
umdns: add missing syscalls to seccomp filter

Looks like 'openat', 'pipe2' and 'ppoll' are now needed, possibly due
to changes on libraries used by umdns now using slightly different
calls.

Found using
/etc/init.d/umdns trace
now use umdns, ie. cover all ubus call etc., then
/etc/init.d/umdns stop
find list of syscalls traced in /tmp/umdns.*.json

Fixes: FS#3355 ("UMDNS: does not start on master with seccomp")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 00a85a163405fdf9bee4d8c3f0ee87ca9ed259d6)

2 years agoumdns: add syscalls needed on Aarch64
Daniel Golle [Fri, 19 Mar 2021 22:32:12 +0000 (22:32 +0000)]
umdns: add syscalls needed on Aarch64

Now that ujail supports seccomp also on Aarch64, add missing syscall
'fstat' to the list of allowed syscalls.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit d28880cdd86e10142fd86936f5da188eaeeaf9eb)

2 years agoramips: mt7530 swconfig: fix race condition in register access
DENG Qingfang [Sat, 3 Apr 2021 14:59:15 +0000 (22:59 +0800)]
ramips: mt7530 swconfig: fix race condition in register access

The mt7530_{r,w}32 operation over MDIO uses 3 mdiobus operations and
does not hold a lock, which causes a race condition when multiple
threads try to access a register, they may get unexpected results.

To avoid this, handle the MDIO lock manually, and use the unlocked
__mdiobus_{read,write} in the critical section.

This fixes the "Ghost VLAN" artifact[1] in MT7530/7621 when the VLAN
operation and the swconfig LED link status poll race between each other.

[1] https://forum.openwrt.org/t/mysterious-vlan-ids-on-mt7621-device/64495

Signed-off-by: DENG Qingfang <dqfext@gmail.com>
(cherry picked from commit f99c9cd9c4d4c49a676d678327546fd41690fe2a)

2 years agoath79: fix 10 Mbit PLL data for UniFi AC
David Bauer [Wed, 14 Apr 2021 21:58:25 +0000 (23:58 +0200)]
ath79: fix 10 Mbit PLL data for UniFi AC

Fix the PLL register value for 10 Mbit/s link modes on the UniFi AC Lite
/ Mesh / LR. Otherwise, 10 Mbit/s links do not transfer data.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 956407292dc5fd41f2d8c7cc7e9ec77eb6444c1e)

2 years agoath79: fix 10 Mbit PLL data for TP-Link EAP2xx
David Bauer [Wed, 14 Apr 2021 22:30:24 +0000 (00:30 +0200)]
ath79: fix 10 Mbit PLL data for TP-Link EAP2xx

Fix the PLL register value for 10 Mbit/s link modes on TP-Link EAP
boards using a AR8033 SGMII PHY.

Otherwise, 10 Mbit/s links do not transfer data.

Reported-by: Tom Herbers <freifunk@tomherbers.de>
Tested-by: Tom Herbers <freifunk@tomherbers.de>
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit bbff6239e2ea273388f4ca0f8586945ff5f36271)

2 years agoglibc: update to latest 2.33 commit
Hans Dedecker [Sat, 17 Apr 2021 19:24:39 +0000 (21:24 +0200)]
glibc: update to latest 2.33 commit

12ff80b312 Remove PR_TAGGED_ADDR_ENABLE from sys/prctl.h
1bf38e7260 Fix SXID_ERASE behavior in setuid programs (BZ #27471)
a7b8e8ec9b Enhance setuid-tunables test
ee16c81063 tst-env-setuid: Use support_capture_subprogram_self_sgid
267e174f19 support: Add capability to fork an sgid child
249c486ce8 support: Pass environ to child process
45b2c57d34 support: Typo and formatting fixes
e07abf59b2 tunables: Fix comparison of tunable values
3e9ca60a58 linux: always update select timeout (BZ #27706)
8380ca5833 linux: Normalize and return timeout on select (BZ #27651)
85e4dc415a libsupport: Add support_select_normalizes_timeout
b5b4aa62c1 libsupport: Add support_select_modifies_timeout
3d525dd639 misc: Fix tst-select timeout handling (BZ#27648)
830674605f tst: Provide test for select

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
(cherry picked from commit b3728f2cbd22c033ff852695eb6832c4040af37e)

2 years agoglibc: update to latest git HEAD (BZ #27468, BZ #27511)
Hans Dedecker [Mon, 5 Apr 2021 16:34:19 +0000 (18:34 +0200)]
glibc: update to latest git HEAD (BZ #27468, BZ #27511)

e78ea9bd26 Update Nios II libm-test-ulps.
98bb18f52a malloc: Fix a realloc crash with heap tagging [BZ 27468]
fc4ecce85b S390: Also check vector support in memmove ifunc-selector [BZ #27511]

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
(cherry picked from commit d49f1acff1a79992c474fceaeac066671f838a2c)

2 years agotoolchain/gdb: fix compilation with ccache
Rosen Penev [Mon, 5 Apr 2021 01:32:30 +0000 (18:32 -0700)]
toolchain/gdb: fix compilation with ccache

For some reason, one of the configure checks results in some infinite
loop and ends up spawning endless gcc processes, causing OOM. Just pass
a configure var to avoid it.

Same fix as 6e23813c1ed7494a9da3b5e59cfcafd71097c420

Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit fc093c3f9cce80ea60e3752f6629f999ec186765)

2 years agoramips: reduce spi-max-frequency for Xiaomi MI Router 4AG
David Bentham [Sun, 4 Apr 2021 12:08:43 +0000 (13:08 +0100)]
ramips: reduce spi-max-frequency for Xiaomi MI Router 4AG

Reduce spi-max-frequency for Xiaomi MI Router 4AG model

Xiaomi MI Router 4AG MTD uses two flash chips (no specific on router versions when produced from factory) - GD25Q128C and W25Q128BV.

These flash chips are capable of high frequency, but due to poor board design or manufacture process.

We are seeing the following errors in the linux kernel bootup:

`spi-nor spi0.0: unrecognized JEDEC id bytes: cc 60 1c cc 60 1c
 spi-nor: probe of spi0.0 failed with error -2`

This causes the partitions not to be detected

`VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6`

Then creates a bootloop and a bricked router.

The solution to limit this race condition is to reduce the frequency from 80 mhz to 50 mhz.

Signed-off-by: David Bentham <db260179@gmail.com>
(cherry picked from commit 17e690017d76c49070bc99d6a376b1926259c5ff)

2 years agomvebu: armada 370: dts: fix the crypto engine
Daniel González Cabanelas [Sun, 4 Apr 2021 21:06:46 +0000 (23:06 +0200)]
mvebu: armada 370: dts: fix the crypto engine

The crypto engine in Armada 370 SoCs is currently broken. It can be
checked installing the required packages for testing openssl with hw
acceleration:

  opkg install openssl-util
  opkg install kmod-cryptodev
  opkg install libopenssl-devcrypto

After configuring /etc/ssl/openssl.cnf to let openssl use the crypto
engine for digest operations, and performing some checksums..

  md5sum 10M-file.bin
  openssl md5 10M-file.bin

...we can see they don't match.

There might be an alignment or size constraint issue caused by the
idle-sram area.

Use the whole crypto sram and disable the idle-sram area to fix it. Also
disable the idle support by adding the broken-idle property to prevent
accessing the disabled idle-sram.

We don't care about disabling the idle support since it is already broken
in Armada 370 causing a huge performance loss because it disables
permanently the L2 cache. This was reported in the Openwrt forum and
elsewhere by Debian users with different board models.

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
(cherry picked from commit 2e1ebe96c61424d0829bb1c8b5ec44aaa8bea8af)

2 years agomvebu: Fix sysupgrade for GL.iNet GL-MV1000
Sven Eckelmann [Thu, 25 Mar 2021 12:26:15 +0000 (13:26 +0100)]
mvebu: Fix sysupgrade for GL.iNet GL-MV1000

The GL.iNet GL-MV1000 is booting from eMMC and the images for it are in
theory sysupgrade compatible. But the platform upgrade scripts were not
adjusted to select the mmcblock device as upgrade target. This resulted in
a failed sysupgrade because the mtd device (NOR flash) was instead tried to
be modified by the sysupgrade script.

Fixes: 050c24f05c85 ("mvebu: add support for GL.iNet GL-MV1000")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
(cherry picked from commit 07e5e03711d55f94db738446ef9eddc8163b53a6)

2 years agouboot-envtools: mvebu: add Buffalo LS421DE
Daniel González Cabanelas [Sat, 10 Apr 2021 16:42:42 +0000 (18:42 +0200)]
uboot-envtools: mvebu: add Buffalo LS421DE

The Buffalo Linkstation LS421DE NAS lacks an uboot env config file.

Create it via scripts.

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
(cherry picked from commit 4f8da19572cf1adc480dca42251a4cded0cb3c7c)

2 years agoramips: Fix booting on MTC WR1201
René van Dorst [Sat, 20 Mar 2021 19:15:14 +0000 (20:15 +0100)]
ramips: Fix booting on MTC WR1201

This fixes the dreaded "lzma error 1" also reported on similar devices
Ref: https://bugs.openwrt.org/index.php?do=details&task_id=3057

Fixes: FS#3057
Signed-off-by: René van Dorst <opensource@vdorst.com>
(cherry picked from commit 12f3d1466ad783fded1747fa2ee521a9bea1ff73)

2 years agoramips: Fix booting on MQmaker WiTi board
Daniel Engberg [Fri, 19 Mar 2021 11:18:02 +0000 (12:18 +0100)]
ramips: Fix booting on MQmaker WiTi board

This fixes the dreaded "lzma error 1" also reported on similar devices
Ref: https://bugs.openwrt.org/index.php?do=details&task_id=3057

Fixes: FS#3057
Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
(cherry picked from commit e83f7e5d76ebf74aa0a1f686d2941950fa5f22e2)

2 years agoramips: rt305x: use lzma-loader for ZyXEL Keenetic Lite rev.B
Szabolcs Hubai [Wed, 3 Feb 2021 06:56:38 +0000 (07:56 +0100)]
ramips: rt305x: use lzma-loader for ZyXEL Keenetic Lite rev.B

Fixes boot loader LZMA decompression issue,
reported by GitHub user KOLANICH at [0].

The reported LZMA ERROR has date of 2020-07-20, soon after
the device support landed:

Ralink UBoot Version: 3.5.2.4_ZyXEL

....

3: System Boot system code via Flash.
   Image Name:   MIPS OpenWrt Linux-4.14.187
   Created:      2020-07-20   3:39:11 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1472250 Bytes =  1.4 MB
   Load Address: 80000000
   Entry Point:  80000000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... LZMA ERROR 1 - must RESET board to recover

[0] https://github.com/openwrt/openwrt/commit/fea232ae8feb6af780fd4fa78ebe9231778bf75a#commitcomment-45016560

Fixes: 4dc9ad4af8c921494d20b303b6772fc6b5af3a69 ("ramips: add support for ZyXEL Keenetic Lite Rev.B")
Signed-off-by: Szabolcs Hubai <szab.hu@gmail.com>
(cherry picked from commit dd3c1ad8ee9ee361285cb9142bdcb35bc3a30ac7)

3 years agobcm53xx: add pending TRX patch for "firmware" partition
Rafał Miłecki [Wed, 14 Apr 2021 06:26:25 +0000 (08:26 +0200)]
bcm53xx: add pending TRX patch for "firmware" partition

This fixes partitioning on Linksys EA9500. With this change only the
currently used firmware MTD partition gets parsed.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit a3c7633ddcd4fac9ec8935e5be9249c011bfec14)

3 years agogemini,layerscape,oxnas: don't disable option CONFIG_BPF_SYSCALL
Tony Ambardar [Sun, 11 Apr 2021 05:18:10 +0000 (22:18 -0700)]
gemini,layerscape,oxnas: don't disable option CONFIG_BPF_SYSCALL

Respect the generic kernel config setting, which is "enabled" tree-wide, as
previously done for sunxi.

Ref: 247ef4d98bab ("sunxi: enable CONFIG_BPF_SYSCALL and CONFIG_EMBEDDED")
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
(cherry picked from commit 41948c9c1b80e39f2fd2771f42e62e209347b0bf)
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
3 years agokernel: limit crypto-hw-ccp to the x86
Rafał Miłecki [Tue, 13 Apr 2021 08:15:39 +0000 (10:15 +0200)]
kernel: limit crypto-hw-ccp to the x86

CRYPTO_DEV_CCP depends on X86 or ARM64
CRYPTO_DEV_CCP_DD depends on CPU_SUP_AMD or ARM64

Compiling this driver makes sense for x86 mainly. If one day support for
ARM64 board with AMD Secure Processor gets added this package may be
updated.

Trying to build this package on bcm4908 was causing:
ERROR: module 'build_dir/target-aarch64_cortex-a53_musl/linux-bcm4908_generic/linux-5.4.110/drivers/crypto/ccp/ccp-crypto.ko' is missing.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit cb3fb45ed1262355e8c31d8e522f411169ee6df8)

3 years agokernel: crypto: format "crypto-hw-ccp" dependencies
Rafał Miłecki [Tue, 13 Apr 2021 15:18:27 +0000 (17:18 +0200)]
kernel: crypto: format "crypto-hw-ccp" dependencies

Use multiples lines for better readability and sort lines.

Suggested-by: Stijn Tintel <stijn@linux-ipv6.be>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 107111adbba16328f9853a4d89db4a103b20118c)

3 years agotplink-safeloader: fix C7v5 factory flashing from vendor fw > v1.1.x
Petr Štetiar [Fri, 9 Apr 2021 12:52:05 +0000 (14:52 +0200)]
tplink-safeloader: fix C7v5 factory flashing from vendor fw > v1.1.x

Currently it's not possible to flash factory images on devices shipped
with vendor firmware versions 1.1.0 Build 20201120 rel. 50406 (published
2020-12-22):

 (curFw_ver, newFw_ver) == (1.1, 1.0) [NM_Error](nm_checkSoftVer) 00848: Firmwave not supports, check failed.
 [NM_Error](nm_checkUpdateContent) 01084: software version dismatched
 [NM_Error](nm_buildUpgradeStruct) 01188: checkUpdateContent failed.

They've even following note in release notes:

 Note: You will be unable to downgrade to the previous firmware version
       after updating this firmware.

This version check in vendor firmware is implemented in
/usr/bin/nvrammanager binary likely as following C code[1]:

 sscanf(buf, "%d.%d.%*s",&upd_fw_major, &upd_fw_minor);
 ...
 if (((int)upd_fw_major < (int)cur_fw_major) ||
     ((ret = 1, cur_fw_major == upd_fw_major && (upd_fw_minor < (int)cur_fw_minor)))) {
       ret = 0;
       printf("[NM_Error](%s) %05d: Firmwave not supports, check failed.\r\n\r\n","nm_checkSoftVer" ,0x350);
 }
 ...
 return ret;

So in order to fix this and make it future proof it should be enough to
ship our factory firmware images with major version 7 (lucky number).

Tested on latest firmware version 1.1.2 Build 20210125 rel.37999:

 Firmwave supports, check OK.
  (curFw_ver, newFw_ver) == (1.1, 7.0) check firmware ok!

Flashing back to vendor firmware
c7v5_us-up-ver1-1-2-P1[20210125-rel37999]_2021-01-25_10.33.55.bin works
as well:

 U-Boot 1.1.4-gbec22107-dirty (Nov 18 2020 - 18:19:12)
 ...
 Firmware downloaded... filesize = 0xeeae77 fileaddr = 0x80060000.
 Firmware Recovery file length : 15642231
 Firmware process id 2.
 handle_fw_cloud 146
 Image verify OK!
 Firmware file Verify ok!
 product-info:product_name:Archer C7
 product_ver:5.0.0
 special_id:55530000
 [Error]sysmgr_cfg_checkSupportList(): 1023 @ specialId 45550000 NOT Match.
 Firmware supports, check OK.
 Firmware Recovery check ok!

1. https://gist.github.com/ynezz/2e0583647d863386a66c3d231541b6d1

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit e6d66375cbbb54e0e82a67030e385a5486273766)

3 years agolibnfnetlink: quote $(FPIC) on command line
Philip Prindeville [Fri, 19 Mar 2021 23:09:26 +0000 (17:09 -0600)]
libnfnetlink: quote $(FPIC) on command line

When $(FPIC) gets expanded on the command line (for instance
when setting environment variables for libtool, configure, or
make) we can't count on it not needing quoting (i.e. it could
contain multiple flags separated with spaces).

Fixes: dc31191ec3e5 ("build: make sure asm gets built with -DPIC")
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
(cherry picked from commit 7fae64cc065738b73a1dddc2fc28adde36c1ae3d)

3 years agoath79: mikrotik: enable 2nd USB on RouterBOARD 922UAGS-5HPacD
Koen Vandeputte [Mon, 12 Apr 2021 11:15:18 +0000 (13:15 +0200)]
ath79: mikrotik: enable 2nd USB on RouterBOARD 922UAGS-5HPacD

RB922 boards have 2 separate USB controllers:
- 1 is connected to Slot Type A
- 1 is connected to the mini PCIe port

Enable the 2nd one too.

Before:

[    5.339304] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI)
Driver
[    5.355053] SCSI subsystem initialized
[    5.364184] ehci-fsl: Freescale EHCI Host controller driver
[    5.372377] ehci-platform: EHCI generic platform driver
[    5.378053] ehci-platform 1b000000.usb: EHCI Host Controller
[    5.383861] ehci-platform 1b000000.usb: new USB bus registered,
assigned bus number 1
[    5.391932] ehci-platform 1b000000.usb: irq 14, io mem 0x1b000000
[    5.410730] ehci-platform 1b000000.usb: USB 2.0 started, EHCI 1.00
[    5.417739] hub 1-0:1.0: USB hub found
[    5.422280] hub 1-0:1.0: 1 port detected
[    5.434007] usbcore: registered new interface driver usb-storage

After:

[    5.342988] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI)
Driver
[    5.358687] SCSI subsystem initialized
[    5.367813] ehci-fsl: Freescale EHCI Host controller driver
[    5.375998] ehci-platform: EHCI generic platform driver
[    5.381695] ehci-platform 1b000000.usb: EHCI Host Controller
[    5.387507] ehci-platform 1b000000.usb: new USB bus registered,
assigned bus number 1
[    5.395571] ehci-platform 1b000000.usb: irq 14, io mem 0x1b000000
[    5.416050] ehci-platform 1b000000.usb: USB 2.0 started, EHCI 1.00
[    5.423089] hub 1-0:1.0: USB hub found
[    5.427578] hub 1-0:1.0: 1 port detected
[    5.432432] ehci-platform 1b400000.usb: EHCI Host Controller
[    5.438254] ehci-platform 1b400000.usb: new USB bus registered,
assigned bus number 2
[    5.446325] ehci-platform 1b400000.usb: irq 15, io mem 0x1b400000
[    5.468049] ehci-platform 1b400000.usb: USB 2.0 started, EHCI 1.00
[    5.475082] hub 2-0:1.0: USB hub found
[    5.479574] hub 2-0:1.0: 1 port detected
[    5.491305] usbcore: registered new interface driver usb-storage

Fixes: 8f93c05a59 ("ath79: add support for MikroTik RouterBOARD
922UAGS-5HPacD")
Signed-off-by: Koen Vandeputte <koen.vandeputte@citymesh.com>
(cherry picked from commit 172fa3bc7544ce940ce724d682d66109a3e14a11)

3 years agomt76: update to the latest version
Felix Fietkau [Sun, 14 Mar 2021 23:10:03 +0000 (00:10 +0100)]
mt76: update to the latest version

6a3cf95733e2 mt76: fix tx skb error handling in mt76_dma_tx_queue_skb
ab9045153343 mt76: mt7915: only modify tx buffer list after allocating tx token id
7e1eff676257 mt76: mt7915: fix unused 'mode' variable
8a2e22fcbf69 mt76: mt7921: fix suspend/resume sequence
27a54e8b687f mt76: mt7921: fix memory leak in mt7921_coredump_work
c267322f0bdb mt76: mt7921: switch to new api for hardware beacon filter [v2 update]
fd2c59d9ba46 mt76: mt7921: fixup rx bitrate statistics [v2 update]
bfa8d5a6a9a1 mt76: adjust to upstream API for enabling threaded NAPI
1706fb6c48e8 mt76: mt7663s: fix rx buffer refcounting
c5aca6692c41 mt76: mt7615: enable hw rx-amsdu de-aggregation
9002b0b30aed mt76: mt7615: add rx checksum offload support
8e3f5bfe74f6 mt76: mt7615: add support for rx decapsulation offload
8e3bba8bd3ef mt76: mt7615: fix memory leak in mt7615_coredump_work
760adce29100 mt76: mt7921: fix aggr length histogram
84229a51845a mt76: mt7915: fix aggr len debugfs node
10a95da23cb7 mt76: mt7921: remove unneeded semicolon
2856dc8fb57e mt76: mt7921: fix stats register definitions
1b245e57549d mt76: mt7615: fix TSF configuration
1a2e2965b62b mt76: mt7615: remove hdr->fw_ver check
f60ec1b9473d mt76: mt7615: fix mib stats counter reporting to mac80211
8a5b036af48f mt76: mt7915: fix mib stats counter reporting to mac80211
ee6dbcc64f6d mt76: connac: fix kernel warning adding monitor interface
e46dd240ce72 mt76: check return value of mt76_txq_send_burst in mt76_txq_schedule_list
ddf95ead3bb3 mt76: mt7921: get rid of mt7921_sta_rc_update routine
fd2a51ea9dc8 mt76: mt7921: fix the base of PCIe interrupt
28f53d074bb0 mt76: mt7921: fix the base of the dynamic remap
8d737632b57f mt76: mt7921: check mcu returned values in mt7921_start
5ff25c915e62 mt76: mt7915: add missing capabilities for DBDC
58dd3f26c099 mt76: mt7615: fix CSA notification for DBDC
76f4959107ac mt76: mt7615: stop ext_phy queue when mac reset happens
7de0a0654054 mt76: mt7915: fix CSA notification for DBDC
e9e418fc7eb0 mt76: mt7915: stop ext_phy queue when mac reset happens
477b78301879 mt76: mt7915: fix PHY mode for DBDC
37b4dc0f7595 mt76: mt76x0u: Add support for TP-Link T2UHP(UN) v1
29a04583aecb mt76: mt7915: fix rxrate reporting
a4307e6ba054 mt76: mt7915: fix txrate reporting
256f324f8fcd mt76: mt7915: check mcu returned values in mt7915_ops
638b112188a5 mt76: mt7615: check mcu returned values in mt7615_ops
975cccfa96da mt76: mt7663: fix when beacon filter is being applied
aafe972e95b2 mt76: mt7663s: make all of packets 4-bytes aligned in sdio tx aggregation
0d5b1a702715 mt76: mt7663s: fix the possible device hang in high traffic
00628061b546 mt76: mt7615: add missing capabilities for DBDC
2303e1844afd mt76: mt7915: fix possible deadlock while mt7915_register_ext_phy()
6e2b9d258306 mt76: mt7921: reduce mcu timeouts for suspend, offload and hif_ctrl msg
3cf5afc02955 mt76: introduce mcu_reset function pointer in mt76_mcu_ops structure
9af9622df549 mt76: mt7921: introduce mt7921_run_firmware utility routine.
e12c44a7e165 mt76: mt7921: introduce __mt7921_start utility routine
7b56d5bf6ea0 mt76: dma: introduce mt76_dma_queue_reset routine
a80e50098b51 mt76: dma: export mt76_dma_rx_cleanup routine
e0708e296e27 mt76: mt7921: add wifi reset support
87e09e8482cf mt76: mt7921: remove leftovers from dbdc configuration
cc933b3669f7 mt76: mt7921: remove redundant check on type
ca22cc221ae7 linux-firmware: add firmware for MT7921
0b6c9a043f78 mt76: move de-amsdu buffer per-phy
48a905e23791 mt76: mt7615: fix CSA event format
fbef8bba038f mt76: mt7921: remove duplicated macros in mcu.h
6886b57a1534 mt76: connac: introcuce mt76_sta_cmd_info data structure
e529e8afe22a mt76: mt7921: properly configure rcpi adding a sta to the fw
e4d522776804 mt76: mt7921: fix airtime reporting
be2f67e8d3cb mt76: mt7915: fix key set/delete issue
09a1befde4b7 mt76: fix potential DMA mapping leak
f66f8f41d47b mt76: mt7915: refresh repeater entry MAC address when setting BSSID
035e2f6f1ddf mt76: mt7921: get rid of mt7921_mac_wtbl_lmac_addr
ee29cd5f3a6a mt76: mt7615: only enable DFS test knobs for mt7615
9a98b1a6f9c2 mt76: mt7615: cleanup mcu tx queue in mt7615_dma_reset()
3bd285424e7b mt76: mt7622: trigger hif interrupt for system reset
bf6d9ee4acd1 mt76: mt7615: keep mcu_add_bss_info enabled till interface removal
115b74282314 mt76: mt7915: keep mcu_add_bss_info enabled till interface removal
57432e701d1a mt76: mt7915: cleanup mcu tx queue in mt7915_dma_reset()
a519c49a6a42 mt76: mt7615: 0-terminate firmware log messages
4a22f2ffae2e mt76: mt7915: 0-terminate firmware log messages
b8609066893a mt76: mt7615: fix chip reset on MT7622 and MT7663e
465dda65ee84 mt7615,mt7915: replace fw log 0-terminating code with wiphy info length limit
62b13f5352b8 mt76: mt7921: fix key set/delete issue
0ff3a336a8d8 mt7615,mt7915: fix a compiler warning
113ba8a81d54 mt76: mt7615: remove redundant dev_err call in mt7622_wmac_probe()
be1ab3b9ae7c mt76: mt7921: fix typo in mt7921_pci_resume
4e22f0dc934b mt76: mt7915: fix txpower init for TSSI off chips
e66a0b9b8d66 mt76: mt7615: always wake the device in mt7615_remove_interface
38f656768a90 mt76: mt7921: always wake the device in mt7921_remove_interface
6ee4770de083 mt76: mt7921: rework mt7921_mcu_debug_msg_event routine
e578b4b8d56a mt76: mt7615: fix .add_beacon_offload()
f8c6c7cbf10f mt76: mt7915: fix mt7915_mcu_add_beacon
7d35b7a15d1d mt76: mt7915: add wifi subsystem reset
04122c89749d mt76: fix rx amsdu subframe processing
5e764ec9bece mt76: mt7921: introduce MT_WFDMA_DUMMY_CR definition
cf0badbc0497 mt76: mt7921: fix inappropriate WoW setup with the missing ARP informaiton
f32a4e15f5b2 mt76: mt7921: fix the dwell time control
54f52771a04a mt76: mt7921: fix kernel crash when the firmware fails to download
97189d2a045b mt76: mt7921: fix the insmod hangs
dcdbd7c89cf5 mt76: mt7921: fix MT_PCIE_MAC_INT_ENABLE access
813db729c02f mt76: mt7921: reduce the data latency during hw scan
028b7152b1a9 mt76: mt7921: remove 80+80 MHz support capabilities
7714dc914df6 mt76: report Rx timestamp
ffd4cf15fa0e mt76: mt7915: add mmio.c
fe8717dd573a mt76: mt7615: add missing SPDX tag in mmio.c
6b293c411d22 mt76: mt7615: always add rx header translation tlv when adding stations
bf45b30d8919 add missing file

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit 8cc013981d2a017a4604e696e4ec19c846f2c230)

3 years agomac80211: add client mode connection monitor fix
Felix Fietkau [Sun, 11 Apr 2021 17:42:14 +0000 (19:42 +0200)]
mac80211: add client mode connection monitor fix

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit dfdb28c24aa60cf057ec45cbc11ab48ba2655f53)

3 years agomac80211: support rx timestamps for HE rates
Felix Fietkau [Sun, 11 Apr 2021 17:41:56 +0000 (19:41 +0200)]
mac80211: support rx timestamps for HE rates

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit 7d8e14e44f76e18d1696565569ec50ccdce963b3)

3 years agokernel: bump 5.4 to 5.4.111
Hauke Mehrtens [Sun, 11 Apr 2021 13:43:19 +0000 (15:43 +0200)]
kernel: bump 5.4 to 5.4.111

Refreshed all patches.

The following patches were manually changed:
* 610-netfilter_match_bypass_default_checks.patch
* 611-netfilter_match_bypass_default_table.patch
* 802-can-0002-can-rx-offload-fix-long-lines.patch
* 802-can-0003-can-rx-offload-can_rx_offload_compare-fix-typo.patch
* 802-can-0004-can-rx-offload-can_rx_offload_irq_offload_timestamp-.patch
* 802-can-0005-can-rx-offload-can_rx_offload_reset-remove-no-op-fun.patch
* 802-can-0006-can-rx-offload-Prepare-for-CAN-FD-support.patch
* 802-can-0018-can-flexcan-use-struct-canfd_frame-for-CAN-classic-f.patch

The can-dev.ko model was moved in the upstream kernel.

Compile-tested on: x86/64, armvirt/64, ath79/generic
Runtime-tested on: x86/64, armvirt/64, ath79/generic

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
3 years agokernel: move some disabled symbols to generic
Aleksander Jan Bajkowski [Fri, 5 Mar 2021 17:41:30 +0000 (18:41 +0100)]
kernel: move some disabled symbols to generic

Move some disabled symbols found in armvirt target to generic.

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
(cherry picked from commit 12e942b1fdda874542e0a4e6ea892969fedab975)

3 years agosunxi: disable LPAE on cortexa8
Zoltan HERPAI [Sat, 10 Apr 2021 20:01:24 +0000 (22:01 +0200)]
sunxi: disable LPAE on cortexa8

LPAE should be disabled as the Cortex-A8 cores don't support it,
and the kernel will crash on boot if it's enabled.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
3 years agobuild: make sure asm gets built with -DPIC
Philip Prindeville [Fri, 19 Mar 2021 21:09:45 +0000 (15:09 -0600)]
build: make sure asm gets built with -DPIC

Fixes issue openwrt/packages#14921, whereby inline ASM wasn't getting
built as PIC; look at gmp-6.2.1/mpn/x86/pentium/popcount.asm for
example:

ifdef(`PIC',`
...

for a routine that exists in both PIC and non-PIC versions.

Make sure that wherever $(FPIC) gets passed as a variable expansion
that it gets quoted where necessary (such as setting environment
variables in shell commands).

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
(cherry picked from commit af22991e03cae55f96b06996df2ff16752cec5d5)

3 years agokernel: DSA roaming fix for Marvell mv88e6xxx
DENG Qingfang [Mon, 22 Feb 2021 05:38:11 +0000 (13:38 +0800)]
kernel: DSA roaming fix for Marvell mv88e6xxx

Marvell mv88e6xxx switch series cannot perform MAC learning from
CPU-injected (FROM_CPU) DSA frames, which results in 2 issues.
- excessive flooding, due to the fact that DSA treats those addresses
as unknown
- the risk of stale routes, which can lead to temporary packet loss

Backport those patch series from netdev mailing list, which solve these
issues by adding and clearing static entries to the switch's FDB.

Add a hack patch to set default VID to 1 in port_fdb_{add,del}. Otherwise
the static entries will be added to the switch's private FDB if VLAN
filtering disabled, which will not work.

The switch may generate an "ATU violation" warning when a client moves
from the CPU port to a switch port because the static ATU entry added by
DSA core still points to the CPU port. DSA core will then clear the static
entry so it is not fatal. Disable the warning so it will not confuse users.

Link: https://lore.kernel.org/netdev/20210106095136.224739-1-olteanv@gmail.com/
Link: https://lore.kernel.org/netdev/20210116012515.3152-1-tobias@waldekranz.com/
Ref: https://gitlab.nic.cz/turris/turris-build/-/issues/165
Signed-off-by: DENG Qingfang <dqfext@gmail.com>
(cherry picked from commit 920eaab1d8179035d0ae1047e75cf9a50da6a6eb)

3 years agox86/base-files: add support for Sophos SG/XG-105
Stan Grishin [Wed, 24 Mar 2021 16:18:08 +0000 (16:18 +0000)]
x86/base-files: add support for Sophos SG/XG-105

This adds detection of the Sophos SG-105 and Sophos XG-105 models
and assignment of ethernet ports these models have to LAN/WAN.

Signed-off-by: Stan Grishin <stangri@melmac.net>
(cherry picked from commit 64eaf633ff7f9280e04e65ae290eb8b65dd9e021)

3 years agoiproute2: fix libbpf detection with NLS enabled
Tony Ambardar [Sat, 27 Mar 2021 12:43:03 +0000 (05:43 -0700)]
iproute2: fix libbpf detection with NLS enabled

Upstream iproute2 detects libbpf using a one-line $CC test-compile, which
normally ignores LDFLAGS. With NLS enabled however, LDFLAGS includes an
"rpath-link" linker option needed to resolve libintl.so. Its absence
causes both the compile and libbpf detection to fail:

  ld: warning: libintl.so.8, needed by libbpf.so, not found (try using
      -rpath or -rpath-link)
  ld: libelf.so.1: undefined reference to `libintl_dgettext'
  collect2: error: ld returned 1 exit status

Fix this by directly including $LDFLAGS in the test-compile command.

Reported-by: Ian Cooper <iancooper@hotmail.com>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
(cherry picked from commit aab3a04ce87c27996b7ce9ea306db8c6eed86941)

3 years agobinutils: fix libbfd missing DSO dependency if NLS enabled
Tony Ambardar [Sun, 28 Mar 2021 07:40:31 +0000 (00:40 -0700)]
binutils: fix libbfd missing DSO dependency if NLS enabled

The libbfd package definition uses $(ICONV_DEPENDS) and $(INTL_DEPENDS)
but links against neither, leading to libbfd detection failures in other
packages (e.g. bpftools) and on-target relocation problems with libintl.so:

  root@OpenWrt:/# ldd /usr/lib/libbfd.so
        ldd (0x77db6000)
        libc.so => ldd (0x77db6000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x77c6d000)
  Error relocating /usr/lib/libbfd.so: libintl_dgettext: symbol not found

Add NLS-conditional linking of "libintl" to fix this. Also remove libbfd
package dependency $(ICONV_DEPENDS) which is not used during building or
linking.

Tested with QEMU on malta/be32, after building all packages from binutils,
bpftools and iproute2, using different libc options musl and glibc.

Fixes: 08e817569630 ("binutils: use nls.mk to fix libbfd link errors in
other packages")
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
(cherry picked from commit 9a59f62f613b1ca774032ccd80c51c74491b142c)

3 years agobpftools: drop unneeded libintl linking for NLS
Tony Ambardar [Sun, 28 Mar 2021 08:12:22 +0000 (01:12 -0700)]
bpftools: drop unneeded libintl linking for NLS

There is no direct linking of libintl from bpftools, only secondary linking
through libelf, so remove "-lintl" from TARGET_LDFLAGS.

Fixes: 5582fbd6135f ("bpftools: support NLS, fix ppc build and update to 5.8.9")
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
(cherry picked from commit c8c638a19b63bf6c3bf8094aebd8fde6feda36ba)

3 years agoiproute2: separate tc into tiny and full variants
Tony Ambardar [Tue, 2 Mar 2021 01:14:50 +0000 (17:14 -0800)]
iproute2: separate tc into tiny and full variants

This change was investigated previously [1] but not deemed necessary. With
the recent addition [2] of modern BPF loader support, however, tc gained
dependencies on libelf and libbpf, with a larger installation footprint.

Similar to ip-tiny/ip-full, split tc into tc-full and tc-tiny variants,
where the latter excludes the eBPF loader, uses a smaller executable, and
avoids libelf and libbpf package dependencies. Both variants provide the
'tc' virtual package, with tc-tiny as the default.

The previous tc package included a loadable module for iptables actions.
Separate this out into a common package, tc-mod-iptables, which both
variants depend on. Some package sizes on mips_24kc:

Before:
  148343  tc_5.11.0-1_mips_24kc.ipk

After:
  144833  tc-full_5.11.0-2_mips_24kc.ipk
  138430  tc-tiny_5.11.0-2_mips_24kc.ipk  (and no libelf or libbpf)
    4115  tc-mod-iptables_5.11.0-2_mips_24kc.ipk

Also fix up some Makefile indentation.

[1] https://github.com/openwrt/openwrt/pull/1627#issuecomment-447619962
[2] b048a305a3d3 ("iproute2: update to 5.11.0")

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
(cherry picked from commit 72885e9608d9c0fa06abce6bdb6dd054c2116eb7)

3 years agokernel/modules: relocate teql hotplug from iproute2 to kmod-sched
Tony Ambardar [Tue, 2 Mar 2021 04:59:04 +0000 (20:59 -0800)]
kernel/modules: relocate teql hotplug from iproute2 to kmod-sched

The link equalizer sch_teql.ko of package kmod-sched relies on a hotplug
script historically included in iproute2's tc package. In previous
discussion [1], consensus was the hotplug script is best located together
with the module in kmod-sched, but this change was deferred at the time.

Relocate the hotplug script now. This change also simplifies adding a tc
variant for minimal size with reduced functionality.

[1] https://github.com/openwrt/openwrt/pull/1627#issuecomment-447923636

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
(cherry picked from commit 863ce4f15f74a674f01ab47f445b362c113b113b)

3 years agoiproute2: add missing limits.h includes
Tony Ambardar [Sat, 13 Mar 2021 04:58:28 +0000 (20:58 -0800)]
iproute2: add missing limits.h includes

This patch has been submitted upstream to fix an error reported by a few
users. One instance seen using gcc 10.2.0, binutils 2.35.1 and musl 1.1.24:

bpf_glue.c: In function 'get_libbpf_version':
bpf_glue.c:46:11: error: 'PATH_MAX' undeclared (first use in this function);
did you mean 'AF_MAX'?
   46 |  char buf[PATH_MAX], *s;
      |           ^~~~~~~~
      |           AF_MAX

Reported-by: Rui Salvaterra <rsalvaterra@gmail.com>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
(cherry picked from commit 10ffefe60299637bc592ec4ef0dde93e0e2e8344)

3 years agoiproute2: update to 5.11.0
Tony Ambardar [Sat, 20 Feb 2021 16:56:20 +0000 (08:56 -0800)]
iproute2: update to 5.11.0

The latest iproute2 version brings various improvements and fixes:
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/log/?qt=range&q=v5.10.0..v5.11.0

In particular, ip and tc now use libbpf as the standard way to load BPF
programs, rather than the old, limited custom loader. This allows more
consistent and featureful BPF program handling e.g. support for global
initialized variables.

Also fix a longstanding problem with iproute2 builds where unneeded DSO
dependencies are added to most utilities, bloating their installation
footprint. From research and testing, explicitly using a "--as-needed"
linker flag avoids the issue. Update accordingly and drop extra package
dependencies from Makefile.

Additional build and packaging updates include:

  - install missing development header to iproute2/bpf_elf.h
  - propagate OpenWrt verbose flag during build
  - update and refresh patches

Compile and run tested: QEMU/malta-mips32be on kernels 5.4 & 5.10.

All iproute2 packages were built and installed to the test image. Some
regression testing using ip-full and tc was successfully performed to
exercise several kmods, tc modules, and simple BPF programs.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
(cherry picked from commit b048a305a3d3cbb5375e32757e70aa129b4c7c4f)

3 years agowireguard-tools: depend on kmod-wireguard
Ilya Lipnitskiy [Thu, 25 Feb 2021 18:20:12 +0000 (10:20 -0800)]
wireguard-tools: depend on kmod-wireguard

To the vast majority of the users, wireguard-tools are not useful
without the underlying kernel module. The cornercase of only generating
keys and not using the secure tunnel is something that won't be done on
an embedded OpenWrt system often. On the other hand, maintaining a
separate meta-package only for this use case introduces extra
complexity. WireGuard changes for Linux 5.10 remove the meta-package.
So let's make wireguard-tools depend on kmod-wireguard
to make WireGuard easier to use without having to install multiple
packages.

Fixes: ea980fb9 ("wireguard: bump to 20191226")
Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
(cherry picked from commit cbcddc9f318607881799e329b327a68c4e76d5cb)

3 years agokernel: fix kmod-wireguard package fields
Ilya Lipnitskiy [Thu, 25 Feb 2021 18:20:11 +0000 (10:20 -0800)]
kernel: fix kmod-wireguard package fields

Use NETWORK_SUPPORT_MENU like all other modules in netsupport.mk. Drop
SECTION and CATEGORY fields as they are set by default and to match
other packages in netsupport.mk. Use better TITLE for kmod-wireguard
(taken from upstream drivers/net/Kconfig).

Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
(cherry picked from commit 0b53d6f7fa8cc35cec5b22e1c64a2407fab6dfe3)

3 years agowireguard-tools: bump to 1.0.20210223
Jason A. Donenfeld [Tue, 23 Feb 2021 21:10:38 +0000 (22:10 +0100)]
wireguard-tools: bump to 1.0.20210223

Simple version bump with accumulated fixes.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
(cherry picked from commit e0f7f5bbce0d03e5192b5dad5a24fcb8566da97f)

3 years agokernel: migrate wireguard into the kernel tree
Ilya Lipnitskiy [Fri, 19 Feb 2021 16:22:08 +0000 (08:22 -0800)]
kernel: migrate wireguard into the kernel tree

On Linux 5.4, build WireGuard from backports. Linux 5.10 contains
wireguard in-tree.

Add in-kernel crypto libraries required by WireGuard along with
arch-specific optimizations.

Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
(cherry picked from commit 06351f1bd0455abacb700db5098bb798f66948fc)
(cherry picked from commit 464451d9ab824c2ed62f7da33f0a965f562714c8)

3 years agokernel: 5.4: import wireguard backport
Jason A. Donenfeld [Fri, 19 Feb 2021 13:29:04 +0000 (14:29 +0100)]
kernel: 5.4: import wireguard backport

Rather than using the clunky, old, slower wireguard-linux-compat out of
tree module, this commit does a patch-by-patch backport of upstream's
wireguard to 5.4. This specific backport is in widespread use, being
part of SUSE's enterprise kernel, Oracle's enterprise kernel, Google's
Android kernel, Gentoo's distro kernel, and probably more I've forgotten
about. It's definately the "more proper" way of adding wireguard to a
kernel than the ugly compat.h hell of the wireguard-linux-compat repo.
And most importantly for OpenWRT, it allows using the same module
configuration code for 5.10 as for 5.4, with no need for bifurcation.

These patches are from the backport tree which is maintained in the
open here: https://git.zx2c4.com/wireguard-linux/log/?h=backport-5.4.y
I'll be sending PRs to update this as needed.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
(cherry picked from commit 3888fa78802354ab7bbd19b7d061fd80a16ce06b)
(cherry picked from commit d54072587146dd0db9bb52b513234d944edabda3)
(cherry picked from commit 196f3d586f11d96ba4ab60068cfb12420bcd20fd)
(cherry picked from commit 3500fd7938a6d0c0e320295f0aa2fa34b1ebc08d)
(cherry picked from commit 23b801d3ba57e34cc609ea40982c7fbed08164e9)
(cherry picked from commit 0c0cb97da7f5cc06919449131dd57ed805f8f78d)
(cherry picked from commit 2a27f6f90a430342cdbe84806e8b10acff446a2d)
Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
3 years agozynq: Enable CONFIG_KERNEL_MODE_NEON
Ilya Lipnitskiy [Fri, 19 Feb 2021 23:41:42 +0000 (15:41 -0800)]
zynq: Enable CONFIG_KERNEL_MODE_NEON

This flag is set on all other platforms. And Zynq 7000 SoC does have
NEON support:
https://www.xilinx.com/support/documentation/application_notes/xapp1206-boost-sw-performance-zynq7soc-w-neon.pdf

Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
(cherry picked from commit 7d00f632b7b245bcf25783797308325aa255b020)

3 years agobcm4908: enable Netgear R8000P bootloader image
Rafał Miłecki [Thu, 8 Apr 2021 08:39:56 +0000 (10:39 +0200)]
bcm4908: enable Netgear R8000P bootloader image

This enables building BCM4908 "raw" image that can be flashed using
bootloader web UI. It requires serial console access & stopping booting
by the "Press any key to stop auto run".

It's easy to build vendor like CHK image but it can't be safely flashed
using vendor UI at this point. Netgear implements method called "NAND
incremental flashing" that doesn't seem to flash bootfs partition as
provided.

Above method seems to update vmlinux.lz without updating 94908.dtb. It
prevents OpenWrt kernel from booting due to incomplete DTB file. Full
Netgear R8000P support can be enabled after finding a way to make vendor
firmware flash OpenWrt firmware including the 94908.dtb update.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit d92a9c97bf3700e90af1d3c9157502af660365c0)

3 years agobcm4908: enable target & Asus GT-AC5300 image
Rafał Miłecki [Thu, 8 Apr 2021 07:12:43 +0000 (09:12 +0200)]
bcm4908: enable target & Asus GT-AC5300 image

OpenWrt was succesfully tested on the GT-AC5300 model. It's possible to:
1. Install OpenWrt using vendor UI
2. Perform UBI aware sysupgrade
3. Install vendor firmware using OpenWrt sysupgrade

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 5e78cb9b85a045f436abf6a03aa5c774d30e1090)

3 years agofirmware-utils: bcm4908img: convert into a package
Rafał Miłecki [Thu, 1 Apr 2021 15:06:47 +0000 (17:06 +0200)]
firmware-utils: bcm4908img: convert into a package

bcm4908img is a tool managing BCM4908 platform images. It's used for
creating them as well as checking, modifying and extracting data from.

It's required by both: host (for building firmware images) and target
(for sysupgrade purposes). Make it a host/target package.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 9b4fc4cae9fa0cd0cd9060e1c9d33320c3249ced)

3 years agofirmware-utils: bcm4908img: fix uninitialized var usage
Rafał Miłecki [Thu, 8 Apr 2021 07:10:20 +0000 (09:10 +0200)]
firmware-utils: bcm4908img: fix uninitialized var usage

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 5a2086d230063b2f83a436ed37b0f6a92706bcb9)

3 years agobcm4908: fix Netgear R8000P image
Rafał Miłecki [Wed, 7 Apr 2021 12:38:45 +0000 (14:38 +0200)]
bcm4908: fix Netgear R8000P image

Use vendor format to allow flashing using Negear UI.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit f2c8c62d98f2137d8af896e56d5e29759cf48715)

3 years agobcm4908: add sysupgrade support
Rafał Miłecki [Wed, 7 Apr 2021 12:14:57 +0000 (14:14 +0200)]
bcm4908: add sysupgrade support

It supports flashing OpenWrt images (bootfs & UBI upgrade) as well as
vendor images (whole MTD partition write).

Upgrading cferom is unsupported. It requires copying device specific
data (like MAC) to target image before flashing.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit a6a0b252baa6c19dfc62611ea910b56527ce4fa5)

3 years agobcm4908: pad firmware image bootfs JFFS2 partition to 8 MiB
Rafał Miłecki [Wed, 7 Apr 2021 07:30:30 +0000 (09:30 +0200)]
bcm4908: pad firmware image bootfs JFFS2 partition to 8 MiB

This way MTD "bootfs" partition will be always 8+ MiB. This should be
enough for any custom / future firmware to fit its bootfs (e.g. big
kernel) without having to repertition whole flash. That way we can
preserve UBI and its erase counters during sysupgrade.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit ca9b1f15c424d68af0f372c37c8eee81b36ee7e1)

3 years agofirmware-utils: bcm4908img: extract bootfs without padding
Rafał Miłecki [Wed, 7 Apr 2021 05:59:57 +0000 (07:59 +0200)]
firmware-utils: bcm4908img: extract bootfs without padding

JFFS2 bootfs partition in a BCM4908 image usually includes some padding.
For flashing it individually (writing to designed MTD partition) we want
just JFFS2 data.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit ed7edf88e20c9dd0026e5c5629d8a6500d3e3f80)

3 years agofirmware-utils: bcm4908img: fix extracting cferom
Rafał Miłecki [Tue, 6 Apr 2021 22:17:40 +0000 (00:17 +0200)]
firmware-utils: bcm4908img: fix extracting cferom

Fix offset to extract proper data when image contains vendor header.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit dcbde11af181055f2d1c77ebc19f50c29bbab96e)

3 years agofirmware-utils: bcm4908img: support extracting bootfs & rootfs
Rafał Miłecki [Mon, 5 Apr 2021 17:30:06 +0000 (19:30 +0200)]
firmware-utils: bcm4908img: support extracting bootfs & rootfs

It's required for upgrading firmware using single partitions instead of
just blindly writing whole image.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit e33957c241abf8f0dbf5f3713058d126fb4599b4)

3 years agofirmware-utils: bcm4908img: replace size with offset
Rafał Miłecki [Mon, 5 Apr 2021 23:06:52 +0000 (01:06 +0200)]
firmware-utils: bcm4908img: replace size with offset

It's much easier to operate on BCM4908 image data with absolute offset
of each section stored. It doesn't require summing sizes over and over.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 5314cab729b743d3b8b08db4e01c3095017f4e68)

3 years agobcm4908: rename bootfs dummy file to the 1-openwrt
Rafał Miłecki [Mon, 5 Apr 2021 22:03:31 +0000 (00:03 +0200)]
bcm4908: rename bootfs dummy file to the 1-openwrt

The purpose of that dummy file is to make CFE work properly with OpenWrt
bootfs. CFE for some reason ignores JFFS2 files with ino 0.

Rename it to 1-openwrt so:
1. It's consistent with bcm63xx
2. It's OpenWrt specific so sysupgrade can distinguish it from vendor
   images

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 880c8b44223c9cbce3dd14da78c33676c6f1a8a6)