openwrt/openwrt.git
21 months agomvebu: move upstreamed DTS files (ESPRESSObin) to files-5.4
Adrian Schmutzler [Tue, 23 Feb 2021 10:43:33 +0000 (11:43 +0100)]
mvebu: move upstreamed DTS files (ESPRESSObin) to files-5.4

Since kernel 5.5-rc1 [1], there are upstreamed DTS files related to ESPRESSObin
variants. Move these to files-5.4.

This helps if you want to use a newer kernel version than used
in OpenWrt 21.02 (= LTS kernel 5.4), you would end up with duplicate files
(one outdated, one up to date from newer Linux versions).

Fixes:
Error: arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7.dts:19.1-7:
Label or path ports not found
FATAL ERROR: Syntax error parsing input tree

[1] https://github.com/torvalds/linux/commit/447b8789359f9a5e6567c4044d18abaa7de68930

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 7be8ab4f7b582924bca6594103735d888989d804)
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
[reword commit subject and commit description]

21 months agocryptodev-linux: update to 1.12
Rosen Penev [Thu, 23 Sep 2021 19:57:52 +0000 (12:57 -0700)]
cryptodev-linux: update to 1.12

Remove upstream backport.

Use AUTORELEASE for simplicity.

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

21 months agokernel: check dst of flow offloading table
Ritaro Takenaka [Wed, 25 May 2022 06:55:48 +0000 (15:55 +0900)]
kernel: check dst of flow offloading table

Flow offload dst can become invalid after the route cache is created.
dst_check() in packet path is necessary to prevent packet drop.

Signed-off-by: Ritaro Takenaka <ritarot634@gmail.com>
21 months agoopenssl: bump to 1.1.1o
Eneas U de Queiroz [Tue, 10 May 2022 23:34:57 +0000 (20:34 -0300)]
openssl: bump to 1.1.1o

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

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

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit 7a5ddc0d06895bde7538d78c8dad2c863d70f946)

21 months agokernel: bump 5.4 to 5.4.203
Hauke Mehrtens [Sun, 3 Jul 2022 16:46:35 +0000 (16:46 +0000)]
kernel: bump 5.4 to 5.4.203

Merged upstream:
 bcm27xx/patches-5.4/950-1014-Revert-mailbox-avoid-timer-start-from-callback.patch
 generic/backport-5.4/080-wireguard-0021-crypto-blake2s-generic-C-library-implementation-and-.patch

Manually adapted:
 layerscape/patches-5.4/801-audio-0005-Revert-ASoC-fsl_sai-Add-support-for-SAI-new-version.patch
 oxnas/patches-5.4/100-oxnas-clk-plla-pllb.patch

Compile-tested: lantiq/xrx200
Run-tested: lantiq/xrx200

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
21 months agoexfat: update to 5.19.1
Chukun Pan [Wed, 8 Jun 2022 15:05:03 +0000 (23:05 +0800)]
exfat: update to 5.19.1

Major changes are:
  4 cleanups & typos fixes.
  Add keep_last_dots mount option to allow access to paths
  with trailing dots.
  Avoid repetitive volume dirty bit set/clear to improve
  storage life time.
  Fix ->i_blocks truncation issue caused by wrong 32bit mask.
  Fix ->i_blocks truncation issue that still exists elsewhere.
  Fix missing REQ_SYNC in exfat_update_bhs().
  Fix referencing wrong parent directory information during rename.
  Fix slab-out-bounds in exat_clear_bitmap() reported from syzbot.
  Improve performance while zeroing a cluster with dirsync mount option.
  Introduce a sys_tz mount option to use system timezone.
  Move super block magic number to magic.h

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
22 months agoramips: fix booting on ZyXEL NBG-419N v2
Piotr Dymacz [Mon, 23 May 2022 15:50:19 +0000 (17:50 +0200)]
ramips: fix booting on ZyXEL NBG-419N v2

This fixes a well known "LZMA ERROR 1" error, reported previously on
numerous of other devices from 'ramips' target.

Fixes: #9842
Fixes: #8964
Reported-by: Juergen Hench <jurgen.hench@gmail.com>
Tested-by: Juergen Hench <jurgen.hench@gmail.com>
Signed-off-by: Demetris Ierokipides <ierokipides.dem@gmail.com>
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
(cherry picked from commit fd72e595c2b2a46bab8cbc7e9415fbfeae7b5b0d)

22 months agoramips: fix RT-AC57U button level
David Bauer [Sat, 18 Jun 2022 18:46:33 +0000 (20:46 +0200)]
ramips: fix RT-AC57U button level

Both buttons on the RT-AC57U are active-low. Fix the GPIO flag for the
WPS cutton to fix button behavior.

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

23 months agokernel: bump 5.4 to 5.4.194
Hauke Mehrtens [Tue, 17 May 2022 21:33:27 +0000 (21:33 +0000)]
kernel: bump 5.4 to 5.4.194

Compile-tested: lantiq/xrx200, armvirt/64
Run-tested: lantiq/xrx200, armvirt/64

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
23 months agokernel: bump 5.4 to 5.4.192
Hauke Mehrtens [Tue, 10 May 2022 18:34:09 +0000 (18:34 +0000)]
kernel: bump 5.4 to 5.4.192

Compile-tested: armvirt/64
Run-tested: armvirt/64

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
23 months agokernel: bump 5.4 to 5.4.191
Hauke Mehrtens [Mon, 9 May 2022 18:18:20 +0000 (18:18 +0000)]
kernel: bump 5.4 to 5.4.191

Merged upstream:
 apm821xx/patches-5.4/150-ata-sata_dwc_460ex-Fix-crash-due-to-OOB-write.patch

Similar patch merged upstream:
 bcm27xx/patches-5.4/950-0210-usb-xhci-Disable-the-XHCI-5-second-timeout.patch

Manually adapted:
 layerscape/patches-5.4/801-audio-0008-Revert-ASoC-Remove-dev_err-usage-after-platform_get_.patch

Compile-tested: armvirt/64
Run-tested: armvirt/64

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
23 months agofirewall: config: remove restictions on DHCPv6 allow rule
Tiago Gaspar [Wed, 4 May 2022 09:36:07 +0000 (10:36 +0100)]
firewall: config: remove restictions on DHCPv6 allow rule

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

Fixes: #5066
Signed-off-by: Tiago Gaspar <tiagogaspar8@gmail.com>
[rebase onto firewall3, clarify subject, bump PKG_RELEASE]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(backported from commit 65258f5d6093809c541050256646795bc0a460a9)

23 months agoramips: zbt-wg2626: Add the reset gpio for PCIe port 1
Alban Bedel [Sat, 30 Apr 2022 08:42:33 +0000 (10:42 +0200)]
ramips: zbt-wg2626: Add the reset gpio for PCIe port 1

The 2.4GHz interface doesn't come up properly with the log showing:

    mt7621-pci 1e140000.pcie: pcie1 no card, disable it (RST & CLK)

As seen on other MT7621 boards this is caused by a missing reset GPIO.
The MT7621 dtsi set GPIO 19 as PCIe reset GPIO, which on this board
reset the 5GHz interface on port 0. Add GPIO 8 to the PCIe reset GPIO
list to also reset the 2.4GHz interface on port 1.

Signed-off-by: Alban Bedel <albeu@free.fr>
(cherry picked from commit f953a1a4bfba2fa70c12bb80938aa66481a673b6)

23 months agoipq40xx: fix ar40xx driver
Nick Hainke [Mon, 18 Apr 2022 13:04:25 +0000 (15:04 +0200)]
ipq40xx: fix ar40xx driver

This commit is completely based on the work of adron-s:
https://github.com/openwrt/openwrt/pull/4721#issuecomment-1101108651

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

Tested on:
- Fritz!Box 4040
- Fritz!Box 7530
- Mikrotik SXTsq 5AC
- ZyXEL NBG6617

- [0] https://git.codelinaro.org/clo/qsdk/oss/lklm/qca-ssdk/-/blob/NHSS.QSDK.11.4/src/init/ssdk_init.c#L2072

Suggested-by: Serhii Serhieiev <adron@mstnt.com>
Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit ab7e53e5cce703c7a62efbe1d41fb94c2228a178)
[Deleted 5.10 from commit title]
Signed-off-by: Nick Hainke <vincent@systemli.org>
2 years agoiwinfo: drop obsolete patch
Jo-Philipp Wich [Wed, 27 Apr 2022 10:24:35 +0000 (12:24 +0200)]
iwinfo: drop obsolete patch

Fixes: 01cc5e195d ("iwinfo: update to latest Git HEAD")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2 years agoiwinfo: update to latest HEAD
David Bauer [Tue, 26 Apr 2022 22:53:11 +0000 (00:53 +0200)]
iwinfo: update to latest HEAD

dc6847e iwinfo: nl80211: omit A-hwmode on non-5GHz hardware

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

2 years agohostapd: refresh patches
David Bauer [Sun, 24 Apr 2022 23:11:32 +0000 (01:11 +0200)]
hostapd: refresh patches

