openwrt/staging/dedeckeh.git
3 years agofirmware-utils: fix unused variable warnings
Rafał Miłecki [Fri, 9 Apr 2021 05:38:46 +0000 (07:38 +0200)]
firmware-utils: fix unused variable warnings

This fixes warnings from the:
1. -Wunused-variable
2. -Wunused-but-set-variable

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agofirmware-utils: fix all -Wformat warnings
Rafał Miłecki [Thu, 8 Apr 2021 22:10:53 +0000 (00:10 +0200)]
firmware-utils: fix all -Wformat warnings

1. Use %hhu for uint8_t
2. Use %z for size_t

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agobcm4908: enable Netgear R8000P bootloader image
Rafał Miłecki [Thu, 8 Apr 2021 08:39:56 +0000 (10:39 +0200)]
bcm4908: enable Netgear R8000P bootloader image

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

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

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

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agobcm4908: enable target & Asus GT-AC5300 image
Rafał Miłecki [Thu, 8 Apr 2021 07:12:43 +0000 (09:12 +0200)]
bcm4908: enable target & Asus GT-AC5300 image

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

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agofirmware-utils: bcm4908img: convert into a package
Rafał Miłecki [Thu, 1 Apr 2021 15:06:47 +0000 (17:06 +0200)]
firmware-utils: bcm4908img: convert into a package

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

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

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agofirmware-utils: bcm4908img: fix uninitialized var usage
Rafał Miłecki [Thu, 8 Apr 2021 07:10:20 +0000 (09:10 +0200)]
firmware-utils: bcm4908img: fix uninitialized var usage

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agoramips: rt305x: use lzma-loader for ZyXEL Keenetic Lite rev.B
Szabolcs Hubai [Wed, 3 Feb 2021 06:56:38 +0000 (07:56 +0100)]
ramips: rt305x: use lzma-loader for ZyXEL Keenetic Lite rev.B

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

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

Ralink UBoot Version: 3.5.2.4_ZyXEL

....

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

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

Fixes: 4dc9ad4af8c921494d20b303b6772fc6b5af3a69 ("ramips: add support for ZyXEL Keenetic Lite Rev.B")
Signed-off-by: Szabolcs Hubai <szab.hu@gmail.com>
3 years agoath79: move pcie node to DTSI for qca955x Senao APs
Michael Pratt [Sat, 27 Feb 2021 19:18:42 +0000 (14:18 -0500)]
ath79: move pcie node to DTSI for qca955x Senao APs

pcie0 is the same for this generation of Senao APs
while eth0, eth1, and wmac can differ

the qca,no-eeprom property has no effect
for the ath10k drivers

Signed-off-by: Michael Pratt <mcpratt@pm.me>
3 years agoath79: cleanup DTS for ALLNET ALL-WAP02860AC
Michael Pratt [Mon, 15 Feb 2021 20:37:06 +0000 (15:37 -0500)]
ath79: cleanup DTS for ALLNET ALL-WAP02860AC

use qca955x_senao_loader.dtsi
because it is the same hardware / partitioning
and some cleanup

Effects:

nodes to match similar boards
 - keys
 - eth0
 - pcie0

bumps SPI frequency to 40 MHz

removes &pll node:
the property is defined in qca955x.dtsi

removes qca,no-eeprom:
has no effect with mtd-cal-data property
(also spelling)

Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Signed-off-by: Michael Pratt <mcpratt@pm.me>
3 years agoath79: add factory.bin for ALLNET ALL-WAP02860AC
Michael Pratt [Fri, 12 Feb 2021 23:58:00 +0000 (18:58 -0500)]
ath79: add factory.bin for ALLNET ALL-WAP02860AC

This device is a Senao-based product
using hardware and software from Senao
with the tar-gz platform for factory.bin
and checksum verification at boot time
using variables stored in uboot environment
and a 'failsafe' image when it fails.

Extremely similar hardware/software to Engenius EAP1200H
and other Engenius APs with qca955x

Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Signed-off-by: Michael Pratt <mcpratt@pm.me>
3 years agoath79: add Senao 'failsafe' sysupgrade procedure
Michael Pratt [Fri, 12 Feb 2021 23:19:10 +0000 (18:19 -0500)]
ath79: add Senao 'failsafe' sysupgrade procedure

Use a similar upgrade method for sysupgrade.bin, like factory.bin,
for Senao boards with the tar.gz OEM upgrade platform,
and 'failsafe' image which is loaded on checksum failure.

This is inspired by the OEM upgrade script /etc/fwupgrade.sh
and the existing platforms for dual-boot Senao boards.

Previously, if the real kernel was damaged or missing
the only way to recover was with UART serial console,
because the OKLI lzma-loader is programmed to halt.

uboot did not detect cases where kernel or rootfs is damaged
and boots OKLI instead of the failsafe image,
because the checksums stored in uboot environment
did not include the real kernel and rootfs space.

Now, the stored checksums include the space for both
the lzma-loader, kernel, and rootfs.
Therefore, these boards are now practically unbrickable.

Also, the factory.bin and sysupgrade.bin are now the same,
except for image metadata.
This allows for flashing OEM image directly from openwrt
as well as flashing openwrt image directly from OEM.

Make 'loader' partition writable so that it can be updated
during a sysupgrade.

tested with
ENS202EXT v1
EAP1200H
EAP350 v1
EAP600
ECB350 v1
ECB600
ENH202 v1

Signed-off-by: Michael Pratt <mcpratt@pm.me>
3 years agoath79: adjust ath79/tiny Senao APs to 4k blocksize
Michael Pratt [Sun, 21 Feb 2021 22:41:30 +0000 (17:41 -0500)]
ath79: adjust ath79/tiny Senao APs to 4k blocksize

ath79/tiny kernel config has
CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
from commit
05d35403b211ccb9bf20e2b3c0b7a30c82c6d6a2

Because of this, these changes are required for 2 reasons:

1.

Senao devices in ath79/tiny
with a 'failsafe' partition and the tar.gz sysupgrade platform
and a flash chip that supports 4k sectors
will fail to reboot to openwrt after a sysupgrade.

the stored checksum is made with the 64k blocksize length
of the image to be flashed,
and the actual checksum changes after flashing due to JFFS2 space
being formatted within the length of the rootfs from the image

example:
0x440000 length of kernel + rootfs (from sysupgrade.bin)
0x439000 offset of rootfs_data (from kernel log)

2.

