Commit Graph

24700 Commits

Author SHA1 Message Date
Rafał Miłecki 8d24ea3f31 kernel: rename 5.20 patches to 6.0
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 372ee1919d)
2022-09-02 14:31:59 +02:00
Rafał Miłecki 36bab9266f bcm4908: enable & setup packet steering
Without packet steering NAT masquarade speed on BCM4908 /jumps/ between
two speeds:
1. 826 Mb/s (±3 Mb/s)
2. 909 Mb/s (±8 Mb/s)
and it never reaches ~940 Mb/s.

Proper packet steering can improve it. Below are testing results for
running iperf TCP traffic from LAN to WAN. They were used to pick up
golden values.

┌──────────┬──────────┬───────────┐
│   eth0   │  br-lan  │   speed   │
│ rps_cpus │ rps_cpus │   [Mbps]  │
├──────────┼──────────┼───────────┤
│        0 │        0 │ 743 / 804 │
│        0 │        1 │ 738 / 821 │
│        0 │        2 │     ✓ 940 │
│        0 │        4 │     ✓ 938 │
│        0 │        8 │     ✓ 941 │
├──────────┼──────────┼───────────┤
│        1 │        0 │       829 │
│        1 │        1 │       829 │
│        1 │        2 │     ✓ 942 │
│        1 │        4 │     ✓ 941 │
│        1 │        8 │     ✓ 941 │
├──────────┼──────────┼───────────┤
│        2 │        0 │     ✓ 942 │
│        2 │        1 │       926 │
│        2 │        2 │     ✓ 942 │
│        2 │        4 │     ✓ 942 │
│        2 │        8 │     ✓ 941 │
├──────────┼──────────┼───────────┤
│        4 │        0 │     ✓ 941 │
│        4 │        1 │       925 │
│        4 │        2 │     ✓ 941 │
│        4 │        4 │     ✓ 941 │
│        4 │        8 │     ✓ 941 │
├──────────┼──────────┼───────────┤
│        8 │        0 │     ✓ 942 │
│        8 │        1 │       925 │
│        8 │        2 │     ✓ 941 │
│        8 │        4 │     ✓ 942 │
│        8 │        8 │     ✓ 942 │
└──────────┴──────────┴───────────┘

Ref: fcbd39689e ("bcm53xx: enable & setup packet steering")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 57cad53f4e)
2022-09-02 12:24:19 +02:00
Rafał Miłecki cc9c72529c bcm4908: build bootfs image per-SoC
In theory we could have just 1 bootfs image for all devices as each
device has its own entry in the "configurations" node. It doesn't work
well with default configuration though.

If something goes wrong U-Boot SPL can be interrupted (by pressing A) to
enter its minimalistic menu. It allows ignoring boardid. In such case
bootfs default configuration is used.

For above reason each SoC family (BCM4908, BCM4912) should have its own
bootfs built. It allows each of them to have working default
configuration.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 6ae2f7ff47)
2022-09-02 12:24:16 +02:00
Rafał Miłecki 28ab4f3955 bcm4908: prepare for Asus GT-AX6000 support
It isn't tested & Linux DT will surely need more work.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 3f2b2fe084)
2022-09-02 12:23:07 +02:00
Rafał Miłecki 1727e356f0 bcm4908: backport bcmbca DT patches queued for 5.20
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit d63ef7c90f)
2022-09-02 12:23:05 +02:00
Rafał Miłecki 114fc3620d bcm4908: include U-Boot DTB files for ASUS GT-AX6000 & Netgear RAX220
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 2de86691b6)
2022-09-01 17:39:52 +02:00
Thibaut VARÈNE 8b552b1d28 ath79: add support for RouterBOARD mAP
The MikroTik mAP-2nd (sold as mAP) is an indoor 2.4Ghz AP with
802.3af/at PoE input and passive PoE passthrough.

See https://mikrotik.com/product/RBmAP2nD for more details.

Specifications:
 - SoC: QCA9533
 - RAM: 64MB
 - Storage: 16MB NOR
 - Wireless: QCA9533 802.11b/g/n 2x2
 - Ethernet: 2x 10/100 ports,
    802.3af/at PoE in port 1, 500 mA passive PoE out on port 2
 - 7 user-controllable LEDs

Note: the device is a tiny AP and does not distinguish between both
ethernet ports roles, so they are both assigned to lan.
With the current setup, ETH1 is connected to eth1 and ETH2 is connected
to eth0 via the embedded switch port 2.

Flashing:
 TFTP boot initramfs image and then perform sysupgrade. The "ETH1" port
 must be used to upload the TFTP image. Follow common MikroTik procedure
 as in https://openwrt.org/toh/mikrotik/common.

Tested-By: Andrew Powers-Holmes <aholmes@omnom.net>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
(cherry picked from commit e1223dbee3)
2022-08-28 08:32:02 +02:00
Thibaut VARÈNE 1dd4b3f06a ath79: add support for MikroTik RouterBOARD hAP ac lite
The MikroTik RB952Ui-5ac2nD (sold as hAP ac lite) is an indoor 2.4Ghz
and 5GHz AP/router with a 2 dBi integrated antenna.

See https://mikrotik.com/product/RB952Ui-5ac2nD for more details.

Specifications:
 - SoC: QCA9533
 - RAM: 64MB
 - Storage: 16MB NOR
 - Wireless: QCA9533 802.11b/g/n 2x2 / QCA9887 802.11a/n/ac 2x2
 - Ethernet: AR934X switch, 5x 10/100 ports,
    10-28 V passive PoE in port 1, 500 mA PoE out on port 5
 - 6 user-controllable LEDs:
   - 1x user (green)
   - 5x port status (green)

Flashing:
 TFTP boot initramfs image and then perform sysupgrade. The "Internet"
 port (port number 1) must be used to upload the TFTP image, then
 connect to any other port to access the OpenWRT system.
 Follow common MikroTik procedure as in
 https://openwrt.org/toh/mikrotik/common.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
(cherry picked from commit 2bd33e8626)
2022-08-28 08:32:02 +02:00
Julien Cassette cd7e6c8a81 ipq40xx: add Linksys MR8300 WAN port
This makes the WAN interface and port appear in
LuCi -> Network -> Switch on Linksys MR8300.
This allows to configure a VLAN on WAN.

Fixes: FS#4227

Signed-off-by: Julien Cassette <julien.cassette@gmail.com>
(cherry picked from commit 2c1f8a665e)
2022-08-28 08:17:55 +02:00
Clemens Hopfer 32101669db ramips: add support for YunCore AX820/HWAP-AX820
There are two versions which are identical apart from the enclosure:
  YunCore AX820: indoor ceiling mount AP with integrated antennas
  YunCore HWAP-AX820: outdoor enclosure with external (N) connectors

Hardware specs:
  SoC: MediaTek MT7621DAT
  Flash: 16 MiB SPI NOR
  RAM: 128MiB (DDR3, integrated)
  WiFi: MT7905DAN+MT7975DN 2.4/5GHz 2T2R 802.11ax
  Ethernet: 10/100/1000 Mbps x2 (WAN/PoE+LAN)
  LED: Status (green)
  Button: Reset
  Power: 802.11af/at PoE; DC 12V,1A
  Antennas: AX820(indoor): 4dBi internal; HWAP-AX820(outdoor): external

Flash instructions:
  The "OpenWRT support" version of the AX820 comes with a LEDE-based
  firmware with proprietary MTK drivers and a luci webinterface and
  ssh accessible under 192.168.1.1 on LAN; user root, no password.
  The sysupgrade.bin can be flashed using luci or sysupgrade via ssh,
  you will have to force the upgrade due to a different factory name.
  Remember: Do *not* preserve factory configuration!

MAC addresses as used by OEM firmware:
  use   address            source
  2g    44:D1:FA:*:0b      Factory 0x0004 (label)
  5g    46:D1:FA:*:0b      LAA of 2g
  lan   44:D1:FA:*:0c      Factory 0xe000
  wan   44:D1:FA:*:0d      Factory 0xe000 + 1
The wan MAC can also be found in 0xe006 but is not used by OEM dtb.

Due to different MAC handling in mt76 the LAA derived from lan is used
for 2g to prevent duplicate MACs when creating multiple interfaces.

Signed-off-by: Clemens Hopfer <openwrt@wireloss.net>
(cherry picked from commit 4891b86538)
[switch to mtd-mac-address instead of nvmem-cells]
2022-08-28 08:14:45 +02:00
Zoltan HERPAI 052ff08aa7 sunxi: add support for Banana Pi M2 Berry
CPU: Allwinner V40 quad-core Cortex A7 @ 1.2GHz
Memory: 1GB DDR3
Storage: SDcard, native SATA
Network: 10/100/1000M ethernet, Ampak AP6212 wifi + BT
USB: 4x USB 2.0

Installation:
Use the standard sunxi installation to an SD-card.