Signed-off-by: David Bauer <mail@david-bauer.net>
2 years agohostapd: add ubus link-measurements notifications
David Bauer [Thu, 31 Mar 2022 20:39:04 +0000 (22:39 +0200)]
hostapd: add ubus link-measurements notifications

Notify external ubus subscribers of received link-measurement reports.

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

2 years agohostapd: add ubus method for requesting link measurements
David Bauer [Tue, 29 Mar 2022 22:31:26 +0000 (00:31 +0200)]
hostapd: add ubus method for requesting link measurements

Add a ubus method to request link-measurements from connected STAs.

In addition to the STAs address, the used and maximum transmit power can
be provided by the external process for the link-measurement. If they
are not provided, 0 is used as the default value.

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

2 years agohostapd: add support for enabling link measurements
David Bauer [Thu, 31 Mar 2022 16:06:02 +0000 (18:06 +0200)]
hostapd: add support for enabling link measurements

Allow external processes to enable advertisement of link-measurement RRM
capability.

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

2 years agoiwinfo: update to latest HEAD
David Bauer [Sun, 24 Apr 2022 21:09:09 +0000 (23:09 +0200)]
iwinfo: update to latest HEAD

a479b9b devices: remove whitespace
562d015 iwinfo: nl80211: fix hwmode parsing for multi-band NICs

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

2 years agoiwinfo: update to latest Git head
Josef Schlehofer [Thu, 17 Mar 2022 23:07:50 +0000 (00:07 +0100)]
iwinfo: update to latest Git head

Changelog:
90bfbb9 devices: Add Cypress CYW43455
234075b devices: fix AMD RZ608 format
0e2a318 devices: add AMD RZ608 device-id

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
(cherry picked from commit 013b0435641ab12d9a896c29c213d90da64bc623)

2 years agoiwinfo: update to latest Git HEAD
Jo-Philipp Wich [Sun, 11 Jul 2021 13:59:48 +0000 (15:59 +0200)]
iwinfo: update to latest Git HEAD

a0a0e02 iwinfo: rename hardware.txt to devices.txt

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(backported from commit c13d7c82aa4cd2cbf1f61bad857cd01b795318e3)

2 years agoiwinfo: update to the latest version
Felix Fietkau [Mon, 28 Jun 2021 13:44:51 +0000 (15:44 +0200)]
iwinfo: update to the latest version

c9b1672f5a83 nl80211: fix path compatibility issue

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

2 years agoiwinfo: update to the latest version
Felix Fietkau [Thu, 10 Jun 2021 06:52:28 +0000 (08:52 +0200)]
iwinfo: update to the latest version

aa0e3c4bbe12 iwinfo: nl80211: add support for printing the device path for a phy
dd6d6d2dec35 iwinfo: nl80211: use new path lookup function for nl80211_phy_idx_from_uci_path
268bb26d2e2a iwinfo: nl80211: support looking up phy by path=.. and macaddr=...
c0414642fead iwinfo: nl80211: fix typo

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(backported from commit 6e8475bbd0c841043c1187fb5a42d835071ad502)

2 years agowolfssl: fix compilation with /dev/crypto
Eneas U de Queiroz [Wed, 13 Apr 2022 13:30:15 +0000 (10:30 -0300)]
wolfssl: fix compilation with /dev/crypto

This is trivial fix of a duplicate definition of 'int ret'.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit df622768da10f36ceeb20346b4c4ee4eb9a8a9ad)

2 years agokernel: add missing config symbols
Felix Fietkau [Tue, 19 Apr 2022 19:14:42 +0000 (21:14 +0200)]
kernel: add missing config symbols

MPLS feature symbols are normally only set when kmod-mpls is enabled, but the
CONFIG_MPLS symbol they depend on could also have been selected by openvswitch
instead

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

2 years agomac80211: fix QCA9561 PA bias
Thibaut VARÈNE [Tue, 19 Apr 2022 08:59:41 +0000 (10:59 +0200)]
mac80211: fix QCA9561 PA bias

This patch fixes an invalid TX PA DC bias level on QCA9561, which
results in a very low output power and very low throughput as devices
are further away from the AP (compared to other 2.4GHz APs),
following a suggestion from nbd[1].

This patch has been submitted upstream[2].

[1] https://lore.kernel.org/all/91c58969-c60e-2f41-00ac-737786d435ae@nbd.name
[2] https://lore.kernel.org/linux-wireless/20220417145145.1847-1-hacks+kernel@slashdirt.org/

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
(cherry-picked from 7dc52a78ae2c2f748a0c0c4adcb13979260b3498)

2 years agoramips: mt7620: disable SOC VLANs for external switches
Michael Pratt [Tue, 20 Apr 2021 16:35:47 +0000 (12:35 -0400)]
ramips: mt7620: disable SOC VLANs for external switches

These boards have AR8327 or QCA8337 external ethernet switch.
The SOC also has it's own internal switch
where VLAN is now enabled by default.

Changes to preinit caused all switches to have VLANs enabled by default
even if they are not configured with a topology in uci_defaults
(see commit f017f617aecbd47debd4d3a734dc0e471342db96)

When both internal and external switches have VLANs,
and the external switch has both LAN and WAN,
the TX traffic from the SOC cannot flow to the tagged port on the external switch
because the VLAN IDs are not matching.

So disable the internal switch VLANs by default on these boards.

Also, add a topology for the internal switch,
so that on LuCI there is not an "unknown topology" warning.

In theory, it may be possible to have LAN ports on both switches
through internal and external PHYs, but there are no known boards that have this.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit 2adeada04558848058105cdad8195848d10d1486)

2 years agoramips: mt7620: ethernet: use more macros and bump version
Michael Pratt [Sat, 1 May 2021 18:47:01 +0000 (14:47 -0400)]
ramips: mt7620: ethernet: use more macros and bump version

Define and use some missing macros,
and use them instead of BIT() or numbers for more readable code.

Add comment for a bit change that seems unrelated to ethernet
but is actually needed (PCIe Root Complex mode).

Remove unknown and unused macro RST_CTRL_MCM
(probably from MT7621 / MT7622)

This is the last of a series of fixes, so bump version.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit 88a0cebadfecb6ebb9f5f535e74f7f7574f513f3)

2 years agoramips: mt7620: fix RGMII TXID PHY mode
Michael Pratt [Sat, 1 May 2021 18:17:11 +0000 (14:17 -0400)]
ramips: mt7620: fix RGMII TXID PHY mode

the register bits for TX delay and RX delay are opposites:
when TX delay bit is set, delay is enabled
when RX delay bit is set, delay is disabled

So, when both bits are unset, it is RX delay
and when both bits are set, it is TX delay

Note: TXID is the default RGMII mode of the SOC

Fixes: 5410a8e2959a ("ramips: mt7620: add rgmii delays support")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit 26c84b2e46caba1ae17bc82a533c99eee65e7004)

2 years agoramips: mt7620: add ephy-disable option to switch driver
Michael Pratt [Mon, 31 May 2021 07:56:20 +0000 (03:56 -0400)]
ramips: mt7620: add ephy-disable option to switch driver

Add back the register write to disable internal PHYs
as a separate option in the code that can be set using a DTS property.

Set the option to true by default
when an external mt7530 switch is identified.

This makes the driver more in sync with original SDK code
while keeping the lines separated into different options
to accommodate any board with any PHY layout.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit cc6fd6fbb505071e08011f7998afaffefcf08fd3)

2 years agoramips: mt7620: move mt7620_mdio_mode() to ethernet driver
Michael Pratt [Sun, 30 May 2021 06:02:47 +0000 (02:02 -0400)]
ramips: mt7620: move mt7620_mdio_mode() to ethernet driver

The function mt7620_mdio_mode is only called once
and both the function and mdio_mode block have been named incorrectly,
leading to confusion and useless commits.

These lines in the mdio_mode block of mt7620_hw_init
are only intended for boards with an external mt7530 switch.
(see commit 194ca6127ee18cd3a95da4d03f02e43b5428c0bb)

Therefore, move lines from mdio_mode to the place in soc_mt7620.c
where the type of mt7530 switch is identified,
and move lines from mt7620_mdio_mode to a main function.

mt7620_mdio_mode was called from mt7620_gsw_init
where the priv struct is available,
so the lines must stay in mt7620_gsw_init function.

In order to keep things as simple as possible,
keep the DTS property related function calls together,
by moving them from mt7620_gsw_probe to init.

Remove the now useless DTS properties and extra phy nodes.

Fixes: 5a6229a93df8 ("ramips: remove superfluous & confusing DT binding")
Fixes: b85fe43ec8c4 ("ramips: mt7620: add force use of mdio-mode")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit 6972e498d33ec896c676b7af91e3bfb00aa846a1)

2 years agoramips: mt7620: use DTS to set PHY base address for external PHYs
Michael Pratt [Sat, 3 Apr 2021 18:42:51 +0000 (14:42 -0400)]
ramips: mt7620: use DTS to set PHY base address for external PHYs

