openwrt/openwrt.git
19 months agoipq40xx: ZTE MF286D: fix DEVICE_PACKAGES
Lech Perczak [Sun, 13 Nov 2022 12:02:36 +0000 (13:02 +0100)]
ipq40xx: ZTE MF286D: fix DEVICE_PACKAGES

Backporting ZTE MF289F introduced an override of DEVICE_PACKAGES for
MF286D, which removed packages needed for built-in modem support.
Fix assignment type to restore those.

Fixes: 3e15a54bb0ef ("ipq40xx: Add ZTE MF289F")
Reported-by: Cezary Jackiewicz <cezary@eko.one.pl>
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
19 months agogeneric: fix unset symbol
David Bauer [Sat, 12 Nov 2022 11:32:31 +0000 (12:32 +0100)]
generic: fix unset symbol

Signed-off-by: David Bauer <mail@david-bauer.net>
19 months agokernel: bump 5.10 to 5.10.154
John Audia [Thu, 10 Nov 2022 20:42:42 +0000 (15:42 -0500)]
kernel: bump 5.10 to 5.10.154

All patches automatically rebased.

Compile-tested: x86/64
Run-tested: x86/64

Signed-off-by: John Audia <therealgraysky@proton.me>
(cherry picked from commit e7bd3767a96a8a84be7ea4730798a7a08dbb20d0)

19 months agokernel: bump 5.10 to 5.10.153
John Audia [Thu, 3 Nov 2022 16:54:01 +0000 (12:54 -0400)]
kernel: bump 5.10 to 5.10.153

Manually rebased:
  bcm27xx/patches-5.10/950-0355-xhci-quirks-add-link-TRB-quirk-for-VL805.patch
  bcm53xx/patches-5.10/180-usb-xhci-add-support-for-performing-fake-doorbell.patch
  lantiq/patches-5.10/0028-NET-lantiq-various-etop-fixes.patch

All patches automatically rebased.

Signed-off-by: John Audia <therealgraysky@proton.me>
(cherry picked from commit 87edb650c74a73d854bc01c0aed46d38dafb09a0)

19 months agoramips: improve compatibility for Youku YK-L2 and YK-L1 series
Shiji Yang [Sat, 5 Nov 2022 11:52:08 +0000 (19:52 +0800)]
ramips: improve compatibility for Youku YK-L2 and YK-L1 series

Add UIMAGE_NAME and UIMAGE_MAGIC to allow users to directly install
initramfs-kernel.bin from the stock firmware Web UI. At the same time,
this change makes it possible to boot OpenWrt with the official u-boot.

Notice:
Since the stock firmware is based on OpenWrt and the configuration
will be retained by default during the upgrade process, so we must use
initramfs-kernel.bin to do a initial installation. After the system
restarts, install sysupgrade.bin and do not retain any configuration.

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

19 months agoramips: gl-mt1300: downclock SPI to 50MHz
Michael Lyle [Sun, 30 Oct 2022 04:00:41 +0000 (21:00 -0700)]
ramips: gl-mt1300: downclock SPI to 50MHz

The SPI max frequency was set to 80MHz, considerably higher than the
vendor clocks it in their firmware (10MHz).  Multiple users reported
jffs2 corruption/instability in GitHub issue #10461.

My unit has a W25Q256; datasheet specifies maximum SPI frequency for
read command of 50MHz.

Thanks to @DragonBlueP for suggesting to eliminate m25p,fast-read;
and @MPannen1979 for identifying the problem.

Fixes: #10461
Signed-off-by: Michael Lyle <mlyle@lyle.org>
(cherry picked from commit 961e01fc67e7d9e60557df3474fa326216aa4839)

19 months agoramips: mt7621: use seama-lzma-loader for D-Link DIR-860L B1
Szabolcs Hubai [Wed, 28 Sep 2022 00:55:01 +0000 (02:55 +0200)]
ramips: mt7621: use seama-lzma-loader for D-Link DIR-860L B1

Fix the LZMA ERROR 1 with a single line of recipe instead of duplicating
"uimage-lzma-loader".

While reviewing my original submission of commit ce1957100411 David
suggested to use $(Device/uimage-lzma-loader), but due to the specific
needs of the vendor bootloader that simple oneliner didn't work.

The new $(Device/seama-lzma-loader) is for those SEAMA capable
bootloaders.

Signed-off-by: Szabolcs Hubai <szab.hu@gmail.com>
(cherry picked from commit 18801f26485e3a0dcb79dc9f9b174aed5821b758)

19 months agoramips: rt3883: use seama-lzma-loader for D-Link DIR-645
Szabolcs Hubai [Tue, 27 Sep 2022 22:54:36 +0000 (00:54 +0200)]
ramips: rt3883: use seama-lzma-loader for D-Link DIR-645

In the support topic [0] of the GitHub issue #10634 it was found out
(based on boot logs) that the uimage-lzma-loader (commit 09faa73c53bd)
never worked, as an earlier workaround (commit 6fba88de1913) negated
the recipe:

    3: System Boot system code via Flash.
    ## Booting image at bc050000 ...
    raspi_read: from:50000 len:40
    .raspi_read: from:50000 len:c
    .raspi_read: from:50000 len:1fa000
    ................................We have SEAMA, Image Size = 2072512
    Verifying Checksum ...
    Uncompressing SEAMA linux.lzma ... OK
    ## Transferring control to Linux (at address 80000000) ...
    ## Giving linux memsize in MB, 64

    Starting kernel ...

    [    0.000000] Linux version 5.4.188 (builder@buildhost) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r16554-1d4dea6d4f)) #0 Sat Apr 16 12:59:34 2022
    [    0.000000] SoC Type: Ralink RT3883 ver:1 eco:5
    [    0.000000] printk: bootconsolde [early0] enabled
    [    0.000000] CPU0 revision is: 0001974c (MIPS 74Kc)
    [    0.000000] MIPS: machine is D-Link DIR-645
    [    0.000000] Initrd not found or empty - disabling initrd