While the board is very similar to the M2 Ultra board
(the V40 is the automotive version of the R40), as both
the u-boot and kernel supports them separately, and some
pins are different, let's add a separate device spec.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
(cherry picked from commit 9aa66b8ce7)
2022-08-28 08:12:39 +02:00
Andrea Poletti caeb618eea ramips: add support for Sitecom WLR-4100 v1 002
Sitecom WLR-4100 v1 002 (marked as X4 N300) is a wireless router
Specification:
SoC: MT7620A
RAM: 64 MB DDR2
Flash: MX25L6405D SPI NOR 8 MB
WIFI: 2.4 GHz integrated
Ethernet: 5x 10/100/1000 Mbps QCA8337
USB: 1x 2.0
LEDS: 2x GPIO controlled, 5x switch
Buttons: 1x GPIO controlled
UART: row of 4 unpopulated holes near USB port, starting count from
      white triangle on PCB:

    VCC 3.3V
    GND
    TX
    RX

    baud: 115200, parity: none, flow control: none

Installation

    Connect to one of LAN (yellow) ethernet ports,
    Open router configuration interface,
    Go to Toolbox > Firmware,
    Browse for OpenWrt factory image with dlf extension and hit Apply,
    Wait few minutes, after the Power LED will stop blinking, the router is
    ready for configuration.

Known issues
Some USB 2.0 devices work at full speed mode 1.1 only

MAC addresses

factory partition only contains one (binary) MAC address in 0x4.
u-boot-env contains four (ascii) MAC addresses, of which two appear
to be valid.

  factory     0x4       **:**:**:**:b9:84  binary
  u-boot-env  ethaddr   **:**:**:**:b9:84  ascii
  u-boot-env  wanaddr   **:**:**:**:b9:85  ascii
  u-boot-env  wlanaddr  00:AA:BB:CC:DD:12  ascii
  u-boot-env  iNICaddr  00:AA:BB:CC:DD:22  ascii

The factory firmware only assigns ethaddr. Thus, we take the
binary value which we can use directly in DTS.

Additional information
OEM firmware shell password is: SitecomSenao
useful for creating backup of original firmware.
There is also another revision of this device (v1 001), based on RT3352 SoC

The nvmem feature (commit 06bb4a5) was introduced in master after the
splitting of the 21.02 branch. It need to be reverted in 21.02..

Signed-off-by: Andrea Poletti <polex73@yahoo.it>
[remove config DT label, convert to nvmem, remove MAC address
 setup from u-boot-env, add MAC address info to commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit de0c380a5f)

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-08-28 08:09:15 +02:00
Paul Spooren f94b30d83c octeon: add SUPPORTED_DEVICES to er/erlite
Using the BOARD_NAME variable results for both er and erlite devices to
identify themselfs as `er` and `erlite` (via `ubus call system board`).

This is problematic when devices search for firmware upgrades since the
OpenWrt profile is actually called `ubnt_edgerouter` and
`ubnt_edgerouter-lite`.

By adding the `SUPPORTED_DEVICE` a mapping is created to point devices
called `er` or `erlite` to the corresponding profile.

FIXES: https://github.com/openwrt/asu/issues/348

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit 2a07270180)
2022-07-29 15:10:21 +02:00
Christian Lamparter 09dae4feac ipq806x: Archer VR2600: fix switch ports numbering
The order of LAN ports shown in Luci is reversed compared to what is
written on the case of the device.  Fix the order so that they match.

Fixes: #10275
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(cherry picked from commit 69ea671320)
2022-07-23 00:25:50 +02:00
Christian Lamparter 41e0dc5db9 sdk: add spidev-test to the bundle of userspace sources
moves and extends the current facilities, which have been
added some time ago for the the usbip utility, to support
more utilites that are shipped with the Linux kernel tree
to the SDK.

this allows to drop all the hand-waving and code for
failed previous attempts to mitigate the SDK build failures.

Fixes: bdaaf66e28 ("utils/spidev_test: build package directly from Linux")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(cherry picked from commit b479db9062)
(cherry picked from commit eb8d0da88a0dcf7f10f05ad10c48e3a691f5a8d1)
2022-07-19 20:27:06 +02:00
Rafał Miłecki 366dfa4c5b bcm4908: use upstream-accepted watchdog patches
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 864fdf2bf3)
2022-07-18 19:45:37 +02:00
Rafał Miłecki c0448cd727 bcm4908: backport latest DT patches
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 001856fa51)
2022-07-18 19:39:04 +02:00
Rafał Miłecki e0b7557c75 kernel: update leds-bcm63138 driver
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit bb2a2b1dbe)
2022-07-18 19:30:53 +02:00
Rafał Miłecki e48124460f kernel: backport LEDs driver for BCMBCA devices
This includes BCM63xx and BCM4908 families.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit d9ab1e56d8)
2022-07-18 09:12:17 +02:00
Chukun Pan 1247010d1c mediatek: mt7623: fixes kconfig for hwcrypto
The MediaTek's Crypto Engine driver has been replaced with the upstream
Inside Secure's SafeXcel cryptographic engine driver, however kconfig
has not been changed accordingly, this commit fixes it.

Fixes: 127ad76 ("mediatek: switch over to extended upstream eip97
driver")

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2022-07-15 15:55:45 +02:00
Eneas U de Queiroz 68fbcc474d mediatek: remove crypto-hw-mtk package
The MediaTek's Crypto Engine module is only available for mt7623, in
which case it is built into the kernel.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
(cherry picked from commit 3f2d0703b6)
2022-07-15 15:55:45 +02:00
Rafał Miłecki a50f5b3fb2 bcm53xx: enable & setup packet steering
Packet steering can improve NAT masquarade performance on Northstar by
40-50%. It makes reaching 940-942 Mb/s possible on BCM4708 (and
obviously BCM47094 too). Add scripts setting up the most optimal
Northstar setup.

Below are testing results for running iperf TCP traffic from LAN to WAN.
They were used to pick up golden values.

┌──────────┬──────────┬────────────────────┬────────────────────┐
│   eth0   │  br-lan  │ flow_offloading=0  │ flow_offloading=1  │
│          │          ├─────────┬──────────┼─────────┬──────────┤
│ rps_cpus │ rps_cpus │ BCM4708 │ BCM47094 │ BCM4708 │ BCM47094 │
├──────────┼──────────┼─────────┼──────────┼─────────┼──────────┤
│        0 │        0 │     387 │      671 │     707 │      941 │
│        0 │        1 │     343 │      576 │     705 │      941 │
│        0 │        2 │   ✓ 574 │    ✓ 941 │     704 │      940 │
│        1 │        0 │     320 │      549 │     561 │      941 │
│        1 │        1 │     327 │      551 │     553 │      941 │
│        1 │        2 │     523 │    ✓ 940 │     559 │      940 │
│        2 │        0 │     383 │      652 │   ✓ 940 │      941 │
│        2 │        1 │     448 │      754 │   ✓ 942 │      941 │
│        2 │        2 │     404 │      655 │   ✓ 941 │      941 │
└──────────┴──────────┴─────────┴──────────┴─────────┴──────────┘

Above tests were performed with all eth0 interrupts handled by CPU0.
Setting "echo 2 > /proc/irq/38/smp_affinity" was tested on BCM4708 but
it didn't increased speeds (just required different steering):

┌──────────┬──────────┬───────────┐
│   eth0   │  br-lan  │ flow_offl │
│   rx-0   │   rx-0   │ oading=0  │
│ rps_cpus │ rps_cpus │  BCM4708  │
├──────────┼──────────┼───────────┤
│        0 │        0 │       384 │
│        0 │        1 │     ✓ 574 │
│        0 │        2 │       348 │
│        1 │        0 │       383 │
│        1 │        1 │       412 │
│        1 │        2 │       448 │
│        2 │        0 │       321 │
│        2 │        1 │       520 │
│        2 │        2 │       327 │
└──────────┴──────────┴───────────┘

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit fcbd39689e)
2022-07-08 16:18:25 +02:00
Rafał Miłecki c032ed3c26 bcm53xx: disable GRO by default at kernel level
This improves NAT masquarade network performance.

An alternative to kernel change would be runtime setup but that requires
ethtool and identifying relevant network interface and all related
switch ports interfaces.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 82d0dd8f8a)
2022-07-08 16:18:25 +02:00
Rafał Miłecki 4ec80cd907 kernel: drop patch adding hardcoded kernel compilation flags
1. KCFLAGS should be used for custom flags
2. Optimization flags are arch / SoC specific
3. -fno-reorder-blocks may *worsen* network performace on some SoCs
4. Usage of flags was *reversed* since 5.4 and noone reported that

If we really need custom flags then CONFIG_KERNEL_CFLAGS should get
default value adjusted properly (per target).

