openwrt/staging/blocktrron.git
2 years agobase-files: fix issues in nand sysupgrade
Rodrigo Balerdi [Fri, 15 Apr 2022 13:11:52 +0000 (10:11 -0300)]
base-files: fix issues in nand sysupgrade

Fix issues while retaining configuration during nand sysupgrade:
- abort configuration saving if data partition is not found
- generate diagnostics if saving fails (eg, because of lack of space)
- do not output "sysupgrade successful" in case of errors

Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
2 years agobase-files: clean up nand sysupgrade code
Rodrigo Balerdi [Fri, 15 Apr 2022 10:18:22 +0000 (07:18 -0300)]
base-files: clean up nand sysupgrade code

Fix some inconsistent quoting in nand sysupgrade code.

Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
2 years agobase-files: clean up ubinized sysupgrade code
Rodrigo Balerdi [Fri, 15 Apr 2022 09:42:51 +0000 (06:42 -0300)]
base-files: clean up ubinized sysupgrade code

Remove redundant check from nand ubinized sysupgrade code. This check
has already been done in the only caller of the affected function:
nand_do_upgrade.

Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
2 years agobase-files: clean up nand tar sysupgrade code
Rodrigo Balerdi [Fri, 15 Apr 2022 09:31:24 +0000 (06:31 -0300)]
base-files: clean up nand tar sysupgrade code

Prepares code for ubirename-based safe sysupgrade implementation.

Fixes several issues:
- the special CI_KERNPART value "none" is ignored if an MTD partition
  named "none" exists
