openwrt/openwrt.git
2 years agomediatek: Add support for Xiaomi Redmi Router AX6S
Richard Huynh [Wed, 1 Dec 2021 01:27:39 +0000 (12:27 +1100)]
mediatek: Add support for Xiaomi Redmi Router AX6S

Also known as the "Xiaomi Router AX3200" in western markets,
but only the AX6S is widely installation-capable at this time.

SoC: MediaTek MT7622B
RAM: DDR3 256 MiB (ESMT M15T2G16128A)
Flash: SPI-NAND 128 MiB (ESMT F50L1G41LB or Gigadevice GD5F1GQ5xExxG)
WLAN: 2.4/5 GHz 4T4R
2.4 GHz: MediaTek MT7622B
5 GHz: MediaTek MT7915E
Ethernet: 4x 10/100/1000 Mbps
Switch: MediaTek MT7531B
LEDs/Keys: 2/2 (Internet + System LED, Mesh button + Reset pin)
UART: Marked J1 on board VCC RX GND TX, beginning from "1". 3.3v, 115200n8
Power: 12 VDC, 1.5 A

Notes:
U-Boot passes through the ethaddr from uboot-env partition,
but also has been known to reset it to a generic mac address
hardcoded in the bootloader.

However, bdata is also populated with the ethernet mac addresses,
but is also typically never written to. Thus this is used instead.

Installation:
1. Flash stock Xiaomi "closed beta" image labelled
'miwifi_rb03_firmware_stable_1.2.7_closedbeta.bin'.
(MD5: 5eedf1632ac97bb5a6bb072c08603ed7)

2. Calculate telnet password from serial number and login

3. Execute commands to prepare device
nvram set ssh_en=1
nvram set uart_en=1
nvram set boot_wait=on
nvram set flag_boot_success=1
nvram set flag_try_sys1_failed=0
nvram set flag_try_sys2_failed=0
nvram commit

4. Download and flash image
On computer:
python -m http.server
On router:
cd /tmp
wget http://<IP>:8000/factory.bin
mtd -r write factory.bin firmware

Device should reboot at this point.

Reverting to stock:
Stock Xiaomi recovery tftp that accepts their signed images,
with default ips of 192.168.31.1 + 192.168.31.100.
Stock image should be renamed to tftp server ip in hex (Eg. C0A81F64.img)
Triggered by holding reset pin on powerup.

A simple implementation of this would be via dnsmasq's
dhcp-boot option or using the vendor's (Windows only)
recovery tool available on their website.

Signed-off-by: Richard Huynh <voxlympha@gmail.com>
2 years agomediatek: Add GD5F1GQ5xExxG to mtk-snand
Richard Huynh [Mon, 27 Dec 2021 02:07:29 +0000 (13:07 +1100)]
mediatek: Add GD5F1GQ5xExxG to mtk-snand

Some units of the Xiaomi Redmi Router AX6S/Xiaomi Router AX3200 contain this part.

Signed-off-by: Richard Huynh <voxlympha@gmail.com>
2 years agoipq40xx: add support for Telco X1 Pro
Nicholas Smith [Fri, 11 Mar 2022 03:54:07 +0000 (13:54 +1000)]
ipq40xx: add support for Telco X1 Pro

Telco X1 Pro is a Cat12 LTE-A Pro modem router.
Vendor firmware is based on a recent version of OpenWrt.
Flashing is possible via CLI using sysupgrade -F -n
The serial headers allow bootloader and console access
Serial setting: 115200  8N1

Brief Specifications:
IPQ4019 SoC
32MB flash
512MB RAM
4x gigabit LAN
1x gigabit WAN
Dual-band Wave-2 wifi
2x SMA LTE antenna connectors
2x RP-SMA wifi antennas
1x USB 2.0 port
1x Reset button
Serial headers installed
1x Nano SIM tray
1x Quectel EM-12G LTE-A Pro modem
1x M.2 slot attached to USB 3.0
1x internal micro SD card slot

Signed-off-by: Nicholas Smith <nicholas@nbembedded.com>
2 years agoramips: add support for D-Link DIR-878 R1
Igor Nazarov [Wed, 16 Mar 2022 21:51:35 +0000 (00:51 +0300)]
ramips: add support for D-Link DIR-878 R1

Specifications:
- SoC: MediaTek MT7621AT
- RAM: 128 MB (DDR3)
- Flash: 16 MB (SPI NOR)
- WiFi: MT7615N (2.4GHz) and MT7615N (5Ghz)
- Switch: 1 WAN, 4 LAN (Gigabit)
- Buttons: Reset, WiFi Toggle, WPS
- LEDs: Power, Internet, WiFi 2.4G WiFi 5G

The R1 revision is identical to the A1 revision except
- No Config2 Parition, therefore
- factory partition resized to 64k from 128K
- Firmware partition offset is 0x50000 not 0x60000
- Firmware partitions size increased by 64K
- Firmware partition type is "denx,uimage", not "sge,uimage"
- Padding of image creation "uimage-padhdr 96" removed

Installation:
Update to the last D-Link firmware through web-ui before OpenWRT
installation then follow the instructions to patch your device using
D-Link FailsafeUI.

- D-Link FailsafeUI:
Power down the router, press and hold the reset button, then
re-plug it. Keep the reset button pressed until the internet LED stops
flashing, then jack into any lan port and manually assign a static IP
address in 192.168.0.0/24 other than 192.168.0.1 (e.g. 192.168.0.2)
and go to http://192.168.0.1
Flash with the factory image.

Signed-off-by: Igor Nazarov <tigron.dev@gmail.com>
2 years agokernel: bump 5.10 to 5.10.107
John Audia [Sat, 19 Mar 2022 16:16:47 +0000 (12:16 -0400)]
kernel: bump 5.10 to 5.10.107

All patches automatically rebased.

Build system: x86_64
Build-tested: bcm2711/RPi4B, mt7622/RT3200
Run-tested: bcm2711/RPi4B, mt7622/RT3200

Signed-off-by: John Audia <graysky@archlinux.us>
2 years agoncurses: update to 6.3
Huangbin Zhan [Mon, 15 Nov 2021 14:03:45 +0000 (22:03 +0800)]
ncurses: update to 6.3

release notes: https://invisible-island.net/ncurses/announce-6.3.html

Signed-off-by: Huangbin Zhan <zhanhb88@gmail.com>
2 years agoramips: add support for Beeline SmartBox Flash
Mikhail Zhilkin [Wed, 5 Jan 2022 13:11:56 +0000 (13:11 +0000)]
ramips: add support for Beeline SmartBox Flash

Beeline SmartBox Flash is a wireless AC1300 (WiFi 5) router manufactured
by Arcadyan company.

Device specification
--------------------
SoC Type: MediaTek MT7621AT
RAM: 256 MiB, Winbond W632GU6NB
Flash: 128 MiB (NAND), Winbond W29N01HVSINF
Wireless 2.4 GHz (MT7615DN): b/g/n, 2x2
Wireless 5 GHz (MT7615DN): a/n/ac, 2x2
Ethernet: 3xGbE (WAN, LAN1, LAN2)
USB ports: 1xUSB3.0
Button: 1 (Reset/WPS)
LEDs: 1 RGB LED
Power: 12 VDC, 1.5 A
Connector type: Barrel
Bootloader: U-Boot (Ralink UBoot Version: 5.0.0.2)
OEM: Arcadyan WE42022

Installation
------------
1. Place *factory.trx on any web server (192.168.1.2 in this example)
2. Connect to the router using telnet shell (no password required)
3. Save MAC adresses to U-Boot environment:
   uboot_env --set --name eth2macaddr --value $(ifconfig | grep eth2 | \
    awk '{print $5}')
   uboot_env --set --name eth3macaddr --value $(ifconfig | grep eth3 | \
    awk '{print $5}')
   uboot_env --set --name ra0macaddr --value $(ifconfig | grep ra0 | \
    awk '{print $5}')
   uboot_env --set --name rax0macaddr --value $(ifconfig | grep rax0 | \
    awk '{print $5}')
4. Ensure that MACs were saved correctly:
   uboot_env --get --name eth2macaddr
   uboot_env --get --name eth3macaddr
   uboot_env --get --name ra0macaddr
   uboot_env --get --name rax0macaddr
5. Download and write the OpenWrt images:
   cd /tmp
   wget http://192.168.1.2/factory.trx
   mtd_write erase /dev/mtd4
   mtd_write write factory.trx /dev/mtd4
6. Set 1st boot partition and reboot:
   uboot_env --set --name bootpartition --value 0
   reboot

Back to Stock
-------------
1. Run in the OpenWrt shell:
   fw_setenv bootpartition 1
   reboot
2. Optional step. Upgrade the stock firmware with any version to
   overwrite the OpenWrt in Slot 1.

MAC addresses
-------------
+-----------+-------------------+----------------+
| Interface | MAC               | Source         |
+-----------+-------------------+----------------+
| label     | 30:xx:xx:51:xx:09 | No MACs was    |
| LAN       | 30:xx:xx:51:xx:09 | found on Flash |
| WAN       | 30:xx:xx:51:xx:06 | [1]            |
| WLAN_2g   | 30:xx:xx:51:xx:07 |                |
| WLAN_5g   | 32:xx:xx:41:xx:07 |                |
+-----------+-------------------+----------------+
[1]:
a. Label wasb't found neither in factory nor in other places.
b. MAC addresses are stored in encrypted partition "glbcfg". Encryption
   key hasn't known yet. To ensure the correct MACs in OpenWrt, a hack
   with saving of the MACs to u-boot-env during the installation was
   applied.
c. Default Ralink ethernet MAC address (00:0C:43:28:80:36) was found in
   "Factory" 0xfff0. It's the same for all Smartbox Flash devices. OEM
   firmware also uses this MAC when initialazes ethernet driver. In
   OpenWrt we use it only as internal GMAC (eth0), all other MACs are
   unique. Therefore, there is no any barriers to the operation of several
   Smartbox Flash devices even within the same broadcast domain.

Stock firmware image format
---------------------------
+--------------+---------------+----------------------------------------+
| Offset       | 1.0.15        | Description                            |
+==============+===============+========================================+
| 0x0          | 5d 43 6f 74   | TRX magic "]Cot"                       |
+--------------+---------------+----------------------------------------+
| 0x4          | 00 70 ff 00   | Length (reverse)                       |
+--------------+---------------+----------------------------------------+
|              |               | htonl(~crc) from 0xc ("flag_version")  |
| 0x8          | 72 b3 93 16   | to "Length"                            |
+--------------+---------------+----------------------------------------+
| 0xc          | 00 00 01 00   | Flags                                  |
+--------------+---------------+----------------------------------------+
|              |               | Offset (reverse) of Kernel partition   |
| 0x10         | 1c 00 00 00   | from the start of the header           |
+--------------+---------------+----------------------------------------+
|              |               | Offset (reverse) of RootFS partition   |
| 0x14         | 00 00 42 00   | from the start of the header           |
+--------------+---------------+----------------------------------------+
| 0x18         | 00 00 00 00   | Zeroes                                 |
+--------------+---------------+----------------------------------------+
| 0x1c         | 27 05 19 56 … | Kernel data + zero padding             |
+--------------+---------------+----------------------------------------+
|              |               | RootFS data (starting with "hsqs") +   |
| 0x420000     | 68 73 71 73 … | zero padding to "Length"               |
+--------------+---------------+----------------------------------------+
|              |               | Some signature data (format is         |
|              |               | unknown). Necessary for the fw         |
| "Lenght"     | 00 00 00 00 … | update via oem fw web interface.       |
+--------------+---------------+----------------------------------------+
| "Lenght" +   |               | TRX magic "HDR0". U-Boot is            |
| 0x10c        | 48 44 52 30   | checking it at every boot.             |
+--------------+---------------+----------------------------------------+
|              |               | 1.00:                                  |
|              |               |   Zero padding to ("Lenght" + 0x23000) |
|              |               | 1.0.12:                                |
|              |               |   Zero padding to ("Lenght" + 0x2a000) |
| "Lenght" +   |               | 1.0.13, 1.0.15, 1.0.16:                |
| 0x110        | 00 00 00 00   |   Zero padding to ("Lenght" + 0x10000) |
+--------------+---------------+----------------------------------------+

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
2 years agobase-files: add wrapper for procd service list command
Florian Eckert [Wed, 22 Dec 2021 07:59:43 +0000 (08:59 +0100)]
base-files: add wrapper for procd service list command