Ref: 4e0c54bc5b ("kernel: add support for kernel 5.4")
Link: http://lists.openwrt.org/pipermail/openwrt-devel/2022-June/038853.html
Link: https://patchwork.ozlabs.org/project/openwrt/patch/20190409093046.13401-1-zajec5@gmail.com/
Cc: Felix Fietkau <nbd@nbd.name>
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Cc: Rui Salvaterra <rsalvaterra@gmail.com>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 22168ae681)
2022-07-08 15:38:42 +02:00
Rafał Miłecki 44fa330a82 kernel: use KCFLAGS for passing EXTRA_OPTIMIZATION flags
This uses kernel's generic variable and doesn't require patching it with
a custom Makefile change. It's expected *not* to change any behaviour.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 1d42af720c)
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit 24e27bec9a)
2022-07-08 15:38:42 +02:00
Hauke Mehrtens 3439c2ff70 kernel: Remove kmod-crypto-lib-blake2s
Delete the crypto-lib-blake2s kmod package, as BLAKE2s is now built-in.

Fixes: be0639063a ("kernel: bump 5.4 to 5.4.203")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-07-04 01:35:37 +02:00
Hauke Mehrtens 8001e19955 kernel: backport wireguard blake2s patch
This patch was backported to kernel 5.4.200, but without the wireguard
change, because wireguard is not available in upstream kernel 5.4.
This adds the missing changes for wireguard too.

Fixes: be0639063a ("kernel: bump 5.4 to 5.4.203")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-07-03 21:27:38 +02:00
Adrian Schmutzler 76ee3e1225 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] 447b878935

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 7be8ab4f7b)
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
[reword commit subject and commit description]
2022-07-03 20:01:47 +02:00
Ritaro Takenaka 6d891adf39 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>
2022-07-03 20:00:16 +02:00
Hauke Mehrtens be0639063a 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>
2022-07-03 19:58:31 +02:00
Piotr Dymacz 09a35619b8 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 fd72e595c2)
2022-06-20 11:10:24 +02:00
David Bauer 01dcdf7b3c 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 535b0c70b1)
2022-06-18 22:15:38 +02:00
Hauke Mehrtens ce92de8c8c 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>
2022-05-18 00:11:28 +02:00
Hauke Mehrtens 7ae0f74bcd 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>
2022-05-18 00:11:17 +02:00
Hauke Mehrtens e0bdf83972 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>
2022-05-18 00:10:34 +02:00
Alban Bedel 13c88950a2 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 f953a1a4bf)
2022-05-01 11:25:50 +08:00
Nick Hainke e9431a8335 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 ab7e53e5cc)
[Deleted 5.10 from commit title]
Signed-off-by: Nick Hainke <vincent@systemli.org>
2022-04-30 16:31:32 +02:00
Felix Fietkau 1418439da9 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 92add80414)
2022-04-20 10:07:58 +02:00
Michael Pratt 1769e3162e 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 f017f617ae)

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 2adeada045)
2022-04-19 14:48:21 +02:00
Michael Pratt 30e47fb1e4 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 88a0cebadf)
2022-04-19 14:48:21 +02:00
Michael Pratt 3f976d0225 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: 5410a8e295 ("ramips: mt7620: add rgmii delays support")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit 26c84b2e46)
2022-04-19 14:48:21 +02:00
Michael Pratt 6685eb29e5 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 cc6fd6fbb5)
2022-04-19 14:48:21 +02:00
Michael Pratt 47db830b82 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 194ca6127e)

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: 5a6229a93d ("ramips: remove superfluous & confusing DT binding")
Fixes: b85fe43ec8 ("ramips: mt7620: add force use of mdio-mode")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit 6972e498d3)
2022-04-19 14:48:21 +02:00
Michael Pratt 6876465875 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 0976b6c426)
2022-04-19 14:48:21 +02:00
Michael Pratt 5d7805c78b 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: 391df37829 ("ramips: mt7620: add EPHY base mdio address changing possibility")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit de5394a29d)
2022-04-19 14:48:21 +02:00
Michael Pratt 01bbed7444 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: f6d81e2fa1 ("mt7620: gsw: make IntPHY and ExtPHY share mdio addr 4 possible")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit afd60d650e)
2022-04-19 14:48:21 +02:00
Michael Pratt 6491212ea7 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: d482356322 ("ramips: mt7620n: add mdio node and disable port4 by default")
Fixes: aa5014dd1a ("ramips: mt7620n: enable port 4 as EPHY by default")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit a2acdf9607)
2022-04-19 14:48:21 +02:00
Michael Pratt a14c2d409c 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 953bfe2eb3)
2022-04-19 14:48:21 +02:00
Gaspare Bruno c652a06eef 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 0056ffb468)
2022-04-19 14:48:21 +02:00
David Bauer 08ec622c46 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 6a15abbc75)
2022-04-19 14:48:21 +02:00
Ben Gainey 4123f177f9 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 a509b80065)
2022-04-19 14:48:21 +02:00
Shiji Yang 92af15077f 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 4a9f389ed2)
2022-04-19 14:48:21 +02:00
Shiji Yang 55f8eb84d2 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 882a6116d3)
2022-04-19 14:48:21 +02:00
Shiji Yang 92489b4f82 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 bf7ddb18f1)
2022-04-19 14:48:21 +02:00
DENG Qingfang bea1891182 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 06af45ec05)
2022-04-19 14:48:21 +02:00
Josef Schlehofer 6c44b157e5 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 9d530ac4bf)
[rebased for config-5.4]
2022-04-19 14:40:24 +02:00
Joe Mullally 1d4dea6d4f 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>
2022-04-16 14:59:34 +02:00
Torsten Duwe 41a97c2074 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 7ea9936f7f)
2022-04-16 14:55:27 +02:00
Thibaut VARÈNE 9a765554f4 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 781d4bfb39
 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 eb38af7881)
2022-04-16 14:51:57 +02:00
Thibaut VARÈNE 2cc9ee8000 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 a05dcb0724)
[switch to mtd-mac-address instead of nvmem-cells]
2022-04-16 14:48:45 +02:00
Thibaut VARÈNE 06874171d1 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 c91df224f5)
2022-04-16 14:48:29 +02:00
Michael Pratt 169c9e3a88 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: 22d982ea00 ("ramips: add support for switching between 3-byte and 4-byte addressing")
Ref: dfa521f129 ("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 74516f4357)
2022-04-08 10:31:32 +02:00
Hauke Mehrtens 39bf2aee0e 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>
2022-04-07 20:42:34 +02:00
Petr Štetiar 3008f1f441 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 621f39d1f4)
(cherry picked from commit ec9af870f3)
2022-04-05 22:06:41 +02:00
Jan-Niklas Burfeind ee62912b2d
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 e19506f206 ("ath79: migrate Archer C7 5GHz radio device paths")

Signed-off-by: Jan-Niklas Burfeind <git@aiyionpri.me>
(cherry picked from commit c6eb63d48f)
2022-03-31 18:07:57 +02:00
Matthias Schiffer f6513143ad
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 aee9ccf5c1)
2022-03-30 17:49:43 +02:00
Christian Lamparter 5cf00adf21 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)
2022-03-26 21:26:07 +01:00
Marek Behún 0e5350db43 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>
2022-03-26 21:26:07 +01:00
David Bauer cd17ca7d6f 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 4551bfd91f)
2022-03-26 19:09:17 +01:00
Matthias Schiffer 30e6f28853
ath79: fix TPLINK_HWREV field for TL-WR1043ND v4
Required to allow sysupgrades from OpenWrt 19.07.

Closes #7071

Fixes: 98fbf2edc0 ("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 8ba71f1f6f)
2022-03-25 18:15:11 +01:00
Petr Štetiar fdd862f9ac 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 ffa1088f63)
2022-03-24 09:40:12 +01:00
Robert Marko 4910ffa8e9 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 a8b2d35903)
(cherry picked from commit b9e90935db)
2022-03-24 09:40:12 +01:00
Robert Marko d38f7ec56f 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 80f21e5336)
(cherry picked from commit d65269a732)
2022-03-24 09:40:12 +01:00
Matthias Schiffer 56d69ee70d
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 2a02b70499)
2022-03-24 09:35:55 +01:00
Felix Fietkau c6256a6533 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 a1ac8728f8)
2022-03-23 12:52:20 +00:00
Marek Behún 28343cfb7d kernel: backport DSA patches fixing null-pointer dereference
[ backport of master commit fbe2c3feaa ]

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]
2022-03-21 14:23:42 +01:00
Rafał Miłecki e8a806c49e 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 34fd5e325a)
2022-03-14 08:51:02 +01:00
Matthias Schiffer 604274c24b
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 c8350dfb3c)
2022-03-10 23:32:59 +01:00
Rafał Miłecki 13c9f1f37d 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 93259e8ca2)
2022-03-07 14:48:02 +01:00
Rafał Miłecki e12ffac02d 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 0dbcefdd52)
2022-03-07 14:48:02 +01:00
Hauke Mehrtens 2d69d098e0 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>
2022-03-06 20:55:26 +01:00
Petr Štetiar b2896d413e 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: 98b86296e6 ("ipq806x: add support for ASRock G10")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit fc317a190c)
2022-02-28 15:21:32 +01:00
Sungbo Eo 952de38ef4 Revert "ramips: increase spi-max-frequency for ipTIME mt7620 devices"
This reverts commit 13a185bf8a.

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 9968a909c2)
2022-02-27 21:40:32 +09:00
Petr Štetiar 610b2cff60 ipq806x: base-files: asrock: fix bootcount include
Fixes following error while executing the init script on the buildhost:

 Enabling boot
 ./etc/init.d/bootcount: line 5: /lib/upgrade/asrock.sh: No such file or directory
 Enabling bootcount