for boards with flash chips that support 4k sectors:
saving configuration over sysupgrade is not possible
because sysupgrade.tgz is appended at a 64k boundary
and the mtd parser starts JFFS2 at a 4k boundary.

for boards with flash chips that do not support 4k sectors:
partitioning with 4k boundaries causes a boot loop
from the mtd parser not finding kernel and rootfs.

Also:

Some of the Senao boards that belong in ath79/tiny,
for example ENH202,
have a flash chip that does not support 4k sectors
(no SECT_4K symbol in upstream source).

Because of this, partitioning must be different for these devices
depending on the flash chip model detected by the kernel.

Therefore:

this creates 2 DTSI files
to replace the single one with 64k partitioning
for 4k and 64k partitioning respectively.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
3 years agoath79: remove 'fakeroot' for Senao devices
Michael Pratt [Thu, 25 Feb 2021 03:55:09 +0000 (22:55 -0500)]
ath79: remove 'fakeroot' for Senao devices

By using the same custom kernel header magic
in both OKLI lzma-loader, DTS, and makefile
this hack is not necessary anymore

However, "rootfs" size and checksum
must now be supplied by the factory.bin image
through a script that is accepted by the OEM upgrade script.

This is because Senao OEM scripts assume a squashfs header exists
at the offset for the original "rootfs" partition
which is actually the kernel + rootfs in this implementation,
and takes size value from the header that would be there with hexdump,
but this offset is now the uImage header instead.

This frees up 1 eraseblock
previously used by the "fakeroot" partition
for bypassing the OEM image verification.

Also, these Senao devices with a 'failsafe' partition
and the tar-gz factory.bin platform would otherwise require
flashing the new tar-gz sysupgrade.bin afterward.
So this also prevents having to flash both images
when starting from OEM or 'failsafe'

the OEM upgrade script verifies the header magic numbers,
but only the first two bytes.
Example:

    [ "${magic_word_kernel}" = "2705" ] &&
    [ "${magic_word_rootfs}" = "7371" -o "${magic_word_rootfs}" = "6873" ] &&
    errcode="0"

therefore picked the magic number
0x73714f4b
which is
'sqOK'

Signed-off-by: Michael Pratt <mcpratt@pm.me>
3 years agoath79: lzma-loader: allow setting custom kernel magic
Michael Pratt [Thu, 25 Feb 2021 03:35:37 +0000 (22:35 -0500)]
ath79: lzma-loader: allow setting custom kernel magic

...and max flash offset

The mtdsplit parser was recently refactored
to allow the kernel to have custom image header magic.

Let's also do this for the lzma-loader

For example:
When implemented together,
this allows the kernel to "appear" to be a rootfs
by OEM software in order to write an image
that is actually kernel + rootfs.

At the same time,
it would boot to openwrt normally
by setting the same magic in DTS.

Both of the variables
have a default value that is unchanged
when not defined in the makefiles

This has no effect on the size of the loader
when lzma compressed.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
3 years agorealtek: allow writing to "u-boot-env2"
Bjørn Mork [Tue, 6 Apr 2021 09:43:05 +0000 (11:43 +0200)]
realtek: allow writing to "u-boot-env2"

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

Signed-off-by: Bjørn Mork <bjorn@mork.no>
3 years agouboot-envtools: add wrapper scripts for alternate config
Bjørn Mork [Tue, 6 Apr 2021 09:43:04 +0000 (11:43 +0200)]
uboot-envtools: add wrapper scripts for alternate config

Now that we can create an alternate configuration file, add two
wrapper scripts for simple access to it using the alternate
alternate application names `fw_printsys' and `fw_setsys'.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
3 years agouboot-envtools: add support for multiple config partitions
Bjørn Mork [Tue, 6 Apr 2021 09:43:03 +0000 (11:43 +0200)]
uboot-envtools: add support for multiple config partitions

Most (all?) of the realtek devices have two u-boot config partitions
with a different set of variables in each. The U-Boot shell provides
two sets of apps to manipulate these:

 printenv- print environment variables
 printsys- printsys - print system information variables
 saveenv - save environment variables to persistent storage
 savesys - savesys - save system information variables to persistent storage
 setenv  - set environment variables
 setsys  - setsys  - set system information variables

Add support for multiple ubootenv configuration types, allowing
more than one configuration file.

Section names are not suitable for naming the different
configurations since each file can be the result of multiple sections
in case of backup partitions.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
3 years agobcm4908: fix Netgear R8000P image
Rafał Miłecki [Wed, 7 Apr 2021 12:38:45 +0000 (14:38 +0200)]
bcm4908: fix Netgear R8000P image

Use vendor format to allow flashing using Negear UI.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agobcm4908: add sysupgrade support
Rafał Miłecki [Wed, 7 Apr 2021 12:14:57 +0000 (14:14 +0200)]
bcm4908: add sysupgrade support

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

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

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agomt76: update to the latest version
Felix Fietkau [Wed, 7 Apr 2021 08:58:01 +0000 (10:58 +0200)]
mt76: update to the latest version

7d35b7a15d1d mt76: mt7915: add wifi subsystem reset
04122c89749d mt76: fix rx amsdu subframe processing
5e764ec9bece mt76: mt7921: introduce MT_WFDMA_DUMMY_CR definition
cf0badbc0497 mt76: mt7921: fix inappropriate WoW setup with the missing ARP informaiton
f32a4e15f5b2 mt76: mt7921: fix the dwell time control
54f52771a04a mt76: mt7921: fix kernel crash when the firmware fails to download
97189d2a045b mt76: mt7921: fix the insmod hangs
dcdbd7c89cf5 mt76: mt7921: fix MT_PCIE_MAC_INT_ENABLE access
813db729c02f mt76: mt7921: reduce the data latency during hw scan

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agobcm4908: pad firmware image bootfs JFFS2 partition to 8 MiB
Rafał Miłecki [Wed, 7 Apr 2021 07:30:30 +0000 (09:30 +0200)]
bcm4908: pad firmware image bootfs JFFS2 partition to 8 MiB

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

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agofirmware-utils: bcm4908img: extract bootfs without padding
Rafał Miłecki [Wed, 7 Apr 2021 05:59:57 +0000 (07:59 +0200)]
firmware-utils: bcm4908img: extract bootfs without padding

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

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agofirmware-utils: bcm4908img: fix extracting cferom
Rafał Miłecki [Tue, 6 Apr 2021 22:17:40 +0000 (00:17 +0200)]
firmware-utils: bcm4908img: fix extracting cferom

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

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agofirmware-utils: bcm4908img: support extracting bootfs & rootfs
Rafał Miłecki [Mon, 5 Apr 2021 17:30:06 +0000 (19:30 +0200)]
firmware-utils: bcm4908img: support extracting bootfs & rootfs

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

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agofirmware-utils: bcm4908img: replace size with offset
Rafał Miłecki [Mon, 5 Apr 2021 23:06:52 +0000 (01:06 +0200)]
firmware-utils: bcm4908img: replace size with offset

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

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agoath79: ar934x-nand: fix broken nand on kernel 5.10
Koen Vandeputte [Tue, 6 Apr 2021 10:16:10 +0000 (12:16 +0200)]
ath79: ar934x-nand: fix broken nand on kernel 5.10