A service managed by procd does have a json object with usefull information.
This information could by dumped with the following command.

ubus call service list "{ 'verbose':true, 'name': '<service-name>)'". }"

This line is long and complicated to enter. This commit adds a wrapper
call to the procd service section tool to simplify the input and get the
output faster.

We could now enter the command /etc/initd/<service> info to get the info
faster.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2 years agoprocd: move service command to procd
Florian Eckert [Tue, 30 Nov 2021 15:01:14 +0000 (16:01 +0100)]
procd: move service command to procd

The service command belongs to the procd and does not belong in the
shinit. In the course of the move, the script was also checked with
shellcheck and cleaned up.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2 years agokernel: bump 5.10 to 5.10.106
John Audia [Wed, 16 Mar 2022 20:06:23 +0000 (16:06 -0400)]
kernel: bump 5.10 to 5.10.106

All patches automatically rebased.

Build system: x86_64
Build-tested: bcm2711/RPi4B, mt7622/RT3200
Run-tested: bcm2711/RPi4B, mt7622/RT3200

Signed-off-by: John Audia <graysky@archlinux.us>
2 years agokernel: bump 5.10 to 5.10.105
John Audia [Fri, 11 Mar 2022 12:15:14 +0000 (07:15 -0500)]
kernel: bump 5.10 to 5.10.105

Updated default config with new sym (CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY=y).

Manually rebased:
    generic/hack-5.10/220-arm-gc_sections.patch

All other patches automatically rebased.

Build system: x86_64
Build-tested: bcm2711/RPi4B, mt7622/RT3200
Run-tested: bcm2711/RPi4B, mt7622/RT3200

Signed-off-by: John Audia <graysky@archlinux.us>
2 years agoiptables: bump PKG_RELEASE
Etienne Champetier [Fri, 18 Mar 2022 00:05:28 +0000 (20:05 -0400)]
iptables: bump PKG_RELEASE

Following {arp,eb}tables-nft addition, bump PKG_RELEASE

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2 years agoiptables: add {arp,eb}tables-nft
Etienne Champetier [Tue, 1 Mar 2022 04:14:48 +0000 (23:14 -0500)]
iptables: add {arp,eb}tables-nft

Add a patch to add some missing init_extensions{a,b}() calls
Package lib{arp,eb}t_*.so

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2 years agoiptables: add xtables-nft package
Etienne Champetier [Tue, 1 Mar 2022 04:32:53 +0000 (23:32 -0500)]
iptables: add xtables-nft package

This allows to install ip6tables-nft without iptables-nft
This prepare the addition of {arp,eb}tables-nft

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2 years agoiptables: add xtables-legacy package
Etienne Champetier [Tue, 1 Mar 2022 04:24:11 +0000 (23:24 -0500)]
iptables: add xtables-legacy package

This allows to install ip6tables-legacy without iptables-legacy

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2 years agoebtables: rename to ebtables-legacy
Etienne Champetier [Tue, 1 Mar 2022 04:00:22 +0000 (23:00 -0500)]
ebtables: rename to ebtables-legacy

This prepare the introduction of ebtables-nft.
Add PROVIDES so dependencies are not broken,
use ALTERNATIVES.

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2 years agoarptables: rename package to arptables-legacy
Etienne Champetier [Tue, 1 Mar 2022 03:37:41 +0000 (22:37 -0500)]
arptables: rename package to arptables-legacy

This prepare the introduction of arptables-nft.
Add PROVIDES so dependencies are not broken,
use ALTERNATIVES.

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2 years agoquilt.mk: fix typo in the Host section
Rosen Penev [Fri, 26 Mar 2021 10:09:34 +0000 (03:09 -0700)]
quilt.mk: fix typo in the Host section

HOST_PATCH_DIR is used for host patches, not PATCH_DIR.

Fixes refreshing patches with a custom HOST_PATCH_DIR.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agocypress-firmware: update it to version 5.4.18-2021_0812
Josef Schlehofer [Wed, 16 Mar 2022 12:14:57 +0000 (13:14 +0100)]
cypress-firmware: update it to version 5.4.18-2021_0812

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

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

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

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

Fixes:
- FragAttacks
- Kr00k

Also add LICENSE file

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

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

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

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

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2 years agobcm27xx: bcm2711: add kmod-usb-net-lan78xx
Josef Schlehofer [Thu, 17 Mar 2022 17:49:57 +0000 (18:49 +0100)]
bcm27xx: bcm2711: add kmod-usb-net-lan78xx

Some vendors like Seeedstudio in their product [1] with Raspberry Pi
Compute Module 4 uses Microchip LAN7800 (USB 3.0 to Gigabit
Ethernet Bridge) - USB 3.0 extended from PCIe of CM4.

lsusb output:
```
Bus 002 Device 002: ID 0424:7800 Microchip LAN7800
```

Raspberry Pi 4 and even Compute Module 4 has many resources available
and for just one kernel module it is not necessary to add additional specific CM4 profiles.
Let's include it by default, so the both Ethernet ports will be usable
to have better user-experience. Because previous generation of Raspberry
Pi included LAN7800 Gigabit Ethernet by default and it is enabled there
[2] in kernel without additional kernel module, which was added recently [3].

After this commit in dmesg can be found this:

```
root@OpenWrt:~# dmesg | grep lan
[    7.038889] lan78xx 2-3:1.0 (unnamed net_device) (uninitialized): int urb period 64
[    7.090484] usbcore: registered new interface driver lan78xx
```

Tested and works with sysupgrade image.

[1] https://www.seeedstudio.com/Dual-GbE-Carrier-Board-with-4GB-RAM-32GB-eMMC-RPi-CM4-Case-p-5029.html
[2] https://github.com/openwrt/openwrt/blob/32c74552b2310531af593ee0f859a3935a3a7cbd/target/linux/bcm27xx/bcm2709/config-5.4#L437
[3] https://github.com/openwrt/openwrt/commit/31647d8be8c60bfb6690c87c739b8abe6dc03950

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2 years agoiwinfo: update to latest Git head
Josef Schlehofer [Thu, 17 Mar 2022 23:07:50 +0000 (00:07 +0100)]
iwinfo: update to latest Git head

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

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2 years agobpftools: fix library path on 64 bit systems
Felix Fietkau [Sat, 19 Mar 2022 12:28:41 +0000 (13:28 +0100)]
bpftools: fix library path on 64 bit systems

drop the use of LIB_SUFFIX

Fixes: 00cbf6f6ab1d ("bpftools: update to standalone bpftools + libbpf, use the latest version")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agobpftools: update to standalone bpftools + libbpf, use the latest version
Felix Fietkau [Tue, 15 Mar 2022 13:33:59 +0000 (14:33 +0100)]
bpftools: update to standalone bpftools + libbpf, use the latest version

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agomac80211: backport MBSSID support
Felix Fietkau [Fri, 18 Mar 2022 13:36:57 +0000 (14:36 +0100)]
mac80211: backport MBSSID support

Required for an upcoming mt76 update

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agokernel: enable SERIAL_8250_16550A_VARIANTS
Stijn Tintel [Mon, 14 Mar 2022 19:56:55 +0000 (21:56 +0200)]
kernel: enable SERIAL_8250_16550A_VARIANTS

Kernel 5.6 introduced a new config symbol SERIAL_8250_16550A_VARIANTS.
In kernel 5.8, this symbol was changed to default to on on !x86, as some
embedded devices still use 16650A variants. Let's play safe here and
enable this symbol in the generic config, to avoid others from running
into this problem and having to spend several hours trying to bisect
this problem. While we could disable the symbol in the x86 target
configs, a 20ms boot time reduction really isn't worth the time wasted
on bisecting this issue.

Matt discovered this problem while working on adding support for the
WatchGuard Firebox M200 to the qoriq target, where it caused some
characters to be missing on the console output.

Reported-by: Matt Fawcett <mattytap@icloud.com>
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Reviewed-by: Rui Salvaterra <rsalvaterra@gmail.com>
2 years agoath79: improve support for GL.iNet GL-XE300
Pascal Coudurier [Tue, 25 Jan 2022 20:18:28 +0000 (21:18 +0100)]
ath79: improve support for GL.iNet GL-XE300

- fix eth0 eth1 sharing same mac so it conforms to the behavior stated
  in the original commit and the way it is in vendor firmware :
  WAN is label, LAN is label +1 and WLAN is label +2
- add default leds config
- add default network config

Signed-off-by: Pascal Coudurier <coudu@wanadoo.fr>
2 years agompc85xx: fix missing kernel config symbol and DTS whitespace issue
Petr Štetiar [Thu, 17 Mar 2022 06:53:55 +0000 (07:53 +0100)]
mpc85xx: fix missing kernel config symbol and DTS whitespace issue

Buildbot has reported following issue while crunching mpc85xx/p1010
subtarget:

 Extreme Networks WS-AP3825i (WS_AP3825I) [N/y/?] (NEW)

Fix it by disabling that config symbol in target kernel config and while
at it fix DTS whitespace issue.

Fixes: 7e614820a892 ("mpc85xx: add support for Extreme Networks WS-AP3825i")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2 years agolantiq: fritz7362sl: add partition subnode for SPI flash
Jan Hoffmann [Wed, 16 Mar 2022 17:24:23 +0000 (18:24 +0100)]
lantiq: fritz7362sl: add partition subnode for SPI flash

Without a partition subnode ofpart_core still parses direct subnodes as
partitions, but it ignores nodes with a compatible property. Due to
this, the switch to nvmem-cells made the urlader partition inaccessible.
As a result, the wireless network was broken, as the calibration data
is read from that partition by a script.

Fixes: #8983
Signed-off-by: Jan Hoffmann <jan@3e8.eu>
2 years agolantiq: fritz7362sl: fix SPI flash node reg property
Martin Blumenstingl [Tue, 15 Mar 2022 21:53:04 +0000 (22:53 +0100)]
lantiq: fritz7362sl: fix SPI flash node reg property

The &spi node has #address-cells = <1> and #size-cells = <0>. Drop the
extra 0 in the reg property from the SPI flash node to ensure it's
number of cells matches the definition in the parent node. This also
makes the reg property for the SPI flash node consistent with all other
VR9 boards.

Fixes: eae6cac6a30b ("lantiq: add support for AVM FRITZ!Box 7362 SL")
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
2 years agoipq806x: fix TP-Link Archer VR2600v bootlooping
Christian Lamparter [Wed, 16 Mar 2022 16:34:24 +0000 (17:34 +0100)]
ipq806x: fix TP-Link Archer VR2600v bootlooping

Timo Schroeder reported:
"The TP-Link Archer VR2600v is stuck in a boot loop on written
snapshot image. It's able to boot using the snapshot uimage
though, but there ath10k firmware can't be found.
21.02.2 release version doesn't have either problem."

The VR2600v has a 512 byte header at the beginning of the
firmware that needs to be accounted for.

Fixes: f6a01d7f5c3d ("ipq806x: convert TP-Link Archer VR2600v to denx,uimage")
Reported-by: Timo Schroeder <der.timosch@gmail.com>
References: <https://github.com/openwrt/openwrt/issues/9467>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agompc85xx: add support for Extreme Networks WS-AP3825i
Martin Kennedy [Sun, 28 Nov 2021 01:59:18 +0000 (20:59 -0500)]
mpc85xx: add support for Extreme Networks WS-AP3825i