Using the new seama-lzma-loader it's able to boot OpenWrt 22.03
and OpenWrt SNAPSHOT too:

    3: System Boot system code via Flash.
    ## Booting image at bc050000 ...
    raspi_read: from:50000 len:40
    .raspi_read: from:50000 len:c
    .raspi_read: from:50000 len:48b004
    .........................................................................We have SEAMA, Image Size = 4763588
    Verifying Checksum ...
    Uncompressing SEAMA linux.lzma ... OK
    ## Transferring control to Linux (at address 80000000) ...
    ## Giving linux memsize in MB, 64

    Starting kernel ...

    OpenWrt kernel loader for MIPS based SoC
    Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org>
    Decompressing kernel... done!
    Starting kernel at 80000000...

    [    0.000000] Linux version 5.10.144 (xabolcs@ut2004) (mipsel-openwrt-linux-musl-gcc (OpenWrt GCC 11.3.0 r20774+2-b71affaf8b) 11.3.0, GNU ld (GNU Binutils) 2.37) #0 Tue Sep 27 23:02:30 2022
    [    0.000000] SoC Type: Ralink RT3883 ver:1 eco:5
    [    0.000000] printk: bootconsole [early0] enabled
    [    0.000000] CPU0 revision is: 0001974c (MIPS 74Kc)
    [    0.000000] MIPS: machine is D-Link DIR-645
    [    0.000000] Initrd not found or empty - disabling initrd
    [    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
    [    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
    [    0.000000] Zone ranges:
    [    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
    [    0.000000] Movable zone start for each node
    [    0.000000] Early memory node ranges
    [    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
    [    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
    [    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
    [    0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2

The OKLI Loader is unable to read the flash on this SoC:

    Looking for OpenWrt image... not found! ('0xddbaddba' at 0xbc051000)

0: https://forum.openwrt.org/t/136435

Fixes: GitHub issue #10634 ("V22.03.0 release currently does not work on D-Link DIR-645")
Fixes: 09faa73c53bd ("ramips: rt3883: use lzma-loader for DIR-645")
Tested-by: Glenn Fowler <gfowler1@outlook.com>
Signed-off-by: Szabolcs Hubai <szab.hu@gmail.com>
(cherry picked from commit c293b492dfa114b67e90d5434edfeba17ba29980)

19 months agoramips: define lzma-loader recipe for SEAMA devices
Szabolcs Hubai [Mon, 26 Sep 2022 06:42:54 +0000 (08:42 +0200)]
ramips: define lzma-loader recipe for SEAMA devices

Define "Device/seama-lzma-loader" recipe for SEAMA devices to help
contributors avoid doing recipe mistakes.

In a forum topic [0] I was under the impression that the good old
uimage-lzma-loader didn't fix the LZMA ERROR 1 for a device.

It was found out, that the uimage-lzma-loader never worked because the
KERNEL variable was overriden earlier (also an LZMA ERROR 1 related
commit, 6fba88de1913), and the "use lzma-loader" fix (commit
09faa73c53bd) didn't catch that to include the "loader-kernel" part.

I contributed an LZMA ERROR 1 fix (commit ce1957100411) for the SEAMA
device D-Link DIR-860L B1, where I had to duplicate the whole
uimage-lzma-loader recipe because of the special needs of the vendor
bootloader.

This new recipe reuse most of uimage-lzma-loader's KERNEL definiton to
avoid duplication.

It uses "relocate-kernel" as it needed for D-Link DIR-860L B1 to
boot from flash, and it's compatible with D-Link DIR-645 too.

It repacks lzma-loader with lzma for kernel (without uImage), because
these weird hacked vendor bootloaders accepts only LZMA compressed
kernels from flash:

    We have SEAMA, Image Size = 4759794
    Verifying Checksum ...
    Uncompressing SEAMA linux.lzma ... OK

It uses uImage header for initramfs kernel to be little bit verbose.

0: https://forum.openwrt.org/t/136435/10

Signed-off-by: Szabolcs Hubai <szab.hu@gmail.com>
(cherry picked from commit e7ad68d682bdb73b7d13d6c4b8d1d65d9f050138)

19 months agoath79: fix MAC address assignment for TP-Link ar7241 devices
Will Moss [Wed, 3 Aug 2022 11:37:47 +0000 (11:37 +0000)]
ath79: fix MAC address assignment for TP-Link ar7241 devices

On TP-Link ar7241 devices LAN and WAN interfaces are swapped. Keeping
that in mind fix MAC address assignment as used in vendor firmware:
LAN MAC - main MAC stored in u-boot and printed on label
WAN MAC - LAN MAC + 1

Signed-off-by: Will Moss <willormos@gmail.com>
(cherry picked from commit 5a1af6ed621d4547d8bf486d0d3e4de5443b9b58)

19 months agotools/expat: update to 2.5.0
Alexander Couzens [Sat, 12 Nov 2022 18:44:40 +0000 (18:44 +0000)]
tools/expat: update to 2.5.0

Fixes CVE-2022-43680 CVE-2022-40674.
Switch to .xz archive to be closer to master.

Changes: https://github.com/libexpat/libexpat/blob/R_2_5_0/expat/Changes
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
19 months agoath79: add support for Linksys EA4500 v3
Edward Chow [Wed, 14 Sep 2022 00:15:58 +0000 (08:15 +0800)]
ath79: add support for Linksys EA4500 v3

Add support for the Linksys EA4500 v3 wireless router

Hardware
--------
SoC:    Qualcomm Atheros QCA9558
RAM:    128M DDR2 (Winbond W971GG6KB-25)
FLASH:  128M SPI-NAND (Spansion S34ML01G100TFI00)
WLAN:   QCA9558 3T3R 802.11 bgn
        QCA9580 3T3R 802.11 an
ETH:    Qualcomm Atheros QCA8337
UART:   115200 8n1, same as ea4500 v2
USB: 1 single USB 2.0 host port
BUTTON: Reset - WPS
LED:    1x system-LED
        LEDs besides the ethernet ports are controlled
        by the ethernet switch

MAC Address:
 use        address(sample 1)    source
 label      94:10:3e:xx:xx:6f   caldata@cal_macaddr
 lan        94:10:3e:xx:xx:6f   $label
 wan        94:10:3e:xx:xx:6f   $label
 WiFi4_2G   94:10:3e:xx:xx:70   caldata@cal_ath9k_soc
 WiFi4_5G   94:10:3e:xx:xx:71   caldata@cal_ath9k_pci

Installation from Serial Console
------------

1. Connect to the serial console. Power up the device and interrupt
   autoboot when prompted

2. Connect a TFTP server reachable at 192.168.1.0/24
   (e.g. 192.168.1.66) to the ethernet port. Serve the OpenWrt
   initramfs image as "openwrt.bin"

3. To test OpenWrt only, go to step 4 and never execute step 5;
   To install, auto_recovery should be disabled first, and boot_part
   should be set to 1 if its current value is not.

   ath> setenv auto_recovery no
   ath> setenv boot_part 1
   ath> saveenv

4. Boot the initramfs image using U-Boot

   ath> setenv serverip 192.168.1.66
   ath> tftpboot 0x84000000 openwrt.bin
   ath> bootm

5. Copy the OpenWrt sysupgrade image to the device using scp and
   install it like a normal upgrade (with no need to keeping config
   since no config from "previous OpenWRT installation" could be kept
   at all)

   # sysupgrade -n /path/to/openwrt/sysupgrade.bin

Note: Like many other routers produced by Linksys, it has a dual
      firmware flash layout, but because I do not know how to handle
      it, I decide to disable it for more usable space. (That is why
      the "auto_recovery" above should be disabled before installing
      OpenWRT.) If someone is interested in generating factory
      firmware image capable to flash from stock firmware, as well as
      restoring the dual firmware layout, commented-out layout for the
      original secondary partitions left in the device tree may be a
      useful hint.

Installation from Web Interface
------------

1. Login to the router via its web interface (default password: admin)

2. Find the firmware update interface under "Connectivity/Basic"

3. Choose the OpenWrt factory image and click "Start"

4. If the router still boots into the stock firmware, it means that
   the OpenWrt factory image has been installed to the secondary
   partitions and failed to boot (since OpenWrt on EA4500 v3 does not
   support dual boot yet), and the router switched back to the stock
   firmware on the primary partitions. You have to install a stock
   firmware (e.g. 3.1.6.172023, downloadable from
   https://www.linksys.com/support-article?articleNum=148385 ) first
   (to the secondary partitions) , and after that, install OpenWrt
   factory image (to the primary partitions). After successful
   installation of OpenWrt, auto_recovery will be automatically
   disabled and router will only boot from the primary partitions.

Signed-off-by: Edward Chow <equu@openmail.cc>
(cherry picked from commit 50f727b7737d118f7d44986181e305af0624c41d)

19 months agoath79: add support to TrendNet TEW-673GRU
Korey Caro [Sun, 13 Mar 2022 04:36:30 +0000 (23:36 -0500)]
ath79: add support to TrendNet TEW-673GRU

Add support for the TrendNet TEW-673GRU to ath79.
This device was supported in 19.07.9 but was deprecated with ar71xx.
This is mostly a copy of D-Link DIR-825 B1.
Updates have been completed to enable factory.bin and sysupgrade.bin both.
Code improvements to DTS file and makefile.

Architecture   |  MIPS
Vendor         |  Qualcomm Atheros
bootloader     |  U-Boot
System-On-Chip |  AR7161 rev 2 (MIPS 24Kc V7.4)
CPU/Speed      |  24Kc V7.4 680 MHz
Flash-Chip     |  Macronix MX25L6405D
Flash size     |  8192 KiB
RAM Chip:      |  ProMOS V58C2256164SCI5 × 2
RAM size       |  64 MiB
Wireless       |  2 x Atheros AR922X 2.4GHz/5.0GHz 802.11abgn
Ethernet       |  RealTek RTL8366S Gigabit w/ port based vlan support
USB            |  Yes 2 x 2.0

Initial Flashing Process:
1) Download 22.03 tew-673gru factory bin
2) Flash 22.03 using TrendNet GUI

OpenWRT Upgrade Process
3) Download 22.03 tew-673gru sysupgrade.bin
4) Flash 22.03 using OpenWRT GUI

Signed-off-by: Korey Caro <korey.caro@gmail.com>
(cherry picked from commit 12cee869890853716ff1ee2dbd0a89c87a0ee544)

19 months agoqoriq: fix typo in FEATURES
Stijn Tintel [Wed, 5 Oct 2022 11:05:55 +0000 (14:05 +0300)]
qoriq: fix typo in FEATURES

There is no root-part FEATURE.

Reported-by: Karl Palsson <karlp@etactica.com>
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
(cherry picked from commit dc51342d34c267d6dc8c69d72979cab394f49d4b)

19 months agomac80211: fix mesh airtime link metric estimation
Felix Fietkau [Thu, 10 Nov 2022 13:46:21 +0000 (14:46 +0100)]
mac80211: fix mesh airtime link metric estimation

fix reading the per-packet rate on devices with firmware rate control

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

19 months agomac80211: fix issues with receiving small STP packets
Felix Fietkau [Fri, 7 Oct 2022 09:29:54 +0000 (11:29 +0200)]
mac80211: fix issues with receiving small STP packets

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

19 months agomac80211: fix decap offload for stations on AP_VLAN interfaces
Felix Fietkau [Wed, 28 Sep 2022 11:57:55 +0000 (13:57 +0200)]
mac80211: fix decap offload for stations on AP_VLAN interfaces

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

19 months agohostapd: remove invalid dtim_period option processing
Felix Fietkau [Thu, 10 Nov 2022 12:08:28 +0000 (13:08 +0100)]
hostapd: remove invalid dtim_period option processing

dtim_period is a bss property, not a device one.
It is already handled properly in mac80211.sh

Fixes: 30c64825c7ed ("hostapd: add dtim_period, local_pwr_constraint, spectrum_mgmt_required")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit ddf736e543d4a214f563dc008b6fb5ee5e0d1b66)

19 months agoramips: backport TP-Link RE200 v3/v4 LED fix
Sungbo Eo [Tue, 8 Nov 2022 12:31:02 +0000 (13:31 +0100)]
ramips: backport TP-Link RE200 v3/v4 LED fix

This backports a commit which fixes LEDs vor the RE200 like this:

Set power LED to gpio 43 instead of 44 for v3 and v4.
Set red wifi LED to gpio 40 (was assigned to `red:wifi5g`).

Tested by the author of the initial v3 and v4 commit.

Tested-by: Richard Fröhning <misanthropos@gmx.de>
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
Signed-off-by: Jan-Niklas Burfeind <git@aiyionpri.me>
(cherry picked from commit 02aa7a2bb9b6bdc8033d30c97f5b49534206a37c)

19 months agostrace: replace PKG_CPE_ID
Nick Hainke [Sat, 3 Sep 2022 15:51:24 +0000 (17:51 +0200)]
strace: replace PKG_CPE_ID

Searching for strace in nvd.nist.gov/products/cpe/search [0] will result
in "cpe:/a:strace_project:strace". Replace the current PKG_CPE_ID with
it.

[0] - https://nvd.nist.gov/products/cpe/search/results?namingFormat=2.2&keyword=strace

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 55c015ae4d115cf8ffb61ee2778d8355c224bd46)

19 months agostrace: update to 5.19
Nick Hainke [Tue, 23 Aug 2022 12:00:18 +0000 (14:00 +0200)]
strace: update to 5.19

Release Notes:
https://strace.io/files/5.19/

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 781a2e20085fff44fade871b0801468e4800af1a)

19 months agostrace: add nls.mk
Rosen Penev [Mon, 11 Jul 2022 01:00:59 +0000 (18:00 -0700)]
strace: add nls.mk

Needed when building with libdw and CONFIG_BUILD_NLS, mostly for the
rpath-link.

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

19 months agostrace: update to 5.18
Nick Hainke [Sat, 2 Jul 2022 16:53:07 +0000 (18:53 +0200)]
strace: update to 5.18

Improvements
- Added an interface of raising des Strausses awareness.
- Added --tips option to print strace tips, tricks, and tweaks at the end of the tracing session.
- Enhanced decoding of bpf and io_uring_register syscalls.
- Implemented decoding of COUNTER_*, RTC_PARAM_GET, and RTC_PARAM_SET ioctl commands.
- Updated lists of BPF_*, BR_*, BTRFS_*, IFA_*, IFLA_*, IORING_*, KEY_*, KVM_*, MADV_*, and UFFD_* constants.
- Updated lists of ioctl commands from Linux 5.18.

Bug fixes
- Fixed printing of the updated value of union bpf_attr.next_id on the exiting of bpf(BPF_*_GET_NEXT_ID) calls.

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 6d423ffbd17f5b00432f8f7a9fc7ea18d437d902)

19 months agostrace: update to 5.17
Nick Hainke [Sat, 2 Jul 2022 16:51:15 +0000 (18:51 +0200)]
strace: update to 5.17

Improvements
- Added 64-bit LoongArch architecture support.
- Extended personality designation syntax of syscall specification expressions to support all@pers and %class@pers.
- Enhanced rejection of invalid syscall numbers in syscall specification expressions.
- Implemented decoding of set_mempolicy_home_node syscall, introduced in Linux 5.17.
- Implemented decoding of IFLA_GRO_MAX_SIZE and TCA_ACT_IN_HW_COUNT netlink attributes.
- Implemented decoding of PR_SET_VMA operation of prctl syscall.
- Implemented decoding of siginfo_t.si_pkey field.
- Implemented decoding of LIRC ioctl commands.
- Updated lists of FAN_*, IORING_*, IOSQE_*, KEY_*, KVM_*, MODULE_INIT_*, TCA_ACT_*, and *_MAGIC constants.
- Updated lists of ioctl commands from Linux 5.17.

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit 36f3238dcb119f9e6b79e01d8f97776f67a7bfce)

19 months agokernel: netsupport: Add FQ-PIE as an optional sched kmod and extract PIE
Kabuli Chana [Sun, 7 Aug 2022 23:05:51 +0000 (17:05 -0600)]
kernel: netsupport: Add FQ-PIE as an optional sched kmod and extract PIE

add Flow Queuing with Proportional Integral controller Enhanced (FQ-PIE) as an
optional kmod in network support and extract sched-pie from kmod-sched to
allow dependency on just kmod-sched-pie (PIE).

Signed-off-by: Kabuli Chana <newtownBuild@gmail.com>
(cherry picked from commit c3e4a0d99b972b91dd65f535365b9b71fcb541ae)

19 months agokernel: extract kmod-sched-act-ipt from kmod-sched
Stijn Tintel [Thu, 21 Jul 2022 16:26:56 +0000 (18:26 +0200)]
kernel: extract kmod-sched-act-ipt from kmod-sched

There is only one module in kmod-sched that depends on iptables. Move it
to its own kmod package so we can drop the kmod-ipt-core dependency from
kmod-sched. This makes it possible to disable all kmod-ipt-* packages
without having to disable kmod-sched. Since we now default to firewall4
and nftables, we should avoid iptables dependencies where we can.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
(cherry picked from commit 05775e38a52007397e5460bd87fa1ac957feb2af)

19 months agokernel: netsupport: Extract act_police
Hauke Mehrtens [Thu, 4 Aug 2022 16:44:51 +0000 (18:44 +0200)]
kernel: netsupport: Extract act_police

This extracts kmod-sched-act-police to allow using it without adding all
the packages from the big kmod-sched package.

Signed-off-by: Hauke Mehrtens <hmehrtens@maxlinear.com>
(cherry picked from commit 0582acf42967e47c16eb3193f91ca65b01b57e8e)