- misleading variable names (such as has_kernel to mean "tar has kernel
  and it should not be written to an MTD partition but a UBI volume")
- inconsistent treatment of zero-length tar member files
- inconsistent meaning of "0" and "" variable values
- redundant operations (unneeded untaring, repeated untaring, unneeded
  partition lookups)
- inconsistent variable quoting

Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
2 years agobase-files: safer sysupgrade.tar for kernel-out-of-UBI
Rodrigo Balerdi [Fri, 15 Apr 2022 06:24:58 +0000 (03:24 -0300)]
base-files: safer sysupgrade.tar for kernel-out-of-UBI

Ensure that the kernel CRC is invalidated while rootfs is being updated.
This allows the bootloader to detect an interrupted sysupgrade and fall
back to an alternate booting method, such as TFTP, instead of just going
ahead with normal boot and effectively bricking the device.

Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
2 years agobase-files: safer sysupgrade for kernel-in-UBI devices
Rodrigo Balerdi [Fri, 15 Apr 2022 03:59:49 +0000 (00:59 -0300)]
base-files: safer sysupgrade for kernel-in-UBI devices

Ensure that the kernel CRC is invalidated while rootfs is being updated.
This allows the bootloader to detect an interrupted sysupgrade and fall
back to an alternate booting method, instead of just going ahead with
normal boot and effectively bricking the device.

Possible fallbacks include a recovery initramfs partition or UBI volume
and TFTP. See here for an example U-Boot configuration with fallbacks:
https://shorturl.at/befsA (https://github.com/Lanchon/openwrt-tr4400-v2/
blob/e7d707d6bd7839fbd0b8d0bd180fce451df77e47/install-recovery.sh#L52-L63)

Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
2 years agobase-files: fix nand sysupgrade comments
Rodrigo Balerdi [Fri, 15 Apr 2022 03:53:27 +0000 (00:53 -0300)]
base-files: fix nand sysupgrade comments

Erroneous comments possibly applied to an earlier code revision.

Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
2 years agobase-files: improve sysupgrade ubiblock handling
Rodrigo Balerdi [Fri, 15 Apr 2022 03:52:12 +0000 (00:52 -0300)]
base-files: improve sysupgrade ubiblock handling

Only remove ubiblock devices required for nand sysupgrade.

Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
2 years agobase-files: emit diagnostics on sysupgrade abort
Rodrigo Balerdi [Fri, 15 Apr 2022 03:44:26 +0000 (00:44 -0300)]
base-files: emit diagnostics on sysupgrade abort

Emit diagnostics if nand sysupgrade is aborted because UBI partition
cannot be attached. Also avoid redudndant checks.

Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
2 years agomediatek: remove crypto-hw-mtk package
Eneas U de Queiroz [Thu, 31 Mar 2022 13:38:49 +0000 (10:38 -0300)]
mediatek: remove crypto-hw-mtk package

The MediaTek's Crypto Engine module is only available for mt7623, in
which case it is built into the kernel.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2 years agoath79: add support for MikroTik RouterBOARD wAP-2nD (wAP)
David Musil [Sat, 16 Apr 2022 12:01:31 +0000 (12:01 +0000)]
ath79: add support for MikroTik RouterBOARD wAP-2nD (wAP)

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

Specifications:
 - SoC: Qualcomm Atheros QCA9533
 - Flash: 16 MB (SPI)
 - RAM: 64 MB
 - Ethernet: 1x 10/100 Mbps (PoE in)
 - WiFi: AR9531 2T2R 2.4 GHz (SoC)
 - 3x green LEDs (1x lan, 1x wlan, 1x user)

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

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: David Musil <0x444d@protonmail.com>
2 years agomac80211: fix QCA9561 PA bias
Thibaut VARÈNE [Sun, 17 Apr 2022 15:03:52 +0000 (17:03 +0200)]
mac80211: fix QCA9561 PA bias

This patch fixes an invalid TX PA DC bias level on QCA9561, which
results in a very low output power and very low throughput as devices
are further away from the AP (compared to other 2.4GHz APs),
following a suggestion from nbd[1].

This patch has been submitted upstream[2].

[1] https://lore.kernel.org/all/91c58969-c60e-2f41-00ac-737786d435ae@nbd.name
[2] https://lore.kernel.org/linux-wireless/20220417145145.1847-1-hacks+kernel@slashdirt.org/

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2 years agolinux-firmware: Update to version 20220411
Hauke Mehrtens [Mon, 11 Apr 2022 22:12:57 +0000 (00:12 +0200)]
linux-firmware: Update to version 20220411

The following files used in OpenWrt changed:
 amd64-microcode/lib/firmware/amd-ucode/microcode_amd_fam17h.bin
 amd64-microcode/lib/firmware/amd-ucode/microcode_amd_fam19h.bin
 amdgpu-firmware/lib/firmware/amdgpu/aldebaran_mec.bin
 amdgpu-firmware/lib/firmware/amdgpu/aldebaran_mec2.bin
 amdgpu-firmware/lib/firmware/amdgpu/aldebaran_rlc.bin
 amdgpu-firmware/lib/firmware/amdgpu/aldebaran_sdma.bin
 amdgpu-firmware/lib/firmware/amdgpu/aldebaran_smc.bin
 amdgpu-firmware/lib/firmware/amdgpu/aldebaran_sos.bin
 amdgpu-firmware/lib/firmware/amdgpu/aldebaran_ta.bin
 amdgpu-firmware/lib/firmware/amdgpu/aldebaran_vcn.bin
 amdgpu-firmware/lib/firmware/amdgpu/arcturus_sdma.bin
 amdgpu-firmware/lib/firmware/amdgpu/beige_goby_ce.bin
 amdgpu-firmware/lib/firmware/amdgpu/beige_goby_dmcub.bin
 amdgpu-firmware/lib/firmware/amdgpu/beige_goby_me.bin
 amdgpu-firmware/lib/firmware/amdgpu/beige_goby_mec.bin
 amdgpu-firmware/lib/firmware/amdgpu/beige_goby_mec2.bin
 amdgpu-firmware/lib/firmware/amdgpu/beige_goby_pfp.bin
 amdgpu-firmware/lib/firmware/amdgpu/beige_goby_rlc.bin
 amdgpu-firmware/lib/firmware/amdgpu/beige_goby_sdma.bin
 amdgpu-firmware/lib/firmware/amdgpu/beige_goby_smc.bin
 amdgpu-firmware/lib/firmware/amdgpu/beige_goby_sos.bin
 amdgpu-firmware/lib/firmware/amdgpu/beige_goby_ta.bin
 amdgpu-firmware/lib/firmware/amdgpu/beige_goby_vcn.bin
 amdgpu-firmware/lib/firmware/amdgpu/cyan_skillfish2_ce.bin
 amdgpu-firmware/lib/firmware/amdgpu/cyan_skillfish2_me.bin
 amdgpu-firmware/lib/firmware/amdgpu/cyan_skillfish2_mec.bin
 amdgpu-firmware/lib/firmware/amdgpu/cyan_skillfish2_mec2.bin
 amdgpu-firmware/lib/firmware/amdgpu/cyan_skillfish2_pfp.bin
 amdgpu-firmware/lib/firmware/amdgpu/dcn_3_1_6_dmcub.bin
 amdgpu-firmware/lib/firmware/amdgpu/dimgrey_cavefish_ce.bin
 amdgpu-firmware/lib/firmware/amdgpu/dimgrey_cavefish_dmcub.bin
 amdgpu-firmware/lib/firmware/amdgpu/dimgrey_cavefish_me.bin
 amdgpu-firmware/lib/firmware/amdgpu/dimgrey_cavefish_mec.bin
 amdgpu-firmware/lib/firmware/amdgpu/dimgrey_cavefish_mec2.bin
 amdgpu-firmware/lib/firmware/amdgpu/dimgrey_cavefish_pfp.bin
 amdgpu-firmware/lib/firmware/amdgpu/dimgrey_cavefish_rlc.bin
 amdgpu-firmware/lib/firmware/amdgpu/dimgrey_cavefish_sdma.bin
 amdgpu-firmware/lib/firmware/amdgpu/dimgrey_cavefish_smc.bin
 amdgpu-firmware/lib/firmware/amdgpu/dimgrey_cavefish_sos.bin
 amdgpu-firmware/lib/firmware/amdgpu/dimgrey_cavefish_ta.bin
 amdgpu-firmware/lib/firmware/amdgpu/dimgrey_cavefish_vcn.bin
 amdgpu-firmware/lib/firmware/amdgpu/gc_10_3_7_ce.bin
 amdgpu-firmware/lib/firmware/amdgpu/gc_10_3_7_me.bin
 amdgpu-firmware/lib/firmware/amdgpu/gc_10_3_7_mec.bin
 amdgpu-firmware/lib/firmware/amdgpu/gc_10_3_7_mec2.bin
 amdgpu-firmware/lib/firmware/amdgpu/gc_10_3_7_pfp.bin
 amdgpu-firmware/lib/firmware/amdgpu/gc_10_3_7_rlc.bin
 amdgpu-firmware/lib/firmware/amdgpu/green_sardine_asd.bin
 amdgpu-firmware/lib/firmware/amdgpu/green_sardine_ce.bin
 amdgpu-firmware/lib/firmware/amdgpu/green_sardine_dmcub.bin
 amdgpu-firmware/lib/firmware/amdgpu/green_sardine_me.bin
 amdgpu-firmware/lib/firmware/amdgpu/green_sardine_mec.bin
 amdgpu-firmware/lib/firmware/amdgpu/green_sardine_mec2.bin
 amdgpu-firmware/lib/firmware/amdgpu/green_sardine_pfp.bin
 amdgpu-firmware/lib/firmware/amdgpu/green_sardine_rlc.bin
 amdgpu-firmware/lib/firmware/amdgpu/green_sardine_ta.bin
 amdgpu-firmware/lib/firmware/amdgpu/green_sardine_vcn.bin
 amdgpu-firmware/lib/firmware/amdgpu/navi10_asd.bin
 amdgpu-firmware/lib/firmware/amdgpu/navi10_ce.bin
 amdgpu-firmware/lib/firmware/amdgpu/navi10_me.bin
 amdgpu-firmware/lib/firmware/amdgpu/navi10_mec.bin
 amdgpu-firmware/lib/firmware/amdgpu/navi10_mec2.bin
 amdgpu-firmware/lib/firmware/amdgpu/navi10_pfp.bin
 amdgpu-firmware/lib/firmware/amdgpu/navi10_sos.bin
 amdgpu-firmware/lib/firmware/amdgpu/navi10_ta.bin
 amdgpu-firmware/lib/firmware/amdgpu/navi10_vcn.bin
 amdgpu-firmware/lib/firmware/amdgpu/navi12_asd.bin
 amdgpu-firmware/lib/firmware/amdgpu/navi12_sdma.bin
 amdgpu-firmware/lib/firmware/amdgpu/navi12_sdma1.bin
 amdgpu-firmware/lib/firmware/amdgpu/navi12_sos.bin
 amdgpu-firmware/lib/firmware/amdgpu/navi12_ta.bin
 amdgpu-firmware/lib/firmware/amdgpu/navi12_vcn.bin
 amdgpu-firmware/lib/firmware/amdgpu/navi14_asd.bin
 amdgpu-firmware/lib/firmware/amdgpu/navi14_smc.bin
 amdgpu-firmware/lib/firmware/amdgpu/navi14_sos.bin
 amdgpu-firmware/lib/firmware/amdgpu/navi14_ta.bin
 amdgpu-firmware/lib/firmware/amdgpu/navi14_vcn.bin
 amdgpu-firmware/lib/firmware/amdgpu/navy_flounder_ce.bin
 amdgpu-firmware/lib/firmware/amdgpu/navy_flounder_dmcub.bin
 amdgpu-firmware/lib/firmware/amdgpu/navy_flounder_me.bin
 amdgpu-firmware/lib/firmware/amdgpu/navy_flounder_mec.bin
 amdgpu-firmware/lib/firmware/amdgpu/navy_flounder_mec2.bin
 amdgpu-firmware/lib/firmware/amdgpu/navy_flounder_pfp.bin
 amdgpu-firmware/lib/firmware/amdgpu/navy_flounder_rlc.bin
 amdgpu-firmware/lib/firmware/amdgpu/navy_flounder_sdma.bin
 amdgpu-firmware/lib/firmware/amdgpu/navy_flounder_smc.bin
 amdgpu-firmware/lib/firmware/amdgpu/navy_flounder_sos.bin
 amdgpu-firmware/lib/firmware/amdgpu/navy_flounder_ta.bin
 amdgpu-firmware/lib/firmware/amdgpu/navy_flounder_vcn.bin
 amdgpu-firmware/lib/firmware/amdgpu/picasso_asd.bin
 amdgpu-firmware/lib/firmware/amdgpu/picasso_ce.bin
 amdgpu-firmware/lib/firmware/amdgpu/picasso_me.bin
 amdgpu-firmware/lib/firmware/amdgpu/picasso_mec.bin
 amdgpu-firmware/lib/firmware/amdgpu/picasso_mec2.bin
 amdgpu-firmware/lib/firmware/amdgpu/picasso_pfp.bin
 amdgpu-firmware/lib/firmware/amdgpu/picasso_ta.bin
 amdgpu-firmware/lib/firmware/amdgpu/picasso_vcn.bin
 amdgpu-firmware/lib/firmware/amdgpu/psp_13_0_8_asd.bin
 amdgpu-firmware/lib/firmware/amdgpu/psp_13_0_8_ta.bin
 amdgpu-firmware/lib/firmware/amdgpu/psp_13_0_8_toc.bin
 amdgpu-firmware/lib/firmware/amdgpu/raven2_asd.bin
 amdgpu-firmware/lib/firmware/amdgpu/raven2_ce.bin
 amdgpu-firmware/lib/firmware/amdgpu/raven2_me.bin
 amdgpu-firmware/lib/firmware/amdgpu/raven2_mec.bin
 amdgpu-firmware/lib/firmware/amdgpu/raven2_mec2.bin
 amdgpu-firmware/lib/firmware/amdgpu/raven2_pfp.bin
 amdgpu-firmware/lib/firmware/amdgpu/raven2_ta.bin
 amdgpu-firmware/lib/firmware/amdgpu/raven2_vcn.bin
 amdgpu-firmware/lib/firmware/amdgpu/raven_asd.bin
 amdgpu-firmware/lib/firmware/amdgpu/raven_ce.bin
 amdgpu-firmware/lib/firmware/amdgpu/raven_me.bin
 amdgpu-firmware/lib/firmware/amdgpu/raven_mec.bin
 amdgpu-firmware/lib/firmware/amdgpu/raven_mec2.bin
 amdgpu-firmware/lib/firmware/amdgpu/raven_pfp.bin
 amdgpu-firmware/lib/firmware/amdgpu/raven_ta.bin
 amdgpu-firmware/lib/firmware/amdgpu/raven_vcn.bin
 amdgpu-firmware/lib/firmware/amdgpu/renoir_asd.bin
 amdgpu-firmware/lib/firmware/amdgpu/renoir_ce.bin
 amdgpu-firmware/lib/firmware/amdgpu/renoir_dmcub.bin
 amdgpu-firmware/lib/firmware/amdgpu/renoir_me.bin
 amdgpu-firmware/lib/firmware/amdgpu/renoir_mec.bin
 amdgpu-firmware/lib/firmware/amdgpu/renoir_mec2.bin
 amdgpu-firmware/lib/firmware/amdgpu/renoir_pfp.bin
 amdgpu-firmware/lib/firmware/amdgpu/renoir_rlc.bin
 amdgpu-firmware/lib/firmware/amdgpu/renoir_ta.bin
 amdgpu-firmware/lib/firmware/amdgpu/renoir_vcn.bin
 amdgpu-firmware/lib/firmware/amdgpu/sdma_5_2_7.bin
 amdgpu-firmware/lib/firmware/amdgpu/sienna_cichlid_ce.bin
 amdgpu-firmware/lib/firmware/amdgpu/sienna_cichlid_dmcub.bin
 amdgpu-firmware/lib/firmware/amdgpu/sienna_cichlid_me.bin
 amdgpu-firmware/lib/firmware/amdgpu/sienna_cichlid_mec.bin
 amdgpu-firmware/lib/firmware/amdgpu/sienna_cichlid_mec2.bin
 amdgpu-firmware/lib/firmware/amdgpu/sienna_cichlid_pfp.bin
 amdgpu-firmware/lib/firmware/amdgpu/sienna_cichlid_rlc.bin
 amdgpu-firmware/lib/firmware/amdgpu/sienna_cichlid_sdma.bin
 amdgpu-firmware/lib/firmware/amdgpu/sienna_cichlid_smc.bin
 amdgpu-firmware/lib/firmware/amdgpu/sienna_cichlid_sos.bin
 amdgpu-firmware/lib/firmware/amdgpu/sienna_cichlid_ta.bin
 amdgpu-firmware/lib/firmware/amdgpu/sienna_cichlid_vcn.bin
 amdgpu-firmware/lib/firmware/amdgpu/vangogh_asd.bin
 amdgpu-firmware/lib/firmware/amdgpu/vangogh_ce.bin
 amdgpu-firmware/lib/firmware/amdgpu/vangogh_me.bin
 amdgpu-firmware/lib/firmware/amdgpu/vangogh_mec.bin
 amdgpu-firmware/lib/firmware/amdgpu/vangogh_mec2.bin
 amdgpu-firmware/lib/firmware/amdgpu/vangogh_pfp.bin
 amdgpu-firmware/lib/firmware/amdgpu/vega10_asd.bin
 amdgpu-firmware/lib/firmware/amdgpu/vega10_ce.bin
 amdgpu-firmware/lib/firmware/amdgpu/vega10_me.bin
 amdgpu-firmware/lib/firmware/amdgpu/vega10_mec.bin
 amdgpu-firmware/lib/firmware/amdgpu/vega10_mec2.bin
 amdgpu-firmware/lib/firmware/amdgpu/vega10_pfp.bin
 amdgpu-firmware/lib/firmware/amdgpu/vega12_asd.bin
 amdgpu-firmware/lib/firmware/amdgpu/vega12_ce.bin
 amdgpu-firmware/lib/firmware/amdgpu/vega12_me.bin
 amdgpu-firmware/lib/firmware/amdgpu/vega12_mec.bin
 amdgpu-firmware/lib/firmware/amdgpu/vega12_mec2.bin
 amdgpu-firmware/lib/firmware/amdgpu/vega12_pfp.bin
 amdgpu-firmware/lib/firmware/amdgpu/vega20_asd.bin
 amdgpu-firmware/lib/firmware/amdgpu/vega20_ce.bin
 amdgpu-firmware/lib/firmware/amdgpu/vega20_me.bin
 amdgpu-firmware/lib/firmware/amdgpu/vega20_mec.bin
 amdgpu-firmware/lib/firmware/amdgpu/vega20_mec2.bin
 amdgpu-firmware/lib/firmware/amdgpu/vega20_pfp.bin
 amdgpu-firmware/lib/firmware/amdgpu/yellow_carp_asd.bin
 amdgpu-firmware/lib/firmware/amdgpu/yellow_carp_ce.bin
 amdgpu-firmware/lib/firmware/amdgpu/yellow_carp_me.bin
 amdgpu-firmware/lib/firmware/amdgpu/yellow_carp_mec.bin
 amdgpu-firmware/lib/firmware/amdgpu/yellow_carp_mec2.bin
 amdgpu-firmware/lib/firmware/amdgpu/yellow_carp_pfp.bin
 amdgpu-firmware/lib/firmware/amdgpu/yellow_carp_rlc.bin
 amdgpu-firmware/lib/firmware/amdgpu/yellow_carp_ta.bin
 ibt-firmware/lib/firmware/intel/ibt-hw-37.8.10-fw-22.50.19.14.f.bseq
 iwlwifi-firmware-ax210/lib/firmware/iwlwifi-ty-a0-gf-a0.pnvm
 iwlwifi-firmware-iwl9260/lib/firmware/iwlwifi-9260-th-b0-jf-b0-46.ucode
 iwlwifi-firmware-iwl9000/lib/firmware/iwlwifi-9000-pu-b0-jf-b0-46.ucode

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agoramips: add support for OrayBox X3A
Ray Wang [Sat, 12 Mar 2022 14:57:12 +0000 (22:57 +0800)]
ramips: add support for OrayBox X3A

OrayBox X3A is a 2.4/5GHz dual band AC router, based on MediaTek MT7621.

Specification:
* SoC: MT7621
* RAM: DDR3 128 MiB
* Flash: 16 MiB NOR (XM25Q128)
* Wi-Fi: (single chip hosting both 2.4G and 5G)
  * 2.4GHz: MT7615
  * 5GHz: MT7615
* Ethernet: 3x 1000Mbps
  * Switch: MT7530
* LED:
  * Ethernet LEDs: On the back of the router, hardware-controlled.
  * Status LEDs: One "pixel-like" RGB LED in the front of the router,
                 which is actually made up of 3 individual LEDs (with
                 dedicated GPIO pins) with the color of Red, Green,
                 and Blue.
                 The OEM firmware only lights up one color at a time to
                 indicate status, but that's very boring, and the colors
                 actually look great when combined, so I've improvised a
                 little and made them indicate netdev activities.
                 My test results:
                 GPIO 13/14/15
                 000 white (actually more like bright green or cyan
                            because the brightness of the green LED is
                            higher than red and blue)
                 001 bright purple
                 010 bright green
                 011 red
                 100 bright cyan
                 101 blue
                 110 green
                 111 off

Flash Layout:
 0x0000000-0x0030000 : "u-boot"
 0x0030000-0x0040000 : "u-boot-env"
 0x0040000-0x0050000 : "factory"
 0x0050000-0x0f50000 : "firmware"
 /*0x0f50000 to 0x0fe0000 is undefined, same as OEM firmware*/
 0x0fe0000-0x0ff0000 : "bdinfo"
 0x0ff0000-0x1000000 : "reserve"

MAC address:
 MAC               Source                          Description    Fix
 A0:CX:XX:BX:XX:0D BDINFO_9                        LAN(LABEL)     DTS
 A0:CX:XX:BX:XX:0E BDINFO_9 + 1                    WAN            DTS
 A2:CX:XX:BX:XX:0F FACTORY_4                       WIFI2G         DTS
 A2:CX:XX:CX:XX:0F SETBIT 7 (FACTORY_4 + 0x100000) WIFI5G         HOTPLUG
 A6:CX:XX:BX:XX:0F N/A                             WIFI2G_CLIENT  N/A
 A6:DX:XX:BX:XX:0F N/A                             WIFI5G_CLIENT  N/A

Stock dmesg:
https://pastebin.com/2t2jwLdf

Stock Dumps:
https://pastebin.com/LDLxSWX3

Installation via SSH (does not void your warranty):
1.  -----UNLOCK SSH-----
1.1 Set computer IP to DHCP mode, load 'http://10.168.1.1/cgi-bin/luci' in
    your browser. Password is 'admin'.
1.2 Click the "备份且导出" (backup and export) button, and download the
    config file.
1.3 Open the downloaded file with 7zip, navigate to '/etc/config/'.
1.4 Edit the file './system'. Change the '0' into '1' under
    "config sys 'ssh'".
1.5 Save the file.
1.6 Upload the file by clicking the "导入且恢复" (import and recover)
    button. The router will automatically reboot.
2.  -----FLASH THE OPENWRT FIRMWARE-----
2.1 Use any scp tool to upload the 'sysupgrade' firmware to the '/tmp/'
    folder to your router. It should be root@10.168.1.1 and the password
    is 'admin'.
2.2 SSH into the router, also root@10.168.1.1 and the password is 'admin'.
2.3 **IMPORTANT** Type command 'dd if=/dev/mtd3 of=/tmp/firmware.bin', to
    backup the stock firmware. Since the OEM does not provide firmware
    download on their website, this is the only way to get it.
2.3 **ALSO IMPORTANT** Use any scp tool to download your backed-up stock
    firmware from '/tmp/' to your local drive. Then you'd better use a hex
    reading tool to have a rough look at it to make sure nothing is
    corrupt. Or u can just back up again and cross check the MD5.
2.4 Type command 'mtd write /tmp/XXX.bin firmware', and it should flash
    the firmware.
2.5 Verify that nothing went wrong. If you're confident, type 'reboot' and
    reboot the router.

Revert to stock firmware:
1.  load stock firmware using mtd (make sure u have a backup).

Signed-off-by: Ray Wang <raywang777@foxmail.com>
2 years agoRevert "mac80211 adjust QCA9561 PA bias"
Petr Štetiar [Sun, 17 Apr 2022 07:07:49 +0000 (09:07 +0200)]
Revert "mac80211 adjust QCA9561 PA bias"

This reverts commit f9ff282d17ec652d63fa2404e47bb0e15ed95b69 as during
upstream patch review process nbd pointed out, that this patch needs
more work:

 "The patch looks wrong to me. I'm pretty sure that AR_CH0_TOP2 is the
  correct register, the definition has an explicit check for 9561 as well.
  I believe this patch works by accident because it avoids writing a wrong
  value to that register."

1. https://lore.kernel.org/all/91c58969-c60e-2f41-00ac-737786d435ae@nbd.name

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2 years agorealtek: add ZyXEL GS1900-24HP v1 support
Martin Kennedy [Sat, 5 Mar 2022 19:02:36 +0000 (14:02 -0500)]
realtek: add ZyXEL GS1900-24HP v1 support

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

Specifications
--------------
* Device:    ZyXEL GS1900-24HP 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)
  * 24 ethernet port PoE status LEDs
  * 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)