Hardware:

- SoC:     Freescale P1020
  - CPU:     2x e500v2 @ 800MHz
- Flash:   64MiB NOR (1x Intel JS28F512)
- Memory:  256MiB (2x ProMOS DDR3 V73CAG01168RBJ-I9H 1Gb)
- WiFi1:   2.4+5GHz abgn 3x3 (Atheros AR9590)
- Wifi2:   5GHz an+ac 3x3 (Qualcomm Atheros QCA9890)
- ETH:     2x PoE Gigabit Ethernet (2x Atheros AR8035)
- Power:   12V (center-positive barrel) or 48V PoE (active or passive)
- Serial:  Cisco-compatible RJ45 next to 12V power socket (115200 baud)
- LED Driver: TI LV164A
  - LEDs: (not functioning)
    - 2x Power (Green + Orange)
    - 4x ETH (ETH1 + ETH2) x (Green + Orange)
    - 2x WiFi (WiFi2 + WiFi1)

Installation:

1. Grab the OpenWrt initramfs <openwrt-initramfs-bin>, e.g.
   openwrt-mpc85xx-p1020-extreme-networks_ws-ap3825i-initramfs-kernel.bin.
   Place it in the root directory of a DHCP+TFTP server, e.g. OpenWrt
   `dnsmasq` with configuration `dhcp.server.enable_tftp='1'`.

2. Connect to the serial port and boot the AP with options
   e.g. 115200,N,8. Stop autoboot in U-Boot by pressing Enter after
   'Scanning JFFS2 FS:' begins, then waiting for the prompt to be
   interrupted. Credentials are identical to the one in the APs
   interface. By default it is admin / new2day: if these do not work,
   follow the OEM's reset procedure using the reset button.

3. Set the bootcmd so the AP can boot OpenWrt by executing:

```uboot
setenv boot_openwrt "cp.b 0xEC000000 0x2000000 0x2000000; interrupts off; bootm start 0x2000000; bootm loados; fdt resize; fdt boardsetup; fdt chosen; bootm prep; bootm go;"
setenv bootcmd "run boot_openwrt"
saveenv
```

   If you plan on going back to the vendor firmware - the bootcmd for it
   is stored in the boot_flash variable.

4. Load the initramfs image to RAM and boot by executing

```uboot
setenv ipaddr <ipv4 client address>;
setenv serverip <tftp server address>;
tftpboot 0x2000000 <openwrt-initramfs-bin>;
interrupts off;
bootm start 0x2000000;
bootm loados;
fdt resize;
fdt boardsetup;
fdt chosen;
bootm prep;
bootm go;
```

5. Make a backup of the "firmware" partition if you ever wish to go back
   to the vendor firmware.

6. Upload the OpenWrt sysupgrade image via SCP to the devices /tmp
   folder.

7. Flash OpenWrt using sysupgrade.

```ash
sysupgrade /tmp/<openwrt-sysupgrade-bin>
```

Notes:

- We must step through the `bootm` process manually to avoid fdt
  relocation. To explain: the stock U-boot (and stock Linux) are configured
  with a very large CONFIG_SYS_BOOTMAPSZ (and the device's stock Linux
  kernel is configured to be able to handle it). The U-boot version
  predates the check for the `fdt_high` variable, meaning that upon fdt
  relocation, the fdt can (and will) be moved to a very high address; the
  default appears to be 0x9ffa000. This address is so high that when the
  Linux kernel starts reading the fdt at the beginning of the boot process,
  it encounters a memory access exception and panics[5]. While it is
  possible to reduce the highest address the fdt will be relocated to by
  setting `bootm_size`, this also has the side effect of limiting the
  amount of RAM the kernel can use[3].

- Because it is not relocated, the flattened device tree needs to be
  padded in the build process to guarantee that `fdt resize` has
  enough space.

- The primary ethernet MAC address is stored (and set) in U-boot; they are
  shimmed into the device tree by 'fdt boardsetup' through the
  'local-mac-address' property of the respective ethernet node, so OpenWrt
  does not need to set this at runtime. Note that U-boot indexes the
  ethernet nodes by alias, which is why the device tree explicitly aliases
  ethernet1 to enet2.

- LEDs do not function under OpenWrt. Each of 8 LEDs is connected to an
  output of a TI LV164A shift register, which is wired to GPIO lines and
  operates through bit-banged SPI. Unfortunately, I am unable to get the
  spi-gpio driver to recognize the `led_spi` device tree node at all, as
  confirmed by patching in printk messages demonstrating
  spi-gpio.c::spi_gpio_probe never runs. It is possible to manually
  articulate the shift register by exporting the GPIO lines and stepping
  their values through the sysfs.

- Though they do not function under OpenWrt, I have left the pinout details
  of the LEDs and shift register in the device tree to represent real
  hardware.

- An archive of the u-boot and Linux source for the AP3825i (which is one
  device of a range of devices code-named 'CHANTRY') be found here[1].

- The device has an identical case to both the Enterasys WS-AP3725i and
  Adtran BSAP-2030[2] (and potentially other Adtran BSAPs). Given that
  there is no FCC ID for the board itself (only its WLAN modules), it's
  likely these are generic boards, and even that the WS-AP3725i is
  identical, with only a change in WLAN card. I have ordered one to confirm
  this.

- For additional information: the process of porting the board is
  documented in an OpenWrt forum thread[4].

[1]: magnet:?xt=urn:btih:f5306a5dfd06d42319e4554565429f84dde96bbc
[2]: https://forum.openwrt.org/t/support-for-adtran-bluesocket-bsap-2030/48538
[3]: https://forum.openwrt.org/t/adding-openwrt-support-for-ws-ap3825i/101168/29
[4]: https://forum.openwrt.org/t/adding-openwrt-support-for-ws-ap3825i/101168
[5]: https://forum.openwrt.org/t/adding-openwrt-support-for-ws-ap3825i/101168/26

Tested-by: Martin Kennedy <hurricos@gmail.com>
Signed-off-by: Martin Kennedy <hurricos@gmail.com>
2 years agoargp-standalone: fix compilation with Alpine Linux
Rosen Penev [Thu, 10 Mar 2022 06:31:14 +0000 (22:31 -0800)]
argp-standalone: fix compilation with Alpine Linux

This package is a C89 one. Add the proper CFLAG to fix compilation.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agobase-files: Align rootfs_data upgrades to 64KiB on eMMC
Brian Norris [Sun, 13 Mar 2022 06:04:30 +0000 (22:04 -0800)]
base-files: Align rootfs_data upgrades to 64KiB on eMMC

Rootfs overlays get created at a ROOTDEV_OVERLAY_ALIGN (64KiB)
alignment after the rootfs, but emmc_do_upgrade() is assuming
it comes at the very next 512-byte sector.