19 months agokernel: netsupport: Add kmod-sched-act-sample
Thomas Langer [Fri, 29 Jul 2022 16:36:01 +0000 (18:36 +0200)]
kernel: netsupport: Add kmod-sched-act-sample

This adds the act_sample.ko and psample.ko kernel module which allows
traffic sampling.

Signed-off-by: Thomas Langer <tlanger@maxlinear.com>
Signed-off-by: Hauke Mehrtens <hmehrtens@maxlinear.com>
(cherry picked from commit aba1bdaed8cb612d4a4d9e8bba2dc963d6ceca76)

19 months agokernel: netsupport: Extract sched-prio and sched-red
Thomas Langer [Fri, 29 Jul 2022 16:36:00 +0000 (18:36 +0200)]
kernel: netsupport: Extract sched-prio and sched-red

Extract the kmod-sched-prio and kmod-sched-red kernel modules from the
big kmod-sched package. This allows adding the two kernel modules to
OpenWrt without adding the kmod-sched and all its depdnecy.

Signed-off-by: Thomas Langer <tlanger@maxlinear.com>
Signed-off-by: Hauke Mehrtens <hmehrtens@maxlinear.com>
(cherry picked from commit 0e3911b6084ac596a3da6b1a255776e44331beef)

19 months agokernel: netsupport: Add kmod-sched-drr
Hauke Mehrtens [Fri, 29 Jul 2022 16:35:59 +0000 (18:35 +0200)]
kernel: netsupport: Add kmod-sched-drr

This adds a package with the DRR scheduler.

Signed-off-by: Hauke Mehrtens <hmehrtens@maxlinear.com>
(cherry picked from commit fa85e44d3c4437327a0ad592831f1746b8b2dc3a)

19 months agokernel: netsupport: kmod-sched: Reorder packages
Hauke Mehrtens [Fri, 29 Jul 2022 16:35:58 +0000 (18:35 +0200)]
kernel: netsupport: kmod-sched: Reorder packages

This puts the kmod-sched packages into an alphabetical order.
I kept the kmod-sched-core at the top as this is the main package.
No changes other than reordering were done.

Signed-off-by: Hauke Mehrtens <hmehrtens@maxlinear.com>
(cherry picked from commit c94ba95e6cd41ccf8f15e77ebe7b7d65e5fd4396)

19 months agoipq40xx: fix ZTE MF289F port mapping
Lech Perczak [Sat, 15 Oct 2022 15:59:38 +0000 (17:59 +0200)]
ipq40xx: fix ZTE MF289F port mapping

With initial support, the mapping of LAN1/WAN and LAN2 ports was
swapped. Fix it to match labels on the device, keeping the "WAN"
personality of the first port - in line with current state of DSA setup
in master for this device.

Tested-by: Marcin Gajda <mgajda@o2.pl>
Tested-by: Christian Heuff <christian@heuff.at>
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
19 months agoipq40xx: Fix wrong GPIO for internal status LED on ZTE MF289F
Giammarco Marzano [Mon, 10 Oct 2022 10:15:19 +0000 (12:15 +0200)]
ipq40xx: Fix wrong GPIO for internal status LED on ZTE MF289F

Change GPIO from 10 to 35 to make it works as expected

Fixes: 0de6a3339f1a ("ipq40xx: Add ZTE MF289F")
Signed-off-by: Giammarco Marzano <stich86@gmail.com>
Reviewed-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit cd93980abb0c6452fd3e9c1213caaf26d221fcd4)

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
19 months agoipq40xx: Add ZTE MF289F
Giammarco Marzano [Wed, 14 Sep 2022 12:20:43 +0000 (14:20 +0200)]
ipq40xx: Add ZTE MF289F

It's a 4G Cat.20 router used by Vodafone Italy (called Vodafone FWA)
and Vodafone DE\T-Mobile PL (called GigaCube).

Modem is a MiniPCIe-to-USB based on Snapdragon X24,
it supports 4CA aggregation.

There are currently two hardware revisions, which
differ on the 5Ghz radio:

AT1 = QCA9984 5Ghz Radio on PCI-E bus
AT2 = IPQ4019 5Ghz Radio inside IPQ4019 like 2.4Ghz

Device specification
--------------------
SoC Type: Qualcomm IPQ4019
RAM: 256 MiB
Flash: 128 MiB SPI NAND (Winbond W25N01GV)
ROM: 2MiB SPI Flash (GD25Q16)
Wireless 2.4 GHz (IP4019): b/g/n, 2x2
Wireless 5 GHz:
(QCA9984): a/n/ac, 4x4 HW REV AT1
(IPA4019): a/n/ac, 2x2 HW REV AT2
Ethernet: 2xGbE (WAN/LAN1, LAN2)
USB ports: No
Button: 2 (Reset/WPS)
LEDs: 3 external leds: Network (white or red), Wifi, Power and 1 internal (blue)
Power: 12 VDC, 1 A
Connector type: Barrel
Bootloader: U-Boot

Installation
------------
1. Place OpenWrt initramfs image for the device on a TFTP
   in the server's root. This example uses Server IP: 192.168.0.2
2. Connect serial console (115200,8n1) to serial connector
   GND (which is right next to the thing with MF289F MIMO-V1.0), RX, TX
   (refer to this image: https://ibb.co/31Gngpr).
3. Connect TFTP server to RJ-45 port (WAN/LAN1).
4. Stop in u-Boot (using ESC button) and run u-Boot commands:

setenv serverip 192.168.0.2
setenv ipaddr 192.168.0.1
set fdt_high 0x85000000
tftp openwrt-ipq40xx-generic-zte_mf289f-initramfs-fit-zImage.itb
bootm $loadaddr

5. Please make backup of original partitions, if you think about revert to
   stock, specially mtd16 (Web UI) and mtd17 (rootFS).
Use /tmp as temporary storage and do:

WEB PARITION
--------------------------------------
cat /dev/mtd16 > /tmp/mtd16.bin
scp /tmp/mtd16.bin root@YOURSERVERIP:/
rm /tmp/mtd16.bin

ROOT PARITION
--------------------------------------
cat /dev/mtd17 > /tmp/mtd17.bin
scp /tmp/mtd17.bin root@YOURSERVERIP:/
rm /tmp/mtd17.bin

6. Login via ssh or serial and remove stock partitions
   (default IP 192.168.0.1):

 # this can return an error, if ubi was attached before
 # or rootfs part was erased before.
ubiattach -m 17

 # it could return error if rootfs part was erased before
ubirmvol /dev/ubi0 -N ubi_rootfs
 # some devices doesn't have it
ubirmvol /dev/ubi0 -N ubi_rootfs_data

7. download and install image via sysupgrade -n
 (either use wget/scp to copy the mf289f's squashfs-sysupgrade.bin
 to the device's /tmp directory)

 sysupgrade -n /tmp/openwrt-...-zte_mf289f-squashfs-sysupgrade.bin

Sometimes it could print ubi attach error, but please ignore it
if process goes forward.

Flash Layout

NAND:
mtd8: 000a0000 00020000 "fota-flag"
mtd9: 00080000 00020000 "0:ART"
mtd10: 00080000 00020000 "mac"
mtd11: 000c0000 00020000 "reserved2"
mtd12: 00400000 00020000 "cfg-param"
mtd13: 00400000 00020000 "log"
mtd14: 000a0000 00020000 "oops"
mtd15: 00500000 00020000 "reserved3"
mtd16: 00800000 00020000 "web"
mtd17: 01d00000 00020000 "rootfs"
mtd18: 01900000 00020000 "data"
mtd19: 03200000 00020000 "fota"
mtd20: 0041e000 0001f000 "kernel"
mtd21: 0101b000 0001f000 "ubi_rootfs"

SPI:
mtd0: 00040000 00010000 "0:SBL1"
mtd1: 00020000 00010000 "0:MIBIB"
mtd2: 00060000 00010000 "0:QSEE"
mtd3: 00010000 00010000 "0:CDT"
mtd4: 00010000 00010000 "0:DDRPARAMS"
mtd5: 00010000 00010000 "0:APPSBLENV"
mtd6: 000c0000 00010000 "0:APPSBL"
mtd7: 00050000 00010000 "0:reserved1"

Back to Stock (!!! need original dump taken from initramfs !!!)
-------------
1. Place mtd16.bin and mtd17.bin initramfs image
   for the device on a TFTP in the server's root.
   This example uses Server IP: 192.168.0.2
2. Connect serial console (115200,8n1) to serial console
   connector (refer to the pin-out from above).
3. Connect TFTP server to RJ-45 port (WAN/LAN1).
4. rename mtd16.bin to web.img and mtd17.bin to root_uImage_s
5. Stop in u-Boot (using ESC button) and run u-Boot commands:

This will erase RootFS+Web:
nand erase 0x1000000 0x800000
nand erase 0x1800000 0x1D00000

This will restore RootFS:
tftpboot 0x84000000 ${dir}root_uImage_s
nand erase 0x1800000 0x1D00000
nand write $fileaddr 0x1800000 $filesize

This will restore Web Interface:
tftpboot 0x84000000 ${dir}web.img
nand erase 0x1000000 0x800000
nand write $fileaddr 0x1000000 $filesize

After first boot on stock firwmare, do a factory reset.
Push reset button for 5 seconds so all parameters will
be reverted to the one printed on label on bottom of the router

Signed-off-by: Giammarco Marzano <stich86@gmail.com>
Reviewed-by: Lech Perczak <lech.perczak@gmail.com>
(Warning: commit message did not conform to UTF-8 - hopefully fixed?,
added description of the pin-out if image goes down, reformatted
commit message to be hopefully somewhat readable on git-web,
redid some of the gpio-buttons & leds DT nodes, etc.)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(cherry picked from commit 0de6a3339f1aadc1de2c9371435e3de239a00645)

[Backported to 22.03: added DTS to the makefile patch, fixed ipq-wifi
inclusion for MF286D]
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
19 months agouboot-envtools: Fix format of autogenerated sectors
Sven Eckelmann [Thu, 29 Sep 2022 10:10:32 +0000 (12:10 +0200)]
uboot-envtools: Fix format of autogenerated sectors

The sector number must be stored in hex. Otherwise, the number (like 16)
will be parsed as hex and any write to the partition will end up with an
error like:

  MTD erase error on /dev/mtd5: Invalid argument

Fixes: 9adfeccd8415 ("uboot-envtools: Add support for IPQ806x AP148 and DB149")
Fixes: 54b275c8ed3a ("ipq40xx: add target")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@fungible.com>
(cherry picked from commit 8d3e932b65b59ab7231cb5440866eb975bd150ea)

19 months agoopenssl: bump to 1.1.1s
John Audia [Thu, 3 Nov 2022 13:27:49 +0000 (09:27 -0400)]
openssl: bump to 1.1.1s

Changes between 1.1.1r and 1.1.1s [1 Nov 2022]

  *) Fixed a regression introduced in 1.1.1r version not refreshing the
     certificate data to be signed before signing the certificate.
     [Gibeom Gwon]

 Changes between 1.1.1q and 1.1.1r [11 Oct 2022]

  *) Fixed the linux-mips64 Configure target which was missing the
     SIXTY_FOUR_BIT bn_ops flag. This was causing heap corruption on that
     platform.
     [Adam Joseph]

  *) Fixed a strict aliasing problem in bn_nist. Clang-14 optimisation was
     causing incorrect results in some cases as a result.
     [Paul Dale]

  *) Fixed SSL_pending() and SSL_has_pending() with DTLS which were failing to
     report correct results in some cases
     [Matt Caswell]

  *) Fixed a regression introduced in 1.1.1o for re-signing certificates with
     different key sizes
     [Todd Short]

  *) Added the loongarch64 target
     [Shi Pujin]

  *) Fixed a DRBG seed propagation thread safety issue
     [Bernd Edlinger]

  *) Fixed a memory leak in tls13_generate_secret
     [Bernd Edlinger]

  *) Fixed reported performance degradation on aarch64. Restored the
     implementation prior to commit 2621751 ("aes/asm/aesv8-armx.pl: avoid
     32-bit lane assignment in CTR mode") for 64bit targets only, since it is
     reportedly 2-17% slower and the silicon errata only affects 32bit targets.
     The new algorithm is still used for 32 bit targets.
     [Bernd Edlinger]

  *) Added a missing header for memcmp that caused compilation failure on some
     platforms
     [Gregor Jasny]

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