While at it fix following shellcheck issue:

 base-files/etc/init.d/bootcount line 11:
    if [ $? -eq 0 ]; then
         ^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.

Fixes: #9345
Cc: Ansuel Smith <ansuelsmth@gmail.com>
Cc: Pawel Dembicki <paweldembicki@gmail.com>
Cc: Christian Lamparter <chunkeey@gmail.com>
Fixes: 98b86296e6 ("ipq806x: add support for ASRock G10")
References: https://gitlab.com/ynezz/openwrt/-/jobs/1243290743#L1444
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit ce8af0ace0)
2022-02-26 07:40:43 +01:00
Chuanhong Guo 7612ecb201 ramips: mt7621: do memory detection on KSEG1
It's reported that current memory detection code occasionally detects
larger memory under some bootloaders.
Current memory detection code tests whether address space wraps around
on KSEG0, which is unreliable because it's cached.

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

Fixes: 6d91ddf517 ("ramips: mt7621: add support for memory detection")
Reported-by: Rui Salvaterra <rsalvaterra@gmail.com>
Tested-by: Rui Salvaterra <rsalvaterra@gmail.com>
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
(cherry picked from commit 2f024b7933)
[backport for OpenWrt 21.02 as it was reproducible with Kernel 5.4, see [1]]
[1]: https://forum.openwrt.org/t/113081
Tested-by: Dimitri Souza <dimitri.souza@gmail.com> [mt7621/archer-c6-v3]
Signed-off-by: Szabolcs Hubai <szab.hu@gmail.com>
2022-02-22 20:48:46 +08:00
Felix Fietkau bf0c965af0 ramips: fix NAND flash driver ECC bit position mask
The bit position mask was accidentally made too wide, overlapping with the LSB
from the byte position mask. This caused ECC calculation to fail for odd bytes

Signed-off-by: Chad Monroe <chad.monroe@smartrg.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit 918d4ab41e)
2022-02-16 21:29:10 +01:00
Felix Fietkau adb65008c8 kernel: backport fix for initializing skb->cb in the bridge code to 5.4
Fixes issues with proxyarp

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit dabc78b644)
2022-02-16 20:38:59 +01:00
Rafał Miłecki 230ec4c69c bcm4908: backport watchdog and I2C changes
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 923cc869a6)
2022-02-16 09:15:52 +01:00
Rafał Miłecki 87b9ba9ed9 bcm4908: backport first 5.18 DTS changes
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit da8b720b0e)
2022-02-16 09:15:52 +01:00
Rafał Miłecki e6a718239f bcm4908: backport bcm_sf2 patch for better LED registers support
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 840f07e532)
2022-02-16 09:15:52 +01:00
Rafał Miłecki e6aaa061d0 bcm4908: backport BCM4908 pinctrl driver
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit b014589167)
2022-02-16 09:15:48 +01:00
Hauke Mehrtens c6ddf8d502 kernel: bump 5.4 to 5.4.179
Many changes were done in drivers/pinctrl/bcm/pinctrl-bcm2835.c between
5.4.171 and 5.4.179.
The following 3 patches do not apply any more:
* target/linux/bcm27xx/patches-5.4/950-0316-pinctrl-bcm2835-Add-support-for-BCM2711-pull-up-func.patch
  This was already integrated in kernel v5.4-rc1, it was never needed.

* target/linux/bcm27xx/patches-5.4/950-0328-Revert-pinctrl-bcm2835-Pass-irqchip-when-adding-gpio.patch
* target/linux/bcm27xx/patches-5.4/950-0362-pinctrl-bcm2835-Change-init-order-for-gpio-hogs.patch
I think these were done to fix the problem which was really fixed in
commit 75278f1aff5e ("pinctrl: bcm2835: Change init order for gpio
hogs") from v5.4.175

target/linux/generic/backport-5.4/716-v5.5-net-sfp-move-fwnode-parsing-into-sfp-bus-layer.patch
Move fwnode_device_is_available to the same position as in kernel 5.10.

target/linux/layerscape/patches-5.4/302-dts-0083-arm64-ls1028a-qds-correct-bus-of-rtc.patch
Applied in commit 65816c1034769e714edb70f59a33bc5472d9e55f ("arm64: dts:
ls1028a-qds: move rtc node to the correct i2c bus")

Compile-tested: lantiq/xrx200, bcm27xx/bcm2710
Run-tested: lantiq/xrx200

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-02-12 19:41:39 +01:00
Sven Eckelmann a4c0c031b8 ath79: Add support for OpenMesh OM5P-AC v2
Device specifications:
======================

* Qualcomm/Atheros QCA9558 ver 1 rev 0
* 720/600/200 MHz (CPU/DDR/AHB)
* 128 MB of RAM
* 16 MB of SPI NOR flash
  - 2x 7 MB available; but one of the 7 MB regions is the recovery image
* 2T2R 2.4 GHz Wi-Fi (11n)
* 2T2R 5 GHz Wi-Fi (11ac)
* 4x GPIO-LEDs (3x wifi, 1x power)
* 1x GPIO-button (reset)
* external h/w watchdog (enabled by default))
* TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX)
* TI tmp423 (package kmod-hwmon-tmp421) for temperature monitoring
* 2x ethernet
  - eth0
    + AR8035 ethernet PHY (RGMII)
    + 10/100/1000 Mbps Ethernet
    + 802.3af POE
    + used as LAN interface
  - eth1
    + AR8031 ethernet PHY (RGMII)
    + 10/100/1000 Mbps Ethernet
    + 18-24V passive POE (mode B)
    + used as WAN interface
* 12-24V 1A DC
* internal antennas

This device support is based on the partially working stub from commit
53c474abbd ("ath79: add new OF only target for QCA MIPS silicon").

Flashing instructions:
======================

Various methods can be used to install the actual image on the flash.
Two easy ones are:

ap51-flash
----------

The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be
used to transfer the image to the u-boot when the device boots up.

initramfs from TFTP
-------------------

The serial console must be used to access the u-boot shell during bootup.
It can then be used to first boot up the initramfs image from a TFTP server
(here with the IP 192.168.1.21):

   setenv serverip 192.168.1.21
   setenv ipaddr 192.168.1.1
   tftpboot 0c00000 <filename-of-initramfs-kernel>.bin && bootm $fileaddr

The actual sysupgrade image can then be transferred (on the LAN port) to the
device via

  scp <filename-of-squashfs-sysupgrade>.bin root@192.168.1.1:/tmp/

On the device, the sysupgrade must then be started using

  sysupgrade -n /tmp/<filename-of-squashfs-sysupgrade>.bin

Signed-off-by: Sven Eckelmann <sven@narfation.org>
(cherry picked from commit 1699c1dc7f)
2022-02-11 00:28:52 +01:00
Paul Spooren 6d266ef158 imagebuilder: fix local packages/ folder
This commit fixes commit "2999f810ff: build,IB: include kmods only in
local builds" which cause the local packages/ folder only to be added
for local builds but no longer for ImageBuilder created by the Buildbot.

The commits intention was to use remote kmods repositories rather than
storing them locally. Accidentally the entire handling of the local
`packages/` was removed.

Re-add the folder and include a README describing what it can be used
for.

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit 15e55a2190)
Fixes: #5068
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-02-10 20:06:04 +01:00
David Bauer 6eced97ce4 lantiq: flag FritzBox 7360 family buttons active-low
All buttons of the FritzBox 7360 family are active-low, not active-high.
Corrent the GPIO flag. This fixes release triggers upon push of a button.

Reported-by: Jan-Niklas Burfeind <git@aiyionpri.me>
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 3154537864)
2022-01-15 22:49:28 +01:00
David Bauer 43d105ec2a kernel: bump 5.4 to 5.4.171
Compile-tested: ath79-generic ipq40xx-generic
Run-tested: ath79-generic

Signed-off-by: David Bauer <mail@david-bauer.net>
2022-01-13 20:30:59 +01:00
Koen Vandeputte 1db847488d ath79: rb912: fix pll init issues
It was reported that some rb912 boards (ar934x) have issues with some ethernet speeds.
Investigation shows that the board failed to adapt the ethernet pll values as shown here:

[    5.284359] ag71xx 19000000.eth: failed to read pll-handle property

added custom prints in code and triggering a link switch:

[   62.821446] Atheros AG71xx: fast reset
[   62.826442] Atheros AG71xx: update pll 2
[   62.830494] Atheros AG71xx: no pll regmap!

Comparison with another very similar board (rb922 - QCA955x) showed a missing
reference clock frequency in dts, which seems to cause a pll init issue.
Unfortunately, no errors are printed when this occurs.

Adding the frequency property fixes the pll init as it can be parsed now
by the ethernet driver.