Booting current 5.10.x testing kernel shows this:

[    0.335781] nand: device found, Manufacturer ID: 0xec, Chip ID: 0xf1
[    0.342280] nand: Samsung NAND 128MiB 3,3V 8-bit
[    0.346982] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048,
OOB size: 64
[    0.354703] ar934x-nand 1b800200.nand: unknown ECC mode 2
[    0.360193] ar934x-nand 1b800200.nand: nand_scan failed, err:-22
[    0.366341] ar934x-nand: probe of 1b800200.nand failed with error -22

...

[    1.089264] /dev/root: Can't open blockdev
[    1.093482] VFS: Cannot open root device "(null)" or
unknown-block(0,0): error -6
[    1.101077] Please append a correct "root=" boot option; here are the
available partitions:
[    1.109555] 1f00              64 mtdblock0
[    1.109559]  (driver?)
[    1.116199] 1f01              48 mtdblock1
[    1.116202]  (driver?)
[    1.122841] 1f02               4 mtdblock2
[    1.122844]  (driver?)
[    1.129493] 1f03               4 mtdblock3
[    1.129497]  (driver?)
[    1.136138] 1f04               4 mtdblock4
[    1.136142]  (driver?)
[    1.142787] Kernel panic - not syncing: VFS: Unable to mount root fs
on unknown-block(0,0)
[    1.151168] Rebooting in 1 seconds..

The issue is caused by a wrong check for ECC engine type
on newer kernels.

Fix this.

Bootlog after:

[    0.335689] nand: device found, Manufacturer ID: 0xec, Chip ID: 0xf1
[    0.342192] nand: Samsung NAND 128MiB 3,3V 8-bit
[    0.346884] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048,
OOB size: 64
[    0.354611] Scanning device for bad blocks
[    0.364924] random: fast init done
[    0.496641] 3 fixed-partitions partitions found on MTD device
ar934x-nand
[    0.503545] Creating 3 MTD partitions on "ar934x-nand":
[    0.508865] 0x000000000000-0x000000040000 : "booter"
[    0.515133] 0x000000040000-0x000000400000 : "kernel"
[    0.523265] 0x000000400000-0x000008000000 : "ubi"