Signed-off-by: John Audia <therealgraysky@proton.me>
(cherry picked from commit a0814f04ed955eb10b25df0ce6666ed91f11ca1b)

19 months agouboot-layerscape: adjust LS1012A-IOT config and env
Pawel Dembicki [Mon, 24 Oct 2022 13:11:07 +0000 (15:11 +0200)]
uboot-layerscape: adjust LS1012A-IOT config and env

In a254279a6c30 LS1012A-IOT kernel image was switched to FIT.

But u-boot config is lack of FIT and ext4 support.

This patch enables it.

It also fix envs, because for some reason this board need to use "loadaddr"
variable in brackets.

Fixes: #9894
Fixes: a254279a6c30 ("layerscape: Change to combined rootfs on sd images")
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
(cherry picked from commit d75ed3726d994fd050730e9ab5923d6232913054)

19 months agodnsmasq: Backport DHCPv6 server fix (CVE-2022-0934)
Hauke Mehrtens [Tue, 1 Nov 2022 14:17:03 +0000 (15:17 +0100)]
dnsmasq: Backport DHCPv6 server fix (CVE-2022-0934)

This backports a commit from upstream dnsmasq to fix CVE-2022-0934.

CVE-2022-0934 description:
A single-byte, non-arbitrary write/use-after-free flaw was found in
dnsmasq. This flaw allows an attacker who sends a crafted packet
processed by dnsmasq, potentially causing a denial of service.

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

19 months agobusybox: awk: fix use after free (CVE-2022-30065)
Hauke Mehrtens [Tue, 1 Nov 2022 14:23:17 +0000 (15:23 +0100)]
busybox: awk: fix use after free (CVE-2022-30065)

This backports a commit which fixes a use after free bug in awk.

CVE-2022-30065 description:
A use-after-free in Busybox 1.35-x's awk applet leads to denial of
service and possibly code execution when processing a crafted awk
pattern in the copyvar function.

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

19 months agoutil-linux: Update to version 2.37.4
Hauke Mehrtens [Tue, 1 Nov 2022 14:38:14 +0000 (15:38 +0100)]
util-linux: Update to version 2.37.4

This update contains only a security fix for an issue in chsh and chfn,
but OpenWrt is not packaging these applications so OpenWrt is not
affected. In OpenWrt master this was already fixed by the update to
util-linux 2.38.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
19 months agobcm4908: backport upstream BQL support for bcm4908_enet
Rafał Miłecki [Thu, 27 Oct 2022 20:33:14 +0000 (22:33 +0200)]
bcm4908: backport upstream BQL support for bcm4908_enet

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

19 months agokernel: bump 5.10 to 5.10.152
John Audia [Sun, 30 Oct 2022 12:32:36 +0000 (08:32 -0400)]
kernel: bump 5.10 to 5.10.152

All patches automatically rebased.

Signed-off-by: John Audia <therealgraysky@proton.me>
[Add CONFIG_ARM64_ERRATUM_1742098 to config]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 52400e167d83bd0bfc40394f9383529212b545ad)

19 months agokernel: bump 5.10 to 5.10.151
John Audia [Fri, 28 Oct 2022 12:03:27 +0000 (08:03 -0400)]
kernel: bump 5.10 to 5.10.151

All patches automatically rebased.

Signed-off-by: John Audia <therealgraysky@proton.me>
(cherry picked from commit 7a27ac605c7e55b7350c0bea76ca5d6eb218c5ea)

19 months agokernel: bump 5.10 to 5.10.150
John Audia [Thu, 27 Oct 2022 10:26:25 +0000 (06:26 -0400)]
kernel: bump 5.10 to 5.10.150

Manually rebased:
  bcm53xx/patches-5.10/180-usb-xhci-add-support-for-performing-fake-doorbell.patch

All patches automatically rebased.

Signed-off-by: John Audia <therealgraysky@proton.me>
[Move gro_skip in 680-NET-skip-GRO-for-foreign-MAC-addresses.patch to old position]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit aa2fa2eb76f13e48cd39d844dca34627da00cb5d)

19 months agoramips: Correct Unielec 01 and 06 dts wan macaddr byte location
David Bentham [Mon, 24 Oct 2022 08:05:59 +0000 (09:05 +0100)]
ramips: Correct Unielec 01 and 06 dts wan macaddr byte location

Recent backport patch b5cb5f352d3133ac8384275be7d47264ad135e74 had missed changing the macaddr_factory address location.

This patch corrects the address location.

Fixes: b5cb5f352d31 ("ramips: fix WAN mac address allocation for Unielec 01 and 06 models")
Signed-off-by: David Bentham <db260179@gmail.com>
[Fix dts node name too]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
19 months agobcm4908: backport bcm4908_enet fix for NULL dereference
Rafał Miłecki [Thu, 27 Oct 2022 19:05:20 +0000 (21:05 +0200)]
bcm4908: backport bcm4908_enet fix for NULL dereference

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

19 months agobcm4908: optimize Ethernet driver by using build_skb()
Rafał Miłecki [Thu, 27 Oct 2022 16:57:39 +0000 (18:57 +0200)]
bcm4908: optimize Ethernet driver by using build_skb()

This should slightly improve performance thanks to the better cache
usage.

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

19 months agokernel: mtd: backport SafeLoader parser
Rafał Miłecki [Tue, 18 Oct 2022 20:37:46 +0000 (22:37 +0200)]
kernel: mtd: backport SafeLoader parser

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

19 months agokernel: mtd: backport extended dynamic partitions support
Rafał Miłecki [Tue, 18 Oct 2022 20:12:27 +0000 (22:12 +0200)]
kernel: mtd: backport extended dynamic partitions support

This gets rid of "nvmem-cells" limitation. Dynamic partitions can be
defined for any (sub)partitions layout.

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

19 months agomac80211: Update to version 5.15.74-1
Hauke Mehrtens [Sat, 15 Oct 2022 09:31:42 +0000 (11:31 +0200)]
mac80211: Update to version 5.15.74-1

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

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

19 months agoath79: fix reference clock for RouterBoard 912UAG
Pavel Kamaev [Sun, 16 Oct 2022 18:27:47 +0000 (21:27 +0300)]
ath79: fix reference clock for RouterBoard 912UAG

This fixes reference clock frequency of RB912. 25 MHz frequency leads
to system clock running too fast, uptime incrementing too fast and
delays (like `sleep 10`) returning too early.

Board has quartz with NSK 3KHAA Z 40 000 marking.

Signed-off-by: Pavel Kamaev <pavel@kamaev.me>
(cherry picked from commit a716ac55649707e8279de6f2ea66c7f6060c982c)

19 months agoramips: fix WAN mac address allocation for Unielec 01 and 06 models
David Bentham [Mon, 17 Oct 2022 14:43:29 +0000 (15:43 +0100)]
ramips: fix WAN mac address allocation for Unielec 01 and 06 models

Manufacturer has predetermined mac address values for lan and wan ports.

This change keeps inline with other mt7621 devices mac address allocation
from factory mtd partition.

Example from hexdump output:

0xe000 0x6 (lan) -           0xe006 0x6 (wan)

0000e000  70 b3 d5 10 02 96 70 b3  d5 10 02 95 ff ff ff ff

Previous change had created an overlapping mac address situation as it
would increment by one based on the lan mac address location found in the
factory partition, which would sometimes increment to the same as the
mt7603 wifi chip.

Tested on Unielec u7621-01 model

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

19 months agoramips: rt3883: enable lzma-loader for Belkin F9K1109v1
Robert Senderek [Mon, 17 Oct 2022 19:15:35 +0000 (21:15 +0200)]
ramips: rt3883: enable lzma-loader for Belkin F9K1109v1

Fixes boot loader LZMA decompression issues

Fixes: #10968
Signed-off-by: Robert Senderek <robert.senderek@10g.pl>
(cherry picked from commit ac296f621058119501ccd54e7cb2a243af5dc5a0)

19 months agoramips: mt7621: enable lzma-loader for Asus RT-N56U-B1
Alex Khodin [Fri, 21 Oct 2022 17:47:38 +0000 (17:47 +0000)]
ramips: mt7621: enable lzma-loader for Asus RT-N56U-B1

Fixes boot loader LZMA decompression issues.

Without this change the board end up in a boot loop.

Signed-off-by: Alex Khodin <mxktz1@gmail.com>
(cherry picked from commit f6099d797460b23e06fb0c391606346993b4593e)

19 months agobcm53xx: enable Broadcom 4366b1 firmware for Asus RT-AC88U
Arınç ÜNAL [Tue, 18 Oct 2022 08:54:20 +0000 (11:54 +0300)]
bcm53xx: enable Broadcom 4366b1 firmware for Asus RT-AC88U

On some of the hardware revisions of Asus RT-AC88U, brcmfmac detects the
4366b1 wireless chip and tries to load the firmware file which doesn't
exist because it's not included in the image.

Therefore, include firmware for 4366b1 along with 4366c0. This way, all
hardware revisions of the router will be supported by having brcmfmac use
the firmware file for the wireless chip it detects.

Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
(cherry picked from commit 2b9bb5b187022f8b64c84781c071d6c2b0ce3e45)

19 months agowireless-tools: add package CPE ID
Petr Štetiar [Wed, 19 Oct 2022 19:38:08 +0000 (21:38 +0200)]
wireless-tools: add package CPE ID

Common Platform Enumeration (CPE) is a structured naming scheme for
information technology systems, software, and packages.

Suggested-by: Steffen Pfendtner <s.pfendtner@ads-tec.de>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit a80e198cd383593da7f41857a6122f28ed6354a1)

19 months agoncurses: add package CPE ID
Petr Štetiar [Wed, 19 Oct 2022 19:38:08 +0000 (21:38 +0200)]
ncurses: add package CPE ID

Common Platform Enumeration (CPE) is a structured naming scheme for
information technology systems, software, and packages.

Suggested-by: Steffen Pfendtner <s.pfendtner@ads-tec.de>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 3826e72b8e100f1f1df742cce6e5567b98c080e4)

19 months agoarm-trusted-firmware-sunxi: add package CPE ID
Petr Štetiar [Wed, 19 Oct 2022 19:38:08 +0000 (21:38 +0200)]
arm-trusted-firmware-sunxi: add package CPE ID

Common Platform Enumeration (CPE) is a structured naming scheme for
information technology systems, software, and packages.

Suggested-by: Steffen Pfendtner <s.pfendtner@ads-tec.de>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 0671e78a65d3540b1c922433f842cbb42f74950d)

19 months agolibnftnl: add package CPE ID
Petr Štetiar [Wed, 19 Oct 2022 19:38:08 +0000 (21:38 +0200)]
libnftnl: add package CPE ID

Common Platform Enumeration (CPE) is a structured naming scheme for
information technology systems, software, and packages.

Suggested-by: Steffen Pfendtner <s.pfendtner@ads-tec.de>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit efb4324c36a024ae6340d85352fb6c766a27a821)

19 months agoocteon: fix imagebuilder generation by introducing generic target
Nick Hainke [Sun, 11 Sep 2022 11:52:31 +0000 (13:52 +0200)]
octeon: fix imagebuilder generation by introducing generic target

The generic imagebuilder does not have a generic in the name, although
this is the default naming scheme. Use bcm53xx as template for this fix.

Before the fix:
  openwrt-imagebuilder-octeon.Linux-x86_64.tar.xz

