From 9745de82d5febff46e8412d8f012043d97428151 Mon Sep 17 00:00:00 2001 From: Andrew Smith Date: Tue, 28 May 2024 09:35:28 +0100 Subject: [PATCH 01/27] qualcommax: ipq807x: use ath11k_patch_mac for SXK80 Use ath11k_patch_mac and ath11k_set_macflag functions for SXK80 Signed-off-by: Andrew Smith Link: https://github.com/openwrt/openwrt/pull/15732 Signed-off-by: Robert Marko --- .../etc/hotplug.d/firmware/11-ath11k-caldata | 12 ++++++++++-- .../etc/hotplug.d/ieee80211/11_fix_wifi_mac | 7 ------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata index 758b0d9a34..1170a35413 100644 --- a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata +++ b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata @@ -17,8 +17,6 @@ case "$FIRMWARE" in edgecore,eap102|\ edimax,cax1800|\ linksys,mx5300|\ - netgear,sxr80|\ - netgear,sxs80|\ netgear,wax218|\ qnap,301w|\ redmi,ax6|\ @@ -49,6 +47,16 @@ case "$FIRMWARE" in ath11k_patch_mac $(mtd_get_mac_binary boarddata1 0x6) 2 ath11k_set_macflag ;; + netgear,sxr80|\ + netgear,sxs80) + caldata_extract "0:art" 0x1000 0x20000 + label_mac=$(get_mac_label) + ath11k_patch_mac $(mtd_get_mac_binary boarddata1 0x0c) 0 + #boarddata1 doesn't have a MAC for the 2G interface + ath11k_patch_mac $(macaddr_setbit_la $label_mac) 1 + ath11k_patch_mac $(mtd_get_mac_binary boarddata1 0x12) 2 + ath11k_set_macflag + ;; netgear,wax620) caldata_extract "0:art" 0x1000 0x20000 label_mac=$(get_mac_label) diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index 75a548d1c6..80c07b8542 100644 --- a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -23,11 +23,4 @@ case "$board" in [ "$PHYNBR" = "0" ] && macaddr_add $(get_mac_label) 2 > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && macaddr_add $(get_mac_label) 3 > /sys${DEVPATH}/macaddress ;; - netgear,sxr80|\ - netgear,sxs80) - [ "$PHYNBR" = "0" ] && mtd_get_mac_binary boarddata1 0x0c > /sys${DEVPATH}/macaddress - #boarddata1 doesn't have a MAC for the 2G interface - [ "$PHYNBR" = "1" ] && macaddr_setbit_la $(get_mac_label) > /sys${DEVPATH}/macaddress - [ "$PHYNBR" = "2" ] && mtd_get_mac_binary boarddata1 0x12 > /sys${DEVPATH}/macaddress - ;; esac From 6ff598306fa2964fab5def3ca2fc572a5d801c64 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 10 Jun 2024 16:49:29 -0700 Subject: [PATCH 02/27] treewide: gpio to gpios gpio is deprecated. Found with dtc's -Wdeprecated_gpio_property Used git grep -E $'\tgpio = <' to make the changes. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/15681 Signed-off-by: Christian Marangi --- target/linux/ath79/dts/qca955x_elecom_wab.dtsi | 2 +- .../arch/arm/boot/dts/qcom/qcom-ipq4018-mf287pro.dts | 2 +- .../arch/arm/boot/dts/qcom/qcom-ipq4019-xx8300.dtsi | 2 +- .../files-6.1/arch/arm/boot/dts/kirkwood-dns320l.dts | 2 +- .../files-6.1/arch/arm/boot/dts/kirkwood-goflexhome.dts | 2 +- .../files-6.1/arch/arm/boot/dts/kirkwood-nas1.dts | 2 +- .../arch/arm/boot/dts/marvell/kirkwood-dns320l.dts | 2 +- .../arch/arm/boot/dts/marvell/kirkwood-goflexhome.dts | 2 +- .../files-6.6/arch/arm/boot/dts/marvell/kirkwood-nas1.dts | 2 +- ...002-6.2-ARM-dts-kirkwood-Add-Zyxel-NSA310S-board.patch | 4 ++-- .../files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7320.dts | 4 ++-- .../arch/mips/boot/dts/lantiq/ar9_bt_homehub-v3a.dts | 2 +- .../mips/boot/dts/lantiq/ar9_buffalo_wbmr-hp-g300h.dts | 2 +- .../files/arch/mips/boot/dts/lantiq/ar9_zte_h201l.dts | 2 +- .../arch/mips/boot/dts/lantiq/ar9_zyxel_p-2601hn.dts | 2 +- .../boot/dts/lantiq/danube_arcadyan_arv4518pwr01.dtsi | 2 +- .../mips/boot/dts/lantiq/danube_arcadyan_arv4519pw.dts | 2 +- .../mips/boot/dts/lantiq/danube_arcadyan_arv4520pw.dts | 2 +- .../mips/boot/dts/lantiq/danube_arcadyan_arv452cqw.dts | 2 +- .../mips/boot/dts/lantiq/danube_arcadyan_arv7510pw22.dts | 2 +- .../mips/boot/dts/lantiq/danube_arcadyan_arv7518pw.dts | 2 +- .../mips/boot/dts/lantiq/danube_arcadyan_arv752dpw.dts | 2 +- .../mips/boot/dts/lantiq/danube_arcadyan_arv752dpw22.dts | 2 +- .../mips/boot/dts/lantiq/danube_arcadyan_arv8539pw22.dts | 2 +- .../mips/boot/dts/lantiq/danube_audiocodes_mp-252.dts | 2 +- .../mips/boot/dts/lantiq/danube_siemens_gigaset-sx76x.dts | 2 +- .../mips/boot/dts/lantiq/vr9_arcadyan_arv7519rw22.dts | 2 +- .../mips/boot/dts/lantiq/vr9_arcadyan_vgv7510kw22.dtsi | 2 +- .../arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7519.dtsi | 2 +- .../mips/boot/dts/lantiq/vr9_arcadyan_vrv9510kwac23.dts | 2 +- .../arch/mips/boot/dts/lantiq/vr9_avm_fritz3370-rev2.dtsi | 4 ++-- .../files/arch/mips/boot/dts/lantiq/vr9_avm_fritz3390.dts | 4 ++-- .../files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7430.dts | 2 +- .../arch/mips/boot/dts/lantiq/vr9_bt_homehub-v5a.dts | 2 +- .../arch/mips/boot/dts/lantiq/vr9_buffalo_wbmr-300hpd.dts | 2 +- .../arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920.dtsi | 2 +- .../arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi | 2 +- .../files/arch/mips/boot/dts/lantiq/vr9_tplink_vr200.dtsi | 2 +- .../arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi | 2 +- target/linux/mediatek/dts/mt7622-elecom-wrc-2533gent.dts | 2 +- .../dts/mt7981a-glinet-gl-x3000-xe3000-common.dtsi | 2 +- target/linux/mediatek/dts/mt7981b-cudy-tr3000-v1.dts | 2 +- target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dts | 2 +- target/linux/mediatek/dts/mt7981b-glinet-gl-mt3000.dts | 4 ++-- target/linux/mediatek/dts/mt7981b-yuncore-ax835.dts | 2 +- .../mediatek/mt7988a-bananapi-bpi-r4-wifi-mt7996a.dtso | 2 +- .../arm/boot/dts/marvell/armada-370-buffalo-ls220de.dts | 4 ++-- .../arm/boot/dts/marvell/armada-370-buffalo-ls421de.dts | 6 +++--- .../arch/arm/boot/dts/marvell/armada-380-iij-sa-w2.dts | 4 ++-- .../arm/boot/dts/marvell/armada-385-fortinet-fg-xxe.dtsi | 2 +- .../arm/boot/dts/marvell/armada-385-linksys-venom.dts | 2 +- .../arch/arm/boot/dts/marvell/armada-385-nas1dual.dts | 2 +- .../boot/dts/marvell/armada-3720-espressobin-ultra.dts | 2 +- .../arch/arm64/boot/dts/marvell/cn9130-clearfog-pro.dts | 2 +- .../arch/arm64/boot/dts/marvell/cn9132-puzzle-m902.dts | 4 ++-- .../files/arch/arm64/boot/dts/qcom/ipq8070-rm2-6.dts | 8 ++++---- .../files/arch/arm64/boot/dts/qcom/ipq8071-eap102.dts | 4 ++-- .../files/arch/arm64/boot/dts/qcom/ipq8071-mf269.dts | 2 +- .../arch/arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts | 2 +- target/linux/ramips/dts/mt7621_asus_rt-ac57u-v1.dts | 2 +- target/linux/ramips/dts/mt7621_meig_slt866.dts | 2 +- target/linux/ramips/dts/mt7621_mikrotik_ltap-2hnd.dts | 4 ++-- .../linux/ramips/dts/mt7621_mikrotik_routerboard-m11g.dts | 2 +- .../linux/ramips/dts/mt7621_mikrotik_routerboard-m33g.dts | 8 ++++---- target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi | 2 +- target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi | 2 +- target/linux/ramips/dts/mt7621_snr_snr-cpe-me1.dts | 2 +- target/linux/ramips/dts/mt7621_snr_snr-cpe-me2-sfp.dts | 2 +- target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts | 2 +- target/linux/ramips/dts/mt7621_tplink_er605-v2.dts | 2 +- target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts | 2 +- target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g.dts | 2 +- target/linux/ramips/dts/mt7628an_netgear_r6120.dts | 2 +- .../patches-6.6/410-sunxi-add-bananapi-p2-zero.patch | 4 ++-- 74 files changed, 93 insertions(+), 93 deletions(-) diff --git a/target/linux/ath79/dts/qca955x_elecom_wab.dtsi b/target/linux/ath79/dts/qca955x_elecom_wab.dtsi index 3e24c514a9..43e34c6029 100644 --- a/target/linux/ath79/dts/qca955x_elecom_wab.dtsi +++ b/target/linux/ath79/dts/qca955x_elecom_wab.dtsi @@ -74,7 +74,7 @@ regulator-name = "usb-vbus"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 11 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; enable-active-high; regulator-always-on; }; diff --git a/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4018-mf287pro.dts b/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4018-mf287pro.dts index b4b9451cb2..29220624de 100644 --- a/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4018-mf287pro.dts +++ b/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4018-mf287pro.dts @@ -16,7 +16,7 @@ regulator-max-microvolt = <5000000>; regulator-always-on; regulator-boot-on; - gpio = <&tlmm 25 GPIO_ACTIVE_LOW>; + gpios = <&tlmm 25 GPIO_ACTIVE_LOW>; }; }; diff --git a/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4019-xx8300.dtsi b/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4019-xx8300.dtsi index ae2d88da93..0673dc0241 100644 --- a/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4019-xx8300.dtsi +++ b/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4019-xx8300.dtsi @@ -59,7 +59,7 @@ regulator-max-microvolt = <5000000>; regulator-always-on; regulator-boot-on; - gpio = <&tlmm 68 GPIO_ACTIVE_LOW>; + gpios = <&tlmm 68 GPIO_ACTIVE_LOW>; }; }; diff --git a/target/linux/kirkwood/files-6.1/arch/arm/boot/dts/kirkwood-dns320l.dts b/target/linux/kirkwood/files-6.1/arch/arm/boot/dts/kirkwood-dns320l.dts index bd86c04ea7..afeb76d5ff 100644 --- a/target/linux/kirkwood/files-6.1/arch/arm/boot/dts/kirkwood-dns320l.dts +++ b/target/linux/kirkwood/files-6.1/arch/arm/boot/dts/kirkwood-dns320l.dts @@ -117,7 +117,7 @@ enable-active-high; regulator-always-on; regulator-boot-on; - gpio = <&gpio0 24 0>; + gpios = <&gpio0 24 0>; }; }; }; diff --git a/target/linux/kirkwood/files-6.1/arch/arm/boot/dts/kirkwood-goflexhome.dts b/target/linux/kirkwood/files-6.1/arch/arm/boot/dts/kirkwood-goflexhome.dts index b0b69b46cd..2f4109fe63 100644 --- a/target/linux/kirkwood/files-6.1/arch/arm/boot/dts/kirkwood-goflexhome.dts +++ b/target/linux/kirkwood/files-6.1/arch/arm/boot/dts/kirkwood-goflexhome.dts @@ -96,7 +96,7 @@ enable-active-high; regulator-always-on; regulator-boot-on; - gpio = <&gpio0 29 GPIO_ACTIVE_HIGH>; + gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; }; }; }; diff --git a/target/linux/kirkwood/files-6.1/arch/arm/boot/dts/kirkwood-nas1.dts b/target/linux/kirkwood/files-6.1/arch/arm/boot/dts/kirkwood-nas1.dts index 379db8acd8..0ceddb0d64 100644 --- a/target/linux/kirkwood/files-6.1/arch/arm/boot/dts/kirkwood-nas1.dts +++ b/target/linux/kirkwood/files-6.1/arch/arm/boot/dts/kirkwood-nas1.dts @@ -110,7 +110,7 @@ regulator-max-microvolt = <5000000>; enable-active-high; regulator-always-on; - gpio = <&gpio1 11 GPIO_ACTIVE_HIGH>; + gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; }; }; }; diff --git a/target/linux/kirkwood/files-6.6/arch/arm/boot/dts/marvell/kirkwood-dns320l.dts b/target/linux/kirkwood/files-6.6/arch/arm/boot/dts/marvell/kirkwood-dns320l.dts index bd86c04ea7..afeb76d5ff 100644 --- a/target/linux/kirkwood/files-6.6/arch/arm/boot/dts/marvell/kirkwood-dns320l.dts +++ b/target/linux/kirkwood/files-6.6/arch/arm/boot/dts/marvell/kirkwood-dns320l.dts @@ -117,7 +117,7 @@ enable-active-high; regulator-always-on; regulator-boot-on; - gpio = <&gpio0 24 0>; + gpios = <&gpio0 24 0>; }; }; }; diff --git a/target/linux/kirkwood/files-6.6/arch/arm/boot/dts/marvell/kirkwood-goflexhome.dts b/target/linux/kirkwood/files-6.6/arch/arm/boot/dts/marvell/kirkwood-goflexhome.dts index b0b69b46cd..2f4109fe63 100644 --- a/target/linux/kirkwood/files-6.6/arch/arm/boot/dts/marvell/kirkwood-goflexhome.dts +++ b/target/linux/kirkwood/files-6.6/arch/arm/boot/dts/marvell/kirkwood-goflexhome.dts @@ -96,7 +96,7 @@ enable-active-high; regulator-always-on; regulator-boot-on; - gpio = <&gpio0 29 GPIO_ACTIVE_HIGH>; + gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; }; }; }; diff --git a/target/linux/kirkwood/files-6.6/arch/arm/boot/dts/marvell/kirkwood-nas1.dts b/target/linux/kirkwood/files-6.6/arch/arm/boot/dts/marvell/kirkwood-nas1.dts index 379db8acd8..0ceddb0d64 100644 --- a/target/linux/kirkwood/files-6.6/arch/arm/boot/dts/marvell/kirkwood-nas1.dts +++ b/target/linux/kirkwood/files-6.6/arch/arm/boot/dts/marvell/kirkwood-nas1.dts @@ -110,7 +110,7 @@ regulator-max-microvolt = <5000000>; enable-active-high; regulator-always-on; - gpio = <&gpio1 11 GPIO_ACTIVE_HIGH>; + gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; }; }; }; diff --git a/target/linux/kirkwood/patches-6.1/002-6.2-ARM-dts-kirkwood-Add-Zyxel-NSA310S-board.patch b/target/linux/kirkwood/patches-6.1/002-6.2-ARM-dts-kirkwood-Add-Zyxel-NSA310S-board.patch index 09e71813cd..6a8e8e8c9b 100644 --- a/target/linux/kirkwood/patches-6.1/002-6.2-ARM-dts-kirkwood-Add-Zyxel-NSA310S-board.patch +++ b/target/linux/kirkwood/patches-6.1/002-6.2-ARM-dts-kirkwood-Add-Zyxel-NSA310S-board.patch @@ -160,7 +160,7 @@ Signed-off-by: Gregory CLEMENT + regulator-max-microvolt = <5000000>; + regulator-always-on; + regulator-boot-on; -+ gpio = <&gpio0 21 GPIO_ACTIVE_HIGH>; ++ gpios = <&gpio0 21 GPIO_ACTIVE_HIGH>; + }; + + sata1_power: regulator@2 { @@ -171,7 +171,7 @@ Signed-off-by: Gregory CLEMENT + regulator-max-microvolt = <5000000>; + regulator-always-on; + regulator-boot-on; -+ gpio = <&gpio1 1 GPIO_ACTIVE_HIGH>; ++ gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>; + }; + + thermal-zones { diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7320.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7320.dts index 3023d4925d..96adb0ddad 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7320.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7320.dts @@ -82,7 +82,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 50 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 50 GPIO_ACTIVE_HIGH>; enable-active-high; }; @@ -94,7 +94,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 51 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 51 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_bt_homehub-v3a.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_bt_homehub-v3a.dts index e8024d6463..fdc3c3037b 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_bt_homehub-v3a.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_bt_homehub-v3a.dts @@ -101,7 +101,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 33 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 33 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_buffalo_wbmr-hp-g300h.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_buffalo_wbmr-hp-g300h.dts index 5a50f27c08..afb858b9e6 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_buffalo_wbmr-hp-g300h.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_buffalo_wbmr-hp-g300h.dts @@ -108,7 +108,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 36 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 36 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_zte_h201l.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_zte_h201l.dts index b17efe740a..a0e3664b6d 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_zte_h201l.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_zte_h201l.dts @@ -116,7 +116,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 36 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 36 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_zyxel_p-2601hn.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_zyxel_p-2601hn.dts index 8baf91861c..760bced2d2 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_zyxel_p-2601hn.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_zyxel_p-2601hn.dts @@ -106,7 +106,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 9 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 9 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4518pwr01.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4518pwr01.dtsi index 3d56e76c46..45ae578567 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4518pwr01.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4518pwr01.dtsi @@ -105,7 +105,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 14 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4519pw.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4519pw.dts index 3eff5cd6da..55ac2038c8 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4519pw.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4519pw.dts @@ -121,7 +121,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 14 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4520pw.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4520pw.dts index c2b44ebb66..487a107ff2 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4520pw.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv4520pw.dts @@ -125,7 +125,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 28 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 28 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv452cqw.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv452cqw.dts index 34bb167b6a..1fd192d221 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv452cqw.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv452cqw.dts @@ -139,7 +139,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 28 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 28 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7510pw22.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7510pw22.dts index 52ba5e1a3b..237188137b 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7510pw22.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7510pw22.dts @@ -80,7 +80,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 8 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 8 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7518pw.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7518pw.dts index 34b8808442..fe642b643f 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7518pw.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv7518pw.dts @@ -120,7 +120,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 14 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw.dts index f56ee53e39..c5362a4d48 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw.dts @@ -118,7 +118,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpiomm 0 GPIO_ACTIVE_HIGH>; + gpios = <&gpiomm 0 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw22.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw22.dts index 910cf65b76..9522e57f5e 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw22.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv752dpw22.dts @@ -134,7 +134,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpiomm 0 GPIO_ACTIVE_HIGH>; + gpios = <&gpiomm 0 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv8539pw22.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv8539pw22.dts index 1a8b29a477..46b98c8c20 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv8539pw22.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_arcadyan_arv8539pw22.dts @@ -87,7 +87,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 14 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_audiocodes_mp-252.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_audiocodes_mp-252.dts index 624f815148..601498beba 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_audiocodes_mp-252.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_audiocodes_mp-252.dts @@ -21,7 +21,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 3 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 3 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_siemens_gigaset-sx76x.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_siemens_gigaset-sx76x.dts index b2585cf5a7..5b57f70c9d 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_siemens_gigaset-sx76x.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/danube_siemens_gigaset-sx76x.dts @@ -45,7 +45,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 29 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 29 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_arv7519rw22.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_arv7519rw22.dts index 9107624eb1..000add09d8 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_arv7519rw22.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_arv7519rw22.dts @@ -92,7 +92,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 32 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 32 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7510kw22.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7510kw22.dtsi index 90d11c991d..6b2aa2b974 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7510kw22.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7510kw22.dtsi @@ -106,7 +106,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 47 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 47 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7519.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7519.dtsi index e0bcaa951b..5056f3c709 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7519.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vgv7519.dtsi @@ -126,7 +126,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 32 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 32 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vrv9510kwac23.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vrv9510kwac23.dts index 4837223813..9d9f981e95 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vrv9510kwac23.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_arcadyan_vrv9510kwac23.dts @@ -159,7 +159,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 32 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 32 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz3370-rev2.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz3370-rev2.dtsi index 4c9b073b70..fbf86f9aef 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz3370-rev2.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz3370-rev2.dtsi @@ -102,7 +102,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 14 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; enable-active-high; }; @@ -114,7 +114,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 5 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 5 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz3390.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz3390.dts index aef33f2f09..dc81f81ca4 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz3390.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz3390.dts @@ -93,7 +93,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 14 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; enable-active-high; }; @@ -105,7 +105,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 5 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 5 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7430.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7430.dts index cbfa7ebe48..a0af4dff32 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7430.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7430.dts @@ -90,7 +90,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 5 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 5 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_bt_homehub-v5a.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_bt_homehub-v5a.dts index dc43b3a994..0ee2cf74d1 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_bt_homehub-v5a.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_bt_homehub-v5a.dts @@ -113,7 +113,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 33 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 33 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_buffalo_wbmr-300hpd.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_buffalo_wbmr-300hpd.dts index 31bbfc67cc..6a23794c7b 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_buffalo_wbmr-300hpd.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_buffalo_wbmr-300hpd.dts @@ -150,7 +150,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 33 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 33 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920.dtsi index a8b5f25810..f477ad8db2 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_lantiq_easy80920.dtsi @@ -96,7 +96,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 33 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 33 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi index d133b5b6d3..c3e69f18fa 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_tdw89x0.dtsi @@ -107,7 +107,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 33 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 33 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_vr200.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_vr200.dtsi index 2160adf793..0fc54677db 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_vr200.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_tplink_vr200.dtsi @@ -99,7 +99,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 33 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 33 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi index 89b7e3e98f..ac536e7a7a 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-fx.dtsi @@ -110,7 +110,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 33 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 33 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/mediatek/dts/mt7622-elecom-wrc-2533gent.dts b/target/linux/mediatek/dts/mt7622-elecom-wrc-2533gent.dts index 3e061ef945..7fe5d02e1a 100644 --- a/target/linux/mediatek/dts/mt7622-elecom-wrc-2533gent.dts +++ b/target/linux/mediatek/dts/mt7622-elecom-wrc-2533gent.dts @@ -130,7 +130,7 @@ regulator-name = "usb_vbus"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&pio 22 GPIO_ACTIVE_LOW>; + gpios = <&pio 22 GPIO_ACTIVE_LOW>; enable-active-high; }; diff --git a/target/linux/mediatek/dts/mt7981a-glinet-gl-x3000-xe3000-common.dtsi b/target/linux/mediatek/dts/mt7981a-glinet-gl-x3000-xe3000-common.dtsi index 4b311dbe21..e9050e02e5 100644 --- a/target/linux/mediatek/dts/mt7981a-glinet-gl-x3000-xe3000-common.dtsi +++ b/target/linux/mediatek/dts/mt7981a-glinet-gl-x3000-xe3000-common.dtsi @@ -31,7 +31,7 @@ regulator-name = "fan"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&pio 28 GPIO_ACTIVE_HIGH>; + gpios = <&pio 28 GPIO_ACTIVE_HIGH>; enable-active-high; }; diff --git a/target/linux/mediatek/dts/mt7981b-cudy-tr3000-v1.dts b/target/linux/mediatek/dts/mt7981b-cudy-tr3000-v1.dts index 2d18af860e..1f03b42b1b 100644 --- a/target/linux/mediatek/dts/mt7981b-cudy-tr3000-v1.dts +++ b/target/linux/mediatek/dts/mt7981b-cudy-tr3000-v1.dts @@ -65,7 +65,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&pio 9 GPIO_ACTIVE_LOW>; + gpios = <&pio 9 GPIO_ACTIVE_LOW>; regulator-boot-on; }; }; diff --git a/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dts b/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dts index 9b7c85e519..15818a90fc 100644 --- a/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dts +++ b/target/linux/mediatek/dts/mt7981b-glinet-gl-mt2500.dts @@ -57,7 +57,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&pio 12 GPIO_ACTIVE_HIGH>; + gpios = <&pio 12 GPIO_ACTIVE_HIGH>; enable-active-high; regulator-boot-on; }; diff --git a/target/linux/mediatek/dts/mt7981b-glinet-gl-mt3000.dts b/target/linux/mediatek/dts/mt7981b-glinet-gl-mt3000.dts index b1ebaf4312..7271798921 100644 --- a/target/linux/mediatek/dts/mt7981b-glinet-gl-mt3000.dts +++ b/target/linux/mediatek/dts/mt7981b-glinet-gl-mt3000.dts @@ -56,7 +56,7 @@ regulator-name = "fan"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&pio 28 GPIO_ACTIVE_HIGH>; + gpios = <&pio 28 GPIO_ACTIVE_HIGH>; enable-active-high; regulator-boot-on; }; @@ -66,7 +66,7 @@ regulator-name = "usb_vbus"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&pio 12 GPIO_ACTIVE_HIGH>; + gpios = <&pio 12 GPIO_ACTIVE_HIGH>; enable-active-high; regulator-boot-on; }; diff --git a/target/linux/mediatek/dts/mt7981b-yuncore-ax835.dts b/target/linux/mediatek/dts/mt7981b-yuncore-ax835.dts index 8b716e8742..5f98e6178a 100644 --- a/target/linux/mediatek/dts/mt7981b-yuncore-ax835.dts +++ b/target/linux/mediatek/dts/mt7981b-yuncore-ax835.dts @@ -36,7 +36,7 @@ regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-always-on; - gpio = <&pio 5 GPIO_ACTIVE_HIGH>; + gpios = <&pio 5 GPIO_ACTIVE_HIGH>; }; leds { diff --git a/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-wifi-mt7996a.dtso b/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-wifi-mt7996a.dtso index 8a029b149f..baba44e595 100644 --- a/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-wifi-mt7996a.dtso +++ b/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-wifi-mt7996a.dtso @@ -15,7 +15,7 @@ regulator-name = "wifi"; regulator-min-microvolt = <12000000>; regulator-max-microvolt = <12000000>; - gpio = <&pio 4 GPIO_ACTIVE_HIGH>; + gpios = <&pio 4 GPIO_ACTIVE_HIGH>; enable-active-high; regulator-always-on; }; diff --git a/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-370-buffalo-ls220de.dts b/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-370-buffalo-ls220de.dts index 11be6a4028..8740cb32d9 100644 --- a/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-370-buffalo-ls220de.dts +++ b/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-370-buffalo-ls220de.dts @@ -192,7 +192,7 @@ enable-active-high; regulator-always-on; regulator-boot-on; - gpio = <&gpio0 8 GPIO_ACTIVE_HIGH>; + gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>; }; sata2_power: regulator@2 { @@ -205,7 +205,7 @@ enable-active-high; regulator-always-on; regulator-boot-on; - gpio = <&gpio0 2 GPIO_ACTIVE_HIGH>; + gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>; }; }; }; diff --git a/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-370-buffalo-ls421de.dts b/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-370-buffalo-ls421de.dts index 59400839a7..13cc8efa2d 100644 --- a/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-370-buffalo-ls421de.dts +++ b/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-370-buffalo-ls421de.dts @@ -204,7 +204,7 @@ enable-active-high; regulator-always-on; regulator-boot-on; - gpio = <&gpio0 5 GPIO_ACTIVE_HIGH>; + gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>; }; sata1_power: regulator@1 { @@ -217,7 +217,7 @@ enable-active-high; regulator-always-on; regulator-boot-on; - gpio = <&gpio0 8 GPIO_ACTIVE_HIGH>; + gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>; }; sata2_power: regulator@2 { @@ -230,7 +230,7 @@ enable-active-high; regulator-always-on; regulator-boot-on; - gpio = <&gpio0 9 GPIO_ACTIVE_HIGH>; + gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>; }; }; }; diff --git a/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-380-iij-sa-w2.dts b/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-380-iij-sa-w2.dts index 01c1ef675b..86029d3629 100644 --- a/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-380-iij-sa-w2.dts +++ b/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-380-iij-sa-w2.dts @@ -151,7 +151,7 @@ regulator-name = "vbus-usb0"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio1 20 GPIO_ACTIVE_HIGH>; + gpios = <&gpio1 20 GPIO_ACTIVE_HIGH>; enable-active-high; regulator-always-on; }; @@ -161,7 +161,7 @@ regulator-name = "vbus-usb1"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio1 21 GPIO_ACTIVE_HIGH>; + gpios = <&gpio1 21 GPIO_ACTIVE_HIGH>; enable-active-high; regulator-always-on; }; diff --git a/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-385-fortinet-fg-xxe.dtsi b/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-385-fortinet-fg-xxe.dtsi index 6a5e016d30..ba4460fddd 100644 --- a/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-385-fortinet-fg-xxe.dtsi +++ b/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-385-fortinet-fg-xxe.dtsi @@ -151,7 +151,7 @@ regulator-name = "usb-vbus"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio1 21 GPIO_ACTIVE_LOW>; + gpios = <&gpio1 21 GPIO_ACTIVE_LOW>; regulator-always-on; }; }; diff --git a/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-385-linksys-venom.dts b/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-385-linksys-venom.dts index a2ca3158cf..63d25701c9 100644 --- a/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-385-linksys-venom.dts +++ b/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-385-linksys-venom.dts @@ -205,7 +205,7 @@ }; &usb3_1_vbus { - gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>; + gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>; }; &usb3_1_vbus_pins { diff --git a/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-385-nas1dual.dts b/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-385-nas1dual.dts index f1fd72a93c..b3dca335c9 100644 --- a/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-385-nas1dual.dts +++ b/target/linux/mvebu/files-6.6/arch/arm/boot/dts/marvell/armada-385-nas1dual.dts @@ -124,7 +124,7 @@ regulator-name = "sata-power"; regulator-min-microvolt = <12000000>; regulator-max-microvolt = <12000000>; - gpio = <&gpio1 20 GPIO_ACTIVE_LOW>; + gpios = <&gpio1 20 GPIO_ACTIVE_LOW>; regulator-always-on; }; }; diff --git a/target/linux/mvebu/files-6.6/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts b/target/linux/mvebu/files-6.6/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts index 1a6594e3cd..063eb86992 100644 --- a/target/linux/mvebu/files-6.6/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts +++ b/target/linux/mvebu/files-6.6/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts @@ -40,7 +40,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; enable-active-high; - gpio = <&gpionb 19 GPIO_ACTIVE_HIGH>; + gpios = <&gpionb 19 GPIO_ACTIVE_HIGH>; }; usb3_phy: usb3-phy { diff --git a/target/linux/mvebu/files-6.6/arch/arm64/boot/dts/marvell/cn9130-clearfog-pro.dts b/target/linux/mvebu/files-6.6/arch/arm64/boot/dts/marvell/cn9130-clearfog-pro.dts index b5cc630781..15e19fb932 100644 --- a/target/linux/mvebu/files-6.6/arch/arm64/boot/dts/marvell/cn9130-clearfog-pro.dts +++ b/target/linux/mvebu/files-6.6/arch/arm64/boot/dts/marvell/cn9130-clearfog-pro.dts @@ -78,7 +78,7 @@ regulator-name = "v_5v0_usb3_hst_vbus"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&expander0 6 GPIO_ACTIVE_LOW>; + gpios = <&expander0 6 GPIO_ACTIVE_LOW>; vin-supply = <&v_5v0>; }; diff --git a/target/linux/mvebu/files-6.6/arch/arm64/boot/dts/marvell/cn9132-puzzle-m902.dts b/target/linux/mvebu/files-6.6/arch/arm64/boot/dts/marvell/cn9132-puzzle-m902.dts index 67dace4888..0c042f12de 100644 --- a/target/linux/mvebu/files-6.6/arch/arm64/boot/dts/marvell/cn9132-puzzle-m902.dts +++ b/target/linux/mvebu/files-6.6/arch/arm64/boot/dts/marvell/cn9132-puzzle-m902.dts @@ -68,7 +68,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; enable-active-high; - gpio = <&cp2_gpio1 2 GPIO_ACTIVE_HIGH>; + gpios = <&cp2_gpio1 2 GPIO_ACTIVE_HIGH>; }; cp2_usb3_0_phy0: cp2_usb3_phy0 { @@ -82,7 +82,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; enable-active-high; - gpio = <&cp2_gpio1 3 GPIO_ACTIVE_HIGH>; + gpios = <&cp2_gpio1 3 GPIO_ACTIVE_HIGH>; }; cp2_usb3_0_phy1: cp2_usb3_phy1 { diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8070-rm2-6.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8070-rm2-6.dts index d935e19ad2..5d3123f75e 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8070-rm2-6.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8070-rm2-6.dts @@ -57,26 +57,26 @@ led_status_amber: status-amber { color = ; function = LED_FUNCTION_STATUS; - gpio = <&tlmm 25 GPIO_ACTIVE_HIGH>; + gpios = <&tlmm 25 GPIO_ACTIVE_HIGH>; }; led_status_blue: status-blue { color = ; function = LED_FUNCTION_STATUS; - gpio = <&tlmm 26 GPIO_ACTIVE_HIGH>; + gpios = <&tlmm 26 GPIO_ACTIVE_HIGH>; }; led_status_red: status-red { color = ; function = LED_FUNCTION_STATUS; - gpio = <&tlmm 31 GPIO_ACTIVE_HIGH>; + gpios = <&tlmm 31 GPIO_ACTIVE_HIGH>; }; }; fan: gpio-fan { #cooling-cells = <2>; compatible = "gpio-fan"; - gpio = <&tlmm 29 GPIO_ACTIVE_HIGH>; + gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; gpio-fan,speed-map = <0 0>, <1 1>; }; }; diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-eap102.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-eap102.dts index d55904a24a..f8fe6b42f8 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-eap102.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-eap102.dts @@ -54,13 +54,13 @@ led_wlan2g { label = "green:wlan2g"; - gpio = <&tlmm 47 GPIO_ACTIVE_HIGH>; + gpios = <&tlmm 47 GPIO_ACTIVE_HIGH>; linux,default-trigger = "phy1radio"; }; led_wlan5g { label = "green:wlan5g"; - gpio = <&tlmm 48 GPIO_ACTIVE_HIGH>; + gpios = <&tlmm 48 GPIO_ACTIVE_HIGH>; linux,default-trigger = "phy0radio"; }; diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-mf269.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-mf269.dts index 3ca92a7a8f..866ed5e9c3 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-mf269.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-mf269.dts @@ -51,7 +51,7 @@ led_power: power { function = LED_FUNCTION_POWER; color = ; - gpio = <&tlmm 56 GPIO_ACTIVE_HIGH>; + gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>; }; }; }; diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts index d8237e81dd..347bb6e8ab 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts @@ -131,7 +131,7 @@ regulator-name = "vbus"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&tlmm 64 GPIO_ACTIVE_HIGH>; + gpios = <&tlmm 64 GPIO_ACTIVE_HIGH>; enable-active-high; regulator-always-on; }; diff --git a/target/linux/ramips/dts/mt7621_asus_rt-ac57u-v1.dts b/target/linux/ramips/dts/mt7621_asus_rt-ac57u-v1.dts index d5b46b14ee..f894cdf598 100644 --- a/target/linux/ramips/dts/mt7621_asus_rt-ac57u-v1.dts +++ b/target/linux/ramips/dts/mt7621_asus_rt-ac57u-v1.dts @@ -56,7 +56,7 @@ led-regulator { compatible = "regulator-fixed"; regulator-name = "LED-Power"; - gpio = <&gpio 46 GPIO_ACTIVE_LOW>; + gpios = <&gpio 46 GPIO_ACTIVE_LOW>; regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-always-on; diff --git a/target/linux/ramips/dts/mt7621_meig_slt866.dts b/target/linux/ramips/dts/mt7621_meig_slt866.dts index d4e040649e..e49f7c1d4a 100644 --- a/target/linux/ramips/dts/mt7621_meig_slt866.dts +++ b/target/linux/ramips/dts/mt7621_meig_slt866.dts @@ -75,7 +75,7 @@ regulator-name = "pa-5g"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 7 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; enable-active-high; regulator-boot-on; regulator-always-on; diff --git a/target/linux/ramips/dts/mt7621_mikrotik_ltap-2hnd.dts b/target/linux/ramips/dts/mt7621_mikrotik_ltap-2hnd.dts index feeda9685e..b5e38071f1 100644 --- a/target/linux/ramips/dts/mt7621_mikrotik_ltap-2hnd.dts +++ b/target/linux/ramips/dts/mt7621_mikrotik_ltap-2hnd.dts @@ -101,7 +101,7 @@ regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; - gpio = <&gpio 10 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 10 GPIO_ACTIVE_HIGH>; enable-active-high; regulator-boot-on; }; @@ -112,7 +112,7 @@ regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; - gpio = <&gpio 11 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; enable-active-high; regulator-boot-on; }; diff --git a/target/linux/ramips/dts/mt7621_mikrotik_routerboard-m11g.dts b/target/linux/ramips/dts/mt7621_mikrotik_routerboard-m11g.dts index eacbbda54d..5f9ee90e7c 100644 --- a/target/linux/ramips/dts/mt7621_mikrotik_routerboard-m11g.dts +++ b/target/linux/ramips/dts/mt7621_mikrotik_routerboard-m11g.dts @@ -51,7 +51,7 @@ regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; - gpio = <&gpio 9 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 9 GPIO_ACTIVE_HIGH>; enable-active-high; regulator-boot-on; regulator-always-on; diff --git a/target/linux/ramips/dts/mt7621_mikrotik_routerboard-m33g.dts b/target/linux/ramips/dts/mt7621_mikrotik_routerboard-m33g.dts index 11171d9535..5e76261529 100644 --- a/target/linux/ramips/dts/mt7621_mikrotik_routerboard-m33g.dts +++ b/target/linux/ramips/dts/mt7621_mikrotik_routerboard-m33g.dts @@ -26,7 +26,7 @@ regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; - gpio = <&gpio 9 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 9 GPIO_ACTIVE_HIGH>; enable-active-high; regulator-boot-on; regulator-always-on; @@ -38,7 +38,7 @@ regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; - gpio = <&gpio 10 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 10 GPIO_ACTIVE_HIGH>; enable-active-high; regulator-boot-on; regulator-always-on; @@ -50,7 +50,7 @@ regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; - gpio = <&gpio 11 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; enable-active-high; regulator-boot-on; regulator-always-on; @@ -62,7 +62,7 @@ regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 12 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; enable-active-high; regulator-always-on; }; diff --git a/target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi b/target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi index f8dc6ebdbf..40d853d48e 100644 --- a/target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi +++ b/target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi @@ -79,7 +79,7 @@ regulator-name = "usb_vbus"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 10 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 10 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi b/target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi index 273bb9469c..16f20d9408 100644 --- a/target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi +++ b/target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi @@ -68,7 +68,7 @@ regulator-name = "usb_vbus"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 10 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 10 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/ramips/dts/mt7621_snr_snr-cpe-me1.dts b/target/linux/ramips/dts/mt7621_snr_snr-cpe-me1.dts index b287056bf1..4270226926 100644 --- a/target/linux/ramips/dts/mt7621_snr_snr-cpe-me1.dts +++ b/target/linux/ramips/dts/mt7621_snr_snr-cpe-me1.dts @@ -62,7 +62,7 @@ regulator-name = "usb_vbus"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 17 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 17 GPIO_ACTIVE_HIGH>; enable-active-high; }; diff --git a/target/linux/ramips/dts/mt7621_snr_snr-cpe-me2-sfp.dts b/target/linux/ramips/dts/mt7621_snr_snr-cpe-me2-sfp.dts index 6249eb6520..b4324feccf 100644 --- a/target/linux/ramips/dts/mt7621_snr_snr-cpe-me2-sfp.dts +++ b/target/linux/ramips/dts/mt7621_snr_snr-cpe-me2-sfp.dts @@ -64,7 +64,7 @@ regulator-name = "usb_vbus"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 17 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 17 GPIO_ACTIVE_HIGH>; enable-active-high; }; diff --git a/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts b/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts index b1a3e3e1bc..de352741f8 100644 --- a/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts +++ b/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts @@ -91,7 +91,7 @@ regulator-name = "usb_vbus"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 3 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 3 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/ramips/dts/mt7621_tplink_er605-v2.dts b/target/linux/ramips/dts/mt7621_tplink_er605-v2.dts index b71b7ad914..1299b02806 100644 --- a/target/linux/ramips/dts/mt7621_tplink_er605-v2.dts +++ b/target/linux/ramips/dts/mt7621_tplink_er605-v2.dts @@ -64,7 +64,7 @@ regulator-name = "usb_vbus"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 10 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 10 GPIO_ACTIVE_HIGH>; enable-active-high; }; diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts index 96054135ae..2ed4b2c311 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts @@ -90,7 +90,7 @@ regulator-name = "usb_vbus"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 12 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g.dts b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g.dts index ad9c18f8ff..7af316de6a 100644 --- a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g.dts +++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3g.dts @@ -63,7 +63,7 @@ regulator-name = "usb_vbus"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&gpio 12 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; enable-active-high; }; }; diff --git a/target/linux/ramips/dts/mt7628an_netgear_r6120.dts b/target/linux/ramips/dts/mt7628an_netgear_r6120.dts index 8a27f0d1ef..5e381f684a 100644 --- a/target/linux/ramips/dts/mt7628an_netgear_r6120.dts +++ b/target/linux/ramips/dts/mt7628an_netgear_r6120.dts @@ -12,7 +12,7 @@ compatible = "regulator-fixed"; regulator-name = "USB-power"; - gpio = <&gpio 45 GPIO_ACTIVE_HIGH>; + gpios = <&gpio 45 GPIO_ACTIVE_HIGH>; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; enable-active-high; diff --git a/target/linux/sunxi/patches-6.6/410-sunxi-add-bananapi-p2-zero.patch b/target/linux/sunxi/patches-6.6/410-sunxi-add-bananapi-p2-zero.patch index 01044fef49..350d7f0403 100644 --- a/target/linux/sunxi/patches-6.6/410-sunxi-add-bananapi-p2-zero.patch +++ b/target/linux/sunxi/patches-6.6/410-sunxi-add-bananapi-p2-zero.patch @@ -94,7 +94,7 @@ + regulator-always-on; + regulator-boot-on; + enable-active-high; -+ gpio = <&r_pio 0 9 GPIO_ACTIVE_HIGH>; /* PL9 */ ++ gpios = <&r_pio 0 9 GPIO_ACTIVE_HIGH>; /* PL9 */ + vin-supply = <®_vcc5v0>; + }; + @@ -106,7 +106,7 @@ + regulator-always-on; + regulator-boot-on; + enable-active-high; -+ gpio = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */ ++ gpios = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */ + vin-supply = <®_vcc5v0>; + }; + From 02d47af19e1296ef85f3b8d63cacb1af3f1721f1 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Sun, 2 Jun 2024 16:01:04 +0200 Subject: [PATCH 03/27] apm821xx: switch to 6.6 kernel Switch the apm821xx targets to kernel 6.6. no complains received. Signed-off-by: Christian Lamparter Link: https://github.com/openwrt/openwrt/pull/15721 Signed-off-by: Christian Marangi --- target/linux/apm821xx/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/linux/apm821xx/Makefile b/target/linux/apm821xx/Makefile index 6719a69779..1bbcbf5070 100644 --- a/target/linux/apm821xx/Makefile +++ b/target/linux/apm821xx/Makefile @@ -9,8 +9,7 @@ CPU_TYPE:=464fp FEATURES:=fpu dt gpio ramdisk squashfs usb SUBTARGETS:=nand sata -KERNEL_PATCHVER:=6.1 -KERNEL_TESTING_PATCHVER:=6.6 +KERNEL_PATCHVER:=6.6 define Target/Description Build images for AppliedMicro APM821xx based boards. From 76dabadda8e25efd30711eec498cb7896fb1fbc2 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Sun, 2 Jun 2024 16:03:26 +0200 Subject: [PATCH 04/27] apm821xx: drop 6.1 kernel support files Drop config+patches for kernel 6.1. Signed-off-by: Christian Lamparter Link: https://github.com/openwrt/openwrt/pull/15721 Signed-off-by: Christian Marangi --- target/linux/apm821xx/config-6.1 | 250 ------------------ .../201-add-amcc-apollo3g-support.patch | 30 --- .../300-fix-atheros-nics-on-apm82181.patch | 51 ---- .../301-fix-memory-map-wndr4700.patch | 14 - ...per-force-gzip-as-mkimage-s-compress.patch | 29 -- 5 files changed, 374 deletions(-) delete mode 100644 target/linux/apm821xx/config-6.1 delete mode 100644 target/linux/apm821xx/patches-6.1/201-add-amcc-apollo3g-support.patch delete mode 100644 target/linux/apm821xx/patches-6.1/300-fix-atheros-nics-on-apm82181.patch delete mode 100644 target/linux/apm821xx/patches-6.1/301-fix-memory-map-wndr4700.patch delete mode 100644 target/linux/apm821xx/patches-6.1/900-powerpc-bootwrapper-force-gzip-as-mkimage-s-compress.patch diff --git a/target/linux/apm821xx/config-6.1 b/target/linux/apm821xx/config-6.1 deleted file mode 100644 index bde05e2f12..0000000000 --- a/target/linux/apm821xx/config-6.1 +++ /dev/null @@ -1,250 +0,0 @@ -# CONFIG_40x is not set -# CONFIG_440_CPU is not set -CONFIG_44x=y -CONFIG_464_CPU=y -CONFIG_4xx=y -CONFIG_4xx_SOC=y -# CONFIG_ADVANCED_OPTIONS is not set -CONFIG_APM821xx=y -# CONFIG_APOLLO3G is not set -# CONFIG_ARCHES is not set -CONFIG_ARCH_32BIT_OFF_T=y -CONFIG_ARCH_DMA_ADDR_T_64BIT=y -CONFIG_ARCH_HIBERNATION_POSSIBLE=y -CONFIG_ARCH_KEEP_MEMBLOCK=y -CONFIG_ARCH_MAY_HAVE_PC_FDC=y -CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y -CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y -CONFIG_ARCH_MMAP_RND_BITS=11 -CONFIG_ARCH_MMAP_RND_BITS_MAX=17 -CONFIG_ARCH_MMAP_RND_BITS_MIN=11 -CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=17 -CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11 -CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y -CONFIG_ARCH_SPLIT_ARG64=y -CONFIG_ARCH_STACKWALK=y -CONFIG_ARCH_SUSPEND_POSSIBLE=y -CONFIG_ARCH_WEAK_RELEASE_ACQUIRE=y -CONFIG_AUDIT_ARCH=y -# CONFIG_BAMBOO is not set -# CONFIG_BLK_DEV_INITRD is not set -CONFIG_BLK_MQ_PCI=y -CONFIG_BLUESTONE=y -CONFIG_BOOKE=y -CONFIG_BOOKE_OR_40x=y -CONFIG_BOOKE_WDT=y -# CONFIG_CANYONLANDS is not set -CONFIG_CLONE_BACKWARDS=y -CONFIG_CMDLINE="rootfstype=squashfs noinitrd" -CONFIG_CMDLINE_FROM_BOOTLOADER=y -CONFIG_COMMON_CLK=y -CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1 -CONFIG_COMPAT_32BIT_TIME=y -CONFIG_CPU_BIG_ENDIAN=y -CONFIG_CRC16=y -# CONFIG_CRC32_SARWATE is not set -CONFIG_CRC32_SLICEBY8=y -CONFIG_CRYPTO_DEFLATE=y -CONFIG_CRYPTO_JITTERENTROPY=y -CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y -CONFIG_CRYPTO_LIB_POLY1305_RSIZE=1 -CONFIG_CRYPTO_LIB_SHA1=y -CONFIG_CRYPTO_LIB_UTILS=y -CONFIG_CRYPTO_LZO=y -# CONFIG_CRYPTO_MD5_PPC is not set -# CONFIG_CRYPTO_SHA1_PPC is not set -CONFIG_DATA_SHIFT=12 -CONFIG_DMADEVICES=y -CONFIG_DMA_DIRECT_REMAP=y -CONFIG_DMA_ENGINE=y -CONFIG_DMA_OF=y -CONFIG_DTC=y -CONFIG_DW_DMAC=y -CONFIG_DW_DMAC_CORE=y -CONFIG_EARLY_PRINTK=y -# CONFIG_EBONY is not set -CONFIG_EDAC_ATOMIC_SCRUB=y -CONFIG_EDAC_SUPPORT=y -# CONFIG_EIGER is not set -CONFIG_EXCLUSIVE_SYSTEM_RAM=y -CONFIG_EXTRA_TARGETS="uImage" -CONFIG_FIXED_PHY=y -CONFIG_FORCE_PCI=y -# CONFIG_FSL_LBC is not set -CONFIG_FWNODE_MDIO=y -CONFIG_FW_LOADER_PAGED_BUF=y -CONFIG_FW_LOADER_SYSFS=y -CONFIG_GENERIC_ALLOCATOR=y -CONFIG_GENERIC_ATOMIC64=y -CONFIG_GENERIC_BUG=y -CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CMOS_UPDATE=y -CONFIG_GENERIC_CPU_AUTOPROBE=y -CONFIG_GENERIC_EARLY_IOREMAP=y -CONFIG_GENERIC_GETTIMEOFDAY=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_GENERIC_IRQ_SHOW_LEVEL=y -CONFIG_GENERIC_ISA_DMA=y -CONFIG_GENERIC_MSI_IRQ=y -CONFIG_GENERIC_MSI_IRQ_DOMAIN=y -CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_GENERIC_SMP_IDLE_THREAD=y -CONFIG_GENERIC_STRNCPY_FROM_USER=y -CONFIG_GENERIC_STRNLEN_USER=y -CONFIG_GENERIC_TIME_VSYSCALL=y -# CONFIG_GEN_RTC is not set -# CONFIG_GLACIER is not set -CONFIG_GPIO_CDEV=y -CONFIG_GPIO_GENERIC=y -CONFIG_GPIO_GENERIC_PLATFORM=y -CONFIG_HAS_DMA=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT_MAP=y -CONFIG_I2C=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_CHARDEV=y -CONFIG_I2C_IBM_IIC=y -CONFIG_IBM_EMAC=y -CONFIG_IBM_EMAC_EMAC4=y -CONFIG_IBM_EMAC_POLL_WEIGHT=32 -CONFIG_IBM_EMAC_RGMII=y -CONFIG_IBM_EMAC_RXB=128 -CONFIG_IBM_EMAC_RX_COPY_THRESHOLD=256 -CONFIG_IBM_EMAC_TAH=y -CONFIG_IBM_EMAC_TXB=128 -# CONFIG_ICON is not set -CONFIG_ILLEGAL_POINTER_VALUE=0 -CONFIG_IRQCHIP=y -CONFIG_IRQ_DOMAIN=y -CONFIG_IRQ_DOMAIN_HIERARCHY=y -CONFIG_IRQ_FORCED_THREADING=y -CONFIG_IRQ_WORK=y -CONFIG_ISA_DMA_API=y -# CONFIG_JFFS2_FS is not set -# CONFIG_KATMAI is not set -CONFIG_KERNEL_START=0xc0000000 -CONFIG_LEDS_TRIGGER_MTD=y -CONFIG_LEDS_TRIGGER_PATTERN=y -CONFIG_LIBFDT=y -CONFIG_LOCK_DEBUGGING_SUPPORT=y -CONFIG_LOWMEM_SIZE=0x30000000 -# CONFIG_MATH_EMULATION is not set -CONFIG_MDIO_BUS=y -CONFIG_MDIO_DEVICE=y -CONFIG_MDIO_DEVRES=y -CONFIG_MEMFD_CREATE=y -CONFIG_MIGRATION=y -CONFIG_MMU_GATHER_PAGE_SIZE=y -CONFIG_MODULES_USE_ELF_RELA=y -CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS=y -CONFIG_MTD_CFI_ADV_OPTIONS=y -# CONFIG_MTD_CFI_GEOMETRY is not set -# CONFIG_MTD_SPLIT_SQUASHFS_ROOT is not set -CONFIG_NEED_DMA_MAP_STATE=y -CONFIG_NEED_PER_CPU_KM=y -CONFIG_NEED_SG_DMA_LENGTH=y -CONFIG_NET_SELFTESTS=y -CONFIG_NOT_COHERENT_CACHE=y -CONFIG_NO_HZ=y -CONFIG_NO_HZ_COMMON=y -CONFIG_NO_HZ_IDLE=y -CONFIG_NR_CPUS=1 -CONFIG_NR_IRQS=512 -CONFIG_NVMEM=y -CONFIG_NVMEM_SYSFS=y -CONFIG_NVMEM_U_BOOT_ENV=y -CONFIG_OF=y -CONFIG_OF_ADDRESS=y -CONFIG_OF_EARLY_FLATTREE=y -CONFIG_OF_FLATTREE=y -CONFIG_OF_GPIO=y -CONFIG_OF_IRQ=y -CONFIG_OF_KOBJ=y -CONFIG_OF_MDIO=y -CONFIG_OLD_SIGACTION=y -CONFIG_OLD_SIGSUSPEND=y -CONFIG_PACKING=y -CONFIG_PAGE_OFFSET=0xc0000000 -CONFIG_PCI=y -CONFIG_PCIEAER=y -CONFIG_PCIEPORTBUS=y -CONFIG_PCI_DISABLE_COMMON_QUIRKS=y -CONFIG_PCI_DOMAINS=y -CONFIG_PCI_MSI=y -CONFIG_PCI_MSI_ARCH_FALLBACKS=y -CONFIG_PCI_MSI_IRQ_DOMAIN=y -CONFIG_PGTABLE_LEVELS=2 -CONFIG_PHYLIB=y -CONFIG_PHYSICAL_START=0x00000000 -CONFIG_PHYS_64BIT=y -CONFIG_PHYS_ADDR_T_64BIT=y -# CONFIG_PMU_SYSFS is not set -CONFIG_PPC=y -CONFIG_PPC32=y -CONFIG_PPC44x_SIMPLE=y -CONFIG_PPC4xx_GPIO=y -CONFIG_PPC4xx_PCI_EXPRESS=y -# CONFIG_PPC64 is not set -# CONFIG_PPC_47x is not set -# CONFIG_PPC_85xx is not set -# CONFIG_PPC_8xx is not set -CONFIG_PPC_ADV_DEBUG_DACS=2 -CONFIG_PPC_ADV_DEBUG_DAC_RANGE=y -CONFIG_PPC_ADV_DEBUG_DVCS=2 -CONFIG_PPC_ADV_DEBUG_IACS=4 -CONFIG_PPC_ADV_DEBUG_REGS=y -# CONFIG_PPC_BOOK3S_32 is not set -CONFIG_PPC_DCR=y -CONFIG_PPC_DCR_NATIVE=y -# CONFIG_PPC_EARLY_DEBUG is not set -CONFIG_PPC_FPU=y -CONFIG_PPC_FPU_REGS=y -CONFIG_PPC_INDIRECT_PCI=y -CONFIG_PPC_KUAP=y -# CONFIG_PPC_KUAP_DEBUG is not set -CONFIG_PPC_KUEP=y -CONFIG_PPC_MMU_NOHASH=y -CONFIG_PPC_PAGE_SHIFT=12 -# CONFIG_PPC_PCI_BUS_NUM_DOMAIN_DEPENDENT is not set -CONFIG_PPC_UDBG_16550=y -CONFIG_PPC_WERROR=y -CONFIG_PTE_64BIT=y -CONFIG_PTP_1588_CLOCK_OPTIONAL=y -# CONFIG_RAINIER is not set -CONFIG_RAS=y -CONFIG_RATIONAL=y -CONFIG_REGULATOR=y -CONFIG_RSEQ=y -# CONFIG_SAM440EP is not set -# CONFIG_SCOM_DEBUGFS is not set -# CONFIG_SEQUOIA is not set -# CONFIG_SERIAL_8250_FSL is not set -CONFIG_SERIAL_MCTRL_GPIO=y -CONFIG_SERIAL_OF_PLATFORM=y -CONFIG_SGL_ALLOC=y -CONFIG_SPARSE_IRQ=y -CONFIG_SRCU=y -# CONFIG_STATIC_CALL_SELFTEST is not set -CONFIG_SWPHY=y -CONFIG_SYSCTL_EXCEPTION_TRACE=y -# CONFIG_TAISHAN is not set -CONFIG_TARGET_CPU="464" -CONFIG_TARGET_CPU_BOOL=y -CONFIG_TASK_SIZE=0xc0000000 -CONFIG_THREAD_INFO_IN_TASK=y -CONFIG_THREAD_SHIFT=13 -CONFIG_TICK_CPU_ACCOUNTING=y -CONFIG_TINY_SRCU=y -# CONFIG_TOOLCHAIN_DEFAULT_CPU is not set -CONFIG_USB_SUPPORT=y -CONFIG_VDSO32=y -# CONFIG_VIRTIO_MENU is not set -# CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set -# CONFIG_WARP is not set -CONFIG_WATCHDOG_CORE=y -CONFIG_XZ_DEC_BCJ=y -CONFIG_XZ_DEC_POWERPC=y -# CONFIG_YOSEMITE is not set -CONFIG_ZLIB_DEFLATE=y -CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/apm821xx/patches-6.1/201-add-amcc-apollo3g-support.patch b/target/linux/apm821xx/patches-6.1/201-add-amcc-apollo3g-support.patch deleted file mode 100644 index d26e74dfb7..0000000000 --- a/target/linux/apm821xx/patches-6.1/201-add-amcc-apollo3g-support.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- a/arch/powerpc/platforms/44x/Kconfig -+++ b/arch/powerpc/platforms/44x/Kconfig -@@ -118,6 +118,17 @@ config CANYONLANDS - help - This option enables support for the AMCC PPC460EX evaluation board. - -+config APOLLO3G -+ bool "Apollo3G" -+ depends on 44x -+ default n -+ select PPC44x_SIMPLE -+ select APM821xx -+ select IBM_EMAC_RGMII -+ select 460EX -+ help -+ This option enables support for the AMCC Apollo 3G board. -+ - config GLACIER - bool "Glacier" - depends on 44x ---- a/arch/powerpc/platforms/44x/ppc44x_simple.c -+++ b/arch/powerpc/platforms/44x/ppc44x_simple.c -@@ -46,6 +46,7 @@ machine_device_initcall(ppc44x_simple, p - * board.c file for it rather than adding it to this list. - */ - static char *board[] __initdata = { -+ "amcc,apollo3g", - "amcc,arches", - "amcc,bamboo", - "apm,bluestone", diff --git a/target/linux/apm821xx/patches-6.1/300-fix-atheros-nics-on-apm82181.patch b/target/linux/apm821xx/patches-6.1/300-fix-atheros-nics-on-apm82181.patch deleted file mode 100644 index 706f86d0cf..0000000000 --- a/target/linux/apm821xx/patches-6.1/300-fix-atheros-nics-on-apm82181.patch +++ /dev/null @@ -1,51 +0,0 @@ ---- a/arch/powerpc/platforms/4xx/pci.c -+++ b/arch/powerpc/platforms/4xx/pci.c -@@ -1061,15 +1061,24 @@ static int __init apm821xx_pciex_init_po - u32 val; - - /* -- * Do a software reset on PCIe ports. -- * This code is to fix the issue that pci drivers doesn't re-assign -- * bus number for PCIE devices after Uboot -- * scanned and configured all the buses (eg. PCIE NIC IntelPro/1000 -- * PT quad port, SAS LSI 1064E) -+ * Only reset the PHY when no link is currently established. -+ * This is for the Atheros PCIe board which has problems to establish -+ * the link (again) after this PHY reset. All other currently tested -+ * PCIe boards don't show this problem. - */ -- -- mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x0); -- mdelay(10); -+ val = mfdcri(SDR0, port->sdr_base + PESDRn_LOOP); -+ if (!(val & 0x00001000)) { -+ /* -+ * Do a software reset on PCIe ports. -+ * This code is to fix the issue that pci drivers doesn't re-assign -+ * bus number for PCIE devices after Uboot -+ * scanned and configured all the buses (eg. PCIE NIC IntelPro/1000 -+ * PT quad port, SAS LSI 1064E) -+ */ -+ -+ mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x0); -+ mdelay(10); -+ } - - if (port->endpoint) - val = PTYPE_LEGACY_ENDPOINT << 20; -@@ -1086,9 +1095,12 @@ static int __init apm821xx_pciex_init_po - mtdcri(SDR0, PESDR0_460EX_L0DRV, 0x00000130); - mtdcri(SDR0, PESDR0_460EX_L0CLK, 0x00000006); - -- mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x10000000); -- mdelay(50); -- mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x30000000); -+ val = mfdcri(SDR0, port->sdr_base + PESDRn_LOOP); -+ if (!(val & 0x00001000)) { -+ mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x10000000); -+ mdelay(50); -+ mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x30000000); -+ } - - mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET, - mfdcri(SDR0, port->sdr_base + PESDRn_RCSSET) | diff --git a/target/linux/apm821xx/patches-6.1/301-fix-memory-map-wndr4700.patch b/target/linux/apm821xx/patches-6.1/301-fix-memory-map-wndr4700.patch deleted file mode 100644 index 0c9fb370f1..0000000000 --- a/target/linux/apm821xx/patches-6.1/301-fix-memory-map-wndr4700.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/arch/powerpc/platforms/4xx/pci.c -+++ b/arch/powerpc/platforms/4xx/pci.c -@@ -1903,9 +1903,9 @@ static void __init ppc4xx_configure_pcie - * if it works - */ - out_le32(mbase + PECFG_PIM0LAL, 0x00000000); -- out_le32(mbase + PECFG_PIM0LAH, 0x00000000); -+ out_le32(mbase + PECFG_PIM0LAH, 0x00000008); - out_le32(mbase + PECFG_PIM1LAL, 0x00000000); -- out_le32(mbase + PECFG_PIM1LAH, 0x00000000); -+ out_le32(mbase + PECFG_PIM1LAH, 0x0000000c); - out_le32(mbase + PECFG_PIM01SAH, 0xffff0000); - out_le32(mbase + PECFG_PIM01SAL, 0x00000000); - diff --git a/target/linux/apm821xx/patches-6.1/900-powerpc-bootwrapper-force-gzip-as-mkimage-s-compress.patch b/target/linux/apm821xx/patches-6.1/900-powerpc-bootwrapper-force-gzip-as-mkimage-s-compress.patch deleted file mode 100644 index 292a252a2e..0000000000 --- a/target/linux/apm821xx/patches-6.1/900-powerpc-bootwrapper-force-gzip-as-mkimage-s-compress.patch +++ /dev/null @@ -1,29 +0,0 @@ -From c9395ad54e2cabb87d408becc37566f3d8248933 Mon Sep 17 00:00:00 2001 -From: Christian Lamparter -Date: Sun, 1 Dec 2019 02:08:23 +0100 -Subject: [PATCH] powerpc: bootwrapper: force gzip as mkimage's compression - method - -Due to CONFIG_KERNEL_XZ symbol, the bootwrapper code tries to -instruct the mkimage to use the xz compression, which isn't -supported. This patch forces the gzip compression, which is -supported and doesn't matter because the generated uImage for -the apm821xx target gets ignored as the OpenWrt toolchain will -do separate U-Boot kernel images for each device individually. - -Signed-off-by: Christian Lamparter ---- - arch/powerpc/boot/Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/arch/powerpc/boot/Makefile -+++ b/arch/powerpc/boot/Makefile -@@ -274,7 +274,7 @@ compressor-$(CONFIG_KERNEL_LZO) := lzo - - # args (to if_changed): 1 = (this rule), 2 = platform, 3 = dts 4=dtb 5=initrd - quiet_cmd_wrap = WRAP $@ -- cmd_wrap =$(CONFIG_SHELL) $(wrapper) -Z $(compressor-y) -c -o $@ -p $2 \ -+ cmd_wrap =$(CONFIG_SHELL) $(wrapper) -Z gzip -c -o $@ -p $2 \ - $(CROSSWRAP) $(if $3, -s $3)$(if $4, -d $4)$(if $5, -i $5) \ - vmlinux - From cef30e225d366b9f48eef20eb57773b981dbbdea Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Fri, 14 Jun 2024 17:05:47 +0200 Subject: [PATCH 05/27] uml: define "generic" subtarget UML didn't have a subtarget defined. While this compiled fine, the patch caused funny filenames for the generated files to appear: - "openwrt-uml--vmlinux" - "openwrt-uml--squashfs.img" - "openwrt-uml--ext4.img" - ... since "generic" is implied anyway, let's just set it. Fixes: d997477775bf ("treewide: remove implicit SUBTARGET") Signed-off-by: Christian Lamparter Link: https://github.com/openwrt/openwrt/pull/15713 Signed-off-by: Christian Marangi --- target/linux/uml/Makefile | 1 + target/linux/uml/README.md | 2 +- target/linux/uml/generic/target.mk | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 target/linux/uml/generic/target.mk diff --git a/target/linux/uml/Makefile b/target/linux/uml/Makefile index 307687ffda..cad5d0f3d3 100644 --- a/target/linux/uml/Makefile +++ b/target/linux/uml/Makefile @@ -12,6 +12,7 @@ ARCH:=x86_64 BOARD:=uml BOARDNAME:=User Mode Linux FEATURES:=audio ext4 rootfs-part squashfs +SUBTARGETS:=generic KERNEL_PATCHVER:=6.1 KERNEL_TESTING_PATCHVER:=6.6 diff --git a/target/linux/uml/README.md b/target/linux/uml/README.md index 9275f9891b..ffdd2f0fe7 100644 --- a/target/linux/uml/README.md +++ b/target/linux/uml/README.md @@ -20,7 +20,7 @@ In your bin directory you will find a Kernel and an root file system when it's finished. Just run it like this:- ```shell -./openwrt-uml-vmlinux ubd0=openwrt-uml-squashfs.img +./openwrt-uml-generic-vmlinux ubd0=openwrt-uml-generic-squashfs.img ``` The uml will start and eventually the serial console of the uml will be at your diff --git a/target/linux/uml/generic/target.mk b/target/linux/uml/generic/target.mk new file mode 100644 index 0000000000..f5cb1fb19b --- /dev/null +++ b/target/linux/uml/generic/target.mk @@ -0,0 +1 @@ +BOARDNAME:=Generic From 85f6deb4e86366fb8d761e8c750e86b8a44d77c5 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Sun, 2 Jun 2024 15:56:56 +0200 Subject: [PATCH 06/27] uml: switch to 6.6 kernel Switch the uml target to kernel 6.6. Signed-off-by: Christian Lamparter Link: https://github.com/openwrt/openwrt/pull/15713 Signed-off-by: Christian Marangi --- target/linux/uml/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/linux/uml/Makefile b/target/linux/uml/Makefile index cad5d0f3d3..00f19fce5b 100644 --- a/target/linux/uml/Makefile +++ b/target/linux/uml/Makefile @@ -14,8 +14,7 @@ BOARDNAME:=User Mode Linux FEATURES:=audio ext4 rootfs-part squashfs SUBTARGETS:=generic -KERNEL_PATCHVER:=6.1 -KERNEL_TESTING_PATCHVER:=6.6 +KERNEL_PATCHVER:=6.6 include $(INCLUDE_DIR)/target.mk From 9328817e75bd10507eb1385ca04a2af9bd971985 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Sun, 2 Jun 2024 15:58:40 +0200 Subject: [PATCH 07/27] uml: drop 6.1 kernel support files Drop config+patches for kernel 6.1. Signed-off-by: Christian Lamparter Link: https://github.com/openwrt/openwrt/pull/15713 Signed-off-by: Christian Marangi --- target/linux/uml/config-6.1 | 150 ------------ .../uml/patches-6.1/101-mconsole-exec.patch | 213 ------------------ .../patches-6.1/102-pseudo-random-mac.patch | 151 ------------- 3 files changed, 514 deletions(-) delete mode 100644 target/linux/uml/config-6.1 delete mode 100644 target/linux/uml/patches-6.1/101-mconsole-exec.patch delete mode 100644 target/linux/uml/patches-6.1/102-pseudo-random-mac.patch diff --git a/target/linux/uml/config-6.1 b/target/linux/uml/config-6.1 deleted file mode 100644 index da4eaac3ac..0000000000 --- a/target/linux/uml/config-6.1 +++ /dev/null @@ -1,150 +0,0 @@ -CONFIG_3_LEVEL_PGTABLES=y -CONFIG_64BIT=y -CONFIG_ARCH_DMA_ADDR_T_64BIT=y -CONFIG_ARCH_EPHEMERAL_INODES=y -CONFIG_ARCH_NO_PREEMPT=y -CONFIG_ARCH_SUSPEND_POSSIBLE=y -CONFIG_BLK_DEV_COW_COMMON=y -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_UBD=y -CONFIG_BLK_DEV_UBD_SYNC=y -CONFIG_BLK_MQ_VIRTIO=y -CONFIG_CDROM=y -# CONFIG_COMMON_CLK is not set -CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1 -# CONFIG_COMPAT_32BIT_TIME is not set -CONFIG_CON_CHAN="xterm" -CONFIG_CON_ZERO_CHAN="fd:0,fd:1" -CONFIG_CPU_SUP_AMD=y -CONFIG_CPU_SUP_CENTAUR=y -CONFIG_CPU_SUP_HYGON=y -CONFIG_CPU_SUP_INTEL=y -CONFIG_CPU_SUP_ZHAOXIN=y -CONFIG_CRC16=y -CONFIG_CRYPTO_CRC32=y -CONFIG_CRYPTO_CRC32C=y -CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y -CONFIG_CRYPTO_LIB_POLY1305_RSIZE=11 -CONFIG_CRYPTO_LIB_SHA1=y -CONFIG_CRYPTO_LIB_UTILS=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_SHA1=y -CONFIG_DCACHE_WORD_ACCESS=y -CONFIG_DECOMPRESS_BZIP2=y -CONFIG_DECOMPRESS_GZIP=y -CONFIG_DNOTIFY=y -# CONFIG_EARLY_PRINTK is not set -CONFIG_EXCLUSIVE_SYSTEM_RAM=y -CONFIG_EXT4_FS=y -CONFIG_F2FS_FS=y -CONFIG_FAILOVER=y -CONFIG_FS_IOMAP=y -CONFIG_FS_MBCACHE=y -CONFIG_FW_LOADER_PAGED_BUF=y -CONFIG_FW_LOADER_SYSFS=y -CONFIG_GCC11_NO_ARRAY_BOUNDS=y -CONFIG_GENERIC_CLOCKEVENTS=y -# CONFIG_GENERIC_CPU is not set -CONFIG_GENERIC_CPU_DEVICES=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_GPIO_CDEV=y -CONFIG_HOSTFS=y -CONFIG_HVC_DRIVER=y -CONFIG_HW_RANDOM=y -CONFIG_HZ_PERIODIC=y -CONFIG_IA32_FEAT_CTL=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_INIT_ENV_ARG_LIMIT=128 -CONFIG_IRQ_WORK=y -CONFIG_ISO9660_FS=y -CONFIG_JBD2=y -# CONFIG_JFFS2_FS is not set -CONFIG_KALLSYMS=y -CONFIG_KERNEL_STACK_ORDER=2 -CONFIG_LOCK_DEBUGGING_SUPPORT=y -# CONFIG_MATOM is not set -CONFIG_MAY_HAVE_RUNTIME_DEPS=y -CONFIG_MCONSOLE=y -# CONFIG_MCORE2 is not set -CONFIG_MEMFD_CREATE=y -CONFIG_MIGRATION=y -CONFIG_MK8=y -# CONFIG_MMAPPER is not set -CONFIG_MODULES_USE_ELF_RELA=y -# CONFIG_MPSC is not set -CONFIG_NAMESPACES=y -CONFIG_NEED_PER_CPU_KM=y -CONFIG_NET_FAILOVER=y -# CONFIG_NET_NS is not set -CONFIG_NLS=y -CONFIG_NO_DMA=y -CONFIG_NO_IOMEM=y -CONFIG_NO_IOPORT_MAP=y -CONFIG_NR_CPUS=1 -CONFIG_NULL_CHAN=y -# CONFIG_OF is not set -CONFIG_PGTABLE_LEVELS=3 -CONFIG_PHYS_ADDR_T_64BIT=y -CONFIG_PORT_CHAN=y -CONFIG_POSIX_MQUEUE=y -CONFIG_POSIX_MQUEUE_SYSCTL=y -CONFIG_PREEMPT_NONE_BUILD=y -# CONFIG_PROCESSOR_SELECT is not set -CONFIG_PROC_PAGE_MONITOR=y -CONFIG_PTP_1588_CLOCK_OPTIONAL=y -CONFIG_PTY_CHAN=y -CONFIG_RANDSTRUCT_NONE=y -CONFIG_RD_BZIP2=y -CONFIG_RD_GZIP=y -CONFIG_RELAY=y -CONFIG_SG_POOL=y -CONFIG_SOFT_WATCHDOG=m -CONFIG_SRCU=y -CONFIG_SSL=y -CONFIG_SSL_CHAN="pty" -CONFIG_STACKTRACE=y -CONFIG_STDERR_CONSOLE=y -CONFIG_TICK_CPU_ACCOUNTING=y -CONFIG_TINY_SRCU=y -CONFIG_TTY_CHAN=y -CONFIG_UML=y -CONFIG_UML_NET=y -CONFIG_UML_NET_DAEMON=y -CONFIG_UML_NET_DAEMON_DEFAULT_SOCK="/tmp/uml.ctl" -CONFIG_UML_NET_DETERMINISTIC_MAC=y -CONFIG_UML_NET_ETHERTAP=y -CONFIG_UML_NET_MCAST=y -# CONFIG_UML_NET_PCAP is not set -CONFIG_UML_NET_SLIP=y -CONFIG_UML_NET_SLIRP=y -CONFIG_UML_NET_TUNTAP=y -# CONFIG_UML_NET_VDE is not set -CONFIG_UML_NET_VECTOR=y -# CONFIG_UML_PCI_OVER_VIRTIO is not set -CONFIG_UML_RANDOM=y -# CONFIG_UML_SOUND is not set -CONFIG_UML_TIME_TRAVEL_SUPPORT=y -# CONFIG_UML_WATCHDOG is not set -CONFIG_UML_X86=y -# CONFIG_USER_NS is not set -CONFIG_VIRTIO=y -CONFIG_VIRTIO_ANCHOR=y -CONFIG_VIRTIO_BLK=y -CONFIG_VIRTIO_CONSOLE=y -CONFIG_VIRTIO_NET=y -CONFIG_VIRTIO_UML=y -CONFIG_VMAP_STACK=y -CONFIG_VM_EVENT_COUNTERS=y -CONFIG_WATCHDOG_CORE=y -CONFIG_X86_64=y -CONFIG_X86_CMOV=y -CONFIG_X86_CMPXCHG64=y -CONFIG_X86_INTEL_USERCOPY=y -CONFIG_X86_INTERNODE_CACHE_SHIFT=6 -CONFIG_X86_L1_CACHE_SHIFT=6 -CONFIG_X86_MINIMUM_CPU_FAMILY=64 -CONFIG_X86_TSC=y -CONFIG_X86_USE_PPRO_CHECKSUM=y -CONFIG_XTERM_CHAN=y -CONFIG_XTERM_CHAN_DEFAULT_EMULATOR="xterm" -CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/uml/patches-6.1/101-mconsole-exec.patch b/target/linux/uml/patches-6.1/101-mconsole-exec.patch deleted file mode 100644 index 2ff9701eb9..0000000000 --- a/target/linux/uml/patches-6.1/101-mconsole-exec.patch +++ /dev/null @@ -1,213 +0,0 @@ -# -# Minimalist mconsole exec patch -# -# 3.10 version (with bit more synchronous behavior) by fingon at iki dot fi -# Adaptation to kernel 3.3.8 made by David Fernández (david at dit.upm.es) for -# Starting point: mconsole-exec-2.6.30.patch for kernel 2.6.30 -# Author of original patch: Paolo Giarrusso, aka Blaisorblade -# (http://www.user-mode-linux.org/~blaisorblade) -# -# Known misfeatures: -# -# - If output is too long, blocks (and breaks horribly) -# (this misfeature from 3.10 patches, when minimalizing the patch; -# workaround: redirect to a shared filesystem if long output is expected) -# -# - Nothing useful is done with stdin -# ---- a/arch/um/drivers/mconsole.h -+++ b/arch/um/drivers/mconsole.h -@@ -85,6 +85,7 @@ extern void mconsole_cad(struct mc_reque - extern void mconsole_stop(struct mc_request *req); - extern void mconsole_go(struct mc_request *req); - extern void mconsole_log(struct mc_request *req); -+extern void mconsole_exec(struct mc_request *req); - extern void mconsole_proc(struct mc_request *req); - extern void mconsole_stack(struct mc_request *req); - ---- a/arch/um/drivers/mconsole_kern.c -+++ b/arch/um/drivers/mconsole_kern.c -@@ -4,6 +4,7 @@ - * Copyright (C) 2001 - 2008 Jeff Dike (jdike@{addtoit,linux.intel}.com) - */ - -+#include - #include - #include - #include -@@ -27,6 +28,7 @@ - #include - #include - #include -+#include - #include - - #include -@@ -124,6 +126,59 @@ void mconsole_log(struct mc_request *req - mconsole_reply(req, "", 0, 0); - } - -+void mconsole_exec(struct mc_request *req) -+{ -+ struct subprocess_info *sub_info; -+ int res, len; -+ struct file *out; -+ char buf[MCONSOLE_MAX_DATA]; -+ -+ char *envp[] = { -+ "HOME=/", "TERM=linux", -+ "PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin", -+ NULL -+ }; -+ char *argv[] = { -+ "/bin/sh", "-c", -+ req->request.data + strlen("exec "), -+ NULL -+ }; -+ -+ sub_info = call_usermodehelper_setup("/bin/sh", argv, envp, GFP_ATOMIC, NULL, NULL, NULL); -+ if (sub_info == NULL) { -+ mconsole_reply(req, "call_usermodehelper_setup failed", 1, 0); -+ return; -+ } -+ res = call_usermodehelper_stdoutpipe(sub_info, &out); -+ if (res < 0) { -+ kfree(sub_info); -+ mconsole_reply(req, "call_usermodehelper_stdoutpipe failed", 1, 0); -+ return; -+ } -+ -+ res = call_usermodehelper_exec(sub_info, UMH_WAIT_PROC); -+ if (res < 0) { -+ kfree(sub_info); -+ mconsole_reply(req, "call_usermodehelper_exec failed", 1, 0); -+ return; -+ } -+ -+ for (;;) { -+ len = out->f_op->read(out, buf, sizeof(buf), &out->f_pos); -+ if (len < 0) { -+ mconsole_reply(req, "reading output failed", 1, 0); -+ break; -+ } -+ if (len == 0) -+ break; -+ mconsole_reply_len(req, buf, len, 0, 1); -+ } -+ fput(out); -+ -+ mconsole_reply_len(req, NULL, 0, 0, 0); -+} -+ -+ - void mconsole_proc(struct mc_request *req) - { - struct vfsmount *mnt = proc_mnt; -@@ -190,6 +245,7 @@ void mconsole_proc(struct mc_request *re - stop - pause the UML; it will do nothing until it receives a 'go' \n\ - go - continue the UML after a 'stop' \n\ - log - make UML enter into the kernel log\n\ -+ exec - pass to /bin/sh -c synchronously\n\ - proc - returns the contents of the UML's /proc/\n\ - stack - returns the stack of the specified pid\n\ - " ---- a/arch/um/drivers/mconsole_user.c -+++ b/arch/um/drivers/mconsole_user.c -@@ -30,6 +30,7 @@ static struct mconsole_command commands[ - { "stop", mconsole_stop, MCONSOLE_PROC }, - { "go", mconsole_go, MCONSOLE_INTR }, - { "log", mconsole_log, MCONSOLE_INTR }, -+ { "exec", mconsole_exec, MCONSOLE_PROC }, - { "proc", mconsole_proc, MCONSOLE_PROC }, - { "stack", mconsole_stack, MCONSOLE_INTR }, - }; ---- a/arch/um/os-Linux/file.c -+++ b/arch/um/os-Linux/file.c -@@ -560,6 +560,8 @@ int os_create_unix_socket(const char *fi - - addr.sun_family = AF_UNIX; - -+ if (len > sizeof(addr.sun_path)) -+ len = sizeof(addr.sun_path); - snprintf(addr.sun_path, len, "%s", file); - - err = bind(sock, (struct sockaddr *) &addr, sizeof(addr)); ---- a/include/linux/kmod.h -+++ b/include/linux/kmod.h -@@ -32,4 +32,6 @@ static inline int request_module_nowait( - #define try_then_request_module(x, mod...) (x) - #endif - -+int call_usermodehelper_stdoutpipe(struct subprocess_info *sub_info, struct file **filp); -+ - #endif /* __LINUX_KMOD_H__ */ ---- a/include/linux/umh.h -+++ b/include/linux/umh.h -@@ -23,6 +23,7 @@ struct subprocess_info { - const char *path; - char **argv; - char **envp; -+ struct file *stdout; - int wait; - int retval; - int (*init)(struct subprocess_info *info, struct cred *new); ---- a/kernel/umh.c -+++ b/kernel/umh.c -@@ -29,6 +29,7 @@ - #include - #include - #include -+#include - - #include - -@@ -74,6 +75,28 @@ static int call_usermodehelper_exec_asyn - flush_signal_handlers(current, 1); - spin_unlock_irq(¤t->sighand->siglock); - -+ /* Install output when needed */ -+ if (sub_info->stdout) { -+ struct files_struct *f = current->files; -+ struct fdtable *fdt; -+ -+ sys_close(1); -+ sys_close(2); -+ get_file(sub_info->stdout); -+ fd_install(1, sub_info->stdout); -+ fd_install(2, sub_info->stdout); -+ spin_lock(&f->file_lock); -+ fdt = files_fdtable(f); -+ __set_bit(1, fdt->open_fds); -+ __clear_bit(1, fdt->close_on_exec); -+ __set_bit(2, fdt->open_fds); -+ __clear_bit(2, fdt->close_on_exec); -+ spin_unlock(&f->file_lock); -+ -+ /* disallow core files */ -+ current->signal->rlim[RLIMIT_CORE] = (struct rlimit){0, 0}; -+ } -+ - /* - * Initial kernel threads share ther FS with init, in order to - * get the init root directory. But we've now created a new -@@ -333,6 +356,20 @@ static void helper_unlock(void) - wake_up(&running_helpers_waitq); - } - -+int call_usermodehelper_stdoutpipe(struct subprocess_info *sub_info, -+ struct file **filp) -+{ -+ struct file *f[2]; -+ -+ if (create_pipe_files(f, 0) < 0) -+ return PTR_ERR(f); -+ -+ sub_info->stdout = f[1]; -+ *filp = f[0]; -+ return 0; -+} -+EXPORT_SYMBOL(call_usermodehelper_stdoutpipe); -+ - /** - * call_usermodehelper_setup - prepare to call a usermode helper - * @path: path to usermode executable diff --git a/target/linux/uml/patches-6.1/102-pseudo-random-mac.patch b/target/linux/uml/patches-6.1/102-pseudo-random-mac.patch deleted file mode 100644 index d2dc7516e6..0000000000 --- a/target/linux/uml/patches-6.1/102-pseudo-random-mac.patch +++ /dev/null @@ -1,151 +0,0 @@ -=============================================================================== - -This patch makes MAC addresses of network interfaces predictable. In -particular, it adds a small routine that computes MAC addresses of based on -a SHA1 hash of the virtual machine name and interface ID. - -TECHNICAL INFORMATION: - -Applies to vanilla kernel 3.9.4. - -=============================================================================== ---- a/arch/um/drivers/Kconfig -+++ b/arch/um/drivers/Kconfig -@@ -143,6 +143,20 @@ config UML_NET - enable at least one of the following transport options to actually - make use of UML networking. - -+config UML_NET_DETERMINISTIC_MAC -+ bool "Use deterministic MAC addresses for network interfaces" -+ default y -+ depends on UML_NET -+ select CRYPTO_SHA1 -+ help -+ Virtual network devices inside a User-Mode Linux instance must be -+ assigned a MAC (Ethernet) address. If none is specified on the UML -+ command line, one must be automatically computed. If this option is -+ enabled, a randomly generated address is used. Otherwise, if this -+ option is disabled, the address is generated from a SHA1 hash of -+ the umid of the UML instance and the interface name. The latter choice -+ is useful to make MAC addresses predictable. -+ - config UML_NET_ETHERTAP - bool "Ethertap transport (obsolete)" - depends on UML_NET ---- a/arch/um/drivers/net_kern.c -+++ b/arch/um/drivers/net_kern.c -@@ -25,6 +25,14 @@ - #include - #include - -+#include -+#include -+#include -+#include -+#include -+#include -+#include "os.h" -+ - #define DRIVER_NAME "uml-netdev" - - static DEFINE_SPINLOCK(opened_lock); -@@ -274,9 +282,55 @@ static const struct ethtool_ops uml_net_ - .get_ts_info = ethtool_op_get_ts_info, - }; - -+#ifdef CONFIG_UML_NET_DETERMINISTIC_MAC -+ -+/* Compute a SHA1 hash of the UML instance's id and -+ * * an interface name. */ -+static int compute_hash(const char *umid, const char *ifname, char *hash) -+{ -+ struct ahash_request *desc = NULL; -+ struct crypto_ahash *tfm = NULL; -+ struct scatterlist sg; -+ char *vmif = NULL; -+ int ret = -ENOMEM; -+ -+ vmif = kmalloc(1024, GFP_KERNEL); -+ if (!vmif) -+ goto out; -+ -+ strcpy (vmif, umid); -+ strcat (vmif, ifname); -+ -+ tfm = crypto_alloc_ahash("sha1", 0, CRYPTO_ALG_ASYNC); -+ if (IS_ERR(tfm)) -+ goto out; -+ -+ desc = ahash_request_alloc(tfm, GFP_KERNEL); -+ if (!desc) -+ goto out; -+ -+ crypto_ahash_clear_flags(tfm, ~0); -+ -+ sg_init_table(&sg, 1); -+ sg_set_buf(&sg, vmif, strlen(vmif)); -+ -+ ahash_request_set_crypt(desc, &sg, hash, strlen(vmif)); -+ -+ ret = crypto_ahash_digest(desc); -+out: -+ crypto_free_ahash(tfm); -+ ahash_request_free(desc); -+ kfree(vmif); -+ -+ return ret; -+} -+ -+#endif -+ - void uml_net_setup_etheraddr(struct net_device *dev, char *str) - { - u8 addr[ETH_ALEN]; -+ u8 hash[SHA1_DIGEST_SIZE]; - char *end; - int i; - -@@ -320,9 +374,26 @@ void uml_net_setup_etheraddr(struct net_ - return; - - random: -+#ifndef CONFIG_UML_NET_DETERMINISTIC_MAC - printk(KERN_INFO - "Choosing a random ethernet address for device %s\n", dev->name); - eth_hw_addr_random(dev); -+#else -+ printk(KERN_INFO -+ "Computing a digest to use as ethernet address for device %s\n", dev->name); -+ if (compute_hash(get_umid(), dev->name, hash) < 0) { -+ printk(KERN_WARNING -+ "Could not compute digest to use as ethernet address for device %s. " -+ "Using random address instead.\n", dev->name); -+ eth_random_addr(addr); -+ } -+ else { -+ for (i=0; i < 6; i++) -+ addr[i] = (hash[i] + hash[i+6]) % 0x100; -+ } -+ addr [0] &= 0xfe; /* clear multicast bit */ -+ addr [0] |= 0x02; /* set local assignment bit (IEEE802) */ -+#endif - } - - static DEFINE_SPINLOCK(devices_lock); ---- a/kernel/umh.c -+++ b/kernel/umh.c -@@ -357,12 +357,12 @@ static void helper_unlock(void) - } - - int call_usermodehelper_stdoutpipe(struct subprocess_info *sub_info, -- struct file **filp) -+ struct file **filp) - { - struct file *f[2]; - - if (create_pipe_files(f, 0) < 0) -- return PTR_ERR(f); -+ return PTR_ERR(f); - - sub_info->stdout = f[1]; - *filp = f[0]; From 76c863fe607d7f457f6d1e9ca26f634383fb5f57 Mon Sep 17 00:00:00 2001 From: Carlos Miguel Ferreira Date: Wed, 12 Jun 2024 01:20:59 +0100 Subject: [PATCH 08/27] libquadmath: Add libquadmath to the toolchain This commit makes the libquadmath library available to the GCC toolchain. This library is important for libraries such as Boost.charconv Signed-off-by: Carlos Miguel Ferreira Link: https://github.com/openwrt/openwrt/pull/15637 Signed-off-by: Christian Marangi --- package/libs/toolchain/Makefile | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/package/libs/toolchain/Makefile b/package/libs/toolchain/Makefile index 3dd844d65b..7c117b144d 100644 --- a/package/libs/toolchain/Makefile +++ b/package/libs/toolchain/Makefile @@ -83,6 +83,33 @@ define Package/libatomic/config endmenu endef +define Package/libquadmath +$(call Package/gcc/Default) + DEPENDS:=@TARGET_x86||TARGET_x86_64 +libgcc + TITLE:=Quadmath support library + ABI_VERSION:=1 +endef + +define Package/libquadmath/config + menu "Configuration" + depends on EXTERNAL_TOOLCHAIN && PACKAGE_libquadmath + + config LIBQUADMATH_ROOT_DIR + string + prompt "libquadmath shared library base directory" + depends on EXTERNAL_TOOLCHAIN && PACKAGE_libquadmath + default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN + default "/" if NATIVE_TOOLCHAIN + + config LIBQUADMATH_FILE_SPEC + string + prompt "libquadmath shared library files (use wildcards)" + depends on EXTERNAL_TOOLCHAIN && PACKAGE_libquadmath + default "./lib/libquadmath.so.*" + + endmenu +endef + define Package/libstdcpp $(call Package/gcc/Default) NAME:=libstdc++ @@ -485,6 +512,11 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) $(CP) $(TOOLCHAIN_DIR)/lib/libatomic.so.* $(1)/lib/ endef + define Package/libquadmath/install + $(INSTALL_DIR) $(1)/lib + $(CP) $(TOOLCHAIN_DIR)/lib/libquadmath.so.* $(1)/lib/ + endef + define Package/libgfortran/install $(INSTALL_DIR) $(1)/usr/lib $(CP) $(TOOLCHAIN_DIR)/lib/libgfortran.so.* $(1)/usr/lib/ @@ -705,6 +737,14 @@ else exit 0 endef + define Package/libquadmath/install + for file in $(call qstrip,$(CONFIG_LIBQUADMATH_FILE_SPEC)); do \ + $(INSTALL_DIR) $(1)/lib ; \ + $(CP) $(call qstrip,$(CONFIG_LIBQUADMATH_ROOT_DIR))/$$$$file $(1)/lib/ ; \ + done ; \ + exit 0 + endef + define Package/libgomp/install for file in $(call qstrip,$(CONFIG_LIBGOMP_FILE_SPEC)); do \ $(INSTALL_DIR) $(1)/lib ; \ @@ -736,6 +776,7 @@ endif $(eval $(call BuildPackage,libc)) $(eval $(call BuildPackage,libgcc)) $(eval $(call BuildPackage,libatomic)) +$(eval $(call BuildPackage,libquadmath)) $(eval $(call BuildPackage,libstdcpp)) $(eval $(call BuildPackage,libasan)) $(eval $(call BuildPackage,libtsan)) From 8cad52a267bffe384a119f3e5ae1892e8580a981 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Mon, 17 Jun 2024 13:19:52 +0200 Subject: [PATCH 09/27] scripts/ext-toolchain: add missing libc library specs Add missing libc library spec that weren't added to the ext-toolchain script when the library were introduced in the packages libs toolchain Makefile. Signed-off-by: Christian Marangi --- scripts/ext-toolchain.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/ext-toolchain.sh b/scripts/ext-toolchain.sh index 1fa2e952bb..e49c011118 100755 --- a/scripts/ext-toolchain.sh +++ b/scripts/ext-toolchain.sh @@ -41,6 +41,12 @@ LIB_SPECS=" ssp: libssp gfortran: libgfortran gomp: libgomp + atomic: libatomic + quadmath: libquadmath + asan: libasan + tasan: libtsan + lasan: liblsan + ubasan: libubsan " # Binary specs @@ -405,7 +411,7 @@ print_config() { fi local lib - for lib in C RT PTHREAD GCC STDCPP SSP GFORTRAN GOMP; do + for lib in C RT PTHREAD GCC STDCPP SSP GFORTRAN GOMP ATOMIC QUADMATH ASAN TSAN LSAN UBSAN; do local file local spec="" local llib="$(echo "$lib" | sed -e 's#.*#\L&#')" From f3080677f506d2670c1911a91c19eec4ace5d085 Mon Sep 17 00:00:00 2001 From: Konstantin Demin Date: Thu, 13 Jun 2024 21:00:31 +0300 Subject: [PATCH 10/27] xdp-tools: update to v1.4.2 - release notes: https://github.com/xdp-project/xdp-tools/releases/tag/v1.4.2 - patches rebased manually: - 010-configure-respect-LDFLAGS.patch Signed-off-by: Konstantin Demin Link: https://github.com/openwrt/openwrt/pull/15705 Signed-off-by: Christian Marangi --- package/network/utils/xdp-tools/Makefile | 4 ++-- .../patches/010-configure-respect-LDFLAGS.patch | 12 ++++++------ ...e-__noinline__-reserved-attribute-for-XDP-d.patch | 6 +++--- ...libxdp-fix-compilation-on-multiarch-systems.patch | 2 +- ...ib-allow-overwriting-W-flags-via-BPF_CFLAGS.patch | 4 ++-- ...DFLAGS-to-allow-overwriting-llc-s-march-arg.patch | 8 ++++---- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/package/network/utils/xdp-tools/Makefile b/package/network/utils/xdp-tools/Makefile index 8a839954e9..4d6ca312f6 100644 --- a/package/network/utils/xdp-tools/Makefile +++ b/package/network/utils/xdp-tools/Makefile @@ -2,8 +2,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=xdp-tools PKG_RELEASE:=1 -PKG_VERSION:=1.2.9 -PKG_HASH:=159ed8d3c8195d812ec3cde83bd736245a72743af372998320d39c2ba69ab142 +PKG_VERSION:=1.4.2 +PKG_HASH:=49c2b96b2be878449a797a74ca515a63e13418cb8ea904df08f8ef9cb2ac5570 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/xdp-project/xdp-tools/tar.gz/v$(PKG_VERSION)? diff --git a/package/network/utils/xdp-tools/patches/010-configure-respect-LDFLAGS.patch b/package/network/utils/xdp-tools/patches/010-configure-respect-LDFLAGS.patch index e2fbfa57dc..512ef09c7e 100644 --- a/package/network/utils/xdp-tools/patches/010-configure-respect-LDFLAGS.patch +++ b/package/network/utils/xdp-tools/patches/010-configure-respect-LDFLAGS.patch @@ -1,6 +1,6 @@ --- a/configure +++ b/configure -@@ -174,7 +174,7 @@ int main(int argc, char **argv) { +@@ -191,7 +191,7 @@ int main(int argc, char **argv) { return 0; } EOF @@ -9,16 +9,16 @@ if [ "$?" -eq "0" ]; then echo "HAVE_PCAP:=y" >>$CONFIG [ -n "$LIBPCAP_CFLAGS" ] && echo 'CFLAGS += ' $LIBPCAP_CFLAGS >> $CONFIG -@@ -222,7 +222,7 @@ int main(int argc, char **argv) { +@@ -267,7 +267,7 @@ int main(int argc, char **argv) { return 0; } EOF -- libbpf_err=$($CC -o $TMPDIR/libbpftest $TMPDIR/libbpftest.c -Werror $LIBBPF_CFLAGS $LIBBPF_LDLIBS 2>&1) -+ libbpf_err=$($CC -o $TMPDIR/libbpftest $TMPDIR/libbpftest.c -Werror $LIBBPF_CFLAGS $LIBBPF_LDLIBS $LDFLAGS 2>&1) +- compile_cmd="$CC -o $TMPDIR/libbpftest $TMPDIR/libbpftest.c -Werror $LIBBPF_CFLAGS $LIBBPF_LDLIBS" ++ compile_cmd="$CC -o $TMPDIR/libbpftest $TMPDIR/libbpftest.c -Werror $LIBBPF_CFLAGS $LIBBPF_LDLIBS $LDFLAGS" + libbpf_err=$($compile_cmd 2>&1) if [ "$?" -eq "0" ]; then echo "HAVE_FEATURES+=${config_var}" >>"$CONFIG" - echo "yes" -@@ -289,7 +289,7 @@ int main(int argc, char **argv) { +@@ -345,7 +345,7 @@ int main(int argc, char **argv) { } EOF diff --git a/package/network/utils/xdp-tools/patches/020-libxdp-Use-__noinline__-reserved-attribute-for-XDP-d.patch b/package/network/utils/xdp-tools/patches/020-libxdp-Use-__noinline__-reserved-attribute-for-XDP-d.patch index 1a157df32c..bd6c0786b7 100644 --- a/package/network/utils/xdp-tools/patches/020-libxdp-Use-__noinline__-reserved-attribute-for-XDP-d.patch +++ b/package/network/utils/xdp-tools/patches/020-libxdp-Use-__noinline__-reserved-attribute-for-XDP-d.patch @@ -18,7 +18,7 @@ Signed-off-by: Andre Heider --- a/lib/libxdp/protocol.org +++ b/lib/libxdp/protocol.org -@@ -54,7 +54,7 @@ static volatile const struct xdp_dispatc +@@ -59,7 +59,7 @@ static volatile const struct xdp_dispatc /* The volatile return value prevents the compiler from assuming it knows the * return value and optimising based on that. */ @@ -29,7 +29,7 @@ Signed-off-by: Andre Heider --- a/lib/libxdp/xdp-dispatcher.c.in +++ b/lib/libxdp/xdp-dispatcher.c.in -@@ -30,7 +30,7 @@ static volatile const struct xdp_dispatc +@@ -29,7 +29,7 @@ static volatile const struct xdp_dispatc * return value and optimising based on that. */ forloop(`i', `0', NUM_PROGS, @@ -38,7 +38,7 @@ Signed-off-by: Andre Heider int format(`prog%d', i)(struct xdp_md *ctx) { volatile int ret = XDP_DISPATCHER_RETVAL; -@@ -40,7 +40,7 @@ int format(`prog%d', i)(struct xdp_md *c +@@ -39,7 +39,7 @@ int format(`prog%d', i)(struct xdp_md *c } ') diff --git a/package/network/utils/xdp-tools/patches/023-libxdp-fix-compilation-on-multiarch-systems.patch b/package/network/utils/xdp-tools/patches/023-libxdp-fix-compilation-on-multiarch-systems.patch index cc60ebf611..89276fca89 100644 --- a/package/network/utils/xdp-tools/patches/023-libxdp-fix-compilation-on-multiarch-systems.patch +++ b/package/network/utils/xdp-tools/patches/023-libxdp-fix-compilation-on-multiarch-systems.patch @@ -19,7 +19,7 @@ Signed-off-by: Andre Heider --- a/lib/libxdp/Makefile +++ b/lib/libxdp/Makefile -@@ -30,7 +30,7 @@ PC_FILE := $(OBJDIR)/libxdp.pc +@@ -28,7 +28,7 @@ PC_FILE := $(OBJDIR)/libxdp.pc TEMPLATED_SOURCES := xdp-dispatcher.c CFLAGS += -I$(HEADER_DIR) diff --git a/package/network/utils/xdp-tools/patches/024-lib-allow-overwriting-W-flags-via-BPF_CFLAGS.patch b/package/network/utils/xdp-tools/patches/024-lib-allow-overwriting-W-flags-via-BPF_CFLAGS.patch index 16835eae37..2b47dd4c54 100644 --- a/package/network/utils/xdp-tools/patches/024-lib-allow-overwriting-W-flags-via-BPF_CFLAGS.patch +++ b/package/network/utils/xdp-tools/patches/024-lib-allow-overwriting-W-flags-via-BPF_CFLAGS.patch @@ -17,7 +17,7 @@ Signed-off-by: Andre Heider --- a/lib/common.mk +++ b/lib/common.mk -@@ -108,12 +108,12 @@ $(XDP_OBJ): %.o: %.c $(KERN_USER_H) $(EX +@@ -111,12 +111,12 @@ $(XDP_OBJ): %.o: %.c $(KERN_USER_H) $(EX $(QUIET_CLANG)$(CLANG) -S \ -target $(BPF_TARGET) \ -D __BPF_TRACING__ \ @@ -33,7 +33,7 @@ Signed-off-by: Andre Heider --- a/lib/libxdp/Makefile +++ b/lib/libxdp/Makefile -@@ -139,12 +139,12 @@ $(XDP_OBJS): %.o: %.c $(BPF_HEADERS) $(L +@@ -138,12 +138,12 @@ $(XDP_OBJS): %.o: %.c $(BPF_HEADERS) $(L $(QUIET_CLANG)$(CLANG) -S \ -target $(BPF_TARGET) \ -D __BPF_TRACING__ \ diff --git a/package/network/utils/xdp-tools/patches/025-Add-BPF_LDFLAGS-to-allow-overwriting-llc-s-march-arg.patch b/package/network/utils/xdp-tools/patches/025-Add-BPF_LDFLAGS-to-allow-overwriting-llc-s-march-arg.patch index d375e1db0c..d6d592b259 100644 --- a/package/network/utils/xdp-tools/patches/025-Add-BPF_LDFLAGS-to-allow-overwriting-llc-s-march-arg.patch +++ b/package/network/utils/xdp-tools/patches/025-Add-BPF_LDFLAGS-to-allow-overwriting-llc-s-march-arg.patch @@ -33,18 +33,18 @@ Signed-off-by: Andre Heider find_tool() --- a/lib/common.mk +++ b/lib/common.mk -@@ -115,7 +115,7 @@ $(XDP_OBJ): %.o: %.c $(KERN_USER_H) $(EX +@@ -118,7 +118,7 @@ $(XDP_OBJ): %.o: %.c $(KERN_USER_H) $(EX -Werror \ $(BPF_CFLAGS) \ -O2 -emit-llvm -c -g -o ${@:.o=.ll} $< - $(QUIET_LLC)$(LLC) -march=$(BPF_TARGET) -filetype=obj -o $@ ${@:.o=.ll} + $(QUIET_LLC)$(LLC) $(BPF_LDFLAGS) -filetype=obj -o $@ ${@:.o=.ll} - .PHONY: man - ifeq ($(EMACS),) + $(BPF_SKEL_H): %.skel.h: %.bpf.o + $(QUIET_GEN)$(BPFTOOL) gen skeleton $< name ${@:.skel.h=} > $@ --- a/lib/libxdp/Makefile +++ b/lib/libxdp/Makefile -@@ -146,7 +146,7 @@ $(XDP_OBJS): %.o: %.c $(BPF_HEADERS) $(L +@@ -145,7 +145,7 @@ $(XDP_OBJS): %.o: %.c $(BPF_HEADERS) $(L -Werror \ $(BPF_CFLAGS) \ -O2 -emit-llvm -c -g -o ${@:.o=.ll} $< From a5c095c4534dcbc09acc7e6d106dc911149c87ae Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 30 May 2024 12:33:37 +0100 Subject: [PATCH 11/27] generic: 6.6: replace (broken) downstream patch with upstream solution Our downstream patch "net/core: add optional threading for backlog processing" has been broken with the switch to Linux 6.6. Replace it by backporting the now available upstream solution. Signed-off-by: Daniel Golle Link: https://github.com/openwrt/openwrt/pull/15592 Signed-off-by: Christian Marangi --- ...tional-threaded-NAPI-wakeup-based-on.patch | 75 ++++ ...-to-use-SMP-threads-for-backlog-NAPI.patch | 330 ++++++++++++++++++ ...klog-NAPI-to-clean-up-the-defer_list.patch | 121 +++++++ ...-net-Rename-rps_lock-to-backlog_lock.patch | 164 +++++++++ ...t-introduce-napi_is_scheduled-helper.patch | 2 +- .../721-net-add-packet-mangeling.patch | 10 +- ...ional-threading-for-backlog-processi.patch | 227 ------------ 7 files changed, 696 insertions(+), 233 deletions(-) create mode 100644 target/linux/generic/backport-6.6/600-v6.10-net-Remove-conditional-threaded-NAPI-wakeup-based-on.patch create mode 100644 target/linux/generic/backport-6.6/601-v6.10-net-Allow-to-use-SMP-threads-for-backlog-NAPI.patch create mode 100644 target/linux/generic/backport-6.6/602-v6.10-net-Use-backlog-NAPI-to-clean-up-the-defer_list.patch create mode 100644 target/linux/generic/backport-6.6/603-v6.10-net-Rename-rps_lock-to-backlog_lock.patch delete mode 100644 target/linux/generic/pending-6.6/760-net-core-add-optional-threading-for-backlog-processi.patch diff --git a/target/linux/generic/backport-6.6/600-v6.10-net-Remove-conditional-threaded-NAPI-wakeup-based-on.patch b/target/linux/generic/backport-6.6/600-v6.10-net-Remove-conditional-threaded-NAPI-wakeup-based-on.patch new file mode 100644 index 0000000000..ef7963b601 --- /dev/null +++ b/target/linux/generic/backport-6.6/600-v6.10-net-Remove-conditional-threaded-NAPI-wakeup-based-on.patch @@ -0,0 +1,75 @@ +From 56364c910691f6d10ba88c964c9041b9ab777bd6 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Mon, 25 Mar 2024 08:40:28 +0100 +Subject: [PATCH 1/4] net: Remove conditional threaded-NAPI wakeup based on + task state. + +A NAPI thread is scheduled by first setting NAPI_STATE_SCHED bit. If +successful (the bit was not yet set) then the NAPI_STATE_SCHED_THREADED +is set but only if thread's state is not TASK_INTERRUPTIBLE (is +TASK_RUNNING) followed by task wakeup. + +If the task is idle (TASK_INTERRUPTIBLE) then the +NAPI_STATE_SCHED_THREADED bit is not set. The thread is no relying on +the bit but always leaving the wait-loop after returning from schedule() +because there must have been a wakeup. + +The smpboot-threads implementation for per-CPU threads requires an +explicit condition and does not support "if we get out of schedule() +then there must be something to do". + +Removing this optimisation simplifies the following integration. + +Set NAPI_STATE_SCHED_THREADED unconditionally on wakeup and rely on it +in the wait path by removing the `woken' condition. + +Acked-by: Jakub Kicinski +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Paolo Abeni +--- + net/core/dev.c | 14 ++------------ + 1 file changed, 2 insertions(+), 12 deletions(-) + +--- a/net/core/dev.c ++++ b/net/core/dev.c +@@ -4473,13 +4473,7 @@ static inline void ____napi_schedule(str + */ + thread = READ_ONCE(napi->thread); + if (thread) { +- /* Avoid doing set_bit() if the thread is in +- * INTERRUPTIBLE state, cause napi_thread_wait() +- * makes sure to proceed with napi polling +- * if the thread is explicitly woken from here. +- */ +- if (READ_ONCE(thread->__state) != TASK_INTERRUPTIBLE) +- set_bit(NAPI_STATE_SCHED_THREADED, &napi->state); ++ set_bit(NAPI_STATE_SCHED_THREADED, &napi->state); + wake_up_process(thread); + return; + } +@@ -6635,8 +6629,6 @@ static int napi_poll(struct napi_struct + + static int napi_thread_wait(struct napi_struct *napi) + { +- bool woken = false; +- + set_current_state(TASK_INTERRUPTIBLE); + + while (!kthread_should_stop()) { +@@ -6645,15 +6637,13 @@ static int napi_thread_wait(struct napi_ + * Testing SCHED bit is not enough because SCHED bit might be + * set by some other busy poll thread or by napi_disable(). + */ +- if (test_bit(NAPI_STATE_SCHED_THREADED, &napi->state) || woken) { ++ if (test_bit(NAPI_STATE_SCHED_THREADED, &napi->state)) { + WARN_ON(!list_empty(&napi->poll_list)); + __set_current_state(TASK_RUNNING); + return 0; + } + + schedule(); +- /* woken being true indicates this thread owns this napi. */ +- woken = true; + set_current_state(TASK_INTERRUPTIBLE); + } + __set_current_state(TASK_RUNNING); diff --git a/target/linux/generic/backport-6.6/601-v6.10-net-Allow-to-use-SMP-threads-for-backlog-NAPI.patch b/target/linux/generic/backport-6.6/601-v6.10-net-Allow-to-use-SMP-threads-for-backlog-NAPI.patch new file mode 100644 index 0000000000..3a7962fd88 --- /dev/null +++ b/target/linux/generic/backport-6.6/601-v6.10-net-Allow-to-use-SMP-threads-for-backlog-NAPI.patch @@ -0,0 +1,330 @@ +From dad6b97702639fba27a2bd3e986982ad6f0db3a7 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Mon, 25 Mar 2024 08:40:29 +0100 +Subject: [PATCH 2/4] net: Allow to use SMP threads for backlog NAPI. + +Backlog NAPI is a per-CPU NAPI struct only (with no device behind it) +used by drivers which don't do NAPI them self, RPS and parts of the +stack which need to avoid recursive deadlocks while processing a packet. + +The non-NAPI driver use the CPU local backlog NAPI. If RPS is enabled +then a flow for the skb is computed and based on the flow the skb can be +enqueued on a remote CPU. Scheduling/ raising the softirq (for backlog's +NAPI) on the remote CPU isn't trivial because the softirq is only +scheduled on the local CPU and performed after the hardirq is done. +In order to schedule a softirq on the remote CPU, an IPI is sent to the +remote CPU which schedules the backlog-NAPI on the then local CPU. + +On PREEMPT_RT interrupts are force-threaded. The soft interrupts are +raised within the interrupt thread and processed after the interrupt +handler completed still within the context of the interrupt thread. The +softirq is handled in the context where it originated. + +With force-threaded interrupts enabled, ksoftirqd is woken up if a +softirq is raised from hardirq context. This is the case if it is raised +from an IPI. Additionally there is a warning on PREEMPT_RT if the +softirq is raised from the idle thread. +This was done for two reasons: +- With threaded interrupts the processing should happen in thread + context (where it originated) and ksoftirqd is the only thread for + this context if raised from hardirq. Using the currently running task + instead would "punish" a random task. +- Once ksoftirqd is active it consumes all further softirqs until it + stops running. This changed recently and is no longer the case. + +Instead of keeping the backlog NAPI in ksoftirqd (in force-threaded/ +PREEMPT_RT setups) I am proposing NAPI-threads for backlog. +The "proper" setup with threaded-NAPI is not doable because the threads +are not pinned to an individual CPU and can be modified by the user. +Additionally a dummy network device would have to be assigned. Also +CPU-hotplug has to be considered if additional CPUs show up. +All this can be probably done/ solved but the smpboot-threads already +provide this infrastructure. + +Sending UDP packets over loopback expects that the packet is processed +within the call. Delaying it by handing it over to the thread hurts +performance. It is not beneficial to the outcome if the context switch +happens immediately after enqueue or after a while to process a few +packets in a batch. +There is no need to always use the thread if the backlog NAPI is +requested on the local CPU. This restores the loopback throuput. The +performance drops mostly to the same value after enabling RPS on the +loopback comparing the IPI and the tread result. + +Create NAPI-threads for backlog if request during boot. The thread runs +the inner loop from napi_threaded_poll(), the wait part is different. It +checks for NAPI_STATE_SCHED (the backlog NAPI can not be disabled). + +The NAPI threads for backlog are optional, it has to be enabled via the boot +argument "thread_backlog_napi". It is mandatory for PREEMPT_RT to avoid the +wakeup of ksoftirqd from the IPI. + +Acked-by: Jakub Kicinski +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Paolo Abeni +--- + net/core/dev.c | 148 +++++++++++++++++++++++++++++++++++++------------ + 1 file changed, 113 insertions(+), 35 deletions(-) + +--- a/net/core/dev.c ++++ b/net/core/dev.c +@@ -78,6 +78,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -217,6 +218,31 @@ static inline struct hlist_head *dev_ind + return &net->dev_index_head[ifindex & (NETDEV_HASHENTRIES - 1)]; + } + ++#ifndef CONFIG_PREEMPT_RT ++ ++static DEFINE_STATIC_KEY_FALSE(use_backlog_threads_key); ++ ++static int __init setup_backlog_napi_threads(char *arg) ++{ ++ static_branch_enable(&use_backlog_threads_key); ++ return 0; ++} ++early_param("thread_backlog_napi", setup_backlog_napi_threads); ++ ++static bool use_backlog_threads(void) ++{ ++ return static_branch_unlikely(&use_backlog_threads_key); ++} ++ ++#else ++ ++static bool use_backlog_threads(void) ++{ ++ return true; ++} ++ ++#endif ++ + static inline void rps_lock_irqsave(struct softnet_data *sd, + unsigned long *flags) + { +@@ -4441,6 +4467,7 @@ EXPORT_SYMBOL(__dev_direct_xmit); + /************************************************************************* + * Receiver routines + *************************************************************************/ ++static DEFINE_PER_CPU(struct task_struct *, backlog_napi); + + int netdev_max_backlog __read_mostly = 1000; + EXPORT_SYMBOL(netdev_max_backlog); +@@ -4473,12 +4500,16 @@ static inline void ____napi_schedule(str + */ + thread = READ_ONCE(napi->thread); + if (thread) { ++ if (use_backlog_threads() && thread == raw_cpu_read(backlog_napi)) ++ goto use_local_napi; ++ + set_bit(NAPI_STATE_SCHED_THREADED, &napi->state); + wake_up_process(thread); + return; + } + } + ++use_local_napi: + list_add_tail(&napi->poll_list, &sd->poll_list); + WRITE_ONCE(napi->list_owner, smp_processor_id()); + /* If not called from net_rx_action() +@@ -4724,6 +4755,11 @@ static void napi_schedule_rps(struct sof + + #ifdef CONFIG_RPS + if (sd != mysd) { ++ if (use_backlog_threads()) { ++ __napi_schedule_irqoff(&sd->backlog); ++ return; ++ } ++ + sd->rps_ipi_next = mysd->rps_ipi_list; + mysd->rps_ipi_list = sd; + +@@ -5947,7 +5983,7 @@ static void net_rps_action_and_irq_enabl + #ifdef CONFIG_RPS + struct softnet_data *remsd = sd->rps_ipi_list; + +- if (remsd) { ++ if (!use_backlog_threads() && remsd) { + sd->rps_ipi_list = NULL; + + local_irq_enable(); +@@ -5962,7 +5998,7 @@ static void net_rps_action_and_irq_enabl + static bool sd_has_rps_ipi_waiting(struct softnet_data *sd) + { + #ifdef CONFIG_RPS +- return sd->rps_ipi_list != NULL; ++ return !use_backlog_threads() && sd->rps_ipi_list; + #else + return false; + #endif +@@ -6006,7 +6042,7 @@ static int process_backlog(struct napi_s + * We can use a plain write instead of clear_bit(), + * and we dont need an smp_mb() memory barrier. + */ +- napi->state = 0; ++ napi->state &= NAPIF_STATE_THREADED; + again = false; + } else { + skb_queue_splice_tail_init(&sd->input_pkt_queue, +@@ -6672,43 +6708,48 @@ static void skb_defer_free_flush(struct + } + } + +-static int napi_threaded_poll(void *data) ++static void napi_threaded_poll_loop(struct napi_struct *napi) + { +- struct napi_struct *napi = data; + struct softnet_data *sd; +- void *have; ++ unsigned long last_qs = jiffies; + +- while (!napi_thread_wait(napi)) { +- unsigned long last_qs = jiffies; ++ for (;;) { ++ bool repoll = false; ++ void *have; + +- for (;;) { +- bool repoll = false; ++ local_bh_disable(); ++ sd = this_cpu_ptr(&softnet_data); ++ sd->in_napi_threaded_poll = true; + +- local_bh_disable(); +- sd = this_cpu_ptr(&softnet_data); +- sd->in_napi_threaded_poll = true; +- +- have = netpoll_poll_lock(napi); +- __napi_poll(napi, &repoll); +- netpoll_poll_unlock(have); +- +- sd->in_napi_threaded_poll = false; +- barrier(); +- +- if (sd_has_rps_ipi_waiting(sd)) { +- local_irq_disable(); +- net_rps_action_and_irq_enable(sd); +- } +- skb_defer_free_flush(sd); +- local_bh_enable(); ++ have = netpoll_poll_lock(napi); ++ __napi_poll(napi, &repoll); ++ netpoll_poll_unlock(have); ++ ++ sd->in_napi_threaded_poll = false; ++ barrier(); ++ ++ if (sd_has_rps_ipi_waiting(sd)) { ++ local_irq_disable(); ++ net_rps_action_and_irq_enable(sd); ++ } ++ skb_defer_free_flush(sd); ++ local_bh_enable(); + +- if (!repoll) +- break; ++ if (!repoll) ++ break; + +- rcu_softirq_qs_periodic(last_qs); +- cond_resched(); +- } ++ rcu_softirq_qs_periodic(last_qs); ++ cond_resched(); + } ++} ++ ++static int napi_threaded_poll(void *data) ++{ ++ struct napi_struct *napi = data; ++ ++ while (!napi_thread_wait(napi)) ++ napi_threaded_poll_loop(napi); ++ + return 0; + } + +@@ -11288,7 +11329,7 @@ static int dev_cpu_dead(unsigned int old + + list_del_init(&napi->poll_list); + if (napi->poll == process_backlog) +- napi->state = 0; ++ napi->state &= NAPIF_STATE_THREADED; + else + ____napi_schedule(sd, napi); + } +@@ -11296,12 +11337,14 @@ static int dev_cpu_dead(unsigned int old + raise_softirq_irqoff(NET_TX_SOFTIRQ); + local_irq_enable(); + ++ if (!use_backlog_threads()) { + #ifdef CONFIG_RPS +- remsd = oldsd->rps_ipi_list; +- oldsd->rps_ipi_list = NULL; ++ remsd = oldsd->rps_ipi_list; ++ oldsd->rps_ipi_list = NULL; + #endif +- /* send out pending IPI's on offline CPU */ +- net_rps_send_ipi(remsd); ++ /* send out pending IPI's on offline CPU */ ++ net_rps_send_ipi(remsd); ++ } + + /* Process offline CPU's input_pkt_queue */ + while ((skb = __skb_dequeue(&oldsd->process_queue))) { +@@ -11564,6 +11607,38 @@ static struct pernet_operations __net_in + * + */ + ++static int backlog_napi_should_run(unsigned int cpu) ++{ ++ struct softnet_data *sd = per_cpu_ptr(&softnet_data, cpu); ++ struct napi_struct *napi = &sd->backlog; ++ ++ return test_bit(NAPI_STATE_SCHED_THREADED, &napi->state); ++} ++ ++static void run_backlog_napi(unsigned int cpu) ++{ ++ struct softnet_data *sd = per_cpu_ptr(&softnet_data, cpu); ++ ++ napi_threaded_poll_loop(&sd->backlog); ++} ++ ++static void backlog_napi_setup(unsigned int cpu) ++{ ++ struct softnet_data *sd = per_cpu_ptr(&softnet_data, cpu); ++ struct napi_struct *napi = &sd->backlog; ++ ++ napi->thread = this_cpu_read(backlog_napi); ++ set_bit(NAPI_STATE_THREADED, &napi->state); ++} ++ ++static struct smp_hotplug_thread backlog_threads = { ++ .store = &backlog_napi, ++ .thread_should_run = backlog_napi_should_run, ++ .thread_fn = run_backlog_napi, ++ .thread_comm = "backlog_napi/%u", ++ .setup = backlog_napi_setup, ++}; ++ + /* + * This is called single threaded during boot, so no need + * to take the rtnl semaphore. +@@ -11614,7 +11689,10 @@ static int __init net_dev_init(void) + init_gro_hash(&sd->backlog); + sd->backlog.poll = process_backlog; + sd->backlog.weight = weight_p; ++ INIT_LIST_HEAD(&sd->backlog.poll_list); + } ++ if (use_backlog_threads()) ++ smpboot_register_percpu_thread(&backlog_threads); + + dev_boot_phase = 0; + diff --git a/target/linux/generic/backport-6.6/602-v6.10-net-Use-backlog-NAPI-to-clean-up-the-defer_list.patch b/target/linux/generic/backport-6.6/602-v6.10-net-Use-backlog-NAPI-to-clean-up-the-defer_list.patch new file mode 100644 index 0000000000..6a9c113124 --- /dev/null +++ b/target/linux/generic/backport-6.6/602-v6.10-net-Use-backlog-NAPI-to-clean-up-the-defer_list.patch @@ -0,0 +1,121 @@ +From 80d2eefcb4c84aa9018b2a997ab3a4c567bc821a Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Mon, 25 Mar 2024 08:40:30 +0100 +Subject: [PATCH 3/4] net: Use backlog-NAPI to clean up the defer_list. + +The defer_list is a per-CPU list which is used to free skbs outside of +the socket lock and on the CPU on which they have been allocated. +The list is processed during NAPI callbacks so ideally the list is +cleaned up. +Should the amount of skbs on the list exceed a certain water mark then +the softirq is triggered remotely on the target CPU by invoking a remote +function call. The raise of the softirqs via a remote function call +leads to waking the ksoftirqd on PREEMPT_RT which is undesired. +The backlog-NAPI threads already provide the infrastructure which can be +utilized to perform the cleanup of the defer_list. + +The NAPI state is updated with the input_pkt_queue.lock acquired. It +order not to break the state, it is needed to also wake the backlog-NAPI +thread with the lock held. This requires to acquire the use the lock in +rps_lock_irq*() if the backlog-NAPI threads are used even with RPS +disabled. + +Move the logic of remotely starting softirqs to clean up the defer_list +into kick_defer_list_purge(). Make sure a lock is held in +rps_lock_irq*() if backlog-NAPI threads are used. Schedule backlog-NAPI +for defer_list cleanup if backlog-NAPI is available. + +Acked-by: Jakub Kicinski +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Paolo Abeni +--- + include/linux/netdevice.h | 1 + + net/core/dev.c | 25 +++++++++++++++++++++---- + net/core/skbuff.c | 4 ++-- + 3 files changed, 24 insertions(+), 6 deletions(-) + +--- a/include/linux/netdevice.h ++++ b/include/linux/netdevice.h +@@ -3300,6 +3300,7 @@ static inline void dev_xmit_recursion_de + __this_cpu_dec(softnet_data.xmit.recursion); + } + ++void kick_defer_list_purge(struct softnet_data *sd, unsigned int cpu); + void __netif_schedule(struct Qdisc *q); + void netif_schedule_queue(struct netdev_queue *txq); + +--- a/net/core/dev.c ++++ b/net/core/dev.c +@@ -246,7 +246,7 @@ static bool use_backlog_threads(void) + static inline void rps_lock_irqsave(struct softnet_data *sd, + unsigned long *flags) + { +- if (IS_ENABLED(CONFIG_RPS)) ++ if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads()) + spin_lock_irqsave(&sd->input_pkt_queue.lock, *flags); + else if (!IS_ENABLED(CONFIG_PREEMPT_RT)) + local_irq_save(*flags); +@@ -254,7 +254,7 @@ static inline void rps_lock_irqsave(stru + + static inline void rps_lock_irq_disable(struct softnet_data *sd) + { +- if (IS_ENABLED(CONFIG_RPS)) ++ if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads()) + spin_lock_irq(&sd->input_pkt_queue.lock); + else if (!IS_ENABLED(CONFIG_PREEMPT_RT)) + local_irq_disable(); +@@ -263,7 +263,7 @@ static inline void rps_lock_irq_disable( + static inline void rps_unlock_irq_restore(struct softnet_data *sd, + unsigned long *flags) + { +- if (IS_ENABLED(CONFIG_RPS)) ++ if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads()) + spin_unlock_irqrestore(&sd->input_pkt_queue.lock, *flags); + else if (!IS_ENABLED(CONFIG_PREEMPT_RT)) + local_irq_restore(*flags); +@@ -271,7 +271,7 @@ static inline void rps_unlock_irq_restor + + static inline void rps_unlock_irq_enable(struct softnet_data *sd) + { +- if (IS_ENABLED(CONFIG_RPS)) ++ if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads()) + spin_unlock_irq(&sd->input_pkt_queue.lock); + else if (!IS_ENABLED(CONFIG_PREEMPT_RT)) + local_irq_enable(); +@@ -4774,6 +4774,23 @@ static void napi_schedule_rps(struct sof + __napi_schedule_irqoff(&mysd->backlog); + } + ++void kick_defer_list_purge(struct softnet_data *sd, unsigned int cpu) ++{ ++ unsigned long flags; ++ ++ if (use_backlog_threads()) { ++ rps_lock_irqsave(sd, &flags); ++ ++ if (!__test_and_set_bit(NAPI_STATE_SCHED, &sd->backlog.state)) ++ __napi_schedule_irqoff(&sd->backlog); ++ ++ rps_unlock_irq_restore(sd, &flags); ++ ++ } else if (!cmpxchg(&sd->defer_ipi_scheduled, 0, 1)) { ++ smp_call_function_single_async(cpu, &sd->defer_csd); ++ } ++} ++ + #ifdef CONFIG_NET_FLOW_LIMIT + int netdev_flow_limit_table_len __read_mostly = (1 << 12); + #endif +--- a/net/core/skbuff.c ++++ b/net/core/skbuff.c +@@ -6863,8 +6863,8 @@ nodefer: __kfree_skb(skb); + /* Make sure to trigger NET_RX_SOFTIRQ on the remote CPU + * if we are unlucky enough (this seems very unlikely). + */ +- if (unlikely(kick) && !cmpxchg(&sd->defer_ipi_scheduled, 0, 1)) +- smp_call_function_single_async(cpu, &sd->defer_csd); ++ if (unlikely(kick)) ++ kick_defer_list_purge(sd, cpu); + } + + static void skb_splice_csum_page(struct sk_buff *skb, struct page *page, diff --git a/target/linux/generic/backport-6.6/603-v6.10-net-Rename-rps_lock-to-backlog_lock.patch b/target/linux/generic/backport-6.6/603-v6.10-net-Rename-rps_lock-to-backlog_lock.patch new file mode 100644 index 0000000000..801067287b --- /dev/null +++ b/target/linux/generic/backport-6.6/603-v6.10-net-Rename-rps_lock-to-backlog_lock.patch @@ -0,0 +1,164 @@ +From 765b11f8f4e20b7433e4ba4a3e9106a0d59501ed Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior +Date: Mon, 25 Mar 2024 08:40:31 +0100 +Subject: [PATCH 4/4] net: Rename rps_lock to backlog_lock. + +The rps_lock.*() functions use the inner lock of a sk_buff_head for +locking. This lock is used if RPS is enabled, otherwise the list is +accessed lockless and disabling interrupts is enough for the +synchronisation because it is only accessed CPU local. Not only the list +is protected but also the NAPI state protected. +With the addition of backlog threads, the lock is also needed because of +the cross CPU access even without RPS. The clean up of the defer_list +list is also done via backlog threads (if enabled). + +It has been suggested to rename the locking function since it is no +longer just RPS. + +Rename the rps_lock*() functions to backlog_lock*(). + +Suggested-by: Jakub Kicinski +Acked-by: Jakub Kicinski +Signed-off-by: Sebastian Andrzej Siewior +Signed-off-by: Paolo Abeni +--- + net/core/dev.c | 34 +++++++++++++++++----------------- + 1 file changed, 17 insertions(+), 17 deletions(-) + +--- a/net/core/dev.c ++++ b/net/core/dev.c +@@ -243,8 +243,8 @@ static bool use_backlog_threads(void) + + #endif + +-static inline void rps_lock_irqsave(struct softnet_data *sd, +- unsigned long *flags) ++static inline void backlog_lock_irq_save(struct softnet_data *sd, ++ unsigned long *flags) + { + if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads()) + spin_lock_irqsave(&sd->input_pkt_queue.lock, *flags); +@@ -252,7 +252,7 @@ static inline void rps_lock_irqsave(stru + local_irq_save(*flags); + } + +-static inline void rps_lock_irq_disable(struct softnet_data *sd) ++static inline void backlog_lock_irq_disable(struct softnet_data *sd) + { + if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads()) + spin_lock_irq(&sd->input_pkt_queue.lock); +@@ -260,8 +260,8 @@ static inline void rps_lock_irq_disable( + local_irq_disable(); + } + +-static inline void rps_unlock_irq_restore(struct softnet_data *sd, +- unsigned long *flags) ++static inline void backlog_unlock_irq_restore(struct softnet_data *sd, ++ unsigned long *flags) + { + if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads()) + spin_unlock_irqrestore(&sd->input_pkt_queue.lock, *flags); +@@ -269,7 +269,7 @@ static inline void rps_unlock_irq_restor + local_irq_restore(*flags); + } + +-static inline void rps_unlock_irq_enable(struct softnet_data *sd) ++static inline void backlog_unlock_irq_enable(struct softnet_data *sd) + { + if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads()) + spin_unlock_irq(&sd->input_pkt_queue.lock); +@@ -4779,12 +4779,12 @@ void kick_defer_list_purge(struct softne + unsigned long flags; + + if (use_backlog_threads()) { +- rps_lock_irqsave(sd, &flags); ++ backlog_lock_irq_save(sd, &flags); + + if (!__test_and_set_bit(NAPI_STATE_SCHED, &sd->backlog.state)) + __napi_schedule_irqoff(&sd->backlog); + +- rps_unlock_irq_restore(sd, &flags); ++ backlog_unlock_irq_restore(sd, &flags); + + } else if (!cmpxchg(&sd->defer_ipi_scheduled, 0, 1)) { + smp_call_function_single_async(cpu, &sd->defer_csd); +@@ -4846,7 +4846,7 @@ static int enqueue_to_backlog(struct sk_ + reason = SKB_DROP_REASON_NOT_SPECIFIED; + sd = &per_cpu(softnet_data, cpu); + +- rps_lock_irqsave(sd, &flags); ++ backlog_lock_irq_save(sd, &flags); + if (!netif_running(skb->dev)) + goto drop; + qlen = skb_queue_len(&sd->input_pkt_queue); +@@ -4855,7 +4855,7 @@ static int enqueue_to_backlog(struct sk_ + enqueue: + __skb_queue_tail(&sd->input_pkt_queue, skb); + input_queue_tail_incr_save(sd, qtail); +- rps_unlock_irq_restore(sd, &flags); ++ backlog_unlock_irq_restore(sd, &flags); + return NET_RX_SUCCESS; + } + +@@ -4870,7 +4870,7 @@ enqueue: + + drop: + sd->dropped++; +- rps_unlock_irq_restore(sd, &flags); ++ backlog_unlock_irq_restore(sd, &flags); + + dev_core_stats_rx_dropped_inc(skb->dev); + kfree_skb_reason(skb, reason); +@@ -5901,7 +5901,7 @@ static void flush_backlog(struct work_st + local_bh_disable(); + sd = this_cpu_ptr(&softnet_data); + +- rps_lock_irq_disable(sd); ++ backlog_lock_irq_disable(sd); + skb_queue_walk_safe(&sd->input_pkt_queue, skb, tmp) { + if (skb->dev->reg_state == NETREG_UNREGISTERING) { + __skb_unlink(skb, &sd->input_pkt_queue); +@@ -5909,7 +5909,7 @@ static void flush_backlog(struct work_st + input_queue_head_incr(sd); + } + } +- rps_unlock_irq_enable(sd); ++ backlog_unlock_irq_enable(sd); + + skb_queue_walk_safe(&sd->process_queue, skb, tmp) { + if (skb->dev->reg_state == NETREG_UNREGISTERING) { +@@ -5927,14 +5927,14 @@ static bool flush_required(int cpu) + struct softnet_data *sd = &per_cpu(softnet_data, cpu); + bool do_flush; + +- rps_lock_irq_disable(sd); ++ backlog_lock_irq_disable(sd); + + /* as insertion into process_queue happens with the rps lock held, + * process_queue access may race only with dequeue + */ + do_flush = !skb_queue_empty(&sd->input_pkt_queue) || + !skb_queue_empty_lockless(&sd->process_queue); +- rps_unlock_irq_enable(sd); ++ backlog_unlock_irq_enable(sd); + + return do_flush; + #endif +@@ -6049,7 +6049,7 @@ static int process_backlog(struct napi_s + + } + +- rps_lock_irq_disable(sd); ++ backlog_lock_irq_disable(sd); + if (skb_queue_empty(&sd->input_pkt_queue)) { + /* + * Inline a custom version of __napi_complete(). +@@ -6065,7 +6065,7 @@ static int process_backlog(struct napi_s + skb_queue_splice_tail_init(&sd->input_pkt_queue, + &sd->process_queue); + } +- rps_unlock_irq_enable(sd); ++ backlog_unlock_irq_enable(sd); + } + + return work; diff --git a/target/linux/generic/backport-6.6/770-net-introduce-napi_is_scheduled-helper.patch b/target/linux/generic/backport-6.6/770-net-introduce-napi_is_scheduled-helper.patch index 821fd60a2d..6449cd6a3a 100644 --- a/target/linux/generic/backport-6.6/770-net-introduce-napi_is_scheduled-helper.patch +++ b/target/linux/generic/backport-6.6/770-net-introduce-napi_is_scheduled-helper.patch @@ -85,7 +85,7 @@ Signed-off-by: Paolo Abeni /** --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -6555,7 +6555,7 @@ static int __napi_poll(struct napi_struc +@@ -6602,7 +6602,7 @@ static int __napi_poll(struct napi_struc * accidentally calling ->poll() when NAPI is not scheduled. */ work = 0; diff --git a/target/linux/generic/hack-6.6/721-net-add-packet-mangeling.patch b/target/linux/generic/hack-6.6/721-net-add-packet-mangeling.patch index b51a324027..e1d4367a8f 100644 --- a/target/linux/generic/hack-6.6/721-net-add-packet-mangeling.patch +++ b/target/linux/generic/hack-6.6/721-net-add-packet-mangeling.patch @@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -1759,6 +1759,7 @@ enum netdev_priv_flags { +@@ -1758,6 +1758,7 @@ enum netdev_priv_flags { IFF_TX_SKB_NO_LINEAR = BIT_ULL(31), IFF_CHANGE_PROTO_DOWN = BIT_ULL(32), IFF_SEE_ALL_HWTSTAMP_REQUESTS = BIT_ULL(33), @@ -27,7 +27,7 @@ Signed-off-by: Felix Fietkau }; #define IFF_802_1Q_VLAN IFF_802_1Q_VLAN -@@ -1792,6 +1793,7 @@ enum netdev_priv_flags { +@@ -1791,6 +1792,7 @@ enum netdev_priv_flags { #define IFF_FAILOVER_SLAVE IFF_FAILOVER_SLAVE #define IFF_L3MDEV_RX_HANDLER IFF_L3MDEV_RX_HANDLER #define IFF_TX_SKB_NO_LINEAR IFF_TX_SKB_NO_LINEAR @@ -35,7 +35,7 @@ Signed-off-by: Felix Fietkau /* Specifies the type of the struct net_device::ml_priv pointer */ enum netdev_ml_priv_type { -@@ -2184,6 +2186,11 @@ struct net_device { +@@ -2183,6 +2185,11 @@ struct net_device { const struct tlsdev_ops *tlsdev_ops; #endif @@ -47,7 +47,7 @@ Signed-off-by: Felix Fietkau const struct header_ops *header_ops; unsigned char operstate; -@@ -2257,6 +2264,10 @@ struct net_device { +@@ -2256,6 +2263,10 @@ struct net_device { struct mctp_dev __rcu *mctp_ptr; #endif @@ -105,7 +105,7 @@ Signed-off-by: Felix Fietkau help --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3571,6 +3571,11 @@ static int xmit_one(struct sk_buff *skb, +@@ -3597,6 +3597,11 @@ static int xmit_one(struct sk_buff *skb, if (dev_nit_active(dev)) dev_queue_xmit_nit(skb, dev); diff --git a/target/linux/generic/pending-6.6/760-net-core-add-optional-threading-for-backlog-processi.patch b/target/linux/generic/pending-6.6/760-net-core-add-optional-threading-for-backlog-processi.patch deleted file mode 100644 index 8a9066bf12..0000000000 --- a/target/linux/generic/pending-6.6/760-net-core-add-optional-threading-for-backlog-processi.patch +++ /dev/null @@ -1,227 +0,0 @@ -From: Felix Fietkau -Date: Thu, 16 Feb 2023 18:39:04 +0100 -Subject: [PATCH] net/core: add optional threading for backlog processing - -When dealing with few flows or an imbalance on CPU utilization, static RPS -CPU assignment can be too inflexible. Add support for enabling threaded NAPI -for backlog processing in order to allow the scheduler to better balance -processing. This helps better spread the load across idle CPUs. - -Signed-off-by: Felix Fietkau ---- - ---- a/include/linux/netdevice.h -+++ b/include/linux/netdevice.h -@@ -558,6 +558,7 @@ static inline bool napi_complete(struct - } - - int dev_set_threaded(struct net_device *dev, bool threaded); -+int backlog_set_threaded(bool threaded); - - /** - * napi_disable - prevent NAPI from scheduling -@@ -3236,6 +3237,7 @@ struct softnet_data { - /* stats */ - unsigned int processed; - unsigned int time_squeeze; -+ unsigned int process_queue_empty; - #ifdef CONFIG_RPS - struct softnet_data *rps_ipi_list; - #endif ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -4729,7 +4729,7 @@ static void napi_schedule_rps(struct sof - struct softnet_data *mysd = this_cpu_ptr(&softnet_data); - - #ifdef CONFIG_RPS -- if (sd != mysd) { -+ if (sd != mysd && !test_bit(NAPI_STATE_THREADED, &sd->backlog.state)) { - sd->rps_ipi_next = mysd->rps_ipi_list; - mysd->rps_ipi_list = sd; - -@@ -5848,6 +5848,8 @@ static DEFINE_PER_CPU(struct work_struct - /* Network device is going away, flush any packets still pending */ - static void flush_backlog(struct work_struct *work) - { -+ unsigned int process_queue_empty; -+ bool threaded, flush_processq; - struct sk_buff *skb, *tmp; - struct softnet_data *sd; - -@@ -5862,8 +5864,17 @@ static void flush_backlog(struct work_st - input_queue_head_incr(sd); - } - } -+ -+ threaded = test_bit(NAPI_STATE_THREADED, &sd->backlog.state); -+ flush_processq = threaded && -+ !skb_queue_empty_lockless(&sd->process_queue); -+ if (flush_processq) -+ process_queue_empty = sd->process_queue_empty; - rps_unlock_irq_enable(sd); - -+ if (threaded) -+ goto out; -+ - skb_queue_walk_safe(&sd->process_queue, skb, tmp) { - if (skb->dev->reg_state == NETREG_UNREGISTERING) { - __skb_unlink(skb, &sd->process_queue); -@@ -5871,7 +5882,16 @@ static void flush_backlog(struct work_st - input_queue_head_incr(sd); - } - } -+ -+out: - local_bh_enable(); -+ -+ while (flush_processq) { -+ msleep(1); -+ rps_lock_irq_disable(sd); -+ flush_processq = process_queue_empty == sd->process_queue_empty; -+ rps_unlock_irq_enable(sd); -+ } - } - - static bool flush_required(int cpu) -@@ -6003,6 +6023,7 @@ static int process_backlog(struct napi_s - } - - rps_lock_irq_disable(sd); -+ sd->process_queue_empty++; - if (skb_queue_empty(&sd->input_pkt_queue)) { - /* - * Inline a custom version of __napi_complete(). -@@ -6012,7 +6033,8 @@ static int process_backlog(struct napi_s - * We can use a plain write instead of clear_bit(), - * and we dont need an smp_mb() memory barrier. - */ -- napi->state = 0; -+ napi->state &= ~(NAPIF_STATE_SCHED | -+ NAPIF_STATE_SCHED_THREADED); - again = false; - } else { - skb_queue_splice_tail_init(&sd->input_pkt_queue, -@@ -6426,6 +6448,55 @@ int dev_set_threaded(struct net_device * - } - EXPORT_SYMBOL(dev_set_threaded); - -+int backlog_set_threaded(bool threaded) -+{ -+ static bool backlog_threaded; -+ int err = 0; -+ int i; -+ -+ if (backlog_threaded == threaded) -+ return 0; -+ -+ for_each_possible_cpu(i) { -+ struct softnet_data *sd = &per_cpu(softnet_data, i); -+ struct napi_struct *n = &sd->backlog; -+ -+ if (n->thread) -+ continue; -+ n->thread = kthread_run(napi_threaded_poll, n, "napi/backlog-%d", i); -+ if (IS_ERR(n->thread)) { -+ err = PTR_ERR(n->thread); -+ pr_err("kthread_run failed with err %d\n", err); -+ n->thread = NULL; -+ threaded = false; -+ break; -+ } -+ -+ } -+ -+ backlog_threaded = threaded; -+ -+ /* Make sure kthread is created before THREADED bit -+ * is set. -+ */ -+ smp_mb__before_atomic(); -+ -+ for_each_possible_cpu(i) { -+ struct softnet_data *sd = &per_cpu(softnet_data, i); -+ struct napi_struct *n = &sd->backlog; -+ unsigned long flags; -+ -+ rps_lock_irqsave(sd, &flags); -+ if (threaded) -+ n->state |= NAPIF_STATE_THREADED; -+ else -+ n->state &= ~NAPIF_STATE_THREADED; -+ rps_unlock_irq_restore(sd, &flags); -+ } -+ -+ return err; -+} -+ - void netif_napi_add_weight(struct net_device *dev, struct napi_struct *napi, - int (*poll)(struct napi_struct *, int), int weight) - { -@@ -11307,6 +11378,9 @@ static int dev_cpu_dead(unsigned int old - raise_softirq_irqoff(NET_TX_SOFTIRQ); - local_irq_enable(); - -+ if (test_bit(NAPI_STATE_THREADED, &oldsd->backlog.state)) -+ return 0; -+ - #ifdef CONFIG_RPS - remsd = oldsd->rps_ipi_list; - oldsd->rps_ipi_list = NULL; -@@ -11622,6 +11696,7 @@ static int __init net_dev_init(void) - INIT_CSD(&sd->defer_csd, trigger_rx_softirq, sd); - spin_lock_init(&sd->defer_lock); - -+ INIT_LIST_HEAD(&sd->backlog.poll_list); - init_gro_hash(&sd->backlog); - sd->backlog.poll = process_backlog; - sd->backlog.weight = weight_p; ---- a/net/core/sysctl_net_core.c -+++ b/net/core/sysctl_net_core.c -@@ -30,6 +30,7 @@ static int int_3600 = 3600; - static int min_sndbuf = SOCK_MIN_SNDBUF; - static int min_rcvbuf = SOCK_MIN_RCVBUF; - static int max_skb_frags = MAX_SKB_FRAGS; -+static int backlog_threaded; - static int min_mem_pcpu_rsv = SK_MEMORY_PCPU_RESERVE; - - static int net_msg_warn; /* Unused, but still a sysctl */ -@@ -189,6 +190,23 @@ static int rps_sock_flow_sysctl(struct c - } - #endif /* CONFIG_RPS */ - -+static int backlog_threaded_sysctl(struct ctl_table *table, int write, -+ void *buffer, size_t *lenp, loff_t *ppos) -+{ -+ static DEFINE_MUTEX(backlog_threaded_mutex); -+ int ret; -+ -+ mutex_lock(&backlog_threaded_mutex); -+ -+ ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos); -+ if (write && !ret) -+ ret = backlog_set_threaded(backlog_threaded); -+ -+ mutex_unlock(&backlog_threaded_mutex); -+ -+ return ret; -+} -+ - #ifdef CONFIG_NET_FLOW_LIMIT - static DEFINE_MUTEX(flow_limit_update_mutex); - -@@ -541,6 +559,15 @@ static struct ctl_table net_core_table[] - .proc_handler = rps_sock_flow_sysctl - }, - #endif -+ { -+ .procname = "backlog_threaded", -+ .data = &backlog_threaded, -+ .maxlen = sizeof(unsigned int), -+ .mode = 0644, -+ .proc_handler = backlog_threaded_sysctl, -+ .extra1 = SYSCTL_ZERO, -+ .extra2 = SYSCTL_ONE -+ }, - #ifdef CONFIG_NET_FLOW_LIMIT - { - .procname = "flow_limit_cpu_bitmap", From bff0e1cfd87374ae0994ea57f8b8b8f14d8d9f38 Mon Sep 17 00:00:00 2001 From: "Leon M. Busch-George" Date: Thu, 9 May 2024 11:32:26 +0200 Subject: [PATCH 12/27] base-files: fix ipcalc bound calculation for /31 prefix A small regress from the translation to shell. Fixes #12921, originally fixed in #12925 (Github). Signed-off-by: Leon M. Busch-George Link: https://github.com/openwrt/openwrt/pull/15430 Signed-off-by: Christian Marangi --- package/base-files/files/bin/ipcalc.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/base-files/files/bin/ipcalc.sh b/package/base-files/files/bin/ipcalc.sh index 9e2702c60d..ae7a5c9598 100755 --- a/package/base-files/files/bin/ipcalc.sh +++ b/package/base-files/files/bin/ipcalc.sh @@ -111,6 +111,8 @@ start=$((network | (start & hostmask))) if [ "$prefix" -le 30 ]; then upper=$(((network | hostmask) - 1)) +elif [ "$prefix" -eq 31 ]; then + upper=$((network | hostmask)) else upper="$network" fi From 5f9fb964c3afbcbc6ca860c817076221d0c1ce8c Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 5 May 2024 17:48:31 +0200 Subject: [PATCH 13/27] bpf: also include toolchain standard header as system header Also include toolchain standard header as system header. These are required by xdp-tools that try to include stddef.h and stdbool.h for some tools. These header are usually in /lib/gcc/../include but musl also have some special variant in /include. To fix compilation of xdp-tools, also include these standard header. These header should follow ISO C standard and should not introduce regression in bpf tools making them specific to an arch. Link: https://github.com/openwrt/openwrt/pull/15390 Signed-off-by: Christian Marangi --- include/bpf.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/bpf.mk b/include/bpf.mk index 9abc660123..85c3edb4c7 100644 --- a/include/bpf.mk +++ b/include/bpf.mk @@ -33,7 +33,8 @@ BPF_TARGET:=bpf$(if $(CONFIG_BIG_ENDIAN),eb,el) BPF_HEADERS_DIR:=$(STAGING_DIR)/bpf-headers BPF_KERNEL_INCLUDE := \ - -nostdinc $(patsubst %,-isystem %,$(TOOLCHAIN_INC_DIRS)) \ + -nostdinc -isystem $(TOOLCHAIN_ROOT_DIR)/lib/gcc/*/*/include \ + $(patsubst %,-isystem%,$(TOOLCHAIN_INC_DIRS)) \ -I$(BPF_HEADERS_DIR)/arch/$(BPF_KARCH)/include \ -I$(BPF_HEADERS_DIR)/arch/$(BPF_KARCH)/include/asm/mach-generic \ -I$(BPF_HEADERS_DIR)/arch/$(BPF_KARCH)/include/generated \ From e3afc7047be26bb4fd461cc4f068f21cb9622ff0 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Mon, 17 Jun 2024 15:02:38 +0100 Subject: [PATCH 14/27] generic: 6.6: refresh patches Refresh patches as line numbers changed with newer upstream version since original backport PR was opened. Fixes: a5c095c453 ("generic: 6.6: replace (broken) downstream patch with upstream solution") Signed-off-by: Daniel Golle --- ...10-net-Allow-to-use-SMP-threads-for-backlog-NAPI.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/linux/generic/backport-6.6/601-v6.10-net-Allow-to-use-SMP-threads-for-backlog-NAPI.patch b/target/linux/generic/backport-6.6/601-v6.10-net-Allow-to-use-SMP-threads-for-backlog-NAPI.patch index 3a7962fd88..40e6514264 100644 --- a/target/linux/generic/backport-6.6/601-v6.10-net-Allow-to-use-SMP-threads-for-backlog-NAPI.patch +++ b/target/linux/generic/backport-6.6/601-v6.10-net-Allow-to-use-SMP-threads-for-backlog-NAPI.patch @@ -250,7 +250,7 @@ Signed-off-by: Paolo Abeni return 0; } -@@ -11288,7 +11329,7 @@ static int dev_cpu_dead(unsigned int old +@@ -11289,7 +11330,7 @@ static int dev_cpu_dead(unsigned int old list_del_init(&napi->poll_list); if (napi->poll == process_backlog) @@ -259,7 +259,7 @@ Signed-off-by: Paolo Abeni else ____napi_schedule(sd, napi); } -@@ -11296,12 +11337,14 @@ static int dev_cpu_dead(unsigned int old +@@ -11297,12 +11338,14 @@ static int dev_cpu_dead(unsigned int old raise_softirq_irqoff(NET_TX_SOFTIRQ); local_irq_enable(); @@ -278,7 +278,7 @@ Signed-off-by: Paolo Abeni /* Process offline CPU's input_pkt_queue */ while ((skb = __skb_dequeue(&oldsd->process_queue))) { -@@ -11564,6 +11607,38 @@ static struct pernet_operations __net_in +@@ -11565,6 +11608,38 @@ static struct pernet_operations __net_in * */ @@ -317,7 +317,7 @@ Signed-off-by: Paolo Abeni /* * This is called single threaded during boot, so no need * to take the rtnl semaphore. -@@ -11614,7 +11689,10 @@ static int __init net_dev_init(void) +@@ -11615,7 +11690,10 @@ static int __init net_dev_init(void) init_gro_hash(&sd->backlog); sd->backlog.poll = process_backlog; sd->backlog.weight = weight_p; From a8ff0c1b7e5aefb8bcd31e0eeb82d2c11399223f Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Thu, 6 Jun 2024 19:28:52 +0200 Subject: [PATCH 15/27] build: include tests/Makefile if available Testing OpenWrt is important, and there is a test suite in the making. For maximum convenience and minimal CI over-usage, make it simple to run tests locally. The main Makefile now attempts to include `tests/Makefile` and silently fails if it doesn't. While the test suite[1] is still young, it provides good examples of how to test things around OpenWrt: starting with shell scripts using `bats`[2], followed by QEMU tests, and finally real device tests using LabGrid[3]. This could lead to the creation of the best OpenWrt version yet. Please consult the `openwrt-tests.git` README.md for details on the setup. Once installed you may run commands like the following: * make tests/shell # run shell tests * make tests/x86-64 # run and test x86/64 in QEMU [1]: http://github.com/aparcar/openwrt-tests/ [2]: https://bats-core.readthedocs.io [3]: https://labgrid.readthedocs.io Signed-off-by: Paul Spooren Link: https://github.com/openwrt/openwrt/pull/15647 Signed-off-by: Christian Marangi --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 9bdb03a443..7c52acccba 100644 --- a/Makefile +++ b/Makefile @@ -40,6 +40,9 @@ else include tools/Makefile include toolchain/Makefile +# Include the test suite Makefile if it exists +-include tests/Makefile + $(toolchain/stamp-compile): $(tools/stamp-compile) $(if $(CONFIG_BUILDBOT),toolchain_rebuild_check) $(target/stamp-compile): $(toolchain/stamp-compile) $(tools/stamp-compile) $(BUILD_DIR)/.prepared $(package/stamp-compile): $(target/stamp-compile) $(package/stamp-cleanup) From dc9c5d1ee72564d97b7d76ab4db239e038916d31 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Mon, 17 Jun 2024 18:23:44 +0200 Subject: [PATCH 16/27] mac80211: ath10k: replace LEDs patch with upstream patch LEDs support for ath10k has finally merged upstream hence replace it with the upstream version. Signed-off-by: Christian Marangi --- ...trolling-support-for.patch:Zone.Identifier | 0 ...LED-and-GPIO-controlling-support-for.patch | 645 ++++++++++++++++++ ...ED-and-GPIO-controlling-support-for.patch} | 299 ++++---- ...75-ath10k-use-tpt-trigger-by-default.patch | 4 +- ...h10k-Try-to-get-mac-address-from-dts.patch | 2 +- 5 files changed, 805 insertions(+), 145 deletions(-) create mode 100644 package/kernel/ath10k-ct/patches/0001-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch:Zone.Identifier create mode 100644 package/kernel/ath10k-ct/patches/201-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch rename package/kernel/mac80211/patches/ath10k/{974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch => 974-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch} (70%) diff --git a/package/kernel/ath10k-ct/patches/0001-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch:Zone.Identifier b/package/kernel/ath10k-ct/patches/0001-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch:Zone.Identifier new file mode 100644 index 0000000000..e69de29bb2 diff --git a/package/kernel/ath10k-ct/patches/201-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch b/package/kernel/ath10k-ct/patches/201-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch new file mode 100644 index 0000000000..c8d74f0e4a --- /dev/null +++ b/package/kernel/ath10k-ct/patches/201-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch @@ -0,0 +1,645 @@ +From 8e1debd82466a3fe711784ab37e6b54e56011267 Mon Sep 17 00:00:00 2001 +From: Sebastian Gottschall +Date: Mon, 13 May 2024 17:22:25 +0300 +Subject: [PATCH] wifi: ath10k: add LED and GPIO controlling support for + various chipsets + +Adds LED and GPIO Control support for 988x, 9887, 9888, 99x0, 9984 +based chipsets with on chipset connected led's using WMI Firmware API. +The LED device will get available named as "ath10k-phyX" at sysfs and +can be controlled with various triggers. +Adds also debugfs interface for gpio control. + +Signed-off-by: Sebastian Gottschall +Reviewed-by: Steve deRosier +[kvalo: major reorg and cleanup] +Signed-off-by: Kalle Valo +[ansuel: rebase and small cleanup] +Signed-off-by: Christian Marangi +Tested-by: Stefan Lippers-Hollmann +Signed-off-by: Kalle Valo +Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com +--- + drivers/net/wireless/ath/ath10k/Kconfig | 6 ++ + drivers/net/wireless/ath/ath10k/Makefile | 1 + + drivers/net/wireless/ath/ath10k/core.c | 32 ++++++++ + drivers/net/wireless/ath/ath10k/core.h | 8 ++ + drivers/net/wireless/ath/ath10k/hw.h | 1 + + drivers/net/wireless/ath/ath10k/leds.c | 90 +++++++++++++++++++++++ + drivers/net/wireless/ath/ath10k/leds.h | 34 +++++++++ + drivers/net/wireless/ath/ath10k/mac.c | 1 + + drivers/net/wireless/ath/ath10k/wmi-ops.h | 32 ++++++++ + drivers/net/wireless/ath/ath10k/wmi-tlv.c | 2 + + drivers/net/wireless/ath/ath10k/wmi.c | 54 ++++++++++++++ + drivers/net/wireless/ath/ath10k/wmi.h | 35 +++++++++ + 12 files changed, 296 insertions(+) + create mode 100644 drivers/net/wireless/ath/ath10k/leds.c + create mode 100644 drivers/net/wireless/ath/ath10k/leds.h + +diff --git a/drivers/net/wireless/ath/ath10k/Kconfig b/drivers/net/wireless/ath/ath10k/Kconfig +index e6ea884cafc1..76572cd2e1ba 100644 +--- a/drivers/net/wireless/ath/ath10k/Kconfig ++++ b/drivers/net/wireless/ath/ath10k/Kconfig +@@ -67,6 +67,12 @@ config ATH10K_DEBUGFS + + If unsure, say Y to make it easier to debug problems. + ++config ATH10K_LEDS ++ bool ++ depends on ATH10K ++ depends on LEDS_CLASS=y || LEDS_CLASS=MAC80211 ++ default y ++ + config ATH10K_SPECTRAL + bool "Atheros ath10k spectral scan support" + depends on ATH10K_DEBUGFS +diff --git a/drivers/net/wireless/ath/ath10k/Makefile b/drivers/net/wireless/ath/ath10k/Makefile +index 142c777b287f..02bf9b629038 100644 +--- a/drivers/net/wireless/ath/ath10k/Makefile ++++ b/drivers/net/wireless/ath/ath10k/Makefile +@@ -19,6 +19,7 @@ ath10k_core-$(CONFIG_ATH10K_SPECTRAL) += spectral.o + ath10k_core-$(CONFIG_NL80211_TESTMODE) += testmode.o + ath10k_core-$(CONFIG_ATH10K_TRACING) += trace.o + ath10k_core-$(CONFIG_THERMAL) += thermal.o ++ath10k_core-$(CONFIG_ATH10K_LEDS) += leds.o + ath10k_core-$(CONFIG_MAC80211_DEBUGFS) += debugfs_sta.o + ath10k_core-$(CONFIG_PM) += wow.o + ath10k_core-$(CONFIG_DEV_COREDUMP) += coredump.o +diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c +index bdf0552cd1c3..b3294287bce1 100644 +--- a/drivers/net/wireless/ath/ath10k/core.c ++++ b/drivers/net/wireless/ath/ath10k/core.c +@@ -27,6 +27,7 @@ + #include "testmode.h" + #include "wmi-ops.h" + #include "coredump.h" ++#include "leds.h" + + unsigned int ath10k_debug_mask; + EXPORT_SYMBOL(ath10k_debug_mask); +@@ -68,6 +69,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { + .name = "qca988x hw2.0", + .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR, + .uart_pin = 7, ++ .led_pin = 1, + .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, +@@ -108,6 +110,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { + .name = "qca988x hw2.0 ubiquiti", + .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR, + .uart_pin = 7, ++ .led_pin = 0, + .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, +@@ -149,6 +152,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { + .name = "qca9887 hw1.0", + .patch_load_addr = QCA9887_HW_1_0_PATCH_LOAD_ADDR, + .uart_pin = 7, ++ .led_pin = 1, + .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, +@@ -190,6 +194,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { + .name = "qca6174 hw3.2 sdio", + .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, + .uart_pin = 19, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -226,6 +231,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { + .name = "qca6164 hw2.1", + .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR, + .uart_pin = 6, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -266,6 +272,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { + .name = "qca6174 hw2.1", + .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR, + .uart_pin = 6, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -306,6 +313,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { + .name = "qca6174 hw3.0", + .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, + .uart_pin = 6, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -346,6 +354,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { + .name = "qca6174 hw3.2", + .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, + .uart_pin = 6, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -390,6 +399,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { + .name = "qca99x0 hw2.0", + .patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR, + .uart_pin = 7, ++ .led_pin = 17, + .otp_exe_param = 0x00000700, + .continuous_frag_desc = true, + .cck_rate_map_rev2 = true, +@@ -436,6 +446,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { + .name = "qca9984/qca9994 hw1.0", + .patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR, + .uart_pin = 7, ++ .led_pin = 17, + .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, + .otp_exe_param = 0x00000700, + .continuous_frag_desc = true, +@@ -488,6 +499,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { + .name = "qca9888 hw2.0", + .patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR, + .uart_pin = 7, ++ .led_pin = 17, + .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, + .otp_exe_param = 0x00000700, + .continuous_frag_desc = true, +@@ -538,6 +550,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { + .name = "qca9377 hw1.0", + .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, + .uart_pin = 6, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -578,6 +591,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { + .name = "qca9377 hw1.1", + .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, + .uart_pin = 6, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -620,6 +634,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { + .name = "qca9377 hw1.1 sdio", + .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, + .uart_pin = 19, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -653,6 +668,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { + .name = "qca4019 hw1.0", + .patch_load_addr = QCA4019_HW_1_0_PATCH_LOAD_ADDR, + .uart_pin = 7, ++ .led_pin = 0, + .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, + .otp_exe_param = 0x0010000, + .continuous_frag_desc = true, +@@ -698,6 +714,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { + .dev_id = 0, + .bus = ATH10K_BUS_SNOC, + .name = "wcn3990 hw1.0", ++ .led_pin = 0, + .continuous_frag_desc = true, + .tx_chain_mask = 0x7, + .rx_chain_mask = 0x7, +@@ -3224,6 +3241,10 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode, + goto err_hif_stop; + } + ++ status = ath10k_leds_start(ar); ++ if (status) ++ goto err_hif_stop; ++ + return 0; + + err_hif_stop: +@@ -3482,9 +3503,18 @@ static void ath10k_core_register_work(struct work_struct *work) + goto err_spectral_destroy; + } + ++ status = ath10k_leds_register(ar); ++ if (status) { ++ ath10k_err(ar, "could not register leds: %d\n", ++ status); ++ goto err_thermal_unregister; ++ } ++ + set_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags); + return; + ++err_thermal_unregister: ++ ath10k_thermal_unregister(ar); + err_spectral_destroy: + ath10k_spectral_destroy(ar); + err_debug_destroy: +@@ -3520,6 +3550,8 @@ void ath10k_core_unregister(struct ath10k *ar) + if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags)) + return; + ++ ath10k_leds_unregister(ar); ++ + ath10k_thermal_unregister(ar); + /* Stop spectral before unregistering from mac80211 to remove the + * relayfs debugfs file cleanly. Otherwise the parent debugfs tree +diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h +index b00099f0b24e..446dca74f06a 100644 +--- a/drivers/net/wireless/ath/ath10k/core.h ++++ b/drivers/net/wireless/ath/ath10k/core.h +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + + #include "htt.h" + #include "htc.h" +@@ -1258,6 +1259,13 @@ struct ath10k { + bool utf_monitor; + } testmode; + ++ struct { ++ struct gpio_led wifi_led; ++ struct led_classdev cdev; ++ char label[48]; ++ u32 gpio_state_pin; ++ } leds; ++ + struct { + /* protected by data_lock */ + u32 rx_crc_err_drop; +diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h +index 48897e5eca06..442091c6dfd2 100644 +--- a/drivers/net/wireless/ath/ath10k/hw.h ++++ b/drivers/net/wireless/ath/ath10k/hw.h +@@ -512,6 +512,7 @@ struct ath10k_hw_params { + const char *name; + u32 patch_load_addr; + int uart_pin; ++ int led_pin; + u32 otp_exe_param; + + /* Type of hw cycle counter wraparound logic, for more info +diff --git a/drivers/net/wireless/ath/ath10k/leds.c b/drivers/net/wireless/ath/ath10k/leds.c +new file mode 100644 +index 000000000000..9b1d04eb4265 +--- /dev/null ++++ b/drivers/net/wireless/ath/ath10k/leds.c +@@ -0,0 +1,90 @@ ++// SPDX-License-Identifier: ISC ++/* ++ * Copyright (c) 2005-2011 Atheros Communications Inc. ++ * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. ++ * Copyright (c) 2018 Sebastian Gottschall ++ * Copyright (c) 2018 The Linux Foundation. All rights reserved. ++ */ ++ ++#include ++ ++#include "core.h" ++#include "wmi.h" ++#include "wmi-ops.h" ++ ++#include "leds.h" ++ ++static int ath10k_leds_set_brightness_blocking(struct led_classdev *led_cdev, ++ enum led_brightness brightness) ++{ ++ struct ath10k *ar = container_of(led_cdev, struct ath10k, ++ leds.cdev); ++ struct gpio_led *led = &ar->leds.wifi_led; ++ ++ mutex_lock(&ar->conf_mutex); ++ ++ if (ar->state != ATH10K_STATE_ON) ++ goto out; ++ ++ ar->leds.gpio_state_pin = (brightness != LED_OFF) ^ led->active_low; ++ ath10k_wmi_gpio_output(ar, led->gpio, ar->leds.gpio_state_pin); ++ ++out: ++ mutex_unlock(&ar->conf_mutex); ++ ++ return 0; ++} ++ ++int ath10k_leds_start(struct ath10k *ar) ++{ ++ if (ar->hw_params.led_pin == 0) ++ /* leds not supported */ ++ return 0; ++ ++ /* under some circumstances, the gpio pin gets reconfigured ++ * to default state by the firmware, so we need to ++ * reconfigure it this behaviour has only ben seen on ++ * QCA9984 and QCA99XX devices so far ++ */ ++ ath10k_wmi_gpio_config(ar, ar->hw_params.led_pin, 0, ++ WMI_GPIO_PULL_NONE, WMI_GPIO_INTTYPE_DISABLE); ++ ath10k_wmi_gpio_output(ar, ar->hw_params.led_pin, 1); ++ ++ return 0; ++} ++ ++int ath10k_leds_register(struct ath10k *ar) ++{ ++ int ret; ++ ++ if (ar->hw_params.led_pin == 0) ++ /* leds not supported */ ++ return 0; ++ ++ snprintf(ar->leds.label, sizeof(ar->leds.label), "ath10k-%s", ++ wiphy_name(ar->hw->wiphy)); ++ ar->leds.wifi_led.active_low = 1; ++ ar->leds.wifi_led.gpio = ar->hw_params.led_pin; ++ ar->leds.wifi_led.name = ar->leds.label; ++ ar->leds.wifi_led.default_state = LEDS_GPIO_DEFSTATE_KEEP; ++ ++ ar->leds.cdev.name = ar->leds.label; ++ ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking; ++ ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger; ++ ++ ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev); ++ if (ret) ++ return ret; ++ ++ return 0; ++} ++ ++void ath10k_leds_unregister(struct ath10k *ar) ++{ ++ if (ar->hw_params.led_pin == 0) ++ /* leds not supported */ ++ return; ++ ++ led_classdev_unregister(&ar->leds.cdev); ++} ++ +diff --git a/drivers/net/wireless/ath/ath10k/leds.h b/drivers/net/wireless/ath/ath10k/leds.h +new file mode 100644 +index 000000000000..56325b0875e5 +--- /dev/null ++++ b/drivers/net/wireless/ath/ath10k/leds.h +@@ -0,0 +1,34 @@ ++/* SPDX-License-Identifier: ISC */ ++/* ++ * Copyright (c) 2005-2011 Atheros Communications Inc. ++ * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. ++ * Copyright (c) 2018 Sebastian Gottschall ++ * Copyright (c) 2018 The Linux Foundation. All rights reserved. ++ */ ++ ++#ifndef _LEDS_H_ ++#define _LEDS_H_ ++ ++#include "core.h" ++ ++#ifdef CONFIG_ATH10K_LEDS ++void ath10k_leds_unregister(struct ath10k *ar); ++int ath10k_leds_start(struct ath10k *ar); ++int ath10k_leds_register(struct ath10k *ar); ++#else ++static inline void ath10k_leds_unregister(struct ath10k *ar) ++{ ++} ++ ++static inline int ath10k_leds_start(struct ath10k *ar) ++{ ++ return 0; ++} ++ ++static inline int ath10k_leds_register(struct ath10k *ar) ++{ ++ return 0; ++} ++ ++#endif ++#endif /* _LEDS_H_ */ +diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c +index e322b528baaf..3bf67b2ecd6d 100644 +--- a/drivers/net/wireless/ath/ath10k/mac.c ++++ b/drivers/net/wireless/ath/ath10k/mac.c +@@ -25,6 +25,7 @@ + #include "wmi-tlv.h" + #include "wmi-ops.h" + #include "wow.h" ++#include "leds.h" + + /*********/ + /* Rates */ +diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h b/drivers/net/wireless/ath/ath10k/wmi-ops.h +index aa57d807491c..f3f6b5954b27 100644 +--- a/drivers/net/wireless/ath/ath10k/wmi-ops.h ++++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h +@@ -226,7 +226,10 @@ struct wmi_ops { + const struct wmi_bb_timing_cfg_arg *arg); + struct sk_buff *(*gen_per_peer_per_tid_cfg)(struct ath10k *ar, + const struct wmi_per_peer_per_tid_cfg_arg *arg); ++ struct sk_buff *(*gen_gpio_config)(struct ath10k *ar, u32 gpio_num, ++ u32 input, u32 pull_type, u32 intr_mode); + ++ struct sk_buff *(*gen_gpio_output)(struct ath10k *ar, u32 gpio_num, u32 set); + }; + + int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id); +@@ -1122,6 +1125,35 @@ ath10k_wmi_force_fw_hang(struct ath10k *ar, + return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->force_fw_hang_cmdid); + } + ++static inline int ath10k_wmi_gpio_config(struct ath10k *ar, u32 gpio_num, ++ u32 input, u32 pull_type, u32 intr_mode) ++{ ++ struct sk_buff *skb; ++ ++ if (!ar->wmi.ops->gen_gpio_config) ++ return -EOPNOTSUPP; ++ ++ skb = ar->wmi.ops->gen_gpio_config(ar, gpio_num, input, pull_type, intr_mode); ++ if (IS_ERR(skb)) ++ return PTR_ERR(skb); ++ ++ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->gpio_config_cmdid); ++} ++ ++static inline int ath10k_wmi_gpio_output(struct ath10k *ar, u32 gpio_num, u32 set) ++{ ++ struct sk_buff *skb; ++ ++ if (!ar->wmi.ops->gen_gpio_config) ++ return -EOPNOTSUPP; ++ ++ skb = ar->wmi.ops->gen_gpio_output(ar, gpio_num, set); ++ if (IS_ERR(skb)) ++ return PTR_ERR(skb); ++ ++ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->gpio_output_cmdid); ++} ++ + static inline int + ath10k_wmi_dbglog_cfg(struct ath10k *ar, u64 module_enable, u32 log_level) + { +diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c +index aed97fd121ba..dbaf26d6a7a6 100644 +--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c ++++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c +@@ -4606,6 +4606,8 @@ static const struct wmi_ops wmi_tlv_ops = { + .gen_echo = ath10k_wmi_tlv_op_gen_echo, + .gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf, + .gen_vdev_spectral_enable = ath10k_wmi_tlv_op_gen_vdev_spectral_enable, ++ /* .gen_gpio_config not implemented */ ++ /* .gen_gpio_output not implemented */ + }; + + static const struct wmi_peer_flags_map wmi_tlv_peer_flags_map = { +diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c +index 80d255aaff1b..fe2344598364 100644 +--- a/drivers/net/wireless/ath/ath10k/wmi.c ++++ b/drivers/net/wireless/ath/ath10k/wmi.c +@@ -7493,6 +7493,49 @@ ath10k_wmi_op_gen_peer_set_param(struct ath10k *ar, u32 vdev_id, + return skb; + } + ++static struct sk_buff *ath10k_wmi_op_gen_gpio_config(struct ath10k *ar, ++ u32 gpio_num, u32 input, ++ u32 pull_type, u32 intr_mode) ++{ ++ struct wmi_gpio_config_cmd *cmd; ++ struct sk_buff *skb; ++ ++ skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); ++ if (!skb) ++ return ERR_PTR(-ENOMEM); ++ ++ cmd = (struct wmi_gpio_config_cmd *)skb->data; ++ cmd->pull_type = __cpu_to_le32(pull_type); ++ cmd->gpio_num = __cpu_to_le32(gpio_num); ++ cmd->input = __cpu_to_le32(input); ++ cmd->intr_mode = __cpu_to_le32(intr_mode); ++ ++ ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi gpio_config gpio_num 0x%08x input 0x%08x pull_type 0x%08x intr_mode 0x%08x\n", ++ gpio_num, input, pull_type, intr_mode); ++ ++ return skb; ++} ++ ++static struct sk_buff *ath10k_wmi_op_gen_gpio_output(struct ath10k *ar, ++ u32 gpio_num, u32 set) ++{ ++ struct wmi_gpio_output_cmd *cmd; ++ struct sk_buff *skb; ++ ++ skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); ++ if (!skb) ++ return ERR_PTR(-ENOMEM); ++ ++ cmd = (struct wmi_gpio_output_cmd *)skb->data; ++ cmd->gpio_num = __cpu_to_le32(gpio_num); ++ cmd->set = __cpu_to_le32(set); ++ ++ ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi gpio_output gpio_num 0x%08x set 0x%08x\n", ++ gpio_num, set); ++ ++ return skb; ++} ++ + static struct sk_buff * + ath10k_wmi_op_gen_set_psmode(struct ath10k *ar, u32 vdev_id, + enum wmi_sta_ps_mode psmode) +@@ -9157,6 +9200,9 @@ static const struct wmi_ops wmi_ops = { + .fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill, + .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, + .gen_echo = ath10k_wmi_op_gen_echo, ++ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config, ++ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output, ++ + /* .gen_bcn_tmpl not implemented */ + /* .gen_prb_tmpl not implemented */ + /* .gen_p2p_go_bcn_ie not implemented */ +@@ -9227,6 +9273,8 @@ static const struct wmi_ops wmi_10_1_ops = { + .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill, + .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, + .gen_echo = ath10k_wmi_op_gen_echo, ++ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config, ++ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output, + /* .gen_bcn_tmpl not implemented */ + /* .gen_prb_tmpl not implemented */ + /* .gen_p2p_go_bcn_ie not implemented */ +@@ -9299,6 +9347,8 @@ static const struct wmi_ops wmi_10_2_ops = { + .gen_delba_send = ath10k_wmi_op_gen_delba_send, + .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill, + .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, ++ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config, ++ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output, + /* .gen_pdev_enable_adaptive_cca not implemented */ + }; + +@@ -9370,6 +9420,8 @@ static const struct wmi_ops wmi_10_2_4_ops = { + ath10k_wmi_op_gen_pdev_enable_adaptive_cca, + .get_vdev_subtype = ath10k_wmi_10_2_4_op_get_vdev_subtype, + .gen_bb_timing = ath10k_wmi_10_2_4_op_gen_bb_timing, ++ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config, ++ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output, + /* .gen_bcn_tmpl not implemented */ + /* .gen_prb_tmpl not implemented */ + /* .gen_p2p_go_bcn_ie not implemented */ +@@ -9451,6 +9503,8 @@ static const struct wmi_ops wmi_10_4_ops = { + .gen_pdev_bss_chan_info_req = ath10k_wmi_10_2_op_gen_pdev_bss_chan_info, + .gen_echo = ath10k_wmi_op_gen_echo, + .gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config, ++ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config, ++ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output, + }; + + int ath10k_wmi_attach(struct ath10k *ar) +diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h +index 2379501225a4..0faefc0a9a40 100644 +--- a/drivers/net/wireless/ath/ath10k/wmi.h ++++ b/drivers/net/wireless/ath/ath10k/wmi.h +@@ -3034,6 +3034,41 @@ enum wmi_10_4_feature_mask { + + }; + ++/* WMI_GPIO_CONFIG_CMDID */ ++enum { ++ WMI_GPIO_PULL_NONE, ++ WMI_GPIO_PULL_UP, ++ WMI_GPIO_PULL_DOWN, ++}; ++ ++enum { ++ WMI_GPIO_INTTYPE_DISABLE, ++ WMI_GPIO_INTTYPE_RISING_EDGE, ++ WMI_GPIO_INTTYPE_FALLING_EDGE, ++ WMI_GPIO_INTTYPE_BOTH_EDGE, ++ WMI_GPIO_INTTYPE_LEVEL_LOW, ++ WMI_GPIO_INTTYPE_LEVEL_HIGH ++}; ++ ++/* WMI_GPIO_CONFIG_CMDID */ ++struct wmi_gpio_config_cmd { ++ __le32 gpio_num; /* GPIO number to be setup */ ++ __le32 input; /* 0 - Output/ 1 - Input */ ++ __le32 pull_type; /* Pull type defined above */ ++ __le32 intr_mode; /* Interrupt mode defined above (Input) */ ++} __packed; ++ ++/* WMI_GPIO_OUTPUT_CMDID */ ++struct wmi_gpio_output_cmd { ++ __le32 gpio_num; /* GPIO number to be setup */ ++ __le32 set; /* Set the GPIO pin*/ ++} __packed; ++ ++/* WMI_GPIO_INPUT_EVENTID */ ++struct wmi_gpio_input_event { ++ __le32 gpio_num; /* GPIO number which changed state */ ++} __packed; ++ + struct wmi_ext_resource_config_10_4_cmd { + /* contains enum wmi_host_platform_type */ + __le32 host_platform_config; +-- +2.43.0 + diff --git a/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch b/package/kernel/mac80211/patches/ath10k/974-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch similarity index 70% rename from package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch rename to package/kernel/mac80211/patches/ath10k/974-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch index 2465470a57..05e3b2a28d 100644 --- a/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch +++ b/package/kernel/mac80211/patches/ath10k/974-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch @@ -1,103 +1,52 @@ -From: Sebastian Gottschall - -Adds LED and GPIO Control support for 988x, 9887, 9888, 99x0, 9984 based -chipsets with on chipset connected led's using WMI Firmware API. The LED -device will get available named as "ath10k-phyX" at sysfs and can be controlled -with various triggers. adds also debugfs interface for gpio control. - -This patch is specific for OpenWRt base, as is use old backported package -with old wireless source. Support for QCA9984 is removed and a simbol -is added to local-simbol file to export the actually compile the code -with the ATH10K_LEDS simbol. +From 8e1debd82466a3fe711784ab37e6b54e56011267 Mon Sep 17 00:00:00 2001 +From: Sebastian Gottschall +Date: Mon, 13 May 2024 17:22:25 +0300 +Subject: [PATCH] wifi: ath10k: add LED and GPIO controlling support for + various chipsets +Adds LED and GPIO Control support for 988x, 9887, 9888, 99x0, 9984 +based chipsets with on chipset connected led's using WMI Firmware API. +The LED device will get available named as "ath10k-phyX" at sysfs and +can be controlled with various triggers. +Adds also debugfs interface for gpio control. Signed-off-by: Sebastian Gottschall Reviewed-by: Steve deRosier [kvalo: major reorg and cleanup] Signed-off-by: Kalle Valo -Signed-off-by: Ansuel Smith +[ansuel: rebase and small cleanup] +Signed-off-by: Christian Marangi +Tested-by: Stefan Lippers-Hollmann +Signed-off-by: Kalle Valo +Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com --- - -v13: - -* only compile tested! - -* fix all checkpatch warnings - -* fix commit log - -* sizeof(struct ath10k_gpiocontrol) -> sizeof(*gpio) - -* unsigned -> unsigned int - -* remove GPIOLIB code, that should be added in a separate patch - -* rename gpio.c to leds.c - -* add leds.h - -* rename some functions: - - ath10k_attach_led() -> ath10k_leds_register() - ath10k_unregister_led() -> ath10k_leds_unregister() - ath10k_reset_led_pin() -> ath10k_leds_start() - -* call ath10k_leds_unregister() before ath10k_thermal_unregister() to preserve ordering - -* call ath10k_leds_start() only from ath10k_core_start() and not from mac.c - -* rename struct ath10k_gpiocontrol as anonymous function under struct - ath10k::leds, no need for memory allocation - -* merge ath10k_add_led() to ath10k_attach_led(), which is it's only caller - -* remove #if IS_ENABLED() checks from most of places, memory savings from those were not worth it - -* Kconfig help text improvement and move it lower in the menu, also don't enable it by default - -* switch to set_brightness_blocking() so that the callback can sleep, - then no need to use ath10k_wmi_cmd_send_nowait() and can take mutex - to access ar->state - -* don't touch ath10k_wmi_pdev_get_temperature() - -* as QCA6174/QCA9377 are not (yet) supported don't add the command to WMI-TLV interface - -* remove debugfs interface, that should be added in another patch - -* cleanup includes - - - drivers/net/wireless/ath/ath10k/Kconfig | 10 +++ - drivers/net/wireless/ath/ath10k/Makefile | 1 + - drivers/net/wireless/ath/ath10k/core.c | 22 +++++++ - drivers/net/wireless/ath/ath10k/core.h | 9 ++- - drivers/net/wireless/ath/ath10k/hw.h | 1 + - drivers/net/wireless/ath/ath10k/leds.c | 103 ++++++++++++++++++++++++++++++ - drivers/net/wireless/ath/ath10k/leds.h | 45 +++++++++++++ - drivers/net/wireless/ath/ath10k/mac.c | 1 + - drivers/net/wireless/ath/ath10k/wmi-ops.h | 32 ++++++++++ - drivers/net/wireless/ath/ath10k/wmi-tlv.c | 2 + - drivers/net/wireless/ath/ath10k/wmi.c | 54 ++++++++++++++++ - drivers/net/wireless/ath/ath10k/wmi.h | 35 ++++++++++ - 12 files changed, 314 insertions(+), 1 deletion(-) + drivers/net/wireless/ath/ath10k/Kconfig | 6 ++ + drivers/net/wireless/ath/ath10k/Makefile | 1 + + drivers/net/wireless/ath/ath10k/core.c | 32 ++++++++ + drivers/net/wireless/ath/ath10k/core.h | 8 ++ + drivers/net/wireless/ath/ath10k/hw.h | 1 + + drivers/net/wireless/ath/ath10k/leds.c | 90 +++++++++++++++++++++++ + drivers/net/wireless/ath/ath10k/leds.h | 34 +++++++++ + drivers/net/wireless/ath/ath10k/mac.c | 1 + + drivers/net/wireless/ath/ath10k/wmi-ops.h | 32 ++++++++ + drivers/net/wireless/ath/ath10k/wmi-tlv.c | 2 + + drivers/net/wireless/ath/ath10k/wmi.c | 54 ++++++++++++++ + drivers/net/wireless/ath/ath10k/wmi.h | 35 +++++++++ + 12 files changed, 296 insertions(+) create mode 100644 drivers/net/wireless/ath/ath10k/leds.c create mode 100644 drivers/net/wireless/ath/ath10k/leds.h + --- a/drivers/net/wireless/ath/ath10k/Kconfig +++ b/drivers/net/wireless/ath/ath10k/Kconfig -@@ -72,6 +72,16 @@ config ATH10K_DEBUGFS +@@ -72,6 +72,12 @@ config ATH10K_DEBUGFS If unsure, say Y to make it easier to debug problems. +config ATH10K_LEDS -+ bool "Atheros ath10k LED support" ++ bool + depends on ATH10K -+ select MAC80211_LEDS -+ select LEDS_CLASS -+ select NEW_LEDS ++ depends on LEDS_CLASS=y || LEDS_CLASS=MAC80211 + default y -+ ---help--- -+ This option is necessary, if you want LED support for chipset connected led pins. If unsure, say N. + config ATH10K_SPECTRAL bool "Atheros ath10k spectral scan support" @@ -132,47 +81,135 @@ v13: unsigned int ath10k_debug_mask; EXPORT_SYMBOL(ath10k_debug_mask); -@@ -65,6 +66,7 @@ static const struct ath10k_hw_params ath - .dev_id = QCA988X_2_0_DEVICE_ID, - .bus = ATH10K_BUS_PCI, +@@ -67,6 +68,7 @@ static const struct ath10k_hw_params ath .name = "qca988x hw2.0", -+ .led_pin = 1, .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, - .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, -@@ -146,6 +148,7 @@ static const struct ath10k_hw_params ath - .dev_id = QCA9887_1_0_DEVICE_ID, - .bus = ATH10K_BUS_PCI, - .name = "qca9887 hw1.0", + .led_pin = 1, + .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, +@@ -107,6 +109,7 @@ static const struct ath10k_hw_params ath + .name = "qca988x hw2.0 ubiquiti", + .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR, + .uart_pin = 7, ++ .led_pin = 0, + .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, +@@ -148,6 +151,7 @@ static const struct ath10k_hw_params ath + .name = "qca9887 hw1.0", .patch_load_addr = QCA9887_HW_1_0_PATCH_LOAD_ADDR, .uart_pin = 7, ++ .led_pin = 1, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, -@@ -387,6 +390,7 @@ static const struct ath10k_hw_params ath - .dev_id = QCA99X0_2_0_DEVICE_ID, - .bus = ATH10K_BUS_PCI, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, +@@ -189,6 +193,7 @@ static const struct ath10k_hw_params ath + .name = "qca6174 hw3.2 sdio", + .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, + .uart_pin = 19, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -225,6 +230,7 @@ static const struct ath10k_hw_params ath + .name = "qca6164 hw2.1", + .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR, + .uart_pin = 6, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -265,6 +271,7 @@ static const struct ath10k_hw_params ath + .name = "qca6174 hw2.1", + .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR, + .uart_pin = 6, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -305,6 +312,7 @@ static const struct ath10k_hw_params ath + .name = "qca6174 hw3.0", + .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, + .uart_pin = 6, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -345,6 +353,7 @@ static const struct ath10k_hw_params ath + .name = "qca6174 hw3.2", + .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, + .uart_pin = 6, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -389,6 +398,7 @@ static const struct ath10k_hw_params ath .name = "qca99x0 hw2.0", -+ .led_pin = 17, .patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, - .otp_exe_param = 0x00000700, -@@ -433,6 +437,7 @@ static const struct ath10k_hw_params ath - .dev_id = QCA9984_1_0_DEVICE_ID, - .bus = ATH10K_BUS_PCI, - .name = "qca9984/qca9994 hw1.0", + .led_pin = 17, + .otp_exe_param = 0x00000700, + .continuous_frag_desc = true, + .cck_rate_map_rev2 = true, +@@ -435,6 +445,7 @@ static const struct ath10k_hw_params ath + .name = "qca9984/qca9994 hw1.0", .patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR, .uart_pin = 7, - .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, -@@ -486,6 +491,7 @@ static const struct ath10k_hw_params ath - .dev_id = QCA9888_2_0_DEVICE_ID, - .bus = ATH10K_BUS_PCI, - .name = "qca9888 hw2.0", + .led_pin = 17, + .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, + .otp_exe_param = 0x00000700, + .continuous_frag_desc = true, +@@ -488,6 +499,7 @@ static const struct ath10k_hw_params ath + .name = "qca9888 hw2.0", .patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, ++ .led_pin = 17, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, -@@ -3222,6 +3228,10 @@ int ath10k_core_start(struct ath10k *ar, + .otp_exe_param = 0x00000700, + .continuous_frag_desc = true, +@@ -538,6 +550,7 @@ static const struct ath10k_hw_params ath + .name = "qca9377 hw1.0", + .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, + .uart_pin = 6, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -578,6 +591,7 @@ static const struct ath10k_hw_params ath + .name = "qca9377 hw1.1", + .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, + .uart_pin = 6, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -620,6 +634,7 @@ static const struct ath10k_hw_params ath + .name = "qca9377 hw1.1 sdio", + .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, + .uart_pin = 19, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -653,6 +668,7 @@ static const struct ath10k_hw_params ath + .name = "qca4019 hw1.0", + .patch_load_addr = QCA4019_HW_1_0_PATCH_LOAD_ADDR, + .uart_pin = 7, ++ .led_pin = 0, + .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, + .otp_exe_param = 0x0010000, + .continuous_frag_desc = true, +@@ -698,6 +714,7 @@ static const struct ath10k_hw_params ath + .dev_id = 0, + .bus = ATH10K_BUS_SNOC, + .name = "wcn3990 hw1.0", ++ .led_pin = 0, + .continuous_frag_desc = true, + .tx_chain_mask = 0x7, + .rx_chain_mask = 0x7, +@@ -3222,6 +3239,10 @@ int ath10k_core_start(struct ath10k *ar, goto err_hif_stop; } @@ -183,7 +220,7 @@ v13: return 0; err_hif_stop: -@@ -3480,9 +3490,18 @@ static void ath10k_core_register_work(st +@@ -3480,9 +3501,18 @@ static void ath10k_core_register_work(st goto err_spectral_destroy; } @@ -202,7 +239,7 @@ v13: err_spectral_destroy: ath10k_spectral_destroy(ar); err_debug_destroy: -@@ -3528,6 +3547,8 @@ void ath10k_core_unregister(struct ath10 +@@ -3528,6 +3558,8 @@ void ath10k_core_unregister(struct ath10 if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags)) return; @@ -247,24 +284,13 @@ v13: /* Type of hw cycle counter wraparound logic, for more info --- /dev/null +++ b/drivers/net/wireless/ath/ath10k/leds.c -@@ -0,0 +1,103 @@ +@@ -0,0 +1,90 @@ ++// SPDX-License-Identifier: ISC +/* + * Copyright (c) 2005-2011 Atheros Communications Inc. + * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. + * Copyright (c) 2018 Sebastian Gottschall -+ * Copyright (c) 2018, The Linux Foundation. All rights reserved. -+ * -+ * Permission to use, copy, modify, and/or distribute this software for any -+ * purpose with or without fee is hereby granted, provided that the above -+ * copyright notice and this permission notice appear in all copies. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ++ * Copyright (c) 2018 The Linux Foundation. All rights reserved. + */ + +#include @@ -331,8 +357,6 @@ v13: + + ar->leds.cdev.name = ar->leds.label; + ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking; -+ -+ /* FIXME: this assignment doesn't make sense as it's NULL, remove it? */ + ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger; + + ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev); @@ -353,22 +377,15 @@ v13: + --- /dev/null +++ b/drivers/net/wireless/ath/ath10k/leds.h -@@ -0,0 +1,41 @@ +@@ -0,0 +1,34 @@ ++/* SPDX-License-Identifier: ISC */ +/* -+ * Copyright (c) 2018, The Linux Foundation. All rights reserved. -+ * -+ * Permission to use, copy, modify, and/or distribute this software for any -+ * purpose with or without fee is hereby granted, provided that the above -+ * copyright notice and this permission notice appear in all copies. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ++ * Copyright (c) 2005-2011 Atheros Communications Inc. ++ * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. ++ * Copyright (c) 2018 Sebastian Gottschall ++ * Copyright (c) 2018 The Linux Foundation. All rights reserved. + */ ++ +#ifndef _LEDS_H_ +#define _LEDS_H_ + @@ -569,7 +586,7 @@ v13: }; -+/* WMI_GPIO_CONFIG_CMDID */ ++/* WMI_GPIO_CPTCFG_CMDID */ +enum { + WMI_GPIO_PULL_NONE, + WMI_GPIO_PULL_UP, @@ -585,7 +602,7 @@ v13: + WMI_GPIO_INTTYPE_LEVEL_HIGH +}; + -+/* WMI_GPIO_CONFIG_CMDID */ ++/* WMI_GPIO_CPTCFG_CMDID */ +struct wmi_gpio_config_cmd { + __le32 gpio_num; /* GPIO number to be setup */ + __le32 input; /* 0 - Output/ 1 - Input */ diff --git a/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch index 95bd48f923..2e598199c4 100644 --- a/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch +++ b/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch @@ -29,12 +29,10 @@ Signed-off-by: Mathias Kresin }; --- a/drivers/net/wireless/ath/ath10k/leds.c +++ b/drivers/net/wireless/ath/ath10k/leds.c -@@ -81,9 +81,7 @@ int ath10k_leds_register(struct ath10k * +@@ -70,7 +70,7 @@ int ath10k_leds_register(struct ath10k * ar->leds.cdev.name = ar->leds.label; ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking; -- -- /* FIXME: this assignment doesn't make sense as it's NULL, remove it? */ - ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger; + ar->leds.cdev.default_trigger = ar->led_default_trigger; diff --git a/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch b/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch index cfa0f9108a..6439ff9803 100644 --- a/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch +++ b/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch @@ -26,7 +26,7 @@ Signed-off-by: Ansuel Smith #include #include #include -@@ -3398,6 +3399,8 @@ static int ath10k_core_probe_fw(struct a +@@ -3409,6 +3410,8 @@ static int ath10k_core_probe_fw(struct a device_get_mac_address(ar->dev, ar->mac_addr); From 29b98a019270da41ca7b4cb9c0a69b3dee48893d Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Mon, 17 Jun 2024 18:33:19 +0200 Subject: [PATCH 17/27] Revert "mac80211: ath10k: replace LEDs patch with upstream patch" This reverts commit dc9c5d1ee72564d97b7d76ab4db239e038916d31. Additional file for ath10k-ct slipped in, revert for a better version pushed later. Signed-off-by: Christian Marangi --- ...trolling-support-for.patch:Zone.Identifier | 0 ...LED-and-GPIO-controlling-support-for.patch | 645 ------------------ ...olling-support-for-various-chipsets.patch} | 291 ++++---- ...75-ath10k-use-tpt-trigger-by-default.patch | 4 +- ...h10k-Try-to-get-mac-address-from-dts.patch | 2 +- 5 files changed, 141 insertions(+), 801 deletions(-) delete mode 100644 package/kernel/ath10k-ct/patches/0001-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch:Zone.Identifier delete mode 100644 package/kernel/ath10k-ct/patches/201-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch rename package/kernel/mac80211/patches/ath10k/{974-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch => 974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch} (70%) diff --git a/package/kernel/ath10k-ct/patches/0001-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch:Zone.Identifier b/package/kernel/ath10k-ct/patches/0001-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch:Zone.Identifier deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/package/kernel/ath10k-ct/patches/201-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch b/package/kernel/ath10k-ct/patches/201-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch deleted file mode 100644 index c8d74f0e4a..0000000000 --- a/package/kernel/ath10k-ct/patches/201-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch +++ /dev/null @@ -1,645 +0,0 @@ -From 8e1debd82466a3fe711784ab37e6b54e56011267 Mon Sep 17 00:00:00 2001 -From: Sebastian Gottschall -Date: Mon, 13 May 2024 17:22:25 +0300 -Subject: [PATCH] wifi: ath10k: add LED and GPIO controlling support for - various chipsets - -Adds LED and GPIO Control support for 988x, 9887, 9888, 99x0, 9984 -based chipsets with on chipset connected led's using WMI Firmware API. -The LED device will get available named as "ath10k-phyX" at sysfs and -can be controlled with various triggers. -Adds also debugfs interface for gpio control. - -Signed-off-by: Sebastian Gottschall -Reviewed-by: Steve deRosier -[kvalo: major reorg and cleanup] -Signed-off-by: Kalle Valo -[ansuel: rebase and small cleanup] -Signed-off-by: Christian Marangi -Tested-by: Stefan Lippers-Hollmann -Signed-off-by: Kalle Valo -Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com ---- - drivers/net/wireless/ath/ath10k/Kconfig | 6 ++ - drivers/net/wireless/ath/ath10k/Makefile | 1 + - drivers/net/wireless/ath/ath10k/core.c | 32 ++++++++ - drivers/net/wireless/ath/ath10k/core.h | 8 ++ - drivers/net/wireless/ath/ath10k/hw.h | 1 + - drivers/net/wireless/ath/ath10k/leds.c | 90 +++++++++++++++++++++++ - drivers/net/wireless/ath/ath10k/leds.h | 34 +++++++++ - drivers/net/wireless/ath/ath10k/mac.c | 1 + - drivers/net/wireless/ath/ath10k/wmi-ops.h | 32 ++++++++ - drivers/net/wireless/ath/ath10k/wmi-tlv.c | 2 + - drivers/net/wireless/ath/ath10k/wmi.c | 54 ++++++++++++++ - drivers/net/wireless/ath/ath10k/wmi.h | 35 +++++++++ - 12 files changed, 296 insertions(+) - create mode 100644 drivers/net/wireless/ath/ath10k/leds.c - create mode 100644 drivers/net/wireless/ath/ath10k/leds.h - -diff --git a/drivers/net/wireless/ath/ath10k/Kconfig b/drivers/net/wireless/ath/ath10k/Kconfig -index e6ea884cafc1..76572cd2e1ba 100644 ---- a/drivers/net/wireless/ath/ath10k/Kconfig -+++ b/drivers/net/wireless/ath/ath10k/Kconfig -@@ -67,6 +67,12 @@ config ATH10K_DEBUGFS - - If unsure, say Y to make it easier to debug problems. - -+config ATH10K_LEDS -+ bool -+ depends on ATH10K -+ depends on LEDS_CLASS=y || LEDS_CLASS=MAC80211 -+ default y -+ - config ATH10K_SPECTRAL - bool "Atheros ath10k spectral scan support" - depends on ATH10K_DEBUGFS -diff --git a/drivers/net/wireless/ath/ath10k/Makefile b/drivers/net/wireless/ath/ath10k/Makefile -index 142c777b287f..02bf9b629038 100644 ---- a/drivers/net/wireless/ath/ath10k/Makefile -+++ b/drivers/net/wireless/ath/ath10k/Makefile -@@ -19,6 +19,7 @@ ath10k_core-$(CONFIG_ATH10K_SPECTRAL) += spectral.o - ath10k_core-$(CONFIG_NL80211_TESTMODE) += testmode.o - ath10k_core-$(CONFIG_ATH10K_TRACING) += trace.o - ath10k_core-$(CONFIG_THERMAL) += thermal.o -+ath10k_core-$(CONFIG_ATH10K_LEDS) += leds.o - ath10k_core-$(CONFIG_MAC80211_DEBUGFS) += debugfs_sta.o - ath10k_core-$(CONFIG_PM) += wow.o - ath10k_core-$(CONFIG_DEV_COREDUMP) += coredump.o -diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c -index bdf0552cd1c3..b3294287bce1 100644 ---- a/drivers/net/wireless/ath/ath10k/core.c -+++ b/drivers/net/wireless/ath/ath10k/core.c -@@ -27,6 +27,7 @@ - #include "testmode.h" - #include "wmi-ops.h" - #include "coredump.h" -+#include "leds.h" - - unsigned int ath10k_debug_mask; - EXPORT_SYMBOL(ath10k_debug_mask); -@@ -68,6 +69,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { - .name = "qca988x hw2.0", - .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR, - .uart_pin = 7, -+ .led_pin = 1, - .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, -@@ -108,6 +110,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { - .name = "qca988x hw2.0 ubiquiti", - .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR, - .uart_pin = 7, -+ .led_pin = 0, - .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, -@@ -149,6 +152,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { - .name = "qca9887 hw1.0", - .patch_load_addr = QCA9887_HW_1_0_PATCH_LOAD_ADDR, - .uart_pin = 7, -+ .led_pin = 1, - .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, -@@ -190,6 +194,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { - .name = "qca6174 hw3.2 sdio", - .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, - .uart_pin = 19, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -226,6 +231,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { - .name = "qca6164 hw2.1", - .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR, - .uart_pin = 6, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -266,6 +272,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { - .name = "qca6174 hw2.1", - .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR, - .uart_pin = 6, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -306,6 +313,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { - .name = "qca6174 hw3.0", - .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, - .uart_pin = 6, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -346,6 +354,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { - .name = "qca6174 hw3.2", - .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, - .uart_pin = 6, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -390,6 +399,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { - .name = "qca99x0 hw2.0", - .patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR, - .uart_pin = 7, -+ .led_pin = 17, - .otp_exe_param = 0x00000700, - .continuous_frag_desc = true, - .cck_rate_map_rev2 = true, -@@ -436,6 +446,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { - .name = "qca9984/qca9994 hw1.0", - .patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR, - .uart_pin = 7, -+ .led_pin = 17, - .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, - .otp_exe_param = 0x00000700, - .continuous_frag_desc = true, -@@ -488,6 +499,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { - .name = "qca9888 hw2.0", - .patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR, - .uart_pin = 7, -+ .led_pin = 17, - .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, - .otp_exe_param = 0x00000700, - .continuous_frag_desc = true, -@@ -538,6 +550,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { - .name = "qca9377 hw1.0", - .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, - .uart_pin = 6, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -578,6 +591,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { - .name = "qca9377 hw1.1", - .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, - .uart_pin = 6, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -620,6 +634,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { - .name = "qca9377 hw1.1 sdio", - .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, - .uart_pin = 19, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -653,6 +668,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { - .name = "qca4019 hw1.0", - .patch_load_addr = QCA4019_HW_1_0_PATCH_LOAD_ADDR, - .uart_pin = 7, -+ .led_pin = 0, - .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, - .otp_exe_param = 0x0010000, - .continuous_frag_desc = true, -@@ -698,6 +714,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { - .dev_id = 0, - .bus = ATH10K_BUS_SNOC, - .name = "wcn3990 hw1.0", -+ .led_pin = 0, - .continuous_frag_desc = true, - .tx_chain_mask = 0x7, - .rx_chain_mask = 0x7, -@@ -3224,6 +3241,10 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode, - goto err_hif_stop; - } - -+ status = ath10k_leds_start(ar); -+ if (status) -+ goto err_hif_stop; -+ - return 0; - - err_hif_stop: -@@ -3482,9 +3503,18 @@ static void ath10k_core_register_work(struct work_struct *work) - goto err_spectral_destroy; - } - -+ status = ath10k_leds_register(ar); -+ if (status) { -+ ath10k_err(ar, "could not register leds: %d\n", -+ status); -+ goto err_thermal_unregister; -+ } -+ - set_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags); - return; - -+err_thermal_unregister: -+ ath10k_thermal_unregister(ar); - err_spectral_destroy: - ath10k_spectral_destroy(ar); - err_debug_destroy: -@@ -3520,6 +3550,8 @@ void ath10k_core_unregister(struct ath10k *ar) - if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags)) - return; - -+ ath10k_leds_unregister(ar); -+ - ath10k_thermal_unregister(ar); - /* Stop spectral before unregistering from mac80211 to remove the - * relayfs debugfs file cleanly. Otherwise the parent debugfs tree -diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h -index b00099f0b24e..446dca74f06a 100644 ---- a/drivers/net/wireless/ath/ath10k/core.h -+++ b/drivers/net/wireless/ath/ath10k/core.h -@@ -15,6 +15,7 @@ - #include - #include - #include -+#include - - #include "htt.h" - #include "htc.h" -@@ -1258,6 +1259,13 @@ struct ath10k { - bool utf_monitor; - } testmode; - -+ struct { -+ struct gpio_led wifi_led; -+ struct led_classdev cdev; -+ char label[48]; -+ u32 gpio_state_pin; -+ } leds; -+ - struct { - /* protected by data_lock */ - u32 rx_crc_err_drop; -diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h -index 48897e5eca06..442091c6dfd2 100644 ---- a/drivers/net/wireless/ath/ath10k/hw.h -+++ b/drivers/net/wireless/ath/ath10k/hw.h -@@ -512,6 +512,7 @@ struct ath10k_hw_params { - const char *name; - u32 patch_load_addr; - int uart_pin; -+ int led_pin; - u32 otp_exe_param; - - /* Type of hw cycle counter wraparound logic, for more info -diff --git a/drivers/net/wireless/ath/ath10k/leds.c b/drivers/net/wireless/ath/ath10k/leds.c -new file mode 100644 -index 000000000000..9b1d04eb4265 ---- /dev/null -+++ b/drivers/net/wireless/ath/ath10k/leds.c -@@ -0,0 +1,90 @@ -+// SPDX-License-Identifier: ISC -+/* -+ * Copyright (c) 2005-2011 Atheros Communications Inc. -+ * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. -+ * Copyright (c) 2018 Sebastian Gottschall -+ * Copyright (c) 2018 The Linux Foundation. All rights reserved. -+ */ -+ -+#include -+ -+#include "core.h" -+#include "wmi.h" -+#include "wmi-ops.h" -+ -+#include "leds.h" -+ -+static int ath10k_leds_set_brightness_blocking(struct led_classdev *led_cdev, -+ enum led_brightness brightness) -+{ -+ struct ath10k *ar = container_of(led_cdev, struct ath10k, -+ leds.cdev); -+ struct gpio_led *led = &ar->leds.wifi_led; -+ -+ mutex_lock(&ar->conf_mutex); -+ -+ if (ar->state != ATH10K_STATE_ON) -+ goto out; -+ -+ ar->leds.gpio_state_pin = (brightness != LED_OFF) ^ led->active_low; -+ ath10k_wmi_gpio_output(ar, led->gpio, ar->leds.gpio_state_pin); -+ -+out: -+ mutex_unlock(&ar->conf_mutex); -+ -+ return 0; -+} -+ -+int ath10k_leds_start(struct ath10k *ar) -+{ -+ if (ar->hw_params.led_pin == 0) -+ /* leds not supported */ -+ return 0; -+ -+ /* under some circumstances, the gpio pin gets reconfigured -+ * to default state by the firmware, so we need to -+ * reconfigure it this behaviour has only ben seen on -+ * QCA9984 and QCA99XX devices so far -+ */ -+ ath10k_wmi_gpio_config(ar, ar->hw_params.led_pin, 0, -+ WMI_GPIO_PULL_NONE, WMI_GPIO_INTTYPE_DISABLE); -+ ath10k_wmi_gpio_output(ar, ar->hw_params.led_pin, 1); -+ -+ return 0; -+} -+ -+int ath10k_leds_register(struct ath10k *ar) -+{ -+ int ret; -+ -+ if (ar->hw_params.led_pin == 0) -+ /* leds not supported */ -+ return 0; -+ -+ snprintf(ar->leds.label, sizeof(ar->leds.label), "ath10k-%s", -+ wiphy_name(ar->hw->wiphy)); -+ ar->leds.wifi_led.active_low = 1; -+ ar->leds.wifi_led.gpio = ar->hw_params.led_pin; -+ ar->leds.wifi_led.name = ar->leds.label; -+ ar->leds.wifi_led.default_state = LEDS_GPIO_DEFSTATE_KEEP; -+ -+ ar->leds.cdev.name = ar->leds.label; -+ ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking; -+ ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger; -+ -+ ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev); -+ if (ret) -+ return ret; -+ -+ return 0; -+} -+ -+void ath10k_leds_unregister(struct ath10k *ar) -+{ -+ if (ar->hw_params.led_pin == 0) -+ /* leds not supported */ -+ return; -+ -+ led_classdev_unregister(&ar->leds.cdev); -+} -+ -diff --git a/drivers/net/wireless/ath/ath10k/leds.h b/drivers/net/wireless/ath/ath10k/leds.h -new file mode 100644 -index 000000000000..56325b0875e5 ---- /dev/null -+++ b/drivers/net/wireless/ath/ath10k/leds.h -@@ -0,0 +1,34 @@ -+/* SPDX-License-Identifier: ISC */ -+/* -+ * Copyright (c) 2005-2011 Atheros Communications Inc. -+ * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. -+ * Copyright (c) 2018 Sebastian Gottschall -+ * Copyright (c) 2018 The Linux Foundation. All rights reserved. -+ */ -+ -+#ifndef _LEDS_H_ -+#define _LEDS_H_ -+ -+#include "core.h" -+ -+#ifdef CONFIG_ATH10K_LEDS -+void ath10k_leds_unregister(struct ath10k *ar); -+int ath10k_leds_start(struct ath10k *ar); -+int ath10k_leds_register(struct ath10k *ar); -+#else -+static inline void ath10k_leds_unregister(struct ath10k *ar) -+{ -+} -+ -+static inline int ath10k_leds_start(struct ath10k *ar) -+{ -+ return 0; -+} -+ -+static inline int ath10k_leds_register(struct ath10k *ar) -+{ -+ return 0; -+} -+ -+#endif -+#endif /* _LEDS_H_ */ -diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c -index e322b528baaf..3bf67b2ecd6d 100644 ---- a/drivers/net/wireless/ath/ath10k/mac.c -+++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -25,6 +25,7 @@ - #include "wmi-tlv.h" - #include "wmi-ops.h" - #include "wow.h" -+#include "leds.h" - - /*********/ - /* Rates */ -diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h b/drivers/net/wireless/ath/ath10k/wmi-ops.h -index aa57d807491c..f3f6b5954b27 100644 ---- a/drivers/net/wireless/ath/ath10k/wmi-ops.h -+++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h -@@ -226,7 +226,10 @@ struct wmi_ops { - const struct wmi_bb_timing_cfg_arg *arg); - struct sk_buff *(*gen_per_peer_per_tid_cfg)(struct ath10k *ar, - const struct wmi_per_peer_per_tid_cfg_arg *arg); -+ struct sk_buff *(*gen_gpio_config)(struct ath10k *ar, u32 gpio_num, -+ u32 input, u32 pull_type, u32 intr_mode); - -+ struct sk_buff *(*gen_gpio_output)(struct ath10k *ar, u32 gpio_num, u32 set); - }; - - int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id); -@@ -1122,6 +1125,35 @@ ath10k_wmi_force_fw_hang(struct ath10k *ar, - return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->force_fw_hang_cmdid); - } - -+static inline int ath10k_wmi_gpio_config(struct ath10k *ar, u32 gpio_num, -+ u32 input, u32 pull_type, u32 intr_mode) -+{ -+ struct sk_buff *skb; -+ -+ if (!ar->wmi.ops->gen_gpio_config) -+ return -EOPNOTSUPP; -+ -+ skb = ar->wmi.ops->gen_gpio_config(ar, gpio_num, input, pull_type, intr_mode); -+ if (IS_ERR(skb)) -+ return PTR_ERR(skb); -+ -+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->gpio_config_cmdid); -+} -+ -+static inline int ath10k_wmi_gpio_output(struct ath10k *ar, u32 gpio_num, u32 set) -+{ -+ struct sk_buff *skb; -+ -+ if (!ar->wmi.ops->gen_gpio_config) -+ return -EOPNOTSUPP; -+ -+ skb = ar->wmi.ops->gen_gpio_output(ar, gpio_num, set); -+ if (IS_ERR(skb)) -+ return PTR_ERR(skb); -+ -+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->gpio_output_cmdid); -+} -+ - static inline int - ath10k_wmi_dbglog_cfg(struct ath10k *ar, u64 module_enable, u32 log_level) - { -diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c -index aed97fd121ba..dbaf26d6a7a6 100644 ---- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c -+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c -@@ -4606,6 +4606,8 @@ static const struct wmi_ops wmi_tlv_ops = { - .gen_echo = ath10k_wmi_tlv_op_gen_echo, - .gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf, - .gen_vdev_spectral_enable = ath10k_wmi_tlv_op_gen_vdev_spectral_enable, -+ /* .gen_gpio_config not implemented */ -+ /* .gen_gpio_output not implemented */ - }; - - static const struct wmi_peer_flags_map wmi_tlv_peer_flags_map = { -diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c -index 80d255aaff1b..fe2344598364 100644 ---- a/drivers/net/wireless/ath/ath10k/wmi.c -+++ b/drivers/net/wireless/ath/ath10k/wmi.c -@@ -7493,6 +7493,49 @@ ath10k_wmi_op_gen_peer_set_param(struct ath10k *ar, u32 vdev_id, - return skb; - } - -+static struct sk_buff *ath10k_wmi_op_gen_gpio_config(struct ath10k *ar, -+ u32 gpio_num, u32 input, -+ u32 pull_type, u32 intr_mode) -+{ -+ struct wmi_gpio_config_cmd *cmd; -+ struct sk_buff *skb; -+ -+ skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); -+ if (!skb) -+ return ERR_PTR(-ENOMEM); -+ -+ cmd = (struct wmi_gpio_config_cmd *)skb->data; -+ cmd->pull_type = __cpu_to_le32(pull_type); -+ cmd->gpio_num = __cpu_to_le32(gpio_num); -+ cmd->input = __cpu_to_le32(input); -+ cmd->intr_mode = __cpu_to_le32(intr_mode); -+ -+ ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi gpio_config gpio_num 0x%08x input 0x%08x pull_type 0x%08x intr_mode 0x%08x\n", -+ gpio_num, input, pull_type, intr_mode); -+ -+ return skb; -+} -+ -+static struct sk_buff *ath10k_wmi_op_gen_gpio_output(struct ath10k *ar, -+ u32 gpio_num, u32 set) -+{ -+ struct wmi_gpio_output_cmd *cmd; -+ struct sk_buff *skb; -+ -+ skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd)); -+ if (!skb) -+ return ERR_PTR(-ENOMEM); -+ -+ cmd = (struct wmi_gpio_output_cmd *)skb->data; -+ cmd->gpio_num = __cpu_to_le32(gpio_num); -+ cmd->set = __cpu_to_le32(set); -+ -+ ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi gpio_output gpio_num 0x%08x set 0x%08x\n", -+ gpio_num, set); -+ -+ return skb; -+} -+ - static struct sk_buff * - ath10k_wmi_op_gen_set_psmode(struct ath10k *ar, u32 vdev_id, - enum wmi_sta_ps_mode psmode) -@@ -9157,6 +9200,9 @@ static const struct wmi_ops wmi_ops = { - .fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill, - .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, - .gen_echo = ath10k_wmi_op_gen_echo, -+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config, -+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output, -+ - /* .gen_bcn_tmpl not implemented */ - /* .gen_prb_tmpl not implemented */ - /* .gen_p2p_go_bcn_ie not implemented */ -@@ -9227,6 +9273,8 @@ static const struct wmi_ops wmi_10_1_ops = { - .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill, - .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, - .gen_echo = ath10k_wmi_op_gen_echo, -+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config, -+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output, - /* .gen_bcn_tmpl not implemented */ - /* .gen_prb_tmpl not implemented */ - /* .gen_p2p_go_bcn_ie not implemented */ -@@ -9299,6 +9347,8 @@ static const struct wmi_ops wmi_10_2_ops = { - .gen_delba_send = ath10k_wmi_op_gen_delba_send, - .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill, - .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, -+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config, -+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output, - /* .gen_pdev_enable_adaptive_cca not implemented */ - }; - -@@ -9370,6 +9420,8 @@ static const struct wmi_ops wmi_10_2_4_ops = { - ath10k_wmi_op_gen_pdev_enable_adaptive_cca, - .get_vdev_subtype = ath10k_wmi_10_2_4_op_get_vdev_subtype, - .gen_bb_timing = ath10k_wmi_10_2_4_op_gen_bb_timing, -+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config, -+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output, - /* .gen_bcn_tmpl not implemented */ - /* .gen_prb_tmpl not implemented */ - /* .gen_p2p_go_bcn_ie not implemented */ -@@ -9451,6 +9503,8 @@ static const struct wmi_ops wmi_10_4_ops = { - .gen_pdev_bss_chan_info_req = ath10k_wmi_10_2_op_gen_pdev_bss_chan_info, - .gen_echo = ath10k_wmi_op_gen_echo, - .gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config, -+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config, -+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output, - }; - - int ath10k_wmi_attach(struct ath10k *ar) -diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h -index 2379501225a4..0faefc0a9a40 100644 ---- a/drivers/net/wireless/ath/ath10k/wmi.h -+++ b/drivers/net/wireless/ath/ath10k/wmi.h -@@ -3034,6 +3034,41 @@ enum wmi_10_4_feature_mask { - - }; - -+/* WMI_GPIO_CONFIG_CMDID */ -+enum { -+ WMI_GPIO_PULL_NONE, -+ WMI_GPIO_PULL_UP, -+ WMI_GPIO_PULL_DOWN, -+}; -+ -+enum { -+ WMI_GPIO_INTTYPE_DISABLE, -+ WMI_GPIO_INTTYPE_RISING_EDGE, -+ WMI_GPIO_INTTYPE_FALLING_EDGE, -+ WMI_GPIO_INTTYPE_BOTH_EDGE, -+ WMI_GPIO_INTTYPE_LEVEL_LOW, -+ WMI_GPIO_INTTYPE_LEVEL_HIGH -+}; -+ -+/* WMI_GPIO_CONFIG_CMDID */ -+struct wmi_gpio_config_cmd { -+ __le32 gpio_num; /* GPIO number to be setup */ -+ __le32 input; /* 0 - Output/ 1 - Input */ -+ __le32 pull_type; /* Pull type defined above */ -+ __le32 intr_mode; /* Interrupt mode defined above (Input) */ -+} __packed; -+ -+/* WMI_GPIO_OUTPUT_CMDID */ -+struct wmi_gpio_output_cmd { -+ __le32 gpio_num; /* GPIO number to be setup */ -+ __le32 set; /* Set the GPIO pin*/ -+} __packed; -+ -+/* WMI_GPIO_INPUT_EVENTID */ -+struct wmi_gpio_input_event { -+ __le32 gpio_num; /* GPIO number which changed state */ -+} __packed; -+ - struct wmi_ext_resource_config_10_4_cmd { - /* contains enum wmi_host_platform_type */ - __le32 host_platform_config; --- -2.43.0 - diff --git a/package/kernel/mac80211/patches/ath10k/974-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch b/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch similarity index 70% rename from package/kernel/mac80211/patches/ath10k/974-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch rename to package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch index 05e3b2a28d..2465470a57 100644 --- a/package/kernel/mac80211/patches/ath10k/974-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch +++ b/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch @@ -1,52 +1,103 @@ -From 8e1debd82466a3fe711784ab37e6b54e56011267 Mon Sep 17 00:00:00 2001 -From: Sebastian Gottschall -Date: Mon, 13 May 2024 17:22:25 +0300 -Subject: [PATCH] wifi: ath10k: add LED and GPIO controlling support for - various chipsets +From: Sebastian Gottschall + +Adds LED and GPIO Control support for 988x, 9887, 9888, 99x0, 9984 based +chipsets with on chipset connected led's using WMI Firmware API. The LED +device will get available named as "ath10k-phyX" at sysfs and can be controlled +with various triggers. adds also debugfs interface for gpio control. + +This patch is specific for OpenWRt base, as is use old backported package +with old wireless source. Support for QCA9984 is removed and a simbol +is added to local-simbol file to export the actually compile the code +with the ATH10K_LEDS simbol. -Adds LED and GPIO Control support for 988x, 9887, 9888, 99x0, 9984 -based chipsets with on chipset connected led's using WMI Firmware API. -The LED device will get available named as "ath10k-phyX" at sysfs and -can be controlled with various triggers. -Adds also debugfs interface for gpio control. Signed-off-by: Sebastian Gottschall Reviewed-by: Steve deRosier [kvalo: major reorg and cleanup] Signed-off-by: Kalle Valo -[ansuel: rebase and small cleanup] -Signed-off-by: Christian Marangi -Tested-by: Stefan Lippers-Hollmann -Signed-off-by: Kalle Valo -Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com +Signed-off-by: Ansuel Smith --- - drivers/net/wireless/ath/ath10k/Kconfig | 6 ++ - drivers/net/wireless/ath/ath10k/Makefile | 1 + - drivers/net/wireless/ath/ath10k/core.c | 32 ++++++++ - drivers/net/wireless/ath/ath10k/core.h | 8 ++ - drivers/net/wireless/ath/ath10k/hw.h | 1 + - drivers/net/wireless/ath/ath10k/leds.c | 90 +++++++++++++++++++++++ - drivers/net/wireless/ath/ath10k/leds.h | 34 +++++++++ - drivers/net/wireless/ath/ath10k/mac.c | 1 + - drivers/net/wireless/ath/ath10k/wmi-ops.h | 32 ++++++++ - drivers/net/wireless/ath/ath10k/wmi-tlv.c | 2 + - drivers/net/wireless/ath/ath10k/wmi.c | 54 ++++++++++++++ - drivers/net/wireless/ath/ath10k/wmi.h | 35 +++++++++ - 12 files changed, 296 insertions(+) + +v13: + +* only compile tested! + +* fix all checkpatch warnings + +* fix commit log + +* sizeof(struct ath10k_gpiocontrol) -> sizeof(*gpio) + +* unsigned -> unsigned int + +* remove GPIOLIB code, that should be added in a separate patch + +* rename gpio.c to leds.c + +* add leds.h + +* rename some functions: + + ath10k_attach_led() -> ath10k_leds_register() + ath10k_unregister_led() -> ath10k_leds_unregister() + ath10k_reset_led_pin() -> ath10k_leds_start() + +* call ath10k_leds_unregister() before ath10k_thermal_unregister() to preserve ordering + +* call ath10k_leds_start() only from ath10k_core_start() and not from mac.c + +* rename struct ath10k_gpiocontrol as anonymous function under struct + ath10k::leds, no need for memory allocation + +* merge ath10k_add_led() to ath10k_attach_led(), which is it's only caller + +* remove #if IS_ENABLED() checks from most of places, memory savings from those were not worth it + +* Kconfig help text improvement and move it lower in the menu, also don't enable it by default + +* switch to set_brightness_blocking() so that the callback can sleep, + then no need to use ath10k_wmi_cmd_send_nowait() and can take mutex + to access ar->state + +* don't touch ath10k_wmi_pdev_get_temperature() + +* as QCA6174/QCA9377 are not (yet) supported don't add the command to WMI-TLV interface + +* remove debugfs interface, that should be added in another patch + +* cleanup includes + + + drivers/net/wireless/ath/ath10k/Kconfig | 10 +++ + drivers/net/wireless/ath/ath10k/Makefile | 1 + + drivers/net/wireless/ath/ath10k/core.c | 22 +++++++ + drivers/net/wireless/ath/ath10k/core.h | 9 ++- + drivers/net/wireless/ath/ath10k/hw.h | 1 + + drivers/net/wireless/ath/ath10k/leds.c | 103 ++++++++++++++++++++++++++++++ + drivers/net/wireless/ath/ath10k/leds.h | 45 +++++++++++++ + drivers/net/wireless/ath/ath10k/mac.c | 1 + + drivers/net/wireless/ath/ath10k/wmi-ops.h | 32 ++++++++++ + drivers/net/wireless/ath/ath10k/wmi-tlv.c | 2 + + drivers/net/wireless/ath/ath10k/wmi.c | 54 ++++++++++++++++ + drivers/net/wireless/ath/ath10k/wmi.h | 35 ++++++++++ + 12 files changed, 314 insertions(+), 1 deletion(-) create mode 100644 drivers/net/wireless/ath/ath10k/leds.c create mode 100644 drivers/net/wireless/ath/ath10k/leds.h - --- a/drivers/net/wireless/ath/ath10k/Kconfig +++ b/drivers/net/wireless/ath/ath10k/Kconfig -@@ -72,6 +72,12 @@ config ATH10K_DEBUGFS +@@ -72,6 +72,16 @@ config ATH10K_DEBUGFS If unsure, say Y to make it easier to debug problems. +config ATH10K_LEDS -+ bool ++ bool "Atheros ath10k LED support" + depends on ATH10K -+ depends on LEDS_CLASS=y || LEDS_CLASS=MAC80211 ++ select MAC80211_LEDS ++ select LEDS_CLASS ++ select NEW_LEDS + default y ++ ---help--- ++ This option is necessary, if you want LED support for chipset connected led pins. If unsure, say N. + config ATH10K_SPECTRAL bool "Atheros ath10k spectral scan support" @@ -81,135 +132,47 @@ Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com unsigned int ath10k_debug_mask; EXPORT_SYMBOL(ath10k_debug_mask); -@@ -67,6 +68,7 @@ static const struct ath10k_hw_params ath +@@ -65,6 +66,7 @@ static const struct ath10k_hw_params ath + .dev_id = QCA988X_2_0_DEVICE_ID, + .bus = ATH10K_BUS_PCI, .name = "qca988x hw2.0", - .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR, - .uart_pin = 7, + .led_pin = 1, - .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, -@@ -107,6 +109,7 @@ static const struct ath10k_hw_params ath - .name = "qca988x hw2.0 ubiquiti", .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, -+ .led_pin = 0, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, -@@ -148,6 +151,7 @@ static const struct ath10k_hw_params ath +@@ -146,6 +148,7 @@ static const struct ath10k_hw_params ath + .dev_id = QCA9887_1_0_DEVICE_ID, + .bus = ATH10K_BUS_PCI, .name = "qca9887 hw1.0", ++ .led_pin = 1, .patch_load_addr = QCA9887_HW_1_0_PATCH_LOAD_ADDR, .uart_pin = 7, -+ .led_pin = 1, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, -@@ -189,6 +193,7 @@ static const struct ath10k_hw_params ath - .name = "qca6174 hw3.2 sdio", - .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, - .uart_pin = 19, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -225,6 +230,7 @@ static const struct ath10k_hw_params ath - .name = "qca6164 hw2.1", - .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR, - .uart_pin = 6, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -265,6 +271,7 @@ static const struct ath10k_hw_params ath - .name = "qca6174 hw2.1", - .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR, - .uart_pin = 6, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -305,6 +312,7 @@ static const struct ath10k_hw_params ath - .name = "qca6174 hw3.0", - .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, - .uart_pin = 6, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -345,6 +353,7 @@ static const struct ath10k_hw_params ath - .name = "qca6174 hw3.2", - .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, - .uart_pin = 6, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -389,6 +398,7 @@ static const struct ath10k_hw_params ath +@@ -387,6 +390,7 @@ static const struct ath10k_hw_params ath + .dev_id = QCA99X0_2_0_DEVICE_ID, + .bus = ATH10K_BUS_PCI, .name = "qca99x0 hw2.0", ++ .led_pin = 17, .patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, -+ .led_pin = 17, .otp_exe_param = 0x00000700, - .continuous_frag_desc = true, - .cck_rate_map_rev2 = true, -@@ -435,6 +445,7 @@ static const struct ath10k_hw_params ath +@@ -433,6 +437,7 @@ static const struct ath10k_hw_params ath + .dev_id = QCA9984_1_0_DEVICE_ID, + .bus = ATH10K_BUS_PCI, .name = "qca9984/qca9994 hw1.0", ++ .led_pin = 17, .patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR, .uart_pin = 7, -+ .led_pin = 17, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, - .otp_exe_param = 0x00000700, - .continuous_frag_desc = true, -@@ -488,6 +499,7 @@ static const struct ath10k_hw_params ath +@@ -486,6 +491,7 @@ static const struct ath10k_hw_params ath + .dev_id = QCA9888_2_0_DEVICE_ID, + .bus = ATH10K_BUS_PCI, .name = "qca9888 hw2.0", ++ .led_pin = 17, .patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, -+ .led_pin = 17, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, - .otp_exe_param = 0x00000700, - .continuous_frag_desc = true, -@@ -538,6 +550,7 @@ static const struct ath10k_hw_params ath - .name = "qca9377 hw1.0", - .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, - .uart_pin = 6, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -578,6 +591,7 @@ static const struct ath10k_hw_params ath - .name = "qca9377 hw1.1", - .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, - .uart_pin = 6, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -620,6 +634,7 @@ static const struct ath10k_hw_params ath - .name = "qca9377 hw1.1 sdio", - .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, - .uart_pin = 19, -+ .led_pin = 0, - .otp_exe_param = 0, - .channel_counters_freq_hz = 88000, - .max_probe_resp_desc_thres = 0, -@@ -653,6 +668,7 @@ static const struct ath10k_hw_params ath - .name = "qca4019 hw1.0", - .patch_load_addr = QCA4019_HW_1_0_PATCH_LOAD_ADDR, - .uart_pin = 7, -+ .led_pin = 0, - .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, - .otp_exe_param = 0x0010000, - .continuous_frag_desc = true, -@@ -698,6 +714,7 @@ static const struct ath10k_hw_params ath - .dev_id = 0, - .bus = ATH10K_BUS_SNOC, - .name = "wcn3990 hw1.0", -+ .led_pin = 0, - .continuous_frag_desc = true, - .tx_chain_mask = 0x7, - .rx_chain_mask = 0x7, -@@ -3222,6 +3239,10 @@ int ath10k_core_start(struct ath10k *ar, +@@ -3222,6 +3228,10 @@ int ath10k_core_start(struct ath10k *ar, goto err_hif_stop; } @@ -220,7 +183,7 @@ Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com return 0; err_hif_stop: -@@ -3480,9 +3501,18 @@ static void ath10k_core_register_work(st +@@ -3480,9 +3490,18 @@ static void ath10k_core_register_work(st goto err_spectral_destroy; } @@ -239,7 +202,7 @@ Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com err_spectral_destroy: ath10k_spectral_destroy(ar); err_debug_destroy: -@@ -3528,6 +3558,8 @@ void ath10k_core_unregister(struct ath10 +@@ -3528,6 +3547,8 @@ void ath10k_core_unregister(struct ath10 if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags)) return; @@ -284,13 +247,24 @@ Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com /* Type of hw cycle counter wraparound logic, for more info --- /dev/null +++ b/drivers/net/wireless/ath/ath10k/leds.c -@@ -0,0 +1,90 @@ -+// SPDX-License-Identifier: ISC +@@ -0,0 +1,103 @@ +/* + * Copyright (c) 2005-2011 Atheros Communications Inc. + * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. + * Copyright (c) 2018 Sebastian Gottschall -+ * Copyright (c) 2018 The Linux Foundation. All rights reserved. ++ * Copyright (c) 2018, The Linux Foundation. All rights reserved. ++ * ++ * Permission to use, copy, modify, and/or distribute this software for any ++ * purpose with or without fee is hereby granted, provided that the above ++ * copyright notice and this permission notice appear in all copies. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES ++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF ++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF ++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include @@ -357,6 +331,8 @@ Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com + + ar->leds.cdev.name = ar->leds.label; + ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking; ++ ++ /* FIXME: this assignment doesn't make sense as it's NULL, remove it? */ + ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger; + + ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev); @@ -377,15 +353,22 @@ Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com + --- /dev/null +++ b/drivers/net/wireless/ath/ath10k/leds.h -@@ -0,0 +1,34 @@ -+/* SPDX-License-Identifier: ISC */ +@@ -0,0 +1,41 @@ +/* -+ * Copyright (c) 2005-2011 Atheros Communications Inc. -+ * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. -+ * Copyright (c) 2018 Sebastian Gottschall -+ * Copyright (c) 2018 The Linux Foundation. All rights reserved. ++ * Copyright (c) 2018, The Linux Foundation. All rights reserved. ++ * ++ * Permission to use, copy, modify, and/or distribute this software for any ++ * purpose with or without fee is hereby granted, provided that the above ++ * copyright notice and this permission notice appear in all copies. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES ++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF ++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF ++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ -+ +#ifndef _LEDS_H_ +#define _LEDS_H_ + @@ -586,7 +569,7 @@ Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com }; -+/* WMI_GPIO_CPTCFG_CMDID */ ++/* WMI_GPIO_CONFIG_CMDID */ +enum { + WMI_GPIO_PULL_NONE, + WMI_GPIO_PULL_UP, @@ -602,7 +585,7 @@ Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com + WMI_GPIO_INTTYPE_LEVEL_HIGH +}; + -+/* WMI_GPIO_CPTCFG_CMDID */ ++/* WMI_GPIO_CONFIG_CMDID */ +struct wmi_gpio_config_cmd { + __le32 gpio_num; /* GPIO number to be setup */ + __le32 input; /* 0 - Output/ 1 - Input */ diff --git a/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch index 2e598199c4..95bd48f923 100644 --- a/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch +++ b/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch @@ -29,10 +29,12 @@ Signed-off-by: Mathias Kresin }; --- a/drivers/net/wireless/ath/ath10k/leds.c +++ b/drivers/net/wireless/ath/ath10k/leds.c -@@ -70,7 +70,7 @@ int ath10k_leds_register(struct ath10k * +@@ -81,9 +81,7 @@ int ath10k_leds_register(struct ath10k * ar->leds.cdev.name = ar->leds.label; ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking; +- +- /* FIXME: this assignment doesn't make sense as it's NULL, remove it? */ - ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger; + ar->leds.cdev.default_trigger = ar->led_default_trigger; diff --git a/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch b/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch index 6439ff9803..cfa0f9108a 100644 --- a/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch +++ b/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch @@ -26,7 +26,7 @@ Signed-off-by: Ansuel Smith #include #include #include -@@ -3409,6 +3410,8 @@ static int ath10k_core_probe_fw(struct a +@@ -3398,6 +3399,8 @@ static int ath10k_core_probe_fw(struct a device_get_mac_address(ar->dev, ar->mac_addr); From ae358b84895b54990a5ffb4e4777028db84ef9ec Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Tue, 27 Jun 2023 10:26:06 +0200 Subject: [PATCH 18/27] mvebu: cortexa53: enable F2FS ZSTD compression support We would love to utilize ZSTD compression support in F2FS on the Methode euroDPU so lets enable the required kernel support. Signed-off-by: Robert Marko --- target/linux/mvebu/cortexa53/config-6.6 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/linux/mvebu/cortexa53/config-6.6 b/target/linux/mvebu/cortexa53/config-6.6 index 3534537b54..9679d30ddf 100644 --- a/target/linux/mvebu/cortexa53/config-6.6 +++ b/target/linux/mvebu/cortexa53/config-6.6 @@ -42,6 +42,10 @@ CONFIG_CC_HAVE_SHADOW_CALL_STACK=y CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y CONFIG_CPU_LITTLE_ENDIAN=y CONFIG_DMA_DIRECT_REMAP=y +CONFIG_F2FS_FS_COMPRESSION=y +# CONFIG_F2FS_FS_LZ4 is not set +# CONFIG_F2FS_FS_LZO is not set +CONFIG_F2FS_FS_ZSTD=y CONFIG_FRAME_POINTER=y CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_REGS=y CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y From 793b925f8b35e278114bb3ab92564bae8b678122 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Mon, 10 Jul 2023 13:37:42 +0200 Subject: [PATCH 19/27] mvebu: cortexa53: include mkfs.f2fs and fdisk for sysupgrade Methode devices require mkfs.f2fs in order to format rootfs and misc partitions if they have not already been formatted. fdisk is required if partition table got broke so it can be regenerated. Signed-off-by: Robert Marko --- target/linux/mvebu/cortexa53/base-files/lib/upgrade/platform.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/mvebu/cortexa53/base-files/lib/upgrade/platform.sh b/target/linux/mvebu/cortexa53/base-files/lib/upgrade/platform.sh index cd41c39d7c..f77f15ecab 100755 --- a/target/linux/mvebu/cortexa53/base-files/lib/upgrade/platform.sh +++ b/target/linux/mvebu/cortexa53/base-files/lib/upgrade/platform.sh @@ -3,7 +3,7 @@ # Copyright (C) 2016 LEDE-Project.org # -RAMFS_COPY_BIN='fw_printenv fw_setenv' +RAMFS_COPY_BIN='fw_printenv fw_setenv mkfs.f2fs fdisk' RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock' REQUIRE_IMAGE_METADATA=1 From 23191b407564d81d28f709c5a05fb93edb7b96ba Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Mon, 10 Jul 2023 13:40:26 +0200 Subject: [PATCH 20/27] mvebu: uDPU/eDPU: format F2FS partitons with compression support In order to prolong the eMMC life and utilize ZSTD compression on Methode devices, we must format the F2FS rootfs and misc partition with xattr and compression support feature flags first. This will only happen if partitions are broken currently, but later commits will add support to convert existing boards to use compression. Signed-off-by: Robert Marko --- target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh b/target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh index b01ad607ee..a8d803ff59 100644 --- a/target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh +++ b/target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh @@ -42,7 +42,7 @@ udpu_do_part_check() { # Format the /misc part right away as we will need it for the firmware printf "Formating /misc partition, this make take a while..\n" udpu_part_prep ${emmc_dev}p4 - if mkfs.f2fs -q -l misc ${emmc_dev}p4; then + if mkfs.f2fs -q -l misc -O extra_attr,compression ${emmc_dev}p4; then printf "/misc partition formated successfully\n" else printf "/misc partition formatting failed\n" @@ -66,7 +66,7 @@ udpu_do_misc_prep() { format_count=0 while [ "$format_count" -lt "1" ]; do udpu_part_prep ${emmc_dev}p4 - mkfs.f2fs -q -l misc ${emmc_dev}p4 + mkfs.f2fs -q -l misc -O extra_attr,compression ${emmc_dev}p4 if ! mount ${emmc_dev}p4 /misc; then umount -l /misc printf "Failed while mounting /misc\n" @@ -92,7 +92,7 @@ udpu_do_initial_setup() { # Prepare /root partition printf "Formating /root partition, this may take a while..\n" udpu_part_prep ${emmc_dev}p3 - mkfs.f2fs -q -l rootfs ${emmc_dev}p3 && printf "/root partition reformated\n" + mkfs.f2fs -q -l rootfs -O extra_attr,compression ${emmc_dev}p3 && printf "/root partition reformated\n" } udpu_do_regular_upgrade() { From 149a1ab273ca5b8582c6e02c7aa99cf9887c4437 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Mon, 10 Jul 2023 13:43:51 +0200 Subject: [PATCH 21/27] mvebu: uDPU/eDPU: mount misc partition with ZSTD compression F2FS requires the compression algorith to be passed as argument while mounting, so lets do so for the misc partition. Signed-off-by: Robert Marko --- target/linux/mvebu/cortexa53/base-files/lib/preinit/82_uDPU | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/mvebu/cortexa53/base-files/lib/preinit/82_uDPU b/target/linux/mvebu/cortexa53/base-files/lib/preinit/82_uDPU index 8d5a482b82..1c72d0fe66 100644 --- a/target/linux/mvebu/cortexa53/base-files/lib/preinit/82_uDPU +++ b/target/linux/mvebu/cortexa53/base-files/lib/preinit/82_uDPU @@ -15,7 +15,7 @@ preinit_mount_udpu() { if [ -b "${mmcdev}p4" ]; then mkdir /misc - mount -t f2fs ${mmcdev}p4 /misc + mount -o compress_algorithm=zstd -t f2fs ${mmcdev}p4 /misc [ -f "/misc/$BACKUP_FILE" ] && { echo "- Restoring configuration files -" tar xzf "/misc/$BACKUP_FILE" -C / From 70088a7e4c766fb57473b63f187997cae11a1488 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Wed, 3 Jan 2024 13:25:04 +0100 Subject: [PATCH 22/27] mvebu: uDPU/eDPU: mount F2FS with ZSTD compression Now that we can pass the desired compression via cmdline, pass ZSTD as the desired compression algorithm for F2FS. Signed-off-by: Robert Marko --- target/linux/mvebu/image/udpu.bootscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/mvebu/image/udpu.bootscript b/target/linux/mvebu/image/udpu.bootscript index 1da35a793e..e646b42e89 100644 --- a/target/linux/mvebu/image/udpu.bootscript +++ b/target/linux/mvebu/image/udpu.bootscript @@ -23,7 +23,7 @@ if test ${fdt_add_r}; then setenv fdt_addr_r 0x4f00000 fi -setenv console 'console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000' +setenv console 'console=ttyMV0,115200 earlycon=ar3700_uart,0xd0012000 rootfs_mount_options.compress_algorithm=zstd' setenv bootargs ${console} $rootdev rw rootwait load mmc ${mmcdev}:1 ${fdt_addr_r} @DTB@.dtb From 6b71ab630a01c8300b5cd17bfdf0cc95d2272ace Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Mon, 17 Jun 2024 18:23:44 +0200 Subject: [PATCH 23/27] mac80211: ath10k: replace LEDs patch with upstream patch LEDs support for ath10k has finally merged upstream hence replace it with the upstream version. Link: https://github.com/openwrt/openwrt/pull/15735 Signed-off-by: Christian Marangi --- ...ED-and-GPIO-controlling-support-for.patch} | 299 +++++++++--------- ...75-ath10k-use-tpt-trigger-by-default.patch | 4 +- ...h10k-Try-to-get-mac-address-from-dts.patch | 2 +- 3 files changed, 160 insertions(+), 145 deletions(-) rename package/kernel/mac80211/patches/ath10k/{974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch => 974-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch} (70%) diff --git a/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch b/package/kernel/mac80211/patches/ath10k/974-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch similarity index 70% rename from package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch rename to package/kernel/mac80211/patches/ath10k/974-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch index 2465470a57..05e3b2a28d 100644 --- a/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch +++ b/package/kernel/mac80211/patches/ath10k/974-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch @@ -1,103 +1,52 @@ -From: Sebastian Gottschall - -Adds LED and GPIO Control support for 988x, 9887, 9888, 99x0, 9984 based -chipsets with on chipset connected led's using WMI Firmware API. The LED -device will get available named as "ath10k-phyX" at sysfs and can be controlled -with various triggers. adds also debugfs interface for gpio control. - -This patch is specific for OpenWRt base, as is use old backported package -with old wireless source. Support for QCA9984 is removed and a simbol -is added to local-simbol file to export the actually compile the code -with the ATH10K_LEDS simbol. +From 8e1debd82466a3fe711784ab37e6b54e56011267 Mon Sep 17 00:00:00 2001 +From: Sebastian Gottschall +Date: Mon, 13 May 2024 17:22:25 +0300 +Subject: [PATCH] wifi: ath10k: add LED and GPIO controlling support for + various chipsets +Adds LED and GPIO Control support for 988x, 9887, 9888, 99x0, 9984 +based chipsets with on chipset connected led's using WMI Firmware API. +The LED device will get available named as "ath10k-phyX" at sysfs and +can be controlled with various triggers. +Adds also debugfs interface for gpio control. Signed-off-by: Sebastian Gottschall Reviewed-by: Steve deRosier [kvalo: major reorg and cleanup] Signed-off-by: Kalle Valo -Signed-off-by: Ansuel Smith +[ansuel: rebase and small cleanup] +Signed-off-by: Christian Marangi +Tested-by: Stefan Lippers-Hollmann +Signed-off-by: Kalle Valo +Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com --- - -v13: - -* only compile tested! - -* fix all checkpatch warnings - -* fix commit log - -* sizeof(struct ath10k_gpiocontrol) -> sizeof(*gpio) - -* unsigned -> unsigned int - -* remove GPIOLIB code, that should be added in a separate patch - -* rename gpio.c to leds.c - -* add leds.h - -* rename some functions: - - ath10k_attach_led() -> ath10k_leds_register() - ath10k_unregister_led() -> ath10k_leds_unregister() - ath10k_reset_led_pin() -> ath10k_leds_start() - -* call ath10k_leds_unregister() before ath10k_thermal_unregister() to preserve ordering - -* call ath10k_leds_start() only from ath10k_core_start() and not from mac.c - -* rename struct ath10k_gpiocontrol as anonymous function under struct - ath10k::leds, no need for memory allocation - -* merge ath10k_add_led() to ath10k_attach_led(), which is it's only caller - -* remove #if IS_ENABLED() checks from most of places, memory savings from those were not worth it - -* Kconfig help text improvement and move it lower in the menu, also don't enable it by default - -* switch to set_brightness_blocking() so that the callback can sleep, - then no need to use ath10k_wmi_cmd_send_nowait() and can take mutex - to access ar->state - -* don't touch ath10k_wmi_pdev_get_temperature() - -* as QCA6174/QCA9377 are not (yet) supported don't add the command to WMI-TLV interface - -* remove debugfs interface, that should be added in another patch - -* cleanup includes - - - drivers/net/wireless/ath/ath10k/Kconfig | 10 +++ - drivers/net/wireless/ath/ath10k/Makefile | 1 + - drivers/net/wireless/ath/ath10k/core.c | 22 +++++++ - drivers/net/wireless/ath/ath10k/core.h | 9 ++- - drivers/net/wireless/ath/ath10k/hw.h | 1 + - drivers/net/wireless/ath/ath10k/leds.c | 103 ++++++++++++++++++++++++++++++ - drivers/net/wireless/ath/ath10k/leds.h | 45 +++++++++++++ - drivers/net/wireless/ath/ath10k/mac.c | 1 + - drivers/net/wireless/ath/ath10k/wmi-ops.h | 32 ++++++++++ - drivers/net/wireless/ath/ath10k/wmi-tlv.c | 2 + - drivers/net/wireless/ath/ath10k/wmi.c | 54 ++++++++++++++++ - drivers/net/wireless/ath/ath10k/wmi.h | 35 ++++++++++ - 12 files changed, 314 insertions(+), 1 deletion(-) + drivers/net/wireless/ath/ath10k/Kconfig | 6 ++ + drivers/net/wireless/ath/ath10k/Makefile | 1 + + drivers/net/wireless/ath/ath10k/core.c | 32 ++++++++ + drivers/net/wireless/ath/ath10k/core.h | 8 ++ + drivers/net/wireless/ath/ath10k/hw.h | 1 + + drivers/net/wireless/ath/ath10k/leds.c | 90 +++++++++++++++++++++++ + drivers/net/wireless/ath/ath10k/leds.h | 34 +++++++++ + drivers/net/wireless/ath/ath10k/mac.c | 1 + + drivers/net/wireless/ath/ath10k/wmi-ops.h | 32 ++++++++ + drivers/net/wireless/ath/ath10k/wmi-tlv.c | 2 + + drivers/net/wireless/ath/ath10k/wmi.c | 54 ++++++++++++++ + drivers/net/wireless/ath/ath10k/wmi.h | 35 +++++++++ + 12 files changed, 296 insertions(+) create mode 100644 drivers/net/wireless/ath/ath10k/leds.c create mode 100644 drivers/net/wireless/ath/ath10k/leds.h + --- a/drivers/net/wireless/ath/ath10k/Kconfig +++ b/drivers/net/wireless/ath/ath10k/Kconfig -@@ -72,6 +72,16 @@ config ATH10K_DEBUGFS +@@ -72,6 +72,12 @@ config ATH10K_DEBUGFS If unsure, say Y to make it easier to debug problems. +config ATH10K_LEDS -+ bool "Atheros ath10k LED support" ++ bool + depends on ATH10K -+ select MAC80211_LEDS -+ select LEDS_CLASS -+ select NEW_LEDS ++ depends on LEDS_CLASS=y || LEDS_CLASS=MAC80211 + default y -+ ---help--- -+ This option is necessary, if you want LED support for chipset connected led pins. If unsure, say N. + config ATH10K_SPECTRAL bool "Atheros ath10k spectral scan support" @@ -132,47 +81,135 @@ v13: unsigned int ath10k_debug_mask; EXPORT_SYMBOL(ath10k_debug_mask); -@@ -65,6 +66,7 @@ static const struct ath10k_hw_params ath - .dev_id = QCA988X_2_0_DEVICE_ID, - .bus = ATH10K_BUS_PCI, +@@ -67,6 +68,7 @@ static const struct ath10k_hw_params ath .name = "qca988x hw2.0", -+ .led_pin = 1, .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, - .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, -@@ -146,6 +148,7 @@ static const struct ath10k_hw_params ath - .dev_id = QCA9887_1_0_DEVICE_ID, - .bus = ATH10K_BUS_PCI, - .name = "qca9887 hw1.0", + .led_pin = 1, + .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, +@@ -107,6 +109,7 @@ static const struct ath10k_hw_params ath + .name = "qca988x hw2.0 ubiquiti", + .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR, + .uart_pin = 7, ++ .led_pin = 0, + .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, +@@ -148,6 +151,7 @@ static const struct ath10k_hw_params ath + .name = "qca9887 hw1.0", .patch_load_addr = QCA9887_HW_1_0_PATCH_LOAD_ADDR, .uart_pin = 7, ++ .led_pin = 1, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, -@@ -387,6 +390,7 @@ static const struct ath10k_hw_params ath - .dev_id = QCA99X0_2_0_DEVICE_ID, - .bus = ATH10K_BUS_PCI, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, +@@ -189,6 +193,7 @@ static const struct ath10k_hw_params ath + .name = "qca6174 hw3.2 sdio", + .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, + .uart_pin = 19, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -225,6 +230,7 @@ static const struct ath10k_hw_params ath + .name = "qca6164 hw2.1", + .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR, + .uart_pin = 6, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -265,6 +271,7 @@ static const struct ath10k_hw_params ath + .name = "qca6174 hw2.1", + .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR, + .uart_pin = 6, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -305,6 +312,7 @@ static const struct ath10k_hw_params ath + .name = "qca6174 hw3.0", + .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, + .uart_pin = 6, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -345,6 +353,7 @@ static const struct ath10k_hw_params ath + .name = "qca6174 hw3.2", + .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, + .uart_pin = 6, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -389,6 +398,7 @@ static const struct ath10k_hw_params ath .name = "qca99x0 hw2.0", -+ .led_pin = 17, .patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, - .otp_exe_param = 0x00000700, -@@ -433,6 +437,7 @@ static const struct ath10k_hw_params ath - .dev_id = QCA9984_1_0_DEVICE_ID, - .bus = ATH10K_BUS_PCI, - .name = "qca9984/qca9994 hw1.0", + .led_pin = 17, + .otp_exe_param = 0x00000700, + .continuous_frag_desc = true, + .cck_rate_map_rev2 = true, +@@ -435,6 +445,7 @@ static const struct ath10k_hw_params ath + .name = "qca9984/qca9994 hw1.0", .patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR, .uart_pin = 7, - .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, -@@ -486,6 +491,7 @@ static const struct ath10k_hw_params ath - .dev_id = QCA9888_2_0_DEVICE_ID, - .bus = ATH10K_BUS_PCI, - .name = "qca9888 hw2.0", + .led_pin = 17, + .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, + .otp_exe_param = 0x00000700, + .continuous_frag_desc = true, +@@ -488,6 +499,7 @@ static const struct ath10k_hw_params ath + .name = "qca9888 hw2.0", .patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, ++ .led_pin = 17, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, -@@ -3222,6 +3228,10 @@ int ath10k_core_start(struct ath10k *ar, + .otp_exe_param = 0x00000700, + .continuous_frag_desc = true, +@@ -538,6 +550,7 @@ static const struct ath10k_hw_params ath + .name = "qca9377 hw1.0", + .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, + .uart_pin = 6, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -578,6 +591,7 @@ static const struct ath10k_hw_params ath + .name = "qca9377 hw1.1", + .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, + .uart_pin = 6, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -620,6 +634,7 @@ static const struct ath10k_hw_params ath + .name = "qca9377 hw1.1 sdio", + .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, + .uart_pin = 19, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -653,6 +668,7 @@ static const struct ath10k_hw_params ath + .name = "qca4019 hw1.0", + .patch_load_addr = QCA4019_HW_1_0_PATCH_LOAD_ADDR, + .uart_pin = 7, ++ .led_pin = 0, + .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, + .otp_exe_param = 0x0010000, + .continuous_frag_desc = true, +@@ -698,6 +714,7 @@ static const struct ath10k_hw_params ath + .dev_id = 0, + .bus = ATH10K_BUS_SNOC, + .name = "wcn3990 hw1.0", ++ .led_pin = 0, + .continuous_frag_desc = true, + .tx_chain_mask = 0x7, + .rx_chain_mask = 0x7, +@@ -3222,6 +3239,10 @@ int ath10k_core_start(struct ath10k *ar, goto err_hif_stop; } @@ -183,7 +220,7 @@ v13: return 0; err_hif_stop: -@@ -3480,9 +3490,18 @@ static void ath10k_core_register_work(st +@@ -3480,9 +3501,18 @@ static void ath10k_core_register_work(st goto err_spectral_destroy; } @@ -202,7 +239,7 @@ v13: err_spectral_destroy: ath10k_spectral_destroy(ar); err_debug_destroy: -@@ -3528,6 +3547,8 @@ void ath10k_core_unregister(struct ath10 +@@ -3528,6 +3558,8 @@ void ath10k_core_unregister(struct ath10 if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags)) return; @@ -247,24 +284,13 @@ v13: /* Type of hw cycle counter wraparound logic, for more info --- /dev/null +++ b/drivers/net/wireless/ath/ath10k/leds.c -@@ -0,0 +1,103 @@ +@@ -0,0 +1,90 @@ ++// SPDX-License-Identifier: ISC +/* + * Copyright (c) 2005-2011 Atheros Communications Inc. + * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. + * Copyright (c) 2018 Sebastian Gottschall -+ * Copyright (c) 2018, The Linux Foundation. All rights reserved. -+ * -+ * Permission to use, copy, modify, and/or distribute this software for any -+ * purpose with or without fee is hereby granted, provided that the above -+ * copyright notice and this permission notice appear in all copies. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ++ * Copyright (c) 2018 The Linux Foundation. All rights reserved. + */ + +#include @@ -331,8 +357,6 @@ v13: + + ar->leds.cdev.name = ar->leds.label; + ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking; -+ -+ /* FIXME: this assignment doesn't make sense as it's NULL, remove it? */ + ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger; + + ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev); @@ -353,22 +377,15 @@ v13: + --- /dev/null +++ b/drivers/net/wireless/ath/ath10k/leds.h -@@ -0,0 +1,41 @@ +@@ -0,0 +1,34 @@ ++/* SPDX-License-Identifier: ISC */ +/* -+ * Copyright (c) 2018, The Linux Foundation. All rights reserved. -+ * -+ * Permission to use, copy, modify, and/or distribute this software for any -+ * purpose with or without fee is hereby granted, provided that the above -+ * copyright notice and this permission notice appear in all copies. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ++ * Copyright (c) 2005-2011 Atheros Communications Inc. ++ * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. ++ * Copyright (c) 2018 Sebastian Gottschall ++ * Copyright (c) 2018 The Linux Foundation. All rights reserved. + */ ++ +#ifndef _LEDS_H_ +#define _LEDS_H_ + @@ -569,7 +586,7 @@ v13: }; -+/* WMI_GPIO_CONFIG_CMDID */ ++/* WMI_GPIO_CPTCFG_CMDID */ +enum { + WMI_GPIO_PULL_NONE, + WMI_GPIO_PULL_UP, @@ -585,7 +602,7 @@ v13: + WMI_GPIO_INTTYPE_LEVEL_HIGH +}; + -+/* WMI_GPIO_CONFIG_CMDID */ ++/* WMI_GPIO_CPTCFG_CMDID */ +struct wmi_gpio_config_cmd { + __le32 gpio_num; /* GPIO number to be setup */ + __le32 input; /* 0 - Output/ 1 - Input */ diff --git a/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch index 95bd48f923..2e598199c4 100644 --- a/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch +++ b/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch @@ -29,12 +29,10 @@ Signed-off-by: Mathias Kresin }; --- a/drivers/net/wireless/ath/ath10k/leds.c +++ b/drivers/net/wireless/ath/ath10k/leds.c -@@ -81,9 +81,7 @@ int ath10k_leds_register(struct ath10k * +@@ -70,7 +70,7 @@ int ath10k_leds_register(struct ath10k * ar->leds.cdev.name = ar->leds.label; ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking; -- -- /* FIXME: this assignment doesn't make sense as it's NULL, remove it? */ - ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger; + ar->leds.cdev.default_trigger = ar->led_default_trigger; diff --git a/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch b/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch index cfa0f9108a..6439ff9803 100644 --- a/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch +++ b/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch @@ -26,7 +26,7 @@ Signed-off-by: Ansuel Smith #include #include #include -@@ -3398,6 +3399,8 @@ static int ath10k_core_probe_fw(struct a +@@ -3409,6 +3410,8 @@ static int ath10k_core_probe_fw(struct a device_get_mac_address(ar->dev, ar->mac_addr); From 3b2a81ec24ed5e2c05c04dfa2fa3d5cd19aa08e3 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Mon, 17 Jun 2024 18:36:58 +0200 Subject: [PATCH 24/27] ath10k-ct: replace LEDs patch with upstream patch LEDs support for ath10k has finally merged upstream hence replace it with the upstream version. Link: https://github.com/openwrt/openwrt/pull/15735 Signed-off-by: Christian Marangi --- ...ED-and-GPIO-controlling-support-for.patch} | 292 ++++++++++-------- ...02-ath10k-use-tpt-trigger-by-default.patch | 4 +- 2 files changed, 156 insertions(+), 140 deletions(-) rename package/kernel/ath10k-ct/patches/{201-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets.patch => 201-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch} (71%) diff --git a/package/kernel/ath10k-ct/patches/201-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets.patch b/package/kernel/ath10k-ct/patches/201-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch similarity index 71% rename from package/kernel/ath10k-ct/patches/201-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets.patch rename to package/kernel/ath10k-ct/patches/201-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch index 8eb587b877..4f26806b5b 100644 --- a/package/kernel/ath10k-ct/patches/201-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets.patch +++ b/package/kernel/ath10k-ct/patches/201-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch @@ -1,102 +1,52 @@ -From: Sebastian Gottschall - -Adds LED and GPIO Control support for 988x, 9887, 9888, 99x0, 9984 based -chipsets with on chipset connected led's using WMI Firmware API. The LED -device will get available named as "ath10k-phyX" at sysfs and can be controlled -with various triggers. adds also debugfs interface for gpio control. - -This patch is specific for OpenWRt base, as is use old backported package -with old wireless source. Support for QCA9984 is removed. -Reworked to use ath10k-ct custom source +From 8e1debd82466a3fe711784ab37e6b54e56011267 Mon Sep 17 00:00:00 2001 +From: Sebastian Gottschall +Date: Mon, 13 May 2024 17:22:25 +0300 +Subject: [PATCH] wifi: ath10k: add LED and GPIO controlling support for + various chipsets +Adds LED and GPIO Control support for 988x, 9887, 9888, 99x0, 9984 +based chipsets with on chipset connected led's using WMI Firmware API. +The LED device will get available named as "ath10k-phyX" at sysfs and +can be controlled with various triggers. +Adds also debugfs interface for gpio control. Signed-off-by: Sebastian Gottschall Reviewed-by: Steve deRosier [kvalo: major reorg and cleanup] Signed-off-by: Kalle Valo -Signed-off-by: Ansuel Smith +[ansuel: rebase and small cleanup] +Signed-off-by: Christian Marangi +Tested-by: Stefan Lippers-Hollmann +Signed-off-by: Kalle Valo +Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com --- - -v13: - -* only compile tested! - -* fix all checkpatch warnings - -* fix commit log - -* sizeof(struct ath10k_gpiocontrol) -> sizeof(*gpio) - -* unsigned -> unsigned int - -* remove GPIOLIB code, that should be added in a separate patch - -* rename gpio.c to leds.c - -* add leds.h - -* rename some functions: - - ath10k_attach_led() -> ath10k_leds_register() - ath10k_unregister_led() -> ath10k_leds_unregister() - ath10k_reset_led_pin() -> ath10k_leds_start() - -* call ath10k_leds_unregister() before ath10k_thermal_unregister() to preserve ordering - -* call ath10k_leds_start() only from ath10k_core_start() and not from mac.c - -* rename struct ath10k_gpiocontrol as anonymous function under struct - ath10k::leds, no need for memory allocation - -* merge ath10k_add_led() to ath10k_attach_led(), which is it's only caller - -* remove #if IS_ENABLED() checks from most of places, memory savings from those were not worth it - -* Kconfig help text improvement and move it lower in the menu, also don't enable it by default - -* switch to set_brightness_blocking() so that the callback can sleep, - then no need to use ath10k_wmi_cmd_send_nowait() and can take mutex - to access ar->state - -* don't touch ath10k_wmi_pdev_get_temperature() - -* as QCA6174/QCA9377 are not (yet) supported don't add the command to WMI-TLV interface - -* remove debugfs interface, that should be added in another patch - -* cleanup includes - - ath10k-6.4/Kconfig | 10 +++ - ath10k-6.4/Makefile | 1 + - ath10k-6.4/core.c | 22 +++++++ - ath10k-6.4/core.h | 9 ++- - ath10k-6.4/hw.h | 1 + - ath10k-6.4/leds.c | 103 ++++++++++++++++++++++++++++++ - ath10k-6.4/leds.h | 45 +++++++++++++ - ath10k-6.4/mac.c | 1 + - ath10k-6.4/wmi-ops.h | 32 ++++++++++ - ath10k-6.4/wmi-tlv.c | 2 + - ath10k-6.4/wmi.c | 54 ++++++++++++++++ - ath10k-6.4/wmi.h | 35 ++++++++++ - 12 files changed, 314 insertions(+), 1 deletion(-) + ath10k-6.4/Kconfig | 6 ++ + ath10k-6.4/Makefile | 1 + + ath10k-6.4/core.c | 32 ++++++++ + ath10k-6.4/core.h | 8 ++ + ath10k-6.4/hw.h | 1 + + ath10k-6.4/leds.c | 90 +++++++++++++++++++++++ + ath10k-6.4/leds.h | 34 +++++++++ + ath10k-6.4/mac.c | 1 + + ath10k-6.4/wmi-ops.h | 32 ++++++++ + ath10k-6.4/wmi-tlv.c | 2 + + ath10k-6.4/wmi.c | 54 ++++++++++++++ + ath10k-6.4/wmi.h | 35 +++++++++ + 12 files changed, 296 insertions(+) create mode 100644 ath10k-6.4/leds.c create mode 100644 ath10k-6.4/leds.h --- a/ath10k-6.4/Kconfig +++ b/ath10k-6.4/Kconfig -@@ -67,6 +67,16 @@ config ATH10K_DEBUGFS +@@ -67,6 +67,12 @@ config ATH10K_DEBUGFS If unsure, say Y to make it easier to debug problems. +config ATH10K_LEDS -+ bool "Atheros ath10k LED support" ++ bool + depends on ATH10K -+ select MAC80211_LEDS -+ select LEDS_CLASS -+ select NEW_LEDS ++ depends on LEDS_CLASS=y || LEDS_CLASS=MAC80211 + default y -+ ---help--- -+ This option is necessary, if you want LED support for chipset connected led pins. If unsure, say N. + config ATH10K_SPECTRAL bool "Atheros ath10k spectral scan support" @@ -121,47 +71,135 @@ v13: /* Disable ath10k-ct DBGLOG output by default */ unsigned int ath10k_debug_mask = ATH10K_DBG_NO_DBGLOG; -@@ -78,6 +79,7 @@ static const struct ath10k_hw_params ath - .dev_id = QCA988X_2_0_DEVICE_ID, - .bus = ATH10K_BUS_PCI, +@@ -80,6 +81,7 @@ static const struct ath10k_hw_params ath .name = "qca988x hw2.0", -+ .led_pin = 1, .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, - .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, -@@ -159,6 +161,7 @@ static const struct ath10k_hw_params ath - .dev_id = QCA9887_1_0_DEVICE_ID, - .bus = ATH10K_BUS_PCI, - .name = "qca9887 hw1.0", + .led_pin = 1, + .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, +@@ -120,6 +122,7 @@ static const struct ath10k_hw_params ath + .name = "qca988x hw2.0 ubiquiti", + .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR, + .uart_pin = 7, ++ .led_pin = 0, + .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, +@@ -161,6 +164,7 @@ static const struct ath10k_hw_params ath + .name = "qca9887 hw1.0", .patch_load_addr = QCA9887_HW_1_0_PATCH_LOAD_ADDR, .uart_pin = 7, ++ .led_pin = 1, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, -@@ -400,6 +403,7 @@ static const struct ath10k_hw_params ath - .dev_id = QCA99X0_2_0_DEVICE_ID, - .bus = ATH10K_BUS_PCI, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, +@@ -202,6 +206,7 @@ static const struct ath10k_hw_params ath + .name = "qca6174 hw3.2 sdio", + .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, + .uart_pin = 19, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -238,6 +243,7 @@ static const struct ath10k_hw_params ath + .name = "qca6164 hw2.1", + .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR, + .uart_pin = 6, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -278,6 +284,7 @@ static const struct ath10k_hw_params ath + .name = "qca6174 hw2.1", + .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR, + .uart_pin = 6, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -318,6 +325,7 @@ static const struct ath10k_hw_params ath + .name = "qca6174 hw3.0", + .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, + .uart_pin = 6, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -358,6 +366,7 @@ static const struct ath10k_hw_params ath + .name = "qca6174 hw3.2", + .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, + .uart_pin = 6, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -402,6 +411,7 @@ static const struct ath10k_hw_params ath .name = "qca99x0 hw2.0", -+ .led_pin = 17, .patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, - .otp_exe_param = 0x00000700, -@@ -446,6 +450,7 @@ static const struct ath10k_hw_params ath - .dev_id = QCA9984_1_0_DEVICE_ID, - .bus = ATH10K_BUS_PCI, - .name = "qca9984/qca9994 hw1.0", + .led_pin = 17, + .otp_exe_param = 0x00000700, + .continuous_frag_desc = true, + .cck_rate_map_rev2 = true, +@@ -448,6 +458,7 @@ static const struct ath10k_hw_params ath + .name = "qca9984/qca9994 hw1.0", .patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR, .uart_pin = 7, - .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, -@@ -499,6 +504,7 @@ static const struct ath10k_hw_params ath - .dev_id = QCA9888_2_0_DEVICE_ID, - .bus = ATH10K_BUS_PCI, - .name = "qca9888 hw2.0", + .led_pin = 17, + .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, + .otp_exe_param = 0x00000700, + .continuous_frag_desc = true, +@@ -501,6 +512,7 @@ static const struct ath10k_hw_params ath + .name = "qca9888 hw2.0", .patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, ++ .led_pin = 17, .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, -@@ -4080,6 +4086,10 @@ int ath10k_core_start(struct ath10k *ar, + .otp_exe_param = 0x00000700, + .continuous_frag_desc = true, +@@ -551,6 +563,7 @@ static const struct ath10k_hw_params ath + .name = "qca9377 hw1.0", + .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, + .uart_pin = 6, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -591,6 +604,7 @@ static const struct ath10k_hw_params ath + .name = "qca9377 hw1.1", + .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, + .uart_pin = 6, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -633,6 +647,7 @@ static const struct ath10k_hw_params ath + .name = "qca9377 hw1.1 sdio", + .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, + .uart_pin = 19, ++ .led_pin = 0, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, +@@ -666,6 +681,7 @@ static const struct ath10k_hw_params ath + .name = "qca4019 hw1.0", + .patch_load_addr = QCA4019_HW_1_0_PATCH_LOAD_ADDR, + .uart_pin = 7, ++ .led_pin = 0, + .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH, + .otp_exe_param = 0x0010000, + .continuous_frag_desc = true, +@@ -711,6 +727,7 @@ static const struct ath10k_hw_params ath + .dev_id = 0, + .bus = ATH10K_BUS_SNOC, + .name = "wcn3990 hw1.0", ++ .led_pin = 0, + .continuous_frag_desc = true, + .tx_chain_mask = 0x7, + .rx_chain_mask = 0x7, +@@ -4080,6 +4097,10 @@ int ath10k_core_start(struct ath10k *ar, ath10k_wmi_check_apply_board_power_ctl_table(ar); } @@ -172,7 +210,7 @@ v13: return 0; err_hif_stop: -@@ -4341,9 +4351,18 @@ static void ath10k_core_register_work(st +@@ -4341,9 +4362,18 @@ static void ath10k_core_register_work(st goto err_spectral_destroy; } @@ -191,7 +229,7 @@ v13: err_spectral_destroy: ath10k_spectral_destroy(ar); err_debug_destroy: -@@ -4403,6 +4422,8 @@ void ath10k_core_unregister(struct ath10 +@@ -4403,6 +4433,8 @@ void ath10k_core_unregister(struct ath10 if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags)) return; @@ -236,24 +274,13 @@ v13: /* Type of hw cycle counter wraparound logic, for more info --- /dev/null +++ b/ath10k-6.4/leds.c -@@ -0,0 +1,103 @@ +@@ -0,0 +1,90 @@ ++// SPDX-License-Identifier: ISC +/* + * Copyright (c) 2005-2011 Atheros Communications Inc. + * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. + * Copyright (c) 2018 Sebastian Gottschall -+ * Copyright (c) 2018, The Linux Foundation. All rights reserved. -+ * -+ * Permission to use, copy, modify, and/or distribute this software for any -+ * purpose with or without fee is hereby granted, provided that the above -+ * copyright notice and this permission notice appear in all copies. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ++ * Copyright (c) 2018 The Linux Foundation. All rights reserved. + */ + +#include @@ -320,8 +347,6 @@ v13: + + ar->leds.cdev.name = ar->leds.label; + ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking; -+ -+ /* FIXME: this assignment doesn't make sense as it's NULL, remove it? */ + ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger; + + ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev); @@ -342,22 +367,15 @@ v13: + --- /dev/null +++ b/ath10k-6.4/leds.h -@@ -0,0 +1,41 @@ +@@ -0,0 +1,34 @@ ++/* SPDX-License-Identifier: ISC */ +/* -+ * Copyright (c) 2018, The Linux Foundation. All rights reserved. -+ * -+ * Permission to use, copy, modify, and/or distribute this software for any -+ * purpose with or without fee is hereby granted, provided that the above -+ * copyright notice and this permission notice appear in all copies. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ++ * Copyright (c) 2005-2011 Atheros Communications Inc. ++ * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. ++ * Copyright (c) 2018 Sebastian Gottschall ++ * Copyright (c) 2018 The Linux Foundation. All rights reserved. + */ ++ +#ifndef _LEDS_H_ +#define _LEDS_H_ + diff --git a/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch index 4f9cf83c48..c5a6d19cac 100644 --- a/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch +++ b/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch @@ -29,12 +29,10 @@ Signed-off-by: Mathias Kresin }; --- a/ath10k-6.4/leds.c +++ b/ath10k-6.4/leds.c -@@ -81,9 +81,7 @@ int ath10k_leds_register(struct ath10k * +@@ -70,7 +70,7 @@ int ath10k_leds_register(struct ath10k * ar->leds.cdev.name = ar->leds.label; ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking; -- -- /* FIXME: this assignment doesn't make sense as it's NULL, remove it? */ - ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger; + ar->leds.cdev.default_trigger = ar->led_default_trigger; From 0134270319b4fa130f35eb012a736ec1d94b3f16 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Mon, 17 Jun 2024 18:56:53 +0200 Subject: [PATCH 25/27] mac80211: backport RX timestamp flags patch Backport RX timestamp flags patch needed for ath10k-ct to compile with newer versions. Link: https://github.com/openwrt/openwrt/pull/15735 Signed-off-by: Christian Marangi --- ...i-mac80211-rework-RX-timestamp-flags.patch | 161 ++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 package/kernel/mac80211/patches/subsys/100-v6.8-wifi-mac80211-rework-RX-timestamp-flags.patch diff --git a/package/kernel/mac80211/patches/subsys/100-v6.8-wifi-mac80211-rework-RX-timestamp-flags.patch b/package/kernel/mac80211/patches/subsys/100-v6.8-wifi-mac80211-rework-RX-timestamp-flags.patch new file mode 100644 index 0000000000..5f88d697c3 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/100-v6.8-wifi-mac80211-rework-RX-timestamp-flags.patch @@ -0,0 +1,161 @@ +From d5b6f6d595b446c1693fdaa6aeb4a65b94d5fc90 Mon Sep 17 00:00:00 2001 +From: Johannes Berg +Date: Wed, 20 Dec 2023 13:41:39 +0200 +Subject: [PATCH] wifi: mac80211: rework RX timestamp flags + +We only have a single flag free, and before using that for +another mactime flag, instead refactor the mactime flags +to use a 2-bit field. + +Signed-off-by: Johannes Berg +Reviewed-by: Gregory Greenman +Reviewed-by: Benjamin Berg +Signed-off-by: Miri Korenblit +Link: https://msgid.link/20231220133549.d0e664832d14.I20c8900106f9bf81316bed778b1e3ce145785274@changeid +Signed-off-by: Johannes Berg +--- + drivers/net/wireless/ath/ath10k/htt_rx.c | 2 +- + include/net/mac80211.h | 13 +++++++++---- + net/mac80211/ieee80211_i.h | 5 +---- + net/mac80211/util.c | 16 ++++++++++------ + 4 files changed, 21 insertions(+), 15 deletions(-) + +--- a/drivers/net/wireless/ath/ath10k/htt_rx.c ++++ b/drivers/net/wireless/ath/ath10k/htt_rx.c +@@ -1294,7 +1294,7 @@ static void ath10k_htt_rx_h_ppdu(struct + status->encoding = RX_ENC_LEGACY; + status->bw = RATE_INFO_BW_20; + +- status->flag &= ~RX_FLAG_MACTIME_END; ++ status->flag &= ~RX_FLAG_MACTIME; + status->flag |= RX_FLAG_NO_SIGNAL_VAL; + + status->flag &= ~(RX_FLAG_AMPDU_IS_LAST); +--- a/include/net/mac80211.h ++++ b/include/net/mac80211.h +@@ -1352,6 +1352,9 @@ ieee80211_tx_info_clear_status(struct ie + * the frame. + * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on + * the frame. ++ * @RX_FLAG_MACTIME: The timestamp passed in the RX status (@mactime ++ * field) is valid if this field is non-zero, and the position ++ * where the timestamp was sampled depends on the value. + * @RX_FLAG_MACTIME_START: The timestamp passed in the RX status (@mactime + * field) is valid and contains the time the first symbol of the MPDU + * was received. This is useful in monitor mode and for proper IBSS +@@ -1431,12 +1434,12 @@ ieee80211_tx_info_clear_status(struct ie + enum mac80211_rx_flags { + RX_FLAG_MMIC_ERROR = BIT(0), + RX_FLAG_DECRYPTED = BIT(1), +- RX_FLAG_MACTIME_PLCP_START = BIT(2), ++ RX_FLAG_ONLY_MONITOR = BIT(2), + RX_FLAG_MMIC_STRIPPED = BIT(3), + RX_FLAG_IV_STRIPPED = BIT(4), + RX_FLAG_FAILED_FCS_CRC = BIT(5), + RX_FLAG_FAILED_PLCP_CRC = BIT(6), +- RX_FLAG_MACTIME_START = BIT(7), ++ /* one free bit at 7 */ + RX_FLAG_NO_SIGNAL_VAL = BIT(8), + RX_FLAG_AMPDU_DETAILS = BIT(9), + RX_FLAG_PN_VALIDATED = BIT(10), +@@ -1445,8 +1448,10 @@ enum mac80211_rx_flags { + RX_FLAG_AMPDU_IS_LAST = BIT(13), + RX_FLAG_AMPDU_DELIM_CRC_ERROR = BIT(14), + RX_FLAG_AMPDU_DELIM_CRC_KNOWN = BIT(15), +- RX_FLAG_MACTIME_END = BIT(16), +- RX_FLAG_ONLY_MONITOR = BIT(17), ++ RX_FLAG_MACTIME = BIT(16) | BIT(17), ++ RX_FLAG_MACTIME_PLCP_START = 1 << 16, ++ RX_FLAG_MACTIME_START = 2 << 16, ++ RX_FLAG_MACTIME_END = 3 << 16, + RX_FLAG_SKIP_MONITOR = BIT(18), + RX_FLAG_AMSDU_MORE = BIT(19), + RX_FLAG_RADIOTAP_TLV_AT_END = BIT(20), +--- a/net/mac80211/ieee80211_i.h ++++ b/net/mac80211/ieee80211_i.h +@@ -1807,10 +1807,7 @@ static inline bool txq_has_queue(struct + static inline bool + ieee80211_have_rx_timestamp(struct ieee80211_rx_status *status) + { +- WARN_ON_ONCE(status->flag & RX_FLAG_MACTIME_START && +- status->flag & RX_FLAG_MACTIME_END); +- return !!(status->flag & (RX_FLAG_MACTIME_START | RX_FLAG_MACTIME_END | +- RX_FLAG_MACTIME_PLCP_START)); ++ return status->flag & RX_FLAG_MACTIME; + } + + void ieee80211_vif_inc_num_mcast(struct ieee80211_sub_if_data *sdata); +--- a/net/mac80211/util.c ++++ b/net/mac80211/util.c +@@ -4174,6 +4174,7 @@ u64 ieee80211_calculate_rx_timestamp(str + unsigned int mpdu_offset) + { + u64 ts = status->mactime; ++ bool mactime_plcp_start; + struct rate_info ri; + u16 rate; + u8 n_ltf; +@@ -4181,6 +4182,9 @@ u64 ieee80211_calculate_rx_timestamp(str + if (WARN_ON(!ieee80211_have_rx_timestamp(status))) + return 0; + ++ mactime_plcp_start = (status->flag & RX_FLAG_MACTIME) == ++ RX_FLAG_MACTIME_PLCP_START; ++ + memset(&ri, 0, sizeof(ri)); + + ri.bw = status->bw; +@@ -4195,7 +4199,7 @@ u64 ieee80211_calculate_rx_timestamp(str + if (status->enc_flags & RX_ENC_FLAG_SHORT_GI) + ri.flags |= RATE_INFO_FLAGS_SHORT_GI; + /* TODO/FIXME: is this right? handle other PPDUs */ +- if (status->flag & RX_FLAG_MACTIME_PLCP_START) { ++ if (mactime_plcp_start) { + mpdu_offset += 2; + ts += 36; + } +@@ -4212,7 +4216,7 @@ u64 ieee80211_calculate_rx_timestamp(str + * See P802.11ax_D6.0, section 27.3.4 for + * VHT PPDU format. + */ +- if (status->flag & RX_FLAG_MACTIME_PLCP_START) { ++ if (mactime_plcp_start) { + mpdu_offset += 2; + ts += 36; + +@@ -4236,7 +4240,7 @@ u64 ieee80211_calculate_rx_timestamp(str + * See P802.11REVmd_D3.0, section 19.3.2 for + * HT PPDU format. + */ +- if (status->flag & RX_FLAG_MACTIME_PLCP_START) { ++ if (mactime_plcp_start) { + mpdu_offset += 2; + if (status->enc_flags & RX_ENC_FLAG_HT_GF) + ts += 24; +@@ -4264,7 +4268,7 @@ u64 ieee80211_calculate_rx_timestamp(str + * See P802.11REVmd_D3.0, section 21.3.2 for + * VHT PPDU format. + */ +- if (status->flag & RX_FLAG_MACTIME_PLCP_START) { ++ if (mactime_plcp_start) { + mpdu_offset += 2; + ts += 36; + +@@ -4298,7 +4302,7 @@ u64 ieee80211_calculate_rx_timestamp(str + bitrate = sband->bitrates[status->rate_idx].bitrate; + ri.legacy = DIV_ROUND_UP(bitrate, (1 << shift)); + +- if (status->flag & RX_FLAG_MACTIME_PLCP_START) { ++ if (mactime_plcp_start) { + if (status->band == NL80211_BAND_5GHZ) { + ts += 20 << shift; + mpdu_offset += 2; +@@ -4320,7 +4324,7 @@ u64 ieee80211_calculate_rx_timestamp(str + return 0; + + /* rewind from end of MPDU */ +- if (status->flag & RX_FLAG_MACTIME_END) ++ if ((status->flag & RX_FLAG_MACTIME) == RX_FLAG_MACTIME_END) + ts -= mpdu_len * 8 * 10 / rate; + + ts += mpdu_offset * 8 * 10 / rate; From d14670aea8c123caade90d3fd2ecd6f9adca40ae Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Mon, 17 Jun 2024 19:00:05 +0200 Subject: [PATCH 26/27] ath10k-ct: bump to version 6.7 Bump ath10k-ct to version 6.7. Drop patch 100 that got merged upstream. Link: https://github.com/openwrt/openwrt/pull/15735 Signed-off-by: Christian Marangi --- package/kernel/ath10k-ct/Makefile | 10 +- ...ompilation-warning-for-debug-level-t.patch | 111 ------------------ ...k-read-qcom-coexist-support-as-a-u32.patch | 4 +- ...LED-and-GPIO-controlling-support-for.patch | 92 +++++++-------- ...02-ath10k-use-tpt-trigger-by-default.patch | 22 ++-- .../300-fix-fortify-checking-error.patch | 4 +- ...0-0010-ath10k-limit-htt-rx-ring-size.patch | 4 +- ...60-0011-ath10k-limit-pci-buffer-size.patch | 4 +- ...k-always-use-mac80211-loss-detection.patch | 8 +- 9 files changed, 74 insertions(+), 185 deletions(-) delete mode 100644 package/kernel/ath10k-ct/patches/100-ath10k-ct-port-compilation-warning-for-debug-level-t.patch diff --git a/package/kernel/ath10k-ct/Makefile b/package/kernel/ath10k-ct/Makefile index 1d9856d8cd..53d9eec1ea 100644 --- a/package/kernel/ath10k-ct/Makefile +++ b/package/kernel/ath10k-ct/Makefile @@ -8,14 +8,14 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/greearb/ath10k-ct.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2023-06-05 -PKG_SOURCE_VERSION:=fadd0768cbd22248a60efbb219ccefc9d86cd78c -PKG_MIRROR_HASH:=caaa373ae2cc6e443e8a31e43e5e2caca4f4ba2b9614efd3e5c9df401056d307 +PKG_SOURCE_DATE:=2024-03-03 +PKG_SOURCE_VERSION:=eb3f488a200fafc46140fd51b5e21f737ee50f24 +PKG_MIRROR_HASH:=368ed648dc7239dbcac3c6ba09be92c4b706118052d35e058cf5d1dae2917039 -# Build the 6.4 ath10k-ct driver version. +# Build the 6.7 ath10k-ct driver version. # Probably this should match as closely as # possible to whatever mac80211 backports version is being used. -CT_KVER="-6.4" +CT_KVER="-6.7" PKG_MAINTAINER:=Ben Greear PKG_BUILD_PARALLEL:=1 diff --git a/package/kernel/ath10k-ct/patches/100-ath10k-ct-port-compilation-warning-for-debug-level-t.patch b/package/kernel/ath10k-ct/patches/100-ath10k-ct-port-compilation-warning-for-debug-level-t.patch deleted file mode 100644 index f4522c87b4..0000000000 --- a/package/kernel/ath10k-ct/patches/100-ath10k-ct-port-compilation-warning-for-debug-level-t.patch +++ /dev/null @@ -1,111 +0,0 @@ -From a227621b46df8a7a5c276131b245f40eac7513fb Mon Sep 17 00:00:00 2001 -From: Christian Marangi -Date: Fri, 3 Nov 2023 04:03:08 +0100 -Subject: [PATCH] ath10k-ct: port compilation warning for debug level to kernel - 6.4 - -Port compilation warning for debug level previously fixed in other -kernel to kernel version 6.4. - -Signed-off-by: Christian Marangi ---- - ath10k-6.4/debug.c | 85 ++++++++++++++++++++++++++-------------------- - 1 file changed, 48 insertions(+), 37 deletions(-) - ---- a/ath10k-6.4/debug.c -+++ b/ath10k-6.4/debug.c -@@ -1345,47 +1345,58 @@ static const struct file_operations fops - .llseek = default_llseek, - }; - -+static const char debug_level_buf[] = -+ "To change debug level, set value adding up desired flags:\n" -+ "PCI: 0x1\n" -+ "WMI: 0x2\n" -+ "HTC: 0x4\n" -+ "HTT: 0x8\n" -+ "MAC: 0x10\n" -+ "BOOT: 0x20\n" -+ "PCI-DUMP: 0x40\n" -+ "HTT-DUMP: 0x80\n" -+ "MGMT: 0x100\n" -+ "DATA: 0x200\n" -+ "BMI: 0x400\n" -+ "REGULATORY: 0x800\n" -+ "TESTMODE: 0x1000\n" -+ "WMI-PRINT: 0x2000\n" -+ "PCI-PS: 0x4000\n" -+ "AHB: 0x8000\n" -+ "SDIO: 0x10000\n" -+ "SDIO_DUMP: 0x20000\n" -+ "USB: 0x40000\n" -+ "USB_BULK: 0x80000\n" -+ "SNOC: 0x100000\n" -+ "QMI: 0x200000\n" -+ "BEACONS: 0x8000000\n" -+ "NO-FW-DBGLOG:0x10000000\n" -+ "MAC2: 0x20000000\n" -+ "INFO-AS-DBG: 0x40000000\n" -+ "FW: 0x80000000\n" -+ "ALL: 0xEFFFFFFF\n"; -+ -+#define READ_DEBUG_LEVEL_SIZE sizeof(debug_level_buf) + 60 -+ - static ssize_t ath10k_read_debug_level(struct file *file, - char __user *user_buf, - size_t count, loff_t *ppos) - { -- int sz; -- const char buf[] = -- "To change debug level, set value adding up desired flags:\n" -- "PCI: 0x1\n" -- "WMI: 0x2\n" -- "HTC: 0x4\n" -- "HTT: 0x8\n" -- "MAC: 0x10\n" -- "BOOT: 0x20\n" -- "PCI-DUMP: 0x40\n" -- "HTT-DUMP: 0x80\n" -- "MGMT: 0x100\n" -- "DATA: 0x200\n" -- "BMI: 0x400\n" -- "REGULATORY: 0x800\n" -- "TESTMODE: 0x1000\n" -- "WMI-PRINT: 0x2000\n" -- "PCI-PS: 0x4000\n" -- "AHB: 0x8000\n" -- "SDIO: 0x10000\n" -- "SDIO_DUMP: 0x20000\n" -- "USB: 0x40000\n" -- "USB_BULK: 0x80000\n" -- "SNOC: 0x100000\n" -- "QMI: 0x200000\n" -- "BEACONS: 0x8000000\n" -- "NO-FW-DBGLOG:0x10000000\n" -- "MAC2: 0x20000000\n" -- "INFO-AS-DBG: 0x40000000\n" -- "FW: 0x80000000\n" -- "ALL: 0xEFFFFFFF\n"; -- char wbuf[sizeof(buf) + 60]; -- sz = snprintf(wbuf, sizeof(wbuf), "Current debug level: 0x%x\n\n%s", -- ath10k_debug_mask, buf); -- wbuf[sizeof(wbuf) - 1] = 0; -+ int sz, ret; -+ char *wbuf; -+ -+ wbuf = kcalloc(READ_DEBUG_LEVEL_SIZE, sizeof(char), GFP_KERNEL); -+ if (!wbuf) -+ return -ENOMEM; -+ -+ sz = snprintf(wbuf, READ_DEBUG_LEVEL_SIZE, -+ "Current debug level: 0x%x\n\n%s", -+ ath10k_debug_mask, debug_level_buf); -+ -+ ret = simple_read_from_buffer(user_buf, count, ppos, wbuf, sz); -+ kfree(wbuf); - -- return simple_read_from_buffer(user_buf, count, ppos, wbuf, sz); -+ return ret; - } - - /* Set logging level. diff --git a/package/kernel/ath10k-ct/patches/130-ath10k-read-qcom-coexist-support-as-a-u32.patch b/package/kernel/ath10k-ct/patches/130-ath10k-read-qcom-coexist-support-as-a-u32.patch index 891973f38d..f5fc3b2ec8 100644 --- a/package/kernel/ath10k-ct/patches/130-ath10k-read-qcom-coexist-support-as-a-u32.patch +++ b/package/kernel/ath10k-ct/patches/130-ath10k-read-qcom-coexist-support-as-a-u32.patch @@ -39,8 +39,8 @@ that the feature is properly initialized: Signed-off-by: Vincent Tremblay ---- a/ath10k-6.4/core.c -+++ b/ath10k-6.4/core.c +--- a/ath10k-6.7/core.c ++++ b/ath10k-6.7/core.c @@ -2869,14 +2869,14 @@ done: static void ath10k_core_fetch_btcoex_dt(struct ath10k *ar) { diff --git a/package/kernel/ath10k-ct/patches/201-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch b/package/kernel/ath10k-ct/patches/201-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch index 4f26806b5b..701fbb9e6f 100644 --- a/package/kernel/ath10k-ct/patches/201-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch +++ b/package/kernel/ath10k-ct/patches/201-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch @@ -20,24 +20,24 @@ Tested-by: Stefan Lippers-Hollmann Signed-off-by: Kalle Valo Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com --- - ath10k-6.4/Kconfig | 6 ++ - ath10k-6.4/Makefile | 1 + - ath10k-6.4/core.c | 32 ++++++++ - ath10k-6.4/core.h | 8 ++ - ath10k-6.4/hw.h | 1 + - ath10k-6.4/leds.c | 90 +++++++++++++++++++++++ - ath10k-6.4/leds.h | 34 +++++++++ - ath10k-6.4/mac.c | 1 + - ath10k-6.4/wmi-ops.h | 32 ++++++++ - ath10k-6.4/wmi-tlv.c | 2 + - ath10k-6.4/wmi.c | 54 ++++++++++++++ - ath10k-6.4/wmi.h | 35 +++++++++ + ath10k-6.7/Kconfig | 6 ++ + ath10k-6.7/Makefile | 1 + + ath10k-6.7/core.c | 32 ++++++++ + ath10k-6.7/core.h | 8 ++ + ath10k-6.7/hw.h | 1 + + ath10k-6.7/leds.c | 90 +++++++++++++++++++++++ + ath10k-6.7/leds.h | 34 +++++++++ + ath10k-6.7/mac.c | 1 + + ath10k-6.7/wmi-ops.h | 32 ++++++++ + ath10k-6.7/wmi-tlv.c | 2 + + ath10k-6.7/wmi.c | 54 ++++++++++++++ + ath10k-6.7/wmi.h | 35 +++++++++ 12 files changed, 296 insertions(+) - create mode 100644 ath10k-6.4/leds.c - create mode 100644 ath10k-6.4/leds.h + create mode 100644 ath10k-6.7/leds.c + create mode 100644 ath10k-6.7/leds.h ---- a/ath10k-6.4/Kconfig -+++ b/ath10k-6.4/Kconfig +--- a/ath10k-6.7/Kconfig ++++ b/ath10k-6.7/Kconfig @@ -67,6 +67,12 @@ config ATH10K_DEBUGFS If unsure, say Y to make it easier to debug problems. @@ -51,8 +51,8 @@ Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com config ATH10K_SPECTRAL bool "Atheros ath10k spectral scan support" depends on ATH10K_DEBUGFS ---- a/ath10k-6.4/Makefile -+++ b/ath10k-6.4/Makefile +--- a/ath10k-6.7/Makefile ++++ b/ath10k-6.7/Makefile @@ -20,6 +20,7 @@ ath10k_core-$(CONFIG_ATH10K_SPECTRAL) += ath10k_core-$(CONFIG_NL80211_TESTMODE) += testmode.o ath10k_core-$(CONFIG_ATH10K_TRACING) += trace.o @@ -61,8 +61,8 @@ Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com ath10k_core-$(CONFIG_MAC80211_DEBUGFS) += debugfs_sta.o ath10k_core-$(CONFIG_PM) += wow.o ath10k_core-$(CONFIG_ATH10K_CE) += ce.o ---- a/ath10k-6.4/core.c -+++ b/ath10k-6.4/core.c +--- a/ath10k-6.7/core.c ++++ b/ath10k-6.7/core.c @@ -28,6 +28,7 @@ #include "testmode.h" #include "wmi-ops.h" @@ -199,7 +199,7 @@ Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com .continuous_frag_desc = true, .tx_chain_mask = 0x7, .rx_chain_mask = 0x7, -@@ -4080,6 +4097,10 @@ int ath10k_core_start(struct ath10k *ar, +@@ -4071,6 +4088,10 @@ int ath10k_core_start(struct ath10k *ar, ath10k_wmi_check_apply_board_power_ctl_table(ar); } @@ -210,7 +210,7 @@ Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com return 0; err_hif_stop: -@@ -4341,9 +4362,18 @@ static void ath10k_core_register_work(st +@@ -4332,9 +4353,18 @@ static void ath10k_core_register_work(st goto err_spectral_destroy; } @@ -229,7 +229,7 @@ Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com err_spectral_destroy: ath10k_spectral_destroy(ar); err_debug_destroy: -@@ -4403,6 +4433,8 @@ void ath10k_core_unregister(struct ath10 +@@ -4394,6 +4424,8 @@ void ath10k_core_unregister(struct ath10 if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags)) return; @@ -238,8 +238,8 @@ Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com ath10k_thermal_unregister(ar); /* Stop spectral before unregistering from mac80211 to remove the * relayfs debugfs file cleanly. Otherwise the parent debugfs tree ---- a/ath10k-6.4/core.h -+++ b/ath10k-6.4/core.h +--- a/ath10k-6.7/core.h ++++ b/ath10k-6.7/core.h @@ -14,6 +14,7 @@ #include #include @@ -248,7 +248,7 @@ Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com #include "htt.h" #include "htc.h" -@@ -1586,6 +1587,13 @@ struct ath10k { +@@ -1589,6 +1590,13 @@ struct ath10k { } testmode; struct { @@ -262,8 +262,8 @@ Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com /* protected by data_lock */ u32 rx_crc_err_drop; u32 fw_crash_counter; ---- a/ath10k-6.4/hw.h -+++ b/ath10k-6.4/hw.h +--- a/ath10k-6.7/hw.h ++++ b/ath10k-6.7/hw.h @@ -523,6 +523,7 @@ struct ath10k_hw_params { const char *name; u32 patch_load_addr; @@ -273,7 +273,7 @@ Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com /* Type of hw cycle counter wraparound logic, for more info --- /dev/null -+++ b/ath10k-6.4/leds.c ++++ b/ath10k-6.7/leds.c @@ -0,0 +1,90 @@ +// SPDX-License-Identifier: ISC +/* @@ -366,7 +366,7 @@ Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com +} + --- /dev/null -+++ b/ath10k-6.4/leds.h ++++ b/ath10k-6.7/leds.h @@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: ISC */ +/* @@ -402,8 +402,8 @@ Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com + +#endif +#endif /* _LEDS_H_ */ ---- a/ath10k-6.4/mac.c -+++ b/ath10k-6.4/mac.c +--- a/ath10k-6.7/mac.c ++++ b/ath10k-6.7/mac.c @@ -25,6 +25,7 @@ #include "wmi-tlv.h" #include "wmi-ops.h" @@ -412,8 +412,8 @@ Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com /*********/ /* Rates */ ---- a/ath10k-6.4/wmi-ops.h -+++ b/ath10k-6.4/wmi-ops.h +--- a/ath10k-6.7/wmi-ops.h ++++ b/ath10k-6.7/wmi-ops.h @@ -228,7 +228,10 @@ struct wmi_ops { const struct wmi_bb_timing_cfg_arg *arg); struct sk_buff *(*gen_per_peer_per_tid_cfg)(struct ath10k *ar, @@ -461,8 +461,8 @@ Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com static inline int ath10k_wmi_dbglog_cfg(struct ath10k *ar, u64 module_enable, u32 log_level) { ---- a/ath10k-6.4/wmi-tlv.c -+++ b/ath10k-6.4/wmi-tlv.c +--- a/ath10k-6.7/wmi-tlv.c ++++ b/ath10k-6.7/wmi-tlv.c @@ -4601,6 +4601,8 @@ static const struct wmi_ops wmi_tlv_ops .gen_echo = ath10k_wmi_tlv_op_gen_echo, .gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf, @@ -472,9 +472,9 @@ Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com }; static const struct wmi_peer_flags_map wmi_tlv_peer_flags_map = { ---- a/ath10k-6.4/wmi.c -+++ b/ath10k-6.4/wmi.c -@@ -8438,6 +8438,49 @@ ath10k_wmi_op_gen_peer_set_param(struct +--- a/ath10k-6.7/wmi.c ++++ b/ath10k-6.7/wmi.c +@@ -8446,6 +8446,49 @@ ath10k_wmi_op_gen_peer_set_param(struct return skb; } @@ -524,7 +524,7 @@ Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com static struct sk_buff * ath10k_wmi_op_gen_set_psmode(struct ath10k *ar, u32 vdev_id, enum wmi_sta_ps_mode psmode) -@@ -10269,6 +10312,9 @@ static const struct wmi_ops wmi_ops = { +@@ -10255,6 +10298,9 @@ static const struct wmi_ops wmi_ops = { .fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill, .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, .gen_echo = ath10k_wmi_op_gen_echo, @@ -534,7 +534,7 @@ Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com /* .gen_bcn_tmpl not implemented */ /* .gen_prb_tmpl not implemented */ /* .gen_p2p_go_bcn_ie not implemented */ -@@ -10339,6 +10385,8 @@ static const struct wmi_ops wmi_10_1_ops +@@ -10325,6 +10371,8 @@ static const struct wmi_ops wmi_10_1_ops .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill, .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, .gen_echo = ath10k_wmi_op_gen_echo, @@ -543,7 +543,7 @@ Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com /* .gen_bcn_tmpl not implemented */ /* .gen_prb_tmpl not implemented */ /* .gen_p2p_go_bcn_ie not implemented */ -@@ -10418,6 +10466,8 @@ static const struct wmi_ops wmi_10_2_ops +@@ -10404,6 +10452,8 @@ static const struct wmi_ops wmi_10_2_ops .gen_delba_send = ath10k_wmi_op_gen_delba_send, .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill, .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, @@ -552,7 +552,7 @@ Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com /* .gen_pdev_enable_adaptive_cca not implemented */ }; -@@ -10489,6 +10539,8 @@ static const struct wmi_ops wmi_10_2_4_o +@@ -10475,6 +10525,8 @@ static const struct wmi_ops wmi_10_2_4_o ath10k_wmi_op_gen_pdev_enable_adaptive_cca, .get_vdev_subtype = ath10k_wmi_10_2_4_op_get_vdev_subtype, .gen_bb_timing = ath10k_wmi_10_2_4_op_gen_bb_timing, @@ -561,7 +561,7 @@ Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com /* .gen_bcn_tmpl not implemented */ /* .gen_prb_tmpl not implemented */ /* .gen_p2p_go_bcn_ie not implemented */ -@@ -10571,6 +10623,8 @@ static const struct wmi_ops wmi_10_4_ops +@@ -10557,6 +10609,8 @@ static const struct wmi_ops wmi_10_4_ops .gen_pdev_bss_chan_info_req = ath10k_wmi_10_2_op_gen_pdev_bss_chan_info, .gen_echo = ath10k_wmi_op_gen_echo, .gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config, @@ -570,8 +570,8 @@ Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com }; int ath10k_wmi_attach(struct ath10k *ar) ---- a/ath10k-6.4/wmi.h -+++ b/ath10k-6.4/wmi.h +--- a/ath10k-6.7/wmi.h ++++ b/ath10k-6.7/wmi.h @@ -3133,6 +3133,41 @@ enum wmi_10_4_feature_mask { }; diff --git a/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch index c5a6d19cac..39b7f645d7 100644 --- a/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch +++ b/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch @@ -9,14 +9,14 @@ traffic. Signed-off-by: Mathias Kresin --- - ath10k-6.4/core.h | 4 ++++ - ath10k-6.4/leds.c | 4 +--- - ath10k-6.4/mac.c | 2 +- + ath10k-6.7/core.h | 4 ++++ + ath10k-6.7/leds.c | 4 +--- + ath10k-6.7/mac.c | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) ---- a/ath10k-6.4/core.h -+++ b/ath10k-6.4/core.h -@@ -1701,6 +1701,10 @@ struct ath10k { +--- a/ath10k-6.7/core.h ++++ b/ath10k-6.7/core.h +@@ -1704,6 +1704,10 @@ struct ath10k { u8 csi_data[4096]; u16 csi_data_len; @@ -27,8 +27,8 @@ Signed-off-by: Mathias Kresin /* must be last */ u8 drv_priv[] __aligned(sizeof(void *)); }; ---- a/ath10k-6.4/leds.c -+++ b/ath10k-6.4/leds.c +--- a/ath10k-6.7/leds.c ++++ b/ath10k-6.7/leds.c @@ -70,7 +70,7 @@ int ath10k_leds_register(struct ath10k * ar->leds.cdev.name = ar->leds.label; @@ -38,9 +38,9 @@ Signed-off-by: Mathias Kresin ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev); if (ret) ---- a/ath10k-6.4/mac.c -+++ b/ath10k-6.4/mac.c -@@ -11616,7 +11616,7 @@ int ath10k_mac_register(struct ath10k *a +--- a/ath10k-6.7/mac.c ++++ b/ath10k-6.7/mac.c +@@ -11622,7 +11622,7 @@ int ath10k_mac_register(struct ath10k *a ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER; #ifdef CPTCFG_MAC80211_LEDS diff --git a/package/kernel/ath10k-ct/patches/300-fix-fortify-checking-error.patch b/package/kernel/ath10k-ct/patches/300-fix-fortify-checking-error.patch index 6966a5a487..1797b16dcf 100644 --- a/package/kernel/ath10k-ct/patches/300-fix-fortify-checking-error.patch +++ b/package/kernel/ath10k-ct/patches/300-fix-fortify-checking-error.patch @@ -1,5 +1,5 @@ ---- a/ath10k-6.4/wmi.h -+++ b/ath10k-6.4/wmi.h +--- a/ath10k-6.7/wmi.h ++++ b/ath10k-6.7/wmi.h @@ -6341,7 +6341,7 @@ struct qca9880_set_ctl_table_cmd { __le32 ctl_len; /* in bytes. This may be ignored in firmware, * make sure ctl_info data is sizeof(qca9880_power_ctl) */ diff --git a/package/kernel/ath10k-ct/patches/960-0010-ath10k-limit-htt-rx-ring-size.patch b/package/kernel/ath10k-ct/patches/960-0010-ath10k-limit-htt-rx-ring-size.patch index b0e6ef76fa..5fb70ab5c7 100644 --- a/package/kernel/ath10k-ct/patches/960-0010-ath10k-limit-htt-rx-ring-size.patch +++ b/package/kernel/ath10k-ct/patches/960-0010-ath10k-limit-htt-rx-ring-size.patch @@ -1,5 +1,5 @@ ---- a/ath10k-6.4/htt.h -+++ b/ath10k-6.4/htt.h +--- a/ath10k-6.7/htt.h ++++ b/ath10k-6.7/htt.h @@ -237,7 +237,11 @@ enum htt_rx_ring_flags { }; diff --git a/package/kernel/ath10k-ct/patches/960-0011-ath10k-limit-pci-buffer-size.patch b/package/kernel/ath10k-ct/patches/960-0011-ath10k-limit-pci-buffer-size.patch index 82109995d9..eceb66c3bb 100644 --- a/package/kernel/ath10k-ct/patches/960-0011-ath10k-limit-pci-buffer-size.patch +++ b/package/kernel/ath10k-ct/patches/960-0011-ath10k-limit-pci-buffer-size.patch @@ -1,5 +1,5 @@ ---- a/ath10k-6.4/pci.c -+++ b/ath10k-6.4/pci.c +--- a/ath10k-6.7/pci.c ++++ b/ath10k-6.7/pci.c @@ -131,7 +131,11 @@ static const struct ce_attr pci_host_ce_ .flags = CE_ATTR_FLAGS, .src_nentries = 0, diff --git a/package/kernel/ath10k-ct/patches/988-ath10k-always-use-mac80211-loss-detection.patch b/package/kernel/ath10k-ct/patches/988-ath10k-always-use-mac80211-loss-detection.patch index 8aef577deb..165f180388 100644 --- a/package/kernel/ath10k-ct/patches/988-ath10k-always-use-mac80211-loss-detection.patch +++ b/package/kernel/ath10k-ct/patches/988-ath10k-always-use-mac80211-loss-detection.patch @@ -13,12 +13,12 @@ own loss detection mechanism. Signed-off-by: David Bauer --- - ath10k-6.4/mac.c | 1 - + ath10k-6.7/mac.c | 1 - 1 file changed, 1 deletion(-) ---- a/ath10k-6.4/mac.c -+++ b/ath10k-6.4/mac.c -@@ -11305,7 +11305,6 @@ int ath10k_mac_register(struct ath10k *a +--- a/ath10k-6.7/mac.c ++++ b/ath10k-6.7/mac.c +@@ -11311,7 +11311,6 @@ int ath10k_mac_register(struct ath10k *a ieee80211_hw_set(ar->hw, CHANCTX_STA_CSA); ieee80211_hw_set(ar->hw, QUEUE_CONTROL); ieee80211_hw_set(ar->hw, SUPPORTS_TX_FRAG); From 7ccd7dac7ec24f8310104f96437bc539c52cb6cb Mon Sep 17 00:00:00 2001 From: Mieczyslaw Nalewaj Date: Tue, 18 Jun 2024 01:43:47 +0200 Subject: [PATCH 27/27] generic: replace spi Silicon Labs patch with upstream version Replace Silicon Labs patch with upstream version as they got merged in kernel 6.3. Signed-off-by: Mieczyslaw Nalewaj [ rework commit title and description, use better patch ] Link: https://github.com/openwrt/openwrt/pull/15300 Signed-off-by: Christian Marangi --- ...ev-Add-Silicon-Labs-EM3581-device-compatible.patch} | 10 +++++----- ...ev-Add-Silicon-Labs-SI3210-device-compatible.patch} | 10 +++++----- ...ev-Add-Silicon-Labs-EM3581-device-compatible.patch} | 10 +++++----- ...ev-Add-Silicon-Labs-SI3210-device-compatible.patch} | 10 +++++----- 4 files changed, 20 insertions(+), 20 deletions(-) rename target/linux/generic/{pending-5.15/110-v6.3-0001-spidev-Add-Silicon-Labs-EM3581-device-compatible.patch => backport-5.15/412-v6.3-01-spidev-Add-Silicon-Labs-EM3581-device-compatible.patch} (72%) rename target/linux/generic/{pending-5.15/110-v6.3-0002-spidev-Add-Silicon-Labs-SI3210-device-compatible.patch => backport-5.15/412-v6.3-02-spidev-Add-Silicon-Labs-SI3210-device-compatible.patch} (72%) rename target/linux/generic/{pending-6.1/110-v6.3-0001-spidev-Add-Silicon-Labs-EM3581-device-compatible.patch => backport-6.1/412-v6.3-01-spidev-Add-Silicon-Labs-EM3581-device-compatible.patch} (74%) rename target/linux/generic/{pending-6.1/110-v6.3-0002-spidev-Add-Silicon-Labs-SI3210-device-compatible.patch => backport-6.1/412-v6.3-02-spidev-Add-Silicon-Labs-SI3210-device-compatible.patch} (74%) diff --git a/target/linux/generic/pending-5.15/110-v6.3-0001-spidev-Add-Silicon-Labs-EM3581-device-compatible.patch b/target/linux/generic/backport-5.15/412-v6.3-01-spidev-Add-Silicon-Labs-EM3581-device-compatible.patch similarity index 72% rename from target/linux/generic/pending-5.15/110-v6.3-0001-spidev-Add-Silicon-Labs-EM3581-device-compatible.patch rename to target/linux/generic/backport-5.15/412-v6.3-01-spidev-Add-Silicon-Labs-EM3581-device-compatible.patch index 5216d6a706..153191529c 100644 --- a/target/linux/generic/pending-5.15/110-v6.3-0001-spidev-Add-Silicon-Labs-EM3581-device-compatible.patch +++ b/target/linux/generic/backport-5.15/412-v6.3-01-spidev-Add-Silicon-Labs-EM3581-device-compatible.patch @@ -1,13 +1,13 @@ -From f7982c726e02001afc19052fe48f642dfcbc00b2 Mon Sep 17 00:00:00 2001 +From c67d90e058550403a3e6f9b05bfcdcfa12b1815c Mon Sep 17 00:00:00 2001 From: Vincent Tremblay -Date: Mon, 26 Dec 2022 21:10:37 -0500 -Subject: [PATCH 1/2] spidev: Add Silicon Labs EM3581 device compatible +Date: Mon, 26 Dec 2022 21:35:48 -0500 +Subject: [PATCH] spidev: Add Silicon Labs EM3581 device compatible Add compatible string for Silicon Labs EM3581 device. -Note: This patch is adapted from a patch submitted to the for-next branch (v6.3). - Signed-off-by: Vincent Tremblay +Link: https://lore.kernel.org/r/20221227023550.569547-2-vincent@vtremblay.dev +Signed-off-by: Mark Brown --- drivers/spi/spidev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/generic/pending-5.15/110-v6.3-0002-spidev-Add-Silicon-Labs-SI3210-device-compatible.patch b/target/linux/generic/backport-5.15/412-v6.3-02-spidev-Add-Silicon-Labs-SI3210-device-compatible.patch similarity index 72% rename from target/linux/generic/pending-5.15/110-v6.3-0002-spidev-Add-Silicon-Labs-SI3210-device-compatible.patch rename to target/linux/generic/backport-5.15/412-v6.3-02-spidev-Add-Silicon-Labs-SI3210-device-compatible.patch index ffbed0c622..ef36c82a6c 100644 --- a/target/linux/generic/pending-5.15/110-v6.3-0002-spidev-Add-Silicon-Labs-SI3210-device-compatible.patch +++ b/target/linux/generic/backport-5.15/412-v6.3-02-spidev-Add-Silicon-Labs-SI3210-device-compatible.patch @@ -1,13 +1,13 @@ -From 536581825219e97fa2ae0c4de35605d2f6311416 Mon Sep 17 00:00:00 2001 +From 6c9d1fd52956c3148e847a214bae9102b1811de5 Mon Sep 17 00:00:00 2001 From: Vincent Tremblay -Date: Tue, 27 Dec 2022 09:00:58 -0500 -Subject: [PATCH 2/2] spidev: Add Silicon Labs SI3210 device compatible +Date: Tue, 27 Dec 2022 09:10:08 -0500 +Subject: [PATCH] spidev: Add Silicon Labs SI3210 device compatible Add compatible string for Silicon Labs SI3210 device. -Note: This patch is adapted from a patch submitted to the for-next branch (v6.3). - Signed-off-by: Vincent Tremblay +Link: https://lore.kernel.org/r/20221227141011.111410-2-vincent@vtremblay.dev +Signed-off-by: Mark Brown --- drivers/spi/spidev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/generic/pending-6.1/110-v6.3-0001-spidev-Add-Silicon-Labs-EM3581-device-compatible.patch b/target/linux/generic/backport-6.1/412-v6.3-01-spidev-Add-Silicon-Labs-EM3581-device-compatible.patch similarity index 74% rename from target/linux/generic/pending-6.1/110-v6.3-0001-spidev-Add-Silicon-Labs-EM3581-device-compatible.patch rename to target/linux/generic/backport-6.1/412-v6.3-01-spidev-Add-Silicon-Labs-EM3581-device-compatible.patch index ebeeae2f8f..cc05fa6b75 100644 --- a/target/linux/generic/pending-6.1/110-v6.3-0001-spidev-Add-Silicon-Labs-EM3581-device-compatible.patch +++ b/target/linux/generic/backport-6.1/412-v6.3-01-spidev-Add-Silicon-Labs-EM3581-device-compatible.patch @@ -1,13 +1,13 @@ -From f7982c726e02001afc19052fe48f642dfcbc00b2 Mon Sep 17 00:00:00 2001 +From c67d90e058550403a3e6f9b05bfcdcfa12b1815c Mon Sep 17 00:00:00 2001 From: Vincent Tremblay -Date: Mon, 26 Dec 2022 21:10:37 -0500 -Subject: [PATCH 1/2] spidev: Add Silicon Labs EM3581 device compatible +Date: Mon, 26 Dec 2022 21:35:48 -0500 +Subject: [PATCH] spidev: Add Silicon Labs EM3581 device compatible Add compatible string for Silicon Labs EM3581 device. -Note: This patch is adapted from a patch submitted to the for-next branch (v6.3). - Signed-off-by: Vincent Tremblay +Link: https://lore.kernel.org/r/20221227023550.569547-2-vincent@vtremblay.dev +Signed-off-by: Mark Brown --- drivers/spi/spidev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/generic/pending-6.1/110-v6.3-0002-spidev-Add-Silicon-Labs-SI3210-device-compatible.patch b/target/linux/generic/backport-6.1/412-v6.3-02-spidev-Add-Silicon-Labs-SI3210-device-compatible.patch similarity index 74% rename from target/linux/generic/pending-6.1/110-v6.3-0002-spidev-Add-Silicon-Labs-SI3210-device-compatible.patch rename to target/linux/generic/backport-6.1/412-v6.3-02-spidev-Add-Silicon-Labs-SI3210-device-compatible.patch index db5b5800f4..59d025e087 100644 --- a/target/linux/generic/pending-6.1/110-v6.3-0002-spidev-Add-Silicon-Labs-SI3210-device-compatible.patch +++ b/target/linux/generic/backport-6.1/412-v6.3-02-spidev-Add-Silicon-Labs-SI3210-device-compatible.patch @@ -1,13 +1,13 @@ -From 536581825219e97fa2ae0c4de35605d2f6311416 Mon Sep 17 00:00:00 2001 +From 6c9d1fd52956c3148e847a214bae9102b1811de5 Mon Sep 17 00:00:00 2001 From: Vincent Tremblay -Date: Tue, 27 Dec 2022 09:00:58 -0500 -Subject: [PATCH 2/2] spidev: Add Silicon Labs SI3210 device compatible +Date: Tue, 27 Dec 2022 09:10:08 -0500 +Subject: [PATCH] spidev: Add Silicon Labs SI3210 device compatible Add compatible string for Silicon Labs SI3210 device. -Note: This patch is adapted from a patch submitted to the for-next branch (v6.3). - Signed-off-by: Vincent Tremblay +Link: https://lore.kernel.org/r/20221227141011.111410-2-vincent@vtremblay.dev +Signed-off-by: Mark Brown --- drivers/spi/spidev.c | 2 ++ 1 file changed, 2 insertions(+)