[   55.861407] Atheros AG71xx: fast reset
[   55.866403] Atheros AG71xx: update pll 2
[   55.870462] Atheros AG71xx: ath79_set_pllval: regmap: 0x81548000, pll_reg: 0x2c, pll_val: 0x02000000

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
(cherry picked from commit 2a00054618)
2022-01-13 10:04:06 +01:00
Vladimir Markovets 6ced8cad8e kernel: backport workaround for Realtek RTL8672 and RTL9601C chips
Adds support for GPON SFP modules based on the Realtek RTL8672 and
RTL9601C chips, including but not limited to:
* V-SOL V2801F
* C-Data FD511GX-RM0
* OPTON GP801R
* BAUDCOM BD-1234-SFM
* CPGOS03-0490 v2.0
* Ubiquiti U-Fiber Instant
* EXOT EGS1

Signed-off-by: Vladimir Markovets <abam_a@yahoo.com>
(cherry picked from commit f032601ed7)
2022-01-08 21:31:15 +01:00
Marek Behún 96b5962704 mvebu: remove patch that was applied into linux stable
The patch
  PCI: aardvark: Don't touch PCIe registers if no card connected
was applied into Linux stable version 5.4.163.

Remove it from patches-5.4.

(It applied even though it was applied already, resulting in repeated
 code.)

Fixes: 14940aee45 ("kernel: bump 5.4 to 5.4.163")
Signed-off-by: Marek Behún <marek.behun@nic.cz>
2022-01-08 21:31:15 +01:00
Rafał Miłecki 93842b20dc bcm4908: include ATF in bootfs images
It's required for proper booting.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 65974aa18b)
2022-01-03 14:28:13 +01:00
Rafał Miłecki 739e359241 kernel: backport support for multicolor & RGB LEDs to 5.4
This is a requirement for backporting DT files defining such LEDs.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 85ad48c957)
2022-01-03 14:28:13 +01:00
Rafał Miłecki 608c7dccf2 bcm4908: sysupgrade: add pkgtb format support
BCM4908 devices with U-Boot use pkgtb firmware format. It's based on
U-Boot's FIT: DTB with configurations, images & embedded data.

This format contains bootfs, rootfs and optionally a first stage U-Boot
loader. Contained images need to be extracted & flashed.

Broadcom used two sets of firmwares: main & backup. It uses UBI volumes
"metadata1" & "metadata2" for storing U-Boot env variables with info
about flashed images.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 5f05795aa7)
2022-01-03 14:28:13 +01:00
Rafał Miłecki 7e4485fd5b bcm4908: add uboot-envtools to default packages
It's required by sysupgrade to access UBI metadata partitions.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 444b4ea4a4)
2022-01-03 14:28:13 +01:00
Rafał Miłecki 4cd5d11fa3 bcm4908: add fdt-utils to default packages
It's required by sysupgrade.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 30b93672ec)
2022-01-03 14:28:13 +01:00
Rafał Miłecki 6292d1e354 bcm4908: sysupgrade: refactor handling different firmware formats
This results in setting format specific data (format info, extract
commands) in a single function. It should help maintaining sysupgrade
code.

This change has been tested on Asus GT-AC5300 and Netgear R8000P.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 30b168b9b8)
2022-01-03 14:00:34 +01:00
Rafał Miłecki a00854040d ipq40xx: specify FritzBox 7530 LAN port label numbers
This helps managing LAN ports.

Ref: https://forum.openwrt.org/t/openwrt-21-02-0-second-release-candidate/98026/121
Fixes: 95b0c07a61 ("ipq40xx: add support for FritzBox 7530")
Cc: David Bauer <mail@david-bauer.net>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 3342d574be)
2022-01-03 14:00:34 +01:00
Daniel Golle 104774c3b0
mvebu: puzzle: wan LED and fix default network
Fix default network configuration of the Puzzle-M902 so all LAN ports
are included in the LAN bridge.
Setup network LED to indicate WAN port link status, like vendor
firmware does as well.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit f9782f5bcd)
2022-01-01 22:30:15 +00:00
Daniel Golle 47d82f0710
mvebu: enable Aquantia phy driver for Puzzle devices
While on Linux 5.10 this fixes Ethernet link status on all ports and
makes 2.5G ports usable in 2.5G and 1G full-duplex mode, when using
Linux 5.4 and backported Aquantia phy patches, only 1G mode works on
the 2.5G ports and link speed and duplex are not reported correctly
from the phy in case of 2.5G.
The reasons are probably trivial, but hard to find. As having all
ports work at least in 1G speed instead of having them not work at
all is still better, push this anyway for now.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit f81a06408e)
2022-01-01 22:30:09 +00:00
Daniel Golle 164ed6069c
mvebu: add id for AQR112 Ethernet phy variants
Add ids for AQR112R and AQR112C 2.5G Ethernet PHYs.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-01-01 22:30:03 +00:00
Daniel Golle daf4301071
mvebu: import patch enabling AQR113 PHY
Add PHY ID for the Aquantia AQR113 PHY.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-01-01 22:29:58 +00:00
Daniel Golle ee5750043c
mvebu: import patch enabling AQR112 and AQR412 PHY
Copy and refresh patch enabling AQR112 and AQR412 Ethernet PHY from
layerscape (5.4) target to mvebu (5.4) as AQR112 can also be found
in IEI Puzzle devices.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-01-01 22:29:53 +00:00
Daniel Golle a03840a1a9
mvebu: puzzle-m901: add LEDs, fan and reset button
Wire up MCU driver for LEDs, fan and temperature sensor, and add
GPIO reset button just like on the M902 also on the Puzzle M901.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 3684b494dd)
2022-01-01 22:29:48 +00:00
Daniel Golle 280bb7c10c
mvebu: puzzle-m902: add GPIO reset button
Add reset button to device tree so it has the function expected from
usual OpenWrt devices.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit ddad936fc6)
2022-01-01 22:29:43 +00:00
Daniel Golle 1e5df4d550
mvebu: puzzle-mcu: improve led driver
Set blinking mode using scheduled work instead of blocking which may
result in deadlocks.
Add dynamic kprintf debugging hexdumps of all MCU rx and tx.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 7e4c1cca8a)
2022-01-01 22:29:38 +00:00
Daniel Golle 99a1e88297
mvebu: puzzle-m902: add driver for MCU driving LEDs, fan and buzzer
Backport MFD driver for communicating with the on-board MCU found on
IEI World Puzzle appliances.
Improve the driver to support multiple LEDs, apply a default state and
let MCU take care of blinking if timing is within supported range.
Wire up LEDs and fan for Puzzle M902 in device tree.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit f0c0b18234
with commit 962c585580 squashed)
2022-01-01 22:29:33 +00:00
Josef Schlehofer d0b0ebf966 linux-firmware: update to version 20210315 and trim down broadcom FW
In there linux-firmware repository located in kernel, there were removed old
broadcom firmware [1] as they seem to be likely vulnerable to KrØØk vulnerability
(CVE-2019-15126), because Cypress released new versions and superseded
by it.

In OpenWrt, there is Makefile for cypress-firmware, which already provides
the same named packages like it was in linux-firmware. For example, cypress-firmware-43455-sdio
provides brcmfmac-firmware-43455-sdio [2].