After:
  openwrt-imagebuilder-octeon-generic.Linux-x86_64.tar.xz

Signed-off-by: Nick Hainke <vincent@systemli.org>
(cherry picked from commit a67f484e67b1d0930cb4b10b9e3787ecf7e71579)

19 months agoath79: support Ruckus ZoneFlex 7321
Lech Perczak [Tue, 14 Jun 2022 20:49:40 +0000 (22:49 +0200)]
ath79: support Ruckus ZoneFlex 7321

Ruckus ZoneFlex 7321 is a dual-band, single radio 802.11n 2x2 MIMO enterprise
access point. It is very similar to its bigger brother, ZoneFlex 7372.

Hardware highligts:
- CPU: Atheros AR9342 SoC at 533 MHz
- RAM: 64MB DDR2
- Flash: 32MB SPI-NOR
- Wi-Fi: AR9342 built-in dual-band 2x2 MIMO radio
- Ethernet: single Gigabit Ethernet port through AR8035 gigabit PHY
- PoE: input through Gigabit port
- Standalone 12V/1A power input
- USB: optional single USB 2.0 host port on the 7321-U variant.

Serial console: 115200-8-N-1 on internal H1 header.
Pinout:

H1 ----------
   |1|x3|4|5|
   ----------

Pin 1 is near the "H1" marking.
1 - RX
x - no pin
3 - VCC (3.3V)
4 - GND
5 - TX

JTAG: Connector H5, unpopulated, similar to MIPS eJTAG, standard,
but without the key in pin 12 and not every pin routed:

------- H5
|1 |2 |
-------
|3 |4 |
-------
|5 |6 |
-------
|7 |8 |
-------
|9 |10|
-------
|11|12|
-------
|13|14|
-------

3 - TDI
5 - TDO
7 - TMS
9 - TCK
2,4,6,8,10 - GND
14 - Vref
1,11,12,13 - Not connected

Installation:
There are two methods of installation:
- Using serial console [1] - requires some disassembly, 3.3V USB-Serial
  adapter, TFTP server,  and removing a single T10 screw,
  but with much less manual steps, and is generally recommended, being
  safer.
- Using stock firmware root shell exploit, SSH and TFTP [2]. Does not
  work on some rare versions of stock firmware. A more involved, and
  requires installing `mkenvimage` from u-boot-tools package if you
  choose to rebuild your own environment, but can be used without
  disassembly or removal from installation point, if you have the
  credentials.
  If for some reason, size of your sysupgrade image exceeds 13312kB,
  proceed with method [1]. For official images this is not likely to
  happen ever.

[1] Using serial console:
0. Connect serial console to H1 header. Ensure the serial converter
   does not back-power the board, otherwise it will fail to boot.

1. Power-on the board. Then quickly connect serial converter to PC and
   hit Ctrl+C in the terminal to break boot sequence. If you're lucky,
   you'll enter U-boot shell. Then skip to point 3.
   Connection parameters are 115200-8-N-1.

2. Allow the board to boot.  Press the reset button, so the board
   reboots into U-boot again and go back to point 1.

3. Set the "bootcmd" variable to disable the dual-boot feature of the
   system and ensure that uImage is loaded. This is critical step, and
   needs to be done only on initial installation.

   > setenv bootcmd "bootm 0x9f040000"
   > saveenv

4. Boot the OpenWrt initramfs using TFTP. Replace IP addresses as needed:

   > setenv serverip 192.168.1.2
   > setenv ipaddr 192.168.1.1
   > tftpboot 0x81000000 openwrt-ath79-generic-ruckus_zf7321-initramfs-kernel.bin
   > bootm 0x81000000

5. Optional, but highly recommended: back up contents of "firmware" partition:

   $ ssh root@192.168.1.1 cat /dev/mtd1 > ruckus_zf7321_fw1_backup.bin
   $ ssh root@192.168.1.1 cat /dev/mtd5 > ruckus_zf7321_fw2_backup.bin

6. Copy over sysupgrade image, and perform actual installation. OpenWrt
   shall boot from flash afterwards:

   $ ssh root@192.168.1.1
   # sysupgrade -n openwrt-ath79-generic-ruckus_zf7321-squashfs-sysupgrade.bin

[2] Using stock root shell:
0. Reset the device to factory defaullts. Power-on the device and after
   it boots, hold the reset button near Ethernet connectors for 5
   seconds.

1. Connect the device to the network. It will acquire address over DHCP,
   so either find its address using list of DHCP leases by looking for
   label MAC address, or try finding it by scanning for SSH port:

   $ nmap 10.42.0.0/24 -p22

   From now on, we assume your computer has address 10.42.0.1 and the device
   has address 10.42.0.254.

2. Set up a TFTP server on your computer. We assume that TFTP server
   root is at /srv/tftp.

3. Obtain root shell. Connect to the device over SSH. The SSHD ond the
   frmware is pretty ancient and requires enabling HMAC-MD5.

   $ ssh 10.42.0.254 \
   -o UserKnownHostsFile=/dev/null \
   -o StrictHostKeyCheking=no \
   -o MACs=hmac-md5

   Login. User is "super", password is "sp-admin".
   Now execute a hidden command:

   Ruckus

   It is case-sensitive. Copy and paste the following string,
   including quotes. There will be no output on the console for that.

   ";/bin/sh;"

   Hit "enter". The AP will respond with:

   grrrr
   OK

   Now execute another hidden command:

   !v54!

   At "What's your chow?" prompt just hit "enter".
   Congratulations, you should now be dropped to Busybox shell with root
   permissions.

4. Optional, but highly recommended: backup the flash contents before
   installation. At your PC ensure the device can write the firmware
   over TFTP:

   $ sudo touch /srv/tftp/ruckus_zf7321_firmware{1,2}.bin
   $ sudo chmod 666 /srv/tftp/ruckus_zf7321_firmware{1,2}.bin

   Locate partitions for primary and secondary firmware image.
   NEVER blindly copy over MTD nodes, because MTD indices change
   depending on the currently active firmware, and all partitions are
   writable!

   # grep rcks_wlan /proc/mtd

   Copy over both images using TFTP, this will be useful in case you'd
   like to return to stock FW in future. Make sure to backup both, as
   OpenWrt uses bot firmwre partitions for storage!

   # tftp -l /dev/<rcks_wlan.main_mtd> -r ruckus_zf7321_firmware1.bin -p 10.42.0.1
   # tftp -l /dev/<rcks_wlan.bkup_mtd> -r ruckus_zf7321_firmware2.bin -p 10.42.0.1

   When the command finishes, copy over the dump to a safe place for
   storage.

   $ cp /srv/tftp/ruckus_zf7321_firmware{1,2}.bin ~/

5. Ensure the system is running from the BACKUP image, i.e. from
   rcks_wlan.bkup partition or "image 2". Otherwise the installation
   WILL fail, and you will need to access mtd0 device to write image
   which risks overwriting the bootloader, and so is not covered here
   and not supported.

   Switching to backup firmware can be achieved by executing a few
   consecutive reboots of the device, or by updating the stock firmware. The
   system will boot from the image it was not running from previously.
   Stock firmware available to update was conveniently dumped in point 4 :-)

6. Prepare U-boot environment image.
   Install u-boot-tools package. Alternatively, if you build your own
   images, OpenWrt provides mkenvimage in host staging directory as well.
   It is recommended to extract environment from the device, and modify
   it, rather then relying on defaults:

   $ sudo touch /srv/tftp/u-boot-env.bin
   $ sudo chmod 666 /srv/tftp/u-boot-env.bin

   On the device, find the MTD partition on which environment resides.
   Beware, it may change depending on currently active firmware image!

   # grep u-boot-env /proc/mtd

   Now, copy over the partition

   # tftp -l /dev/mtd<N> -r u-boot-env.bin -p 10.42.0.1

   Store the stock environment in a safe place:

   $ cp /srv/tftp/u-boot-env.bin ~/

   Extract the values from the dump:

   $ strings u-boot-env.bin | tee u-boot-env.txt

   Now clean up the debris at the end of output, you should end up with
   each variable defined once. After that, set the bootcmd variable like
   this:

   bootcmd=bootm 0x9f040000

   You should end up with something like this:

bootcmd=bootm 0x9f040000
bootargs=console=ttyS0,115200 rootfstype=squashfs init=/sbin/init
baudrate=115200
ethaddr=0x00:0xaa:0xbb:0xcc:0xdd:0xee
mtdparts=mtdparts=ar7100-nor0:256k(u-boot),13312k(rcks_wlan.main),2048k(datafs),256k(u-boot-env),512k(Board Data),13312k(rcks_wlan.bkup)
mtdids=nor0=ar7100-nor0
bootdelay=2
ethact=eth0
filesize=78a000
fileaddr=81000000
partition=nor0,0
mtddevnum=0
mtddevname=u-boot
ipaddr=10.0.0.1
serverip=10.0.0.5
stdin=serial
stdout=serial
stderr=serial

   These are the defaults, you can use most likely just this as input to
   mkenvimage.

   Now, create environment image and copy it over to TFTP root:

   $ mkenvimage -s 0x40000 -b -o u-boot-env.bin u-boot-env.txt
   $ sudo cp u-boot-env.bin /srv/tftp

   This is the same image, gzipped and base64-encoded:

H4sIAAAAAAAAA+3QQW7TQBQAUF8EKRtQI6XtJDS0VJoN4gYcAE3iCbWS2MF2Sss1ORDYqVq6YMEB3rP0
Z/7Yf+aP3/56827VNP16X8Zx3E/Cw8dNuAqDYlxI7bcurpu6a3Y59v3jlzCbz5eLECbt8HbT9Y+HHLvv
x9TdbbpJVVd9vOxWVX05TotVOpZt6nN8qilyf5fKso3hIYTb8JDSEFarIazXQyjLIeRc7PvykNq+iy+T
1F7PQzivmzbcLpYftmfH87G56Wz+/v18sT1r19vu649dqi/2qaqns0W4utmelalPm27I/lac5/p+OluO
NZ+a1JaTz8M3/9hmtT0epmMjVdnF8djXLZx+TJl36TEuTlda93EYQrGpdrmrfuZ4fZPGHzjmp/vezMNJ
MV6n6qumPm06C+MRZb6vj/v4Mk/7HJ+6LarDqXweLsZnXnS5vc9tdXheWRbd0GIdh/Uq7cakOfavsty2
z1nxGwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAD+1x9eTkHLAAAEAA==

7. Perform actual installation. Copy over OpenWrt sysupgrade image to
   TFTP root:

   $ sudo cp openwrt-ath79-generic-ruckus_zf7321-squashfs-sysupgrade.bin /srv/tftp

   Now load both to the device over TFTP:

   # tftp -l /tmp/u-boot-env.bin -r u-boot-env.bin -g 10.42.0.1
   # tftp -l /tmp/openwrt.bin -r openwrt-ath79-generic-ruckus_zf7321-squashfs-sysupgrade.bin -g 10.42.0.1

   Vverify checksums of both images to ensure the transfer over TFTP
   was completed:

   # sha256sum /tmp/u-boot-env.bin /tmp/openwrt.bin

   And compare it against source images:

   $ sha256sum /srv/tftp/u-boot-env.bin /srv/tftp/openwrt-ath79-generic-ruckus_zf7321-squashfs-sysupgrade.bin

   Locate MTD partition of the primary image:

   # grep rcks_wlan.main /proc/mtd

   Now, write the images in place. Write U-boot environment last, so
   unit still can boot from backup image, should power failure occur during
   this. Replace MTD placeholders with real MTD nodes:

   # flashcp /tmp/openwrt.bin /dev/<rcks_wlan.main_mtd>
   # flashcp /tmp/u-boot-env.bin /dev/<u-boot-env_mtd>

   Finally, reboot the device. The device should directly boot into
   OpenWrt. Look for the characteristic power LED blinking pattern.

   # reboot -f

   After unit boots, it should be available at the usual 192.168.1.1/24.