Set the PHY base address to 12 for mt7530 and 8 for others,
which is based on the default setting for some devices
from printing the register with the following command
after it is written to by uboot during the boot cycle.

`md 0x10117014 1`

PHY_BASE option only uses 5 bits of the register,
bits 16 to 20, so use 8-bit integer type.

Set the option using the DTS property mediatek,ephy-base
and create the gsw node if missing.

Also, added a kernel message to display the EPHY base address.

Note:
If anything is written to a PHY address that is greater than 1 hex char (greater than 0xf)
then there is adverse effects with Atheros switches.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit 0976b6c4262a11a8d0dab9aeb64f5cdee266c44a)

2 years agoramips: mt7620: allow both internal and external PHYs
Michael Pratt [Tue, 20 Apr 2021 22:45:15 +0000 (18:45 -0400)]
ramips: mt7620: allow both internal and external PHYs

When the new variable ephy_base was introduced,
it was not applied to the if block for mdio_mode.

The first line in the mdio_mode if block
sets the EPHY base address to 12 in the SOC by writing a register,
but the corresponding variable in the driver
was still set to the default of 0.

This causes subsequent lines that write registers with the function
_mt7620_mii_write
to write to PHY addresses 0 through 4
while internal PHYs have been moved to addresses 12 through 16.

All of these lines are intended only for PHYs on the SOC internal switch,
however, they are being written to external ethernet switches
if they exist at those PHY addresses 0 through 4.
This causes some ethernet ports to be broken on boards with AR8327 or QCA8337 switch.

Other suggested fixes move those lines to the else block of mdio_mode,
but removing the else block completely also fixes it.

Therefore, move the lines to the mt7620_hw_init function main block,
and have only one instance of the function mtk_switch_w32
for writing the register with the EPHY base address.

In theory, this also allows for boards that have both external switches
and internal PHYs that lead to ethernet ports to be supported.

Fixes: 391df3782914 ("ramips: mt7620: add EPHY base mdio address changing possibility")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit de5394a29dae9356a830d043e76591698411e97a)

2 years agoramips: mt7620: fix ethernet driver GMAC port init
Michael Pratt [Wed, 2 Jun 2021 03:01:26 +0000 (23:01 -0400)]
ramips: mt7620: fix ethernet driver GMAC port init

A workaround was added to the switch driver
to set SOC port 4 as an RGMII GMAC interface
based on the DTS property mediatek,port4-gmac.
(previously mediatek,port4)

However, the ethernet driver already does this,
but is being blocked by a return statement
whenever the phy-handle and fixed-link properties
are both missing from nodes that define the port properties.

Revert the workaround, so that both the switch driver
and ethernet driver are not doing the same thing
and move the phy-handle related lines down
so nothing is ending the function prematurely.

While at it, clean up kernel messages
and delete useless return statements.

Fixes: f6d81e2fa1f1 ("mt7620: gsw: make IntPHY and ExtPHY share mdio addr 4 possible")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit afd60d650e769e9578eac5bb3647807f683aaf7c)

2 years agoramips: mt7620: remove useless GMAC nodes
Michael Pratt [Fri, 11 Jun 2021 18:54:43 +0000 (14:54 -0400)]
ramips: mt7620: remove useless GMAC nodes

These nodes are used for configuring a GMAC interface
and for defining external PHYs to be accessed with MDIO.

None of this is possible on MT7620N, only MT7620A,
so remove them from all MT7620N DTS.

When the mdio-bus node is missing, the driver returns -NODEV
which causes the internal switch to not initialize.
Replace that return so that everything works without the DTS node.

Also, an extra kernel message to indicate for all error conditions
that mdio-bus is disabled.

Fixes: d482356322c9 ("ramips: mt7620n: add mdio node and disable port4 by default")
Fixes: aa5014dd1a58 ("ramips: mt7620n: enable port 4 as EPHY by default")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit a2acdf9607045e5669c305c57dd7c77be8351ba0)

2 years agoramips: mt7620: simplify DTS properties for GMAC
Michael Pratt [Wed, 31 Mar 2021 20:09:37 +0000 (16:09 -0400)]
ramips: mt7620: simplify DTS properties for GMAC

There are only 2 options in the driver
for the function of mt7620 internal switch port 4:

  EPHY mode (RJ-45, internal PHY)
  GMAC mode (RGMII, external PHY)

Let the DTS property be boolean instead of string
where EPHY mode is the default.

Fix how the properties are written
for all DTS that use them,
and add missing nodes where applicable,
and remove useless nodes,
and minor DTS formatting.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit 953bfe2eb3b7236a72fa41ab2204fdaa9fd09f65)

2 years agoramips: mt7620: enable autonegotiation for all ports
Gaspare Bruno [Wed, 13 Jan 2021 21:03:39 +0000 (18:03 -0300)]
ramips: mt7620: enable autonegotiation for all ports

This enables autonegotiation for all ephy ports on probe.
Some devices do not configure the ports, particularly port 4.

Signed-off-by: Gaspare Bruno <gaspare@anlix.io>
[replace magic values ; reword commit message]
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 0056ffb468f40f34bea006eb889b70c9a4f562e0)

2 years agoramips: make PHY initialization more descriptive
David Bauer [Sun, 6 Jun 2021 17:45:24 +0000 (19:45 +0200)]
ramips: make PHY initialization more descriptive

The basic mode control register of the ESW PHYs is modified in this
codeblock. Use the respective macros to make this code more readable.

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

2 years agoramips: add support for the Wavlink WL-WN579X3
Ben Gainey [Sun, 31 Jan 2021 11:15:38 +0000 (11:15 +0000)]
ramips: add support for the Wavlink WL-WN579X3

About the device
----------------

SoC: MediaTek MT7620a @ 580MHz
RAM: 64M
FLASH: 8MB
WiFi: SoC-integrated: MediaTek MT7620a bgn
WiFi: MediaTek MT7612EN nac
GbE: 2x (RTL8211F)
BTN: - WPS
- Reset
- Router/Repeater/AP (3-way slide-switch)
LED: - WPS (blue)
- 3-segment Wifi signal representation (blue)
- WiFi (blue)
- WAN (blue)
- LAN (blue)
- Power (blue)
UART: UART is present as Pads with through-holes on the PCB. They are
located next to the reset button and are labelled Vcc/TX/RX/GND as
appropriate. Use 3.3V, 57600-8N1.

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

Using the webcmd interface
--------------------------

Warning: Do not update to the latest Wavlink firmware (version
20201201) as this removes the webcmd console and you will need to
use the serial port instead.

You will need to have built uboot/sqauashfs image for this device,
and you will need to provide an HTTP service where the image can
be downloaded from that is accessible by the device.
You cannot use the device manufacturers firmware upgrade interface
as it rejects the OpenWrt image.

1. Log into the device's admin portal. This is necessary to
   authenticate you as a user in order to be able to access the
   webcmd interface.
2. Navigate to http://<device-ip>/webcmd.shtml - you can access
   the console directly through this page, or you may wish to
   launch the installed `telnetd` and use telnet instead.
   * Using telnet is recommended since it provides a more
     convenient shell interface that the web form.
   * Launch telnetd from the form with the command `telnetd`.
   * Check the port that telnetd is running on using
     `netstat -antp|grep telnetd`, it is likely to be 2323.
   * Connect to the target using `telnet`. The username should
     be `admin2860`, and the password is your admin password.
3. On the target use `curl` to download the image.
   e.g.  `curl -L -O http://<some-other-lan-ip>/openwrt-ramips-mt7620-\
          wavlink_wl-wn579x3-squashfs-sysupgrade.bin`.
   Check the hash using `md5sum`.
4. Use the mtd_write command to flash the image.
   * The flash partition should be mtd4, but check
     /sys/class/mtd/mtd4/name first. The partition should be
     called 'Kernel'.
   * To flash use the following command:
     `mtd_write -r -e /dev/mtd<n> write <image-file> /dev/mtd<n>`
     Where mtd<n> is the Kernel partition, and <image-file> is
     the OpenWrt image previously downloaded.
   * The command above will erase, flash and then reboot the
     device. Once it reboots it will be running OpenWrt.

Connect via ssh to the device at 192.168.1.1 on the LAN port.
The WAN port will be configured via DHCP.

Using the serial port
---------------------

The device uses uboot like many other MT7260a based boards. To
use this interface, you will need to connect to the serial
interface, and provide a TFTP server. At boot follow the
bootloader menu and select option 2 to erase/flash the image.
Provide the address and filename details for the tftp server.
The bootloader will do the rest.

Once the image is flashed, the board will boot into OpenWrt. The
console is available over the serial port.

Signed-off-by: Ben Gainey <ba.gainey@googlemail.com>
(cherry picked from commit a509b80065b6680e3e007203084c147f77b6717f)

2 years agoramips: split Youku YK1 to YK-L1 and YK-L1c
Shiji Yang [Sun, 16 May 2021 13:21:09 +0000 (21:21 +0800)]
ramips: split Youku YK1 to YK-L1 and YK-L1c