Changelog between 2020118 and 20210315:
3568f96 (tag: 20210315) linux-firmware: Update firmware file for Intel Bluetooth AX210
9e96e50 linux-firmware: Update firmware file for Intel Bluetooth AX200
c8d0db5 linux-firmware: Update firmware file for Intel Bluetooth AX201
5e2a387 Merge tag 'iwlwifi-fw-2021-03-05-v3' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/linux-firmware into main
b0d3e31 rtw88: 8822c: Update normal firmware to v9.9.6
5a2fd63 iwlwifi: add new FWs from core59-66 release
4f54906 iwlwifi: update 9000-family firmwares
11b7607 iwlwifi: update 7265D firmware
e425f76 Merge branch 'add-silabs-wf200' of github.com:jerome-pouiller/linux-firmware into main
5ecd13f Mellanox: Add new mlxsw_spectrum firmware xx.2008.2406
58fb90a linux-firmware: add frimware for mediatek bluetooth chip (MT7921)
e576a1b rtw89: 8852a: add firmware v0.9.12.2
048a7cb WHENCE: add missing symlink for BananaPi M3
aa6c6e7 Add symlink for BananaPi M2 to brcmfmac43430-sdio config
58825f7 brcm: Fix Raspberry Pi 4B NVRAM file
520f71b silabs: add new firmware for WF200
f7915a0 amdgpu: add initial firmware for green sardine
80cb579 rtw88: RTL8822C: Update normal firmware to v9.9.5
b79d239 (tag: 20210208) Merge branch 'DG1-guc-huc-ADLS-dmc' of git://anongit.freedesktop.org/drm/drm-firmware into main
66970e1 Merge branch 'qcom-rb5' of https://github.com/lumag/linux-firmware into main
cf6fc2b Mellanox: Add new mlxsw_spectrum firmware xx.2008.2304
391fd50 linux-firmware: add firmware for MT7921
c5e3240 rtw88: RTL8821C: Update firmware to v24.8
d33d2d8 linux-firmware: Update firmware file for Intel Bluetooth AX210
3027ae4 linux-firmware: Update firmware file for Intel Bluetooth AX200
13979c3 linux-firmware: Update firmware file for Intel Bluetooth AX201
348d8a9 i915: Add DMC v2.01 for ADL-S
f33f1f7 i915: Add HuC v7.7.1 for DG1
6a422f5 i915: Add GuC v49.0.1 for DG1
df822a8 qcom: Add venus firmware files for VPU-1.0
11a1db1 qcom: Add SM8250 Compute DSP firmware
e55248b qcom: Add SM8250 Audio DSP firmware
da74cc6 qcom: add firmware files for Adreno a650
0578970 brcm: Link RPi4's WiFi firmware with DMI machine name.
d528862 brcm: Add NVRAM for Vamrs 96boards Rock960
870b805 brcm: Update Raspberry Pi 3B+/4B NVRAM for downstream changes
a28a590 cypress: Fix link direction
060ad8b cypress: Link the new cypress firmware to the old brcm files
0f0aefd brcm: remove old brcm firmwares that have newer cypress variants
f580dc2 rtl_bt: Update RTL8822C BT(UART I/F) FW to 0x059A_25CB
7df2220 rtl_bt: Update RTL8822C BT(USB I/F) FW to 0x099a_7253
e79405d rtl_bt: Add firmware and config files for RTL8852A BT USB chip
ef3813d rtl_bt: Update RTL8821C BT(USB I/F) FW to 0x829a_7644
646f159 (tag: 20201218) make AP6212 in bananpi m2 plus/zero work
28185ec linux-firmware: Update firmware file for Intel Bluetooth AX210
23da869 linux-firmware: Update firmware file for Intel Bluetooth AX200
2099248 linux-firmware: Update firmware file for Intel Bluetooth AX201
94de5e2 linux-firmware: Update firmware file for Intel Bluetooth 9560
27a3689 linux-firmware: Update firmware file for Intel Bluetooth 9260
5c3c4af Merge branch 'lt9611uxc' of https://github.com/lumag/linux-firmware into main
aaed4a8 Merge branch 'v1.1.6' of https://github.com/irui-wang/linux_fw_vpu_v1.1.6 into main
d8c9865 Merge branch 'master' of https://github.com/sampnimm/linux-firmware-BT into main
63ab3db linux-firmware: add firmware for Lontium LT9611UXC DSI to HDMI bridge
0fe0fe0 mediatek: update MT8173 VPU firmware to v1.1.6
1a08ec9 QCA : Updated firmware files for WCN3991
7455a36 Merge branch 'guc_v49' of git://anongit.freedesktop.org/drm/drm-firmware into main
7eb7fda linux-firmware: Update firmware file for Intel Bluetooth AX210
5cbf459 linux-firmware: Update firmware file for Intel Bluetooth AX210
c487f7d i915: Add GuC firmware v49.0.1 for all platforms
d9ffb07 i915: Remove duplicate KBL DMC entry
b362fd4 Mellanox: Add new mlxsw_spectrum firmware xx.2008.2018
bc9cd0b linux-firmware: Update AMD SEV firmware
54c797a amdgpu: add sienna cichlid firmware for 20.45
1340e9c amdgpu: update vega20 firmware for 20.45
b260c9c amdgpu: update vega12 firmware for 20.45
d683bd5 amdgpu: update vega10 firmware for 20.45
7c81cc2 amdgpu: update renoir firmware for 20.45
3619e57 amdgpu: update navi14 firmware for 20.45
68ce0fb amdgpu: update navi12 firmware for 20.45
e889b80 amdgpu: update navi10 firmware for 20.45
f4edc15 amdgpu: update raven2 firmware for 20.45
e71210f amdgpu: update raven firmware for 20.45

[1] https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/?id=0f0aefd733f70beae4c0246edbd2c158d5ce974c

[2] eeda8652f1/package/firmware/cypress-firmware/Makefile (L124)

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
(cherry picked from commit ff2bb16730)
(removed sinovoip_bananapi-m2-berry)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2021-12-29 23:45:37 +01:00
Klaus Kudielka 5e2a2b086c mvebu: Turris Omnia: use SFP module, if present
Follow the recommendations stated in the Turris Omnia DTS for eth2:

"In case SFP module is present, U-Boot has to enable the sfp node above,
remove phy-handle property, and add managed = "in-band-status" property."

The boot script is written in a way, that it works for all U-Boot
versions deployed by the vendor so far (2015.10-rc2, 2019.07).

Reviewed-by: Noci <noci@noci.work>
Reviewed-by: Justin van Steijn <jvs@fsfe.org>
Reviewed-by: Nico Rikken <nico@nicorikken.eu>
Reviewed-by: Julius Schwartzenberg <julius.schwartzenberg@gmail.com>
Signed-off-by: Klaus Kudielka <klaus.kudielka@gmail.com>
(cherry picked from commit 23d2690e5a5410576b587bc96e2c2cf5fc693927)
2021-12-29 21:18:52 +01:00
Klaus Kudielka 24e564d327 mvebu: backport Turris Omnia DTS changes to 5.4
Kernel 5.4 receives a reduced set, just to make the SFP cage work.
While we are at it, move the patches accepted upstream to the 0xx series.

Reviewed-by: Noci <noci@noci.work>
Reviewed-by: Justin van Steijn <jvs@fsfe.org>
Reviewed-by: Nico Rikken <nico@nicorikken.eu>
Reviewed-by: Julius Schwartzenberg <julius.schwartzenberg@gmail.com>
Signed-off-by: Klaus Kudielka <klaus.kudielka@gmail.com>
(cherry picked from commit 8138cb8737d1475e6e8d57393500f30384e75a82)
2021-12-29 21:18:52 +01:00
Hauke Mehrtens 32c74552b2 kernel: bump 5.4 to 5.4.168
All updated automatically.

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

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-12-28 19:09:17 +01:00
Christian Lamparter a8ad881b83 apm821xx: fix WD MyBook Live DUO USB-Port
where to begin? the USB regulator settings were just
a part of the issue. With them changed, according to
the forum it still failed when a USB device was
connected to the port with:

dwc2 4bff80000.usbotg: dwc2_restore_global_registers: no global registers to restore
dwc2 4bff80000.usbotg: dwc2_exit_partial_power_down: failed to restore registers
dwc2 4bff80000.usbotg: exit partial_power_down failed
dwc2 4bff80000.usbotg: HC died; cleaning up

One clue was found upstream in
commit cc10ce0c51b1 ("usb: dwc2: disable power_down on Amlogic devices")

|Disable power_down by setting the parameter to
|DWC2_POWER_DOWN_PARAM_NONE. This fixes a problem on various Amlogic
|Meson SoCs where USB devices are only recognized when plugged in before
|booting Linux. A hot-plugged USB device was not detected even though the
|device got power (my USB thumb drive for example has an LED which lit
|up).
|[...]

the same method proposed there worked with APM821xx's USB IP-Core.

Link: https://forum.openwrt.org/t/wd-my-book-duo-usb/111926/2
Reported-by: thwe and takimata (openwrt forum)
Fixes: b70d3557e0 ("apm821xx: clean up gpio-hogs")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(cherry picked from commit 832b9cbd74)
2021-12-27 13:55:24 +01:00
Felix Fietkau 5414aa88ae kernel: backport the upstream implementation of threaded NAPI to 5.4
The workqueue based implementation has a few corner cases and typically lower
performance than the upstream one

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit 01bebc070c)
2021-12-21 12:56:22 +01:00
Rafał Miłecki 5a8faa407a bcm53xx: sysupgrade: fix support for Luxul's legacy firmware format
Fixes: c808c55b39 ("bcm53xx: sysupgrade: refactor handling different firmware formats")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 3bcf3e8143)
2021-12-13 18:21:25 +01:00
Rafał Miłecki 052619a71b bcm4908: build chk image for Netgear RAXE500
Fixes: 63ba3eaccd ("bcm4908: start working on Netgear RAXE500 image")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 0e8a5acf6e)
2021-12-13 14:46:31 +01:00
Rafał Miłecki d5f9c6729f bcm4908: start working on Netgear RAXE500 image
bootfs still needs more work before it's ready.

For some unknown reason model RAXE500 uses board id RAX220.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 63ba3eaccd)
2021-12-13 14:46:31 +01:00
Rafał Miłecki 76ccf10c59 bcm4908: enable MTD_CMDLINE_PARTS
It's needed to support devices with U-Boot. That bootloader passes MTD
layout using cmdline.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 21d28adbc1)
2021-12-13 14:46:31 +01:00
Rafał Miłecki 97b76de576 bcm4908: continue work on images for U-Boot based devices
It still isn't ready though - more data needs to be added to the bootfs.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 494c033f9c)
2021-12-13 14:46:31 +01:00
Rafał Miłecki 1da38bb4db bcm4908: backport upstream DT commits
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit d745835ae1)
2021-12-13 14:46:31 +01:00
Rafał Miłecki 570c26f664 bcm4908: add watchdog support
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 9565bd9bd6)
2021-12-13 14:46:31 +01:00
Rafał Miłecki 027dd3c50b bcm4908: start work on images for devices using U-Boot
New BCM4908 family based routers will use U-Boot bootloader. That will
require using a totally different firmware format. Kernel has to be put
in a FIT image.