Suggested-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
(move spaces around, mention fstools' libtoolfs)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2 years agoopenssl: bump to 1.1.1n
Martin Schiller [Wed, 16 Mar 2022 14:04:56 +0000 (15:04 +0100)]
openssl: bump to 1.1.1n

This is a bugfix release. Changelog:

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

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

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
2 years agoramips: add support for Netgear WN3100RPv2
Rodolphe de Saint Léger [Wed, 16 Mar 2022 09:19:30 +0000 (10:19 +0100)]
ramips: add support for Netgear WN3100RPv2

This patch adds support for the Netgear WN3100RPv2
http://www.netgear.com/support/product/wn3100rpv2.aspx

Specifications:
- SoC: MediaTek MT7620A (580MHz, ramips)
- RAM: 32MB DDR
- Storage: 8MB NOR SPI flash
- Wireless: builtin MT7620A, 2x2:2 with u.FL connectors
- Ethernet: 1x100M
- Stock firmware based on OpenWRT Kamikaze

Like the EX2700, the bootloader expects a secondary image signature,
see https://forum.openwrt.org/viewtopic.php?pid=312577#p312577

This device seems to be same hardware as a WN3000RPv3

Flash instructions:
- Use the Netgear WebUI to upgrade to OpenWRT using the factory image
  (see note below),
- Use the sysupgrade image for upgrading versions from OpenWRT,
- TFTP recovery procedure can be used to flash the factory image
  (preferred method).

Note:
- The WebUI may not reboot automatically, wait at least 5 minutes before
  powercycling the device

Flashing using TFTP:
- Set you IP address to 192.168.1.10/24 (no gateway)
- Connect your machine to the Ethernet port
- Power off the device and wait for 10 seconds,
- Hold the reset button and power on the device (do not release reset),
- Hold the reset button until the green light is flashing (Approx. 15s)
- launch tftp, set mode to binary and connect to 192.168.1.1
- put the factory firmware image
- All leds will switch off (like a power off), this is normal
- Wait for the device to reboot in the new OpenWRT image (max 5 mins)
- The first boot will take longer than usual.
- After boot, the Device IP on the ethernet port is 192.168.1.1

Signed-off-by: Rodolphe de Saint Léger <rdesaintleger@gmail.com>
[drop unneeded includes in dts, wrap commit message]
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2 years agoRevert "ramips: add support for Netgear WN3000RPv3"
Sungbo Eo [Wed, 16 Mar 2022 14:10:45 +0000 (23:10 +0900)]
Revert "ramips: add support for Netgear WN3000RPv3"

This reverts commit 7bc20cb6143e089fae6ad4b173fc42b55bdbecfe.

It adds support for Netgear WN3100RPv2, but the commit title is wrong.
It will be re-added with the correct title.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2 years agoramips: add support for Netgear WN3000RPv3
Rodolphe de Saint Léger [Wed, 16 Mar 2022 09:19:30 +0000 (10:19 +0100)]
ramips: add support for Netgear WN3000RPv3

This patch adds support for the Netgear WN3100RPv2
http://www.netgear.com/support/product/wn3100rpv2.aspx

Specifications:
- SoC: MediaTek MT7620A (580MHz, ramips)
- RAM: 32MB DDR
- Storage: 8MB NOR SPI flash
- Wireless: builtin MT7620A, 2x2:2 with u.FL connectors
- Ethernet: 1x100M
- Stock firmware based on OpenWRT Kamikaze

Like the EX2700, the bootloader expects a secondary image signature,
see https://forum.openwrt.org/viewtopic.php?pid=312577#p312577

This device seems to be same hardware as a WN3000RPv3

Flash instructions:
- Use the Netgear WebUI to upgrade to OpenWRT using the factory image
  (see note below),
- Use the sysupgrade image for upgrading versions from OpenWRT,
- TFTP recovery procedure can be used to flash the factory image
  (preferred method).

Note:
- The WebUI may not reboot automatically, wait at least 5 minutes before
  powercycling the device

Flashing using TFTP:
- Set you IP address to 192.168.1.10/24 (no gateway)
- Connect your machine to the Ethernet port
- Power off the device and wait for 10 seconds,
- Hold the reset button and power on the device (do not release reset),
- Hold the reset button until the green light is flashing (Approx. 15s)
- launch tftp, set mode to binary and connect to 192.168.1.1
- put the factory firmware image
- All leds will switch off (like a power off), this is normal
- Wait for the device to reboot in the new OpenWRT image (max 5 mins)
- The first boot will take longer than usual.
- After boot, the Device IP on the ethernet port is 192.168.1.1

Signed-off-by: Rodolphe de Saint Léger <rdesaintleger@gmail.com>
[drop unneeded includes in dts, wrap commit message]
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2 years agoramips: mt7620: Add support for D-Link DWR-961 A1
Pawel Dembicki [Thu, 17 Feb 2022 23:23:45 +0000 (00:23 +0100)]
ramips: mt7620: Add support for D-Link DWR-961 A1

The DWR-961 A1 Wireless Router is based on the MT7620A SoC.
It's a merge of two Amit boards: DWR-960 with ethernet part
of Lava LR-25G001.

ROMID it's taken from Telenor branded version and it works with tested
device. Images from D-Link site for this router are from DWR-953 and it
have ROMID DLK6E2424001. I don't know if it's mistake on web-site
or if it's will require different image.

Specification:

- MediaTek MT7620A (580 Mhz)
- 128 MB of RAM
- 16 MB of FLASH
- 1x 802.11bgn radio
- 1x 802.11ac radio (MT7612 mpcie card)
- 5x 10/100/1000 Mbps Ethernet: 4xLAN and 1xWAN (QCA8337)
- 2x internal, non-detachable antennas (Wifi 2.4G)
- 3x external, detachable antennas (2x LTE, 1x Wifi 5G)
- 1x LTE modem cat 6
- UART (J5) header on PCB (57600 8n1)
- 13x LED, 2x button
- JBOOT bootloader

Installation:
Apply factory image via http web-gui or JBOOT recovery page

How to revert to OEM firmware:
- push the reset button and turn on the power. Wait until LED start
  blinking (~10sec.)
- upload original factory image via JBOOT http (IP: 192.168.123.254)

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
2 years agoqoriq: enable I2C in target kernel config
Stijn Tintel [Tue, 15 Mar 2022 23:25:08 +0000 (01:25 +0200)]
qoriq: enable I2C in target kernel config

The I2C controller used in QorIQ PPC devices requires the mpc-i2c
driver, which is enabled by the I2C_MPC kernel config symbol. Enable
this and its dependencies in the target kernel config, as is done for
the mpc85xx target.

This fixes missing hwmon, rtc and tpm devices on the M300.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2 years agobcm4908: include U-Boot DTB files for ASUS GT-AX6000 & Netgear RAX220
Rafał Miłecki [Tue, 15 Mar 2022 17:42:15 +0000 (18:42 +0100)]
bcm4908: include U-Boot DTB files for ASUS GT-AX6000 & Netgear RAX220

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2 years agouboot-bcm4908: add BCM4912 build
Rafał Miłecki [Tue, 15 Mar 2022 17:41:03 +0000 (18:41 +0100)]
uboot-bcm4908: add BCM4912 build

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2 years agouboot-bcm4908: update to the latest generic
Rafał Miłecki [Tue, 15 Mar 2022 13:30:20 +0000 (14:30 +0100)]
uboot-bcm4908: update to the latest generic

0625aad74d arm: dts: add ASUS GT-AX6000
6fb1cb624d arm: dts: add Netgear RAXE450 / RAXE550

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2 years agouboot-bcm4908: use "xxd" from staging_dir
Rafał Miłecki [Tue, 15 Mar 2022 11:40:40 +0000 (12:40 +0100)]
uboot-bcm4908: use "xxd" from staging_dir

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

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2 years agomt76: update to the latest version
Felix Fietkau [Tue, 15 Mar 2022 09:45:38 +0000 (10:45 +0100)]
mt76: update to the latest version

378b638c70c0 mt76: mt7915: fix unused variable with testmode disabled
4f4309542862 mt76: mt7915: only use u32_get_bits with constant value
de06d828a0bf mt76: mt7921: fix injected MPDU transmission to not use HW A-MSDU
c007ba3ec7a9 mt76: mt7915: simplify conditional
64c74dc93f68 mt76: fix dfs state issue with 160 MHz channels
d3471b0d92c1 mt76: mt7615: honor ret from mt7615_mcu_restart in mt7663u_mcu_init
f4c87b32e0e9 mt76: mt7663u: introduce mt7663u_mcu_power_on routine
82de5987af54 mt76: mt7921: fix up the monitor mode
c501df4086e1 mt76: mt7921: use mt76_hw instead of open coding it
594ee03d5a11 mt76: mt7915: fix DFS no radar detection event
d8d2b383a241 mt76: split single ldpc cap bit into bits
0f336fba20fe mt76: mt7921: make mt7921_init_tx_queues static
00a066ce9914 mt76: mt7921: fix xmit-queue dump for usb and sdio
d6d2479568b2 mt76: mt7921: fix mt7921_queues_acq implementation
d17b74420199 mt76: fix monitor mode crash with sdio driver
c374559eae6f mt76: mt7915: allow beaconing on all chains
b219af63b9ce mt76: connac: add 6 GHz support for wtbl and starec configuration
630384cb3246 mt76: mt7915: add 6 GHz support
28ff1bddc7e8 mt76: mt7915: fix eeprom fields of txpower init values
d4b226cc15e7 mt76: mt7915: add txpower init for 6GHz
31e820d4ce4b mt76: mt7921: get rid of mt7921_wait_for_mcu_init declaration
9fee1faf6028 mt76: mt7915: check for devm_pinctrl_get() failure
31a970940b97 mt76: connac: make read-only array ba_range static const
e49af7036bbc mt76: use le32/16_get_bits() whenever possible
0664d39039c2 mt76: fix invalid rssi report
f16fc9d96105 mt76: mt7915: set band1 TGID field in tx descriptor
67ce2708dcef mt76: mt7915: fix beamforming mib stats
6e899abec818 mt76: mt7915: fix phy cap in mt7915_set_stream_he_txbf_caps()
c6780c85cff2 mt76: mt7915: fix typos in comments
aa6eadc09a83 mt76: usb: add req_type to ___mt76u_rr signature
74a519ab8353 mt76: usb: add req_type to ___mt76u_wr signature
2651d2c66cbd mt76: usb: introduce __mt76u_init utility routine
c03e095eee27 mt76: mt7921: disable runtime pm for usb
41085cdcd7e3 mt76: mt7921: update mt7921_skb_add_usb_sdio_hdr to support usb
e700aba6bae3 mt76: mt7921: move mt7921_usb_sdio_tx_prepare_skb in common mac code
056b7f4ebcc6 mt76: mt7921: move mt7921_usb_sdio_tx_complete_skb in common mac code.
0abf682a3def mt76: mt7921: move mt7921_usb_sdio_tx_status_data in mac common code.
b0c60d5252de mt76: mt7921: add mt7921u driver
053668acdaf8 mt76: mt7921: move mt7921_init_hw in a dedicated work

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agokernel: include CONFIG_KEXEC_SIG in configs
Philip Prindeville [Tue, 26 Oct 2021 19:47:17 +0000 (13:47 -0600)]
kernel: include CONFIG_KEXEC_SIG in configs

Seeing failure to build because of missing symbols related to provisioning
CONFIG_KEXEC and signed images.  Without this, if you set
CONFIG_KERNEL_KEXEC=y and try to build, target/linux will hang at:

scripts/kconfig/conf  --syncconfig Kconfig
...
kexec system call (KEXEC) [Y/n/?] y
kexec file based system call (KEXEC_FILE) [Y/n/?] y
Verify kernel signature during kexec_file_load() syscall (KEXEC_SIG) [N/y/?] (NEW)

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2 years agokernel: backport DSA patches fixing null-pointer dereference for 5.10
Marek Behún [Mon, 14 Mar 2022 17:31:30 +0000 (18:31 +0100)]
kernel: backport DSA patches fixing null-pointer dereference for 5.10

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

Signed-off-by: Marek Behún <kabel@kernel.org>
2 years agomac80211: headers: fix lockdep_assert_not_held()
Petr Štetiar [Fri, 11 Mar 2022 19:56:02 +0000 (20:56 +0100)]
mac80211: headers: fix lockdep_assert_not_held()

LOCK_STATE_HELD define was omitted during backport of
lockdep_assert_not_held() which leads to build failures of kernels with
CONFIG_LOCKDEP=y:

 backports-5.15.8-1/backport-include/linux/lockdep.h:16:47: error: 'LOCK_STATE_HELD' undeclared (first use in this function)

Fix it by adding missing LOCK_STATE_HELD define.

References: PR#9373
Reported-by: Oskari Rauta <oskari.rauta@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2 years agoath79: add support for Araknis AN-700-AP-I-AC
Michael Pratt [Wed, 8 Sep 2021 21:00:00 +0000 (17:00 -0400)]
ath79: add support for Araknis AN-700-AP-I-AC

FCC ID: 2AG6R-AN700APIAC

Araknis AN-700-AP-I-AC is an indoor wireless access point with
1 Gb ethernet port, dual-band wireless,
internal antenna plates, and 802.3at PoE+

this board is a Senao device:
the hardware is equivalent to EnGenius EAP1750
the software is modified Senao SDK which is based on openwrt and uboot
including image checksum verification at boot time,
and a failsafe image that boots if checksum fails

**Specification:**

  - QCA9558 SOC MIPS 74kc, 2.4 GHz WMAC, 3x3
  - QCA9880 WLAN PCI card, 5 GHz, 3x3, 26dBm
  - AR8035-A PHY RGMII GbE with PoE+ IN
  - 40 MHz clock
  - 16 MB FLASH MX25L12845EMI-10G
  - 2x 64 MB RAM NT5TU32M16
  - UART console J10, populated, RX shorted to ground
  - 4 antennas 5 dBi, internal omni-directional plates
  - 4 LEDs power, 2G, 5G, wps
  - 1 button reset

  NOTE: all 4 gpio controlled LEDS are viewed through the same lightguide
therefore, the power LED is off for default state

**MAC addresses:**

  MAC address labeled as ETH
  Only one Vendor MAC address in flash at art 0x0

  eth0 ETH  *:xb art 0x0
  phy1 2.4G *:xc ---
  phy0 5GHz *:xd ---

**Serial Access:**

  the RX line on the board for UART is shorted to ground by resistor R176
  therefore it must be removed to use the console
  but it is not necessary to remove to view boot log

  optionally, R175 can be replaced with a solder bridge short

  the resistors R175 and R176 are next to the UART RX pin at J10

**Installation:**

  Method 1: Firmware upgrade page:

    (if you cannot access the APs webpage)
    factory reset with the reset button
    connect ethernet to a computer
    OEM webpage at 192.168.20.253
    username and password 'araknis'
    make a new password, login again...

    Navigate to 'File Management' page from left pane
    Click Browse and select the factory.bin image
    Upload and verify checksum
    Click Continue to confirm
    wait about 3 minutes

  Method 2: Serial to load Failsafe webpage:

    After connecting to serial console and rebooting...
    Interrupt uboot with any key pressed rapidly
    execute `run failsafe_boot` OR `bootm 0x9fd70000`
    wait a minute
    connect to ethernet and navigate to
    192.168.20.253
    Select the factory.bin image and upload
    wait about 3 minutes

**Return to OEM:**

  Method 1: Serial to load Failsafe webpage (above)

  Method 2: delete a checksum from uboot-env
  this will make uboot load the failsafe image at next boot
  because it will fail the checksum verification of the image

    ssh into openwrt and run
    `fw_setenv rootfs_checksum 0`
    reboot, wait a minute
    connect to ethernet and navigate to
    192.168.20.253
    select OEM firmware image and click upgrade

  Method 3: backup mtd partitions before upgrade

**TFTP recovery:**

  Requires serial console, reset button does nothing

  rename initramfs-kernel.bin to '0101A8C0.img'
  make available on TFTP server at 192.168.1.101
  power board, interrupt boot with serial console
  execute `tftpboot` and `bootm 0x81000000`

  NOTE: TFTP may not be reliable due to bugged bootloader
set MTU to 600 and try many times

**Format of OEM firmware image:**

  The OEM software is built using SDKs from Senao
  which is based on a heavily modified version
  of Openwrt Kamikaze or Altitude Adjustment.
  One of the many modifications is sysupgrade being performed by a custom script.
  Images are verified through successful unpackaging, correct filenames
  and size requirements for both kernel and rootfs files, and that they
  start with the correct magic numbers (first 2 bytes) for the respective headers.

  Newer Senao software requires more checks but their script
  includes a way to skip them.

  The OEM upgrade script is at
  /etc/fwupgrade.sh

  OKLI kernel loader is required because the OEM software
  expects the kernel to be less than 1536k
  and the OEM upgrade procedure would otherwise
  overwrite part of the kernel when writing rootfs.

Note on PLL-data cells:

  The default PLL register values will not work
  because of the external AR8035 switch between
  the SOC and the ethernet port.

  For QCA955x series, the PLL registers for eth0 and eth1
  can be see in the DTSI as 0x28 and 0x48 respectively.
  Therefore the PLL registers can be read from uboot
  for each link speed after attempting tftpboot
  or another network action using that link speed
  with `md 0x18050028 1` and `md 0x18050048 1`.

  The clock delay required for RGMII can be applied at the PHY side,
  using the at803x driver `phy-mode` setting through the DTS.
  Therefore, the Ethernet Configuration registers for GMAC0
  do not need the bits for RGMII delay on the MAC side.
  This is possible due to fixes in at803x driver
  since Linux 5.1 and 5.3

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2 years agoath79: add support for Araknis AN-500-AP-I-AC
Michael Pratt [Wed, 17 Mar 2021 05:07:36 +0000 (01:07 -0400)]
ath79: add support for Araknis AN-500-AP-I-AC

FCC ID: 2AG6R-AN500APIAC

Araknis AN-500-AP-I-AC is an indoor wireless access point with
1 Gb ethernet port, dual-band wireless,
internal antenna plates, and 802.3at PoE+

this board is a Senao device:
the hardware is equivalent to EnGenius EAP1200
the software is modified Senao SDK which is based on openwrt and uboot
including image checksum verification at boot time,
and a failsafe image that boots if checksum fails

**Specification:**

  - QCA9557 SOC MIPS 74kc, 2.4 GHz WMAC, 2x2
  - QCA9882 WLAN PCI card 168c:003c, 5 GHz, 2x2, 26dBm
  - AR8035-A PHY RGMII GbE with PoE+ IN
  - 40 MHz clock
  - 16 MB FLASH MX25L12845EMI-10G
  - 2x 64 MB RAM NT5TU32M16
  - UART console J10, populated, RX shorted to ground
  - 4 antennas 5 dBi, internal omni-directional plates
  - 4 LEDs power, 2G, 5G, wps
  - 1 button reset

  NOTE: all 4 gpio controlled LEDS are viewed through the same lightguide
therefore, the power LED is off for default state

**MAC addresses:**

  MAC address labeled as ETH
  Only one Vendor MAC address in flash at art 0x0

  eth0 ETH  *:e1 art 0x0
  phy1 2.4G *:e2 ---
  phy0 5GHz *:e3 ---

**Serial Access:**

  the RX line on the board for UART is shorted to ground by resistor R176
  therefore it must be removed to use the console
  but it is not necessary to remove to view boot log

  optionally, R175 can be replaced with a solder bridge short

  the resistors R175 and R176 are next to the UART RX pin at J10

**Installation:**

  Method 1: Firmware upgrade page:

    (if you cannot access the APs webpage)
    factory reset with the reset button
    connect ethernet to a computer
    OEM webpage at 192.168.20.253
    username and password 'araknis'
    make a new password, login again...

    Navigate to 'File Management' page from left pane
    Click Browse and select the factory.bin image
    Upload and verify checksum
    Click Continue to confirm
    wait about 3 minutes

  Method 2: Serial to load Failsafe webpage:

    After connecting to serial console and rebooting...
    Interrupt uboot with any key pressed rapidly
    execute `run failsafe_boot` OR `bootm 0x9fd70000`
    wait a minute
    connect to ethernet and navigate to
    192.168.20.253
    Select the factory.bin image and upload
    wait about 3 minutes

**Return to OEM:**

  Method 1: Serial to load Failsafe webpage (above)

  Method 2: delete a checksum from uboot-env
  this will make uboot load the failsafe image at next boot
  because it will fail the checksum verification of the image

    ssh into openwrt and run
    `fw_setenv rootfs_checksum 0`
    reboot, wait a minute
    connect to ethernet and navigate to
    192.168.20.253
    select OEM firmware image and click upgrade

  Method 3: backup mtd partitions before upgrade

**TFTP recovery:**

  Requires serial console, reset button does nothing

  rename initramfs-kernel.bin to '0101A8C0.img'
  make available on TFTP server at 192.168.1.101
  power board, interrupt boot with serial console
  execute `tftpboot` and `bootm 0x81000000`

  NOTE: TFTP may not be reliable due to bugged bootloader
set MTU to 600 and try many times

**Format of OEM firmware image:**

  The OEM software is built using SDKs from Senao
  which is based on a heavily modified version
  of Openwrt Kamikaze or Altitude Adjustment.
  One of the many modifications is sysupgrade being performed by a custom script.
  Images are verified through successful unpackaging, correct filenames
  and size requirements for both kernel and rootfs files, and that they
  start with the correct magic numbers (first 2 bytes) for the respective headers.

  Newer Senao software requires more checks but their script
  includes a way to skip them.

  The OEM upgrade script is at
  /etc/fwupgrade.sh

  OKLI kernel loader is required because the OEM software
  expects the kernel to be less than 1536k
  and the OEM upgrade procedure would otherwise
  overwrite part of the kernel when writing rootfs.

Note on PLL-data cells:

  The default PLL register values will not work
  because of the external AR8035 switch between
  the SOC and the ethernet port.

  For QCA955x series, the PLL registers for eth0 and eth1
  can be see in the DTSI as 0x28 and 0x48 respectively.
  Therefore the PLL registers can be read from uboot
  for each link speed after attempting tftpboot
  or another network action using that link speed
  with `md 0x18050028 1` and `md 0x18050048 1`.

  The clock delay required for RGMII can be applied at the PHY side,
  using the at803x driver `phy-mode` setting through the DTS.
  Therefore, the Ethernet Configuration registers for GMAC0
  do not need the bits for RGMII delay on the MAC side.
  This is possible due to fixes in at803x driver
  since Linux 5.1 and 5.3

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2 years agoath79: add support for Araknis AN-300-AP-I-N
Michael Pratt [Fri, 26 Mar 2021 06:12:26 +0000 (02:12 -0400)]
ath79: add support for Araknis AN-300-AP-I-N

FCC ID: U2M-AN300APIN

Araknis AN-300-AP-I-N is an indoor wireless access point with
1 Gb ethernet port, dual-band wireless,
internal antenna plates, and 802.3at PoE+

this board is a Senao device:
the hardware is equivalent to EnGenius EWS310AP
the software is modified Senao SDK which is based on openwrt and uboot
including image checksum verification at boot time,
and a failsafe image that boots if checksum fails

**Specification:**

  - AR9344 SOC MIPS 74kc, 2.4 GHz WMAC, 2x2
  - AR9382 WLAN PCI on-board 168c:0030, 5 GHz, 2x2
  - AR8035-A PHY RGMII GbE with PoE+ IN
  - 40 MHz clock
  - 16 MB FLASH MX25L12845EMI-10G
  - 2x 64 MB RAM 1839ZFG V59C1512164QFJ25
  - UART console J10, populated, RX shorted to ground
  - 4 antennas 5 dBi, internal omni-directional plates
  - 4 LEDs power, 2G, 5G, wps
  - 1 button reset

  NOTE: all 4 gpio controlled LEDS are viewed through the same lightguide
therefore, the power LED is off for default state

**MAC addresses:**

  MAC address labeled as ETH
  Only one Vendor MAC address in flash at art 0x0

  eth0 ETH  *:7d art 0x0
  phy1 2.4G *:7e ---
  phy0 5GHz *:7f ---

**Serial Access:**

  the RX line on the board for UART is shorted to ground by resistor R176
  therefore it must be removed to use the console
  but it is not necessary to remove to view boot log

  optionally, R175 can be replaced with a solder bridge short

  the resistors R175 and R176 are next to the UART RX pin at J10

**Installation:**

  Method 1: Firmware upgrade page:

    (if you cannot access the APs webpage)
    factory reset with the reset button
    connect ethernet to a computer
    OEM webpage at 192.168.20.253
    username and password 'araknis'
    make a new password, login again...

    Navigate to 'File Management' page from left pane
    Click Browse and select the factory.bin image
    Upload and verify checksum
    Click Continue to confirm
    wait about 3 minutes

  Method 2: Serial to load Failsafe webpage:

    After connecting to serial console and rebooting...
    Interrupt uboot with any key pressed rapidly
    execute `run failsafe_boot` OR `bootm 0x9fd70000`
    wait a minute
    connect to ethernet and navigate to
    192.168.20.253
    Select the factory.bin image and upload
    wait about 3 minutes

**Return to OEM:**

  Method 1: Serial to load Failsafe webpage (above)

  Method 2: delete a checksum from uboot-env
  this will make uboot load the failsafe image at next boot
  because it will fail the checksum verification of the image

    ssh into openwrt and run
    `fw_setenv rootfs_checksum 0`
    reboot, wait a minute
    connect to ethernet and navigate to
    192.168.20.253
    select OEM firmware image and click upgrade

  Method 3: backup mtd partitions before upgrade

**TFTP recovery:**

  Requires serial console, reset button does nothing

  rename initramfs-kernel.bin to '0101A8C0.img'
  make available on TFTP server at 192.168.1.101
  power board, interrupt boot with serial console
  execute `tftpboot` and `bootm 0x81000000`

  NOTE: TFTP may not be reliable due to bugged bootloader
set MTU to 600 and try many times

**Format of OEM firmware image:**

  The OEM software is built using SDKs from Senao
  which is based on a heavily modified version
  of Openwrt Kamikaze or Altitude Adjustment.
  One of the many modifications is sysupgrade being performed by a custom script.
  Images are verified through successful unpackaging, correct filenames
  and size requirements for both kernel and rootfs files, and that they
  start with the correct magic numbers (first 2 bytes) for the respective headers.

  Newer Senao software requires more checks but their script
  includes a way to skip them.

  The OEM upgrade script is at
  /etc/fwupgrade.sh

  OKLI kernel loader is required because the OEM software
  expects the kernel to be less than 1536k
  and the OEM upgrade procedure would otherwise
  overwrite part of the kernel when writing rootfs.

Note on PLL-data cells:

  The default PLL register values will not work
  because of the external AR8035 switch between
  the SOC and the ethernet port.

  For QCA955x series, the PLL registers for eth0 and eth1
  can be see in the DTSI as 0x28 and 0x48 respectively.
  Therefore the PLL registers can be read from uboot
  for each link speed after attempting tftpboot
  or another network action using that link speed
  with `md 0x18050028 1` and `md 0x18050048 1`.

  The clock delay required for RGMII can be applied at the PHY side,
  using the at803x driver `phy-mode` setting through the DTS.
  Therefore, the Ethernet Configuration registers for GMAC0
  do not need the bits for RGMII delay on the MAC side.
  This is possible due to fixes in at803x driver
  since Linux 5.1 and 5.3

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2 years agoath79: improve factory.bin for some Senao devices
Michael Pratt [Wed, 17 Mar 2021 23:07:46 +0000 (19:07 -0400)]
ath79: improve factory.bin for some Senao devices

Some boards with firmware made with Senao SDK based on Linux 3.3
have the following lines in the OEM upgrade script at
/etc/fwupgrade.sh

local append=""
local CONF_TAR="/tmp/sysupgrade.tgz"
[ -f "$CONF_TAR" ] && append="-j $CONF_TAR"

and

\# check FWINFO filename
[ -z $(ls FWINFO* | grep -i ${modelname}) ] && errcode="1"

This addition also prevents needing to factory reset after flashing
for some boards that also have these lines in the script

\# Support downgrade but do default (Smart v2.x.x.x -> senaowrt v1.x.x.x)
[ $(ls FWINFO* | grep -i ${modelname} | cut -d "-" -f4 | cut -c 2) -lt 2 ] && append=""

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2 years agorealtek: add support for Panasonic Switch-M8eG PN28080K
INAGAKI Hiroshi [Wed, 9 Mar 2022 14:31:00 +0000 (23:31 +0900)]
realtek: add support for Panasonic Switch-M8eG PN28080K

Panasonic Switch-M8eG PN28080K is a 8 + 1 port gigabit switch, based on
RTL8380M.

Specification:

- SoC : Realtek RTL8380M
- RAM : DDR3 128 MiB (Winbond W631GG8KB-15)
- Flash : SPI-NOR 32 MiB (Macronix MX25L25635FMI-10G)
- Ethernet : 10/100/1000 Mbps x8 + 1
  - port 1-8 : TP, RTL8218B (SoC)
  - port 9 : SFP, RTL8380M (SoC)
- LEDs/Keys : 7x / 1x
- UART : RS-232 port on the front panel (connector: RJ-45)
  - 3:TX, 4:GND, 5:GND, 6:RX (pin number: RJ-45)
  - 9600n8
- Power : 100-240 VAC, 50/60 Hz, 0.5 A
  - Plug : IEC 60320-C13
- Stock OS : VxWorks based

Flash instruction using initramfs image:

1.  Prepare the TFTP server with the IP address 192.168.1.111
2.  Rename the OpenWrt initramfs image to "0101A8C0.img" and place it to
    the TFTP directory
3.  Download the official upgrading firmware (ex: pn28080k_v30000.rom)
    and place it to the TFTP directory
4.  Boot M8eG and interrupt the U-Boot with Ctrl + C keys
5.  Execute the following commands and boot with the OpenWrt initramfs
    image

    rtk network on
    tftpboot 0x81000000
    bootm

6.  Backup mtdblock files to the computer by scp or anything and reboot
7.  Interrupt the U-Boot and execute the following commands to re-create
    filesystem in the flash

    ffsmount c:/
    ffsfmt c:/

    this step takes a long time, about ~ 4 mins

8.  Execute the following commands to put the official images to the
    filesystem

    updatert <official image>

    example:

      updatert pn28080k_v30000.rom

    this step takes about ~ 40 secs

9.  Set the environment variables of the U-Boot by the following commands

    setenv loadaddr 0xb4e00000
    setenv bootcmd bootm
    saveenv

10: Download the OpenWrt initramfs image and boot with it

    tftpboot 0x81000000 0101A8C0.img
    bootm

11: On the initramfs image, download the sysupgrade image and perform
    sysupgrade with it

    sysupgrade <imagename>

12: Wait ~ 120 seconds to complete flashing

Note:

- "Switch-M8eG" is a model name, and "PN28080K" is a model number.
  Switch-M8eG has an another (old) model number ("PN28080"), it's not a
  Realtek based hardware.

- Switch-M8eG has a "POWER" LED (Green), but it's not connected to any
  GPIO pin.

- The U-Boot checks the runtime images in the flash when booting and
  fails to execute anything in "bootcmd" variable if the images are not
  exsisting.

- A filesystem is formed in the flash (0x100000-0x1DFFFFF) on the stock
  firmware and it includes the stock images, configuration files and
  checksum files. It's unknown format, can't be managed on the OpenWrt.
  To get the enough space for OpenWrt, move the filesystem to the head
  of "fs_reserved" partition by execution of "ffsfmt" and "updatert".

- On the other devices in the same series of Switch-M8eG PN28080K, the
  INT pin on the PCA9555 is not connected to anywhere.

Back to the stock firmware:

1. Delete "loadaddr" variable and set "bootcmd" to the original value

   on U-Boot:

     setenv loadaddr
     setenv bootcmd 'bootm 0x81000000'

   on OpenWrt:

     fw_setenv loadaddr
     fw_setenv bootcmd 'bootm 0x81000000'

2. Perform reset or reboot

  on U-Boot:

    reset

  on OpenWrt:

    reboot

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Reviewed-by: Sander Vanheule <sander@svanheule.net>
2 years agorealtek: enable pca953x driver for rtl838x subtarget
INAGAKI Hiroshi [Wed, 9 Mar 2022 14:30:59 +0000 (23:30 +0900)]
realtek: enable pca953x driver for rtl838x subtarget

The system status LED on Panasonic Switch-M8eG PN28080K is connected to
a PCA9539PW. To use the LED as a status LED of OpenWrt while booting,
enable the pca953x driver and built-in to the kernel.
Also enable CONFIG_GPIO_PCA953X_IRQ to use interrupt via RTL83xx GPIO.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Acked-by: Sander Vanheule <sander@svanheule.net>
2 years agorealtek: add ZyXEL GS1900-24 v1 support
Martin Kennedy [Sat, 5 Mar 2022 19:02:36 +0000 (14:02 -0500)]
realtek: add ZyXEL GS1900-24 v1 support

The ZyXEL GS1900-24 v1 is a 24 port switch with two SFP ports, similar to
the other GS1900 switches.

Specifications
--------------
* Device:    ZyXEL GS1900-24 v1
* SoC:       Realtek RTL8382M 500 MHz MIPS 4KEc
* Flash:     16 MiB
* RAM:       Winbond W9751G8KB-25 64 MiB DDR2 SDRAM
* Ethernet:  24x 10/100/1000 Mbps, 2x SFP 100/1000 Mbps
* LEDs:
  * 1 PWR LED (green, not configurable)
  * 1 SYS LED (green, configurable)
  * 24 ethernet port link/activity LEDs (green, SoC controlled)
  * 2 SFP status/activity LEDs (green, SoC controlled)
* Buttons:
  * 1 "RESET" button on front panel (soft reset)
  * 1 button ('SW1') behind right hex grate (hardwired power-off)
* Power:     120-240V AC C13
* UART:      Internal populated 10-pin header ('J5') providing RS232;
             connected to SoC UART through a SIPEX 3232EC for voltage
             level shifting.

* 'J5' RS232 Pinout (dot as pin 1):
  2) SoC RXD
  3) GND
  10) SoC TXD