Device specifications:
* Model: Youku YK-L1/L1c
* CPU: MT7620A
* RAM: 128 MiB
* Flash: 32 MiB (YK-L1)/ 16 MiB (YK-L1c)
* LAN: 2* 10M/100M Ports
* WAN: 1* 10M/100M Port
* USB: 1* USB2.0
* SD: 1* MicroSD socket
* UART: 1* TTL, Baudrate 57600

Descriptions:
  Previous supported device YOUKU yk1 is actually Youku YK-L1. Though they look
  really different, the only hardware difference between the two models is flash
  size, YK-L1 has 32 MiB flash but YK-L1c has 16MiB. It seems that YK-L1c can
  compatible with YK-L1's firmware but it's better to split it to different models.

  It is easy to identify the models by looking at the label on the bottom of the
  device. The label has the model number "YK-L1" or "YK-L1c". Due to different flash
  sizes, YK-L1c that using previous YK-L1's firmware needs to apply "force update"
  to install compatible firmware, so please backup config file before system upgrade.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
[use more specific name for DTSI]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 4a9f389ed2dcee18a5c5e1f0d4e5c406f9290579)

2 years agoramips: improve pinctrl for Youku YK-L1
Shiji Yang [Sun, 4 Apr 2021 03:55:41 +0000 (11:55 +0800)]
ramips: improve pinctrl for Youku YK-L1

1. rename led pin "air" to a more common name "wlan" and use "phy0tpt" to trigger it.
2. led "wan" can be triggered by ethernet pinctrl by default so just drop it.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
(cherry picked from commit 882a6116d3d6394dd109350287067accebbf6114)

2 years agoramips: speed up spi frequency for Youku YK-L1
Shiji Yang [Sun, 21 Mar 2021 14:43:59 +0000 (22:43 +0800)]
ramips: speed up spi frequency for Youku YK-L1

Youku YK-L1 has a huge storage space up to 32 MB. It is better to
use a higher spi clock to read or write serial nor flash chips.
Youku YK-L1 has Winbond w25q256fvfg on board that can support
104 MHz spi clock so 48 MHz is safe enough.
The real frequency can only be sysclk(580MHz ) /3 /(2^n) so 80 MHz
defined in dts file will set only 48 MHz in spi bus.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
(cherry picked from commit bf7ddb18f1bfa0b61b4dc43732c114f20900bd4b)

2 years agoramips: remove obsolete mx25l25635f compatible hack
DENG Qingfang [Tue, 2 Feb 2021 08:10:32 +0000 (16:10 +0800)]
ramips: remove obsolete mx25l25635f compatible hack

The kernel bump to 5.4 has removed the mx25l25635f hack, and the
mx25l25635f compatible is no longer required.

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

2 years agomvebu: kernel: enable CONFIG_BLK_DEV_NVME
Josef Schlehofer [Thu, 18 Nov 2021 15:37:17 +0000 (16:37 +0100)]
mvebu: kernel: enable CONFIG_BLK_DEV_NVME

CONFIG_BLK_DEV_NVME [1]:
- This is a kernel driver for SSD connected to PCI or PCIe bus [1].
By default, it is enabled for targets "ipq807x", "rockchip/armv8"
and "x86/64".

With miniPCIe adapter, there is a possibility to connect NVMe disk
to Turris Omnia (cortex-a9), Turris MOX (cortex-a53).

It allows to boot system from NVMe disk, because of that it can not
be kmod package as you can not access the disk to be able to boot from
it.

CONFIG_NVME_CORE [2]:
- This is selected by CONFIG_BLK_DEV_NVME
It does not need to be explicitly enabled, but it is done for "ipq807",
"x64_64" and rockchip/armv8", which has also enabled the previous config
option as well.

Kernel increase: ~28k KiB on mamba kernel

Reference:
[1] https://cateee.net/lkddb/web-lkddb/BLK_DEV_NVME.html
[2] https://cateee.net/lkddb/web-lkddb/NVME_CORE.html

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
(cherry picked from commit 9d530ac4bf6b9804a06dbf5df4631ee86f1304c1)
[rebased for config-5.4]

2 years agoOpenWrt v21.02.3: revert to branch defaults
Hauke Mehrtens [Sun, 17 Apr 2022 19:00:07 +0000 (21:00 +0200)]
OpenWrt v21.02.3: revert to branch defaults

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agoOpenWrt v21.02.3: adjust config defaults v21.02.3
Hauke Mehrtens [Sun, 17 Apr 2022 19:00:03 +0000 (21:00 +0200)]
OpenWrt v21.02.3: adjust config defaults

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agoath79: Move TPLink WPA8630Pv2 to ath79-tiny target
Joe Mullally [Mon, 30 Aug 2021 21:35:05 +0000 (22:35 +0100)]
ath79: Move TPLink WPA8630Pv2 to ath79-tiny target

These devices only have 6MiB available for firmware, which is not
enough for recent release images, so move these to the tiny target.

Note for users sysupgrading from the previous ath79-generic snapshot
images:

The tiny target kernel has a 4Kb flash erase block size instead
of the generic target's 64kb. This means the JFFS2 overlay partition
containing settings must be reformatted with the new block size or else
there will be data corruption.

To do this, backup your settings before upgrading, then during the
sysupgrade, de-select "Keep Settings". On the CLI, use "sysupgrade -n".

If you forget to do this and your system becomes unstable after
upgrading, you can do this to format the partition and recover:

* Reboot
* Press RESET when Power LED blinks during boot to enter Failsafe mode
* SSH to 192.168.1.1
* Run "firstboot" and reboot

Signed-off-by: Joe Mullally <jwmullally@gmail.com>
Tested-by: Robert Högberg <robert.hogberg@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [commit message facelift]
(cherry picked from commit 44e1e5d)
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2 years agobcm27xx: add AMP2 to HifiBerry DAC+ / DAC+ Pro package
Torsten Duwe [Wed, 22 Sep 2021 08:52:51 +0000 (10:52 +0200)]
bcm27xx: add AMP2 to HifiBerry DAC+ / DAC+ Pro package

According to the vendor [1] these HATs share the same DT overlay:
hifiberry-dacplus. The PCM512x-compatible control unit is attached to
I2C, so the additional snd-soc-pcm512x-i2c kernel module is required.
Also explicitly note the Amp2 support to reduce confusion for those
users.

[1] <https://www.hifiberry.com/docs/software/configuring-linux-3-18-x/>
Signed-off-by: Torsten Duwe <duwe@lst.de>
(added bcm27xx tag, changed commit message)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(cherry picked from commit 7ea9936f7f32fd90af1a29775ac3b297d7775db7)

2 years agoath79: add support for MikroTik RouterBOARD mAP lite
Thibaut VARÈNE [Thu, 10 Mar 2022 11:01:29 +0000 (12:01 +0100)]
ath79: add support for MikroTik RouterBOARD mAP lite

The MikroTik RouterBOARD mAPL-2nd (sold as mAP Lite) is a small
2.4 GHz 802.11b/g/n PoE-capable AP.

See https://mikrotik.com/product/RBmAPL-2nD for more info.

Specifications:
 - SoC: Qualcomm Atheros QCA9533
 - RAM: 64 MB
 - Storage: 16 MB NOR
 - Wireless: Atheros AR9531 (SoC) 802.11b/g/n 2x2:2, 1.5 dBi antenna
 - Ethernet: Atheros AR8229 (SoC), 1x 10/100 port, 802.3af/at PoE in
 - 4 user-controllable LEDs:
   · 1x power (green)
   · 1x user (green)
   · 1x lan (green)
   · 1x wlan (green)

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

Note: following 781d4bfb397cdd12ee0151eb66c577f470e3377d
 The network setup avoids using the integrated switch and connects the
 single Ethernet port directly. This way, link speed (10/100 Mbps) is
 properly reported by eth0.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
(cherry picked from commit eb38af788180d624e5b37aa5db1fe3766b138dc8)

2 years agoath79: add support for Yuncore A930
Thibaut VARÈNE [Fri, 15 Apr 2022 11:17:53 +0000 (13:17 +0200)]
ath79: add support for Yuncore A930

Specification:

- QCA9533 (650 MHz), 64 or 128MB RAM, 16MB SPI NOR
- 2x 10/100 Mbps Ethernet, with 802.3at PoE support (WAN)
- 2T2R 802.11b/g/n 2.4GHz

Flash instructions:

If your device comes with generic QSDK based firmware, you can login
over telnet (login: root, empty password, default IP: 192.168.188.253),
issue first (important!) 'fw_setenv' command and then perform regular
upgrade, using 'sysupgrade -n -F ...' (you can use 'wget' to download
image to the device, SSH server is not available):

  fw_setenv bootcmd "bootm 0x9f050000 || bootm 0x9fe80000"
  sysupgrade -n -F openwrt-...-yuncore_...-squashfs-sysupgrade.bin

In case your device runs firmware with YunCore custom GUI, you can use
U-Boot recovery mode:

1. Set a static IP 192.168.0.141/24 on PC and start TFTP server with
   'tftp' image renamed to 'upgrade.bin'