Fixes: fb64e2c30f ("ath79: ar934x-nand: add kernel 5.10 compatibility")
Signed-off-by: Koen Vandeputte <koen.vandeputte@citymesh.com>
3 years agobcm4908: rename bootfs dummy file to the 1-openwrt
Rafał Miłecki [Mon, 5 Apr 2021 22:03:31 +0000 (00:03 +0200)]
bcm4908: rename bootfs dummy file to the 1-openwrt

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

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

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agoglibc: update to latest git HEAD (BZ #27468, BZ #27511)
Hans Dedecker [Mon, 5 Apr 2021 16:34:19 +0000 (18:34 +0200)]
glibc: update to latest git HEAD (BZ #27468, BZ #27511)

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

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
3 years agouboot-mediatek: update to v2021.04
Daniel Golle [Mon, 5 Apr 2021 16:38:19 +0000 (17:38 +0100)]
uboot-mediatek: update to v2021.04

Remove patches merged upstream and refresh the remaining ones.
Runtime tested on
 * Bananapi BPi-R64 (eMMC and SD Card)
 * Linksys E8450 (SPI-NAND)
 * Ubiquiti UniFi 6 LR (SPI-NOR)

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agolldpd: further size reductions
Stijn Tintel [Mon, 5 Apr 2021 15:48:41 +0000 (18:48 +0300)]
lldpd: further size reductions

Size difference on mips_4kec:
Before: 120196
After:  120006

Closes https://github.com/openwrt/openwrt/pull/3823

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Suggested-by: Lucian Cristian <lucian.cristian@gmail.com>
3 years agolldpd: enable LTO
Stijn Tintel [Mon, 5 Apr 2021 15:30:45 +0000 (18:30 +0300)]
lldpd: enable LTO

Size difference on mips_4kec:
W/o LTO: 139674
W/ LTO:  120196

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Suggested-by: Lucian Cristian <lucian.cristian@gmail.com>
3 years agolldpd: bump to 1.0.9
Stijn Tintel [Mon, 5 Apr 2021 14:35:39 +0000 (17:35 +0300)]
lldpd: bump to 1.0.9

Contains fixes related to CVE-2020-27827.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
3 years agolldpd: add libcap dependency
Stijn Tintel [Thu, 11 Mar 2021 23:10:07 +0000 (01:10 +0200)]
lldpd: add libcap dependency

Now that libcap is in OpenWrt base, we can drop our custom patch to
disable libcap support and have lldpd depend on it instead. This will
allow the monitor process to drop its privileges instead of running as
root, improving security.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
3 years agolibcap: bump to 2.48
Stijn Tintel [Thu, 11 Mar 2021 23:08:25 +0000 (01:08 +0200)]
libcap: bump to 2.48

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
3 years agolibcap: drop invalid copyright header
Stijn Tintel [Thu, 11 Mar 2021 23:03:43 +0000 (01:03 +0200)]
libcap: drop invalid copyright header

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
3 years agolibcap: import from packages feed
Stijn Tintel [Thu, 11 Mar 2021 23:03:22 +0000 (01:03 +0200)]
libcap: import from packages feed

Having libcap in OpenWrt base allows us to enable libcap support in
other packages in base.

In lldpd, this would allow the monitor process to drop its privileges
instead of running as root, improving security. It will also allow us to
drop our patch to disable libcap.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
3 years agobcm4908: enable JFFS2 support
Rafał Miłecki [Mon, 5 Apr 2021 08:44:46 +0000 (10:44 +0200)]
bcm4908: enable JFFS2 support

It's needed for accessing JFFS2 bootfs partition.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agofirmware-utils: bcm4908img: add bootfs support
Rafał Miłecki [Fri, 2 Apr 2021 15:28:21 +0000 (17:28 +0200)]
firmware-utils: bcm4908img: add bootfs support

This adds support for accessing bootfs JFFS2 partition in the BCM4908
image. Support includes:
1. Listing files
2. Renaming file (requires unchanged name length)

Above commands are useful for flashing BCM4908 images which by defualt
come with cferom.000 file and require renaming it.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agofirmware-utils: bcm4908img: support extracting image data
Rafał Miłecki [Fri, 2 Apr 2021 14:31:43 +0000 (16:31 +0200)]
firmware-utils: bcm4908img: support extracting image data

It's useful for upgrading cferom, firmware, etc.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agofirmware-utils: bcm4908img: find cferom size
Rafał Miłecki [Fri, 2 Apr 2021 13:04:46 +0000 (15:04 +0200)]
firmware-utils: bcm4908img: find cferom size

It's important for modifying / extracting firmware content. cferom is
optional image content at the file beginning.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agofirmware-utils: bcm4908img: use "info" command displaying file info
Rafał Miłecki [Fri, 2 Apr 2021 12:12:58 +0000 (14:12 +0200)]
firmware-utils: bcm4908img: use "info" command displaying file info

BCM4908 image format contains some info that may be useful for info /
debugging purposes.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agofirmware-utils: bcm4908img: support reading from stdin
Rafał Miłecki [Sun, 4 Apr 2021 12:53:00 +0000 (14:53 +0200)]
firmware-utils: bcm4908img: support reading from stdin

1. Don't allow pipe stdin as we need to fseek()
2. Don't alow TTY as it doesn't make sense for binary input

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agofirmware-utils: bcm4908img: detect Netgear vendor firmware
Rafał Miłecki [Fri, 2 Apr 2021 11:59:02 +0000 (13:59 +0200)]
firmware-utils: bcm4908img: detect Netgear vendor firmware

Netgear uses CHK header which needs to be skipped when validating
BCM4908 image. Detect it directly in the bcm4908img tool. Dealing with
binary structs and endianess is way simpler in C.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agofirmware-utils: bcm4908img: extract parsing code
Rafał Miłecki [Fri, 2 Apr 2021 11:02:51 +0000 (13:02 +0200)]
firmware-utils: bcm4908img: extract parsing code

Move code parsing existing firmware file to separated function. This
cleans up existing code and allows reusing parsing code for other
commands.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agoipq40xx: add MikroTik hAP ac2 support
Robert Marko [Thu, 12 Nov 2020 18:45:22 +0000 (19:45 +0100)]
ipq40xx: add MikroTik hAP ac2 support

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

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

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

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

Signed-off-by: Robert Marko <robimarko@gmail.com>
3 years agouboot-mediatek: bpi-r64: no longer force recovery on first-boot
Daniel Golle [Fri, 2 Apr 2021 14:45:02 +0000 (15:45 +0100)]
uboot-mediatek: bpi-r64: no longer force recovery on first-boot

Now that sdcard.gz image contains everything needed to boot straight
into production image, no longer force booting into recovery image on
first boot by removing the logic which implemented that.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agomt76: update to the latest version
Felix Fietkau [Sun, 4 Apr 2021 09:28:48 +0000 (11:28 +0200)]
mt76: update to the latest version

465dda65ee84 mt7615,mt7915: replace fw log 0-terminating code with wiphy info length limit
62b13f5352b8 mt76: mt7921: fix key set/delete issue
0ff3a336a8d8 mt7615,mt7915: fix a compiler warning
113ba8a81d54 mt76: mt7615: remove redundant dev_err call in mt7622_wmac_probe()
be1ab3b9ae7c mt76: mt7921: fix typo in mt7921_pci_resume
4e22f0dc934b mt76: mt7915: fix txpower init for TSSI off chips
e66a0b9b8d66 mt76: mt7615: always wake the device in mt7615_remove_interface
38f656768a90 mt76: mt7921: always wake the device in mt7921_remove_interface
6ee4770de083 mt76: mt7921: rework mt7921_mcu_debug_msg_event routine
e578b4b8d56a mt76: mt7615: fix .add_beacon_offload()
f8c6c7cbf10f mt76: mt7915: fix mt7915_mcu_add_beacon

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agokernel: bump 5.10 to 5.10.27
Kevin Darbyshire-Bryant [Tue, 30 Mar 2021 21:01:27 +0000 (22:01 +0100)]
kernel: bump 5.10 to 5.10.27

Use update_kernel to refresh all patches, required manual updates to:

610-netfilter_match_bypass_default_checks.patch
611-netfilter_match_bypass_default_table.patch
762-net-bridge-switchdev-Refactor-br_switchdev_fdb_notif.patch
764-net-bridge-switchdev-Send-FDB-notifications-for-host.patch

Run-tested: x86_64

Nothing screamed out but any funny business with linux bridging should
suspect this update first.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
3 years agonetifd: update to Git version 2021-04-03
Hauke Mehrtens [Sat, 3 Apr 2021 17:11:38 +0000 (19:11 +0200)]
netifd: update to Git version 2021-04-03

f8899b9 netifd: bridge: set default value for igmp_snoop
327da98 netifd: add possibility to switch off route config

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
3 years agouclient: update to Git version 2021-04-03
Hauke Mehrtens [Sat, 3 Apr 2021 17:04:53 +0000 (19:04 +0200)]
uclient: update to Git version 2021-04-03

83efca2 tests: fix possibly longer start of HTTP server
64e00d6 uclient-fetch: document missing options

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
3 years agohostapd: enable airtime policy for the -basic variants
Rui Salvaterra [Wed, 25 Nov 2020 23:03:48 +0000 (23:03 +0000)]
hostapd: enable airtime policy for the -basic variants

Airtime policy configuration is extremely useful in multiple BSS scenarios.
Since nowadays most people configure both private and guest networks (at
least), it makes sense to enable it by default, except for the most limited
of the variants.

Size of the hostapd-basic-openssl binary (mipsel 24Kc -O2):
543944 bytes (airtime policy disabled)
548040 bytes (airtime policy enabled)

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
Acked-by: Daniel Golle <daniel@makrotopia.org>
3 years agorealtek: rename partitions in Netgear DTSI
Stijn Segers [Sun, 28 Feb 2021 21:50:15 +0000 (22:50 +0100)]
realtek: rename partitions in Netgear DTSI

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

Signed-off-by: Stijn Segers <foss@volatilesystems.org>
3 years agozram-swap: bail out early if the kernel doesn't support swap
Rui Salvaterra [Thu, 1 Apr 2021 13:36:33 +0000 (14:36 +0100)]
zram-swap: bail out early if the kernel doesn't support swap

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

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
3 years agozram-swap: clean up the makefile
Rui Salvaterra [Thu, 1 Apr 2021 13:36:32 +0000 (14:36 +0100)]
zram-swap: clean up the makefile

Break dependencies into separate lines, to improve the readability. Trim
trailing whitespace.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
3 years agolantiq: add basic support for AVM FRITZ!Box 3390
Andreas Böhler [Thu, 23 Jan 2020 20:20:38 +0000 (21:20 +0100)]
lantiq: add basic support for AVM FRITZ!Box 3390

The FRITZ!Box 3390 actually contains two SoCs, one Lantiq with a
5GHz WiFi and one AR9342 with a 2.4GHz WiFi. Only the Lantiq
has access to the flash memory, the Atheros runs fully from RAM.

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

  - Lantiq 500 MHz
  - 128MiB RAM
  - 128MiB NAND
  - 256k Flash
  - AR9580 5GHz WiFi
  - AR9342 560 MHz
  - 64MiB RAM
  - AR9328 2.4GHz WiFi

Remarks
-------

This commit only adds support for the Lantiq side of things and
prepares the drivers for communication with the Atheros SoC. Thus,
only 5GHz WiFi works by default, the 2.4GHz WiFi will be added via
another target.

Some kernel patches will be required to add support for the Atheros SoC.

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

Use the eva_ramboot.py script to boot the initramfs image. Then, transfer
the sysupgrade image to the device and run sysupgrade to flash it to the
NAND.

Signed-off-by: Andreas Böhler <dev@aboehler.at>
Acked-by: Aleksander Jan Bajkowski A.Bajkowski@stud.elka.pw.edu.pl
Signed-off-by: Joachim Cerny <cocktail_yogi@web.de>
3 years agolantiq: VR9: fix gpio-hog by defining the GPIO ranges
Joachim Cerny [Tue, 8 Dec 2020 16:41:56 +0000 (17:41 +0100)]
lantiq: VR9: fix gpio-hog by defining the GPIO ranges

defined gpio-ranges according to Reference: https://github.com/torvalds/linux/blob/master/drivers/pinctrl/pinctrl-xway.c#L864
This change is needed by gpio-hog on Fritzbox 3390
thx to @abajk

Acked-by: Aleksander Jan Bajkowski A.Bajkowski@stud.elka.pw.edu.pl
Signed-off-by: Andreas Böhler <dev@aboehler.at>
Signed-off-by: Joachim Cerny <cocktail_yogi@web.de>
3 years agolantiq: use ActualNetDataRate for speed reporting
Jeroen Peelaerts [Tue, 9 Feb 2021 22:33:51 +0000 (23:33 +0100)]
lantiq: use ActualNetDataRate for speed reporting

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

Refer to ITU-T G.997.1 chapter 7.5.2.8

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

Signed-off-by: Jeroen Peelaerts <jeroen.peelaerts@gmail.com>
Reviewed-by: Andre Heider <a.heider@gmail.com>
3 years agolantiq: enable G.INP retransmission counters
Jeroen Peelaerts [Sat, 16 May 2020 10:12:46 +0000 (12:12 +0200)]
lantiq: enable G.INP retransmission counters

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

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

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

Reviewed-by: Andre Heider <a.heider@gmail.com>
Signed-off-by: Jeroen Peelaerts <jeroen.peelaerts@gmail.com>
3 years agoramips: fix IMAGE_SIZE of HC5x6: fix image size of HC5x61
Shiji Yang [Thu, 4 Mar 2021 09:59:14 +0000 (17:59 +0800)]
ramips: fix IMAGE_SIZE of HC5x6: fix image size of HC5x61

"firmware" partition size defined in the device tree file is 0xf70000,
so the right IMAGE_SIZE is 15808k

Fixes: df1e5d646345 ("ramips: fix partition layout of hiwifi hc5x61")
Signed-off-by: Shiji Yang <yangshiji66@qq.com>
3 years agoramips: Fix booting on MQmaker WiTi board
Daniel Engberg [Fri, 19 Mar 2021 11:18:02 +0000 (12:18 +0100)]
ramips: Fix booting on MQmaker WiTi board

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

Fixes: FS#3057
Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
3 years agoramips: Fix booting on MTC WR1201
René van Dorst [Sat, 20 Mar 2021 19:15:14 +0000 (20:15 +0100)]
ramips: Fix booting on MTC WR1201

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

Fixes: FS#3057
Signed-off-by: René van Dorst <opensource@vdorst.com>
3 years agoarmvirt: add 5.10 testing kernel
Aleksander Jan Bajkowski [Fri, 5 Mar 2021 19:16:35 +0000 (20:16 +0100)]
armvirt: add 5.10 testing kernel

Add 5.10 as testing kernel. Builds successfully with
CONFIG_ALL_KMODS=y enabled.

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
3 years agoarmvirt: refresh 5.10 config
Aleksander Jan Bajkowski [Fri, 5 Mar 2021 19:18:20 +0000 (20:18 +0100)]
armvirt: refresh 5.10 config

This was done by executing these commands:
$ make kernel_oldconfig CONFIG_TARGET=subtarget
$ make kernel_oldconfig CONFIG_TARGET=subtarget_platform

Some common symbols have been moved to target config.

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
3 years agoarmvirt: copy config files for 5.10
Aleksander Jan Bajkowski [Fri, 19 Mar 2021 18:44:12 +0000 (19:44 +0100)]
armvirt: copy config files for 5.10

Copy config and patches for 5.10.

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
3 years agoarmvirt: refresh 5.4 config
Aleksander Jan Bajkowski [Thu, 4 Mar 2021 23:51:04 +0000 (00:51 +0100)]
armvirt: refresh 5.4 config

This was done by executing these commands:
$ make kernel_oldconfig CONFIG_TARGET=subtarget
$ make kernel_oldconfig CONFIG_TARGET=subtarget_platform

Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
3 years agobase-files: fix status display command
Alexander Egorenkov [Sun, 28 Mar 2021 08:45:08 +0000 (10:45 +0200)]
base-files: fix status display command

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

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

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

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

Signed-off-by: Alexander Egorenkov <egorenar-dev@posteo.net>
3 years agoiproute2: fix libbpf detection with NLS enabled
Tony Ambardar [Sat, 27 Mar 2021 12:43:03 +0000 (05:43 -0700)]
iproute2: fix libbpf detection with NLS enabled

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

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

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

Reported-by: Ian Cooper <iancooper@hotmail.com>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
3 years agobinutils: fix libbfd missing DSO dependency if NLS enabled
Tony Ambardar [Sun, 28 Mar 2021 07:40:31 +0000 (00:40 -0700)]
binutils: fix libbfd missing DSO dependency if NLS enabled

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

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

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

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

Fixes: 08e817569630 ("binutils: use nls.mk to fix libbfd link errors in
other packages")
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
3 years agobpftools: drop unneeded libintl linking for NLS
Tony Ambardar [Sun, 28 Mar 2021 08:12:22 +0000 (01:12 -0700)]
bpftools: drop unneeded libintl linking for NLS

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

Fixes: 5582fbd6135f ("bpftools: support NLS, fix ppc build and update to 5.8.9")
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
3 years agokernel: bump 5.4 to 5.4.109
John Audia [Tue, 30 Mar 2021 14:52:07 +0000 (10:52 -0400)]
kernel: bump 5.4 to 5.4.109

Ran update_kernel.sh in a fresh clone without any existing toolchains.

Manually rebased:
  pending-5.4/611-netfilter_match_bypass_default_table.patch

The upstream change affecting this patch is the revert of an earlier
kernel commit. Therefore, we just revert our corresponding changes
in [1].

Build system: x86_64
Build-tested: ipq806x/R7800

[1] 9b1b89229f0e ("kernel: bump 5.4 to 5.4.86")

Signed-off-by: John Audia <graysky@archlinux.us>
[adjust manually rebased patch, add explanation]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agobcm53xx: enhance support for Linksys EA9500
Vivek Unune [Fri, 13 Nov 2020 13:43:00 +0000 (08:43 -0500)]
bcm53xx: enhance support for Linksys EA9500

1. Add leds and configs
2. Add network configs
3. Add script to clear partial boot flag
4. Hack to use port 5 as cpu port as port 8 connected to eth2
   wont pass any frames
5. Enable EA9500 image generation

Hardware Info:

- Processor - Broadcom BCM4709C0KFEBG dual-core @ 1.4 GHz
- Switch - BCM53012 in BCM4709C0KFEBG & external BCM53125
- DDR3 RAM - 256 MB
- Flash - 128 MB (Toshiba TC58BVG0S3HTA00)
- 2.4GHz - BCM4366 4×4 2.4/5G single chip 802.11ac SoC
- Power Amp - Skyworks SE2623L 2.4 GHz power amp (x4)
- 5GHz x 2 - BCM4366 4×4 2.4/5G single chip 802.11ac SoC
- Power Amp - PLX Technology PEX8603 3-lane, 3-port PCIe switch
- Ports - 8 Ports, 1 WAN Ports
- Antennas - 8 Antennas
- Serial Port - @j6 [GND,TX,RX] (VCC NC) 115200 8n1

Flashing Instructions:

1. Connect a USB-TTL table to J6 on the router as well as a
   ethernet cable to a lan port and your PC.
2. Power-on the router.
3. Use putty or a serial port program to view the terminal.
   Hit Ctrl+C and interrupt the CFE terminal terminal.
4. Setup a TFTP server on your local machine at setup you
   local IP to 192.168.1.2
5. Start the TFTP Server
6. Run following commands at the CFE terminal

   flash -noheader 192.168.1.2:/openwrt.trx nflash0.trx
   flash -noheader 192.168.1.2:/openwrt.trx nflash0.trx2
   nvram set bootpartition=0 && nvram set partialboots=0 && nvram commit

7. Reboot router to be presented by OpenWrt

Note: Only installation method via serial cable is supported at the moment.
The trx firmware has to be flashed to both the partitions using following
commands from CFE prompt. This will cover US and Non-US variants.

Signed-off-by: Vivek Unune <npcomplete13@gmail.com>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agobcm53xx: use upstream Linksys EA9500 fixes
Rafał Miłecki [Thu, 1 Apr 2021 05:00:06 +0000 (07:00 +0200)]
bcm53xx: use upstream Linksys EA9500 fixes

One fix was accepted, one was added.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agofirewall4: update to latest Git HEAD
Jo-Philipp Wich [Wed, 31 Mar 2021 22:21:55 +0000 (00:21 +0200)]
firewall4: update to latest Git HEAD

29fba84 tests: expand testing
6bf82a8 fw4.uc: fix family test functions
25b2c7d fw4.uc: fix parsing boolean "0" values
694d428 rule.uc: fix redundant whitespace in rules without target
7f69fbb ruleset.uc: reduce empty lines in output
8f8e42c fw4.uc: gracefully handle missing defaults section
25287af treewide: remove ucode module preloading
802b685 fw4.uc: remove upvalue caching

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
3 years agoucode: update to latest Git HEAD
Jo-Philipp Wich [Wed, 31 Mar 2021 22:07:56 +0000 (00:07 +0200)]
ucode: update to latest Git HEAD

973cc6c compiler: actually expand block scope fix to for/while alt syntax
97bf297 compiler: ensure that alternative if/for/while syntax has own block scope
f0e2a64 tests: add missing test case for fixed switch codegen

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
3 years agouboot-mediatek: adapt root= cmdline arg for bpi-r64
Daniel Golle [Wed, 31 Mar 2021 20:32:23 +0000 (21:32 +0100)]
uboot-mediatek: adapt root= cmdline arg for bpi-r64

Adapt to FIT partition parser changes.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agokernel: fix FIT partition parser compatibility issues
Daniel Golle [Wed, 31 Mar 2021 20:29:26 +0000 (21:29 +0100)]
kernel: fix FIT partition parser compatibility issues

The uImage.FIT partition parser used to squeeze in FIT partitions in
the range where partition editor tools (fdisk and such) expect the
regular partition. This is confusing people and tools when adding
additional partitions on top of the partition used for OpenWrt's
uImage.FIT.
Instead of squeezing in the additional partitions, rather start with
all uImage.FIT partitions at offset 64.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agobcm4908: backport DT patch adding Ethernet MAC address
Rafał Miłecki [Wed, 31 Mar 2021 21:14:24 +0000 (23:14 +0200)]
bcm4908: backport DT patch adding Ethernet MAC address

This tells OS (Linux) where from MAC should be read (bootloader MTD
partition).

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agomediatek: mt7622: improve sysupgrade on MMC
Daniel Golle [Wed, 31 Mar 2021 13:19:16 +0000 (14:19 +0100)]
mediatek: mt7622: improve sysupgrade on MMC

Use generic functions to acquire rootdev.
Make sure to wipe rootfs_data in case of '-n'.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agobase-files: functions: introduce new helper functions
Daniel Golle [Wed, 31 Mar 2021 12:47:35 +0000 (13:47 +0100)]
base-files: functions: introduce new helper functions

Introduce cmdline_get_var() to /lib/function.sh and make use of it in
export_rootdev() in /lib/upgrade/common.sh, making the code more
simple and removing one level of indentation.
Introduce get_partition_by_name() to /lib/upgrade/common.sh which is
useful on non-EFI GPT platforms like mt7622.
Remove some dead-code while at it.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agobmips: backport pinctrl fixes
Álvaro Fernández Rojas [Wed, 31 Mar 2021 15:13:36 +0000 (17:13 +0200)]
bmips: backport pinctrl fixes

Backport some minor upstream fixes for the pinctrl drivers.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
3 years agonetifd: update to git HEAD
Daniel Golle [Wed, 31 Mar 2021 00:32:51 +0000 (01:32 +0100)]
netifd: update to git HEAD

 09632d4 device: remove left-over comment
 b22f83d handler: add mechanism to generate external device handler stubs
 80bf9d7 extdev: add support for external device handlers
 44c0f40 system-linux: reorder sysctl functions
 c84f3b0 system-linux: add device options used by wpad

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agoramips: mt7620: ralink-i2s: fix modpost error
Ilya Lipnitskiy [Fri, 26 Mar 2021 06:23:01 +0000 (23:23 -0700)]
ramips: mt7620: ralink-i2s: fix modpost error

Fixes the following error when building without CONFIG_MODULE_STRIPPED:
  FATAL: modpost: sound/soc/ralink/snd-soc-ralink-i2s: struct
  of_device_id is not terminated with a NULL entry!

Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
3 years agoramips/mt7621: enable support for cpuidle
Rui Salvaterra [Tue, 30 Mar 2021 22:59:50 +0000 (23:59 +0100)]
ramips/mt7621: enable support for cpuidle

MIPS Coherent Processor Systems (CPS), which include the MT7621 SoC, support
deep sleep idle states and have a specific cpuidle driver for them.
Enable support for it, while also switching from constant timer ticks to the
idle dynticks model, with the TEO governor.

Run-tested on a Redmi AC2100.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
3 years agoramips/mt7621: drop the timer recalibration patch
Rui Salvaterra [Tue, 30 Mar 2021 22:59:49 +0000 (23:59 +0100)]
ramips/mt7621: drop the timer recalibration patch

We've been carrying this patch for many years [1], in order to fix a timer
calibration issue on MT7621. Turns out, after retesting with a recent kernel
(Linux 5.10), the system works perfectly fine without it (no rcu_sched stalls
or inconsistent BogoMIPS values across CPUs).

Manually refreshed:
322-mt7621-fix-cpu-clk-add-clkdev.patch
323-mt7621-memory-detect.patch

[1] https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=6f4a903533361a2906a4d94ac6f597cd9c6c47bc

Suggested-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Tested-by: Donald Hoskins <grommish@gmail.com>
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
3 years agoramips/mt7621: drop the weak reordering patch
Rui Salvaterra [Tue, 30 Mar 2021 22:59:48 +0000 (23:59 +0100)]
ramips/mt7621: drop the weak reordering patch

In order to fix random hangs on MT7621, we've been selecting
WEAK_REORDERING_BEYOND_LLSC for years [1]. However, these random hangs have been
most likely caused by an oversight in the MIPS implementation of the kernel
memory consistency model, which has already been fixed for some time (and
backported to stable) [2].

Manually refreshed:
321-mt7621-timer.patch

[1] https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=5c971cd6fdd7298a2017bdb6bea870088eddb8b9
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/mips?h=linux-5.4.y&id=42344113ba7a1ed7b5654cd5270af0d5698d8521

Suggested-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Tested-by: Donald Hoskins <grommish@gmail.com>
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
3 years agofirewall: update to latest git HEAD
Hans Dedecker [Mon, 29 Mar 2021 19:04:06 +0000 (21:04 +0200)]
firewall: update to latest git HEAD

a4355a6 firewall3: clean up the flow table detection logic
edd0dc5 firewall3: create a common helper to find strings in files

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
3 years agoncurses: add screen-256color terminfo
Paul Spooren [Mon, 29 Mar 2021 08:31:21 +0000 (22:31 -1000)]
ncurses: add screen-256color terminfo

The terminfo is required by the popular terminal multiplexer screen and
tmux, offer it by default as the size impact is minimal with 885 Bytes.

Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agoncurses: split long line of supported terminfo
Paul Spooren [Mon, 29 Mar 2021 08:21:49 +0000 (22:21 -1000)]
ncurses: split long line of supported terminfo

The terminfo files were all in one row which is terrible to read.
Split them over multiple lines to improve readability.

Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agosunxi: enable wifi module on Pine64 boards
Zoltan HERPAI [Sun, 28 Feb 2021 15:42:05 +0000 (16:42 +0100)]
sunxi: enable wifi module on Pine64 boards

The Pine64(+) and the SoPine64 baseboard has an optional BT+WiFi
module, carrying an RTL8723BS. The wifi part is connected via
SDIO, the BT part is connected via UART. The BT part requires
additional code changes in the drivers so we'll skip that until 5.10.
Aside from a DTS patch to enable the wifi module, add the required
packages into the device definitions.

[    8.996970] RTL8723BS: module init start
[    9.000922] RTL8723BS: rtl8723bs v4.3.5.5_12290.20140916_BTCOEX20140507-4E40
[    9.007965] RTL8723BS: rtl8723bs BT-Coex version = BTCOEX20140507-4E40
[    9.014785] pnetdev = 000000009bdd5000
[    9.047780] RTL8723BS: rtw_ndev_init(wlan0)
[    9.053349] RTL8723BS: module init ret =0

root@OpenWrt:/# iw list
Wiphy phy0
        wiphy index: 0
        max # scan SSIDs: 9
        max scan IEs length: 2304 bytes
        max # sched scan SSIDs: 0
        max # match sets: 0
        Retry short limit: 7
        Retry long limit: 4
        Coverage class: 0 (up to 0m)
        Available Antennas: TX 0 RX 0
        Supported interface modes:
                 * IBSS
                 * managed
                 * AP
                 * monitor
        Band 1:
                Frequencies:
                        * 2412 MHz [1] (20.0 dBm)
                        * 2417 MHz [2] (20.0 dBm)
                        * 2422 MHz [3] (20.0 dBm)
                        * 2427 MHz [4] (20.0 dBm)
                        * 2432 MHz [5] (20.0 dBm)
                        * 2437 MHz [6] (20.0 dBm)
                        * 2442 MHz [7] (20.0 dBm)
                        * 2447 MHz [8] (20.0 dBm)
                        * 2452 MHz [9] (20.0 dBm)
                        * 2457 MHz [10] (20.0 dBm)
                        * 2462 MHz [11] (20.0 dBm)
                        * 2467 MHz [12] (20.0 dBm) (no IR)
                        * 2472 MHz [13] (20.0 dBm) (no IR)
                        * 2484 MHz [14] (20.0 dBm) (no IR)

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
3 years agosunxi: enable MUSB in A53 subtarget
Zoltan HERPAI [Sun, 28 Feb 2021 11:51:27 +0000 (12:51 +0100)]
sunxi: enable MUSB in A53 subtarget

The Pine64(+) and the SoPine64 baseboard has two USB ports. One of
these (the lower) is connected directly to a USB host, the other
one's (upper) PHY is shared with the separate OTG controller. In
order to get it working, MUSB support needs to be enabled.

As there are other targets which compile MUSB support into the kernel
and not package it into modules, the same is done here.

[    1.348760] usb usb5: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.04
[    1.357029] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.364250] usb usb5: Product: MUSB HDRC host driver
[    1.369219] usb usb5: Manufacturer: Linux 5.4.99 musb-hcd
[    1.374617] usb usb5: SerialNumber: musb-hdrc.1.auto
[    1.379891] hub 5-0:1.0: USB hub found
[    1.383677] hub 5-0:1.0: 1 port detected
[...]
[  697.299440] usb 1-1: new high-speed USB device number 2 using ehci-platform
[  697.461855] usb 1-1: New USB device found, idVendor=090c, idProduct=1000, bcdDevice=11.00
[  697.470038] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  697.477180] usb 1-1: Product: USB Flash Disk

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
3 years agobmips: dts: align LEDs
Álvaro Fernández Rojas [Wed, 24 Mar 2021 10:30:23 +0000 (11:30 +0100)]
bmips: dts: align LEDs

Align all bmips devices LED configurations.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
3 years agobmips: backport accepted pinctrl patches
Álvaro Fernández Rojas [Tue, 2 Mar 2021 19:19:30 +0000 (20:19 +0100)]
bmips: backport accepted pinctrl patches

These patches have been accepted for linux v5.13.
External interrupts not supported for now.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
3 years agobmips: vr-3032u: fix gpio keys
Álvaro Fernández Rojas [Wed, 24 Mar 2021 10:11:47 +0000 (11:11 +0100)]
bmips: vr-3032u: fix gpio keys

These GPIO keys were assigned to incorrect pins.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
3 years agobmips: dgnd3700-v2: fix gpio keys
Álvaro Fernández Rojas [Wed, 24 Mar 2021 10:09:27 +0000 (11:09 +0100)]
bmips: dgnd3700-v2: fix gpio keys

These GPIO keys were assigned to incorrect pins.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
3 years agoucode: update to latest Git HEAD
Jo-Philipp Wich [Mon, 29 Mar 2021 10:50:55 +0000 (12:50 +0200)]
ucode: update to latest Git HEAD

aa9621d compiler: rework switch statement code generation
b5f0de1 vm: add trace mode instruction dump output fixes
0341d64 vm: fix another for-loop memory leak
00d9419 vm: fix further memory leaks in trace mode
20a3763 vm: fix loop variable memory leak in NEXTK/NEXTKV instruction
9a6ef2b lib: prevent use-after-free after uc_shift()
03f1324 object: free prototype object when registering existing ressource type
b3d758b compiler: fix for/break miscompilation
86e3970 lib: fix value refcount of uc_unshift() return value
fe464ea run_tests.sh: allow passing tests to run as arguments
091ae1b compiler: fix another try/catch miscompilation
fcedb19 lib: fix passing uninitialized memory to sigprocmask()
0d0357d vm: fix leaking source context strings in trace mode
7a41fb3 lib: use execvp() in system()

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
3 years agobcm53xx: fix Linksys EA9500 partitions
Rafał Miłecki [Mon, 29 Mar 2021 07:28:47 +0000 (09:28 +0200)]
bcm53xx: fix Linksys EA9500 partitions

Use proper DT binding.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agokernel: backport 5.13 mtd partitioning changes
Rafał Miłecki [Mon, 29 Mar 2021 06:16:17 +0000 (08:16 +0200)]
kernel: backport 5.13 mtd partitioning changes

1. Use upstream accepted NVMEM patches
2. Minor fix for BCM4908 partitioning
3. Support for Linksys firmware partitions on Northstar

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
3 years agomac80211: merge a few pending tx related fixes
Felix Fietkau [Sun, 28 Mar 2021 10:15:42 +0000 (12:15 +0200)]
mac80211: merge a few pending tx related fixes

Improve performance and fix potential mgmt tx hangs/warnings

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agofirewall3: update to latest git HEAD
Tony Ambardar [Fri, 26 Mar 2021 05:47:36 +0000 (22:47 -0700)]
firewall3: update to latest git HEAD

This includes several improvements and fixes:

  61db17e rules: fix device and chain usage for DSCP/MARK targets
  7b844f4 zone: avoid duplicates in devices list
  c2c72c6 firewall3: remove last remaining sprintf()
  12f6f14 iptables: fix serializing multiple weekdays
  00f27ab firewall3: fix duplicate defaults section detection
  e8f2d8f ipsets: allow blank/commented lines with loadfile
  8c2f9fa fw3: zones: limit zone names to 11 bytes
  78d52a2 options: fix parsing of boolean attributes

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
3 years agomvebu: Fix mac addresses for GL.iNet GL-MV1000
Sven Eckelmann [Thu, 25 Mar 2021 12:26:15 +0000 (13:26 +0100)]
mvebu: Fix mac addresses for GL.iNet GL-MV1000

The original GL.iNet firmware has two different mac addresses in the
factory/art partition. The first one is for the WAN interface only and the
second one is for both lan0 and lan1.

But the original submission for OpenWrt didn't initialize the mac
addresses of the LAN ports for the DSA device at all. The ethernet mac
address was then used for all DSA ports.

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