* PoE:
  * Management MCU: ST Micro ST32F100 Microcontroller
  * 6 BCM59111 PSE chips
  * 170W power budget
* Power:     120-240V AC C13
* UART:      Internal populated 10-pin header ('J5') providing RS232;
             connected to SoC UART through a TI or SIPEX 3232C 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-24hp-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-24hp-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-24HP 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-24hp-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-24hp-v1-squashfs-sysupgrade.bin

Signed-off-by: Martin Kennedy <hurricos@gmail.com>
[Add info on PoE hardware to commit message]
Signed-off-by: Sander Vanheule <sander@svanheule.net>
2 years agoipq806x: RT4230W: utilize nvmem-cells for ath10k caldata
Chukun Pan [Thu, 10 Feb 2022 13:26:40 +0000 (21:26 +0800)]
ipq806x: RT4230W: utilize nvmem-cells for ath10k caldata

Converts extraction entries from 11-ath10k-caldata into
nvmem-cells in the individual board's device-tree file.

Same as commit 2047058 ("ipq806x: utilize nvmem-cells
for pre-calibration data")

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
Reviewed-by: Ansuel Smith <ansuelsmth@gmail.com>
2 years agoipq806x: Askey RT4230W REV6: enable onboard spi flash
Chukun Pan [Wed, 9 Jun 2021 15:22:50 +0000 (23:22 +0800)]
ipq806x: Askey RT4230W REV6: enable onboard spi flash

There is a mr25h256 spi flash on this machine. From the mtd backup
of the stock firmware, this spi flash is empty.

[    3.652745] spi_qup 1a280000.spi: IN:block:16, fifo:64, OUT:block:16,
fifo:64
[    3.653925] spi-nor spi0.0: mr25h256 (32 Kbytes)

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
2 years agoath79: add support for Sophos AP100/AP55 family
Andrew Powers-Holmes [Fri, 3 Sep 2021 13:53:57 +0000 (23:53 +1000)]
ath79: add support for Sophos AP100/AP55 family

The Sophos AP100, AP100C, AP55, and AP55C are dual-band 802.11ac access
points based on the Qualcomm QCA9558 SoC. They share PCB designs with
several devices that already have partial or full support, most notably the
Devolo DVL1750i/e.

The AP100 and AP100C are hardware-identical to the AP55 and AP55C, however
the 55 models' ART does not contain calibration data for their third chain
despite it being present on the PCB.

Specifications common to all models:
 - Qualcomm QCA9558 SoC @ 720 MHz (MIPS 74Kc Big-endian processor)
 - 128 MB RAM
 - 16 MB SPI flash
 - 1x 10/100/1000 Mbps Ethernet port, 802.3af PoE-in
 - Green and Red status LEDs sharing a single external light-pipe
 - Reset button on PCB[1]
 - Piezo beeper on PCB[2]
 - Serial UART header on PCB
 - Alternate power supply via 5.5x2.1mm DC jack @ 12 VDC

Unique to AP100 and AP100C:
 - 3T3R 2.4GHz 802.11b/g/n via SoC WMAC
 - 3T3R 5.8GHz 802.11a/n/ac via QCA9880 (PCI Express)

AP55 and AP55C:
 - 2T2R 2.4GHz 802.11b/g/n via SoC WMAC
 - 2T2R 5.8GHz 802.11a/n/ac via QCA9880 (PCI Express)

AP100 and AP55:
 - External RJ45 serial console port[3]
 - USB 2.0 Type A port, power controlled via GPIO 11

Flashing instructions:

This firmware can be flashed either via a compatible Sophos SG or XG
firewall appliance, which does not require disassembling the device, or via
the U-Boot console available on the internal UART header.

To flash via XG appliance:
 - Register on Sophos' website for a no-cost Home Use XG firewall license
 - Download and install the XG software on a compatible PC or virtual
   machine, complete initial appliance setup, and enable SSH console access
 - Connect the target AP device to the XG appliance's LAN interface
 - Approve the AP from the XG Web UI and wait until it shows as Active
   (this can take 3-5 minutes)
 - Connect to the XG appliance over SSH and access the Advanced Console
   (Menu option 5, then menu option 3)
 - Run `sudo awetool` and select the menu option to connect to an AP via
   SSH. When prompted to enable SSH on the target AP, select Yes.
 - Wait 2-3 minutes, then select the AP from the awetool menu again. This
   will connect you to a root shell on the target AP.
 - Copy the firmware to /tmp/openwrt.bin on the target AP via SCP/TFTP/etc
 - Run `mtd -r write /tmp/openwrt.bin astaro_image`
 - When complete, the access point will reboot to OpenWRT.

To flash via U-Boot serial console:
 - Configure a TFTP server on your PC, and set IP address 192.168.99.8 with
   netmask 255.255.255.0
 - Copy the firmware .bin to the TFTP server and rename to 'uImage_AP100C'
 - Open the target AP's enclosure and locate the 4-pin 3.3V UART header [4]
 - Connect the AP ethernet to your PC's ethernet port
 - Connect a terminal to the UART at 115200 8/N/1 as usual
 - Power on the AP and press a key to cancel autoboot when prompted
 - Run the following commands at the U-Boot console:
    - `tftpboot`
    - `cp.b $fileaddr 0x9f070000 $filesize`
    - `boot`
 - The access point will boot to OpenWRT.

MAC addresses as verified by OEM firmware:

use   address     source
LAN   label       config 0x201a (label)
2g    label + 1   art 0x1002    (also found at config 0x2004)
5g    label + 9   art 0x5006

Increments confirmed across three AP55C, two AP55, and one AP100C.

These changes have been tested to function on both current master and
21.02.0 without any obvious issues.

[1] Button is present but does not alter state of any GPIO on SoC
[2] Buzzer and driver circuitry is present on PCB but is not connected to
    any GPIO. Shorting an unpopulated resistor next to the driver circuitry
    should connect the buzzer to GPIO 4, but this is unconfirmed.
[3] This external RJ45 serial port is disabled in the OEM firmware, but
    works in OpenWRT without additional configuration, at least on my
    three test units.
[4] On AP100/AP55 models the UART header is accessible after removing
    the device's top cover. On AP100C/AP55C models, the PCB must be removed
    for access; three screws secure it to the case.
    Pin 1 is marked on the silkscreen. Pins from 1-4 are 3.3V, GND, TX, RX

Signed-off-by: Andrew Powers-Holmes <andrew@omnom.net>
2 years agoath79: add support for MikroTik RouterBOARD 962UiGS-5HacT2HnT (hAP ac)
Ryan Mounce [Sat, 10 Apr 2021 02:56:49 +0000 (12:26 +0930)]
ath79: add support for MikroTik RouterBOARD 962UiGS-5HacT2HnT (hAP ac)

This patch adds support for the MikroTik RouterBOARD 962UiGS-5HacT2HnT (hAP ac)

Specifications:
- SoC: QCA9558
- RAM: 128 MB
- Flash: 16 MB SPI
- 2.4GHz WLAN: 3x3:3 802.11n on SoC
- 5GHz WLAN: 3x3:3 802.11ac on QCA9880 connected via PCIe
- Switch: 5x 1000/100/10 on QCA8337 connected via RGMII
- SFP cage: connected via SGMII (tested with genuine & generic GLC-T)
- USB: 1x type A, GPIO power switch
- PoE: Passive input on Ether1, GPIO switched passthrough to Ether5
- Reset button
- "SFP" LED connected to SoC
- Ethernet LEDs connected to QCA8337 switch
- Green WLAN LED connected to QCA9880

Not working:
- Red WLAN LED

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

Signed-off-by: Ryan Mounce <ryan@mounce.com.au>
2 years agoramips: mt7621: make u_env partition r/w for Linksys EA7xxx devices
Russell Morris [Fri, 8 Apr 2022 18:29:13 +0000 (13:29 -0500)]
ramips: mt7621: make u_env partition r/w for Linksys EA7xxx devices

Make u_env partition read/write - currently cannot write to it, which
blocks fw_setenv. This in turn breaks features like Advanced Reboot,
which rely on setting the environment variable boot_part (1 or 2).

Signed-off-by: Russell Morris <rmorris@rkmorris.us>
2 years agoramips: add support for ASUS RT-AC1200-V2
Tamas Balogh [Fri, 15 Apr 2022 09:11:01 +0000 (11:11 +0200)]
ramips: add support for ASUS RT-AC1200-V2

Hardware specifications:
SoC: MT7628DAN MIPS_24KEc@580MHz 2.4G-n 2x2
WiFi: MT7613BEN 5G-ac 160MHz 2x2
Switch: 4x100M built-in SoC
Flash: 16MB W25Q128JVSQ SPI-NOR
DRAM: 64MB built-in SoC

MAC addresses as verified by OEM firmware:
use address source
Lan/Wan/2G *:60 factory 0x4 (label)
5G *:64 factory 0x8000

Serial console: 57600,8n1

Installation:

Asus windows recovery tool:

install the Asus firmware restoration utility
unplug the router, hold the reset button while powering it on
release when the power LED flashes slowly
specify a static IP on your computer:
IP address: 192.168.1.75
Subnet mask 255.255.255.0
start the Asus firmware restoration utility, specify the factory image
and press upload
do NOT power off the device after OpenWrt has booted until the LED flashing
after flashing OpenWrt, there will be first no 5GHz Wifi available probably,
wait until blinking finishes and do a reboot
TFTP Recovery method:

set computer to a static ip, 192.168.1.75
connect computer to the LAN 1 port of the router
hold the reset button while powering on the router for a few seconds
send firmware image using a tftp client; i.e from linux:
$ tftp
tftp> binary
tftp> connect 192.168.1.1
tftp> put factory.bin
tftp> quit
do NOT power off the device after OpenWrt has booted until the LED flashing
after flashing OpenWrt, there will be first no 5GHz Wifi available probably,
wait until blinking finishes and do a reboot

Signed-off-by: Tamas Balogh <tamasbalogh@hotmail.com>
2 years agoscripts: format to black
Doug Kerr [Fri, 15 Apr 2022 19:54:30 +0000 (15:54 -0400)]
scripts: format to black

clean up formatting with black using 80 character line limit

Signed-off-by: Doug Kerr <dek3rr@gmail.com>
2 years agoscripts: use std library for jam crc32 calculation
Doug Kerr [Fri, 15 Apr 2022 19:47:32 +0000 (15:47 -0400)]
scripts: use std library for jam crc32 calculation

CRC32 is available in a standard library. It seems reasonable
to defer to that rather than run a custom implementation.

Signed-off-by: Doug Kerr <dek3rr@gmail.com>
2 years agokernel: bump 5.15 to 5.15.34
Rui Salvaterra [Thu, 14 Apr 2022 08:28:11 +0000 (09:28 +0100)]
kernel: bump 5.15 to 5.15.34

Deleted (upstreamed):
generic/pending-5.15/850-0003-PCI-aardvark-Fix-support-for-MSI-interrupts.patch [1]

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.34&id=60eabd66d17fa2cbc31f670b2f201f0bc54090a2

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2 years agokernel: bump 5.10 to 5.10.111
John Audia [Wed, 13 Apr 2022 20:25:50 +0000 (16:25 -0400)]
kernel: bump 5.10 to 5.10.111

Removed upstreamed:
  pending-5.10/850-0003-PCI-aardvark-Fix-support-for-MSI-interrupts.patch
  apm821xx/patches-5.10/150-ata-sata_dwc_460ex-Fix-crash-due-to-OOB-write.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 agoramips: add support for BOLT! Arion
Abdul Aziz Amar [Mon, 14 Mar 2022 09:26:23 +0000 (05:26 -0400)]
ramips: add support for BOLT! Arion

This device is from now-defunct BOLT! ISP in Indonesia.
The original firmware is based on mediatek SDK running linux 2.6 or 3.x in later revision.

Specifications:

- SoC:      MediaTek MT7621
- Flash:    32 MiB NOR SPI
- RAM:      128 MiB DDR3
- Ethernet: 2x 10/100/1000 Mbps (switched, LAN + WAN)
- WIFI0:    MT7603E 2.4GHz 802.11b/g/n
- WIFI1:    MT7612E 5GHz 802.11ac
- Antennas: 2x internal, non-detachable
- LEDs:     Programmable LEDs: 5 blue LEDs (wlan, tel, sig1-3) and 2 red LEDs (wlan and sig1)
            Non-programmable "Power"  LED
- Buttons:  Reset and WPS

Instalation:
Install from TFTP

Set your PC IP to 10.10.10.3 and gateway to 10.10.10.123
Press "1" when turning on the router, and type the initramfs file name

You also need to solder pin header or cable to J4 or neighboring test points (T19-T21)
Pinouts from top to bottom: GND, TX, RX, VCC (3.3v)
Baudrate: 57600n8

There's also an additional gigabit transformer and RTL8211FD managed by the LTE module on the backside of the PCB.

Signed-off-by: Abdul Aziz Amar <abdulaziz.amar@gmail.com>
2 years agoramips: add support for Wavlink WL-WN531A3
Davide Fioravanti [Wed, 16 Mar 2022 01:18:11 +0000 (02:18 +0100)]
ramips: add support for Wavlink WL-WN531A3

The Wavlink WL-WN531A3 is an AC1200 router with 5 fast ethernet ports
and one USB 2.0 port.
It's also known as Wavlink QUANTUM D4.

Hardware
--------
SoC:   Mediatek MT7628AN
RAM:   64MB
FLASH: 8MB NOR (GigaDevice GD25Q64CSIG3)
ETH:
  - 5x 10/100 Mbps Ethernet (4x LAN + 1x WAN)
WIFI:
  - 2.4GHz: 1x (integrated in SOC) (2x2:2)
  - 5GHz:   1x MT7612E (2x2:2)
  - 4 external antennas
BTN:
  - 1x Reset button
  - 1x WPS button
  - 1x Turbo button
  - 1x Touchlink button
  - 1x ON/OFF switch
LEDS:
  - 1x Red led (system status)
  - 1x Blue led (system status)
  - 7x Blue leds (wifi led + 5 ethernet ports + power)
USB:
  - 1x USB 2.0 port
UART:
  - 57600-8-N-1
    J1
      O VCC +3,3V (near lan ports)
      o RX
      o TX
      o GND

Everything works correctly.

Currently there is no firmware update available. Because of this, in
order to restore the OEM firmware, you must firstly dump the OEM
firmware from your router before you flash the OpenWrt image.

Backup the OEM Firmware
-----------------------
The following steps are to be intended for users having little to none
experience in linux. Obviously there are many ways to backup the OEM
firmware, but probably this is the easiest way for this router.
Procedure tested on M31A3.V4300.200420 firmware version.

1) Go to http://192.168.10.1/webcmd.shtml