2. Power the device with reset button pressed and release it after 5-7
   seconds, recovery mode should start downloading image from server
   (unfortunately, there is no visible indication that recovery got
   enabled - in case of problems check TFTP server logs)

Signed-off-by: Clemens Hopfer <openwrt@wireloss.net>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
(cherry-picked from commit a05dcb07241aa83a4416b56201e31b4af8518981)
[switch to mtd-mac-address instead of nvmem-cells]

2 years agoath79: add support for Yuncore XD3200
Thibaut VARÈNE [Fri, 15 Apr 2022 11:17:49 +0000 (13:17 +0200)]
ath79: add support for Yuncore XD3200

Specification:

- QCA9563 (775MHz), 128MB RAM, 16MB SPI NOR
- 2T2R 802.11b/g/n 2.4GHz
- 2T2R 802.11n/ac 5GHz
- 2x 10/100/1000 Mbps Ethernet, with 802.3at PoE support (WAN port)

LED for 5 GHz WLAN is currently not supported as it is connected directly
to the QCA9882 radio chip.

Flash instructions:

If your device comes with generic QSDK based firmware, you can login
over telnet (login: root, empty password, default IP: 192.168.188.253),
issue first (important!) 'fw_setenv' command and then perform regular
upgrade, using 'sysupgrade -n -F ...' (you can use 'wget' to download
image to the device, SSH server is not available):

  fw_setenv bootcmd "bootm 0x9f050000 || bootm 0x9fe80000"
  sysupgrade -n -F openwrt-...-yuncore_...-squashfs-sysupgrade.bin

In case your device runs firmware with YunCore custom GUI, you can use
U-Boot recovery mode:

1. Set a static IP 192.168.0.141/24 on PC and start TFTP server with
   'tftp' image renamed to 'upgrade.bin'
2. Power the device with reset button pressed and release it after 5-7
   seconds, recovery mode should start downloading image from server
   (unfortunately, there is no visible indication that recovery got
   enabled - in case of problems check TFTP server logs)

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
(cherry-picked from commit c91df224f54fdd44c9c0487a8c91876f5d273164)

2 years agowolfssl: bump to 5.2.0
Eneas U de Queiroz [Fri, 8 Apr 2022 13:27:25 +0000 (10:27 -0300)]
wolfssl: bump to 5.2.0

Fixes two high-severity vulnerabilities:

- CVE-2022-25640: A TLS v1.3 server who requires mutual authentication
  can be bypassed.  If a malicious client does not send the
  certificate_verify message a client can connect without presenting a
  certificate even if the server requires one.

- CVE-2022-25638: A TLS v1.3 client attempting to authenticate a TLS
  v1.3 server can have its certificate heck bypassed. If the sig_algo in
  the certificate_verify message is different than the certificate
  message checking may be bypassed.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit e89f3e85eb1c1d81294e5d430a91b0ba625e2ec0)

2 years agomac80211: Update to version 5.10.110-1
Hauke Mehrtens [Sun, 10 Apr 2022 22:26:29 +0000 (00:26 +0200)]
mac80211: Update to version 5.10.110-1

This updates mac80211 to version 5.10.110-1 which is based on kernel
5.10.110.
The removed patches were applied upstream.

This new release contains many fixes which were merged into the upstream
Linux kernel.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agobpftools: fix feature override for masking clang
Tony Ambardar [Mon, 12 Apr 2021 23:46:22 +0000 (16:46 -0700)]
bpftools: fix feature override for masking clang

Rename feature variable clang-bpf-global-var following upstream changes.
This restores the HAVE_CLANG feature override and should avoid rare build
errors where a recent host clang and BTF-enabled host kernel are present.

Fixes: 23be333401f0 ("bpftools: update to 5.10.10")
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
(cherry picked from commit cf20f1bb5f0479c2509dd651d08e235a3b9e8755)

2 years agoramips: fix reboot for remaining 32 MB boards
Michael Pratt [Sat, 11 Sep 2021 02:06:10 +0000 (22:06 -0400)]
ramips: fix reboot for remaining 32 MB boards

The following devices have a Winbond W25Q256FV flash chip,
which does not have the RESET pin enabled by default,
and otherwise would require setting a bit in a status register.

Before moving to Linux 5.4, we had the patch:
0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch
which kept specific flash chips with explicit 3-byte and 4-byte address modes
to stay in 3-byte address mode while idle (after an erase or write)
by using a custom flag SPI_NOR_4B_READ_OP that was part of the patch.

this was obsoleted by the patch:
481-mtd-spi-nor-rework-broken-flash-reset-support.patch
which uses the newer upstream flag SNOR_F_BROKEN_RESET
for devices with a flash chip that cannot be hardware reset with RESET pin
and therefore must be left in 3-byte address mode when idle.

The new patch requires that the DTS of affected devices
have the property "broken-flash-reset", which was not yet added for most of them.

This commit adds the property for remaining affected devices in ramips target,
specifically because of the flash chip model.

However, it is possible that there are other devices
where the flash chip uses an explicit 4-byte address mode
and the RESET pin is not connected to the SOC on the board,
and those DTS would also need this property.

Ref: 22d982ea0033 ("ramips: add support for switching between 3-byte and 4-byte addressing")
Ref: dfa521f12953 ("generic: spi-nor: rework broken-flash-reset")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
[pepe2k@gmail.com: backported to 21.02]
Fixes: #9655, #9636, #9547
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
(backported from commit 74516f4357d281f093f0daac01c4c5c239acc443)

2 years agokernel: bump 5.4 to 5.4.188
Hauke Mehrtens [Tue, 5 Apr 2022 22:46:27 +0000 (00:46 +0200)]
kernel: bump 5.4 to 5.4.188

Added the new configuration options:
CONFIG_HARDEN_BRANCH_HISTORY=y
CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY=y

Manually adapted:
target/linux/generic/hack-5.4/220-gc_sections.patch

Compile-tested: lantiq/xrx200, armvirt/64
Run-tested: lantiq/xrx200, armvirt/64

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agoimagebuilder: fix broken image generation with external targets
Petr Štetiar [Thu, 24 Mar 2022 05:52:37 +0000 (06:52 +0100)]
imagebuilder: fix broken image generation with external targets

When using external targets there is a symlink being created for the
target under target/linux which then becomes dangling under Image
Builder. Fix it by dereferencing the possible symlink.

Tested on IB with external target, ipq40xx and mvebu.

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

2 years agoath79: migrate Archer C5 5GHz radio device paths
Jan-Niklas Burfeind [Mon, 28 Mar 2022 16:07:59 +0000 (18:07 +0200)]
ath79: migrate Archer C5 5GHz radio device paths

When upgrading a TP-Link Archer C5 v1 from ar71xx to ath79,
the 5ghz radio stops working because the device path changed.

Same has been done for the Archer C7 before:

commit e19506f20618 ("ath79: migrate Archer C7 5GHz radio device paths")

Signed-off-by: Jan-Niklas Burfeind <git@aiyionpri.me>
(cherry picked from commit c6eb63d48f942f1e54737ed182776cf9a08de542)

2 years agoath79: fix label MAC address for Ubiquiti UniFi AP Outdoor+
Matthias Schiffer [Tue, 29 Mar 2022 22:20:39 +0000 (00:20 +0200)]
ath79: fix label MAC address for Ubiquiti UniFi AP Outdoor+

The label has the MAC address of eth0, not the WLAN PHY address. We can
merge the definition back into ar7241_ubnt_unifi.dtsi, as both DTS
derived from it use the same interface for their label MAC addresses
after all.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(cherry picked from commit aee9ccf5c1b536189ebee8c232273657334da843)

2 years agoapm821xx: fix crash/panic related to SATA/SSD choice
Christian Lamparter [Thu, 24 Mar 2022 20:05:11 +0000 (21:05 +0100)]
apm821xx: fix crash/panic related to SATA/SSD choice

Ticerex on the OpenWrt Forum reported a gnarly crash when
he was using Samsung 840 and 850 EVOs with his MyBook Live:

| BUG: Kernel NULL pointer dereference at 0x00000000
| Faulting instruction address: 0xc03ed4b8
| Oops: Kernel access of bad area, sig: 11 [#1]
| BE PAGE_SIZE=4K PowerPC 44x Platform
| CPU: 0 PID: 362 Comm: scsi_eh_1 Not tainted 5.4.163 #0
| NIP:  c03ed4b8 LR: c03d27e8 CTR: c03ed36c
| REGS: cfa59950 TRAP: 0300   Not tainted  (5.4.163)
| MSR:  00021000 <CE,ME>  CR: 42000222  XER: 00000000
| DEAR: 00000000 ESR: 00000000
| GPR00: c03d27e8 cfa59a08 cfa55fe0 00000000 0fa46bc0 [...]
| [..]
| NIP [c03ed4b8] sata_dwc_qc_issue+0x14c/0x254
| LR [c03d27e8] ata_qc_issue+0x1c8/0x2dc
| Call Trace:
| [cfa59a08] [c003f4e0] __cancel_work_timer+0x124/0x194 (unreliable)
| [cfa59a78] [c03d27e8] ata_qc_issue+0x1c8/0x2dc
| [cfa59a98] [c03d2b3c] ata_exec_internal_sg+0x240/0x524
| [cfa59b08] [c03d2e98] ata_exec_internal+0x78/0xe0
| [cfa59b58] [c03d30fc] ata_read_log_page.part.38+0x1dc/0x204
| [cfa59bc8] [c03d324c] ata_identify_page_supported+0x68/0x130
| [...]

This turned out this is an issue with upstream changing
ATA_TAG_INTERNAL's value from 31 to 32 during 4.18 release.
Update "SATA_DWC_QCMD_MAX" to account for that.

Link: https://forum.openwrt.org/t/my-book-live-duo-reboot-loop/122464
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(cherry picked from commit 5ac672cfab60e90ab8a0bf3491fa2a27619d22d6)

2 years agomvebu: SFP backports for GPON modules
Marek Behún [Sat, 8 Jan 2022 18:56:02 +0000 (19:56 +0100)]
mvebu: SFP backports for GPON modules

This backports the following upstream Linux patches
  net: sfp: add mode quirk for GPON module Ubiquiti U-Fiber Instant
  net: sfp: relax bitrate-derived mode check
  net: sfp: cope with SFPs that set both LOS normal and LOS inverted
for 5.4 for mvebu platform.

This fixes GPON modules:
  Ubiquiti U-Fiber Instant SFP GPON
  VSOL V2801F
  CarlitoxxPro CPGOS03-0490 v2.0

Signed-off-by: Marek Behún <marek.behun@nic.cz>
2 years agocypress-firmware: drop several packages
Josef Schlehofer [Sun, 20 Mar 2022 22:28:41 +0000 (23:28 +0100)]
cypress-firmware: drop several packages

1. Drop package: cypress-firmware-4359-pcie
This binary is no longer provided and there are not many details what
happened.

2. Drop package: cypress-firmware-4359-sdio
This binary is no longer provided, but in this case, to compare it with
PCIe package mention as first, there was added
support in Linux-firmware [1], but no sign of firmware file.

4. Drop package: cypress-firmware-89459-pcie [2]
According to Infineon: "CYW89459 is an automotive Wi-Fi chip which is not
supported in the broad market community."

[1] https://patchwork.kernel.org/project/linux-wireless/patch/20191211235253.2539-6-smoch@web.de/

[2] https://community.infineon.com/t5/Wi-Fi-Bluetooth-for-Linux/the-wifi-driver-for-CYW89459-in-linux4-14-98-2-3-00/m-p/138971

Fixes: 7ca7e0b22de6e629f5df12b8a935a168073bcca3 ("cypress-firmware:
update it to version 5.4.18-2021_0812")

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
(cherry picked from commit 8c66bf89d1e8e67d8a3537e164bb7d9669259c08)

2 years agocypress-firmware: update it to version 5.4.18-2021_0812
Josef Schlehofer [Wed, 16 Mar 2022 12:14:57 +0000 (13:14 +0100)]
cypress-firmware: update it to version 5.4.18-2021_0812

- Binary files were renamed to cyfmac from brcmfmac, but the files needs
  to be on the router with the previous naming

[    6.656165] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[    6.665182] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43455-sdio.bin failed with error -2
[    6.674928] brcmfmac mmc1:0001:1: Falling back to sysfs fallback for: brcm/brcmfmac43455-sdio.bin

- Cypress were acquired by Infineon Technologies
Thus change the project URL and switch to download files from their
GitHub repository. This is much better than the previous solution, which
requires finding new threads on their community forum about new driver
updates, and it will be necessary to change the URL each time.

Unfortunately, it seems that there is not published changelog, but
according to this forum thread [1], be careful by opening the link from
solution since it contains ending bracket ), it brings fixes for various
security vulnerabilities, which were fixed in 7_45_234.

Fixes:
- FragAttacks
- Kr00k

Also add LICENSE file

Run tested on Seeedstudio router powered by Raspberry Pi 4 CM with
package cypress-firmware-43455-sdio.

Before:
root@OpenWrt:~# dmesg | grep 'Firmware: BCM4345/6'
[    6.895050] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Mar 23 2020 02:20:01 version 7.45.206 (r725000 CY) FWID 01-febaba43

After:
root@OpenWrt:~# dmesg | grep 'Firmware: BCM4345/6'
[    6.829805] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Apr 15 2021 03:03:20 version 7.45.234 (4ca95bb CY) FWID 01-996384e2

[1] https://community.infineon.com/t5/Wi-Fi-Bluetooth-for-Linux/Outdated-brcmfmac-firmware-for-Raspberry-Pi-4-in-OpenWrt-21-02-1/m-p/331593#M2269

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
(cherry picked from commit 7ca7e0b22de6e629f5df12b8a935a168073bcca3)

2 years agoath79: fix link for long cables with OCEDO Raccoon
David Bauer [Fri, 25 Mar 2022 21:58:34 +0000 (22:58 +0100)]
ath79: fix link for long cables with OCEDO Raccoon

The OCEDO Raccoon had significant packet-loss with cables longer than 50
meter. Disabling EEE restores normal operation.

Also change the ethernet config to reduce loss on sub-1G links.

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

2 years agoath79: fix TPLINK_HWREV field for TL-WR1043ND v4
Matthias Schiffer [Fri, 25 Mar 2022 16:32:24 +0000 (17:32 +0100)]
ath79: fix TPLINK_HWREV field for TL-WR1043ND v4

Required to allow sysupgrades from OpenWrt 19.07.

Closes #7071

Fixes: 98fbf2edc021 ("ath79: move TPLINK_HWID/_HWREV to parent for tplink-safeloader")
Tested-by: J. Burfeind <git@aiyionpri.me>
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(cherry picked from commit 8ba71f1f6f2359f9cf54201e9fc037df33f123c0)

2 years agozlib: backport security fix for a reproducible crash in compressor
Petr Štetiar [Thu, 24 Mar 2022 05:45:04 +0000 (06:45 +0100)]
zlib: backport security fix for a reproducible crash in compressor

Tavis has just reported, that he was recently trying to track down a
reproducible crash in a compressor. Believe it or not, it really was a
bug in zlib-1.2.11 when compressing (not decompressing!) certain inputs.

Tavis has reported it upstream, but it turns out the issue has been
public since 2018, but the patch never made it into a release. As far as
he knows, nobody ever assigned it a CVE.

Suggested-by: Tavis Ormandy <taviso@gmail.com>
References: https://www.openwall.com/lists/oss-security/2022/03/24/1
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit b3aa2909a79aeff20d594160b207a89dc807c033)
(cherry picked from commit 3965dda0fa70dc9408f1a2e55a3ddefde78bd50e)

2 years agosunxi: cortexa7: fix ethernet link detection on a20-olinuxino-lime2
Petr Štetiar [Tue, 8 Mar 2022 09:41:24 +0000 (10:41 +0100)]
sunxi: cortexa7: fix ethernet link detection on a20-olinuxino-lime2

a20-olinuxino-lime2 is currently having hard time with link detection of
certain 1000Mbit partners due to usage of generic PHY driver, probably
due to following missing workaround introduced in upstream in commit
3aed3e2a143c ("net: phy: micrel: add Asym Pause workaround"):

 The Micrel KSZ9031 PHY may fail to establish a link when the Asymmetric
 Pause capability is set. This issue is described in a Silicon Errata
 (DS80000691D or DS80000692D), which advises to always disable the
 capability. This patch implements the workaround by defining a KSZ9031
 specific get_feature callback to force the Asymmetric Pause capability
 bit to be cleared.

 This fixes issues where the link would not come up at boot time, or when
 the Asym Pause bit was set later on.

As a20-olinuxino-lime2 has Micrel KSZ9031RNXCC-TR Gigabit PHY since
revision H, so we need to use Micrel PHY driver on those devices.

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

2 years agomvebu: udpu: include LM75 kmod by default
Robert Marko [Mon, 21 Mar 2022 10:47:28 +0000 (11:47 +0100)]
mvebu: udpu: include LM75 kmod by default

uDPU has 2 LM75 compatible temperature sensors, so include the driver for
them by default in order to utilize them.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [rebase]
(cherry picked from commit a8b2d3590329386d0ae6873460b2d5126f63ddaa)
(cherry picked from commit b9e90935db8e0c0166c80fc6e5e50755282e9e0b)

2 years agomvebu: udpu: fix initramfs booting
Robert Marko [Mon, 21 Mar 2022 10:47:27 +0000 (11:47 +0100)]
mvebu: udpu: fix initramfs booting

uDPU provides a FIT based initramfs, but currently gets stuck after U-boot
starts the kernel at "Starting kernel..".

It is due to the load address being too low, so increase it in order to get
the initramfs booting again.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
(cherry picked from commit 80f21e53360d52d493c51a4a263d9b7607b7494e)
(cherry picked from commit d65269a732d82ca9d084c89d6ca05d125d4ab629)

