From c0a6fefd9b74af03a30810be20f0ce5504447b3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Sun, 17 Apr 2022 09:07:49 +0200 Subject: [PATCH 01/27] Revert "mac80211 adjust QCA9561 PA bias" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../580-ath9k_ar9561_xpa_bias_level_top.patch | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 package/kernel/mac80211/patches/ath9k/580-ath9k_ar9561_xpa_bias_level_top.patch diff --git a/package/kernel/mac80211/patches/ath9k/580-ath9k_ar9561_xpa_bias_level_top.patch b/package/kernel/mac80211/patches/ath9k/580-ath9k_ar9561_xpa_bias_level_top.patch deleted file mode 100644 index 25db3ab5ba..0000000000 --- a/package/kernel/mac80211/patches/ath9k/580-ath9k_ar9561_xpa_bias_level_top.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c -+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c -@@ -3604,10 +3604,13 @@ static void ar9003_hw_xpa_bias_level_app - { - int bias = ar9003_modal_header(ah, is2ghz)->xpaBiasLvl; - -+ -+ - if (AR_SREV_9485(ah) || AR_SREV_9330(ah) || AR_SREV_9340(ah) || -- AR_SREV_9531(ah) || AR_SREV_9561(ah)) -+ AR_SREV_9531(ah)) - REG_RMW_FIELD(ah, AR_CH0_TOP2, AR_CH0_TOP2_XPABIASLVL, bias); -- else if (AR_SREV_9462(ah) || AR_SREV_9550(ah) || AR_SREV_9565(ah)) -+ else if (AR_SREV_9462(ah) || AR_SREV_9550(ah) || AR_SREV_9565(ah) || -+ AR_SREV_9561(ah)) - REG_RMW_FIELD(ah, AR_CH0_TOP, AR_CH0_TOP_XPABIASLVL, bias); - else { - REG_RMW_FIELD(ah, AR_CH0_TOP, AR_CH0_TOP_XPABIASLVL, bias); From 9a750aae62de74b488d7df7bdbfa78cd606a8aaf Mon Sep 17 00:00:00 2001 From: Ray Wang Date: Sat, 12 Mar 2022 22:57:12 +0800 Subject: [PATCH 02/27] ramips: add support for OrayBox X3A MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../linux/ramips/dts/mt7621_oraybox_x3a.dts | 158 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 10 ++ .../mt7621/base-files/etc/board.d/01_leds | 4 + .../mt7621/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/ieee80211/10_fix_wifi_mac | 6 + 5 files changed, 179 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_oraybox_x3a.dts diff --git a/target/linux/ramips/dts/mt7621_oraybox_x3a.dts b/target/linux/ramips/dts/mt7621_oraybox_x3a.dts new file mode 100644 index 0000000000..a97b0900aa --- /dev/null +++ b/target/linux/ramips/dts/mt7621_oraybox_x3a.dts @@ -0,0 +1,158 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "oraybox,x3a", "mediatek,mt7621-soc"; + model = "OrayBox X3A"; + + aliases { + led-boot = &led_status_green; + led-failsafe = &led_status_red; + led-running = &led_status_blue; + led-upgrade = &led_status_green; + label-mac-device = &gmac0; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + leds { + compatible = "gpio-leds"; + + led_status_red: status-red { + label = "red:status"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + led_status_blue: status-blue { + label = "blue:status"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + led_status_green: status-green { + label = "green:status"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <30000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xf00000>; + }; + + partition@fe0000 { + label = "bdinfo"; + reg = <0xfe0000 0x10000>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdinfo_9: macaddr@9 { + reg = <0x9 0x6>; + }; + }; + + partition@ff0000 { + label = "reserve"; + reg = <0xff0000 0x10000>; + read-only; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0>; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_bdinfo_9>; + nvmem-cell-names = "mac-address"; +}; + +&switch0 { + ports { + port@2 { + status = "okay"; + label = "lan2"; + }; + + port@3 { + status = "okay"; + label = "lan1"; + }; + + port@4 { + status = "okay"; + label = "wan"; + nvmem-cells = <&macaddr_bdinfo_9>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; + }; + }; +}; + +&state_default { + gpio { + groups = "jtag", "wdt"; + function = "gpio"; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 3b34c9d364..e15c1ec3a8 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -1388,6 +1388,16 @@ define Device/netis_wf2881 endef TARGET_DEVICES += netis_wf2881 +define Device/oraybox_x3a + $(Device/dsa-migration) + $(Device/uimage-lzma-loader) + IMAGE_SIZE := 15360k + DEVICE_VENDOR := OrayBox + DEVICE_MODEL := X3A + DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware +endef +TARGET_DEVICES += oraybox_x3a + define Device/phicomm_k2p $(Device/dsa-migration) IMAGE_SIZE := 15744k diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index c0add4c88e..fc6e7ede3c 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -103,6 +103,10 @@ netgear,r7450) ucidef_set_led_netdev "lan3" "LAN3" "white:lan3" "lan3" ucidef_set_led_netdev "lan4" "LAN4" "white:lan4" "lan4" ;; +oraybox,x3a) + ucidef_set_led_netdev "wan" "wan link" "red:status" "wan" + ucidef_set_led_netdev "lan" "lan link" "green:status" "br-lan" + ;; tplink,archer-a6-v3|\ tplink,archer-c6-v3|\ tplink,archer-c6u-v1) diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index 7223908f95..1a914d8614 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -44,6 +44,7 @@ ramips_setup_interfaces() jcg,q20|\ lenovo,newifi-d1|\ mikrotik,routerboard-m33g|\ + oraybox,x3a|\ renkforce,ws-wn530hp3-a|\ xiaomi,mi-router-3g|\ xiaomi,mi-router-3g-v2|\ diff --git a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index 2a47f926be..625d6a616b 100644 --- a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -71,6 +71,12 @@ case "$board" in [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress ;; + oraybox,x3a) + if [ "$PHYNBR" = "1" ]; then + hw_mac_addr="$(mtd_get_mac_binary factory 0x4)" + macaddr_setbit_la "$(macaddr_add $hw_mac_addr 0x100000)" > /sys${DEVPATH}/macaddress + fi + ;; raisecom,msg1500-x-00) [ "$PHYNBR" = "0" ] && \ macaddr_setbit_la "$(mtd_get_mac_ascii Config protest_lan_mac)" \ From 54d9051c5596814293edd9e6a534c8d1e56e6fcf Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Tue, 12 Apr 2022 00:12:57 +0200 Subject: [PATCH 03/27] 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 --- package/firmware/linux-firmware/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/firmware/linux-firmware/Makefile b/package/firmware/linux-firmware/Makefile index c387e6e4b0..f0d3e85cd8 100644 --- a/package/firmware/linux-firmware/Makefile +++ b/package/firmware/linux-firmware/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=linux-firmware -PKG_VERSION:=20220209 +PKG_VERSION:=20220411 PKG_RELEASE:=1 PKG_SOURCE_URL:=@KERNEL/linux/kernel/firmware PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_HASH:=e2e46fa618414952bbf2f6920cd3abcddbef45bfb7d1352994b4bfc35394d177 +PKG_HASH:=020b11f6412f4956f5a6f98de7d41867d2b30ea0ce81b1e2d206ec9840363849 PKG_MAINTAINER:=Felix Fietkau From 7dc52a78ae2c2f748a0c0c4adcb13979260b3498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibaut=20VAR=C3=88NE?= Date: Sun, 17 Apr 2022 17:03:52 +0200 Subject: [PATCH 04/27] mac80211: fix QCA9561 PA bias MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../580-ath9k_ar9561_fix_bias_level.patch | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 package/kernel/mac80211/patches/ath9k/580-ath9k_ar9561_fix_bias_level.patch diff --git a/package/kernel/mac80211/patches/ath9k/580-ath9k_ar9561_fix_bias_level.patch b/package/kernel/mac80211/patches/ath9k/580-ath9k_ar9561_fix_bias_level.patch new file mode 100644 index 0000000000..e4c2e1cd02 --- /dev/null +++ b/package/kernel/mac80211/patches/ath9k/580-ath9k_ar9561_fix_bias_level.patch @@ -0,0 +1,47 @@ +From 4509e523dba46f789377cfec6f20579adf743416 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Thibaut=20VAR=C3=88NE?= +Date: Sun, 17 Apr 2022 11:31:35 +0200 +Subject: [PATCH v2] ath9k: fix QCA9561 PA bias level +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +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). + +This patch was suggested by Felix Fietkau, who noted[1]: +"The value written to that register is wrong, because while the mask +definition AR_CH0_TOP2_XPABIASLVL uses a different value for 9561, the +shift definition AR_CH0_TOP2_XPABIASLVL_S is hardcoded to 12, which is +wrong for 9561." + +In real life testing, without this patch the 2.4GHz throughput on +Yuncore XD3200 is around 10Mbps sitting next to the AP, and closer to +practical maximum with the patch applied. + +[1] https://lore.kernel.org/all/91c58969-c60e-2f41-00ac-737786d435ae@nbd.name + +Signed-off-by: Thibaut VARÈNE +--- +v2: Adjust #define per Felix's suggestion +--- + drivers/net/wireless/ath/ath9k/ar9003_phy.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.h b/drivers/net/wireless/ath/ath9k/ar9003_phy.h +index a171dbb29..ad949eb02 100644 +--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.h ++++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.h +@@ -720,7 +720,7 @@ + #define AR_CH0_TOP2 (AR_SREV_9300(ah) ? 0x1628c : \ + (AR_SREV_9462(ah) ? 0x16290 : 0x16284)) + #define AR_CH0_TOP2_XPABIASLVL (AR_SREV_9561(ah) ? 0x1e00 : 0xf000) +-#define AR_CH0_TOP2_XPABIASLVL_S 12 ++#define AR_CH0_TOP2_XPABIASLVL_S (AR_SREV_9561(ah) ? 9 : 12) + + #define AR_CH0_XTAL (AR_SREV_9300(ah) ? 0x16294 : \ + ((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0x16298 : \ +-- +2.30.2 + From e20de224427008e0f26161f924bc347d974fd15a Mon Sep 17 00:00:00 2001 From: David Musil <0x444d@protonmail.com> Date: Sat, 16 Apr 2022 12:01:31 +0000 Subject: [PATCH 05/27] 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> --- .../qca9533_mikrotik_routerboard-wap-2nd.dts | 58 +++++++++++++++++++ target/linux/ath79/image/mikrotik.mk | 8 +++ .../mikrotik/base-files/etc/board.d/01_leds | 3 +- .../base-files/etc/board.d/02_network | 2 + .../etc/hotplug.d/firmware/10-ath9k-eeprom | 1 + 5 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 target/linux/ath79/dts/qca9533_mikrotik_routerboard-wap-2nd.dts diff --git a/target/linux/ath79/dts/qca9533_mikrotik_routerboard-wap-2nd.dts b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-wap-2nd.dts new file mode 100644 index 0000000000..807941c608 --- /dev/null +++ b/target/linux/ath79/dts/qca9533_mikrotik_routerboard-wap-2nd.dts @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9533_mikrotik_routerboard-16m.dtsi" + +/ { + compatible = "mikrotik,routerboard-wap-2nd", "qca,qca9533"; + model = "MikroTik RouterBOARD wAP-2nD (wAP)"; + + aliases { + led-boot = &led_user; + led-failsafe = &led_user; + led-running = &led_user; + led-upgrade = &led_user; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&led_lan_pin>; + + lan { + label = "green:lan"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "green:wlan"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led_user: user { + label = "green:user"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy0>; + + gmac-config { + device = <&gmac>; + switch-phy-swap = <1>; + }; +}; + +ð1 { + compatible = "syscon", "simple-mfd"; +}; + +&pinmux { + led_lan_pin: pinmux_led_lan_pin { + pinctrl-single,bits = <0x4 0x0 0xff>; + }; +}; diff --git a/target/linux/ath79/image/mikrotik.mk b/target/linux/ath79/image/mikrotik.mk index 13aec3949a..30c1761134 100644 --- a/target/linux/ath79/image/mikrotik.mk +++ b/target/linux/ath79/image/mikrotik.mk @@ -101,3 +101,11 @@ define Device/mikrotik_routerboard-wapr-2nd IMAGE_SIZE := 16256k endef TARGET_DEVICES += mikrotik_routerboard-wapr-2nd + +define Device/mikrotik_routerboard-wap-2nd + $(Device/mikrotik_nor) + SOC := qca9533 + DEVICE_MODEL := RouterBOARD wAP-2nD (wAP) + IMAGE_SIZE := 16256k +endef +TARGET_DEVICES += mikrotik_routerboard-wap-2nd diff --git a/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds b/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds index ecc47e07c2..f5b927ea96 100644 --- a/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds @@ -7,7 +7,8 @@ board=$(board_name) case "$board" in mikrotik,routerboard-lhg-2nd|\ -mikrotik,routerboard-mapl-2nd) +mikrotik,routerboard-mapl-2nd|\ +mikrotik,routerboard-wap-2nd) ucidef_set_led_netdev "lan" "lan" "green:lan" "eth0" ;; mikrotik,routerboard-lhg-5nd) diff --git a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network index 04bedfb569..999ce0dd99 100644 --- a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network +++ b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network @@ -19,6 +19,7 @@ ath79_setup_interfaces() mikrotik,routerboard-lhg-5nd|\ mikrotik,routerboard-mapl-2nd|\ mikrotik,routerboard-sxt-5nd-r2|\ + mikrotik,routerboard-wap-2nd|\ mikrotik,routerboard-wap-g-5hact2hnd|\ mikrotik,routerboard-wapr-2nd) ucidef_set_interface_lan "eth0" @@ -47,6 +48,7 @@ ath79_setup_macs() mikrotik,routerboard-lhg-5nd|\ mikrotik,routerboard-mapl-2nd|\ mikrotik,routerboard-sxt-5nd-r2|\ + mikrotik,routerboard-wap-2nd|\ mikrotik,routerboard-wap-g-5hact2hnd|\ mikrotik,routerboard-wapr-2nd) label_mac="$mac_base" diff --git a/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 4701460cb6..800ce11d51 100644 --- a/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -27,6 +27,7 @@ case "$FIRMWARE" in mikrotik,routerboard-lhg-2nd|\ mikrotik,routerboard-lhg-5nd|\ mikrotik,routerboard-sxt-5nd-r2|\ + mikrotik,routerboard-wap-2nd|\ mikrotik,routerboard-wapr-2nd) caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" 1) ;; From 3f2d0703b60357e3ff1865783335be9f51528eb8 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Thu, 31 Mar 2022 10:38:49 -0300 Subject: [PATCH 06/27] 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 --- target/linux/mediatek/modules.mk | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/target/linux/mediatek/modules.mk b/target/linux/mediatek/modules.mk index 9c6fb515f4..467934256c 100644 --- a/target/linux/mediatek/modules.mk +++ b/target/linux/mediatek/modules.mk @@ -38,26 +38,3 @@ define KernelPackage/sdhci-mtk endef $(eval $(call KernelPackage,sdhci-mtk)) - -define KernelPackage/crypto-hw-mtk - TITLE:= MediaTek's Crypto Engine module - DEPENDS:=@TARGET_mediatek - KCONFIG:= \ - CONFIG_CRYPTO_HW=y \ - CONFIG_CRYPTO_AES=y \ - CONFIG_CRYPTO_AEAD=y \ - CONFIG_CRYPTO_SHA1=y \ - CONFIG_CRYPTO_SHA256=y \ - CONFIG_CRYPTO_SHA512=y \ - CONFIG_CRYPTO_HMAC=y \ - CONFIG_CRYPTO_DEV_MEDIATEK - FILES:=$(LINUX_DIR)/drivers/crypto/mediatek/mtk-crypto.ko - AUTOLOAD:=$(call AutoLoad,90,mtk-crypto) - $(call AddDepends/crypto) -endef - -define KernelPackage/crypto-hw-mtk/description - MediaTek's EIP97 Cryptographic Engine driver. -endef - -$(eval $(call KernelPackage,crypto-hw-mtk)) From f5ed603d0ce795bb8beb55db90b566836eef6514 Mon Sep 17 00:00:00 2001 From: Rodrigo Balerdi Date: Fri, 15 Apr 2022 00:44:26 -0300 Subject: [PATCH 07/27] 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 --- package/base-files/files/lib/upgrade/nand.sh | 27 ++++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh index 8720a78b4b..8f008d6a06 100644 --- a/package/base-files/files/lib/upgrade/nand.sh +++ b/package/base-files/files/lib/upgrade/nand.sh @@ -136,18 +136,23 @@ nand_upgrade_prepare_ubi() { ubiattach -m "$mtdnum" sync ubidev="$( nand_find_ubi "$CI_UBIPART" )" - fi - if [ ! "$ubidev" ]; then - ubiformat /dev/mtd$mtdnum -y - ubiattach -m "$mtdnum" - sync - ubidev="$( nand_find_ubi "$CI_UBIPART" )" - [ ! "$ubidev" ] && return 1 - [ "$has_env" -gt 0 ] && { - ubimkvol /dev/$ubidev -n 0 -N ubootenv -s 1MiB - ubimkvol /dev/$ubidev -n 1 -N ubootenv2 -s 1MiB - } + if [ ! "$ubidev" ]; then + ubiformat /dev/mtd$mtdnum -y + ubiattach -m "$mtdnum" + sync + ubidev="$( nand_find_ubi "$CI_UBIPART" )" + + if [ ! "$ubidev" ]; then + echo "cannot attach ubi mtd partition $CI_UBIPART" + return 1 + fi + + if [ "$has_env" -gt 0 ]; then + ubimkvol /dev/$ubidev -n 0 -N ubootenv -s 1MiB + ubimkvol /dev/$ubidev -n 1 -N ubootenv2 -s 1MiB + fi + fi fi local kern_ubivol="$( nand_find_volume $ubidev $CI_KERNPART )" From e3238a486f8102bdca3ea12091ef2425eabcd13e Mon Sep 17 00:00:00 2001 From: Rodrigo Balerdi Date: Fri, 15 Apr 2022 00:52:12 -0300 Subject: [PATCH 08/27] base-files: improve sysupgrade ubiblock handling Only remove ubiblock devices required for nand sysupgrade. Signed-off-by: Rodrigo Balerdi --- package/base-files/files/lib/upgrade/nand.sh | 34 +++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh index 8f008d6a06..ec1335cb2c 100644 --- a/package/base-files/files/lib/upgrade/nand.sh +++ b/package/base-files/files/lib/upgrade/nand.sh @@ -114,6 +114,18 @@ nand_restore_config() { rmdir /tmp/new_root } +nand_remove_ubiblock() { + local ubivol=$1 + local ubiblk=ubiblock${ubivol:3} + if [ -e /dev/$ubiblk ]; then + echo "removing $ubiblk" + if ! ubiblock -r /dev/$ubivol; then + echo "cannot remove $ubiblk" + return 1 + fi + fi +} + nand_upgrade_prepare_ubi() { local rootfs_length="$1" local rootfs_type="$2" @@ -158,26 +170,16 @@ nand_upgrade_prepare_ubi() { local kern_ubivol="$( nand_find_volume $ubidev $CI_KERNPART )" local root_ubivol="$( nand_find_volume $ubidev $CI_ROOTPART )" local data_ubivol="$( nand_find_volume $ubidev rootfs_data )" + [ "$root_ubivol" = "$kern_ubivol" ] && root_ubivol= - local ubiblk ubiblkvol - for ubiblk in /dev/ubiblock${ubidev:3}_* ; do - [ -e "$ubiblk" ] || continue - case "$ubiblk" in - /dev/ubiblock*_*p*) - continue - ;; - esac - echo "removing ubiblock${ubiblk:13}" - ubiblkvol=ubi${ubiblk:13} - if ! ubiblock -r /dev/$ubiblkvol; then - echo "cannot remove $ubiblk" - return 1 - fi - done + # remove ubiblocks + [ "$kern_ubivol" ] && { nand_remove_ubiblock $kern_ubivol || return 1; } + [ "$root_ubivol" ] && { nand_remove_ubiblock $root_ubivol || return 1; } + [ "$data_ubivol" ] && { nand_remove_ubiblock $data_ubivol || return 1; } # kill volumes [ "$kern_ubivol" ] && ubirmvol /dev/$ubidev -N $CI_KERNPART || : - [ "$root_ubivol" -a "$root_ubivol" != "$kern_ubivol" ] && ubirmvol /dev/$ubidev -N $CI_ROOTPART || : + [ "$root_ubivol" ] && ubirmvol /dev/$ubidev -N $CI_ROOTPART || : [ "$data_ubivol" ] && ubirmvol /dev/$ubidev -N rootfs_data || : # update kernel From 1e191adb20abe428d5feb128ce28f1457ae5110b Mon Sep 17 00:00:00 2001 From: Rodrigo Balerdi Date: Fri, 15 Apr 2022 00:53:27 -0300 Subject: [PATCH 09/27] base-files: fix nand sysupgrade comments Erroneous comments possibly applied to an earlier code revision. Signed-off-by: Rodrigo Balerdi --- package/base-files/files/lib/upgrade/nand.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh index ec1335cb2c..b5c982b272 100644 --- a/package/base-files/files/lib/upgrade/nand.sh +++ b/package/base-files/files/lib/upgrade/nand.sh @@ -182,7 +182,7 @@ nand_upgrade_prepare_ubi() { [ "$root_ubivol" ] && ubirmvol /dev/$ubidev -N $CI_ROOTPART || : [ "$data_ubivol" ] && ubirmvol /dev/$ubidev -N rootfs_data || : - # update kernel + # create kernel vol if [ -n "$kernel_length" ]; then if ! ubimkvol /dev/$ubidev -N $CI_KERNPART -s $kernel_length; then echo "cannot create kernel volume" @@ -190,7 +190,7 @@ nand_upgrade_prepare_ubi() { fi fi - # update rootfs + # create rootfs vol if [ -n "$rootfs_length" ]; then local rootfs_size_param if [ "$rootfs_type" = "ubifs" ]; then @@ -204,7 +204,7 @@ nand_upgrade_prepare_ubi() { fi fi - # create rootfs_data for non-ubifs rootfs + # create rootfs_data vol for non-ubifs rootfs if [ "$rootfs_type" != "ubifs" ]; then local rootfs_data_size_param="-m" if [ -n "$rootfs_data_max" ]; then From 073dc450b5ca91cfffd9097f0e3900dd390be399 Mon Sep 17 00:00:00 2001 From: Rodrigo Balerdi Date: Fri, 15 Apr 2022 00:59:49 -0300 Subject: [PATCH 10/27] 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 --- package/base-files/files/lib/upgrade/nand.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh index b5c982b272..f927c066da 100644 --- a/package/base-files/files/lib/upgrade/nand.sh +++ b/package/base-files/files/lib/upgrade/nand.sh @@ -288,7 +288,7 @@ nand_upgrade_tar() { local board_dir=$(tar tf "$tar_file" | grep -m 1 '^sysupgrade-.*/$') board_dir=${board_dir%/} - kernel_length=$( (tar xf "$tar_file" ${board_dir}/kernel -O | wc -c) 2> /dev/null) + local kernel_length=$( (tar xf "$tar_file" ${board_dir}/kernel -O | wc -c) 2> /dev/null) local has_rootfs=0 local rootfs_length local rootfs_type @@ -311,17 +311,17 @@ nand_upgrade_tar() { nand_upgrade_prepare_ubi "$rootfs_length" "$rootfs_type" "${has_kernel:+$kernel_length}" "$has_env" local ubidev="$( nand_find_ubi "$CI_UBIPART" )" - [ "$has_kernel" = "1" ] && { - local kern_ubivol="$( nand_find_volume $ubidev $CI_KERNPART )" - tar xf "$tar_file" ${board_dir}/kernel -O | \ - ubiupdatevol /dev/$kern_ubivol -s $kernel_length - - } - [ "$has_rootfs" = "1" ] && { local root_ubivol="$( nand_find_volume $ubidev $CI_ROOTPART )" tar xf "$tar_file" ${board_dir}/root -O | \ ubiupdatevol /dev/$root_ubivol -s $rootfs_length - } + + [ "$has_kernel" = "1" ] && { + local kern_ubivol="$( nand_find_volume $ubidev $CI_KERNPART )" + tar xf "$tar_file" ${board_dir}/kernel -O | \ + ubiupdatevol /dev/$kern_ubivol -s $kernel_length - + } nand_do_upgrade_success } From ecbcc0b595516d059092b89efbef69b93cf97f6a Mon Sep 17 00:00:00 2001 From: Rodrigo Balerdi Date: Fri, 15 Apr 2022 03:24:58 -0300 Subject: [PATCH 11/27] 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 --- package/base-files/files/lib/upgrade/nand.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh index f927c066da..a93c9acccd 100644 --- a/package/base-files/files/lib/upgrade/nand.sh +++ b/package/base-files/files/lib/upgrade/nand.sh @@ -303,7 +303,7 @@ nand_upgrade_tar() { local has_env=0 [ "$kernel_length" != 0 -a -n "$kernel_mtd" ] && { - tar xf "$tar_file" ${board_dir}/kernel -O | mtd write - $CI_KERNPART + mtd erase $CI_KERNPART } [ "$kernel_length" = 0 -o ! -z "$kernel_mtd" ] && has_kernel= [ "$CI_KERNPART" = "none" ] && has_kernel= @@ -317,6 +317,10 @@ nand_upgrade_tar() { ubiupdatevol /dev/$root_ubivol -s $rootfs_length - } + [ "$kernel_length" != 0 -a -n "$kernel_mtd" ] && { + tar xf "$tar_file" ${board_dir}/kernel -O | \ + mtd -n write - $CI_KERNPART + } [ "$has_kernel" = "1" ] && { local kern_ubivol="$( nand_find_volume $ubidev $CI_KERNPART )" tar xf "$tar_file" ${board_dir}/kernel -O | \ From 264d9483025c9604709879094810f25e6c9fac38 Mon Sep 17 00:00:00 2001 From: Rodrigo Balerdi Date: Fri, 15 Apr 2022 06:31:24 -0300 Subject: [PATCH 12/27] 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 --- package/base-files/files/lib/upgrade/nand.sh | 68 ++++++++++---------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh index a93c9acccd..67c6a620b1 100644 --- a/package/base-files/files/lib/upgrade/nand.sh +++ b/package/base-files/files/lib/upgrade/nand.sh @@ -283,49 +283,49 @@ nand_upgrade_fit() { nand_upgrade_tar() { local tar_file="$1" - local kernel_mtd="$(find_mtd_index $CI_KERNPART)" - local board_dir=$(tar tf "$tar_file" | grep -m 1 '^sysupgrade-.*/$') - board_dir=${board_dir%/} + local board_dir="$(tar tf "$tar_file" | grep -m 1 '^sysupgrade-.*/$')" + board_dir="${board_dir%/}" - local kernel_length=$( (tar xf "$tar_file" ${board_dir}/kernel -O | wc -c) 2> /dev/null) - local has_rootfs=0 - local rootfs_length + local kernel_mtd kernel_length + if [ "$CI_KERNPART" != "none" ]; then + kernel_mtd="$(find_mtd_index "$CI_KERNPART")" + kernel_length=$( (tar xf "$tar_file" "$board_dir/kernel" -O | wc -c) 2> /dev/null) + [ "$kernel_length" = 0 ] && kernel_length= + fi + local rootfs_length=$( (tar xf "$tar_file" "$board_dir/root" -O | wc -c) 2> /dev/null) + [ "$rootfs_length" = 0 ] && rootfs_length= local rootfs_type + [ "$rootfs_length" ] && rootfs_type="$(identify_tar "$tar_file" "$board_dir/root")" - tar tf "$tar_file" ${board_dir}/root 1>/dev/null 2>/dev/null && has_rootfs=1 - [ "$has_rootfs" = "1" ] && { - rootfs_length=$( (tar xf "$tar_file" ${board_dir}/root -O | wc -c) 2> /dev/null) - rootfs_type="$(identify_tar "$tar_file" ${board_dir}/root)" - } - - local has_kernel=1 + local ubi_kernel_length + if [ "$kernel_length" ]; then + if [ "$kernel_mtd" ]; then + mtd erase "$CI_KERNPART" + else + ubi_kernel_length="$kernel_length" + fi + fi local has_env=0 - - [ "$kernel_length" != 0 -a -n "$kernel_mtd" ] && { - mtd erase $CI_KERNPART - } - [ "$kernel_length" = 0 -o ! -z "$kernel_mtd" ] && has_kernel= - [ "$CI_KERNPART" = "none" ] && has_kernel= - - nand_upgrade_prepare_ubi "$rootfs_length" "$rootfs_type" "${has_kernel:+$kernel_length}" "$has_env" + nand_upgrade_prepare_ubi "$rootfs_length" "$rootfs_type" "$ubi_kernel_length" "$has_env" local ubidev="$( nand_find_ubi "$CI_UBIPART" )" - [ "$has_rootfs" = "1" ] && { - local root_ubivol="$( nand_find_volume $ubidev $CI_ROOTPART )" - tar xf "$tar_file" ${board_dir}/root -O | \ + if [ "$rootfs_length" ]; then + local root_ubivol="$( nand_find_volume $ubidev "$CI_ROOTPART" )" + tar xf "$tar_file" "$board_dir/root" -O | \ ubiupdatevol /dev/$root_ubivol -s $rootfs_length - - } + fi + if [ "$kernel_length" ]; then + if [ "$kernel_mtd" ]; then + tar xf "$tar_file" "$board_dir/kernel" -O | \ + mtd -n write - "$CI_KERNPART" + else + local kern_ubivol="$( nand_find_volume $ubidev "$CI_KERNPART" )" + tar xf "$tar_file" "$board_dir/kernel" -O | \ + ubiupdatevol /dev/$kern_ubivol -s $kernel_length - + fi + fi - [ "$kernel_length" != 0 -a -n "$kernel_mtd" ] && { - tar xf "$tar_file" ${board_dir}/kernel -O | \ - mtd -n write - $CI_KERNPART - } - [ "$has_kernel" = "1" ] && { - local kern_ubivol="$( nand_find_volume $ubidev $CI_KERNPART )" - tar xf "$tar_file" ${board_dir}/kernel -O | \ - ubiupdatevol /dev/$kern_ubivol -s $kernel_length - - } nand_do_upgrade_success } From de4b65a793f8b7222d19f7507e7d3d93a0677597 Mon Sep 17 00:00:00 2001 From: Rodrigo Balerdi Date: Fri, 15 Apr 2022 06:42:51 -0300 Subject: [PATCH 13/27] 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 --- package/base-files/files/lib/upgrade/nand.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh index 67c6a620b1..c7ec59cb22 100644 --- a/package/base-files/files/lib/upgrade/nand.sh +++ b/package/base-files/files/lib/upgrade/nand.sh @@ -236,11 +236,6 @@ nand_upgrade_ubinized() { local ubi_file="$1" local mtdnum="$(find_mtd_index "$CI_UBIPART")" - [ ! "$mtdnum" ] && { - CI_UBIPART="rootfs" - mtdnum="$(find_mtd_index "$CI_UBIPART")" - } - if [ ! "$mtdnum" ]; then echo "cannot find mtd device $CI_UBIPART" umount -a @@ -248,10 +243,11 @@ nand_upgrade_ubinized() { fi local mtddev="/dev/mtd${mtdnum}" - ubidetach -p "${mtddev}" || true + ubidetach -p "${mtddev}" || : sync ubiformat "${mtddev}" -y -f "${ubi_file}" ubiattach -p "${mtddev}" + nand_do_upgrade_success } @@ -333,7 +329,7 @@ nand_upgrade_tar() { nand_do_upgrade() { local file_type=$(identify $1) - [ ! "$(find_mtd_index "$CI_UBIPART")" ] && CI_UBIPART="rootfs" + [ ! "$(find_mtd_index "$CI_UBIPART")" ] && CI_UBIPART=rootfs case "$file_type" in "fit") nand_upgrade_fit $1;; From f8351d65bb32f07a6362b136d66153073f601acb Mon Sep 17 00:00:00 2001 From: Rodrigo Balerdi Date: Fri, 15 Apr 2022 07:18:22 -0300 Subject: [PATCH 14/27] base-files: clean up nand sysupgrade code Fix some inconsistent quoting in nand sysupgrade code. Signed-off-by: Rodrigo Balerdi --- package/base-files/files/lib/upgrade/nand.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh index c7ec59cb22..f941718446 100644 --- a/package/base-files/files/lib/upgrade/nand.sh +++ b/package/base-files/files/lib/upgrade/nand.sh @@ -98,10 +98,10 @@ identify_tar() { nand_restore_config() { sync - local ubidev=$( nand_find_ubi $CI_UBIPART ) + local ubidev=$( nand_find_ubi "$CI_UBIPART" ) local ubivol="$( nand_find_volume $ubidev rootfs_data )" [ ! "$ubivol" ] && - ubivol="$( nand_find_volume $ubidev $CI_ROOTPART )" + ubivol="$( nand_find_volume $ubidev "$CI_ROOTPART" )" mkdir /tmp/new_root if ! mount -t ubifs /dev/$ubivol /tmp/new_root; then echo "mounting ubifs $ubivol failed" @@ -167,8 +167,8 @@ nand_upgrade_prepare_ubi() { fi fi - local kern_ubivol="$( nand_find_volume $ubidev $CI_KERNPART )" - local root_ubivol="$( nand_find_volume $ubidev $CI_ROOTPART )" + local kern_ubivol="$( nand_find_volume $ubidev "$CI_KERNPART" )" + local root_ubivol="$( nand_find_volume $ubidev "$CI_ROOTPART" )" local data_ubivol="$( nand_find_volume $ubidev rootfs_data )" [ "$root_ubivol" = "$kern_ubivol" ] && root_ubivol= @@ -178,13 +178,13 @@ nand_upgrade_prepare_ubi() { [ "$data_ubivol" ] && { nand_remove_ubiblock $data_ubivol || return 1; } # kill volumes - [ "$kern_ubivol" ] && ubirmvol /dev/$ubidev -N $CI_KERNPART || : - [ "$root_ubivol" ] && ubirmvol /dev/$ubidev -N $CI_ROOTPART || : + [ "$kern_ubivol" ] && ubirmvol /dev/$ubidev -N "$CI_KERNPART" || : + [ "$root_ubivol" ] && ubirmvol /dev/$ubidev -N "$CI_ROOTPART" || : [ "$data_ubivol" ] && ubirmvol /dev/$ubidev -N rootfs_data || : # create kernel vol if [ -n "$kernel_length" ]; then - if ! ubimkvol /dev/$ubidev -N $CI_KERNPART -s $kernel_length; then + if ! ubimkvol /dev/$ubidev -N "$CI_KERNPART" -s $kernel_length; then echo "cannot create kernel volume" return 1; fi @@ -198,7 +198,7 @@ nand_upgrade_prepare_ubi() { else rootfs_size_param="-s $rootfs_length" fi - if ! ubimkvol /dev/$ubidev -N $CI_ROOTPART $rootfs_size_param; then + if ! ubimkvol /dev/$ubidev -N "$CI_ROOTPART" $rootfs_size_param; then echo "cannot create rootfs volume" return 1; fi @@ -258,7 +258,7 @@ nand_upgrade_ubifs() { nand_upgrade_prepare_ubi "$rootfs_length" "ubifs" "" "" local ubidev="$( nand_find_ubi "$CI_UBIPART" )" - local root_ubivol="$(nand_find_volume $ubidev $CI_ROOTPART)" + local root_ubivol="$(nand_find_volume $ubidev "$CI_ROOTPART")" ubiupdatevol /dev/$root_ubivol -s $rootfs_length $1 nand_do_upgrade_success From bfd9afc38dc8a5e158aea11f89c43980396cceff Mon Sep 17 00:00:00 2001 From: Rodrigo Balerdi Date: Fri, 15 Apr 2022 10:11:52 -0300 Subject: [PATCH 15/27] 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 --- package/base-files/files/lib/upgrade/nand.sh | 31 +++++++++++++------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh index f941718446..d85b2aa241 100644 --- a/package/base-files/files/lib/upgrade/nand.sh +++ b/package/base-files/files/lib/upgrade/nand.sh @@ -97,21 +97,33 @@ identify_tar() { } nand_restore_config() { - sync local ubidev=$( nand_find_ubi "$CI_UBIPART" ) local ubivol="$( nand_find_volume $ubidev rootfs_data )" - [ ! "$ubivol" ] && + if [ ! "$ubivol" ]; then ubivol="$( nand_find_volume $ubidev "$CI_ROOTPART" )" + if [ ! "$ubivol" ]; then + echo "cannot find ubifs data volume" + return 1 + fi + fi mkdir /tmp/new_root if ! mount -t ubifs /dev/$ubivol /tmp/new_root; then - echo "mounting ubifs $ubivol failed" + echo "cannot mount ubifs volume $ubivol" rmdir /tmp/new_root return 1 fi - mv "$1" "/tmp/new_root/$BACKUP_FILE" - umount /tmp/new_root - sync + if mv "$1" "/tmp/new_root/$BACKUP_FILE"; then + if umount /tmp/new_root; then + echo "configuration saved" + rmdir /tmp/new_root + return 0 + fi + else + umount /tmp/new_root + fi + echo "could not save configuration to ubifs volume $ubivol" rmdir /tmp/new_root + return 1 } nand_remove_ubiblock() { @@ -223,10 +235,9 @@ nand_upgrade_prepare_ubi() { nand_do_upgrade_success() { local conf_tar="/tmp/sysupgrade.tgz" - - sync - [ -f "$conf_tar" ] && nand_restore_config "$conf_tar" - echo "sysupgrade successful" + if { [ ! -f "$conf_tar" ] || nand_restore_config "$conf_tar"; } && sync; then + echo "sysupgrade successful" + fi umount -a reboot -f } From 9a2f08f6e704d733fea88b6b511f2fa06b8039f4 Mon Sep 17 00:00:00 2001 From: Rodrigo Balerdi Date: Fri, 15 Apr 2022 10:15:02 -0300 Subject: [PATCH 16/27] base-files: trim unnecessary nand sysupgrade code Remove unnecessary sync commands during nand sysupgrade. Signed-off-by: Rodrigo Balerdi --- package/base-files/files/lib/upgrade/nand.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh index d85b2aa241..371bdf7d77 100644 --- a/package/base-files/files/lib/upgrade/nand.sh +++ b/package/base-files/files/lib/upgrade/nand.sh @@ -158,13 +158,11 @@ nand_upgrade_prepare_ubi() { local ubidev="$( nand_find_ubi "$CI_UBIPART" )" if [ ! "$ubidev" ]; then ubiattach -m "$mtdnum" - sync ubidev="$( nand_find_ubi "$CI_UBIPART" )" if [ ! "$ubidev" ]; then ubiformat /dev/mtd$mtdnum -y ubiattach -m "$mtdnum" - sync ubidev="$( nand_find_ubi "$CI_UBIPART" )" if [ ! "$ubidev" ]; then @@ -229,7 +227,7 @@ nand_upgrade_prepare_ubi() { fi fi fi - sync + return 0 } @@ -255,7 +253,6 @@ nand_upgrade_ubinized() { local mtddev="/dev/mtd${mtdnum}" ubidetach -p "${mtddev}" || : - sync ubiformat "${mtddev}" -y -f "${ubi_file}" ubiattach -p "${mtddev}" From 9ba28f978c76692876f4f5bc7ad66e8fc73084fb Mon Sep 17 00:00:00 2001 From: Rodrigo Balerdi Date: Fri, 15 Apr 2022 07:20:28 -0300 Subject: [PATCH 17/27] base-files: minimize critical time in sysupgrade Attempt to minimize the time during which an interrupted nand sysupgrade can lead to a non-functional device by flushing caches before starting the upgrade procedure. Signed-off-by: Rodrigo Balerdi --- package/base-files/files/lib/upgrade/nand.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh index 371bdf7d77..5ecdb0ff23 100644 --- a/package/base-files/files/lib/upgrade/nand.sh +++ b/package/base-files/files/lib/upgrade/nand.sh @@ -335,15 +335,16 @@ nand_upgrade_tar() { # Recognize type of passed file and start the upgrade process nand_do_upgrade() { - local file_type=$(identify $1) + local file_type=$(identify "$1") [ ! "$(find_mtd_index "$CI_UBIPART")" ] && CI_UBIPART=rootfs + sync case "$file_type" in - "fit") nand_upgrade_fit $1;; - "ubi") nand_upgrade_ubinized $1;; - "ubifs") nand_upgrade_ubifs $1;; - *) nand_upgrade_tar $1;; + "fit") nand_upgrade_fit "$1";; + "ubi") nand_upgrade_ubinized "$1";; + "ubifs") nand_upgrade_ubifs "$1";; + *) nand_upgrade_tar "$1";; esac } From fc245338d6e02e61fa7ecbd1a828aed97cdbef88 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Tue, 19 Apr 2022 16:23:08 +0100 Subject: [PATCH 18/27] mediatek: mt7622: remove '0x' prefix from pstore address in dts Adresses of device tree nodes are typically noted without the '0x' prefix. While having the '0x' prefix doesn't hurt when using Linux, more recent versions of U-Boot will add a duplicate ramoops node as a simple string compare is used to check if the node is already present. Remove the '0x' prefix to avoid the kernel warning resulting from U-Boot adding a dupplicate pstore/ramoops node. See also https://lists.denx.de/pipermail/u-boot/2022-April/481810.html Signed-off-by: Daniel Golle --- .../mediatek/patches-5.10/105-dts-mt7622-enable-pstore.patch | 2 +- .../mediatek/patches-5.15/105-dts-mt7622-enable-pstore.patch | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/mediatek/patches-5.10/105-dts-mt7622-enable-pstore.patch b/target/linux/mediatek/patches-5.10/105-dts-mt7622-enable-pstore.patch index 6ef56f8584..da42c07728 100644 --- a/target/linux/mediatek/patches-5.10/105-dts-mt7622-enable-pstore.patch +++ b/target/linux/mediatek/patches-5.10/105-dts-mt7622-enable-pstore.patch @@ -14,7 +14,7 @@ ranges; + /* 64 KiB reserved for ramoops/pstore */ -+ ramoops@0x42ff0000 { ++ ramoops@42ff0000 { + compatible = "ramoops"; + reg = <0 0x42ff0000 0 0x10000>; + record-size = <0x1000>; diff --git a/target/linux/mediatek/patches-5.15/105-dts-mt7622-enable-pstore.patch b/target/linux/mediatek/patches-5.15/105-dts-mt7622-enable-pstore.patch index 6ef56f8584..da42c07728 100644 --- a/target/linux/mediatek/patches-5.15/105-dts-mt7622-enable-pstore.patch +++ b/target/linux/mediatek/patches-5.15/105-dts-mt7622-enable-pstore.patch @@ -14,7 +14,7 @@ ranges; + /* 64 KiB reserved for ramoops/pstore */ -+ ramoops@0x42ff0000 { ++ ramoops@42ff0000 { + compatible = "ramoops"; + reg = <0 0x42ff0000 0 0x10000>; + record-size = <0x1000>; From 810b48e79389a54b9b332fa2834360602a9734f3 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Tue, 19 Apr 2022 16:27:22 +0100 Subject: [PATCH 19/27] uboot-mediatek: remove '0x' prefix from pstore node Remove '0x' prefix from pstore node in dts, just like it was done for the device tree used by Linux on MT7622. This change is done in preparation to update U-Boot to 2022.04. Signed-off-by: Daniel Golle --- .../boot/uboot-mediatek/patches/050-mt7622-enable-pstore.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/boot/uboot-mediatek/patches/050-mt7622-enable-pstore.patch b/package/boot/uboot-mediatek/patches/050-mt7622-enable-pstore.patch index 42d60c3f66..601e394f5e 100644 --- a/package/boot/uboot-mediatek/patches/050-mt7622-enable-pstore.patch +++ b/package/boot/uboot-mediatek/patches/050-mt7622-enable-pstore.patch @@ -15,7 +15,7 @@ + ranges; + + /* 64 KiB reserved for ramoops/pstore */ -+ ramoops@0x42ff0000 { ++ ramoops@42ff0000 { + compatible = "ramoops"; + reg = <0 0x42ff0000 0 0x10000>; + record-size = <0x1000>; From 0b5a3234369395e886c2902d4b6a490c4ea91634 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Mon, 18 Apr 2022 18:57:54 +0200 Subject: [PATCH 20/27] toolchain: Update glibc 2.34 to recent HEAD This adds the following changes: 31186e2cb7 elf: Sort tests and modules-names 511b244cc5 elf: Add a comment after trailing backslashes de6cdd6875 elf/Makefile: Reflow and sort most variable assignments 948ebc098e Fix glibc 2.34 ABI omission (missing GLIBC_2.34 in dynamic loader) b952c25dc7 x86: Black list more Intel CPUs for TSX [BZ #27398] aa601d0244 x86: Use CHECK_FEATURE_PRESENT to check HLE [BZ #27398] e09e7b1492 support: Add support_socket_so_timestamp_time64 e098446037 linux: Fix ancillary 64-bit time timestamp conversion (BZ #28349, BZ#28350) 489d0b8b32 Linux: Only generate 64 bit timestamps for 64 bit time_t recvmsg/recvmmsg 008003dc6e tst-socket-timestamp-compat.c: Check __TIMESIZE [BZ #28837] 05c83ccaf5 linux: __get_nprocs_sched: do not feed CPU_COUNT_S with garbage [BZ #28850] ad615b59c7 Linux: Simplify __opensock and fix race condition [BZ #28353] d8302ba2da hurd if_index: Explicitly use AF_INET for if index discovery 6eaf10cbb7 socket: Do not use AF_NETLINK in __opensock 0351c75c5f linux: Fix missing __convert_scm_timestamps (BZ #28860) d64b08d5ba Add reference to BZ#28860 on NEWS 007e054d78 linux: fix accuracy of get_nprocs and get_nprocs_conf [BZ #28865] 04d60ce0f2 string: Add a testcase for wcsncmp with SIZE_MAX [BZ #28755] 38e0d24794 x86: Fallback {str|wcs}cmp RTM in the ncmp overflow case [BZ #28896] d093b677c3 x86: Test wcscmp RTM in the wcsncmp overflow case [BZ #28896] 15b00d2af0 x86: Fix TEST_NAME to make it a string in tst-strncmp-rtm.c d5d1c95aaf NEWS: Add a bug fix entry for BZ #28896 852361b5a3 localedef: Handle symbolic links when generating locale-archive 3be79b72d5 Fix elf/tst-audit2 on hppa c6f9085ee4 hppa: Fix swapcontext f610d2935f hppa: Revise gettext trampoline design 40fc6a74ee nptl: Fix cleanups for stack grows up [BZ# 28899] 6c9c230765 hppa: Fix warnings from _dl_lookup_address b5032c3d37 io: Add fsync call in tst-stat b53f0c11de nss: Do not mention NSS test modules in 54b1273395 nss: Protect against errno changes in function lookup (bug 28953) c82bdf033f Don't add access size hints to fortifiable functions 0e6ebf06e4 Make sure that the fortified function conditionals are constant 536910724d debug: Add tests for _FORTIFY_SOURCE=3 98ea9372cc __glibc_unsafe_len: Fix comment 10f7bdebe5 fortify: Fix spurious warning with realpath d6a58bd81d Enable _FORTIFY_SOURCE=3 for gcc 12 and above f8c2f620f1 debug: Autogenerate _FORTIFY_SOURCE tests 224d8c1890 debug: Synchronize feature guards in fortified functions [BZ #28746] 738ee53f0c hppa: Implement swapcontext in assembler (bug 28960) d53b9cc391 hppa: Use END instead of PSEUDO_END in swapcontext.S 4b5b8a1cdf powerpc: Delete unneeded ELF_MACHINE_BEFORE_RTLD_RELOC b19de59d62 elf: Avoid nested functions in the loader [BZ #27220] c6df39a0bd elf: Fix elf_get_dynamic_info definition b868b45f67 elf: Fix dynamic-link.h usage on rtld.c f6a54a3042 elf: Fix elf_get_dynamic_info() for bootstrap a31bbe3242 elf: Move LAV_CURRENT to link_lavcurrent.h e25fe99213 elf: Move la_activity (LA_ACT_ADD) after _dl_add_to_namespace_list() (BZ #28062) ce0cb6d1d2 elf: Add _dl_audit_objopen 66e9d27a09 elf: Add _dl_audit_activity_map and _dl_audit_activity_nsid ec0fc2a153 elf: Add _dl_audit_objsearch 198660741b elf: Add _dl_audit_objclose b2d99731b6 elf: Add _dl_audit_symbind_alt and _dl_audit_symbind 31473c273b elf: Add _dl_audit_preinit fd9c4e8a1b elf: Add _dl_audit_pltenter a8e211daea elf: Add _dl_audit_pltexit 29496b3103 elf: Avoid unnecessary slowdown from profiling with audit (BZ#15533) 02c6a3d353 elf: Add audit tests for modules with TLSDESC d1b9bee29a elf: Issue audit la_objopen for vDSO 2255621f0e elf: Do not fail for failed dlmopen on audit modules (BZ #28061) 98047ba95c elf: Add la_activity during application exit efb21b5fb2 elf: Fix initial-exec TLS access on audit modules (BZ #28096) 056fc1c0e3 elf: Issue la_symbind for bind-now (BZ #23734) b118bce87a elf: Fix runtime linker auditing on aarch64 (BZ #26643) 165e7ad459 Fix elf/tst-audit25a with default bind now toolchains aabdad371f elf: Replace tst-audit24bmod2.so with tst-audit24bmod2 4dca2d3a7b hppa: Fix bind-now audit (BZ #28857) ceed89d089 NEWS: Update fixed bug list for LD_AUDIT backports. 0c03cb54c8 S390: Add new s390 platform z16. 290db09546 nptl: Handle spurious EINTR when thread cancellation is disabled (BZ#29029) 5d8c777634 hurd: Fix arbitrary error code b87b697f15 mips: Fix mips64n32 64 bit time_t stat support (BZ#29069) Signed-off-by: Hauke Mehrtens --- toolchain/glibc/common.mk | 4 ++-- ...Revert-Disallow-use-of-DES-encryption-functions-in-n.patch | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/toolchain/glibc/common.mk b/toolchain/glibc/common.mk index 51d13c457e..f2634588db 100644 --- a/toolchain/glibc/common.mk +++ b/toolchain/glibc/common.mk @@ -12,8 +12,8 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=72123e1b56f53f9205bb105f8a62d0869b837b22 -PKG_MIRROR_HASH:=934ec7067d41da0b76b8f29a1cd03b10ba9d98c2f761f7b32f8595e59ac2b428 +PKG_SOURCE_VERSION:=b87b697f15d6bf7e576a2eeadc1f740172f9d013 +PKG_MIRROR_HASH:=c65c9600292bfb73118793ff268aac7561e6c3c90f6c152a8b334fd6eddc0838 PKG_SOURCE_URL:=https://sourceware.org/git/glibc.git PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz diff --git a/toolchain/glibc/patches/050-Revert-Disallow-use-of-DES-encryption-functions-in-n.patch b/toolchain/glibc/patches/050-Revert-Disallow-use-of-DES-encryption-functions-in-n.patch index cb2ae0550b..8cb8c80fd2 100644 --- a/toolchain/glibc/patches/050-Revert-Disallow-use-of-DES-encryption-functions-in-n.patch +++ b/toolchain/glibc/patches/050-Revert-Disallow-use-of-DES-encryption-functions-in-n.patch @@ -596,7 +596,7 @@ provides them. /* The enhanced internationalization capabilities according to XPG4.2 are present. */ #define _XOPEN_ENH_I18N 1 -@@ -1146,17 +1149,25 @@ ssize_t copy_file_range (int __infd, __o +@@ -1150,17 +1153,25 @@ ssize_t copy_file_range (int __infd, __o extern int fdatasync (int __fildes); #endif /* Use POSIX199309 */ @@ -627,7 +627,7 @@ provides them. range [FROM - N + 1, FROM - 1]. If N is odd the first byte in FROM --- a/stdlib/stdlib.h +++ b/stdlib/stdlib.h -@@ -968,6 +968,12 @@ extern int getsubopt (char **__restrict +@@ -969,6 +969,12 @@ extern int getsubopt (char **__restrict #endif From 7a732213322d9aa6d8743beffb185ca6f53a5bea Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Tue, 19 Apr 2022 20:02:59 +0200 Subject: [PATCH 21/27] build: use numeric-owner in ipkg-build To create packages the `ipkg-build` script is used which double packs `control.tar.gz` and `data.tar.gz` to a single package. By default it's using a verbose username instead of a numeric value for files. Official OpenWrt images (artifacts) are created within docker containers which do not seem to contain those verbose usernames and instead defaults to numeric values. This becomes a problem when rebuilding public artifacts because other build environments may offer verbose usernames and there the created packages is different from the official ones. With this commit `ipkg-build` always uses numeric values for user/group and thereby making it easier to reproduce official artifacts. Signed-off-by: Paul Spooren --- scripts/ipkg-build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/ipkg-build b/scripts/ipkg-build index 19df621048..122cca2cb4 100755 --- a/scripts/ipkg-build +++ b/scripts/ipkg-build @@ -179,20 +179,20 @@ for file_mode in $file_modes; do chown "$uid:$gid" "$pkg_dir/$path" chmod "$mode" "$pkg_dir/$path" done -$TAR -X "$tmp_dir"/tarX --format=gnu --sort=name -cpf - --mtime="$TIMESTAMP" . | gzip -n - > "$tmp_dir"/data.tar.gz +$TAR -X "$tmp_dir"/tarX --format=gnu --numeric-owner --sort=name -cpf - --mtime="$TIMESTAMP" . | gzip -n - > "$tmp_dir"/data.tar.gz installed_size=$(stat -c "%s" "$tmp_dir"/data.tar.gz) sed -i -e "s/^Installed-Size: .*/Installed-Size: $installed_size/" \ "$pkg_dir"/$CONTROL/control -( cd "$pkg_dir"/$CONTROL && $TAR --format=gnu --sort=name -cf - --mtime="$TIMESTAMP" . | gzip -n - > "$tmp_dir"/control.tar.gz ) +( cd "$pkg_dir"/$CONTROL && $TAR --format=gnu --numeric-owner --sort=name -cf - --mtime="$TIMESTAMP" . | gzip -n - > "$tmp_dir"/control.tar.gz ) rm "$tmp_dir"/tarX echo "2.0" > "$tmp_dir"/debian-binary pkg_file=$dest_dir/${pkg}_${version}_${arch}.ipk rm -f "$pkg_file" -( cd "$tmp_dir" && $TAR --format=gnu --sort=name -cf - --mtime="$TIMESTAMP" ./debian-binary ./data.tar.gz ./control.tar.gz | gzip -n - > "$pkg_file" ) +( cd "$tmp_dir" && $TAR --format=gnu --numeric-owner --sort=name -cf - --mtime="$TIMESTAMP" ./debian-binary ./data.tar.gz ./control.tar.gz | gzip -n - > "$pkg_file" ) rm "$tmp_dir"/debian-binary "$tmp_dir"/data.tar.gz "$tmp_dir"/control.tar.gz rmdir "$tmp_dir" From 92add80414c2f39ba8fd0d221d0f37e75fb19951 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 19 Apr 2022 21:14:42 +0200 Subject: [PATCH 22/27] kernel: add missing config symbols MPLS feature symbols are normally only set when kmod-mpls is enabled, but the CONFIG_MPLS symbol they depend on could also have been selected by openvswitch instead Signed-off-by: Felix Fietkau --- target/linux/generic/config-5.10 | 2 ++ target/linux/generic/config-5.15 | 2 ++ 2 files changed, 4 insertions(+) diff --git a/target/linux/generic/config-5.10 b/target/linux/generic/config-5.10 index a46fe13e64..a400b63e17 100644 --- a/target/linux/generic/config-5.10 +++ b/target/linux/generic/config-5.10 @@ -3515,6 +3515,8 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MPL115_SPI is not set # CONFIG_MPL3115 is not set # CONFIG_MPLS is not set +# CONFIG_MPLS_IPTUNNEL is not set +# CONFIG_MPLS_ROUTING is not set # CONFIG_MPTCP is not set # CONFIG_MPU3050_I2C is not set # CONFIG_MQ_IOSCHED_DEADLINE is not set diff --git a/target/linux/generic/config-5.15 b/target/linux/generic/config-5.15 index c9547258e1..7cffea43a5 100644 --- a/target/linux/generic/config-5.15 +++ b/target/linux/generic/config-5.15 @@ -3647,6 +3647,8 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_MPL115_SPI is not set # CONFIG_MPL3115 is not set # CONFIG_MPLS is not set +# CONFIG_MPLS_IPTUNNEL is not set +# CONFIG_MPLS_ROUTING is not set # CONFIG_MPTCP is not set # CONFIG_MPU3050_I2C is not set # CONFIG_MQ_IOSCHED_DEADLINE is not set From c18c6e53b9860b248986cea4b6856806a65af73c Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Wed, 13 Apr 2022 10:30:15 -0300 Subject: [PATCH 23/27] wolfssl: fix compilation with /dev/crypto This is trivial fix of a duplicate definition of 'int ret'. Signed-off-by: Eneas U de Queiroz --- ...rt-devcrypto-devcrypto_aes.c-remove-.patch | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 package/libs/wolfssl/patches/400-wolfcrypt-src-port-devcrypto-devcrypto_aes.c-remove-.patch diff --git a/package/libs/wolfssl/patches/400-wolfcrypt-src-port-devcrypto-devcrypto_aes.c-remove-.patch b/package/libs/wolfssl/patches/400-wolfcrypt-src-port-devcrypto-devcrypto_aes.c-remove-.patch new file mode 100644 index 0000000000..3c0c0a07af --- /dev/null +++ b/package/libs/wolfssl/patches/400-wolfcrypt-src-port-devcrypto-devcrypto_aes.c-remove-.patch @@ -0,0 +1,19 @@ +From 096889927d9528d4fbeb3aab56d1fe8225d2e7ec Mon Sep 17 00:00:00 2001 +From: Daniel Pouzzner +Date: Thu, 14 Apr 2022 20:23:31 -0500 +Subject: [PATCH] wolfcrypt/src/port/devcrypto/devcrypto_aes.c: remove + redundant "int ret" in wc_AesCtrEncrypt() (supersedes #5052). + + +diff --git a/wolfcrypt/src/port/devcrypto/devcrypto_aes.c b/wolfcrypt/src/port/devcrypto/devcrypto_aes.c +index 3bc1d5bb1..28e145e27 100644 +--- a/wolfcrypt/src/port/devcrypto/devcrypto_aes.c ++++ b/wolfcrypt/src/port/devcrypto/devcrypto_aes.c +@@ -208,7 +208,6 @@ int wc_AesCtrEncrypt(Aes* aes, byte* out, const byte* in, word32 sz) + int ret; + struct crypt_op crt; + byte* tmp; +- int ret; + + if (aes == NULL || out == NULL || in == NULL) { + return BAD_FUNC_ARG; From 6e837bc5d83a7c8b8433748ab875b6f23357f56a Mon Sep 17 00:00:00 2001 From: Rui Salvaterra Date: Thu, 7 Apr 2022 17:14:38 +0100 Subject: [PATCH 24/27] kernel: x86: remove an upstreamed patch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 012-pcengines-apu2-detect-apuv4-board.patch is upstream since Linux 5.5 [1]. [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.5&id=3d00da1de3ea36ba44f4a7ba76c8c8b16f98204b Acked-by: Petr Štetiar Signed-off-by: Rui Salvaterra --- ...12-pcengines-apu2-detect-apuv4-board.patch | 50 ------------------- ...12-pcengines-apu2-detect-apuv4-board.patch | 50 ------------------- 2 files changed, 100 deletions(-) delete mode 100644 target/linux/x86/patches-5.10/012-pcengines-apu2-detect-apuv4-board.patch delete mode 100644 target/linux/x86/patches-5.15/012-pcengines-apu2-detect-apuv4-board.patch diff --git a/target/linux/x86/patches-5.10/012-pcengines-apu2-detect-apuv4-board.patch b/target/linux/x86/patches-5.10/012-pcengines-apu2-detect-apuv4-board.patch deleted file mode 100644 index 520c66d292..0000000000 --- a/target/linux/x86/patches-5.10/012-pcengines-apu2-detect-apuv4-board.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 3d00da1de3ea36ba44f4a7ba76c8c8b16f98204b Mon Sep 17 00:00:00 2001 -From: "Enrico Weigelt, metux IT consult" -Date: Thu, 12 Dec 2019 14:27:56 +0100 -Subject: [PATCH] platform/x86: pcengines-apuv2: detect apuv4 board - -GPIO stuff on APUv4 seems to be the same as on APUv2, so we just -need to match on DMI data. - -Signed-off-by: Enrico Weigelt, metux IT consult -Signed-off-by: Andy Shevchenko ---- - drivers/platform/x86/pcengines-apuv2.c | 27 ++++++++++++++++++++++++++ - 1 file changed, 27 insertions(+) - ---- a/drivers/platform/x86/pcengines-apuv2.c -+++ b/drivers/platform/x86/pcengines-apuv2.c -@@ -215,6 +215,33 @@ static const struct dmi_system_id apu_gp - }, - .driver_data = (void *)&board_apu2, - }, -+ /* APU4 w/ legacy bios < 4.0.8 */ -+ { -+ .ident = "apu4", -+ .matches = { -+ DMI_MATCH(DMI_SYS_VENDOR, "PC Engines"), -+ DMI_MATCH(DMI_BOARD_NAME, "APU4") -+ }, -+ .driver_data = (void *)&board_apu2, -+ }, -+ /* APU4 w/ legacy bios >= 4.0.8 */ -+ { -+ .ident = "apu4", -+ .matches = { -+ DMI_MATCH(DMI_SYS_VENDOR, "PC Engines"), -+ DMI_MATCH(DMI_BOARD_NAME, "apu4") -+ }, -+ .driver_data = (void *)&board_apu2, -+ }, -+ /* APU4 w/ mainline bios */ -+ { -+ .ident = "apu4", -+ .matches = { -+ DMI_MATCH(DMI_SYS_VENDOR, "PC Engines"), -+ DMI_MATCH(DMI_BOARD_NAME, "PC Engines apu4") -+ }, -+ .driver_data = (void *)&board_apu2, -+ }, - {} - }; - diff --git a/target/linux/x86/patches-5.15/012-pcengines-apu2-detect-apuv4-board.patch b/target/linux/x86/patches-5.15/012-pcengines-apu2-detect-apuv4-board.patch deleted file mode 100644 index 520c66d292..0000000000 --- a/target/linux/x86/patches-5.15/012-pcengines-apu2-detect-apuv4-board.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 3d00da1de3ea36ba44f4a7ba76c8c8b16f98204b Mon Sep 17 00:00:00 2001 -From: "Enrico Weigelt, metux IT consult" -Date: Thu, 12 Dec 2019 14:27:56 +0100 -Subject: [PATCH] platform/x86: pcengines-apuv2: detect apuv4 board - -GPIO stuff on APUv4 seems to be the same as on APUv2, so we just -need to match on DMI data. - -Signed-off-by: Enrico Weigelt, metux IT consult -Signed-off-by: Andy Shevchenko ---- - drivers/platform/x86/pcengines-apuv2.c | 27 ++++++++++++++++++++++++++ - 1 file changed, 27 insertions(+) - ---- a/drivers/platform/x86/pcengines-apuv2.c -+++ b/drivers/platform/x86/pcengines-apuv2.c -@@ -215,6 +215,33 @@ static const struct dmi_system_id apu_gp - }, - .driver_data = (void *)&board_apu2, - }, -+ /* APU4 w/ legacy bios < 4.0.8 */ -+ { -+ .ident = "apu4", -+ .matches = { -+ DMI_MATCH(DMI_SYS_VENDOR, "PC Engines"), -+ DMI_MATCH(DMI_BOARD_NAME, "APU4") -+ }, -+ .driver_data = (void *)&board_apu2, -+ }, -+ /* APU4 w/ legacy bios >= 4.0.8 */ -+ { -+ .ident = "apu4", -+ .matches = { -+ DMI_MATCH(DMI_SYS_VENDOR, "PC Engines"), -+ DMI_MATCH(DMI_BOARD_NAME, "apu4") -+ }, -+ .driver_data = (void *)&board_apu2, -+ }, -+ /* APU4 w/ mainline bios */ -+ { -+ .ident = "apu4", -+ .matches = { -+ DMI_MATCH(DMI_SYS_VENDOR, "PC Engines"), -+ DMI_MATCH(DMI_BOARD_NAME, "PC Engines apu4") -+ }, -+ .driver_data = (void *)&board_apu2, -+ }, - {} - }; - From 079828fa54a81b9672c55f7f1d02bd2879a4944a Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Wed, 20 Apr 2022 15:10:07 +0100 Subject: [PATCH 25/27] uboot-mediatek: replace patch with accepted commit Replace pending patch with version accepted upstream. Other than in the first suggested version, the new property is now called 'u-boot,bootconf' instead of 'bootconf'. Signed-off-by: Daniel Golle --- ...-of-FIT-configuration-in-chosen-node.patch | 44 +++++-------------- 1 file changed, 10 insertions(+), 34 deletions(-) diff --git a/package/boot/uboot-mediatek/patches/280-image-fdt-save-name-of-FIT-configuration-in-chosen-node.patch b/package/boot/uboot-mediatek/patches/280-image-fdt-save-name-of-FIT-configuration-in-chosen-node.patch index 76e272a2c9..8517ffb97c 100644 --- a/package/boot/uboot-mediatek/patches/280-image-fdt-save-name-of-FIT-configuration-in-chosen-node.patch +++ b/package/boot/uboot-mediatek/patches/280-image-fdt-save-name-of-FIT-configuration-in-chosen-node.patch @@ -1,60 +1,36 @@ -From patchwork Mon Mar 21 23:22:23 2022 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -X-Patchwork-Submitter: Daniel Golle -X-Patchwork-Id: 1607954 -Return-Path: -X-Original-To: incoming@patchwork.ozlabs.org -Delivered-To: patchwork-incoming@bilbo.ozlabs.org -Date: Mon, 21 Mar 2022 23:22:23 +0000 +From 5f2d5915f8ea4785bc2b8a26955e176a7898c15b Mon Sep 17 00:00:00 2001 From: Daniel Golle -To: u-boot@lists.denx.de -Cc: Simon Glass , Alexandru Gagniuc , - Patrick Delaunay , - Heinrich Schuchardt +Date: Tue, 12 Apr 2022 21:00:43 +0100 Subject: [PATCH] image-fdt: save name of FIT configuration in '/chosen' node -Message-ID: -MIME-Version: 1.0 -Content-Disposition: inline -X-BeenThere: u-boot@lists.denx.de -X-Mailman-Version: 2.1.39 -Precedence: list -List-Id: U-Boot discussion -List-Unsubscribe: , - -List-Archive: -List-Post: -List-Help: -List-Subscribe: , - -Errors-To: u-boot-bounces@lists.denx.de -Sender: "U-Boot" It can be useful for the OS (Linux) to know which configuration has been chosen by U-Boot when launching a FIT image. Store the name of the FIT configuration node used in a new string -attribute called 'bootconf' in the '/chosen' node in device tree. +property called 'u-boot,bootconf' in the '/chosen' node in device tree. Signed-off-by: Daniel Golle +Reviewed-by: Tom Rini --- boot/image-fdt.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/boot/image-fdt.c b/boot/image-fdt.c -index 692a9ad3e4..4017bc94a6 100644 +index 692a9ad3e4..fdb69926a2 100644 --- a/boot/image-fdt.c +++ b/boot/image-fdt.c @@ -601,6 +601,12 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob, goto err; } -+ /* Store name of configuration node as bootconf in /chosen node */ ++ /* Store name of configuration node as u-boot,bootconf in /chosen node */ + if (images->fit_uname_cfg) -+ fdt_find_and_setprop(blob, "/chosen", "bootconf", ++ fdt_find_and_setprop(blob, "/chosen", "u-boot,bootconf", + images->fit_uname_cfg, + strlen(images->fit_uname_cfg) + 1, 1); + /* Update ethernet nodes */ fdt_fixup_ethernet(blob); #if CONFIG_IS_ENABLED(CMD_PSTORE) +-- +2.35.3 + From 690f7152673bc033e6fe5f0104be6c2b8aa16529 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Wed, 20 Apr 2022 15:19:59 +0100 Subject: [PATCH 26/27] kernel: update FIT partition parser to new property name The commit "uboot-mediatek: replace patch with accepted commit" changed the name of the boot configuration property from 'bootconf' to 'u-boot,bootconf'. Reflect this change in the FIT partition parser. Signed-off-by: Daniel Golle --- target/linux/generic/files/block/partitions/fit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/generic/files/block/partitions/fit.c b/target/linux/generic/files/block/partitions/fit.c index 46ccef62ee..ce6a2b5411 100644 --- a/target/linux/generic/files/block/partitions/fit.c +++ b/target/linux/generic/files/block/partitions/fit.c @@ -148,7 +148,7 @@ int parse_fit_partitions(struct parsed_partitions *state, u64 fit_start_sector, np = of_find_node_by_path("/chosen"); if (np) - bootconf = of_get_property(np, "bootconf", NULL); + bootconf = of_get_property(np, "u-boot,bootconf", NULL); else bootconf = NULL; From 0d2d52df69e91fe2f6e3e65750c0728fc45f5ab2 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 20 Apr 2022 15:14:14 +0200 Subject: [PATCH 27/27] mt76: update to the latest version d4937118ec4f mt76: fix rx reordering with non explicit / psmp ack policy f50672518bcc mt76: do not attempt to reorder received 802.3 packets without agg session 75e046e3c9ae mt76: fix antenna config missing in 6G cap 64ede85f14b5 mt76: mt7915: remove SCS feature db0a67582028 mt76: mt7915: make read-only array ppet16_ppet8_ru3_ru0 static const 68a2f68d5c01 mt76: mt7921: make read-only array ppet16_ppet8_ru3_ru0 static const 1e7b77294e97 mt76: mt7921: fix kernel crash at mt7921_pci_remove 795830a99a6c mt76: mt7915: add debugfs knob for RF registers read/write 60a8ec12a8eb mt76: mt7603: move spin_lock_bh() to spin_lock() 5ec7a2eac867 mt76: mt7915: disable RX_HDR_TRANS_SHORT eecbb4992073 mt76: fix encap offload ethernet type check Signed-off-by: Felix Fietkau --- package/kernel/mt76/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index b6dfa5e2b9..58e3bdfc71 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2022-04-07 -PKG_SOURCE_VERSION:=506bb0605e3e2fa4c5285e6c8866167691a6d71b -PKG_MIRROR_HASH:=4c60255d5899e2aac48dad6129d000163aa9ce18ed3ed0cd7e223298a10cc4e7 +PKG_SOURCE_DATE:=2022-04-20 +PKG_SOURCE_VERSION:=eecbb49920732b9b364f15c1ef0066342544b22b +PKG_MIRROR_HASH:=1a5c171d1713baadd5ba7da3c036a129a0ac318e5b3f4e98f719e9a92a510c44 PKG_MAINTAINER:=Felix Fietkau PKG_USE_NINJA:=0