2) Type the following line in the "Command" input box and then press enter:
mkdir /etc_ro/lighttpd/www/dev; cp /dev/mtd0ro /etc_ro/lighttpd/www/dev/mtd0ro; ls -la /etc_ro/lighttpd/www/dev/mtd0ro

3) After few seconds in the textarea should appear this output:
-rw-r--r--    1 0        0         8388608 /etc_ro/lighttpd/www/dev/mtd0ro

   If your output doesn't match mine, stop reading and ask for
   help in the forum.

4) Open in another tab http://192.168.10.1/dev/mtd0ro to download the
   content of the whole NOR. If the file size is 0 byte, stop reading
   and ask for help in the forum.

5) Come back to the http://192.168.10.1/webcmd.shtml webpage and type:
rm /etc_ro/lighttpd/www/dev/mtd0ro; for i in 1 2 3 4 ; do cp /dev/mtd${i}ro /etc_ro/lighttpd/www/dev/mtd${i}ro; done; ls -la /etc_ro/lighttpd/www/dev/

6) After few seconds, in the textarea should appear this output:
-rw-r--r--    1 0        0          196608 mtd1ro
-rw-r--r--    1 0        0           65536 mtd2ro
-rw-r--r--    1 0        0           65536 mtd3ro
-rw-r--r--    1 0        0         8060928 mtd4ro
drwxr-xr-x    7 0        0               0 ..
drwxr-xr-x    2 0        0               0 .

   If your output doesn't match mine, stop reading and ask for
   help in the forum.