2 years agoath79: fix label MAC address for Ubiquiti UniFi
Matthias Schiffer [Wed, 23 Mar 2022 21:06:50 +0000 (22:06 +0100)]
ath79: fix label MAC address for Ubiquiti UniFi

The label has the MAC address of eth0, not the WLAN PHY address.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(cherry picked from commit 2a02b7049966dc77ae9519ca165f29b75e0dbf0e)

2 years agoramips: remove kmod-mt7663-firmware-sta from device packages
Felix Fietkau [Sun, 17 Oct 2021 14:05:34 +0000 (16:05 +0200)]
ramips: remove kmod-mt7663-firmware-sta from device packages

This firmware should only be used for mobile devices (e.g. laptops), where
AP mode functionality is typically not used. This firmware supports a lot
of power saving offload functionality at the expense of AP mode support.

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

2 years agokernel: backport DSA patches fixing null-pointer dereference
Marek Behún [Mon, 14 Mar 2022 14:39:03 +0000 (15:39 +0100)]
kernel: backport DSA patches fixing null-pointer dereference

[ backport of master commit fbe2c3feaa4ef5747a691cb4c808925b024ff450 ]

Backport patches
  381a730182f1 ("net: dsa: Move VLAN filtering syncing out of dsa_switch_bridge_leave")
  108dc8741c20 ("net: dsa: Avoid cross-chip syncing of VLAN filtering")
from upstream (currently in net-next) to fix null-pointer dereference.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [master commit detail]
2 years agohostapd: add STA extended capabilities to get_clients
David Bauer [Wed, 16 Feb 2022 22:09:51 +0000 (23:09 +0100)]
hostapd: add STA extended capabilities to get_clients

Add the STAs extended capabilities to the ubus STA information. This
way, external daemons can be made aware of a STAs capabilities.

This field is of an array type and contains 0 or more bytes of a STAs
advertised extended capabilities.

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

2 years agohostapd: add op-class to get_status output
David Bauer [Sat, 8 Jan 2022 11:25:42 +0000 (12:25 +0100)]
hostapd: add op-class to get_status output

Include the current operation class to hostapd get_status interface.

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

2 years agohostapd: add beacon_interval to get_status ubus output
David Bauer [Mon, 25 Oct 2021 19:33:40 +0000 (21:33 +0200)]
hostapd: add beacon_interval to get_status ubus output

Add the beacon interval to hostapd status output. This allows external
services to discover the beacon interval for a specific VAP.

This way, external wireless management daemons can correctly calculate
fields containing TBTT value from absolute time-values.

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

2 years agohostapd: remove unused mac_buff allocation
Martin Weinelt [Fri, 25 Jun 2021 22:01:08 +0000 (00:01 +0200)]
hostapd: remove unused mac_buff allocation

Signed-off-by: Martin Weinelt <hexa@darmstadt.ccc.de>
(cherry picked from commit cde154c8712255d13658317b116d4fc341ed89f2)

2 years agohostapd: report bssid, ssid and channel over ubus
Martin Weinelt [Fri, 25 Jun 2021 22:01:07 +0000 (00:01 +0200)]
hostapd: report bssid, ssid and channel over ubus

Imports a function from iw to convert frequencies to channel numbers.

Co-authored-by: David Bauer <mail@david-bauer.net>
Signed-off-by: Martin Weinelt <hexa@darmstadt.ccc.de>
[fix potential out of bounds read]
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 398df6275674b637bc950e4f946f84c2bc5e09ff)

2 years agohostapd: ubus: add notification for BSS transition response
David Bauer [Wed, 21 Oct 2020 18:50:01 +0000 (20:50 +0200)]
hostapd: ubus: add notification for BSS transition response

To allow steering daemons to be aware of the STA-decided transition
target, publish WNM transition responses to ubus. This way, steerings
daemons can learn about STA-chosen targets and send a better selection
of transition candidates.

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

2 years agohostapd: ubus: add BSS transtiton request method
David Bauer [Sat, 5 Dec 2020 19:17:35 +0000 (20:17 +0100)]
hostapd: ubus: add BSS transtiton request method

The existing wnm_disassoc_imminent ubus method only supports issuing a
bss transition request with the disassoc imminent flag set.
For use-cases, where the client is requested to roam to another BSS
without a pending disassoc, this existing method is not suitable.

Add a new bss_transition_request ubus method, which provides a more
universal way to dispatch a transition request. It takes the following
arguments:

Required:
addr: String - MAC-address of the STA to send the request to (colon-seperated)

Optional:
abridged - Bool - Indicates if the abridged flag is set
disassociation_imminent: Bool - Whether or not the disassoc_imminent
                         flag is set
disassociation_timer: I32 - number of TBTTs after which the client will
                      be disassociated
validity_period: I32 - number of TBTTs after which the beacon
                 candidate list (if included) will be invalid
neighbors: blob-array - Array of strings containing neighbor reports as
           hex-string

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

2 years agoopenssl: bump to 1.1.1n
Martin Schiller [Wed, 16 Mar 2022 14:04:56 +0000 (15:04 +0100)]
openssl: bump to 1.1.1n

This is a bugfix release. Changelog:

  *) Fixed a bug in the BN_mod_sqrt() function that can cause it to loop
     forever for non-prime moduli. (CVE-2022-0778)

  *) Add ciphersuites based on DHE_PSK (RFC 4279) and ECDHE_PSK
     (RFC 5489) to the list of ciphersuites providing Perfect Forward
     Secrecy as required by SECLEVEL >= 3.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
(cherry picked from commit e17c6ee62770005e398364ee5d955c9a8ab6f016)

2 years agouboot-bcm4908: use "xxd" from staging_dir
Rafał Miłecki [Tue, 15 Mar 2022 11:40:40 +0000 (12:40 +0100)]
uboot-bcm4908: use "xxd" from staging_dir

This fixes:
bash: xxd: command not found
on hosts without xxd installed.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 9dbca6bf6e6e088afd18fb532ed9135c21aec1cc)
Fixes: 45b3f2aa0f57 ("uboot-bcm4908: add package with BCM4908 U-Boot")
2 years agotools: xxd: use more convenient source tarball
Daniel Golle [Mon, 1 Mar 2021 14:06:33 +0000 (14:06 +0000)]
tools: xxd: use more convenient source tarball

Don't download all of vim just to build xxd. Use a tight tarball
containing only xxd sources instead.

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

2 years agotools: add xxd (from vim)
Daniel Golle [Sun, 28 Feb 2021 19:26:07 +0000 (19:26 +0000)]
tools: add xxd (from vim)

U-Boot requires xxd to create the default environment from an external
file as done in uboot-mediatek.
Build xxd (only, not the rest of vim) as part of tools to make sure it
is present on the buildhost.

Reported-by: David Bauer <mail@david-bauer.net>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit c4dd2441e7875c9550820f8380b3e41ca619ef27)

2 years agobase-files: call "sync" after initial setup
Rafał Miłecki [Tue, 1 Mar 2022 17:46:27 +0000 (18:46 +0100)]
base-files: call "sync" after initial setup

OpenWrt uses a lot of (b)ash scripts for initial setup. This isn't the
best solution as they almost never consider syncing files / data. Still
this is what we have and we need to try living with it.

Without proper syncing OpenWrt can easily get into an inconsistent state
on power cut. It's because:
1. Actual (flash) inode and data writes are not synchronized
2. Data writeback can take up to 30 seconds (dirty_expire_centisecs)
3. ubifs adds extra 5 seconds (dirty_writeback_centisecs) "delay"

Some possible cases (examples) for new files:
1. Power cut during 5 seconds after write() can result in all data loss
2. Power cut happening between 5 and 35 seconds after write() can result
   in empty file (inode flushed after 5 seconds, data flush queued)

Above affects e.g. uci-defaults. After executing some migration script
it may get deleted (whited out) without generated data getting actually
written. Power cut will result in missing data and deleted file.

There are three ways of dealing with that:
1. Rewriting all user-space init to proper C with syncs
2. Trying bash hacks (like creating tmp files & moving them)
3. Adding sync and hoping for no power cut during critical section

This change introduces the last solution that is the simplest. It
reduces time during which things may go wrong from ~35 seconds to
probably less than a second. Of course it applies only to IO operations
performed before /etc/init.d/boot . It's probably the stage when the
most new files get created.

All later changes are usually done using smarter C apps (e.g. busybox or
uci) that creates tmp files and uses rename() that is expected to be
atomic.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
(cherry picked from commit 9851d4b6ce6e89d164a04803817625a9041b060a)

2 years agobcm4908: include U-Boot in images
Rafał Miłecki [Fri, 4 Mar 2022 08:39:05 +0000 (09:39 +0100)]
bcm4908: include U-Boot in images

This is a step forward in adding support for devices with U-Boot.

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

2 years agouboot-bcm4908: add package with BCM4908 U-Boot
Rafał Miłecki [Fri, 4 Mar 2022 08:39:04 +0000 (09:39 +0100)]
uboot-bcm4908: add package with BCM4908 U-Boot