Serial connection parameters: 115200 8N1.

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

OEM upgrade method:

* Log in to OEM management web interface

* Navigate to Maintenance > Firmware > Management

* If "Active Image" has the first option selected, OpenWrt will need to be
  flashed to the "Active" partition. If the second option is selected,
  OpenWrt will need to be flashed to the "Backup" partition.

* Navigate to Maintenance > Firmware > Upload

* Upload the openwrt-realtek-rtl838x-zyxel_gs1900-24-v1-initramfs-kernel.bin
  file by your preferred method to the previously determined partition.
  When prompted, select to boot from the newly flashed image, and reboot
  the switch.

* Once OpenWrt has booted, scp the sysupgrade image to /tmp and flash it:

  > sysupgrade /tmp/openwrt-realtek-rtl838x-zyxel_gs1900-24-v1-squashfs-sysupgrade.bin

U-Boot TFTP method:

* Configure your client with a static 192.168.1.x IP (e.g. 192.168.1.10).

* Set up a TFTP server on your client and make it serve the initramfs
  image.

* Connect serial, power up the switch, interrupt U-boot by hitting the
  space bar, and enable the network:

  > rtk network on

> Since the GS1900-24 v1 is a dual-partition device, you want to keep the
  OEM firmware on the backup partition for the time being. OpenWrt can
  only be installed in the first partition anyway (hardcoded in the
  DTS). To ensure we are set to boot from the first partition, issue the
  following commands:

  > setsys bootpartition 0
  > savesys