7) Open the following links to download the partitions of the OEM FW:
http://192.168.10.1/dev/mtd1ro
http://192.168.10.1/dev/mtd2ro
http://192.168.10.1/dev/mtd3ro
http://192.168.10.1/dev/mtd4ro

   If one (or more) of these files are 0 byte, stop reading and ask
   for help in the forum.

8) Store these downloaded files in a safe place.

9) Reboot your router to remove any temporary file in ram.

Installation
------------
Flash the initramfs image in the OEM firmware interface
(http://192.168.10.1/update.shtml).
When Openwrt boots, flash the sysupgrade image otherwise you won't be
able to keep configuration between reboots.

Restore OEM Firmware
--------------------
Flash the "mtd4ro" file you previously backed-up directly from LUCI.
Warning: Remember to not keep settings!
Warning2: Remember to force the flash.

Notes
-----
1) Router mac addresses:
   LAN XX:XX:XX:XX:XX:9B (factory @ 0x28)
   WAN XX:XX:XX:XX:XX:9C (factory @ 0x2e)
   WIFI 2G XX:XX:XX:XX:XX:9D (factory @ 0x04)
   WIFI 5G XX:XX:XX:XX:XX:9E (factory @ 0x8004)

   LABEL XX:XX:XX:XX:XX:9D

2) There is just one wifi led for both wifi interfaces.
   It currently shows only the 2.4 GHz wifi activity.

Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
2 years agoreadline: add host PIC
Rosen Penev [Thu, 31 Mar 2022 04:33:01 +0000 (21:33 -0700)]
readline: add host PIC

Python seems to fail to link to libreadline properly because of this.
Not a fatal error but an error nontheless.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agopcre: pass -fPIC under host as well
Rosen Penev [Sun, 27 Mar 2022 20:27:15 +0000 (13:27 -0700)]
pcre: pass -fPIC under host as well

static libraries need them as they are not PIC by default.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agolantiq: fritz736x: Move GPIO resets to the inidvidual board.dts files
Martin Blumenstingl [Fri, 18 Mar 2022 22:36:41 +0000 (23:36 +0100)]
lantiq: fritz736x: Move GPIO resets to the inidvidual board.dts files

FRITZ!Box 7360 V2 and FRITZ!Box 7360 SL both use GPIOs 37 (for &phy0)
and GPIO 44 (for &phy1) to control the PHY's reset lines. FRITZ!Box 7362
SL however uses GPIO 45 (for &phy0) and GPIO 44 (for &phy1). Move the
GPIO reset definitions to each individual board .dts and while at it,
fix the GPIOs for the FRITZ!Box 7362 SL.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
2 years agocomgt: support ZTE MF286R modem
Cezary Jackiewicz [Sun, 27 Feb 2022 13:12:39 +0000 (14:12 +0100)]
comgt: support ZTE MF286R modem

The modem is based on Marvell PXA1826 and uses ACM+RNDIS interface to
establish connection with custom commands specific to ZTE modems.
Two variants of modems were discovered, some identifying themselves
as "ZTE", and others as plain "Marvell", the chipset manufacturer.
The modem itself runs a fork of OpenWrt inside, which root shell can be
accessed via ADB interface.

Signed-off-by: Cezary Jackiewicz <cezary@eko.one.pl>
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
2 years agocomgt: ncm: try to detect interface for ttyACM ports
Lech Perczak [Thu, 31 Mar 2022 19:16:34 +0000 (21:16 +0200)]
comgt: ncm: try to detect interface for ttyACM ports

Some modems expose ttyACM as their control ports, which have the
"device" symlink pointing one level down in sysfs tree. Try to find
network interfaces for them as well, this is commonly used for modems
exposing ACM + RNDIS or ACM + ECM interface combinations.

Co-developed-by: Cezary Jackiewicz <cezary@eko.one.pl>
Signed-off-by: Cezary Jackiewicz <cezary@eko.one.pl>
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
2 years agocomgt: ncm: select first available network interface for device
Lech Perczak [Thu, 31 Mar 2022 19:16:22 +0000 (21:16 +0200)]
comgt: ncm: select first available network interface for device

Some modems expose multiple network interfaces on the same USB device,
causing the connection setup script to fail, because glob matching in
the detection phase causes 'ls' to output more than one interface name
plus their base directories in sysfs. Avoid that by listing the
directories explicitly and then selecting first available interface.
This is the case for some variants of ZTE MF286R built-in modem, which
exposes both RNDIS and CDC-ECM network interfaces, causing the
connection setup to fail.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
2 years agocomgt: ncm: allow specification of interface name
Lech Perczak [Thu, 31 Mar 2022 19:16:01 +0000 (21:16 +0200)]
comgt: ncm: allow specification of interface name

Add ifname property to UCI, which can be used to override the
autodetected interface name in case the detection fails due to having
none or more than one interface exposed by the modem, which is not
explicitly linked to TTY port. This is needed on certain variants of ZTE
MF286R built-in modem, which exposes both RNDIS and CDC-ECM interfaces
on the modem, on which the automatic detection may select the wrong
network interface.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
2 years agokernel: backport ZTE RNDIS bogus MAC address fix
Lech Perczak [Fri, 1 Apr 2022 20:05:08 +0000 (22:05 +0200)]
kernel: backport ZTE RNDIS bogus MAC address fix

This is required to support built-in modem of ZTE MF286R, in addition to
other external modems, such as MF831, MF910, MF920, which refuse to
reconfigure their remote MAC address, even if "locally administered" bit
is set, leading to dropped traffic towards the host. Add a workaround
for that issue already present in cdc_ether to rndis_host driver as
well.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
2 years agoipq806x: fix wrong CPU OPP for ipq8062
Ansuel Smith [Mon, 28 Mar 2022 00:47:12 +0000 (02:47 +0200)]
ipq806x: fix wrong CPU OPP for ipq8062

Fix wrong CPU OPP for ipq8062. Revision of the SoC added an
extra 25mV for every pvs. Also fix the voltage min/max value
that were wrong.

Reviewed-by: Robert Marko robimarko@gmail.com
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2 years agoipq806x: fix USB bug in 5.10 dtsi additions
Rodrigo Balerdi [Sat, 9 Apr 2022 21:26:17 +0000 (18:26 -0300)]
ipq806x: fix USB bug in 5.10 dtsi additions

The existing device tree has incorrect definitions for usb3_0 and usb3_1
and the blocks they depend upon: their addresses and interrupts are
swapped. However, their clocks and resets are not. The result is that
the USB blocks are non-functional if only one of them is enabled.

This fix backports the definitions from mainline Linux 5.15 to
OpenWrt's 5.10 dtsi additions. See the relevant mainline code here:
https://github.com/torvalds/linux/blob/v5.17/arch/arm/boot/dts/qcom-ipq8064.dtsi#L1062-L1148

This fix does not break existing ports. But some ports may have enabled
both USB blocks even thought their board only implements one, because
enabling a single USB block would not have worked before this fix.
This means that revisiting all ports of ipq806x devices that implement
a single USB port is advised. This work must be done by maintainers that
can determine which USB block corresponds to the implemented port on
their hardware.

Note that this fix swaps the names of the hardware ports. This is
unfortunate, but will happen anyway when switching to kernel 5.15. Thus,
it is best to do this ASAP, before users get to depend on port names.

It is strongly recommended that this fix is backported to 22.03 before
its release. This will minimize the number of users affected by the port
name swap.

Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
2 years agoipq806x: remove non-working fixes for USB bug in 5.10 dtsi additions
Rodrigo Balerdi [Sat, 9 Apr 2022 20:41:38 +0000 (17:41 -0300)]
ipq806x: remove non-working fixes for USB bug in 5.10 dtsi additions

These workarrounds are incomplete and non-functional, and thus not needed.

Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
2 years agoath79: port HiWiFi HC6361 from ar71xx
Yousong Zhou [Sat, 16 Apr 2022 00:23:52 +0000 (00:23 +0000)]
ath79: port HiWiFi HC6361 from ar71xx

The device was added for ar71xx target and dropped during the ath79
transition, mainly because of the ascii mac address stored in bdinfo
partition

Device page, http://wiki.openwrt.org/toh/hiwifi/hc6361

The vendor u-boot image accepts sysupgrade.bin image with specific
requirements, including having squashfs signature "hsqs" at file offset
0x140000.  This is not possible now that OpenWrt kernel image is at
least 2MB with the signature at offset 0x240000.

Installation of current build of OpenWrt now requires a bootstrap step
of installing an earlier version first.

 - If the vendor u-boot accepts sysupgrade image, hc6361 image of LEDE
   release should work
 - If the vendor u-boot accepts only verified flashsmt image, install
   the one in the above device page.  The image is based on Barrier
   Breaker

   SHA256SUM of the flashsmt image

81b193b95ea5f8e5c30cd62fa9facf275f39233be4fdeed7038f3deed2736156

After the bootstrap step, current build of OpenWrt can be installed
there fine.

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2 years agoath79: add nvmem cell mac-address-ascii support
Yousong Zhou [Fri, 8 Apr 2022 10:20:08 +0000 (10:20 +0000)]
ath79: add nvmem cell mac-address-ascii support

This is needed for devices with mac address stored in ascii format, e.g.
HiWiFi HC6361 to be ported in the following patch.

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2 years agoimage: strip metadata from images when used in other artifacts
Daniel Golle [Fri, 15 Apr 2022 12:25:41 +0000 (13:25 +0100)]
image: strip metadata from images when used in other artifacts