New BCM4908 devices come with U-Boot instead of CFE. Firmwares for such
devices has to include U-Boot.

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

2 years agox86: legacy: enable pata_sis driver
Matthias Schiffer [Thu, 10 Mar 2022 22:24:10 +0000 (23:24 +0100)]
x86: legacy: enable pata_sis driver

This driver is needed to boot from CompactFlash on the Siemens Futro S400.
The device has an AMD NX1500 CPU, which seems to be unsupported by the
geode subtarget, so it must use legacy.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
(cherry picked from commit c8350dfb3cdee7653744bbb4ee3b0ac1b015912c)

2 years agobcm4908: support "rootfs_data" on U-Boot devices
Rafał Miłecki [Fri, 4 Mar 2022 15:03:26 +0000 (16:03 +0100)]
bcm4908: support "rootfs_data" on U-Boot devices

1. Create "rootfs_data" dynamicaly

U-Boot firmware images can contain only 2 UBI volumes: bootfs (container
with U-Boot + kernel + DTBs) and rootfs (e.g. squashfs). There is no way
to include "rootfs_data" UBI volume or make firmware file tell U-Boot to
create one.

For that reason "rootfs_data" needs to be created dynamically. Use
preinit script to handle that. Fire it right before "mount_root" one.

2. Relate "rootfs_data" to flashed firmware

As already explained flashing new firmware with U-Boot will do nothing
to the "rootfs_data". It could result in new firmware reusing old
"rootfs_data" overlay UBI volume and its file. Users expect a clean
state after flashing firmware (even if flashing the same one).

Solve that by reading flash counter of running firmware and storing it
in "rootfs_data" UBI volume. Every mismatch will result in wiping old
data.

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

2 years agobcm4908: fix USB PHY support
Rafał Miłecki [Fri, 25 Feb 2022 09:47:08 +0000 (10:47 +0100)]
bcm4908: fix USB PHY support

This fixes problem with USB PHY not handling some USB 3.0 devices.

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

2 years agou-boot.mk: add LOCALVERSION (explicitly specify OpenWrt build)
Josef Schlehofer [Mon, 21 Feb 2022 17:55:15 +0000 (18:55 +0100)]
u-boot.mk: add LOCALVERSION (explicitly specify OpenWrt build)

For debugging purposes, we need to know if users are using modified
U-boot versions or not. Currently, the U-boot version is somehow
stripped. This is a little bit problematic when there are
backported/wip/to-upstream patches.

To make it more confusing, there was (before this commit) two U-boot
versioning. U-boot compiled by OpenWrt build bots are missing ``Build:``
This is also the case when the U-boot is compiled locally.

Example:
```
U-Boot SPL 2022.01 (Jan 27 2022 - 00:24:34 +0000)
U-Boot 2022.01 (Jan 27 2022 - 00:24:34 +0000)
```

On the other hand, if you run full build, you can at least see, where it
was compiled. Notice added ``Build:``.

Example:
```
U-Boot 2022.01 (Jan 27 2022 - 00:24:34 +0000), Build: jenkins-turris-os-packages-burstlab-omnia-216
```

In both cases, it is not clear to U-boot developers if it is an unmodified
build. This is also caused that there is a missing ``.git`` file from
U-boot folder, and so there is no history. It leads to that it can not
contain suffix ``-dirty`` (uncommitted modifications) or even something
else like number of commits, etc. [1]

When U-boot is compiled as it should be, the version should look like
this: ``U-Boot 2022.04-rc1-01173-g278195ea1f (Feb 11 2022 - 14:46:50 +0100)``
The date is not changed daily when there are new OpenWrt builds.

This commit adds OpenWrt specific version, which could be verified by
using strings.

```
$ strings bin/targets/mvebu/cortexa9/u-boot-omnia/u-boot-spl.kwb | grep -E "OpenWrt*"
U-Boot SPL 2022.01-OpenWrt-r18942+54-cbfce92367 (Feb 21 2022 - 13:17:34 +0000)
arm-openwrt-linux-muslgnueabi-gcc (OpenWrt GCC 11.2.0 r18942+54-cbfce92367) 11.2.0
2022.01-OpenWrt-r18942+54-cbfce92367
U-Boot 2022.01-OpenWrt-r18942+54-cbfce92367 (Feb 21 2022 - 13:17:34 +0000)
```

[1] https://u-boot.readthedocs.io/en/latest/develop/version.html

Reported-by: Pali Rohár <pali@kernel.org>
Suggested-by: Karel Kočí <karel.koci@nic.cz>
[rebased for OpenWrt 21.02]
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
(cherry picked from commit d6aa9d9e071d9f23ed26f5142991bc66aefe20f5)

2 years agotools/libressl: update to version 3.4.2
Josef Schlehofer [Wed, 23 Feb 2022 20:32:41 +0000 (21:32 +0100)]
tools/libressl: update to version 3.4.2

Release notes:
https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.4.2-relnotes.txt

```
It includes the following security fix

  * In some situations the X.509 verifier would discard an error on an
    unverified certificate chain, resulting in an authentication bypass.
    Thanks to Ilya Shipitsin and Timo Steinlein for reporting.
```

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
(cherry picked from commit 495c4f4e197166a6fa997d4620ca6c241e3abd45)

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>
(cherry picked from commit 03bb3412a2b8bf8ac69e062ea9fd88e2c6c6fb57)

2 years agotools/libressl: update to 3.3.4
Rosen Penev [Thu, 2 Sep 2021 02:29:40 +0000 (19:29 -0700)]
tools/libressl: update to 3.3.4

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

2 years agotools/libressl: update to 3.3.3
Rosen Penev [Sat, 19 Jun 2021 21:45:11 +0000 (14:45 -0700)]
tools/libressl: update to 3.3.3

Fix wrong FPIC variable usage. Fixes compilation under sparc64 host.

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

2 years agokernel: bump 5.4 to 5.4.182
Hauke Mehrtens [Sun, 6 Mar 2022 19:12:47 +0000 (19:12 +0000)]
kernel: bump 5.4 to 5.4.182

The following patch was integrated upstream:
  target/linux/bcm4908/patches-5.4/180-i2c-brcmstb-fix-support-for-DSL-and-CM-variants.patch

All other updated automatically.

The new config option CONFIG_BPF_UNPRIV_DEFAULT_OFF is now handled too.

Compile-tested on: lantiq/xrx200, armvirt/64
Runtime-tested on: lantiq/xrx200, armvirt/64

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agouboot-envtools: mvebu: update uci defaults for Turris Omnia
Marek Behún [Thu, 15 Jul 2021 18:48:33 +0000 (20:48 +0200)]
uboot-envtools: mvebu: update uci defaults for Turris Omnia

From version 2021.09 U-Boot will fixup Turris Omnia's DTB before
booting, separating U-Boot's environment into separate MTD partition
"u-boot-env" [1].

Check if "u-boot-env" MTD partition exists and set the uci defaults
accordingly.

[1] https://lists.denx.de/pipermail/u-boot/2021-July/455017.html

Signed-off-by: Marek Behún <marek.behun@nic.cz>
(cherry picked from commit 713be7543909b79fbbccdea297e306cb3d3adb0c)

2 years agoipq806x: base-files: asrock: fix bootcount include
Petr Štetiar [Mon, 28 Feb 2022 13:59:16 +0000 (14:59 +0100)]
ipq806x: base-files: asrock: fix bootcount include

Fixes following warning message during image building process:

 Finalizing root filesystem...
 root-ipq806x/lib/upgrade/asrock.sh: line 1: /lib/functions.sh: No such file or directory
 Enabling boot
 root-ipq806x/lib/upgrade/asrock.sh: line 1: /lib/functions.sh: No such file or directory
 Enabling bootcount

Fixes #9350

Fixes: 98b86296e67d ("ipq806x: add support for ASRock G10")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit fc317a190c930c9c338bd07c2e323b6b9eaa1f07)

2 years agoRevert "ramips: increase spi-max-frequency for ipTIME mt7620 devices"
Sungbo Eo [Sat, 19 Feb 2022 15:19:31 +0000 (00:19 +0900)]
Revert "ramips: increase spi-max-frequency for ipTIME mt7620 devices"

This reverts commit 13a185bf8acb67da4a68873e560876c0e60b1a87.

There was a report that one A1004ns device fails to detect its flash
chip correctly:

[    1.470297] spi-nor spi0.0: unrecognized JEDEC id bytes: e0 10 0c 40 10 08
[    1.484110] spi-nor: probe of spi0.0 failed with error -2

It also uses a different flash chip model:
* in my hand: Winbond W25Q128FVSIG (SOIC-8)
* reported: Macronix MX25L12845EMI-10G (SOP-16)

Reducing spi-max-frequency solved the detection failure. Hence revert.

Reported-by: Koasing <koasing@gmail.com>
Tested-by: Koasing <koasing@gmail.com>
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
(cherry picked from commit 9968a909c248169064446ed40e66d18986d93d11)