* Download the image onto the device and boot from it:

  > tftpboot 0x81f00000 192.168.1.10:openwrt-realtek-rtl838x-zyxel_gs1900-24-v1-initramfs-kernel.bin
  > bootm

* Once OpenWrt has booted, scp the sysupgrade image to /tmp and flash it:

  > sysupgrade /tmp/openwrt-realtek-rtl838x-zyxel_gs1900-24-v1-squashfs-sysupgrade.bin

Signed-off-by: Martin Kennedy <hurricos@gmail.com>
2 years agokernel/modules: add kmod-inet-diag package
Tianling Shen [Wed, 9 Mar 2022 02:35:04 +0000 (10:35 +0800)]
kernel/modules: add kmod-inet-diag package

Add option to compile kmod-inet-diag, support for INET (TCP, DCCP, etc)
socket monitoring interface used by native Linux tools such as ss.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2 years agokernel: bump 5.10 to 5.10.104
John Audia [Tue, 8 Mar 2022 22:01:48 +0000 (17:01 -0500)]
kernel: bump 5.10 to 5.10.104

All patches automatically rebased.

Build system: x86_64
Build-tested: bcm2711/RPi4B, mt7622/RT3200
Run-tested: bcm2711/RPi4B, mt7622/RT3200

Signed-off-by: John Audia <graysky@archlinux.us>
2 years agotools/ccache: update to 4.6
Rosen Penev [Mon, 7 Mar 2022 04:46:22 +0000 (20:46 -0800)]
tools/ccache: update to 4.6

Full changelog: https://ccache.dev/releasenotes.html#_ccache_4_6

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agotools/fakeroot: update to 1.28
Rosen Penev [Mon, 7 Mar 2022 04:53:47 +0000 (20:53 -0800)]
tools/fakeroot: update to 1.28

Refreshed patches.

Upstream says there's only a bugfix for GNU Hurd.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agotools/cmake: update to 3.22.3
Rosen Penev [Mon, 7 Mar 2022 04:30:53 +0000 (20:30 -0800)]
tools/cmake: update to 3.22.3

Seems to be mostly pthread fixes.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agotools/mtools: update to 4.0.38
Rosen Penev [Mon, 7 Mar 2022 05:02:33 +0000 (21:02 -0800)]
tools/mtools: update to 4.0.38

No real changelog available.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agoiptables: backport missing init_extensions6() calls
Etienne Champetier [Sun, 13 Mar 2022 05:24:13 +0000 (00:24 -0500)]
iptables: backport missing init_extensions6() calls

This fixes ip6tables-nft no being able to use built-in
extensions like icmp6.

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2 years agoipset: add backport patch for IPv6 nftables ipset-translation
Florian Eckert [Wed, 2 Mar 2022 08:42:52 +0000 (09:42 +0100)]
ipset: add backport patch for IPv6 nftables ipset-translation

When porting mwan3 from iptables to nftables I tried the new translation
tool for ipset ipset-translate. I noticed that no IPv6 ipset can be
created with the tool. I have reported the problem to the upstream
project and the following patch fixes the problem.

Until this upsream is included in a new release, this patch should be
used in Openwrt.

https://lore.kernel.org/netfilter-devel/20220228190217.2256371-1-pablo@netfilter.org/T/#m09cc3cb738f2e42024c7aecf5b7240d9f6bbc19c

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2 years agotools/expat: enable DTD
Rosen Penev [Sat, 12 Mar 2022 22:58:10 +0000 (14:58 -0800)]
tools/expat: enable DTD

Fixes gdb usage, which depends on it.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agotools/expat: update to 2.4.7
Rosen Penev [Mon, 7 Mar 2022 04:58:29 +0000 (20:58 -0800)]
tools/expat: update to 2.4.7

Mostly a bug fix to the bug fix to CVE-2022-25236

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agoramips: Apply pinctrl DTS changes to TL-WPA8631P
Joe Mullally [Tue, 8 Mar 2022 19:33:37 +0000 (19:33 +0000)]
ramips: Apply pinctrl DTS changes to TL-WPA8631P

Applies changes from 7774b86019 to new device committed later. Fix some
whitespace in the DTS. Use standard model name format in DTS.

Fixes: 6c743c3006f9 ("ramips: Add support for TP-Link TL-WPA8631P v3")
Signed-off-by: Joe Mullally <jwmullally@gmail.com>
Reported-by: Arınç ÜNAL <arinc.unal@arinc9.com>
2 years agoath79: Add LED labels for Airtight C-75
Sven Schwermer [Wed, 9 Mar 2022 08:46:41 +0000 (09:46 +0100)]
ath79: Add LED labels for Airtight C-75

Keep labels since OpenWrt userland tooling (get_dt_led) depends on them
to find the LED instances referenced by the led-* aliases.

The label for the amber power LED was removed in 4eefdc7adb.