Image metadata and signature is of no use for images which are included
inside other artifacts (like an SD-card image). Strip them off before
using images in artifacts or stashing them for the ImageBuilder as the
contained signature breaks reproducibility.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agoath79: cleanup mikrotik routerboot partitions
Thibaut VARÈNE [Thu, 31 Mar 2022 15:50:31 +0000 (17:50 +0200)]
ath79: cleanup mikrotik routerboot partitions

For some reason useless labels and aliases have been propagated through
copy-paste. Before the issue spreads any further, this patch cleans up
all relevant DTS files to the canonical form, bringing ath79 in line
with other mikrotik platforms (ramips and ipq40xx).

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2 years agoath79: add support for Yuncore A930
Thibaut VARÈNE [Thu, 14 Apr 2022 10:39:05 +0000 (12:39 +0200)]
ath79: add support for Yuncore A930

Specification:

- QCA9533 (650 MHz), 64 or 128MB RAM, 16MB SPI NOR
- 2x 10/100 Mbps Ethernet, with 802.3at PoE support (WAN)
- 2T2R 802.11b/g/n 2.4GHz

Flash instructions:

If your device comes with generic QSDK based firmware, you can login
over telnet (login: root, empty password, default IP: 192.168.188.253),
issue first (important!) 'fw_setenv' command and then perform regular
upgrade, using 'sysupgrade -n -F ...' (you can use 'wget' to download
image to the device, SSH server is not available):

  fw_setenv bootcmd "bootm 0x9f050000 || bootm 0x9fe80000"
  sysupgrade -n -F openwrt-...-yuncore_...-squashfs-sysupgrade.bin

In case your device runs firmware with YunCore custom GUI, you can use
U-Boot recovery mode:

1. Set a static IP 192.168.0.141/24 on PC and start TFTP server with
   'tftp' image renamed to 'upgrade.bin'
2. Power the device with reset button pressed and release it after 5-7
   seconds, recovery mode should start downloading image from server
   (unfortunately, there is no visible indication that recovery got
   enabled - in case of problems check TFTP server logs)

Signed-off-by: Clemens Hopfer <openwrt@wireloss.net>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2 years agomac80211 adjust QCA9561 PA bias
Thibaut VARÈNE [Thu, 14 Apr 2022 10:39:04 +0000 (12:39 +0200)]
mac80211 adjust QCA9561 PA bias

ath9k is setting the TX PA DC bias level different on QCA9561 and QCA9565
although they have the same radio IP-core, which results in a very low
output power and very low throughput as devices are further away from
the AP (compared to other 2.4GHz APs.)

In real life testing, without this patch the 2.4GHz throughput on Yuncore
XD3200 is around 10Mbps sitting close to the AP, and close to theoretical
maximum with the patch applied.

Signed-off-by: Clemens Hopfer <openwrt@wireloss.net>
[edit commit message]
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2 years agoath79: add support for Yuncore XD3200
Thibaut VARÈNE [Thu, 14 Apr 2022 10:39:03 +0000 (12:39 +0200)]
ath79: add support for Yuncore XD3200

Specification:

- QCA9563 (775MHz), 128MB RAM, 16MB SPI NOR
- 2T2R 802.11b/g/n 2.4GHz
- 2T2R 802.11n/ac 5GHz
- 2x 10/100/1000 Mbps Ethernet, with 802.3at PoE support (WAN port)

LED for 5 GHz WLAN is currently not supported as it is connected directly
to the QCA9882 radio chip.

Flash instructions:

If your device comes with generic QSDK based firmware, you can login
over telnet (login: root, empty password, default IP: 192.168.188.253),
issue first (important!) 'fw_setenv' command and then perform regular
upgrade, using 'sysupgrade -n -F ...' (you can use 'wget' to download
image to the device, SSH server is not available):

  fw_setenv bootcmd "bootm 0x9f050000 || bootm 0x9fe80000"
  sysupgrade -n -F openwrt-...-yuncore_...-squashfs-sysupgrade.bin

In case your device runs firmware with YunCore custom GUI, you can use
U-Boot recovery mode:

1. Set a static IP 192.168.0.141/24 on PC and start TFTP server with
   'tftp' image renamed to 'upgrade.bin'
2. Power the device with reset button pressed and release it after 5-7
   seconds, recovery mode should start downloading image from server
   (unfortunately, there is no visible indication that recovery got
   enabled - in case of problems check TFTP server logs)

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2 years agobuild: target: improve UX of CONFIG_TARGET handling
Petr Štetiar [Tue, 29 Mar 2022 06:30:32 +0000 (08:30 +0200)]
build: target: improve UX of CONFIG_TARGET handling

Make it clear, that for `make kernel_{menu,old}config` it's possible to
use only following values for CONFIG_TARGET variable:

 * env
 * target
 * subtarget
 * subtarget_target

This should prevent misuse like `make kernel_menuconfig
CONFIG_TARGET=bcm2710` etc.

Keep support for obsolete `platform` and `subtarget_platform` targets
with deprecation notice so this compat stuff could be removed in the
future.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
Acked-by: Piotr Dymacz <pepe2k@gmail.com>
2 years agokernel: usb-net-asix: fix 5.15 dependency
Petr Štetiar [Mon, 11 Apr 2022 15:39:23 +0000 (17:39 +0200)]
kernel: usb-net-asix: fix 5.15 dependency

