Commit Graph

54621 Commits

Author SHA1 Message Date
Christian Marangi
f4dd18ca39
scripts: ext-toolchain: add option to overwrite config
It can be useful to overwrite an already generated config.
Option are simply added at the end of the config and make defconfig
will overwrite the relevant option with the new one.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-07-24 19:53:44 +02:00
Christian Marangi
53c293262f
scripts: ext-toolchain: fix wrong prefix in print_config generation
The parsed prefix in print_config is wrong and this produce broken
generated .config that won't work with any external toolchain.

Currently the prefix from a CC of

'arm-openwrt-linux-muslgnueabi-gcc-12.1.0'

produce a prefix

'arm-openwrt-linux-muslgnueabi-gcc-'

This is wrong as the real prefix should be

'arm-openwrt-linux-muslgnueabi-'

This is probably caused by a change in how the toolchain is now handled
that now append also the gcc version. Probably in ancient days the
version wasn't part of the name and the prefix generation stripped the
'-gcc' instead of the gcc version.

Fix this and correctly strip the gcc version and the gcc suffix to
correctly call toolchain bins.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-07-24 19:53:43 +02:00
Christian Marangi
a90eabf602
rules_mk: don't include wrapped bin with external toolchains
Don't add wrapped bin to the TARGET_PATH as it does cause compilation
error.

cmake.mk will use the "command -v" and will use the wrapped bin instead
of the external toolchain bin as they have the same name and command
will select the first result.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-07-24 19:53:43 +02:00
Vincent Wiemann
2555ffb453
rules_mk: use gcc versions for external toolchain
When using the OpenWrt toolchain as an external toolchain the build
failed due to missing LTO support. By choosing the GCC wrappers of
the tools this commit makes sure that the LTO-enabled executables
are being used.