Signed-off-by: Sven Schwermer <sven@svenschwermer.de>
2 years agoramips: update WLAN MAC address of JCG Y2
Chukun Pan [Mon, 10 Jan 2022 04:28:40 +0000 (12:28 +0800)]
ramips: update WLAN MAC address of JCG Y2

MAC addresses on OEM firmware:
  04:xx:xx:xx:xx:c8  factory 0x4     wlan2g
  06:xx:xx:xx:xx:c8  [not on flash]  wlan5g

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2 years agoramips: update WLAN MAC address of Phicomm K2P
Chukun Pan [Sun, 9 Jan 2022 04:16:06 +0000 (12:16 +0800)]
ramips: update WLAN MAC address of Phicomm K2P

The wireless mac address difference of this machine is similar
to that of D-Link DIR-853-R1, so use the same practice.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2 years agoramips: Add support for Dual-Q H721
Dawsen Gao [Sat, 12 Feb 2022 02:21:21 +0000 (10:21 +0800)]
ramips: Add support for Dual-Q H721

Dual-Q H721 is a router platform board, it is the smaller model of
the U7621-06.

The device has the following specifications:

MT7621AT (880 MHz)
256 of RAM (DDR3)
16 MB of FLASH (MX25l12805d SPI)
5x 1 Gbps Ethernet (MT7621 built-in switch)
1x M.2 (NGFF) 3.7V 3A max for 5G M.2 Modem work at USB3.0 mode
1x Minipcie 3.7V 3A max for LTE Modem work at USB2.0 Mode
2x Minipcie for WIFI card
4x Lan+1x Wan 10/100M/1000M RJ45 port
14x LEDs (1x GPIO-controlled)
1x reset button
1x UART header (4-pins)
1x mico SD-card reader
1x DC jack for main power (5~27 V)

The following has been tested and is working:

Ethernet switch
miniPCIe slots (tested with Wi-Fi cards and LTE modem cards)
miniSIM slot (works with normal size simcard)
sysupgrade
reset button
micro SD-card reader

Installation:

This board has no locked down bootloader. The seller can be asked to
install openwrt, so upgrades are standard sysupgrade method.

Recovery:

This board contains a Chinese, closed-source bootloader called Breed
(Boot and Recovery Environment for Embedded Devices). Breed supports web
recovery and to enter it, you keep the reset button pressed for around
5 seconds during boot. Your machine will be assigned an IP through DHCP
and the router will use IP address 192.168.1.1. The recovery website is
in Chinese, but is easy to use. Click on the second item in the list to
access the recovery page, then the second item on the next page is where
you select the firmware. In order to start the recovery, you click the
button at the bottom.

Signed-off-by: Dawsen Gao <dawsen_gao@163.com>
[change author name (used SoB one), add ethernet pinctrl,
 apply sorting to device recipe]
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2 years agobase-files: call "sync" after initial setup
Rafał Miłecki [Tue, 1 Mar 2022 17:46:27 +0000 (18:46 +0100)]
base-files: call "sync" after initial setup

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

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

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

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

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

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

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

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
2 years agouqmi: update to git HEAD
Daniel Golle [Sat, 12 Mar 2022 11:07:27 +0000 (11:07 +0000)]
uqmi: update to git HEAD

 44dd095 uqmi: corrected too short received SMS

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agouqmi: set CID during 'query-data-status' operation
Lech Perczak [Sat, 12 Mar 2022 00:50:53 +0000 (01:50 +0100)]
uqmi: set CID during 'query-data-status' operation

Modems used in ZTE mobile broadband routers require to query the data
session status using the same CID as one used to establish the session,
otherwise they will report the session as "disconnected" despite
reporting correct PDH in previous step. Without this change, IPv6
connection on these modems doesn't establish properly. In IPv4 this bug
is present as well, but for some reason querying of IPv4 status works
using temporary CID, this however seems noncompliant with QMI
specifications, so fix it as well.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
2 years agobcm4908: include U-Boot in images
Rafał Miłecki [Fri, 4 Mar 2022 08:39:05 +0000 (09:39 +0100)]
bcm4908: include U-Boot in images

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

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2 years agouboot-bcm4908: add package with BCM4908 U-Boot
Rafał Miłecki [Fri, 4 Mar 2022 08:39:04 +0000 (09:39 +0100)]
uboot-bcm4908: add package with BCM4908 U-Boot

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

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2 years agoimx: fix USB support
Piotr Dymacz [Thu, 10 Mar 2022 22:29:21 +0000 (23:29 +0100)]
imx: fix USB support