Return to factory firmware:

1. Boot into OpenWrt initramfs as for initial installation. To do that
   without disassembly, you can write an initramfs image to the device
   using 'sysupgrade -F' first.
2. Unset the "bootcmd" variable:
   fw_setenv bootcmd ""
3. Write factory images downloaded from manufacturer website into
   fwconcat0 and fwconcat1 MTD partitions, or restore backup you took
   before installation:
   mtd write ruckus_zf7321_fw1_backup.bin /dev/mtd1
   mtd write ruckus_zf7321_fw2_backup.bin /dev/mtd5
4. Reboot the system, it should load into factory firmware again.

Quirks and known issues:
- Flash layout is changed from the factory, to use both firmware image
  partitions for storage using mtd-concat, and uImage format is used to
  actually boot the system, which rules out the dual-boot capability.
- The 5GHz radio has its own EEPROM on board, not connected to CPU.
- The stock firmware has dual-boot capability, which is not supported in
  OpenWrt by choice.
  It is controlled by data in the top 64kB of RAM which is unmapped,
  to avoid   the interference in the boot process and accidental
  switch to the inactive image, although boot script presence in
  form of "bootcmd" variable should prevent this entirely.
- U-boot disables JTAG when starting. To re-enable it, you need to
  execute the following command before booting:
  mw.l 1804006c 40
  And also you need to disable the reset button in device tree if you
  intend to debug Linux, because reset button on GPIO0 shares the TCK
  pin.
- On some versions of stock firmware, it is possible to obtain root shell,
  however not much is available in terms of debugging facitilies.
  1. Login to the rkscli
  2. Execute hidden command "Ruckus"
  3. Copy and paste ";/bin/sh;" including quotes. This is required only
     once, the payload will be stored in writable filesystem.
  4. Execute hidden command "!v54!". Press Enter leaving empty reply for
     "What's your chow?" prompt.
  5. Busybox shell shall open.
  Source: https://alephsecurity.com/vulns/aleph-2019014

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
(cherry picked from commit f1d112ee5a43e8c4a22db05b94bbcd0677a34486)

19 months agoath79: support Ruckus ZoneFlex 7372
Lech Perczak [Sun, 22 May 2022 15:46:28 +0000 (17:46 +0200)]
ath79: support Ruckus ZoneFlex 7372

Ruckus ZoneFlex 7372 is a dual-band, dual-radio 802.11n 2x2 MIMO enterprise
access point.

Ruckus ZoneFlex 7352 is also supported, lacking the 5GHz radio part.

Hardware highligts:
- CPU: Atheros AR9344 SoC at 560 MHz
- RAM: 128MB DDR2
- Flash: 32MB SPI-NOR
- Wi-Fi 2.4GHz: AR9344 built-in 2x2 MIMO radio
- Wi-Fi 5Ghz: AR9582 2x2 MIMO radio (Only in ZF7372)
- Antennas:
  - Separate internal active antennas with beamforming support on both
    bands with 7 elements per band, each controlled by 74LV164 GPIO
    expanders, attached to GPIOs of each radio.
  - Two dual-band external RP-SMA antenna connections on "7372-E"
    variant.
- Ethernet 1: single Gigabit Ethernet port through AR8035 gigabit PHY
- Ethernet 2: single Fast Ethernet port through AR9344 built-in switch
- PoE: input through Gigabit port
- Standalone 12V/1A power input
- USB: optional single USB 2.0 host port on "-U" variants.

The same image should support:
- ZoneFlex 7372E (variant with external antennas, without beamforming
  capability)
- ZoneFlex 7352 (single-band, 2.4GHz-only variant).

which are based on same baseboard (codename St. Bernard),
with different populated components.

Serial console: 115200-8-N-1 on internal H1 header.
Pinout:

H1
---
|5|
---
|4|
---
|3|
---
|x|
---
|1|
---

Pin 5 is near the "H1" marking.
1 - RX
x - no pin
3 - VCC (3.3V)
4 - GND
5 - TX

JTAG: Connector H2, similar to MIPS eJTAG, standard,
but without the key in pin 12 and not every pin routed:

------- H2
|1 |2 |
-------
|3 |4 |
-------
|5 |6 |
-------
|7 |8 |
-------
|9 |10|
-------
|11|12|
-------
|13|14|
-------

3 - TDI
5 - TDO
7 - TMS
9 - TCK
2,4,6,8,10 - GND
14 - Vref
1,11,12,13 - Not connected

Installation:
There are two methods of installation:
- Using serial console [1] - requires some disassembly, 3.3V USB-Serial
  adapter, TFTP server,  and removing a single T10 screw,
  but with much less manual steps, and is generally recommended, being
  safer.
- Using stock firmware root shell exploit, SSH and TFTP [2]. Does not
  work on some rare versions of stock firmware. A more involved, and
  requires installing `mkenvimage` from u-boot-tools package if you
  choose to rebuild your own environment, but can be used without
  disassembly or removal from installation point, if you have the
  credentials.
  If for some reason, size of your sysupgrade image exceeds 13312kB,
  proceed with method [1]. For official images this is not likely to
  happen ever.

[1] Using serial console:
0. Connect serial console to H1 header. Ensure the serial converter
   does not back-power the board, otherwise it will fail to boot.

1. Power-on the board. Then quickly connect serial converter to PC and
   hit Ctrl+C in the terminal to break boot sequence. If you're lucky,
   you'll enter U-boot shell. Then skip to point 3.
   Connection parameters are 115200-8-N-1.

2. Allow the board to boot.  Press the reset button, so the board
   reboots into U-boot again and go back to point 1.

3. Set the "bootcmd" variable to disable the dual-boot feature of the
   system and ensure that uImage is loaded. This is critical step, and
   needs to be done only on initial installation.

   > setenv bootcmd "bootm 0x9f040000"
   > saveenv

4. Boot the OpenWrt initramfs using TFTP. Replace IP addresses as needed:

   > setenv serverip 192.168.1.2
   > setenv ipaddr 192.168.1.1
   > tftpboot 0x81000000 openwrt-ath79-generic-ruckus_zf7372-initramfs-kernel.bin
   > bootm 0x81000000

5. Optional, but highly recommended: back up contents of "firmware" partition:

   $ ssh root@192.168.1.1 cat /dev/mtd1 > ruckus_zf7372_fw1_backup.bin
   $ ssh root@192.168.1.1 cat /dev/mtd5 > ruckus_zf7372_fw2_backup.bin

6. Copy over sysupgrade image, and perform actual installation. OpenWrt
   shall boot from flash afterwards:

   $ ssh root@192.168.1.1
   # sysupgrade -n openwrt-ath79-generic-ruckus_zf7372-squashfs-sysupgrade.bin

[2] Using stock root shell:
0. Reset the device to factory defaullts. Power-on the device and after
   it boots, hold the reset button near Ethernet connectors for 5
   seconds.

1. Connect the device to the network. It will acquire address over DHCP,
   so either find its address using list of DHCP leases by looking for
   label MAC address, or try finding it by scanning for SSH port:

   $ nmap 10.42.0.0/24 -p22

   From now on, we assume your computer has address 10.42.0.1 and the device
   has address 10.42.0.254.

2. Set up a TFTP server on your computer. We assume that TFTP server
   root is at /srv/tftp.

3. Obtain root shell. Connect to the device over SSH. The SSHD ond the
   frmware is pretty ancient and requires enabling HMAC-MD5.

   $ ssh 10.42.0.254 \
   -o UserKnownHostsFile=/dev/null \
   -o StrictHostKeyCheking=no \
   -o MACs=hmac-md5

   Login. User is "super", password is "sp-admin".
   Now execute a hidden command:

   Ruckus

   It is case-sensitive. Copy and paste the following string,
   including quotes. There will be no output on the console for that.

   ";/bin/sh;"

   Hit "enter". The AP will respond with:

   grrrr
   OK

   Now execute another hidden command:

   !v54!

   At "What's your chow?" prompt just hit "enter".
   Congratulations, you should now be dropped to Busybox shell with root
   permissions.

4. Optional, but highly recommended: backup the flash contents before
   installation. At your PC ensure the device can write the firmware
   over TFTP:

   $ sudo touch /srv/tftp/ruckus_zf7372_firmware{1,2}.bin
   $ sudo chmod 666 /srv/tftp/ruckus_zf7372_firmware{1,2}.bin

   Locate partitions for primary and secondary firmware image.
   NEVER blindly copy over MTD nodes, because MTD indices change
   depending on the currently active firmware, and all partitions are
   writable!

   # grep rcks_wlan /proc/mtd

   Copy over both images using TFTP, this will be useful in case you'd
   like to return to stock FW in future. Make sure to backup both, as
   OpenWrt uses bot firmwre partitions for storage!

   # tftp -l /dev/<rcks_wlan.main_mtd> -r ruckus_zf7372_firmware1.bin -p 10.42.0.1
   # tftp -l /dev/<rcks_wlan.bkup_mtd> -r ruckus_zf7372_firmware2.bin -p 10.42.0.1

   When the command finishes, copy over the dump to a safe place for
   storage.

   $ cp /srv/tftp/ruckus_zf7372_firmware{1,2}.bin ~/

5. Ensure the system is running from the BACKUP image, i.e. from
   rcks_wlan.bkup partition or "image 2". Otherwise the installation
   WILL fail, and you will need to access mtd0 device to write image
   which risks overwriting the bootloader, and so is not covered here
   and not supported.

   Switching to backup firmware can be achieved by executing a few
   consecutive reboots of the device, or by updating the stock firmware. The
   system will boot from the image it was not running from previously.
   Stock firmware available to update was conveniently dumped in point 4 :-)

6. Prepare U-boot environment image.
   Install u-boot-tools package. Alternatively, if you build your own
   images, OpenWrt provides mkenvimage in host staging directory as well.
   It is recommended to extract environment from the device, and modify
   it, rather then relying on defaults:

   $ sudo touch /srv/tftp/u-boot-env.bin
   $ sudo chmod 666 /srv/tftp/u-boot-env.bin

   On the device, find the MTD partition on which environment resides.
   Beware, it may change depending on currently active firmware image!

   # grep u-boot-env /proc/mtd

   Now, copy over the partition

   # tftp -l /dev/mtd<N> -r u-boot-env.bin -p 10.42.0.1

   Store the stock environment in a safe place:

   $ cp /srv/tftp/u-boot-env.bin ~/

   Extract the values from the dump:

   $ strings u-boot-env.bin | tee u-boot-env.txt

   Now clean up the debris at the end of output, you should end up with
   each variable defined once. After that, set the bootcmd variable like
   this:

   bootcmd=bootm 0x9f040000

   You should end up with something like this:

bootcmd=bootm 0x9f040000
bootargs=console=ttyS0,115200 rootfstype=squashfs init=/sbin/init
baudrate=115200
ethaddr=0x00:0xaa:0xbb:0xcc:0xdd:0xee
bootdelay=2
mtdids=nor0=ar7100-nor0
mtdparts=mtdparts=ar7100-nor0:256k(u-boot),13312k(rcks_wlan.main),2048k(datafs),256k(u-boot-env),512k(Board Data),13312k(rcks_wlan.bkup)
ethact=eth0
filesize=1000000
fileaddr=81000000
ipaddr=192.168.0.7
serverip=192.168.0.51
partition=nor0,0
mtddevnum=0
mtddevname=u-boot
stdin=serial
stdout=serial
stderr=serial

   These are the defaults, you can use most likely just this as input to
   mkenvimage.

   Now, create environment image and copy it over to TFTP root:

   $ mkenvimage -s 0x40000 -b -o u-boot-env.bin u-boot-env.txt
   $ sudo cp u-boot-env.bin /srv/tftp

   This is the same image, gzipped and base64-encoded:

H4sIAAAAAAAAA+3QTW7TQBQAYB+AQ2TZSGk6Tpv+SbNBrNhyADSJHWolsYPtlJaDcAWOCXaqQhdIXOD7
Fm/ee+MZ+/nHu58fV03Tr/dFHNf9JDzdbcJVGGRjI7Vfurhu6q7ZlbHvnz+FWZ4vFyFM2mF30/XPhzJ2
X4+pe9h0k6qu+njRrar6YkyzVToWberL+HImK/uHVBRtDE8h3IenlIawWg1hvR5CUQyhLE/vLcpdeo6L
bN8XVdHFumlDTO1NHsL5mI/9Q2r7Lv5J3uzeL5bX27Pj+XjRdJZfXuaL7Vm73nafv+1SPd+nqp7OFuHq
dntWpD5tuqH6e+K8rB+ns+V45n2T2mLyYXjmH9estsfD9DTSuo/DErJNtSu76vswbjg5NU4D3752qsOp
zu8W8/z6dh7mN1lXto9lWx3eNJd5Ng5V9VVTn2afnSYuysf6uI9/8rQv48s3Z93wn+o4XFWl3Vg0x/5N
Vbbta5X9AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAID/+Q2Z/B7cAAAEAA==

7. Perform actual installation. Copy over OpenWrt sysupgrade image to
   TFTP root:

   $ sudo cp openwrt-ath79-generic-ruckus_zf7372-squashfs-sysupgrade.bin /srv/tftp

   Now load both to the device over TFTP:

   # tftp -l /tmp/u-boot-env.bin -r u-boot-env.bin -g 10.42.0.1
   # tftp -l /tmp/openwrt.bin -r openwrt-ath79-generic-ruckus_zf7372-squashfs-sysupgrade.bin -g 10.42.0.1

   Verify checksums of both images to ensure the transfer over TFTP
   was completed:

   # sha256sum /tmp/u-boot-env.bin /tmp/openwrt.bin

   And compare it against source images:

   $ sha256sum /srv/tftp/u-boot-env.bin /srv/tftp/openwrt-ath79-generic-ruckus_zf7372-squashfs-sysupgrade.bin

   Locate MTD partition of the primary image:

   # grep rcks_wlan.main /proc/mtd

   Now, write the images in place. Write U-boot environment last, so
   unit still can boot from backup image, should power failure occur during
   this. Replace MTD placeholders with real MTD nodes:

   # flashcp /tmp/openwrt.bin /dev/<rcks_wlan.main_mtd>
   # flashcp /tmp/u-boot-env.bin /dev/<u-boot-env_mtd>

   Finally, reboot the device. The device should directly boot into
   OpenWrt. Look for the characteristic power LED blinking pattern.

   # reboot -f

   After unit boots, it should be available at the usual 192.168.1.1/24.

Return to factory firmware:

1. Boot into OpenWrt initramfs as for initial installation. To do that
   without disassembly, you can write an initramfs image to the device
   using 'sysupgrade -F' first.
2. Unset the "bootcmd" variable:
   fw_setenv bootcmd ""
3. Write factory images downloaded from manufacturer website into
   fwconcat0 and fwconcat1 MTD partitions, or restore backup you took
   before installation:
   mtd write ruckus_zf7372_fw1_backup.bin /dev/mtd1
   mtd write ruckus_zf7372_fw2_backup.bin /dev/mtd5
4. Reboot the system, it should load into factory firmware again.

Quirks and known issues:
- This is first device in ath79 target to support link state reporting
  on FE port attached trough the built-in switch.
- Flash layout is changed from the factory, to use both firmware image
  partitions for storage using mtd-concat, and uImage format is used to
  actually boot the system, which rules out the dual-boot capability.
  The 5GHz radio has its own EEPROM on board, not connected to CPU.
- The stock firmware has dual-boot capability, which is not supported in
  OpenWrt by choice.
  It is controlled by data in the top 64kB of RAM which is unmapped,
  to avoid   the interference in the boot process and accidental
  switch to the inactive image, although boot script presence in
  form of "bootcmd" variable should prevent this entirely.
- U-boot disables JTAG when starting. To re-enable it, you need to
  execute the following command before booting:
  mw.l 1804006c 40
  And also you need to disable the reset button in device tree if you
  intend to debug Linux, because reset button on GPIO0 shares the TCK
  pin.
- On some versions of stock firmware, it is possible to obtain root shell,
  however not much is available in terms of debugging facitilies.
  1. Login to the rkscli
  2. Execute hidden command "Ruckus"
  3. Copy and paste ";/bin/sh;" including quotes. This is required only
     once, the payload will be stored in writable filesystem.
  4. Execute hidden command "!v54!". Press Enter leaving empty reply for
     "What's your chow?" prompt.
  5. Busybox shell shall open.
  Source: https://alephsecurity.com/vulns/aleph-2019014
- Stock firmware has beamforming functionality, known as BeamFlex,
  using active multi-segment antennas on both bands - controlled by
  RF analog switches, driven by a pair of 74LV164 shift registers.
  Shift registers used for each radio are connected to GPIO14 (clock)
  and GPIO15 of the respective chip.
  They are mapped as generic GPIOs in OpenWrt - in stock firmware,
  they were most likely handled directly by radio firmware,
  given the real-time nature of their control.
  Lack of this support in OpenWrt causes the antennas to behave as
  ordinary omnidirectional antennas, and does not affect throughput in
  normal conditions, but GPIOs are available to tinker with nonetheless.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
(cherry picked from commit 59cb4dc91d500edc2e6b462e223e367806557cc5)

19 months agokernel: add kmod-nvme package
Daniel Golle [Tue, 26 Jul 2022 08:17:07 +0000 (10:17 +0200)]
kernel: add kmod-nvme package

Add driver for NVM Express block devices, ie. PCIe connected SSDs.

Targets which allow booting from NVMe (x86, maybe some mvebu boards come
to mind) should have it built-in, so rootfs can be mounted from there.
For targets without NVMe support in bootloader or BIOS/firmware it's
sufficient to provide the kernel module package.

On targets having the NVMe driver built-in the resulting kmod package
is an empty dummy. In any case, depending on or installing kmod-nvme
results in driver support being available (either because it was already
built-in or because the relevant kernel modules are added and loaded).

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

19 months agokernel: mtd: fix unbalanced of_node_put() in dynamic partitions code
Rafał Miłecki [Tue, 18 Oct 2022 19:25:15 +0000 (21:25 +0200)]
kernel: mtd: fix unbalanced of_node_put() in dynamic partitions code

Fixes: cae4d089bc1d3 ("kernel: backport mtd dynamic partition patch")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 76a470d5df971bd4c7309480a585d7fbaef63621)

19 months agokernel: bump 5.10 to 5.10.149
John Audia [Mon, 17 Oct 2022 18:34:40 +0000 (14:34 -0400)]
kernel: bump 5.10 to 5.10.149

No patches required modification.

Signed-off-by: John Audia <therealgraysky@proton.me>
(cherry picked from commit 25fba4c375f081d175bf94079d5d713b6bc4bbc0)

19 months agokernel: bump 5.10 to 5.10.148
John Audia [Sat, 15 Oct 2022 10:31:21 +0000 (06:31 -0400)]
kernel: bump 5.10 to 5.10.148

No patches required modification.

Signed-off-by: John Audia <therealgraysky@proton.me>
(cherry picked from commit 59b5d59edf4479197099e3bf6b034f085067b8e5)

19 months agokernel: bump 5.10 to 5.10.147
John Audia [Wed, 5 Oct 2022 11:58:32 +0000 (07:58 -0400)]
kernel: bump 5.10 to 5.10.147

Removed upstreamed:
  bcm53xx/patches-5.10/083-v6.0-clk-iproc-Do-not-rely-on-node-name-for-correct-PLL-s.patch[1]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.147&id=a8e6cde5062fb2aff81f86cc0770591714bee545

Signed-off-by: John Audia <therealgraysky@proton.me>
(cherry picked from commit e2da6a0a59a81a4fc0fdffde31abf22ee121e9f5)

19 months agomt7621: hiwifi_hc5962: fix reboot loop by using LZMA loader
Petr Štetiar [Tue, 18 Oct 2022 06:55:46 +0000 (08:55 +0200)]
mt7621: hiwifi_hc5962: fix reboot loop by using LZMA loader

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

References: https://github.com/openwrt/openwrt/issues/10645#issuecomment-1282607274
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit b63d6d4730fd0dc30ce6707338c398e8b9d61d86)

19 months agoucode: update to latest Git HEAD
Jo-Philipp Wich [Tue, 18 Oct 2022 09:06:31 +0000 (11:06 +0200)]
ucode: update to latest Git HEAD

00af065 fs: expose `getdelim()` functionality through `fd.read()`
21ace5e lexer: fixes for regex literal parsing

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 1b90c7441b81aee7b1212e8918e3ec7144375d96)

19 months agofirewall4: update to latest Git HEAD
Jo-Philipp Wich [Tue, 18 Oct 2022 07:44:42 +0000 (09:44 +0200)]
firewall4: update to latest Git HEAD

7ae5e14 fw4: gracefully handle `null` return values from `fd.read("line")`

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 5e2e048c0e7c16d7967ec7a0cd8a9c01aa0f12b1)

19 months agomt7621: netgear_ex6150: fix reboot loop by using LZMA loader
Petr Štetiar [Tue, 18 Oct 2022 06:55:46 +0000 (08:55 +0200)]
mt7621: netgear_ex6150: fix reboot loop by using LZMA loader

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

Fixes: #10645
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 7dd1cab1c16f374716b1ee7a5bf99f849b74c1dc)

20 months agoOpenWrt v22.03.2: revert to branch defaults
Hauke Mehrtens [Sat, 15 Oct 2022 12:46:15 +0000 (14:46 +0200)]
OpenWrt v22.03.2: revert to branch defaults

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
20 months agoOpenWrt v22.03.2: adjust config defaults v22.03.2
Hauke Mehrtens [Sat, 15 Oct 2022 12:45:57 +0000 (14:45 +0200)]
OpenWrt v22.03.2: adjust config defaults

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
20 months agofirewall4: update to latest Git HEAD
Jo-Philipp Wich [Fri, 14 Oct 2022 15:32:28 +0000 (17:32 +0200)]
firewall4: update to latest Git HEAD

4fbf6d7 ruleset.uc: log forwarded traffic not matched by zone policies
c7201a3 main.uc: reintroduce set reload restriction
756f1e2 ruleset: fix emitting set_mark/set_xmark rules with masks
3db4741 ruleset: properly handle zone names starting with a digit
43d8ef5 fw4: fix formatting of default log prefix
592ba45 main.uc: remove uneeded/wrong set reload restrictions
b0a6bff tests: fix testcases
145e159 fw4: recognize `option log` and `option counter` in `config nat` sections
ce050a8 fw4: fall back to device if l3_device is not available in ifstatus

Fixes: #10639, #10965
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit fdfa9d8f7469626d2dc8e4b46a6ad56a3b27c16b)

20 months agoucode: update to latest Git HEAD
Jo-Philipp Wich [Mon, 5 Sep 2022 08:50:39 +0000 (10:50 +0200)]
ucode: update to latest Git HEAD

4ae7072 fs: use `getline()` for line wise read operations
21ace5e lexer: fixes for regex literal parsing
00965fa lib: implement slice() function
76d396d main: implement print mode
7bbba78 compiler: optimize function return opcode generation
a45f2a3 lexer: improve regex literal handling
d64d5d6 vm: maintain export symbol tables per program
f4b4ded uloop: task: gracefully handle absent output callback
a58fe47 ubus: hold reference to underlying connection until deferred is concluded
e23b58a lib: uc_system(): retry waitpid() on EINTR
cc4eb79 ubus: support obtaining numeric error code
01c412c ubus: add toplevel constants for ubus status codes
8e240fa ubus: allow object method call handlers to return a numeric status code
5cdddd3 lib: add limit support to split() and replace()
0ba9c3e fs: add optional third permission argument to fs.open()
c1f7b3b lib: remove fixed capture group limit in match() and regex replace()

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(backported from commits 639754e36d849553e288f8e34f51f793761c07db
 and 5110dcb1fa44fc1aac737c63b31474daa471de89)