OpenWrt has some helpers for generating .its files but they don't fit
BCM4908 requirements and there is no simple way of extending any of
them. The best solution seems to be storing an .its template.

BCM4908 bootfs may:
1. contain extra binaries (other than kernel & DTB)
2. include multiple DTB files
3. store device specific U-Boot configurations with custom properties

Such setups are too complex to generate using shell script. Raw .its
file on the other hand seems quire clean & reasonable.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit a02c971dff)
2021-12-13 14:33:07 +01:00
Rafał Miłecki c808c55b39 bcm53xx: sysupgrade: refactor handling different firmware formats
List of supported formats grew over time and implementation got a bit
messy. There are multiple functions with format-specific parameters and
commands.

Refactor it by making platform_identify() setup all required info right
after detecting firmware format. This simplifies formats handling in
platform_other_check_image() and platform_do_upgrade() a lot.

This has been tested on:
1. SmartRG SR400ac (TRX): non-NAND sysupgrade
2. Netgear R8000 (CHK): NAND aware and standard sysupgrade-s
3. D-Link DIR-885L (Seama): NAND aware and standard sysupgrade-s
4. Luxul XWR-3150 (LXL): NAND aware and standard sysupgrade-s

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 80041dea70)
2021-12-13 14:01:14 +01:00
Rafał Miłecki 29f73a7968 bcm53xx: sysupgrade: simplify extracting image from Seama seal
Use "oseama extract" which supports now writing to stdout.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit e7bd6cce4c)
2021-12-13 14:01:14 +01:00
Rafał Miłecki 0ebf62e7f4 bcm53xx: enable Linksys EA6300 & EA9200 builds
Both should be supported since:
1. Adding NVMEM driver for NVRAM
2. Using NVRAM info for determining active firmware partition

Linksys EA9500 uses very similar design and works fine.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 287257d676)
2021-12-13 14:01:14 +01:00
Rafał Miłecki 67978e4ce5 bcm53xx: backport the latest upstream DT changes
This includes:
1. BCM5301X changes from 5.14 and queued 5.15 stuff
2. NSP changes from 5.11 - 5.15 for kernel 5.10

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit bce00f47e5)
2021-12-13 14:01:14 +01:00
Rafał Miłecki 6f9e9d978a bcm53xx: fix Luxul XWR-3150 LAN ports numbering
Port numbers were reverted.

Fixes: c459a6bf48 ("bcm53xx: add support for Luxul FullMAC WiFi devices")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 53546c3e94)
2021-12-13 14:01:14 +01:00
Hauke Mehrtens 14940aee45 kernel: bump 5.4 to 5.4.163
Removed upstreamed:
 target/linux/mvebu/patches-5.4/001-PCI-aardvark-Wait-for-endpoint-to-be-ready-before-tr.patch
 target/linux/mvebu/patches-5.4/016-PCI-aardvark-Train-link-immediately-after-enabling-t.patch
 target/linux/mvebu/patches-5.4/017-PCI-aardvark-Improve-link-training.patch
 target/linux/mvebu/patches-5.4/018-PCI-aardvark-Issue-PERST-via-GPIO.patch
 target/linux/mvebu/patches-5.4/020-arm64-dts-marvell-armada-37xx-Set-pcie_reset_pin-to-.patch

The following patch does not apply to upstream any more and needs some
more work to make it work fully again. I am not sure if we are still
able to set the UART to a none standard baud rate.
 target/linux/ath79/patches-5.4/921-serial-core-add-support-for-boot-console-with-arbitr.patch

These patches needed manually changes:
  target/linux/generic/pending-5.4/110-ehci_hcd_ignore_oc.patch
  target/linux/ipq806x/patches-5.4/0065-arm-override-compiler-flags.patch
  target/linux/layerscape/patches-5.4/804-crypto-0016-MLKU-114-1-crypto-caam-reduce-page-0-regs-access-to-.patch
  target/linux/mvebu/patches-5.4/019-PCI-aardvark-Add-PHY-support.patch
  target/linux/octeontx/patches-5.4/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch

All others updated automatically.

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

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-12-12 20:08:17 +01:00
Evgeniy Isaev 06547e0a58 ath79: add support for Xiaomi AIoT Router AC2350
Device specifications
* SoC: QCA9563 @ 775MHz (MIPS 74Kc)
* RAM: 128MiB DDR2
* Flash: 16MiB SPI-NOR (EN25QH128)
* Wireless 2.4GHz (SoC): b/g/n, 3x3
* Wireless 5Ghz (QCA9988): a/n/ac, 4x4 MU-MIMO
* IoT Wireless 2.4GHz (QCA6006): currently unusable
* Ethernet (AR8327): 3 LAN × 1GbE, 1 WAN × 1GbE
* LEDs: Internet (blue/orange), System (blue/orange)
* Buttons: Reset
* UART: through-hole on PCB ([VCC 3.3v](RX)(GND)(TX) 115200, 8n1)
* Power: 12VDC, 1,5A

MAC addresses map (like in OEM firmware)
  art@0x0     88:C3:97:*:57  wan/label
  art@0x1002  88:C3:97:*:2D  lan/wlan2g
  art@0x5006  88:C3:97:*:2C  wlan5g

Obtain SSH Access
1. Download and flash the firmware version 1.3.8 (China).
2. Login to the router web interface and get the value of `stok=` from the
   URL
3. Open a new tab and go to the following URL (replace <STOK> with the stok
   value gained above; line breaks are only for easier handling, please put
   together all four lines into a single URL without any spaces):
     http://192.168.31.1/cgi-bin/luci/;stok=<STOK>/api/misystem/set_config_iotdev
       ?bssid=any&user_id=any&ssid=-h%0Anvram%20set%20ssh_en%3D1%0Anvram%20commit
       %0Ased%20-i%20%27s%2Fchannel%3D.%2A%2Fchannel%3D%5C%5C%22debug%5C%5C%22%2F
       g%27%20%2Fetc%2Finit.d%2Fdropbear%0A%2Fetc%2Finit.d%2Fdropbear%20start%0A
4. Wait 30-60 seconds (this is the time required to generate keys for the
   SSH server on the router).

Create Full Backup
1. Obtain SSH Access.
2. Create backup of all flash (on router):
    dd if=/dev/mtd0 of=/tmp/ALL.backup
3. Copy backup to PC (on PC):
    scp root@192.168.31.1:/tmp/ALL.backup ./
Tip: backup of the original firmware, taken three times, increases the
chances of recovery :)

Calculate The Password
* Locally using shell (replace "12345/E0QM98765" with your router's serial
  number):
  On Linux
    printf "%s6d2df50a-250f-4a30-a5e6-d44fb0960aa0" "12345/E0QM98765" | \
    md5sum - | head -c8 && echo
  On macOS
    printf "%s6d2df50a-250f-4a30-a5e6-d44fb0960aa0" "12345/E0QM98765" | \
    md5 | head -c8
* Locally using python script (replace "12345/E0QM98765" with your
  router's serial number):
    wget https://raw.githubusercontent.com/eisaev/ax3600-files/master/scripts/calc_passwd.py
    python3.7 -c 'from calc_passwd import calc_passwd; print(calc_passwd("12345/E0QM98765"))'
* Online
    https://www.oxygen7.cn/miwifi/

Debricking (lite)
If you have a healthy bootloader, you can use recovery via TFTP using
programs like TinyPXE on Windows or dnsmasq on Linux. To switch the router
to TFTP recovery mode, hold down the reset button, connect the power
supply, and release the button after about 10 seconds. The router must be
connected directly to the PC via the LAN port.

Debricking
You will need a full dump of your flash, a CH341 programmer, and a clip
for in-circuit programming.

Install OpenWRT
1. Obtain SSH Access.
2. Create script (on router):
    echo '#!/bin/sh' > /tmp/flash_fw.sh
    echo >> /tmp/flash_fw.sh
    echo '. /bin/boardupgrade.sh' >> /tmp/flash_fw.sh
    echo >> /tmp/flash_fw.sh
    echo 'board_prepare_upgrade' >> /tmp/flash_fw.sh
    echo 'mtd erase rootfs_data' >> /tmp/flash_fw.sh
    echo 'mtd write /tmp/openwrt.bin firmware' >> /tmp/flash_fw.sh
    echo 'sleep 3' >> /tmp/flash_fw.sh
    echo 'reboot' >> /tmp/flash_fw.sh
    echo >> /tmp/flash_fw.sh
    chmod +x /tmp/flash_fw.sh
3. Copy `openwrt-ath79-generic-xiaomi_aiot-ac2350-squashfs-sysupgrade.bin`
   to the router (on PC):
    scp openwrt-ath79-generic-xiaomi_aiot-ac2350-squashfs-sysupgrade.bin \
    root@192.168.31.1:/tmp/openwrt.bin
4. Flash OpenWRT (on router):
    /bin/ash /tmp/flash_fw.sh &
5. SSH connection will be interrupted - this is normal.
6. Wait for the indicator to turn blue.

Signed-off-by: Evgeniy Isaev <isaev.evgeniy@gmail.com>
[improve commit message formatting slightly]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 6c148116f7)
2021-12-12 15:41:15 +01:00
Sergey V. Lobanov c67509efd7 ramips: fix tl-mr3020-v3 switch topology to configure vlans via luci
Currently it is not possible to configure VLANs via LUCI on
tplink tl-mr3020-v3. This patch fixes switch topology for the
LUCI interface.