Upstream in commit 34a1dee6bc44 ("net: usb: asix: ax88772: add generic
selftest support") in version 5.14 added dependency on generic selftest
functionality and armvirt/64 when compiled with ALL_KMODS=y reports following:

 Package kmod-usb-net-asix is missing dependencies for the following libraries:
 mdio_devres.ko
 selftests.ko

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2 years agokernel: netdevices: add generic selftests module
Petr Štetiar [Mon, 11 Apr 2022 16:36:20 +0000 (18:36 +0200)]
kernel: netdevices: add generic selftests module

Upstream in commit 3e1e58d64c3d ("net: add generic selftest support") in
version 5.13 added generic selftests module and usb-net-asix already
depends on it, in version 5.18 via commit 1710b52d7c13 ("net: usb:
smsc95xx: add generic selftest support") it will be used by
usb-net-smsc95xx as well.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2 years agokernel: usb-net-smsc95xx: fix 5.15 dependency
Petr Štetiar [Mon, 11 Apr 2022 15:36:55 +0000 (17:36 +0200)]
kernel: usb-net-smsc95xx: fix 5.15 dependency

armvirt/64 when compiled with ALL_KMODS=y reports following:

 Package kmod-usb-net-smsc95xx is missing dependencies for the following libraries:
 libphy.ko

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2 years agokernel: mdio-devres: fix of-mdio dependency
Petr Štetiar [Mon, 11 Apr 2022 14:51:12 +0000 (16:51 +0200)]
kernel: mdio-devres: fix of-mdio dependency

armvirt/64 when compiled with ALL_KMODS=y reports following:

 Package kmod-mdio-devres is missing dependencies for the following libraries:
 of_mdio.ko

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2 years agokernel: of-mdio: fix 5.15 fwnode_mdio dependency
Petr Štetiar [Mon, 11 Apr 2022 11:45:33 +0000 (13:45 +0200)]
kernel: of-mdio: fix 5.15 fwnode_mdio dependency

Upstream in commit bc1bee3b87ee ("net: mdiobus: Introduce
fwnode_mdiobus_register_phy()") in version 5.14 introduced new
dependency:

 Package kmod-of-mdio is missing dependencies for the following libraries:

  fwnode_mdio.ko

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2 years agomtools: update to version 4.0.39
Daniel Golle [Fri, 15 Apr 2022 00:15:26 +0000 (01:15 +0100)]
mtools: update to version 4.0.39

Improvements since the 4.0.38 release are:
 - Rename strtoi to strosi (string to signed int). The strtoi
   function on BSD does something else (returns an intmax, not
   an int)

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agoscripts/gen_image_generic.sh: fix order of files in EFI bootfs
Daniel Golle [Thu, 14 Apr 2022 23:46:28 +0000 (00:46 +0100)]
scripts/gen_image_generic.sh: fix order of files in EFI bootfs

mtools recursive copy (mcopy -s ...) is using READDIR(3) to iterate
over the directory entries, hence they end up in the FAT filesystem in
traversal order which breaks reproducibility (rather than being added
to the FAT filesystem in a reproducible order). Implement recursive
copy in gen_image_generic.sh in Shell code instead, as in that way we
can force files to be copied in reproducible order.

Fixes: aece8f5ae8 ("scripts/gen_image_generic.sh: generate reproducible EFI filesystem")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agogemini: Bump kernel to v5.15
Linus Walleij [Mon, 11 Apr 2022 21:46:19 +0000 (23:46 +0200)]
gemini: Bump kernel to v5.15

It's working well on all tested targets, so let's move
Gemini forward to v5.15. imx is already bumped so why not.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2 years agogemini: Create patches and config for kernel v5.15
Linus Walleij [Mon, 11 Apr 2022 21:46:18 +0000 (23:46 +0200)]
gemini: Create patches and config for kernel v5.15

This creates a v5.15 baseline for the Gemini platform.
The main new attraction is the new crypto driver from
Corentin Labbe that we activate in the new config.
Config was refreshed.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2 years agogeneric: backport 5.16 RTL8366RB improvements
Linus Walleij [Mon, 11 Apr 2022 21:46:17 +0000 (23:46 +0200)]
generic: backport 5.16 RTL8366RB improvements

The prerequisite DSA changes for the nice RTL8366RB improvements
are already backported so bring back these changes as well.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2 years agourandom-seed: go back to seeding with shell script temporarily
Jason A. Donenfeld [Mon, 11 Apr 2022 22:53:49 +0000 (00:53 +0200)]
urandom-seed: go back to seeding with shell script temporarily

This reverts commit 2edc017a6e0cb92b72b768aaa46c6d336ad84eff.

We shouldn't be using a shell script here, but the SeedRNG integration
into OpenWRT requires a bit more thought. Etienne raised some important
points immediately after this was merged and planned to send some follow
up commits, but became busy with other things. The points he raised are
important enough that we should actually back this out until it's ready
to go, and then merge it as a cohesive unit. So let's revert this for
now, and come back to it later on.

Cc: Etienne Champetier <champetier.etienne@gmail.com>
Cc: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2 years agomediatek: 5.15: re-enable arch timer on MT7623 as well
Daniel Golle [Thu, 14 Apr 2022 06:33:38 +0000 (07:33 +0100)]
mediatek: 5.15: re-enable arch timer on MT7623 as well

Re-enable arch timer also on MT7623, yet another time.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agomediatek: 5.15: enable arm arch timer for mt7629
Chuanhong Guo [Sat, 9 Apr 2022 05:28:26 +0000 (13:28 +0800)]
mediatek: 5.15: enable arm arch timer for mt7629

otherwise the system delay is completely broken.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2 years agokernel: 5.15: add support for ESMT F50x1G41LB
Chuanhong Guo [Thu, 14 Apr 2022 04:38:31 +0000 (12:38 +0800)]
kernel: 5.15: add support for ESMT F50x1G41LB

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2 years agonetifd: relax check in dhcp proto handler
Daniel Golle [Wed, 13 Apr 2022 15:51:58 +0000 (16:51 +0100)]
netifd: relax check in dhcp proto handler

Checking whether /sbin/udhcpc is a symbolic link breaks using the
DHCP proto handler inside procd-ujail where bind-mounts are used for
the resolved link. Check whether /sbin/udhcpc is executable instead
to allow using the proto handler for DHCP-provisioned containers.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agoprocd: update to git HEAD
Daniel Golle [Wed, 13 Apr 2022 15:47:07 +0000 (16:47 +0100)]
procd: update to git HEAD

 6343c3a procd: completely remove tmp-on-zram support
 5c5e63f uxc: fix potential NULL-pointer dereference
 eb03f03 jail: include necessary files for per-netns netifd instance

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agomalta: add config-5.15
Daniel Golle [Wed, 13 Apr 2022 14:44:16 +0000 (15:44 +0100)]
malta: add config-5.15

Adding the kernel configuration has accidentally been omitted when
enabling testing kernel 5.15. Add it now.

Fixes: 09f6200198 ("malta: enable testing kernel 5.15")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agobase-files: more robust sysupgrade on NAND
Daniel Golle [Wed, 13 Apr 2022 13:51:34 +0000 (14:51 +0100)]
base-files: more robust sysupgrade on NAND

Make sure sysupgrade on NAND also works in case of UBI volumes having
index >9. While at it, also make sure UBI device is detected and abort
in case it isn't. Use Shell built-in shorthand ':' instead of 'true'.

Fixes #9708
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agofirewall3: bump to latest git HEAD
Rui Salvaterra [Fri, 25 Feb 2022 13:54:36 +0000 (13:54 +0000)]
firewall3: bump to latest git HEAD

4cd7d4f Revert "firewall3: support table load on access on Linux 5.15+"
50979cc firewall3: remove unnecessary fw3_has_table

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2 years agoath79: nand: add 5.15 support for nand subtarget
Koen Vandeputte [Wed, 13 Apr 2022 09:58:44 +0000 (11:58 +0200)]
ath79: nand: add 5.15 support for nand subtarget

Tested on GL.iNet E750

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2 years agokernel: add missing symbols for 5.15
Koen Vandeputte [Wed, 6 Apr 2022 12:10:31 +0000 (14:10 +0200)]
kernel: add missing symbols for 5.15

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2 years agonetfilter: move nf-log modules into separate packages
Jo-Philipp Wich [Tue, 12 Apr 2022 11:38:23 +0000 (13:38 +0200)]
netfilter: move nf-log modules into separate packages

Both legacy iptables and nftables require nf-log modules for rule logging,
so move them into a separate package both firewall implementations can
depend on.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2 years agomac80211: backport minstrel_ht fix for legacy rates
Felix Fietkau [Tue, 12 Apr 2022 07:32:34 +0000 (09:32 +0200)]
mac80211: backport minstrel_ht fix for legacy rates

Fixes OFDM rates on 5 GHz

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agotoolchain: musl: Update to version 1.2.3
Hauke Mehrtens [Sun, 10 Apr 2022 22:11:51 +0000 (00:11 +0200)]
toolchain: musl: Update to version 1.2.3

Changes:
new features:
- qsort_r function (POSIX-future)
- pthread_getname_np extension function
- hard float on SPE FPU for powerpc-sf
- SEEK_DATA and SEEK_HOLE exposed in unistd.h (Linux extensions)

compatibility:
- free now preserves errno (POSIX-future requirement)
- setjmp is declared explicitly with returns_twice for non-GCC compilers
- macro version of isascii is no longer defined for C++
- dynamic linker now tolerates zero-length LOAD segments
- epoll_[p]wait is now a cancellation point
- pwd/grp functions no longer fail on systems without AF_UNIX support
- POSIX TZ parsing is stricter to allow more names to fallback to files
- NULL is now defined as nullptr when used in C++11 or later
- gettext now accepts null pointer as argument

bugs fixed:
- old regression in wcwidth of Hangul combining (vowel/final) letters
- duplocale used wrong malloc when malloc was replaced (1.2.2 regression)
- fmaf rounded wrong on archs without FE_TOWARDZERO (all softfloat archs)
- popen didn't honor requirement not to leak other popen pipe fds to child
- aligned_alloc and variants crashed on allocation failure
- dl_iterate_phdr reported incorrect module TLS pointers
- mishandling of some inputs in acoshf and expm1f and functions using them
- potentially wrong-sign zero in cproj functions at infinity
- multiple bugs in legacy function cuserid
- minor posix_spawn file actions API conformance issues
- pthread_setname_np fd leak
- out-of-bound read in zoneinfo handling with distant-past times
- out-of-tree builds lacked generated debug cfi for x86 asm

arch-specific bugs fixed:
- powerpc (32-bit) struct shmid_ds layout was wrong for some fields
- time64 struct layout was wrong in sound ioctl fallback (32-bit archs)

In addition it contains the following improvements:
* protect stack canary from leak via read-as-string by zeroing second byte
* fix excessively slow TLS performance on some mips models

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Rui Salvaterra <rsalvaterra@gmail.com>
Tested-by: Rui Salvaterra <rsalvaterra@gmail.com>
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2 years agonftables: add CONFLICT between versions
Eneas U de Queiroz [Thu, 7 Apr 2022 20:47:38 +0000 (17:47 -0300)]
nftables: add CONFLICT between versions

Have nftables-json conflict with nftables-nojson.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2 years agowolfssl: bump to 5.2.0
Eneas U de Queiroz [Fri, 8 Apr 2022 13:27:25 +0000 (10:27 -0300)]
wolfssl: bump to 5.2.0

Fixes two high-severity vulnerabilities:

- CVE-2022-25640: A TLS v1.3 server who requires mutual authentication
  can be bypassed.  If a malicious client does not send the
  certificate_verify message a client can connect without presenting a
  certificate even if the server requires one.

- CVE-2022-25638: A TLS v1.3 client attempting to authenticate a TLS
  v1.3 server can have its certificate heck bypassed. If the sig_algo in
  the certificate_verify message is different than the certificate
  message checking may be bypassed.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2 years agomediatek/mt7622: enable accelerated crypto drivers
Eneas U de Queiroz [Thu, 31 Mar 2022 13:30:11 +0000 (10:30 -0300)]
mediatek/mt7622: enable accelerated crypto drivers

Use ARMv8 Crypto Extensions for AES, ghash and sha256.

This results in a 16 times speed gain in speed for aes-128-ctr, 17x in
aes-128-gcm, and 9 times in sha256.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2 years agoscripts/gen_image_generic.sh: generate reproducible EFI filesystem
Daniel Golle [Mon, 11 Apr 2022 14:25:27 +0000 (15:25 +0100)]
scripts/gen_image_generic.sh: generate reproducible EFI filesystem

Generate FAT filesystem for EFI boot in a reproducible way:
 * use '--invariant' option of mkfs.fat
 * set timestamps of all files to SOURCE_DATE_EPOCH
 * make sure files are ordered locale-independent

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agomac80211: Update to version 5.15.33-1
Hauke Mehrtens [Tue, 5 Apr 2022 22:29:44 +0000 (00:29 +0200)]
mac80211: Update to version 5.15.33-1

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

This new release contains many fixes which were merged into the upstream
Linux kernel.
This also contains the following new drivers which are needed for ath11k:
* net/qrtr/
* drivers/bus/mhi/

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agoimagebuilder: export SOURCE_DATE_EPOCH to environment
Daniel Golle [Sat, 9 Apr 2022 23:55:21 +0000 (00:55 +0100)]
imagebuilder: export SOURCE_DATE_EPOCH to environment

Export SOURCE_DATE_EPOCH to environment so filesystem and image
creation tools will make use of it.
Fixes reproducibility of images generated with the ImageBuilder.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agoarm-trusted-firmware-mediatek: remove no longer needed Configure step
Daniel Golle [Sat, 9 Apr 2022 21:04:58 +0000 (22:04 +0100)]
arm-trusted-firmware-mediatek: remove no longer needed Configure step

As anyway only the default is called now we can as well also just remove
the override for Build/Configure.

Fixes: e2cffbb805 ("arm-trusted-firmware-mediatek: update to 2021-03-10")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agotrusted-firmware-a.mk: make sure include directory exists
Daniel Golle [Sat, 9 Apr 2022 21:00:50 +0000 (22:00 +0100)]
trusted-firmware-a.mk: make sure include directory exists

ARM Trusted Firmware builds do not depend on any target libraries as
they are bare-metal builds. However, the compiler aborts due to
-Werror=missing-include-dirs if the include dir doesn't exists and this
can happen when building with parallelisation as that makes it likely
for arm-trusted-firmware-* to be build very early before any of the
libraries which would implicitely create the directory.
Fix this by making sure the include dir exists before building.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agokernel: bump 5.10 to 5.10.110
John Audia [Fri, 8 Apr 2022 16:35:54 +0000 (12:35 -0400)]
kernel: bump 5.10 to 5.10.110

Removed upstreamed:
  generic/backport-5.10/350-v5.18-MIPS-pgalloc-fix-memory-leak-caused-by-pgd_free.patch
  generic/pending-5.10/850-0014-PCI-aardvark-Fix-reading-PCI_EXP_RTSTA_PME-bit-on-em.patch
  ipq40xx/patches-5.10/105-ipq40xx-fix-sleep-clock.patch

All patches automatically rebased.

Build system: x86_64
Build-tested: bcm2711/RPi4B, mt7622/RT3200
Run-tested: bcm2711/RPi4B, mt7622/RT3200
Compile-/run-tested: ath79/generic (Archer C7 v2).

Signed-off-by: John Audia <graysky@archlinux.us>
2 years agokernel: bump 5.15 to 5.15.33
Rui Salvaterra [Fri, 8 Apr 2022 13:43:04 +0000 (14:43 +0100)]
kernel: bump 5.15 to 5.15.33

Deleted (upstreamed):
generic/backport-5.15/350-v5.18-MIPS-pgalloc-fix-memory-leak-caused-by-pgd_free.patch [1]
generic/backport-5.15/730-v5.16-hv-utils-add-PTP_1588_CLOCK-to-Kconfig-to-fix-build.patch [2]
generic/pending-5.15/850-0014-PCI-aardvark-Fix-reading-PCI_EXP_RTSTA_PME-bit-on-em.patch [3]
generic/pending-5.15/850-0002-PCI-aardvark-Fix-reading-MSI-interrupt-number.patch [4]

Manually rebased:
generic/pending-5.15/850-0002-PCI-aardvark-Fix-reading-MSI-interrupt-number.patch
ramips/patches-5.15/710-at803x.patch

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.33&id=d29cda15cab086d82d692de016f7249545d4b6b4
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.33&id=d5aad7d63b1b5c1f3c4b69e12c05e7c7d196fae8
[3] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.33&id=ed750e22e44366e264bcdf7b1cf0713f08f7980a
[4] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.15.33&id=0fe94b84c43cfea867e1721606185e8686d7d32f

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
[Refresh patches again]
[Remove generic/pending-5.15/850-0002-PCI-aardvark-Fix-reading-MSI-interrupt-number.patch]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agokernel: bump 5.15 to 5.15.32
Rui Salvaterra [Wed, 30 Mar 2022 08:42:31 +0000 (09:42 +0100)]
kernel: bump 5.15 to 5.15.32

Patches automatically rebased.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2 years agokernel: move some symbols to generic config
Aleksander Jan Bajkowski [Sun, 27 Mar 2022 16:55:48 +0000 (18:55 +0200)]
kernel: move some symbols to generic config

This commit add some enabled symbols to generic config.
LTO is only supported by clang compiler and therefore should
be disabled in the generic config instead of duplicating this
symbol in each target. CONFIG_LTO_NONE do this job.

The second group of symbols is enabled by the options available
in the generic config and is therefore added here:
* CONFIG_AF_UNIX_OOB is selected by CONFIG_NET && CONFIG_UNIX,
* CONFIG_BINARY_PRINTF is selected by CONFIG_BPF_SYSCALL,
* CONFIG_NET_SOCK_MSG is selected by CONFIG_BPF_SYSCALL && CONFIG_NET.

The other symbols are disabled and should be in the generic config.

This commit also removes these symbols from subtargets.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
2 years agogeneric: 5.15: fix aardvak pci pending patch
Ansuel Smith [Wed, 30 Mar 2022 14:14:03 +0000 (16:14 +0200)]
generic: 5.15: fix aardvak pci pending patch

Fix aardvak pci controller pending patch. Use generic_handle_domain_irq
and fix rebase error.

Fixes: 483503603cb2 ("generic: 5.15: rework pending patch")
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2 years agoarmvirt: add 5.15 as testing kernel
Aleksander Jan Bajkowski [Mon, 21 Mar 2022 18:09:32 +0000 (19:09 +0100)]
armvirt: add 5.15 as testing kernel

Add 5.15 as testing kernel.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
2 years agoarmvirt: move common symbols from subtarget to target config
Aleksander Jan Bajkowski [Sat, 2 Apr 2022 13:01:40 +0000 (15:01 +0200)]
armvirt: move common symbols from subtarget to target config

These new symbols are common for all subtargets and
can be moved into target config.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
2 years agoarmvirt: refresh 5.15 config
Aleksander Jan Bajkowski [Mon, 21 Mar 2022 18:43:20 +0000 (19:43 +0100)]
armvirt: refresh 5.15 config

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

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
2 years agoarmvirt: copy config files from 5.10
Aleksander Jan Bajkowski [Mon, 21 Mar 2022 21:14:54 +0000 (22:14 +0100)]
armvirt: copy config files from 5.10

Copy config files from 5.10.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
2 years agoarmvirt: refresh 5.10 config
Aleksander Jan Bajkowski [Mon, 21 Mar 2022 21:01:42 +0000 (22:01 +0100)]
armvirt: refresh 5.10 config

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

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
2 years agoipq40xx: add RT-AC2200 alternative name to RT-AC42U/RT-ACRH17
Ray Wang [Mon, 4 Apr 2022 02:29:18 +0000 (10:29 +0800)]
ipq40xx: add RT-AC2200 alternative name to RT-AC42U/RT-ACRH17

RT-AC2200 is the same device with a different name. The OEM firmwares have the same MD5.

Signed-off-by: Ray Wang <raywang777@foxmail.com>
2 years agoath79: Move TPLink WPA8630Pv2 to ath79-tiny target
Joe Mullally [Mon, 30 Aug 2021 21:35:05 +0000 (22:35 +0100)]
ath79: Move TPLink WPA8630Pv2 to ath79-tiny target

These devices only have 6MiB available for firmware, which is not
enough for recent release images, so move these to the tiny target.

Note for users sysupgrading from the previous ath79-generic snapshot
images:

The tiny target kernel has a 4Kb flash erase block size instead
of the generic target's 64kb. This means the JFFS2 overlay partition
containing settings must be reformatted with the new block size or else
there will be data corruption.

To do this, backup your settings before upgrading, then during the
sysupgrade, de-select "Keep Settings". On the CLI, use "sysupgrade -n".

If you forget to do this and your system becomes unstable after
upgrading, you can do this to format the partition and recover:

* Reboot
* Press RESET when Power LED blinks during boot to enter Failsafe mode
* SSH to 192.168.1.1
* Run "firstboot" and reboot

Signed-off-by: Joe Mullally <jwmullally@gmail.com>
Tested-by: Robert Högberg <robert.hogberg@gmail.com>
2 years agomwlwifi: fix 5.15 kernel support
Robert Marko [Wed, 30 Mar 2022 18:23:19 +0000 (20:23 +0200)]
mwlwifi: fix 5.15 kernel support

Fix compilation and usage under kernel 5.15 for the mwlwifi driver.

For detailed description of changes, check individual patches.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
2 years agodropbear: bump to 2022.82
Konstantin Demin [Thu, 7 Apr 2022 08:33:08 +0000 (11:33 +0300)]
dropbear: bump to 2022.82

- update dropbear to latest stable 2022.82;
  for the changes see https://matt.ucc.asn.au/dropbear/CHANGES
- use $(AUTORELEASE) in PKG_RELEASE
- use https for all uris
- refresh all patches
- rewrite patches:
  - 100-pubkey_path.patch
  - 130-ssh_ignore_x_args.patch

binary/pkg size changes:
- ath79/generic, mips:
  - binary: 215112 -> 219228 (+4116)
  - pkg: 111914 -> 113404 (+1490)
- ath79/tiny, mips:
  - binary: 172501 -> 172485 (-16)
  - pkg: 89871 -> 90904 (+1033)

Tested-by: Stijn Segers <foss@volatilesystems.org>
Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
2 years agolibmnl: update to 1.0.5
Nick Hainke [Tue, 5 Apr 2022 13:01:43 +0000 (15:01 +0200)]
libmnl: update to 1.0.5

Changes:

Duncan Roe (5):
      nlmsg: Fix a missing doxygen section trailer
      build: doc: "make" builds & installs a full set of man pages
      build: doc: get rid of the need for manual updating of Makefile
      build: If doxygen is not available, be sure to report "doxygen: no" to ./configure
      src: doc: Fix messed-up Netlink message batch diagram

Fernando Fernandez Mancera (1):
      src: fix doxygen function documentation

Florian Westphal (1):
      libmnl: zero attribute padding

Guillaume Nault (1):
      callback: mark cb_ctl_array 'const' in mnl_cb_run2()

Kylie McClain (1):
      examples: nfct-daemon: Fix test building on musl libc

Laura Garcia Liebana (4):
      examples: add arp cache dump example
      examples: fix neigh max attributes
      examples: fix print line format
      examples: reduce LOCs during neigh attributes validation

Pablo Neira Ayuso (3):
      doxygen: remove EXPORT_SYMBOL from the output
      include: add MNL_SOCKET_DUMP_SIZE definition
      build: libmnl 1.0.5 release

Petr Vorel (1):
      examples: Add rtnl-addr-add.c

Stephen Hemminger (1):
      examples: rtnl-addr-dump: fix typo

igo95862 (1):
      doxygen: Fixed link to the git source tree on the website.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2 years agolibnfnetlink: update to 1.0.2
Nick Hainke [Tue, 5 Apr 2022 13:26:24 +0000 (15:26 +0200)]
libnfnetlink: update to 1.0.2

Changes:

c63f193 bump version to 1.0.2
3cffa84 libnfnetlink: Check getsockname() return code
90ba679 include: Silence gcc warning in linux_list.h
bb4f6c8 Make it clear that this library is deprecated
e46569c Minimally resurrect doxygen documentation
5087de4 libnfnetlink: hide private symbols
62ca426 autogen: don't convert __u16 to u_int16_t
efa1d8e src: Use stdint types everywhere
7a1a07c include: Sync with kernel headers
7633f0c libnfnetlink: initialize attribute padding to resolve valgrind warnings
94b68f3 configure: uclinux is also linux
617fe82 src: get source code license header in sync with current licensing terms
97a3960 build: resolve automake-1.12 warnings

Removed the patch 100-missing_include.patch, libnfnetlink compiles fine
with musl without this patch.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2 years agogpio-button-hotplug: fix data race
Andrey Erokhin [Wed, 6 Apr 2022 09:36:15 +0000 (12:36 +0300)]
gpio-button-hotplug: fix data race

bh_event_add_var can be called by multiple threads concurrently,
so it shall not use a static char buffer

Signed-off-by: Andrey Erokhin <a.erokhin@inango-systems.com>
2 years agotools/meson: update to 0.61.4
Rosen Penev [Wed, 16 Mar 2022 23:18:07 +0000 (16:18 -0700)]
tools/meson: update to 0.61.4

Override python to use the one in host instead of hostpkg. There's no
need to use the latter.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agotools/cmake: fix download url
leo chung [Thu, 31 Mar 2022 02:58:29 +0000 (10:58 +0800)]
tools/cmake: fix download url

fix the cmake.org download url

Signed-off-by: leo chung <gewalalb@gmail.com>
2 years agokernel: Fix oob layout of XTX XT26G0xA
Felix Matouschek [Fri, 8 Apr 2022 16:27:05 +0000 (18:27 +0200)]
kernel: Fix oob layout of XTX XT26G0xA

The correct oob layout is:

ECC:
region->offset = 48;
region->length = 16;

Free:
/* Reserve 1 byte for the BBM. */
region->offset = 1;
region->length = 47;

Signed-off-by: Felix Matouschek <felix@matouschek.org>
2 years agokernel: Fix readid method of XTX XT26G0xA
Felix Matouschek [Fri, 8 Apr 2022 16:33:10 +0000 (18:33 +0200)]
kernel: Fix readid method of XTX XT26G0xA

The correct readid method is SPINAND_READID_METHOD_OPCODE_ADDR.

Signed-off-by: Felix Matouschek <felix@matouschek.org>