20 months agorpcd: update to latest Git HEAD
Jo-Philipp Wich [Mon, 12 Sep 2022 11:48:40 +0000 (13:48 +0200)]
rpcd: update to latest Git HEAD

8c852b6 ucode: write ucode runtime exceptions to stderr
e80d0b2 ucode: pass-through `ubus_rpc_session` argument
0d02243 ucode: initialize module search path early

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(backported from commits 94129cbefb6027cdfe2b7801a6e27a36d4ec58b8
 and db17c7527107c1dae190608a1313a3977fe4f23f)

20 months agoimage: always rebuild kernel loaders
Matthias Schiffer [Sun, 27 Mar 2022 21:15:48 +0000 (23:15 +0200)]
image: always rebuild kernel loaders

Kernel loaders like the lzma-loader currently don't track changes to
their sources. This can lead to an old version of a loader to be used
when a build tree is not clean between builds.

As the loaders are tiny and the build times are insignificant, simply
force rebuilding them on every build to avoid this problem.

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

20 months agompc85xx: p1010: make TP-Link WDR4900 v1 build again
Matthias Schiffer [Sun, 27 Mar 2022 19:00:30 +0000 (21:00 +0200)]
mpc85xx: p1010: make TP-Link WDR4900 v1 build again

Add the spi-loader as a pre-kernel stage, so we can lift the kernel size
limit.

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

20 months agompc85xx: add SPI kernel loader for TP-Link TL-WDR4900 v1
Matthias Schiffer [Sun, 27 Mar 2022 18:57:01 +0000 (20:57 +0200)]
mpc85xx: add SPI kernel loader for TP-Link TL-WDR4900 v1

Similar to the lzma-loader on our MIPS targets, the spi-loader acts as
a second-stage loader that will then load and start the actual kernel.
As the TL-WDR4900 uses SPI-NOR and the P1010 family does not have support
for memory mapping of this type of flash, this loader needs to contain a
basic driver for the FSL ESPI controller.

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

20 months agoramips: fix ZyXEL NWA55AXE model name
David Bauer [Thu, 18 Aug 2022 16:02:48 +0000 (18:02 +0200)]
ramips: fix ZyXEL NWA55AXE model name

The model name was missing a letter.

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

20 months agoramips: add support for ZyXEL NWA50AX / NWA55AXE
David Bauer [Fri, 27 May 2022 15:48:06 +0000 (17:48 +0200)]
ramips: add support for ZyXEL NWA50AX / NWA55AXE

Hardware
--------
CPU:    Mediatek MT7621
RAM:    256M DDR3
FLASH:  128M NAND
ETH:    1x Gigabit Ethernet
WiFi:   Mediatek MT7915 (2.4/5GHz 802.11ax 2x2 DBDC)
BTN:    1x Reset (NWA50AX only)
LED:    1x Multi-Color (NWA50AX only)

UART Console
------------
NWA50AX:
Available below the rubber cover next to the ethernet port.
NWA55AXE:
Available on the board when disassembling the device.

Settings: 115200 8N1

Layout:

<12V> <LAN> GND-RX-TX-VCC

Logic-Level is 3V3. Don't connect VCC to your UART adapter!

Installation Web-UI
-------------------
Upload the Factory image using the devices Web-Interface.

As the device uses a dual-image partition layout, OpenWrt can only
installed on Slot A. This requires the current active image prior
flashing the device to be on Slot B.

If the currently installed image is started from Slot A, the device will
flash OpenWrt to Slot B. OpenWrt will panic upon first boot in this case
and the device will return to the ZyXEL firmware upon next boot.

If this happens, first install a ZyXEL firmware upgrade of any version
and install OpenWrt after that.

Installation TFTP
-----------------
This installation routine is especially useful in case
 * unknown device password (NWA55AXE lacks reset button)
 * bricked device

Attach to the UART console header of the device. Interrupt the boot
procedure by pressing Enter.

The bootloader has a reduced command-set available from CLI, but more
commands can be executed by abusing the atns command.

Boot a OpenWrt initramfs image available on a TFTP server at
192.168.1.66. Rename the image to owrt.bin

 $ atnf owrt.bin
 $ atna 192.168.1.88
 $ atns "192.168.1.66; tftpboot; bootm"

Upon booting, set the booted image to the correct slot:

 $ zyxel-bootconfig /dev/mtd10 get-status
 $ zyxel-bootconfig /dev/mtd10 set-image-status 0 valid
 $ zyxel-bootconfig /dev/mtd10 set-active-image 0

Copy the OpenWrt ramboot-factory image to the device using scp.
Write the factory image to NAND and reboot the device.

 $ mtd write ramboot-factory.bin firmware
 $ reboot

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

20 months agobusybox: nslookup: ensure unique transaction IDs for the DNS queries
Uwe Kleine-König [Fri, 14 Oct 2022 10:23:07 +0000 (12:23 +0200)]
busybox: nslookup: ensure unique transaction IDs for the DNS queries

On machines with a coarse monotonic clock (here: TP-Link RE200 powered
by a MediaTek MT7620A) it can happen that the two DNS requests (for A
and AAAA) share the same transaction ID. If this happens the second
reply is wrongly dropped and nslookup reports "No answer".

Fix this by ensuring that the transaction IDs are unique.

Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
(cherry picked from commit 63e5ba8e69f03a584b707520db0a0821eda3024f)
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
20 months agomac80211: backport security fixes
Felix Fietkau [Thu, 13 Oct 2022 12:29:53 +0000 (14:29 +0200)]
mac80211: backport security fixes

This mainly affects scanning and beacon parsing, especially with MBSSID enabled

Fixes: CVE-2022-41674
Fixes: CVE-2022-42719
Fixes: CVE-2022-42720
Fixes: CVE-2022-42721
Fixes: CVE-2022-42722
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit 26f400210d6b3780fcc0deb89b9741837df9c8b8)

20 months agomac80211: merge upstream fixes
Koen Vandeputte [Mon, 22 Aug 2022 09:18:35 +0000 (11:18 +0200)]
mac80211: merge upstream fixes

fetched from upstream kernel v5.15.67

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
(cherry-picked from commit aa9be386d40f3a5e559c0f2183c772175a45cf0d)

20 months agoramips: skip bbt scan on mt7621
Felix Fietkau [Thu, 10 Mar 2022 14:20:29 +0000 (15:20 +0100)]
ramips: skip bbt scan on mt7621

reduces unnecessary flash reads and speeds up boot time

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

20 months agoramips: enable support for mtk_bmt in the nand flash driver
Felix Fietkau [Thu, 10 Mar 2022 10:45:00 +0000 (11:45 +0100)]
ramips: enable support for mtk_bmt in the nand flash driver

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

20 months agoramips: mt7621_nand: initialize ECC_FDMADDR
Felix Fietkau [Wed, 9 Mar 2022 19:46:21 +0000 (20:46 +0100)]
ramips: mt7621_nand: initialize ECC_FDMADDR

This is needed for the ECC controller to access FDM data

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

20 months agoramips: mt7621_nand: reduce log verbosity
Stijn Tintel [Wed, 19 Jan 2022 15:59:51 +0000 (17:59 +0200)]
ramips: mt7621_nand: reduce log verbosity

Avoid flooding the log with the message below by increasing the log
level to debug:

  mt7621-nand 1e003000.nand: Using programmed access timing: 31c07388

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
(cherry-picked from commit 89c195925109d2b59f284bfdd23a3d853c67e27b)

20 months agoramips: move mt7621_nand driver to files
Stijn Tintel [Wed, 19 Jan 2022 13:44:58 +0000 (15:44 +0200)]
ramips: move mt7621_nand driver to files

The patch was rejected by upstream. The mtk_nand driver should be
modified to support the mt7621 flash controller instead. As there is no
newer version to backport, or no upstream version to fix bugs, let's
move the driver to the files dir under the ramips target. This makes it
easier to make changes to the driver while waiting for mt7621 support to
land in mtk_nand.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
(cherry-picked from commit 2f2e81a4ea110328c5434054d1412b4d1d8fde81)

20 months agokernel: mtdsplit: support UBI after FIT images
Felix Fietkau [Thu, 10 Mar 2022 16:32:20 +0000 (17:32 +0100)]
kernel: mtdsplit: support UBI after FIT images

Change the partition name accordingly. Same behavior as mtdsplit_uimage

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

20 months agokernel: mtk_bmt: skip bitflip check if threshold isn't set
Chuanhong Guo [Thu, 7 Apr 2022 01:56:02 +0000 (09:56 +0800)]
kernel: mtk_bmt: skip bitflip check if threshold isn't set

kernel spi-nand driver leaves this field empty and let mtd set it later.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
(cherry-picked from commit 6fa50e26e7c1221085d8e71cde7e9148c540c752)

20 months agokernel: mtk_bmt: add debugfs file to attempt repair of remapped sectors
Felix Fietkau [Thu, 10 Mar 2022 15:23:25 +0000 (16:23 +0100)]
kernel: mtk_bmt: add debugfs file to attempt repair of remapped sectors

This can be used for sectors that are not physically damaged

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

20 months agokernel: add support for mediatek NMBM flash mapping support
Felix Fietkau [Thu, 10 Mar 2022 14:31:25 +0000 (15:31 +0100)]
kernel: add support for mediatek NMBM flash mapping support

This NAND flash remapping method is used on newer MediaTek devices with NAND
flash.

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

20 months agokernel: mtk_bmt: on error, do not attempt to remap out-of-range blocks
Felix Fietkau [Wed, 9 Mar 2022 15:14:12 +0000 (16:14 +0100)]
kernel: mtk_bmt: on error, do not attempt to remap out-of-range blocks

Pass errors to caller instead

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

20 months agokernel: mtk_bmt: fix block copying on remap with bmt v2
Felix Fietkau [Wed, 9 Mar 2022 15:04:39 +0000 (16:04 +0100)]
kernel: mtk_bmt: fix block copying on remap with bmt v2

Copy from the previously mapped block (in case it was remapped already)

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

20 months agokernel: mtk_bmt: allow get_mapping_block to return an error
Felix Fietkau [Wed, 9 Mar 2022 14:54:52 +0000 (15:54 +0100)]
kernel: mtk_bmt: allow get_mapping_block to return an error

Used by the mapping implementation to indicate that no backing block is
available

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

20 months agokernel: split up mtk_bmt driver code
Felix Fietkau [Wed, 9 Mar 2022 10:30:58 +0000 (11:30 +0100)]
kernel: split up mtk_bmt driver code

Keep a separate source file per variant

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

20 months agoOpenWrt v22.03.1: revert to branch defaults
Hauke Mehrtens [Sun, 9 Oct 2022 17:32:23 +0000 (19:32 +0200)]
OpenWrt v22.03.1: revert to branch defaults

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
20 months agoOpenWrt v22.03.1: adjust config defaults v22.03.1
Hauke Mehrtens [Sun, 9 Oct 2022 17:32:19 +0000 (19:32 +0200)]
OpenWrt v22.03.1: adjust config defaults

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
20 months agoath79: fix model name of Extreme Networks WS-AP3805i
Tom Herbers [Fri, 7 Oct 2022 22:08:52 +0000 (00:08 +0200)]
ath79: fix model name of Extreme Networks WS-AP3805i

Everywhere else the device is referred to as WS-AP3805i,
only the model name wrongly only said AP3805i.

Signed-off-by: Tom Herbers <mail@tomherbers.de>
(cherry picked from commit 7d6032f310058d7e9b96d7e1dc4d49c8232beff7)