Signed-off-by: Sergey V. Lobanov <sergey@lobanov.in>
[copied commit message from github PR]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(cherry picked from commit e22c91e144)
2021-12-05 13:54:20 +01:00
Mathias Kresin 4172a8e0ad lantiq: set maximum kernel size for P2812HNUF3
The board has a fixed size kernel partition but do not limit the kernel
size during image building.

Disable image building for both boards as well, since the kernel of the
last release as well as master are to big to fit into the 2 MByte kernel
partition.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2021-11-27 23:00:31 +01:00
Hauke Mehrtens 0b7311300b kernel: bump 5.4 to 5.4.158
Removed upstreamed:
  generic/backport-5.4/790-v5.7-net-switchdev-do-not-propagate-bridge-updates-across.patch

All others updated automatically.

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

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-11-07 01:10:53 +01:00
Sungbo Eo 4607f55439 bcm4908: fix calculation of new cferam index
The arithmetic expansion fails when idx becomes a two digit number.
Fix this by relying on expr command.

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

Fixes: a6a0b252ba ("bcm4908: add sysupgrade support")
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
(cherry picked from commit f432353850)
2021-11-05 14:13:46 +01:00
Bruno Randolf b4c40a7efc
ramips: minew g1-c: Allow dynamic RAM sizes
Allow RAM size to be passed thru U-Boot. There are 128MB and 64MB
versions of Minew G1-C. This is also in line with the behaviour of
most other RAMIPS boards.

Signed-off-by: Bruno Randolf <br1@einfach.org>
2021-11-01 15:35:25 +01:00
David Bauer 88151b8303 ipq40xx: ar40xx: reset port status register
This resolves incosnsitencies of the configured RX / TX flow control
modes between different boards or bootloaders.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 4d81f08771)
2021-10-24 11:01:35 +02:00
Roger Pueyo Centelles 23cd9fafa8 ath79: mikrotik: use 64 KiB SPI NOR erase sectors
This patch removes CONFIG_MTD_SPI_NOR_USE_4K_SECTORS from the default
symbols for the ath79/mikrotik target.

MikroTik devices hold some of their user-configurable settings in the
soft_config partition, which is typically sized 4 KiB, of the SPI NOR
flash memory. Previously, in the ar71xx target, it was possible to use
64 KiB erase sectors but also smaller 4 KiB ones when needed. This is
no longer the case in ath79 with newer kernels so, to be able to write
to these 4 KiB small partitions without erasing 60 KiB around, the
CONFIG_MTD_SPI_NOR_USE_4K_SECTORS symbol was added to the defaults.
However, this ended up making sysupgrade images which were built with
64 KiB size blocks not to keep settings (e.g., the files under
/etc/config/) over the flashing process.

Using 4 KiB erase sector size on the sysupgrade images (by setting
BLOCKSIZE = 4k) allows keeping settings over a flashing process, but
renders the process terribly slow, possibly causing a user to
mistakenly force a manual device reboot while the process is still on-
going. Instead, ditching the 4 KiB erase sectors for the default
64 KiB erase size provides normal SPI write speed and sysupgrade times,
at the expense of not being able to modify the soft_config partition
(which is rarely a required thing).

An OpenWrt patch for MTD_SPI_NOR_USE_4K_SECTORS_LIMIT may once have
allowed to use different per-partition erase sector sizes. Due to
changes on recent kernels it now only works on a per-device basis.
Also, partial eraseblock write can be performed in ath79 with kernels
5.4 and lower, by copying the blocks from the 64 KiB, erasing the whole
sector and restoring those blocks not meant to be modified. A kernel
bump had that patch broken for a long time, but got fixed in bf2870c.

Note: the settings in the soft_config partition can be reset to their
defaults by holding the reset button for 5 seconds (and less than 10
seconds) at device boot.

Fixes: FS#3492 (sysupgrade […] loses settings...)
Fixes: a66eee6336 (ath79: add mikrotik subtarget)

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
(cherry picked from commit 68d91f08ed)
2021-10-22 16:34:11 -10:00
Hauke Mehrtens 24b23ed96a layerscape: Add missing config option
This option is not set when building the target.
In master this is also unset.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-10-22 22:26:02 +02:00
Hauke Mehrtens 7bf7f78891 layerscape: Fix build in dtb
This fixes a kernel build problem.
The removed parts of the patch are already applied upstream.

Fixes: b4ed8a9275 ("kernel: bump 5.4 to 5.4.154")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 9501ce909f)
2021-10-22 22:25:41 +02:00
Hauke Mehrtens b4ed8a9275 kernel: bump 5.4 to 5.4.154
Removed upstreamed:
  generic/backport-5.4/070-v5.5-MIPS-BPF-Restore-MIPS32-cBPF-JIT.patch

All others updated automatically.

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

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-10-20 00:37:51 +02:00
Ian Chang c43a5921fa mvebu: add support for iEi Puzzle-M901/Puzzle-M902
Hardware specification
 ----------------------
 * CN9130 SoC, Quad-core ARMv8 Cortex-72 @ 2200 MHz
 * 4 GB DDR
 * 4 GB eMMC
 * mmcblk0
 - mmcblk0p1    64M  kernel_1
 - mmcblk0p2    64M  kernel_2
 - mmcblk0p3   512M  rootfs_1
 - mmcblk0p4   512M  rootfs_2
 - mmcblk0p5   512M  Reserved
 - mmcblk0p6    64M  Reserved
 - mmcblk0p7   1.8G  rootfs_data

 * 4 MB (SPI Flash)
 * 6 x 2.5 Gigabit  ports (Puzzle-M901)
 - External PHY with 6 ports (AQR112R)

 * 6 x 2.5 Gigabit ports (Puzzle-M902)
 - External PHY with 6 ports (AQR112R)
   3 x 10 Gigabit ports (Puzzle-M902)
 - External PHY with 3 ports (AQR113R)

 * 4 x Front panel LED
 * 1 x USB 3.0
 * Reset button on Rear panel
 * UART (115200 8N1,header on PCB)

 Flash instructions:
    The original firmware is based on OpenWrt.
    Flash firmware using LuCI and CLI

Signed-off-by: Ian Chang <ianchang@ieiworld.com>
(cherry picked from commit 70c75965a9)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-10-14 13:09:57 +01:00
Ian Chang bb1eb5e8e6 mvebu: backport CN9130 dts necessary files changes to 5.4
1. Add support for Marvell CN9130 SoC
 2. Add support for CP115,and create an armada-cp11x.dtsi file which will be used to instantiate both CP110 and CP115
 3. Add support for AP807/AP807-quad,AP807 is a major component of CN9130 SoC series
 4. Drop PCIe I/O ranges from CP11x file and externalize PCIe macros from CP11x file

Signed-off-by: Ian Chang <ianchang@ieiworld.com>
(cherry picked from commit c98ddf0f01)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2021-10-14 13:09:57 +01:00
David Bauer e7c5e08db0 kernel: ar8216: add get_features method
Modifying PHY capabilities in the probe function broke with upstream
commit 92ed2eb7f4b7 ("net: phy: probe the PHY before determining the
supported features").

AR8316 switches only support 10/100 Mbit/s link modes because of this
change.

Provide a get_features method for the PHY driver, so Gigabit link mode
will be advertised to link partners again.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 766e0f584a)
2021-10-12 11:38:20 +02:00
Hauke Mehrtens 8cc7ac54b6 kernel: bump 5.4 to 5.4.150
Manually rebased:
  generic/backport-5.4/370-netfilter-nf_flow_table-fix-offloaded-connection-tim.patch
  generic/pending-5.4/800-bcma-get-SoC-device-struct-copy-its-DMA-params-to-th.patch
  mvebu/patches-5.4/021-arm64-dts-marvell-armada-37xx-Move-PCIe-comphy-handl.patch

Removed upstreamed:
  generic/backport-5.4/040-ARM-8918-2-only-build-return_address-if-needed.patch
  layerscape/patches-5.4/819-uart-0004-MLK-18137-fsl_lpuart-Fix-loopback-mode.patch

All others updated automatically.

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

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-10-02 16:05:34 +02:00