The ChipIdea USB kernel driver gained support for disabling glue drivers
in 5.8, see upstream commmit: 95caa2ae70fd ("usb: chipidea: allow
disabling glue drivers if EMBEDDED").

This enables 'CONFIG_USB_CHIPIDEA_IMX' in the 'imx' target kernel config
which brings back USB support.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2 years agox86: legacy: enable pata_sis driver
Matthias Schiffer [Thu, 10 Mar 2022 22:24:10 +0000 (23:24 +0100)]
x86: legacy: enable pata_sis driver

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

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2 years agokernel: wwan: add MeigLink SLM750 modem support
Daniel Golle [Thu, 10 Mar 2022 17:53:01 +0000 (17:53 +0000)]
kernel: wwan: add MeigLink SLM750 modem support

Add patch found in Teltonika RUT9_R_00.07.01.4 GPL SDK download[1]
adding USB IDs of the MeigLink SLM750 to the relevant kernel drivers.
Newer versions of Teltonika's 2G/3G/4G RUT9XX WWAN router series come
with this kind of modem.

[1]: https://wiki.teltonika-networks.com/view/GPL
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agoiptables: add iptables-mod-socket
Yousong Zhou [Wed, 9 Mar 2022 05:00:42 +0000 (13:00 +0800)]
iptables: add iptables-mod-socket

Previously libxt_socket.so was included in iptables-mod-tproxy.  It was
missed out when trying to make kmod-ipt-socket and kmod-ipt-tproxy
separate packages

Fixes: 4f443c88 ("netfilter: separate packages for kmod-ipt-socket and kmod-ipt-tproxy")
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2 years agoCI: move logs/ to GITHUB_WORKSPACE
Paul Spooren [Wed, 9 Mar 2022 12:30:21 +0000 (13:30 +0100)]
CI: move logs/ to GITHUB_WORKSPACE

Artifacts can only be uploaded from inside the GITHUB_WORKSPACE. While
the Linux CI jobs run inside that per default, a special case-sensitive
mount outside the GITHUB_WORKSPACE is used for macOS builds.

To make log artifacts work for both macOS and Linux, move logs/ folder
to GITHUB_WORKSPACE on failures.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2 years agotoolchain: binutils: add support for version 2.38
Rui Salvaterra [Wed, 9 Feb 2022 15:18:45 +0000 (15:18 +0000)]
toolchain: binutils: add support for version 2.38

While at it, also fix the download.xs4all.nl and add ftp.gnu.org to the GNU
mirrors, as it seems to be updated faster.

Deleted (upstreamed):
600-Close_the_file_descriptor.patch [1]

[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=5a98fb7513b559e20dfebdbaa2a471afda3b4742

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2 years agoramips: allow USB power control on TP-Link MR3020v3
Dmitry Chigiryov [Fri, 25 Feb 2022 09:41:12 +0000 (12:41 +0300)]
ramips: allow USB power control on TP-Link MR3020v3

By switching EPHY_LED4_N_JTRST_N from EPHY_LED4_N to GPIO#39
we can control USB port power an all current revisions of MR3020v3.
It was not a thing on some first revisions, pin was unused.
But for now on all current MR3020v3 boards EPHY_LED4_N_JTRST_N pin
is connected to USB power key.
Also it was not used as EPHY indicator on any revision of the board.

Signed-off-by: Dmitry Chigiryov <dmitry.chigiryov@ya.ru>
[changed author address (used SoB one)]
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2 years agoramips: fix DEVICE_VENDOR for unbranded devices
Sungbo Eo [Thu, 24 Feb 2022 14:17:45 +0000 (23:17 +0900)]
ramips: fix DEVICE_VENDOR for unbranded devices

In commit ee66fe4ea9a6 ("ramips: convert DEVICE_TITLE to new variables"),
DEVICE_VENDOR of some unbranded devices were set incorrectly:
* WR512-3GN is not a dev board from Ralink.
* "XDX-RN502J" is the whole model name and should be not split.

This patch sets their DEVICE_VENDOR to "Unbranded", and changes their DTS
model properties accordingly.

Ref: d0bf15f23595 ("ramips: add support for A5-V11 board (resubmit)")
Ref: 9085b05d9e71 ("ramips: rt305x: support for wr512-3gn-like routers")
Ref: 0e486d2fd297 ("ramips: add support for unbranded XDX-RN502J board")
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2 years agoramips: mt7621: add support for Zbtlink ZBT-WG1608
Kim Namu [Wed, 23 Feb 2022 15:14:37 +0000 (00:14 +0900)]
ramips: mt7621: add support for Zbtlink ZBT-WG1608

Zbtlink ZBT-WG1608 is a Wi-Fi router intendent to use with WWAN (4G/5G)
modems.

Specifications:
* SoC: MediaTek MT7621A
* RAM: 256/512 MiB
* Flash: 16/32 MiB (SPI NOR)
* Wi-Fi:
  * MediaTek MT7603E : 2.4Ghz
  * MediaTek MT7613BE : 5Ghz
* Ethernet: 10/100/1000 Mbps Ethernet x5 ports (4xLAN + WAN)
* M.2: 1x slot with USB&SIM
  * EM7455/EM12-G/EM160R/RM500Q-AE
* USB: 1x 3.0 Type-A port
* External storage: 1x microSD (SDXC) slot
* UART: console (115200 baud)
* LED:
  * 1 power indicator
  * 1 WLAN 2.4G controlled (wlan 2G)
  * 3 SoC controlled (wlan 5G, wwan, internet)
  * 5 per Eth phy (4xLAN + WAN)

MAC Addresses:
* LAN    : f8:5e:3c:xx:xx:e0 (Factory, 0xe000 (hex))
* WAN    : f8:5e:3c:xx:xx:e1 (Factory, 0xe006 (hex))
* 2.4 GHz: f8:5e:3c:xx:xx:de (Factory, 0x0004 (hex))
* 5 GHz  : f8:5e:3c:xx:xx:df (Factory, 0x8004 (hex))

Installation:
* Vendor's firmware is OpenWrt (LEDE) based, so the sysupgrade image can
  be directly used to install OpenWrt. Firmware must be upgraded using the
  'force' and 'do not save configuration' command line options (or
  correspondig web interface checkboxes) since the vendor firmware is from
  the pre-DSA era.

Recovery Mode:
 * Press reset button, power up the device, wait for about 10sec.
 * Upload sysupgrade image through the firmware recovery mode web page at
  192.168.1.1.

Signed-off-by: Kim Namu <namu@theseed.io>
2 years agoramips: add support for Asus RT-AC1200
Ray Wang [Thu, 10 Feb 2022 15:16:05 +0000 (23:16 +0800)]
ramips: add support for Asus RT-AC1200

Asus RT-AC1200 is a 2.4/5GHz dual band AC router,
based on MediaTek MT7628AN.

Specification:
* SoC: MT7628AN
* RAM: DDR2 64 MiB
* Flash: 16 MiB NOR (W25Q128BV)
* Wi-Fi:
  * 2.4GHz: SoC Built-in
  * 5GHz: MT7612EN
* Ethernet: 5x 100Mbps
  * Switch: SoC built-in
* USB: 1x 2.0

Flash Layout:
 0x0000000-0x0030000 : "bootloader"
 0x0030000-0x0040000 : "nvram"
 0x0040000-0x0050000 : "factory"
 0x0050000-0x1000000 : "firmware"

MAC address:
 LAN: factory 0x28
 WAN: factory 0x22
 2.4G: factory 0x4
 5G: factory 0x8004

Installation via **recovery** mode:
1. Download the Asus recovery firmware (windows) tool from
   http://dlcdnet.asus.com/pub/ASUS/LiveUpdate/Release/Wireless/Rescue.zip
2. Set your ethernet IP manually 192.168.1.5 / 255.255.255.0 with NO
   gateway.
3. Plug in your ethernet to LAN port 1 on the router.
4. Load up the recovery software with the firmware file, but don't press
   "Upload" yet.
5. Plug in the router to power WHILE HOLDING the reset button in. While
   CONTINUING to hold the button, select "Upload" Continue to hold the
   reset button in until it finishes and verifies!
6. If that doesn't work try pressing "Upload" first just before you do
   step 5. At some point while holding reset the rescue tool will finally
   detect and upload the firmware. That's when you can let go of the
   reset button.
7. The router will reboot and not much will happen. Wait a minute or 2.
8. Power off and on the router again. Voila. Set everything your Ethernet
   IP back to DHCP (automatically) and you're good to go.

Revert to stock firmware:
1. Install stock image via recovery mode.

Tested-by: Ivan Pavlov <AuthorReflex@gmail.com>
Signed-off-by: Ray Wang <raywang777@foxmail.com>
2 years agotools: zip: make encrypted archives reproducible
Sungbo Eo [Sat, 12 Feb 2022 08:01:31 +0000 (17:01 +0900)]
tools: zip: make encrypted archives reproducible

Zip always try to generate new encryption header depending on execution
time and process id, which is far from being reproducible. This commit
changes the zip srand() seed to a predictable value to generate
reproducible random bytes for the encryption header. This will compromise
the goal of secure archive encryption, but it would not be a big problem
for our purpose.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2 years agotools: zip: fetch SOURCE_DATE_EPOCH directly
Sungbo Eo [Sat, 12 Feb 2022 08:01:31 +0000 (17:01 +0900)]
tools: zip: fetch SOURCE_DATE_EPOCH directly

Remove "--mtime" option introduced in commit 18c9faa03211 ("tools: zip:
add option for reproducible archives") and instead fetch SOURCE_DATE_EPOCH
environment variable directly in the code.

Ref: https://sourceforge.net/p/infozip/patches/25/
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2 years agobuild: image: use UTC for zip timestamp
Sungbo Eo [Sat, 12 Feb 2022 08:01:31 +0000 (17:01 +0900)]
build: image: use UTC for zip timestamp

Zip uses DOS timestamp for mtime which is stored in local time and hence
depends on the timezone of the build system. Force zip to use UTC timezone
to make image builds more reproducible.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2 years agoramips: add support for Renkforce WS-WN530HP3-A
Birger Koblitz [Mon, 7 Mar 2022 18:50:29 +0000 (19:50 +0100)]
ramips: add support for Renkforce WS-WN530HP3-A

This adds support for the Renkforce WS-WN530HP3-A ceiling-
mountable Wireless Access Point, which is powered over PoE.
Hardware:
- SoC: Mediatek MT7621DAT
- RAM: 128MiB on SoC
- Flash: 16MiB GigaDevice GD25Q128C
- 2.4Ghz Wifi: Mediatek MT603EN
- 5GHz Wifi: MT613BEN
- Ethernet:
  - 1x 1GBit WAN port, passive PoE capable
  - 2x 1GBit LAN ports
LEDs: 1x Bi-Color LED (red/blue)
Buttons: 1x Reset Button, 1x Power Button

Installation:
Power on the access point and immedately press the reset
button for 10 seconds. Connect web-browser to 192.168.10.1
and upload sysupgrade image. Flash uploaded image and wait
about 2 minutes for reboot.

Signed-off-by: Birger Koblitz <mail@birger-koblitz.de>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [fixed SoB]
2 years agoath79: fix button labels for WZR-HP-AG300H and WZR-600DHP
Jeffery To [Sun, 6 Mar 2022 14:47:20 +0000 (22:47 +0800)]
ath79: fix button labels for WZR-HP-AG300H and WZR-600DHP

These were present in ar71xx but overlooked when porting to ath79.

Fixes: 480bf2827392 ("ath79: add support for Buffalo WZR-HP-AG300H")
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2 years agoath79: add support for MikroTik RouterBOARD mAP lite
Thibaut VARÈNE [Mon, 28 Feb 2022 10:34:43 +0000 (11:34 +0100)]
ath79: add support for MikroTik RouterBOARD mAP lite

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

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

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

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

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

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2 years agoipq806x: provide ramoops for R7800/XR500 by default
Hannu Nyman [Sun, 6 Mar 2022 09:56:15 +0000 (11:56 +0200)]
ipq806x: provide ramoops for R7800/XR500 by default

Add kmod-ramoops to the default set of device packages in
R7800 and XR500, so that the ramoops kernel crash logs
are provided by default for these routers.

The capability was earlier defined by 97158fe1 and cf346dfa,
but the feature was not yet turned on by default.

The possible kernel crashes are stored into /sys/fs/pstore/*

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2 years agoath79: Add green power LED to Airtight C-75
Sven Schwermer [Mon, 7 Mar 2022 21:08:32 +0000 (22:08 +0100)]
ath79: Add green power LED to Airtight C-75

In addition to the missing green LED definition, the polarity of the
amber power LED was incorrect which is fixed here.

Signed-off-by: Sven Schwermer <sven@svenschwermer.de>
2 years agolantiq: xrx200: fix use after free bug
Aleksander Jan Bajkowski [Sat, 5 Mar 2022 11:54:48 +0000 (12:54 +0100)]
lantiq: xrx200: fix use after free bug

The skb->len field is read after the packet is sent to the network
stack. In the meantime, skb can be freed. This patch fixes this bug.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
2 years agouboot-envtools: add support for I-O DATA BSH-G24MB
INAGAKI Hiroshi [Sun, 18 Apr 2021 01:23:09 +0000 (10:23 +0900)]
uboot-envtools: add support for I-O DATA BSH-G24MB

This patch adds the device-specific configuration to u-boot-envtools for
I-O DATA BSH-G24MB switch.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2 years agorealtek: add support for I-O DATA BSH-G24MB
INAGAKI Hiroshi [Sat, 17 Apr 2021 01:10:27 +0000 (10:10 +0900)]
realtek: add support for I-O DATA BSH-G24MB

I-O DATA BSH-G24MB is a 24 port gigabit switch, based on RTL8382M.

Specification:

- SoC : Realtek RTL8382M
- RAM : DDR2 128 MiB (Nanya NT5TU128M8HE-AC)
- Flash : SPI-NOR 16 MiB (Macronix MX25L12835FM2I-10G)
- Ethernet : 10/100/1000 Mbps x24
  - port 1-8 : RTL8218B
  - port 9-16 : RTL8218B (SoC)
  - port 17-24 : RTL8218B
- LEDs/Keys : 2x, 1x
- UART : pin header on PCB
  - JP2: 3.3V, TX, RX, GND from rear side
  - 115200n8
- Power : 100 VAC, 50/60 Hz
  - Plug : IEC 60320-C13

Flash instruction using sysupgrade image:

1. Boot BSH-G24MB normally
2. Connect BSH-G24MB to the DHCP enabled network
3. Find the device's IP address and open the WebUI and login
   Note: by default, the device obtains IP address from DHCP server of
         the network
4. Open firmware update page ("ファームウェア アップデート")
5. Rename the OpenWrt sysupgrade image to "bsh-g24mb_v100.image" and
   select it
6. Press apply ("適用") button to perform update
7. Wait ~150 seconds to complete flashing

Note:

- BSH-G24MB has a power-related LED ("電源"), but it's not connected to
  the GPIO of the SoC or RTL8231 and cannot be controlled. Instead of
  it, use system status LED on other than running-state.

- "sys_loop" LED indicates system status and loop-detection status in
  stock firmware.

- BSH-G24MB has 2x os-image partitions named as "RUNTIME"/"RUNTIME2" in
  16 MiB SPI-NOR flash and the size of image per partition is only
  6848 KiB. The secondary image is never used on stock firmware, so also
  use it on OpenWrt to get more space.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2 years agonftables: update to version 1.0.2
Josef Schlehofer [Sat, 5 Mar 2022 23:16:27 +0000 (00:16 +0100)]
nftables: update to version 1.0.2

Changelog:
https://lwn.net/ml/netdev/YhO5Pn+6+dgAgSd9@salvia/

Patches:

removed:
- 001-parser-allow-quoted-string-in-flowtable_expr_member:
it is now part of upstream release [1]

added:
- 001-examples-compile-with-make-check.patch:
backported from [2], it fixes:

nft-json-file.c:3:10: fatal error: nftables/libnftables.h: No such file or directory
    3 | #include <nftables/libnftables.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

[1] https://git.netfilter.org/nftables/commit/?h=v1.0.2&id=07af4429241c9832a613cb8620331ac54257d9df
[2] https://git.netfilter.org/nftables/commit/?id=18a08fb7f0443f8bde83393bd6f69e23a04246b3

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2 years agolinux-firmware: Update to version 20220209
Hauke Mehrtens [Sun, 6 Mar 2022 20:44:06 +0000 (21:44 +0100)]
linux-firmware: Update to version 20220209

This switches the iwlwifi-firmware-ax200 file to API version 66, this is
the most recent version supported by our driver.

The following files used in OpenWrt changed:
 amdgpu-firmware/lib/firmware/amdgpu/yellow_carp_dmcub.bin
 ar3k-firmware/lib/firmware/qca/nvm_usb_00130201.bin
 ar3k-firmware/lib/firmware/qca/nvm_usb_00130201_010a.bin
 ar3k-firmware/lib/firmware/qca/nvm_usb_00130201_010b.bin
 ar3k-firmware/lib/firmware/qca/nvm_usb_00130201_0303.bin
 ar3k-firmware/lib/firmware/qca/nvm_usb_00130201_gf.bin
 ar3k-firmware/lib/firmware/qca/nvm_usb_00130201_gf_010a.bin
 ar3k-firmware/lib/firmware/qca/nvm_usb_00130201_gf_010b.bin
 ar3k-firmware/lib/firmware/qca/nvm_usb_00130201_gf_0303.bin
 ar3k-firmware/lib/firmware/qca/rampatch_usb_00130200.bin
 ar3k-firmware/lib/firmware/qca/rampatch_usb_00130201.bin
 iwlwifi-firmware-ax200/lib/firmware/iwlwifi-cc-a0-66.ucode
 iwlwifi-firmware-ax210/lib/firmware/iwlwifi-ty-a0-gf-a0-66.ucode
 iwlwifi-firmware-ax210/lib/firmware/iwlwifi-ty-a0-gf-a0.pnvm
 iwlwifi-firmware-iwl9000/lib/firmware/iwlwifi-9000-pu-b0-jf-b0-46.ucode
 iwlwifi-firmware-iwl9260/lib/firmware/iwlwifi-9260-th-b0-jf-b0-46.ucode
 rtl8822ce-firmware/lib/firmware/rtw88/rtw8822c_fw.bin

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agobcm4908: fix init on CFE devices
Rafał Miłecki [Mon, 7 Mar 2022 10:12:36 +0000 (11:12 +0100)]
bcm4908: fix init on CFE devices

exit in preinit script was stopping whole process

Fixes: 93259e8ca261 ("bcm4908: support "rootfs_data" on U-Boot devices")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2 years agobpf-headers: ship a modified version of stdarg.h from musl to fix ebpf build on glibc
Felix Fietkau [Mon, 7 Mar 2022 09:37:15 +0000 (10:37 +0100)]
bpf-headers: ship a modified version of stdarg.h from musl to fix ebpf build on glibc

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agotoolchain/binutils: remove old versions
Felix Fietkau [Mon, 7 Mar 2022 07:43:52 +0000 (08:43 +0100)]
toolchain/binutils: remove old versions

Signed-off-by: Felix Fietkau <nbd@nbd.name>