Signed-off-by: Vincent Wiemann <vincent.wiemann@ironai.com>
[ wrap the commit description to 72 char ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-07-24 19:53:43 +02:00
Daniel Kestrel
0f301b0b1d lantiq: fix network port GPIO settings for Fritzbox 3390
There are forum reports that 2 LAN ports are not working, the
GPIO settings are adjusted to fix the problem.

Signed-off-by: Daniel Kestrel <kestrel1974@t-online.de>
2022-07-22 22:05:23 +02:00
Christian Lamparter
69ea671320 ipq806x: Archer VR2600: fix switch ports numbering
The order of LAN ports shown in Luci is reversed compared to what is
written on the case of the device.  Fix the order so that they match.

Fixes: #10275
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-07-22 22:03:27 +02:00
Christian Lamparter
d4391ef073 layerscape: update remaining PKG_HASH / PKG_MIRROR_HASH
The change of the PKG_VERSION caused the hash of the package to
change. This is because the PKG_VERSION is present in the
internal directory structure of the archive.

Fixes: e879cccaa2 ("uboot-layerscape: update PKG_HASH")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-07-22 22:03:27 +02:00
Martin Blumenstingl
8083d225f3 generic: 5.15: Disable more config symbols
These came up while trying to build the lantiq target with Linux 5.15.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
2022-07-22 16:53:20 +02:00
Sander Vanheule
a3e4949998 realtek: clear spurious GPIO interrupts
The interrupt controller in the internal GPIO peripheral will sometimes
generate spurious interrupts. If these are not properly acknowledged, the
system will be held busy until reboot. These spurious interrupts are identified
by the fact that there is no system IRQ number associated, since the interrupt
line was never allocated. Although most prevalent on RTL839x, RTL838x SoCs have
also displayed this behaviour.

Reported-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> # DGS-1210-52
Reported-by: Birger Koblitz <mail@birger-koblitz.de> # Netgear GS724TP v2
Reported-by: Jan Hoffmann <jan@3e8.eu> # HPE 1920-16G
Signed-off-by: Sander Vanheule <sander@svanheule.net>
2022-07-21 22:44:01 +02:00
David Bauer
a0b7fef0ff 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>
2022-07-20 21:52:06 +02:00
Rafał Miłecki
3f2b2fe084 bcm4908: prepare for Asus GT-AX6000 support
It isn't tested & Linux DT will surely need more work.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2022-07-20 20:04:50 +02:00
Rafał Miłecki
d63ef7c90f bcm4908: backport bcmbca DT patches queued for 5.20
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2022-07-20 20:04:50 +02:00
Hauke Mehrtens
d1b5d17d03 wolfssl: Do not activate HW acceleration on armvirt by default
The armvirt target is also used to run OpenWrt in lxc on other targets
like a Raspberry Pi. If we set WOLFSSL_HAS_CPU_CRYPTO by default the
wolfssl binray is only working when the CPU supports the hardware crypto
extension.

Some targets like the Raspberry Pi do not support the ARM CPU crypto
extension, compile wolfssl without it by default. It is still possible
to activate it in custom builds.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-07-20 17:02:45 +02:00
Andre Heider
5451b03b7c tools/libressl: bump to v3.5.3
This includes API additions required for u-boot v2022.07 and Python 3.10.

https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.5.0-relnotes.txt
https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.5.1-relnotes.txt
https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.5.2-relnotes.txt
https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.5.3-relnotes.txt

Signed-off-by: Andre Heider <a.heider@gmail.com>
2022-07-20 13:02:57 +02:00
Eneas U de Queiroz
bc43ad88ed
uencrypt: add package to decrypt WG4хх223 config
This adds a simple AES-128-CBC encryption/decryption program using
either wolfSSL or OpenSSL as backend to decrypt Arcadyan WG4xx223
configuration partitions.  The ipk size is 3,355 bytes.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2022-07-19 14:53:29 +02:00
Wenli Looi
0f068e7c4a
ramips: add support for Netgear WAX202
Netgear WAX202 is an 802.11ax (Wi-Fi 6) router.

Specifications:
* SoC: MT7621A
* RAM: 512 MiB NT5CC256M16ER-EK
* Flash: NAND 128 MiB F59L1G81MB-25T
* Wi-Fi:
  * MT7915D: 2.4/5 GHz (DBDC)
* Ethernet: 4x 1GbE
  * Switch: SoC built-in
* USB: None
* UART: 115200 baud (labeled on board)

Load addresses (same as ipTIME AX2004M):
* stock
  * 0x80010000: FIT image
  * 0x81001000: kernel image -> entry
* OpenWrt
  * 0x80010000: FIT image
  * 0x82000000: uncompressed kernel+relocate image
  * 0x80001000: relocated kernel image -> entry

Installation:
* Flash the factory image through the stock web interface, or TFTP to
  the bootloader. NMRP can be used to TFTP without opening the case.
* Note that the bootloader accepts both encrypted and unencrypted
  images, while the stock web interface only accepts encrypted ones.

Revert to stock firmware:
* Flash the stock firmware to the bootloader using TFTP/NMRP.

References in WAX202 GPL source:
https://www.downloads.netgear.com/files/GPL/WAX202_V1.0.5.1_Source.rar

* openwrt/target/linux/ramips/dts/mt7621-ax-nand-wax202.dts
  DTS file for this device.

Signed-off-by: Wenli Looi <wlooi@ucalgary.ca>
2022-07-19 14:49:04 +02:00
Wenli Looi
efca76ffce
image: add support for Netgear encrypted image
Netgear encrypted image is used in various devices including WAX202,
WAX206, and EX6400v3. This image format also requires a dummy squashfs4
image which is added here as well.

References in WAX202 GPL source:
https://www.downloads.netgear.com/files/GPL/WAX202_V1.0.5.1_Source.rar

* openwrt/bootloader/u-boot-mt7621-2018.09-gitb178829-20200526/board/ralink/common/dual_image.c
  Bootloader code that verifies the presence of a squashfs4 image, thus
  a dummy image is added here.

* openwrt/tools/imgencoder/src/gj_enc.c
  Contains code that generates the encrypted image. There is support for
  adding an RSA signature, but it does not look like the signature is
  verified by the stock firmware or bootloader.

* openwrt/tools/imgencoder/src/imagekey.h
  Contains the encryption key and IV. It appears the same key/IV is used
  for other Netgear devices including WAX206 and EX6400v3.

Signed-off-by: Wenli Looi <wlooi@ucalgary.ca>
2022-07-19 14:49:03 +02:00
Oleg S
6c7e337c80
ramips: Add support command fw_setsys for Xiaomi routers
The system parameters are contained in the Bdata partition.
To use the fw_setsys command, you need to create a file
fw_sys.config.
This file is created after calling the functions
ubootenv_add_uci_sys_config and ubootenv_add_app_config.

Signed-off-by: Oleg S <remittor@gmail.com>
[ wrapped commit description to 72 char ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-07-19 14:40:21 +02:00
John Audia
d0d6b8e183
mt7622: remove 300 MHz from dts
Due to the bug described here[1], remove the 300 MHz clock to avoid a low
voltage condition that can cause a hang when rebooting the RT3200/E8450.

This solution is probably better than the script-based work-around[2].

1. https://forum.openwrt.org/t/belkin-rt3200-linksys-e8450-wifi-ax-discussion/94302/1490
2. https://github.com/openwrt/openwrt/pull/5025

Signed-off-by: John Audia <therealgraysky@proton.me>
Tested-by: Rui Salvaterra <rsalvaterra@gmail.com>
Tested-by: John Audia <therealgraysky@proton.me>
2022-07-19 14:26:30 +02:00
Rafał Miłecki
79af0593a3 kernel: switch back 5.15 to fw_devlink=permissive
Kernel switching to fw_devlink=on as default broke probing some devices.
Revert it until we get a proper fix.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2022-07-19 06:26:32 +02:00
John Audia
c50d462e34 kernel: bump 5.10 to 5.10.131
All patches automatically rebased.

Signed-off-by: John Audia <therealgraysky@proton.me>
2022-07-18 23:14:30 +02:00
John Audia
c600d1cb00 kernel: bump 5.10 to 5.10.130
All patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800

Signed-off-by: John Audia <therealgraysky@proton.me>
2022-07-18 23:14:30 +02:00
John Audia
06c9e8bfdf kernel: bump 5.10 to 5.10.129
All patches automatically rebased.

Build system: x86_64
Build-tested: ipq806x/R7800

Signed-off-by: John Audia <therealgraysky@proton.me>
2022-07-18 23:14:30 +02:00
John Audia
6dc3efe14b kernel: bump 5.10 to 5.10.128
No patches needed to be rebased, just updated checksums

Signed-off-by: John Audia <therealgraysky@proton.me>
2022-07-18 23:14:30 +02:00
Rafał Miłecki
864fdf2bf3 bcm4908: use upstream-accepted watchdog patches
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2022-07-18 18:39:20 +02:00
Rafał Miłecki
001856fa51 bcm4908: backport latest DT patches
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2022-07-18 18:39:20 +02:00
Rafał Miłecki
bb2a2b1dbe kernel: update leds-bcm63138 driver
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2022-07-18 18:39:20 +02:00
Felix Fietkau
af8771751c kernel: backport mtk wlan flow offloading fix
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-07-18 15:14:16 +02:00
Mark Mentovai
7f54bf6fe2
ipq40xx: add MikroTik wAP ac (RBwAPG-5HacD2HnD) support
The MikroTik wAP ac (RBwAPG-5HacD2HnD) is a dual-band dual-radio
802.11ac wireless access point with integrated antenna and two Ethernet
ports in a weatherproof enclosure. See
https://mikrotik.com/product/wap_ac for more information.

Important: this is the new ipq40xx-based wAP ac, not the older
ath79-based wAP ac (RBwAPG-5HacT2HnD), already supported in OpenWrt.

Specifications:
 - SoC: Qualcomm Atheros IPQ4018
 - CPU: 4x ARM Cortex A7
 - RAM: 128MB
 - Storage: 16MB NOR flash
 - Wireless
    - 2.4GHz: Built-in IPQ4018 (SoC) 802.11b/g/n 2x2:2, 2.5 dBi antennae
    - 5GHz: Built-in IPQ4018 (SoC) 802.11a/n/ac 2x2:2, 2.5 dBi antennae
 - Ethernet: Built-in IPQ4018 (SoC, QCA8075), 2x 1000/100/10Mb/s ports,
   one with 802.3af/at PoE in

Installation:
Boot the initramfs image via TFTP, then flash the sysupgrade image using
sysupgrade. Details at https://openwrt.org/toh/mikrotik/common.

Notes:
This preserves the MAC addresses of the physical Ethernet ports:
 - eth0 corresponds to the physical port labeled ETH1 and has the base
   MAC address. This port can be used to power the device.
 - eth1 corresponds to the physical port labeled ETH2 and has a MAC
   address one greater than the base.

MAC addresses are set from /lib/preinit/05_set_iface_mac_ipq40xx.sh
rather than /etc/board.d/02_network so that they are in effect for
preinit. This should likely be done for other MikroTik devices and
possibly other non-MikroTik devices as well.

As this device has 2 physical ports, they are each connected to their
respective PHYs, allowing the link status to be visible to software.
Since they are not marked on the case with any role (such as LAN or
WAN), both are bridged to the lan network by default, although this can
easily be changed if needed.

Signed-off-by: Mark Mentovai <mark@mentovai.com>
2022-07-18 01:45:47 +02:00
Rafał Miłecki
d9ab1e56d8 kernel: backport LEDs driver for BCMBCA devices
This includes BCM63xx and BCM4908 families.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2022-07-17 18:44:41 +02:00
Rosen Penev
5ad67cc513 libiconv-full: add host build
Now that libiconv-stub is gone, a replacement for its host build is
needed.

Fixes: c0ba4201f8 ("libiconv-stub: remove")
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-07-17 14:21:03 +02:00
Christian Lamparter
b479db9062 sdk: add spidev-test to the bundle of userspace sources
moves and extends the current facilities, which have been
added some time ago for the the usbip utility, to support
more utilites that are shipped with the Linux kernel tree
to the SDK.

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

Fixes: bdaaf66e28 ("utils/spidev_test: build package directly from Linux")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-07-17 14:19:21 +02:00
Catalin Toda
488b25f5ac kernel: netconsole: add network console logging support
Accessing the console on many devices is difficult.
netconsole eases debugging on devices that crash
after the network is up.

Reference to the netconsole documentation in upstream Linux:
<https://www.kernel.org/doc/html/latest/networking/netconsole.html>
|
|netconsole=[+][src-port]@[src-ip]/[<dev>],[tgt-port]@<tgt-ip>/[tgt-macaddr]
|
| where
|  +            if present, enable extended console support
|  src-port     source for UDP packets (defaults to 6665)
|  src-ip       source IP to use (interface address)
|  dev          network interface (eth0)
|  tgt-port     port for logging agent (6666)
|  tgt-ip       IP address for logging agent
|  tgt-macaddr  ethernet MAC address for logging agent (broadcast)

OpenWrt specific notes:

OpenWrt's device userspace scripts are attaching the network
interface (i.e. eth0) to a (virtual) bridge (br-lan) device.
This will cause netconsole to report:
|network logging stopped on interface eth0 as it is joining a master device
(and unfortunately the traffic/logs to stop at this point)

As a workaround, the netconsole module can be manually loaded
again after the bridge has been setup with:

 insmod netconsole netconsole=@/br-lan,@192.168.1.x/MA:C...

One way of catching errors before the handoff, try to
append the /etc/modules.conf file with the following extra line:
 options netconsole netconsole=@/eth0,@192.168.1.x/MA:C...

and install the kmod-netconsole (=y) into the base image.

Signed-off-by: Catalin Toda <catalinii@yahoo.com>
(Added commit message from PR, added links to documentation)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-07-17 14:18:42 +02:00
Christian Lamparter
e879cccaa2 uboot-layerscape: update PKG_HASH
The change of the PKG_VERSION caused the hash of the package to
change. This is because the PKG_VERSION is present in the
internal directory structure of the uboot-layerscape-21.08.tar.xz
archive.

i.e:
 # tar tf uboot-layerscape-21.08.tar.xz:

uboot-layerscape-21.08/
uboot-layerscape-21.08/.azure-pipelines.yml
uboot-layerscape-21.08/.checkpatch.conf
uboot-layerscape-21.08/.gitattributes
uboot-layerscape-21.08/.github/
[...]

vs.

 # tar tf uboot-layerscape-LSDK-21.08.tar.xz
uboot-layerscape-LSDK-21.08/
uboot-layerscape-LSDK-21.08/.azure-pipelines.yml
uboot-layerscape-LSDK-21.08/.checkpatch.conf
uboot-layerscape-LSDK-21.08/.gitattributes
uboot-layerscape-LSDK-21.08/.github/
[...]

the (file) content of both archives are otherwise the same.

The PKG_HASH was taken from the builder log:
| Hash of the local file uboot-layerscape-21.08.tar.xz does not match
|(file: 54909a98bdcc26c7f9b35b35fcae09b977ecbf044be7bffa6dad9306c47cccf6,
|requested: 874e871755ef84ebbf3[...]) - deleting download.

without this update, the uboot-layerscape-21.08 package would
always try to download (from git), repacked the archive and
reupload to sources.openwrt.org (~14 MiB saved).

Fixes: 038d5bdab1 ("layerscape: use semantic versions for LSDK")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-07-17 14:14:54 +02:00
Rosen Penev
5dca7d7015 mbedtls: build with PIC
Fixes compilation with GCC12 and dependent packages for some reason.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-07-17 13:43:48 +02:00
Christian Lamparter
e3a1d3ba15 ipq-wifi: remove dangling GL.iNet GL-B2200 boardfiles
those board files can/should be dropped now too.

Fixes: 50c232d6f4 ("ipq-wifi: drop upstreamed board-2.bin")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-07-17 13:43:48 +02:00
Christian Lamparter
e0e6444930 nu801: fix DEPENDS on bcm53xx
the tacked on @TARGET_bcm53xx causes warnings:
tmp/.config-package.in:14027:warning: ignoring unsupported character '@'
tmp/.config-package.in:26028:warning: ignoring unsupported character '@'

this was wrong.

Fixes: be1761fa14 ("nu801: add MR26 to the table")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-07-17 13:43:48 +02:00
Christian Marangi
e62d1edd6b
procd: update to git HEAD
ef5d3e3 jail: fix various ignoring return value compilation warning
8e4a956 jail: add WARNING macro to log non critical warning message

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-07-17 13:21:45 +02:00
Christian Marangi
d58ce80080
fstools: update to git HEAD
ebf7e90 libfstools: handle gzip return value in block_volume_format

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-07-17 13:21:45 +02:00
Sander Vanheule
1773264a0c realtek: correct egress frame port verification
Destination switch ports for outgoing frame can range from 0 to
CPU_PORT-1.

Refactor the code to only generate egress frame CPU headers when a valid
destination port number is available, and make the code a bit more
consistent between different switch generations. Change the dest_port
argument's type to 'unsigned int', since only positive values are valid.

This fixes the issue where egress frames on switch port 0 did not
receive a VLAN tag, because they are sent out without a CPU header.
Also fixes a potential issue with invalid (negative) egress port numbers
on RTL93xx switches.

Reported-by: Arınç ÜNAL <arinc.unal@xeront.com>
Suggested-by: Birger Koblitz <mail@birger-koblitz.de>
Tested-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Signed-off-by: Sander Vanheule <sander@svanheule.net>
2022-07-17 10:06:51 +02:00
Sander Vanheule
0b35a08a05 realtek: correct egress frame priority assignment
Priority values passed to the egress (TX) frame header initialiser are
invalid when smaller than 0, and should not be assigned to the frame.
Queue assignment is then left to the switch core logic.

Current code for RTL83xx forces the passed priority value to be
positive, by always masking it to the lower bits, resulting in the
priority always being set and enabled. RTL93xx code doesn't even check
the value and unconditionally assigns the (32 bit) value to the (5 bit)
QID field without masking.

Fix priority assignment by only setting the AS_QID/AS_PRI flag when a
valid value is passed, and properly mask the value to not overflow the
QID/PRI field.

For RTL839x, also assign the priority to the right part of the frame
header. Counting from the leftmost bit, AS_PRI and PRI are in bits 36
and 37-39. The means they should be assigned to the third 16 bit value,
containing bits 32-47.

Tested-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Signed-off-by: Sander Vanheule <sander@svanheule.net>
2022-07-17 10:06:46 +02:00
Sander Vanheule
d6165ea75b realtek: fix egress L2 learning on rtl839x
The flag to enable L2 address learning on egress frames is in CPU header
bit 40, with bit 0 being the leftmost bit of the header. This
corresponds to BIT(7) in the third 16-bit value of the header.

Correctly set L2LEARNING by fixing the off-by-one error.

Fixes: 9eab76c84e ("realtek: Improve TX CPU-Tag usage")
Tested-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Signed-off-by: Sander Vanheule <sander@svanheule.net>
2022-07-17 10:06:40 +02:00
Sander Vanheule
d9516cacb0 realtek: fix egress port mask on rtl839x
The flag to enable the outgoing port mask is in CPU header bit 43, with
bit 0 being the leftmost bit of the header. This corresponds to BIT(4)
in the third 16-bit value of the header.

Correctly set AS_DPM by fixing the off-by-one error.

Fixes: 9eab76c84e ("realtek: Improve TX CPU-Tag usage")
Tested-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Signed-off-by: Sander Vanheule <sander@svanheule.net>
2022-07-17 10:06:32 +02:00
Christian Marangi
ef3d0a3029
ubox: update to latest git HEAD
46a33b8 kmodloader: fix compilation warning with not checking return of asprintf

Also switch PKG_RELEASE to AUTORELEASE.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-07-17 03:12:45 +02:00
Eneas U de Queiroz
9710fe70a6
wolfssl: bump to 5.4.0
This version fixes two vulnerabilities:
-CVE-2022-34293[high]: Potential for DTLS DoS attack
-[medium]: Ciphertext side channel attack on ECC and DH operations.

The patch fixing x86 aesni build has been merged upstream.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2022-07-16 22:22:40 +02:00
Christian Lamparter
e37ba80633 bcm53xx: add support for Meraki MR26
Meraki MR26 is an EOL wireless access point featuring a
PoE ethernet port and two dual-band 3x3 MIMO 802.11n
radios and 1x1 dual-band WIFI dedicated to scanning.

Thank you Amir for the unit and PSU.

Hardware info:
SOC   : Broadcom BCM53015A1KFEBG (dual-core Cortex-A9 CPU at 800 MHz)
RAM   : SK hynix Inc. H5TQ1G63EFR, 1 Gbit DDR3 SDRAM = 128 MiB
NAND  : Spansion S34ML01G100TF100, 1 Gbit SLC NAND Flash = 128 MiB
ETH   : 1 GBit Ethernet Port - PoE
WIFI1 : Broadcom BCM43431KMLG, BCM43431 802.11 abgn
WIFI1 : Broadcom BCM43431KMLG, BCM43431 802.11 abgn
WIFI3 : Broadcom BCM43428 abgn (1x1:1 - id: 43428)
BUTTON: one reset button
LEDS  : RGB-LED
MISC  : Atmel AT24C64 8KiB EEPROM (i2c - seems empty)
      : Ti INA219 26V, 12-bit, i2c output current/voltage/power monitor
      : TPS23754, High Power/High Efficiency PoE Interface+DC/DC Controller

SERIAL:
	WARNING: The serial port needs a TTL/RS-232 3V3 level converter!
	The Serial setting is 115200-8-N-1. The board has a populated
	right angle 1x4 0.1" pinheader.
	The pinout is: VCC (next to J3, has little white arrow), RX, TX, GND.

This flashing procedure for the MR26 was tested with firmware:
    "22-143410M-gf25cbf5a-asa".
    U-Boot 2012.10-00063-g83f9fe4 (Jun 04 2014 - 21:22:39)

A guide how to open up the device is available on the wiki:
<https://openwrt.org/toh/meraki/mr26>

Notes:
 - The WIFI do work to a degree. Limited to 802.11bg in the 2.4GHz band.
 - the WIFI macs are made up.

0. Create a separate Ethernet LAN which can't have access to the internet.
   Ideally use 192.168.1.2 for your PC. The new OpenWrt firmware will setup
   the network via DHCP Discovery, so make sure your PC is running
   a DHCP-Server (i.e.: dnsmasq)
   '# dnsmasq -i eth# -F 192.168.1.5,192.168.1.50
   Download the openwrt-meraki-mr26 initramfs file from openwrt.org and
   rename it to something simple like mr26.bin. Then put it into the tftp's
   server directory.

1. Disassemble the MR26 device by removing all screws (4 screws are located
   under the 4 rubber feets!) and prying open the plastic covers without
   breaking the plastic retention clips. Once inside, remove the plastic
   back casing. Be careful, there some "hidden" retention clips on both
   sides of the LAN port, you need a light to see those. Next, you want to
   remove all the screws on the outer metal shielding to get to the PCB.
   It's not necessary to remove the antennas!

2. Connect the serial cable to the serial header and Ethernet patch cable
   to the device.

4. Before connecting the power, get ready flood the serial console program
   with the magic:   xyzzy  . This is necessary in order to get into the
   u-boot prompt. Once Ready: connect power cable.

5. If you don't get the "u-boot>" prompt within the first few seconds,
   you have to disconnect and reconnect the power cable and try again.

6. In the u-boot prompt enter:

   setenv ipaddr 192.168.1.4
   setenv serverip 192.168.1.2
   tftpboot ${meraki_loadaddr} mr26.bin; bootm

   this will boot a in-ram-only OpenWrt image.

7. Once it booted use sysupgrade to permanently install OpenWrt.
   To do this: Download the latest sysupgrade.bin file and move
   it to the device. Then use sysupgrade *sysupgrade.bin to install it.

    WARNING: DO NOT DELETE the "storage" ubi volume!

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-07-15 15:21:44 +02:00
Christian Lamparter
be1761fa14 nu801: add MR26 to the table
The MR26 uses a NU801 for the RGB-Leds. Make the LEDs
available.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-07-15 15:21:44 +02:00
Christian Lamparter
cb3d0250db module/firmware: remove intersil PRISM54 support
the legacy driver was dropped in linux 5.14-rc3:
commit d249ff28b1d8 ("intersil: remove obsolete prism54 wireless driver")

Quoting Lukas Bulwahn:
"p54 replaces prism54 so users should be unaffected."

Reported-by: Marius Dinu <m95d+git@psihoexpert.ro>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-07-15 15:21:44 +02:00
Christian Lamparter
f0c1d26738 utils/spidev_test: side-step build-system woes
The spidev_test is build in phase2 even though it should be disabled.
My best guess is that we hit the same issue that I had with nu801.
The build-system thinks it's a tool that is necessary for
building the kernel.

In this case, the same fix (adding a dependency on the presence of
the module) could work in this case as well?

Fixes: bdaaf66e28 ("utils/spidev_test: build package directly from Linux")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-07-15 15:21:44 +02:00
Christian Lamparter
50c232d6f4 ipq-wifi: drop upstreamed board-2.bin
The BDFs for the:
	GL.iNet GL-B2200

were upstreamed to the ath10k-firmware repository
and landed in linux-firmware.git

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2022-07-15 15:21:44 +02:00