From 1a6f6a1e8cbc29042f63771d5f05bdbe622d9078 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 8 Sep 2022 02:34:28 +0100 Subject: [PATCH 01/21] mediatek: bpi-r3: make initramfs/recovery optional Only include recovery image in SD card image generated for the BananaPi BPi-R3 if building with CONFIG_TARGET_ROOTFS_INITRAMFS. This allows to build images larger than 32 MB (the limit for initramfs/recovery image) by deselecting initramfs. Signed-off-by: Daniel Golle --- target/linux/mediatek/image/filogic.mk | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index dfc71bbb14..e366661240 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -62,7 +62,9 @@ define Device/bananapi_bpi-r3 ARTIFACT/sdcard.img.gz := mt7986-gpt sdmmc |\ pad-to 17k | bl2 sdmmc-ddr4 |\ pad-to 6656k | bl31-uboot bananapi_bpi-r3-sdmmc |\ - pad-to 12M | append-image-stage initramfs-recovery.itb |\ + $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),\ + pad-to 12M | append-image-stage initramfs-recovery.itb | check-size 44m |\ + ) \ pad-to 44M | bl2 spim-nand-ddr4 |\ pad-to 45M | bl31-uboot bananapi_bpi-r3-snand |\ pad-to 49M | bl2 nor-ddr4 |\ @@ -70,7 +72,10 @@ define Device/bananapi_bpi-r3 pad-to 51M | bl2 emmc-ddr4 |\ pad-to 52M | bl31-uboot bananapi_bpi-r3-emmc |\ pad-to 56M | mt7986-gpt emmc |\ - pad-to 64M | append-image squashfs-sysupgrade.itb | gzip + $(if $(CONFIG_TARGET_ROOTFS_SQUASHFS),\ + pad-to 64M | append-image squashfs-sysupgrade.itb | check-size | gzip \ + ) + IMAGE_SIZE := $$(shell expr 64 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m KERNEL := kernel-bin | gzip KERNEL_INITRAMFS := kernel-bin | lzma | \ fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k From 50c892d67bb4af90861be9fbb6831c2eeb62de11 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 8 Sep 2022 02:44:30 +0100 Subject: [PATCH 02/21] mediatek: bpi-r64: make initramfs/recovery optional Only include recovery image in SD card image generated for the BananaPi BPi-R64 if building with CONFIG_TARGET_ROOTFS_INITRAMFS This allows to build images larger than 32 MB (the limit for initramfs/recovery image) by deselecting initramfs. Signed-off-by: Daniel Golle --- target/linux/mediatek/image/mt7622.mk | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/target/linux/mediatek/image/mt7622.mk b/target/linux/mediatek/image/mt7622.mk index 810645067a..d92c72294a 100644 --- a/target/linux/mediatek/image/mt7622.mk +++ b/target/linux/mediatek/image/mt7622.mk @@ -86,13 +86,18 @@ define Device/bananapi_bpi-r64 ARTIFACT/sdcard.img.gz := mt7622-gpt sdmmc |\ pad-to 512k | bl2 sdmmc-2ddr |\ pad-to 2048k | bl31-uboot bananapi_bpi-r64-sdmmc |\ - pad-to 6144k | append-image-stage initramfs-recovery.itb |\ + $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),\ + pad-to 6144k | append-image-stage initramfs-recovery.itb | checksize 38912k |\ + ) \ pad-to 38912k | mt7622-gpt emmc |\ pad-to 39424k | bl2 emmc-2ddr |\ pad-to 40960k | bl31-uboot bananapi_bpi-r64-emmc |\ pad-to 43008k | bl2 snand-2ddr |\ pad-to 43520k | bl31-uboot bananapi_bpi-r64-snand |\ - pad-to 46080k | append-image squashfs-sysupgrade.itb | gzip + $(if $(CONFIG_TARGET_ROOTFS_SQUASHFS),\ + pad-to 46080k | append-image squashfs-sysupgrade.itb | check-size | gzip \ + ) + IMAGE_SIZE := $$(shell expr 45 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m KERNEL := kernel-bin | gzip KERNEL_INITRAMFS := kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb with-initrd | pad-to 128k IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb external-static-with-rootfs | append-metadata From 1e1695f959e678868bb7911d059b847f38fc9cf4 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Mon, 5 Sep 2022 19:23:16 +0200 Subject: [PATCH 03/21] ath79: add support for ZTE MF281 Add support for the ZTE MF281 battery-powered WiFi router. Hardware -------- SoC: Qualcomm Atheros QCA9563 RAM: 128M DDR2 FLASH: 2M SPI-NOR (GigaDevice GD25Q16) 128M SPI-NAND (GigaDevice) WLAN: QCA9563 2T2R 802.11 abgn QCA9886 2T2R 802.11 nac WWAN: ASRMicro ASR1826 ETH: Qualcomm Atheros QCA8337 UART: 115200 8n1 Unpopulated connector next to SIM slot (SIM) GND - RX - TX - 3V3 Don't connect 3V3 BUTTON: Reset - WPS LED: 1x debug-LED (internal) LEDs on front of the device are controlled using the modem CPU and can not be controlled by OpenWrt Installation ------------ 1. Connect to the serial console. Power up the device and interrupt autoboot when prompted 2. Connect a TFTP server reachable at 192.168.1.66 to the ethernet port. Serve the OpenWrt initramfs image as "speedbox-2.bin" 3. Boot the initramfs image using U-Boot $ setenv serverip 192.168.1.66 $ setenv ipaddr 192.168.1.154 $ tftpboot 0x84000000 speedbox-2.bin $ bootm 4. Copy the OpenWrt factory image to the device using scp and write to the NAND flash $ mtd write /path/to/openwrt/factory.bin firmware WWAN ---- The WWAN card can be used with OpenWrt. Example configuration for connection with a unauthenticated dual-stack APN: network.lte=interface network.lte.proto='ncm' network.lte.device='/dev/ttyACM0' network.lte.pdptype='IPV4V6' network.lte.apn='internet.telekom' network.lte.ipv6='auto' network.lte.delay='10' The WWAN card is running a modified version of OpenWrt and handles power-management as well as the LED controller (AW9523). A root shell can be acquired by installing adb using opkg and executing "adb shell". Signed-off-by: David Bauer --- target/linux/ath79/dts/qca9563_zte_mf281.dts | 275 ++++++++++++++++++ target/linux/ath79/image/nand.mk | 21 +- .../nand/base-files/etc/board.d/02_network | 4 + 3 files changed, 296 insertions(+), 4 deletions(-) create mode 100644 target/linux/ath79/dts/qca9563_zte_mf281.dts diff --git a/target/linux/ath79/dts/qca9563_zte_mf281.dts b/target/linux/ath79/dts/qca9563_zte_mf281.dts new file mode 100644 index 0000000000..2f4b7316bf --- /dev/null +++ b/target/linux/ath79/dts/qca9563_zte_mf281.dts @@ -0,0 +1,275 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +// Copyright (c) 2021 Cezary Jackiewicz +// Copyright (c) 2021, 2022 Lech Perczak +// Copyright (c) 2022 David Bauer + +#include "qca956x.dtsi" + +#include +#include +#include + +/ { + model = "ZTE MF281"; + compatible = "zte,mf281", "qca,qca9563"; + + aliases { + led-boot = &led_debug; + led-failsafe = &led_debug; + led-running = &led_debug; + led-upgrade = &led_debug; + label-mac-device = ð0; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&enable_wlan_led_gpio>; + + /* Hidden SMD LED below signal strength LEDs. + * Visible through slits underside of the case. + */ + led_debug: debug { + label = "green:debug"; + gpios = <&gpio 7 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + wps { + label = "wps"; + linux,code = ; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + /* This GPIO is used to reset whole board _including_ the modem */ + gpio-restart { + compatible = "gpio-restart"; + gpios = <&gpio 5 GPIO_ACTIVE_HIGH>; + active-delay = <3000>; + inactive-delay = <1000>; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0xa0000>; + read-only; + }; + + partition@80000 { + label = "u-boot-env"; + reg = <0xa0000 0x20000>; + read-only; + }; + }; + }; + + flash@1 { + compatible = "spi-nand"; + reg = <1>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "fota-flag"; + reg = <0x000000 0xa0000>; + read-only; + }; + + partition@a0000 { + label = "art"; + reg = <0xa0000 0x80000>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + cal_caldata_1000: cal@1000 { + reg = <0x1000 0x440>; + }; + + cal_caldata_5000: cal@5000 { + reg = <0x5000 0x2f20>; + }; + }; + + partition@120000 { + label = "mac"; + reg = <0x120000 0x80000>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mac_0: macaddr@0 { + reg = <0x0 0x6>; + }; + }; + + partition@1a0000 { + label = "reserved2"; + reg = <0x1a0000 0xc0000>; + read-only; + }; + + partition@260000 { + label = "cfg-param"; + reg = <0x260000 0x400000>; + read-only; + }; + + partition@660000 { + label = "log"; + reg = <0x660000 0x400000>; + read-only; + }; + + partition@a60000 { + label = "oops"; + reg = <0xa60000 0xa0000>; + read-only; + }; + + partition@b00000 { + label = "reserved3"; + reg = <0xb00000 0x500000>; + read-only; + }; + + partition@1000000 { + label = "web"; + reg = <0x1000000 0x800000>; + read-only; + }; + + partition@1800000 { + label = "firmware"; + reg = <0x1800000 0x1d00000>; + + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "kernel"; + reg = <0x0 0x600000>; + }; + + partition@600000 { + label = "ubi"; + reg = <0x600000 0x1700000>; + }; + }; + + partition@3500000 { + label = "data"; + reg = <0x3500000 0x1900000>; + read-only; + }; + + partition@4e00000 { + label = "fota"; + reg = <0x4e00000 0x3200000>; + read-only; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + phy-mode = "sgmii"; + + qca,ar8327-initvals = < + 0x04 0x00080080 /* PORT0 PAD MODE CTRL */ + 0x7c 0x0000007e /* PORT0_STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + phy-mode = "sgmii"; + phy-handle = <&phy0>; + + nvmem-cells = <&macaddr_mac_0>; + nvmem-cell-names = "mac-address"; +}; + +&pcie { + status = "okay"; + + wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0x0 0 0 0 0>; + + nvmem-cells = <&macaddr_mac_0>, <&cal_caldata_5000>; + nvmem-cell-names = "mac-address", "pre-calibration"; + mac-address-increment = <1>; + }; +}; + +&pinmux { + enable_wlan_led_gpio: pinmux_wlan_led_gpio { + pinctrl-single,bits = <0x10 0x0 0xff000000>; + }; +}; + +&wmac { + status = "okay"; + + nvmem-cells = <&macaddr_mac_0>, <&cal_caldata_1000>; + nvmem-cell-names = "mac-address", "calibration"; +}; + +&usb_phy0 { + status = "okay"; +}; + +&usb0 { + status = "okay"; +}; + +&usb_phy1 { + status = "okay"; +}; + +&usb1 { + status = "okay"; +}; diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk index 4e1ac216a5..117f6e99cd 100644 --- a/target/linux/ath79/image/nand.mk +++ b/target/linux/ath79/image/nand.mk @@ -322,7 +322,7 @@ define Device/netgear_wndr4500-v3 endef TARGET_DEVICES += netgear_wndr4500-v3 -define Device/zte_mf286_common +define Device/zte_mf28x_common SOC := qca9563 DEVICE_VENDOR := ZTE DEVICE_PACKAGES := kmod-usb2 kmod-ath10k-ct @@ -332,8 +332,21 @@ define Device/zte_mf286_common IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata endef +define Device/zte_mf281 + $(Device/zte_mf28x_common) + DEVICE_MODEL := MF281 + KERNEL_SIZE := 6144k + IMAGE_SIZE := 29696k + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | \ + check-size + DEVICE_PACKAGES += ath10k-firmware-qca9888-ct kmod-usb-net-rndis \ + kmod-usb-acm comgt-ncm +endef +TARGET_DEVICES += zte_mf281 + define Device/zte_mf286 - $(Device/zte_mf286_common) + $(Device/zte_mf28x_common) DEVICE_MODEL := MF286 DEVICE_PACKAGES += ath10k-firmware-qca988x-ct kmod-usb-net-qmi-wwan \ kmod-usb-serial-option uqmi @@ -341,7 +354,7 @@ endef TARGET_DEVICES += zte_mf286 define Device/zte_mf286a - $(Device/zte_mf286_common) + $(Device/zte_mf28x_common) DEVICE_MODEL := MF286A DEVICE_PACKAGES += ath10k-firmware-qca9888-ct kmod-usb-net-qmi-wwan \ kmod-usb-serial-option uqmi @@ -349,7 +362,7 @@ endef TARGET_DEVICES += zte_mf286a define Device/zte_mf286r - $(Device/zte_mf286_common) + $(Device/zte_mf28x_common) DEVICE_MODEL := MF286R DEVICE_PACKAGES += ath10k-firmware-qca9888-ct kmod-usb-net-rndis kmod-usb-acm \ comgt-ncm diff --git a/target/linux/ath79/nand/base-files/etc/board.d/02_network b/target/linux/ath79/nand/base-files/etc/board.d/02_network index 01f26fb39d..b252d7d9e8 100644 --- a/target/linux/ath79/nand/base-files/etc/board.d/02_network +++ b/target/linux/ath79/nand/base-files/etc/board.d/02_network @@ -53,6 +53,10 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" ;; + zte,mf281) + ucidef_add_switch "switch0" \ + "0@eth0" "5:lan" + ;; zte,mf286|\ zte,mf286a|\ zte,mf286r) From 007c8809c1e888748af70c1b878f4d0105fe7531 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 8 Sep 2022 19:29:44 +0100 Subject: [PATCH 04/21] mediatek: fix typo in bpi-r64 image recipe Janusz Dziedzic reported a typo introduced by a recent commit. Fix it. Fixes: 50c892d67b ("mediatek: bpi-r64: make initramfs/recovery optional") Signed-off-by: Daniel Golle --- target/linux/mediatek/image/mt7622.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/mediatek/image/mt7622.mk b/target/linux/mediatek/image/mt7622.mk index d92c72294a..f9cd18fd41 100644 --- a/target/linux/mediatek/image/mt7622.mk +++ b/target/linux/mediatek/image/mt7622.mk @@ -87,7 +87,7 @@ define Device/bananapi_bpi-r64 pad-to 512k | bl2 sdmmc-2ddr |\ pad-to 2048k | bl31-uboot bananapi_bpi-r64-sdmmc |\ $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),\ - pad-to 6144k | append-image-stage initramfs-recovery.itb | checksize 38912k |\ + pad-to 6144k | append-image-stage initramfs-recovery.itb | check-size 38912k |\ ) \ pad-to 38912k | mt7622-gpt emmc |\ pad-to 39424k | bl2 emmc-2ddr |\ From 545c6113c93bbf7de1b0e515141a4565f7e6cece Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= Date: Thu, 8 Sep 2022 19:35:34 +0200 Subject: [PATCH 05/21] realtek: fix RTL838x receive tag decoding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit dc9cc0d3e2a1 ("realtek: add QoS and rate control") replaced a 16 bit reserved field in the RTL83xx packet header with the initial cpu_tag word, shifting the real cpu_tag fields by one. Adjusting for this new shift was partially forgotten in the new RX tag decoders. This caused the switch to block IGMP, effectively blocking IPv4 multicast. The bug was partially fixed by commit 9d847244d9fd ("realtek: fix RTL839X receive tag decoding") Fix on RTL838x too, including correct NIC_RX_REASON_SPECIAL_TRAP value. Suggested-by: Jan Hoffmann Fixes: dc9cc0d3e2a1 ("realtek: add QoS and rate control") Signed-off-by: Bjørn Mork --- .../files-5.10/drivers/net/ethernet/rtl838x_eth.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c b/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c index 0eee06d803..d9ade65526 100644 --- a/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c +++ b/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c @@ -58,6 +58,7 @@ struct p_hdr { uint16_t size; /* buffer size */ uint16_t offset; uint16_t len; /* pkt len */ + /* cpu_tag[0] is a reserved uint16_t on RTL83xx */ uint16_t cpu_tag[10]; } __packed __aligned(1); @@ -262,13 +263,14 @@ struct dsa_tag { bool rtl838x_decode_tag(struct p_hdr *h, struct dsa_tag *t) { - t->reason = h->cpu_tag[3] & 0xf; - t->queue = (h->cpu_tag[0] & 0xe0) >> 5; + /* cpu_tag[0] is reserved. Fields are off-by-one */ + t->reason = h->cpu_tag[4] & 0xf; + t->queue = (h->cpu_tag[1] & 0xe0) >> 5; t->port = h->cpu_tag[1] & 0x1f; t->crc_error = t->reason == 13; pr_debug("Reason: %d\n", t->reason); - if (t->reason != 4) // NIC_RX_REASON_SPECIAL_TRAP + if (t->reason != 6) // NIC_RX_REASON_SPECIAL_TRAP t->l2_offloaded = 1; else t->l2_offloaded = 0; @@ -278,6 +280,7 @@ bool rtl838x_decode_tag(struct p_hdr *h, struct dsa_tag *t) bool rtl839x_decode_tag(struct p_hdr *h, struct dsa_tag *t) { + /* cpu_tag[0] is reserved. Fields are off-by-one */ t->reason = h->cpu_tag[5] & 0x1f; t->queue = (h->cpu_tag[3] & 0xe000) >> 13; t->port = h->cpu_tag[1] & 0x3f; From 3020d9f8b4d6651662ed22cc87e542ca3e66b887 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 9 Sep 2022 05:00:57 +0100 Subject: [PATCH 06/21] kernel: mtk_sgmii: re-organize PCS link status reporting Don't report speed in case link is down. Signed-off-by: Daniel Golle --- .../724-net-mtk_sgmii-implement-mtk_pcs_ops.patch | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/target/linux/generic/pending-5.15/724-net-mtk_sgmii-implement-mtk_pcs_ops.patch b/target/linux/generic/pending-5.15/724-net-mtk_sgmii-implement-mtk_pcs_ops.patch index 896f0169d2..cd97706658 100644 --- a/target/linux/generic/pending-5.15/724-net-mtk_sgmii-implement-mtk_pcs_ops.patch +++ b/target/linux/generic/pending-5.15/724-net-mtk_sgmii-implement-mtk_pcs_ops.patch @@ -15,7 +15,7 @@ Signed-off-by: Daniel Golle --- a/drivers/net/ethernet/mediatek/mtk_sgmii.c +++ b/drivers/net/ethernet/mediatek/mtk_sgmii.c -@@ -122,10 +122,26 @@ static void mtk_pcs_link_up(struct phyli +@@ -122,10 +122,28 @@ static void mtk_pcs_link_up(struct phyli regmap_write(mpcs->regmap, SGMSYS_SGMII_MODE, val); } @@ -24,12 +24,14 @@ Signed-off-by: Daniel Golle + struct mtk_pcs *mpcs = pcs_to_mtk_pcs(pcs); + unsigned int val; + -+ regmap_read(mpcs->regmap, mpcs->ana_rgc3, &val); -+ state->speed = val & RG_PHY_SPEED_3_125G ? SPEED_2500 : SPEED_1000; -+ + regmap_read(mpcs->regmap, SGMSYS_PCS_CONTROL_1, &val); + state->an_complete = !!(val & SGMII_AN_COMPLETE); + state->link = !!(val & SGMII_LINK_STATYS); ++ if (!state->link) ++ return; ++ ++ regmap_read(mpcs->regmap, mpcs->ana_rgc3, &val); ++ state->speed = val & RG_PHY_SPEED_3_125G ? SPEED_2500 : SPEED_1000; + state->duplex = DUPLEX_FULL; + state->pause = 0; +} From bd6783f4fb8f6171927e9067c0005a6d69fc13fe Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 9 Sep 2022 05:01:47 +0100 Subject: [PATCH 07/21] kernel: mt7530: add support for in-band managed link Add support for in-band managed link status to support SFP cage connected to port 5 of the MT7531 switch on the Bananapi BPi-R3. Signed-off-by: Daniel Golle --- ...-add-support-for-in-band-link-status.patch | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 target/linux/generic/pending-5.15/731-net-dsa-mt7530-add-support-for-in-band-link-status.patch diff --git a/target/linux/generic/pending-5.15/731-net-dsa-mt7530-add-support-for-in-band-link-status.patch b/target/linux/generic/pending-5.15/731-net-dsa-mt7530-add-support-for-in-band-link-status.patch new file mode 100644 index 0000000000..8196f19540 --- /dev/null +++ b/target/linux/generic/pending-5.15/731-net-dsa-mt7530-add-support-for-in-band-link-status.patch @@ -0,0 +1,123 @@ +From 8e18c5fef75debfae3531fbd6901f3bf317d91ed Mon Sep 17 00:00:00 2001 +From: Daniel Golle +Date: Fri, 9 Sep 2022 04:28:43 +0100 +Subject: [PATCH] net: dsa: mt7530: add support for in-band link status +To: linux-mediatek@lists.infradead.org, + netdev@vger.kernel.org +Cc: Russell King , + Sean Wang , + Landen Chao , + DENG Qingfang , + Andrew Lunn , + Vivien Didelot , + Florian Fainelli , + Vladimir Oltean , + David S. Miller , + Eric Dumazet , + Jakub Kicinski , + Paolo Abeni , + Matthias Brugger , + Philipp Zabel + +Read link status from SGMII PCS for in-band managed 2500Base-X and +1000Base-X connection on a MAC port of the MT7531. This is needed to +get the SFP cage working which is connected to SGMII interface of +port 5 of the MT7531 switch IC on the Bananapi BPi-R3 board. + +Signed-off-by: Daniel Golle +--- + drivers/net/dsa/mt7530.c | 48 +++++++++++++++++++++++++++++----------- + 1 file changed, 35 insertions(+), 13 deletions(-) + +--- a/drivers/net/dsa/mt7530.c ++++ b/drivers/net/dsa/mt7530.c +@@ -2703,9 +2703,6 @@ mt7531_mac_config(struct dsa_switch *ds, + case PHY_INTERFACE_MODE_NA: + case PHY_INTERFACE_MODE_1000BASEX: + case PHY_INTERFACE_MODE_2500BASEX: +- if (phylink_autoneg_inband(mode)) +- return -EINVAL; +- + return mt7531_sgmii_setup_mode_force(priv, port, interface); + default: + return -EINVAL; +@@ -2781,13 +2778,6 @@ unsupported: + return; + } + +- if (phylink_autoneg_inband(mode) && +- state->interface != PHY_INTERFACE_MODE_SGMII) { +- dev_err(ds->dev, "%s: in-band negotiation unsupported\n", +- __func__); +- return; +- } +- + mcr_cur = mt7530_read(priv, MT7530_PMCR_P(port)); + mcr_new = mcr_cur; + mcr_new &= ~PMCR_LINK_SETTINGS_MASK; +@@ -2924,6 +2914,9 @@ static void mt753x_phylink_get_caps(stru + config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE | + MAC_10 | MAC_100 | MAC_1000FD; + ++ if ((priv->id == ID_MT7531) && mt753x_is_mac_port(port)) ++ config->mac_capabilities |= MAC_2500FD; ++ + /* This driver does not make use of the speed, duplex, pause or the + * advertisement in its mac_config, so it is safe to mark this driver + * as non-legacy. +@@ -3019,16 +3012,43 @@ mt7531_sgmii_pcs_get_state_an(struct mt7 + return 0; + } + ++static void ++mt7531_sgmii_pcs_get_state_inband(struct mt7530_priv *priv, int port, ++ struct phylink_link_state *state) ++{ ++ unsigned int val; ++ ++ val = mt7530_read(priv, MT7531_PCS_CONTROL_1(port)); ++ state->link = !!(val & MT7531_SGMII_LINK_STATUS); ++ if (!state->link) ++ return; ++ ++ if (state->interface == PHY_INTERFACE_MODE_2500BASEX) ++ state->speed = SPEED_2500; ++ else ++ state->speed = SPEED_1000; ++ ++ state->duplex = DUPLEX_FULL; ++ state->pause = 0; ++} ++ + static void mt7531_pcs_get_state(struct phylink_pcs *pcs, + struct phylink_link_state *state) + { + struct mt7530_priv *priv = pcs_to_mt753x_pcs(pcs)->priv; + int port = pcs_to_mt753x_pcs(pcs)->port; ++ unsigned int val; + +- if (state->interface == PHY_INTERFACE_MODE_SGMII) ++ if (state->interface == PHY_INTERFACE_MODE_SGMII) { + mt7531_sgmii_pcs_get_state_an(priv, port, state); +- else +- state->link = false; ++ return; ++ } else if ((state->interface == PHY_INTERFACE_MODE_1000BASEX) || ++ (state->interface == PHY_INTERFACE_MODE_2500BASEX)) { ++ mt7531_sgmii_pcs_get_state_inband(priv, port, state); ++ return; ++ } ++ ++ state->link = false; + } + + static int mt753x_pcs_config(struct phylink_pcs *pcs, unsigned int mode, +@@ -3069,6 +3089,8 @@ mt753x_setup(struct dsa_switch *ds) + priv->pcs[i].pcs.ops = priv->info->pcs_ops; + priv->pcs[i].priv = priv; + priv->pcs[i].port = i; ++ if (mt753x_is_mac_port(i)) ++ priv->pcs[i].pcs.poll = 1; + } + + ret = priv->info->sw_setup(ds); From 5f458e64a9bca6875d7974fd5b9cd570f5d2d40c Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Wed, 20 Jul 2022 20:39:09 +0200 Subject: [PATCH 08/21] ipq40xx: switch to 5.15 as default kernel The testing kernel received now multiple months of testing. Set 5.15 as default to give it a test with a broader audience. Tested on: - MikroTik SXTsq 5 AC - FritzBox 4040/7530 - ZyXEL NBG6617 Signed-off-by: Nick Hainke --- target/linux/ipq40xx/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/linux/ipq40xx/Makefile b/target/linux/ipq40xx/Makefile index 19b63cdd65..6eb9c00223 100644 --- a/target/linux/ipq40xx/Makefile +++ b/target/linux/ipq40xx/Makefile @@ -8,8 +8,7 @@ CPU_TYPE:=cortex-a7 CPU_SUBTYPE:=neon-vfpv4 SUBTARGETS:=generic chromium mikrotik -KERNEL_PATCHVER:=5.10 -KERNEL_TESTING_PATCHVER:=5.15 +KERNEL_PATCHVER:=5.15 KERNELNAME:=zImage Image dtbs From c7c350922668e262068c9301b75434d7bb4b8d10 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Fri, 9 Sep 2022 18:14:08 +0200 Subject: [PATCH 09/21] ipq40xx: add LTE packages for GL-AP1300 Add LTE packages required for operating the LTE modem optionally shipped with the GL-AP1300. Signed-off-by: David Bauer --- target/linux/ipq40xx/image/generic.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk index 98a40349b2..102de5c8bf 100644 --- a/target/linux/ipq40xx/image/generic.mk +++ b/target/linux/ipq40xx/image/generic.mk @@ -559,7 +559,7 @@ define Device/glinet_gl-ap1300 PAGESIZE := 2048 IMAGE_SIZE := 131072k KERNEL_INSTALL := 1 - DEVICE_PACKAGES := ipq-wifi-glinet_gl-ap1300 + DEVICE_PACKAGES := ipq-wifi-glinet_gl-ap1300 kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi endef TARGET_DEVICES += glinet_gl-ap1300 From c0f74a01b539a3406b61ed6a22f8d5d183be3df9 Mon Sep 17 00:00:00 2001 From: John Audia Date: Tue, 6 Sep 2022 17:34:02 -0400 Subject: [PATCH 10/21] kernel: add # CONFIG_ARM64_ERRATUM_2441009 symbol No current targets are ARMv9 or Cortex-A510 so comment the new symbol.[1] 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/diff/arch/arm64/Kconfig?id=v5.15.65&id2=v5.15.64 Signed-off-by: John Audia --- target/linux/generic/config-5.15 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/generic/config-5.15 b/target/linux/generic/config-5.15 index 13b52d6b5e..efeaf2c452 100644 --- a/target/linux/generic/config-5.15 +++ b/target/linux/generic/config-5.15 @@ -337,6 +337,7 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 # CONFIG_ARM64_ERRATUM_843419 is not set # CONFIG_ARM64_ERRATUM_845719 is not set # CONFIG_ARM64_ERRATUM_858921 is not set +# CONFIG_ARM64_ERRATUM_2441009 is not set # CONFIG_ARM64_HW_AFDBM is not set # CONFIG_ARM64_LSE_ATOMICS is not set # CONFIG_ARM64_MODULE_PLTS is not set From fbe2f7db8644d831e7afe9e0b5b154a8d7294815 Mon Sep 17 00:00:00 2001 From: John Audia Date: Thu, 8 Sep 2022 09:03:12 -0400 Subject: [PATCH 11/21] kernel: bump 5.15 to 5.15.67 All patches automatically rebased Build system: x86_64 Build-tested: bcm2711/RPi4B, mt7622/RT3200 Run-tested: bcm2711/RPi4B, mt7622/RT3200 Signed-off-by: John Audia --- include/kernel-5.15 | 4 ++-- ...-plumbing-for-updating-interrupt-endpoint-int.patch | 2 +- ...plement-xhci_fixup_endpoint-for-interval-adju.patch | 4 ++-- ...-0371-clk-raspberrypi-Also-support-HEVC-clock.patch | 2 +- .../950-0440-clk-Always-clamp-the-rounded-rate.patch | 2 +- .../950-0548-clk-raspberrypi-Support-VEC-clock.patch | 2 +- ...-0591-clk-bcm-rpi-Add-the-BCM283x-pixel-clock.patch | 2 +- ...factor-out-TRBS_PER_SEGMENT-define-in-runtime.patch | 4 ++-- ...-clk-Use-clamp-instead-of-open-coding-our-own.patch | 2 +- ...clk-Always-set-the-rate-on-clk_set_range_rate.patch | 2 +- .../950-0837-clk-Drop-the-rate-range-on-clk_put.patch | 8 ++++---- ...e-into-account-uncached-clocks-in-clk_set_rat.patch | 4 ++-- .../950-0846-clk-Set-req_rate-on-reparenting.patch | 4 ++-- ...lk-Skip-set_rate_range-if-our-clock-is-orphan.patch | 2 +- ...-our-request-boundaries-in-clk_core_init_rate.patch | 8 ++++---- ...9-clk-Change-clk_core_init_rate_req-prototype.patch | 6 +++--- ...0-0850-clk-Introduce-clk_hw_init_rate_request.patch | 2 +- ...-clk-Add-missing-clk_core_init_rate_req-calls.patch | 6 +++--- ...-Remove-redundant-clk_core_init_rate_req-call.patch | 2 +- .../950-0854-clk-Introduce-clk_core_has_parent.patch | 2 +- ...op-forwarding-clk_rate_requests-to-the-parent.patch | 4 ++-- ...-0856-clk-Zero-the-clk_rate_request-structure.patch | 2 +- .../950-0858-clk-bcm-rpi-Add-variant-structure.patch | 2 +- .../950-0865-clk-Add-clk_get_rate_range.patch | 2 +- ...50-0896-clk-Add-locking-to-clk_get_rate_range.patch | 2 +- ...xhci-add-support-for-performing-fake-doorbell.patch | 6 +++--- ...10-net-dsa-b53-add-support-for-BCM63xx-RGMIIs.patch | 2 +- .../backport-5.15/011-kbuild-export-SUBARCH.patch | 2 +- ...t-convert-users-of-bitmap_foo-to-linkmode_foo.patch | 4 ++-- .../generic/hack-5.15/250-netfilter_depends.patch | 4 ++-- .../650-netfilter-add-xt_FLOWOFFLOAD-target.patch | 6 +++--- .../hack-5.15/721-net-add-packet-mangeling.patch | 4 ++-- .../hack-5.15/780-usb-net-MeigLink_modem_support.patch | 2 +- .../pending-5.15/203-kallsyms_uncompressed.patch | 2 +- .../generic/pending-5.15/655-increase_skb_pad.patch | 2 +- .../680-NET-skip-GRO-for-foreign-MAC-addresses.patch | 10 +++++----- ...tk_sgmii-enable-PCS-polling-to-allow-SFP-work.patch | 2 +- .../patches-5.15/700-mvneta-tx-queue-workaround.patch | 4 ++-- ...net-next-ethernet-marvell-mvnetaMQPrioOffload.patch | 4 ++-- ...03-net-next-ethernet-marvell-mvnetaMQPrioFlag.patch | 2 +- ...4-net-next-ethernet-marvell-mvnetaMQPrioQueue.patch | 6 +++--- ...t-next-ethernet-marvell-mvnetaMQPrioTCOffload.patch | 6 +++--- 42 files changed, 75 insertions(+), 75 deletions(-) diff --git a/include/kernel-5.15 b/include/kernel-5.15 index 672f5bc15e..8ebccec7fa 100644 --- a/include/kernel-5.15 +++ b/include/kernel-5.15 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.15 = .64 -LINUX_KERNEL_HASH-5.15.64 = c6a1d38c6fa3798341372d5cf0088ae806ccdc827e31ecbff8988e097ba5de50 +LINUX_VERSION-5.15 = .67 +LINUX_KERNEL_HASH-5.15.67 = da47d9a80b694548835ccb553b6eb1a1f3f5d5cddd9e2bd6f4886b99ca14f940 diff --git a/target/linux/bcm27xx/patches-5.15/950-0151-usb-add-plumbing-for-updating-interrupt-endpoint-int.patch b/target/linux/bcm27xx/patches-5.15/950-0151-usb-add-plumbing-for-updating-interrupt-endpoint-int.patch index 44fd3256ff..12ddf91426 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0151-usb-add-plumbing-for-updating-interrupt-endpoint-int.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0151-usb-add-plumbing-for-updating-interrupt-endpoint-int.patch @@ -70,7 +70,7 @@ Signed-off-by: Jonathan Bell * @dev: the device whose endpoint is being disabled --- a/include/linux/usb.h +++ b/include/linux/usb.h -@@ -1840,6 +1840,8 @@ extern int usb_clear_halt(struct usb_dev +@@ -1842,6 +1842,8 @@ extern int usb_clear_halt(struct usb_dev extern int usb_reset_configuration(struct usb_device *dev); extern int usb_set_interface(struct usb_device *dev, int ifnum, int alternate); extern void usb_reset_endpoint(struct usb_device *dev, unsigned int epaddr); diff --git a/target/linux/bcm27xx/patches-5.15/950-0152-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch b/target/linux/bcm27xx/patches-5.15/950-0152-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch index 166ca54512..7fec7cb556 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0152-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0152-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch @@ -15,7 +15,7 @@ Signed-off-by: Jonathan Bell --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -1620,6 +1620,109 @@ command_cleanup: +@@ -1611,6 +1611,109 @@ command_cleanup: } /* @@ -125,7 +125,7 @@ Signed-off-by: Jonathan Bell * non-error returns are a promise to giveback() the urb later * we drop ownership so next owner (or urb unlink) can get it */ -@@ -5445,6 +5548,7 @@ static const struct hc_driver xhci_hc_dr +@@ -5436,6 +5539,7 @@ static const struct hc_driver xhci_hc_dr .endpoint_reset = xhci_endpoint_reset, .check_bandwidth = xhci_check_bandwidth, .reset_bandwidth = xhci_reset_bandwidth, diff --git a/target/linux/bcm27xx/patches-5.15/950-0371-clk-raspberrypi-Also-support-HEVC-clock.patch b/target/linux/bcm27xx/patches-5.15/950-0371-clk-raspberrypi-Also-support-HEVC-clock.patch index 9ff67d830c..dceb16819e 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0371-clk-raspberrypi-Also-support-HEVC-clock.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0371-clk-raspberrypi-Also-support-HEVC-clock.patch @@ -10,7 +10,7 @@ Signed-off-by: Dom Cobley --- a/drivers/clk/bcm/clk-raspberrypi.c +++ b/drivers/clk/bcm/clk-raspberrypi.c -@@ -271,6 +271,7 @@ static int raspberrypi_discover_clocks(s +@@ -276,6 +276,7 @@ static int raspberrypi_discover_clocks(s case RPI_FIRMWARE_CORE_CLK_ID: case RPI_FIRMWARE_M2MC_CLK_ID: case RPI_FIRMWARE_V3D_CLK_ID: diff --git a/target/linux/bcm27xx/patches-5.15/950-0440-clk-Always-clamp-the-rounded-rate.patch b/target/linux/bcm27xx/patches-5.15/950-0440-clk-Always-clamp-the-rounded-rate.patch index 6eb5c947ac..434c91f01e 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0440-clk-Always-clamp-the-rounded-rate.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0440-clk-Always-clamp-the-rounded-rate.patch @@ -17,7 +17,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -1347,6 +1347,8 @@ static int clk_core_determine_round_nolo +@@ -1346,6 +1346,8 @@ static int clk_core_determine_round_nolo if (!core) return 0; diff --git a/target/linux/bcm27xx/patches-5.15/950-0548-clk-raspberrypi-Support-VEC-clock.patch b/target/linux/bcm27xx/patches-5.15/950-0548-clk-raspberrypi-Support-VEC-clock.patch index d31cc64168..9e3b2188c7 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0548-clk-raspberrypi-Support-VEC-clock.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0548-clk-raspberrypi-Support-VEC-clock.patch @@ -26,7 +26,7 @@ Signed-off-by: Dom Cobley }; #define RPI_FIRMWARE_STATE_ENABLE_BIT BIT(0) -@@ -273,6 +275,7 @@ static int raspberrypi_discover_clocks(s +@@ -278,6 +280,7 @@ static int raspberrypi_discover_clocks(s case RPI_FIRMWARE_V3D_CLK_ID: case RPI_FIRMWARE_HEVC_CLK_ID: case RPI_FIRMWARE_PIXEL_BVB_CLK_ID: diff --git a/target/linux/bcm27xx/patches-5.15/950-0591-clk-bcm-rpi-Add-the-BCM283x-pixel-clock.patch b/target/linux/bcm27xx/patches-5.15/950-0591-clk-bcm-rpi-Add-the-BCM283x-pixel-clock.patch index 6b663b96d3..1a6400dc75 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0591-clk-bcm-rpi-Add-the-BCM283x-pixel-clock.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0591-clk-bcm-rpi-Add-the-BCM283x-pixel-clock.patch @@ -16,7 +16,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/clk/bcm/clk-raspberrypi.c +++ b/drivers/clk/bcm/clk-raspberrypi.c -@@ -276,6 +276,7 @@ static int raspberrypi_discover_clocks(s +@@ -281,6 +281,7 @@ static int raspberrypi_discover_clocks(s case RPI_FIRMWARE_HEVC_CLK_ID: case RPI_FIRMWARE_PIXEL_BVB_CLK_ID: case RPI_FIRMWARE_VEC_CLK_ID: diff --git a/target/linux/bcm27xx/patches-5.15/950-0605-xhci-refactor-out-TRBS_PER_SEGMENT-define-in-runtime.patch b/target/linux/bcm27xx/patches-5.15/950-0605-xhci-refactor-out-TRBS_PER_SEGMENT-define-in-runtime.patch index 4387b4eed9..e6d2bcebb5 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0605-xhci-refactor-out-TRBS_PER_SEGMENT-define-in-runtime.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0605-xhci-refactor-out-TRBS_PER_SEGMENT-define-in-runtime.patch @@ -226,7 +226,7 @@ Signed-off-by: Jonathan Bell } --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -879,8 +879,8 @@ static void xhci_clear_command_ring(stru +@@ -870,8 +870,8 @@ static void xhci_clear_command_ring(stru seg = ring->deq_seg; do { memset(seg->trbs, 0, @@ -237,7 +237,7 @@ Signed-off-by: Jonathan Bell cpu_to_le32(~TRB_CYCLE); seg = seg->next; } while (seg != ring->deq_seg); -@@ -891,7 +891,7 @@ static void xhci_clear_command_ring(stru +@@ -882,7 +882,7 @@ static void xhci_clear_command_ring(stru ring->enq_seg = ring->deq_seg; ring->enqueue = ring->dequeue; diff --git a/target/linux/bcm27xx/patches-5.15/950-0833-clk-Use-clamp-instead-of-open-coding-our-own.patch b/target/linux/bcm27xx/patches-5.15/950-0833-clk-Use-clamp-instead-of-open-coding-our-own.patch index 02a0a12401..290cc631cb 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0833-clk-Use-clamp-instead-of-open-coding-our-own.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0833-clk-Use-clamp-instead-of-open-coding-our-own.patch @@ -18,7 +18,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -2387,11 +2387,7 @@ int clk_set_rate_range(struct clk *clk, +@@ -2386,11 +2386,7 @@ int clk_set_rate_range(struct clk *clk, * this corner case when determining the rate */ diff --git a/target/linux/bcm27xx/patches-5.15/950-0834-clk-Always-set-the-rate-on-clk_set_range_rate.patch b/target/linux/bcm27xx/patches-5.15/950-0834-clk-Always-set-the-rate-on-clk_set_range_rate.patch index b110f717ad..47c3eb131c 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0834-clk-Always-set-the-rate-on-clk_set_range_rate.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0834-clk-Always-set-the-rate-on-clk_set_range_rate.patch @@ -30,7 +30,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -2372,28 +2372,29 @@ int clk_set_rate_range(struct clk *clk, +@@ -2371,28 +2371,29 @@ int clk_set_rate_range(struct clk *clk, goto out; } diff --git a/target/linux/bcm27xx/patches-5.15/950-0837-clk-Drop-the-rate-range-on-clk_put.patch b/target/linux/bcm27xx/patches-5.15/950-0837-clk-Drop-the-rate-range-on-clk_put.patch index 1da8076078..f96e740888 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0837-clk-Drop-the-rate-range-on-clk_put.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0837-clk-Drop-the-rate-range-on-clk_put.patch @@ -29,7 +29,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -2331,19 +2331,15 @@ int clk_set_rate_exclusive(struct clk *c +@@ -2330,19 +2330,15 @@ int clk_set_rate_exclusive(struct clk *c } EXPORT_SYMBOL_GPL(clk_set_rate_exclusive); @@ -54,7 +54,7 @@ Signed-off-by: Maxime Ripard if (!clk) return 0; -@@ -2356,8 +2352,6 @@ int clk_set_rate_range(struct clk *clk, +@@ -2355,8 +2351,6 @@ int clk_set_rate_range(struct clk *clk, return -EINVAL; } @@ -63,7 +63,7 @@ Signed-off-by: Maxime Ripard if (clk->exclusive_count) clk_core_rate_unprotect(clk->core); -@@ -2401,6 +2395,28 @@ out: +@@ -2400,6 +2394,28 @@ out: if (clk->exclusive_count) clk_core_rate_protect(clk->core); @@ -92,7 +92,7 @@ Signed-off-by: Maxime Ripard clk_prepare_unlock(); return ret; -@@ -4360,9 +4376,10 @@ void __clk_put(struct clk *clk) +@@ -4359,9 +4375,10 @@ void __clk_put(struct clk *clk) } hlist_del(&clk->clks_node); diff --git a/target/linux/bcm27xx/patches-5.15/950-0844-clk-Take-into-account-uncached-clocks-in-clk_set_rat.patch b/target/linux/bcm27xx/patches-5.15/950-0844-clk-Take-into-account-uncached-clocks-in-clk_set_rat.patch index b5ae00957a..8f540b7660 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0844-clk-Take-into-account-uncached-clocks-in-clk_set_rat.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0844-clk-Take-into-account-uncached-clocks-in-clk_set_rat.patch @@ -22,7 +22,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -2366,6 +2366,10 @@ static int clk_set_rate_range_nolock(str +@@ -2365,6 +2365,10 @@ static int clk_set_rate_range_nolock(str goto out; } @@ -33,7 +33,7 @@ Signed-off-by: Maxime Ripard /* * Since the boundaries have been changed, let's give the * opportunity to the provider to adjust the clock rate based on -@@ -2383,7 +2387,7 @@ static int clk_set_rate_range_nolock(str +@@ -2382,7 +2386,7 @@ static int clk_set_rate_range_nolock(str * - the determine_rate() callback does not really check for * this corner case when determining the rate */ diff --git a/target/linux/bcm27xx/patches-5.15/950-0846-clk-Set-req_rate-on-reparenting.patch b/target/linux/bcm27xx/patches-5.15/950-0846-clk-Set-req_rate-on-reparenting.patch index 32786521a9..d45bdcf343 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0846-clk-Set-req_rate-on-reparenting.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0846-clk-Set-req_rate-on-reparenting.patch @@ -23,7 +23,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -1758,6 +1758,23 @@ static void clk_core_update_orphan_statu +@@ -1757,6 +1757,23 @@ static void clk_core_update_orphan_statu clk_core_update_orphan_status(child, is_orphan); } @@ -47,7 +47,7 @@ Signed-off-by: Maxime Ripard static void clk_reparent(struct clk_core *core, struct clk_core *new_parent) { bool was_orphan = core->orphan; -@@ -1782,6 +1799,7 @@ static void clk_reparent(struct clk_core +@@ -1781,6 +1798,7 @@ static void clk_reparent(struct clk_core } core->parent = new_parent; diff --git a/target/linux/bcm27xx/patches-5.15/950-0847-clk-Skip-set_rate_range-if-our-clock-is-orphan.patch b/target/linux/bcm27xx/patches-5.15/950-0847-clk-Skip-set_rate_range-if-our-clock-is-orphan.patch index 4244ad378f..d4f281d6fe 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0847-clk-Skip-set_rate_range-if-our-clock-is-orphan.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0847-clk-Skip-set_rate_range-if-our-clock-is-orphan.patch @@ -25,7 +25,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -2388,6 +2388,12 @@ static int clk_set_rate_range_nolock(str +@@ -2387,6 +2387,12 @@ static int clk_set_rate_range_nolock(str if (clk->core->flags & CLK_GET_RATE_NOCACHE) rate = clk_core_get_rate_recalc(clk->core); diff --git a/target/linux/bcm27xx/patches-5.15/950-0848-clk-Add-our-request-boundaries-in-clk_core_init_rate.patch b/target/linux/bcm27xx/patches-5.15/950-0848-clk-Add-our-request-boundaries-in-clk_core_init_rate.patch index 1d3f213f54..f273453031 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0848-clk-Add-our-request-boundaries-in-clk_core_init_rate.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0848-clk-Add-our-request-boundaries-in-clk_core_init_rate.patch @@ -26,7 +26,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -1381,6 +1381,8 @@ static void clk_core_init_rate_req(struc +@@ -1380,6 +1380,8 @@ static void clk_core_init_rate_req(struc if (WARN_ON(!core || !req)) return; @@ -35,7 +35,7 @@ Signed-off-by: Maxime Ripard parent = core->parent; if (parent) { req->best_parent_hw = parent->hw; -@@ -1455,7 +1457,6 @@ unsigned long clk_hw_round_rate(struct c +@@ -1454,7 +1456,6 @@ unsigned long clk_hw_round_rate(struct c int ret; struct clk_rate_request req; @@ -43,7 +43,7 @@ Signed-off-by: Maxime Ripard req.rate = rate; ret = clk_core_round_rate_nolock(hw->core, &req); -@@ -1488,7 +1489,6 @@ long clk_round_rate(struct clk *clk, uns +@@ -1487,7 +1488,6 @@ long clk_round_rate(struct clk *clk, uns if (clk->exclusive_count) clk_core_rate_unprotect(clk->core); @@ -51,7 +51,7 @@ Signed-off-by: Maxime Ripard req.rate = rate; ret = clk_core_round_rate_nolock(clk->core, &req); -@@ -1995,8 +1995,6 @@ static struct clk_core *clk_calc_new_rat +@@ -1994,8 +1994,6 @@ static struct clk_core *clk_calc_new_rat struct clk_rate_request req; req.rate = rate; diff --git a/target/linux/bcm27xx/patches-5.15/950-0849-clk-Change-clk_core_init_rate_req-prototype.patch b/target/linux/bcm27xx/patches-5.15/950-0849-clk-Change-clk_core_init_rate_req-prototype.patch index dcd6568c1d..7f08b94fa4 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0849-clk-Change-clk_core_init_rate_req-prototype.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0849-clk-Change-clk_core_init_rate_req-prototype.patch @@ -19,7 +19,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -1374,13 +1374,15 @@ static int clk_core_determine_round_nolo +@@ -1373,13 +1373,15 @@ static int clk_core_determine_round_nolo } static void clk_core_init_rate_req(struct clk_core * const core, @@ -36,7 +36,7 @@ Signed-off-by: Maxime Ripard clk_core_get_boundaries(core, &req->min_rate, &req->max_rate); parent = core->parent; -@@ -1408,7 +1410,7 @@ static int clk_core_round_rate_nolock(st +@@ -1407,7 +1409,7 @@ static int clk_core_round_rate_nolock(st return 0; } @@ -45,7 +45,7 @@ Signed-off-by: Maxime Ripard if (clk_core_can_round(core)) return clk_core_determine_round_nolock(core, req); -@@ -1994,9 +1996,7 @@ static struct clk_core *clk_calc_new_rat +@@ -1993,9 +1995,7 @@ static struct clk_core *clk_calc_new_rat if (clk_core_can_round(core)) { struct clk_rate_request req; diff --git a/target/linux/bcm27xx/patches-5.15/950-0850-clk-Introduce-clk_hw_init_rate_request.patch b/target/linux/bcm27xx/patches-5.15/950-0850-clk-Introduce-clk_hw_init_rate_request.patch index 6a04498301..1db5a0ad45 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0850-clk-Introduce-clk_hw_init_rate_request.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0850-clk-Introduce-clk_hw_init_rate_request.patch @@ -22,7 +22,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -1395,6 +1395,26 @@ static void clk_core_init_rate_req(struc +@@ -1394,6 +1394,26 @@ static void clk_core_init_rate_req(struc } } diff --git a/target/linux/bcm27xx/patches-5.15/950-0851-clk-Add-missing-clk_core_init_rate_req-calls.patch b/target/linux/bcm27xx/patches-5.15/950-0851-clk-Add-missing-clk_core_init_rate_req-calls.patch index 0fe7a39a7a..1dad2e5006 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0851-clk-Add-missing-clk_core_init_rate_req-calls.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0851-clk-Add-missing-clk_core_init_rate_req-calls.patch @@ -19,7 +19,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -1479,7 +1479,7 @@ unsigned long clk_hw_round_rate(struct c +@@ -1478,7 +1478,7 @@ unsigned long clk_hw_round_rate(struct c int ret; struct clk_rate_request req; @@ -28,7 +28,7 @@ Signed-off-by: Maxime Ripard ret = clk_core_round_rate_nolock(hw->core, &req); if (ret) -@@ -1511,7 +1511,7 @@ long clk_round_rate(struct clk *clk, uns +@@ -1510,7 +1510,7 @@ long clk_round_rate(struct clk *clk, uns if (clk->exclusive_count) clk_core_rate_unprotect(clk->core); @@ -37,7 +37,7 @@ Signed-off-by: Maxime Ripard ret = clk_core_round_rate_nolock(clk->core, &req); -@@ -2215,8 +2215,7 @@ static unsigned long clk_core_req_round_ +@@ -2214,8 +2214,7 @@ static unsigned long clk_core_req_round_ if (cnt < 0) return cnt; diff --git a/target/linux/bcm27xx/patches-5.15/950-0852-clk-Remove-redundant-clk_core_init_rate_req-call.patch b/target/linux/bcm27xx/patches-5.15/950-0852-clk-Remove-redundant-clk_core_init_rate_req-call.patch index cfc272d194..86e43eec54 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0852-clk-Remove-redundant-clk_core_init_rate_req-call.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0852-clk-Remove-redundant-clk_core_init_rate_req-call.patch @@ -23,7 +23,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -1430,8 +1430,6 @@ static int clk_core_round_rate_nolock(st +@@ -1429,8 +1429,6 @@ static int clk_core_round_rate_nolock(st return 0; } diff --git a/target/linux/bcm27xx/patches-5.15/950-0854-clk-Introduce-clk_core_has_parent.patch b/target/linux/bcm27xx/patches-5.15/950-0854-clk-Introduce-clk_core_has_parent.patch index 909acfefb0..73e34ebe5f 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0854-clk-Introduce-clk_core_has_parent.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0854-clk-Introduce-clk_core_has_parent.patch @@ -47,7 +47,7 @@ Signed-off-by: Maxime Ripard int clk_mux_determine_rate_flags(struct clk_hw *hw, struct clk_rate_request *req, unsigned long flags) -@@ -2569,25 +2589,11 @@ void clk_hw_reparent(struct clk_hw *hw, +@@ -2568,25 +2588,11 @@ void clk_hw_reparent(struct clk_hw *hw, */ bool clk_has_parent(struct clk *clk, struct clk *parent) { diff --git a/target/linux/bcm27xx/patches-5.15/950-0855-clk-Stop-forwarding-clk_rate_requests-to-the-parent.patch b/target/linux/bcm27xx/patches-5.15/950-0855-clk-Stop-forwarding-clk_rate_requests-to-the-parent.patch index 4573dbcc05..75fcbeee9e 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0855-clk-Stop-forwarding-clk_rate_requests-to-the-parent.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0855-clk-Stop-forwarding-clk_rate_requests-to-the-parent.patch @@ -126,7 +126,7 @@ Signed-off-by: Maxime Ripard } } -@@ -1450,6 +1480,8 @@ static bool clk_core_can_round(struct cl +@@ -1449,6 +1479,8 @@ static bool clk_core_can_round(struct cl static int clk_core_round_rate_nolock(struct clk_core *core, struct clk_rate_request *req) { @@ -135,7 +135,7 @@ Signed-off-by: Maxime Ripard lockdep_assert_held(&prepare_lock); if (!core) { -@@ -1459,8 +1491,20 @@ static int clk_core_round_rate_nolock(st +@@ -1458,8 +1490,20 @@ static int clk_core_round_rate_nolock(st if (clk_core_can_round(core)) return clk_core_determine_round_nolock(core, req); diff --git a/target/linux/bcm27xx/patches-5.15/950-0856-clk-Zero-the-clk_rate_request-structure.patch b/target/linux/bcm27xx/patches-5.15/950-0856-clk-Zero-the-clk_rate_request-structure.patch index 05ef714deb..dc914aab84 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0856-clk-Zero-the-clk_rate_request-structure.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0856-clk-Zero-the-clk_rate_request-structure.patch @@ -17,7 +17,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -1439,6 +1439,8 @@ static void clk_core_init_rate_req(struc +@@ -1438,6 +1438,8 @@ static void clk_core_init_rate_req(struc if (WARN_ON(!core || !req)) return; diff --git a/target/linux/bcm27xx/patches-5.15/950-0858-clk-bcm-rpi-Add-variant-structure.patch b/target/linux/bcm27xx/patches-5.15/950-0858-clk-bcm-rpi-Add-variant-structure.patch index 3fde2c951a..b57437194d 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0858-clk-bcm-rpi-Add-variant-structure.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0858-clk-bcm-rpi-Add-variant-structure.patch @@ -105,7 +105,7 @@ Signed-off-by: Maxime Ripard if (ret) { dev_err(rpi->dev, "Failed to initialize clkdev\n"); return ERR_PTR(ret); -@@ -266,30 +305,27 @@ static int raspberrypi_discover_clocks(s +@@ -271,30 +310,27 @@ static int raspberrypi_discover_clocks(s return ret; while (clks->id) { diff --git a/target/linux/bcm27xx/patches-5.15/950-0865-clk-Add-clk_get_rate_range.patch b/target/linux/bcm27xx/patches-5.15/950-0865-clk-Add-clk_get_rate_range.patch index 5366c057cd..09d5dc4bce 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0865-clk-Add-clk_get_rate_range.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0865-clk-Add-clk_get_rate_range.patch @@ -28,7 +28,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -2576,6 +2576,24 @@ int clk_set_max_rate(struct clk *clk, un +@@ -2575,6 +2575,24 @@ int clk_set_max_rate(struct clk *clk, un EXPORT_SYMBOL_GPL(clk_set_max_rate); /** diff --git a/target/linux/bcm27xx/patches-5.15/950-0896-clk-Add-locking-to-clk_get_rate_range.patch b/target/linux/bcm27xx/patches-5.15/950-0896-clk-Add-locking-to-clk_get_rate_range.patch index 7e228999e2..b932514d09 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0896-clk-Add-locking-to-clk_get_rate_range.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0896-clk-Add-locking-to-clk_get_rate_range.patch @@ -13,7 +13,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c -@@ -2589,7 +2589,9 @@ void clk_get_rate_range(struct clk *clk, +@@ -2588,7 +2588,9 @@ void clk_get_rate_range(struct clk *clk, if (!clk || !min || !max) return; diff --git a/target/linux/bcm53xx/patches-5.15/180-usb-xhci-add-support-for-performing-fake-doorbell.patch b/target/linux/bcm53xx/patches-5.15/180-usb-xhci-add-support-for-performing-fake-doorbell.patch index 3b6bcbaa2a..285dd8df84 100644 --- a/target/linux/bcm53xx/patches-5.15/180-usb-xhci-add-support-for-performing-fake-doorbell.patch +++ b/target/linux/bcm53xx/patches-5.15/180-usb-xhci-add-support-for-performing-fake-doorbell.patch @@ -40,7 +40,7 @@ it on BCM4708 family. /* called during probe() after chip reset completes */ --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -155,6 +155,49 @@ int xhci_start(struct xhci_hcd *xhci) +@@ -157,6 +157,49 @@ int xhci_start(struct xhci_hcd *xhci) return ret; } @@ -90,7 +90,7 @@ it on BCM4708 family. /* * Reset a halted HC. * -@@ -605,10 +648,20 @@ static int xhci_init(struct usb_hcd *hcd +@@ -607,10 +650,20 @@ static int xhci_init(struct usb_hcd *hcd static int xhci_run_finished(struct xhci_hcd *xhci) { @@ -114,7 +114,7 @@ it on BCM4708 family. xhci->shared_hcd->state = HC_STATE_RUNNING; xhci->cmd_ring_state = CMD_RING_STATE_RUNNING; -@@ -618,6 +671,10 @@ static int xhci_run_finished(struct xhci +@@ -620,6 +673,10 @@ static int xhci_run_finished(struct xhci xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Finished xhci_run for USB3 roothub"); return 0; diff --git a/target/linux/bmips/patches-5.15/510-net-dsa-b53-add-support-for-BCM63xx-RGMIIs.patch b/target/linux/bmips/patches-5.15/510-net-dsa-b53-add-support-for-BCM63xx-RGMIIs.patch index 3921477224..e16041b919 100644 --- a/target/linux/bmips/patches-5.15/510-net-dsa-b53-add-support-for-BCM63xx-RGMIIs.patch +++ b/target/linux/bmips/patches-5.15/510-net-dsa-b53-add-support-for-BCM63xx-RGMIIs.patch @@ -60,7 +60,7 @@ Signed-off-by: Álvaro Fernández Rojas if (is531x5(dev) && phy_interface_is_rgmii(phydev)) { if (port == dev->imp_port) off = B53_RGMII_CTRL_IMP; -@@ -1421,6 +1454,9 @@ void b53_phylink_mac_link_up(struct dsa_ +@@ -1419,6 +1452,9 @@ void b53_phylink_mac_link_up(struct dsa_ { struct b53_device *dev = ds->priv; diff --git a/target/linux/generic/backport-5.15/011-kbuild-export-SUBARCH.patch b/target/linux/generic/backport-5.15/011-kbuild-export-SUBARCH.patch index 0aedad4bfd..56e30c11cf 100644 --- a/target/linux/generic/backport-5.15/011-kbuild-export-SUBARCH.patch +++ b/target/linux/generic/backport-5.15/011-kbuild-export-SUBARCH.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -523,7 +523,7 @@ KBUILD_LDFLAGS_MODULE := +@@ -525,7 +525,7 @@ KBUILD_LDFLAGS_MODULE := KBUILD_LDFLAGS := CLANG_FLAGS := diff --git a/target/linux/generic/backport-5.15/703-00-v5.16-net-convert-users-of-bitmap_foo-to-linkmode_foo.patch b/target/linux/generic/backport-5.15/703-00-v5.16-net-convert-users-of-bitmap_foo-to-linkmode_foo.patch index eb1bc50367..8063d20270 100644 --- a/target/linux/generic/backport-5.15/703-00-v5.16-net-convert-users-of-bitmap_foo-to-linkmode_foo.patch +++ b/target/linux/generic/backport-5.15/703-00-v5.16-net-convert-users-of-bitmap_foo-to-linkmode_foo.patch @@ -530,7 +530,7 @@ Signed-off-by: David S. Miller static int --- a/drivers/net/dsa/xrs700x/xrs700x.c +++ b/drivers/net/dsa/xrs700x/xrs700x.c -@@ -456,7 +456,7 @@ static void xrs700x_phylink_validate(str +@@ -457,7 +457,7 @@ static void xrs700x_phylink_validate(str phylink_set(mask, 1000baseT_Full); break; default: @@ -539,7 +539,7 @@ Signed-off-by: David S. Miller dev_err(ds->dev, "Unsupported port: %i\n", port); return; } -@@ -467,10 +467,8 @@ static void xrs700x_phylink_validate(str +@@ -468,10 +468,8 @@ static void xrs700x_phylink_validate(str phylink_set(mask, 10baseT_Full); phylink_set(mask, 100baseT_Full); diff --git a/target/linux/generic/hack-5.15/250-netfilter_depends.patch b/target/linux/generic/hack-5.15/250-netfilter_depends.patch index 495c73ffa8..d9a2b81d74 100644 --- a/target/linux/generic/hack-5.15/250-netfilter_depends.patch +++ b/target/linux/generic/hack-5.15/250-netfilter_depends.patch @@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau --- a/net/netfilter/Kconfig +++ b/net/netfilter/Kconfig -@@ -243,7 +243,6 @@ config NF_CONNTRACK_FTP +@@ -242,7 +242,6 @@ config NF_CONNTRACK_FTP config NF_CONNTRACK_H323 tristate "H.323 protocol support" @@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau depends on NETFILTER_ADVANCED help H.323 is a VoIP signalling protocol from ITU-T. As one of the most -@@ -1106,7 +1105,6 @@ config NETFILTER_XT_TARGET_SECMARK +@@ -1105,7 +1104,6 @@ config NETFILTER_XT_TARGET_SECMARK config NETFILTER_XT_TARGET_TCPMSS tristate '"TCPMSS" target support' diff --git a/target/linux/generic/hack-5.15/650-netfilter-add-xt_FLOWOFFLOAD-target.patch b/target/linux/generic/hack-5.15/650-netfilter-add-xt_FLOWOFFLOAD-target.patch index 8769876c4d..961a930bb3 100644 --- a/target/linux/generic/hack-5.15/650-netfilter-add-xt_FLOWOFFLOAD-target.patch +++ b/target/linux/generic/hack-5.15/650-netfilter-add-xt_FLOWOFFLOAD-target.patch @@ -47,7 +47,7 @@ Signed-off-by: Felix Fietkau depends on !NF_CONNTRACK || NF_CONNTRACK --- a/net/netfilter/Kconfig +++ b/net/netfilter/Kconfig -@@ -708,8 +708,6 @@ config NFT_REJECT_NETDEV +@@ -707,8 +707,6 @@ config NFT_REJECT_NETDEV endif # NF_TABLES_NETDEV @@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau config NF_FLOW_TABLE_INET tristate "Netfilter flow table mixed IPv4/IPv6 module" depends on NF_FLOW_TABLE -@@ -718,11 +716,12 @@ config NF_FLOW_TABLE_INET +@@ -717,11 +715,12 @@ config NF_FLOW_TABLE_INET To compile it as a module, choose M here. @@ -70,7 +70,7 @@ Signed-off-by: Felix Fietkau help This option adds the flow table core infrastructure. -@@ -1011,6 +1010,15 @@ config NETFILTER_XT_TARGET_NOTRACK +@@ -1010,6 +1009,15 @@ config NETFILTER_XT_TARGET_NOTRACK depends on NETFILTER_ADVANCED select NETFILTER_XT_TARGET_CT diff --git a/target/linux/generic/hack-5.15/721-net-add-packet-mangeling.patch b/target/linux/generic/hack-5.15/721-net-add-packet-mangeling.patch index eab1ed92e4..53f6d33bd9 100644 --- a/target/linux/generic/hack-5.15/721-net-add-packet-mangeling.patch +++ b/target/linux/generic/hack-5.15/721-net-add-packet-mangeling.patch @@ -71,7 +71,7 @@ Signed-off-by: Felix Fietkau */ --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2816,6 +2816,10 @@ static inline int pskb_trim(struct sk_bu +@@ -2824,6 +2824,10 @@ static inline int pskb_trim(struct sk_bu return (len < skb->len) ? __pskb_trim(skb, len) : 0; } @@ -82,7 +82,7 @@ Signed-off-by: Felix Fietkau /** * pskb_trim_unique - remove end from a paged unique (not cloned) buffer * @skb: buffer to alter -@@ -2966,16 +2970,6 @@ static inline struct sk_buff *dev_alloc_ +@@ -2974,16 +2978,6 @@ static inline struct sk_buff *dev_alloc_ } diff --git a/target/linux/generic/hack-5.15/780-usb-net-MeigLink_modem_support.patch b/target/linux/generic/hack-5.15/780-usb-net-MeigLink_modem_support.patch index 2cae49bb1f..683c29620b 100644 --- a/target/linux/generic/hack-5.15/780-usb-net-MeigLink_modem_support.patch +++ b/target/linux/generic/hack-5.15/780-usb-net-MeigLink_modem_support.patch @@ -29,7 +29,7 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support #define QUECTEL_VENDOR_ID 0x2c7c /* These Quectel products use Quectel's vendor ID */ -@@ -1133,6 +1135,11 @@ static const struct usb_device_id option +@@ -1140,6 +1142,11 @@ static const struct usb_device_id option { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EG95, 0xff, 0, 0) }, { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_BG96), .driver_info = RSVD(4) }, diff --git a/target/linux/generic/pending-5.15/203-kallsyms_uncompressed.patch b/target/linux/generic/pending-5.15/203-kallsyms_uncompressed.patch index 4f51e524c3..b525976fc9 100644 --- a/target/linux/generic/pending-5.15/203-kallsyms_uncompressed.patch +++ b/target/linux/generic/pending-5.15/203-kallsyms_uncompressed.patch @@ -106,7 +106,7 @@ Signed-off-by: Felix Fietkau } --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh -@@ -266,6 +266,10 @@ kallsyms() +@@ -257,6 +257,10 @@ kallsyms() kallsymopt="${kallsymopt} --base-relative" fi diff --git a/target/linux/generic/pending-5.15/655-increase_skb_pad.patch b/target/linux/generic/pending-5.15/655-increase_skb_pad.patch index f89ee0b8d2..e3dd249d11 100644 --- a/target/linux/generic/pending-5.15/655-increase_skb_pad.patch +++ b/target/linux/generic/pending-5.15/655-increase_skb_pad.patch @@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2782,7 +2782,7 @@ static inline int pskb_network_may_pull( +@@ -2790,7 +2790,7 @@ static inline int pskb_network_may_pull( * NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8) */ #ifndef NET_SKB_PAD diff --git a/target/linux/generic/pending-5.15/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-5.15/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index 1d5975f626..233d7b6563 100644 --- a/target/linux/generic/pending-5.15/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-5.15/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau __u8 inner_protocol_type:1; --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -6062,6 +6062,9 @@ static enum gro_result dev_gro_receive(s +@@ -6063,6 +6063,9 @@ static enum gro_result dev_gro_receive(s int same_flow; int grow; @@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau if (netif_elide_gro(skb->dev)) goto normal; -@@ -8076,6 +8079,48 @@ static void __netdev_adjacent_dev_unlink +@@ -8077,6 +8080,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *upper_priv, void *upper_info, -@@ -8127,6 +8172,7 @@ static int __netdev_upper_dev_link(struc +@@ -8128,6 +8173,7 @@ static int __netdev_upper_dev_link(struc if (ret) return ret; @@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); ret = notifier_to_errno(ret); -@@ -8223,6 +8269,7 @@ static void __netdev_upper_dev_unlink(st +@@ -8224,6 +8270,7 @@ static void __netdev_upper_dev_unlink(st __netdev_adjacent_dev_unlink_neighbour(dev, upper_dev); @@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, &changeupper_info.info); -@@ -9042,6 +9089,7 @@ int dev_set_mac_address(struct net_devic +@@ -9043,6 +9090,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; diff --git a/target/linux/generic/pending-5.15/730-mtk_sgmii-enable-PCS-polling-to-allow-SFP-work.patch b/target/linux/generic/pending-5.15/730-mtk_sgmii-enable-PCS-polling-to-allow-SFP-work.patch index 6c7fd6a6bf..d185aed7bd 100644 --- a/target/linux/generic/pending-5.15/730-mtk_sgmii-enable-PCS-polling-to-allow-SFP-work.patch +++ b/target/linux/generic/pending-5.15/730-mtk_sgmii-enable-PCS-polling-to-allow-SFP-work.patch @@ -13,7 +13,7 @@ Signed-off-by: Alexander Couzens --- a/drivers/net/ethernet/mediatek/mtk_sgmii.c +++ b/drivers/net/ethernet/mediatek/mtk_sgmii.c -@@ -180,6 +180,7 @@ int mtk_sgmii_init(struct mtk_sgmii *ss, +@@ -182,6 +182,7 @@ int mtk_sgmii_init(struct mtk_sgmii *ss, return PTR_ERR(ss->pcs[i].regmap); ss->pcs[i].pcs.ops = &mtk_pcs_ops; diff --git a/target/linux/mvebu/patches-5.15/700-mvneta-tx-queue-workaround.patch b/target/linux/mvebu/patches-5.15/700-mvneta-tx-queue-workaround.patch index 6c07a2915b..826f95d1c2 100644 --- a/target/linux/mvebu/patches-5.15/700-mvneta-tx-queue-workaround.patch +++ b/target/linux/mvebu/patches-5.15/700-mvneta-tx-queue-workaround.patch @@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau --- --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -4987,6 +4987,16 @@ static int mvneta_setup_tc(struct net_de +@@ -4943,6 +4943,16 @@ static int mvneta_setup_tc(struct net_de } } @@ -26,7 +26,7 @@ Signed-off-by: Felix Fietkau static const struct net_device_ops mvneta_netdev_ops = { .ndo_open = mvneta_open, .ndo_stop = mvneta_stop, -@@ -4997,6 +5007,9 @@ static const struct net_device_ops mvnet +@@ -4953,6 +4963,9 @@ static const struct net_device_ops mvnet .ndo_fix_features = mvneta_fix_features, .ndo_get_stats64 = mvneta_get_stats64, .ndo_eth_ioctl = mvneta_ioctl, diff --git a/target/linux/mvebu/patches-5.15/702-net-next-ethernet-marvell-mvnetaMQPrioOffload.patch b/target/linux/mvebu/patches-5.15/702-net-next-ethernet-marvell-mvnetaMQPrioOffload.patch index 96f5042e69..c3a6d9f4d0 100644 --- a/target/linux/mvebu/patches-5.15/702-net-next-ethernet-marvell-mvnetaMQPrioOffload.patch +++ b/target/linux/mvebu/patches-5.15/702-net-next-ethernet-marvell-mvnetaMQPrioOffload.patch @@ -26,7 +26,7 @@ Signed-off-by: David S. Miller #include /* Registers */ -@@ -4947,14 +4948,14 @@ static void mvneta_setup_rx_prio_map(str +@@ -4903,14 +4904,14 @@ static void mvneta_setup_rx_prio_map(str } static int mvneta_setup_mqprio(struct net_device *dev, @@ -44,7 +44,7 @@ Signed-off-by: David S. Miller if (num_tc > rxq_number) return -EINVAL; -@@ -4965,13 +4966,15 @@ static int mvneta_setup_mqprio(struct ne +@@ -4921,13 +4922,15 @@ static int mvneta_setup_mqprio(struct ne return 0; } diff --git a/target/linux/mvebu/patches-5.15/703-net-next-ethernet-marvell-mvnetaMQPrioFlag.patch b/target/linux/mvebu/patches-5.15/703-net-next-ethernet-marvell-mvnetaMQPrioFlag.patch index 997f301f39..8ef585be9a 100644 --- a/target/linux/mvebu/patches-5.15/703-net-next-ethernet-marvell-mvnetaMQPrioFlag.patch +++ b/target/linux/mvebu/patches-5.15/703-net-next-ethernet-marvell-mvnetaMQPrioFlag.patch @@ -17,7 +17,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -4954,7 +4954,9 @@ static int mvneta_setup_mqprio(struct ne +@@ -4910,7 +4910,9 @@ static int mvneta_setup_mqprio(struct ne u8 num_tc; int i; diff --git a/target/linux/mvebu/patches-5.15/704-net-next-ethernet-marvell-mvnetaMQPrioQueue.patch b/target/linux/mvebu/patches-5.15/704-net-next-ethernet-marvell-mvnetaMQPrioQueue.patch index 73563a57a0..196b986541 100644 --- a/target/linux/mvebu/patches-5.15/704-net-next-ethernet-marvell-mvnetaMQPrioQueue.patch +++ b/target/linux/mvebu/patches-5.15/704-net-next-ethernet-marvell-mvnetaMQPrioQueue.patch @@ -30,7 +30,7 @@ Signed-off-by: David S. Miller phy_interface_t phy_interface; struct device_node *dn; -@@ -4936,13 +4935,12 @@ static void mvneta_clear_rx_prio_map(str +@@ -4892,13 +4891,12 @@ static void mvneta_clear_rx_prio_map(str mvreg_write(pp, MVNETA_VLAN_PRIO_TO_RXQ, 0); } @@ -48,7 +48,7 @@ Signed-off-by: David S. Miller mvreg_write(pp, MVNETA_VLAN_PRIO_TO_RXQ, val); } -@@ -4951,8 +4949,8 @@ static int mvneta_setup_mqprio(struct ne +@@ -4907,8 +4905,8 @@ static int mvneta_setup_mqprio(struct ne struct tc_mqprio_qopt_offload *mqprio) { struct mvneta_port *pp = netdev_priv(dev); @@ -58,7 +58,7 @@ Signed-off-by: David S. Miller if (mqprio->qopt.hw != TC_MQPRIO_HW_OFFLOAD_TCS) return 0; -@@ -4962,21 +4960,28 @@ static int mvneta_setup_mqprio(struct ne +@@ -4918,21 +4916,28 @@ static int mvneta_setup_mqprio(struct ne if (num_tc > rxq_number) return -EINVAL; diff --git a/target/linux/mvebu/patches-5.15/705-net-next-ethernet-marvell-mvnetaMQPrioTCOffload.patch b/target/linux/mvebu/patches-5.15/705-net-next-ethernet-marvell-mvnetaMQPrioTCOffload.patch index 7b837d0b49..d640da4d44 100644 --- a/target/linux/mvebu/patches-5.15/705-net-next-ethernet-marvell-mvnetaMQPrioTCOffload.patch +++ b/target/linux/mvebu/patches-5.15/705-net-next-ethernet-marvell-mvnetaMQPrioTCOffload.patch @@ -62,7 +62,7 @@ Signed-off-by: David S. Miller #define MVNETA_LPI_CTRL_0 0x2cc0 #define MVNETA_LPI_CTRL_1 0x2cc4 #define MVNETA_LPI_REQUEST_ENABLE BIT(0) -@@ -4945,11 +4972,74 @@ static void mvneta_map_vlan_prio_to_rxq( +@@ -4901,11 +4928,74 @@ static void mvneta_map_vlan_prio_to_rxq( mvreg_write(pp, MVNETA_VLAN_PRIO_TO_RXQ, val); } @@ -138,7 +138,7 @@ Signed-off-by: David S. Miller u8 num_tc; if (mqprio->qopt.hw != TC_MQPRIO_HW_OFFLOAD_TCS) -@@ -4963,6 +5053,7 @@ static int mvneta_setup_mqprio(struct ne +@@ -4919,6 +5009,7 @@ static int mvneta_setup_mqprio(struct ne mvneta_clear_rx_prio_map(pp); if (!num_tc) { @@ -146,7 +146,7 @@ Signed-off-by: David S. Miller netdev_reset_tc(dev); return 0; } -@@ -4983,6 +5074,33 @@ static int mvneta_setup_mqprio(struct ne +@@ -4939,6 +5030,33 @@ static int mvneta_setup_mqprio(struct ne } } From a9233175e805a0176c8850e6fa8907c41b7797c5 Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Mon, 5 Sep 2022 23:16:09 +0800 Subject: [PATCH 12/21] mediatek: mt7986a/b-rfb: fix 02_network setup According to the device tree, the lan ports are lan0 to lan3, and the wan port is eth1. Fixes: cffc77a ("mediatek: add filogic subtarget") Signed-off-by: Chukun Pan --- target/linux/mediatek/filogic/base-files/etc/board.d/02_network | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network index 13afc2a3dc..f7dc7a01e0 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network @@ -10,7 +10,7 @@ mediatek_setup_interfaces() case $board in mediatek,mt7986a-rfb|\ mediatek,mt7986b-rfb) - ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" wan + ucidef_set_interfaces_lan_wan "lan0 lan1 lan2 lan3" eth1 ;; bananapi,bpi-r3) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 sfp2" "eth1 wan" From c91dd139d6e5c6583de3266eaca7312d0fb0eeb2 Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Tue, 6 Sep 2022 23:15:39 +0800 Subject: [PATCH 13/21] mediatek: 5.15: add missing patch suffix The 213 patch is missing filename suffix. Fix it. Fixes: dabcaac ("mediatek: add mt7986 soc support to the target") Signed-off-by: Chukun Pan --- ...-spi-support => 213-spi-mediatek-add-mt7986-spi-support.patch} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename target/linux/mediatek/patches-5.15/{213-spi-mediatek-add-mt7986-spi-support => 213-spi-mediatek-add-mt7986-spi-support.patch} (100%) diff --git a/target/linux/mediatek/patches-5.15/213-spi-mediatek-add-mt7986-spi-support b/target/linux/mediatek/patches-5.15/213-spi-mediatek-add-mt7986-spi-support.patch similarity index 100% rename from target/linux/mediatek/patches-5.15/213-spi-mediatek-add-mt7986-spi-support rename to target/linux/mediatek/patches-5.15/213-spi-mediatek-add-mt7986-spi-support.patch From f97fbd8a9adb481d195cecbcf0b1b19322dc9709 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 8 Sep 2022 21:14:32 +0100 Subject: [PATCH 14/21] mediatek: rename some patches To ease maintainance rename patches to contain the kernel version they have first been part of. Signed-off-by: Daniel Golle --- ...120-11-v5.19-mtd-nand-make-mtk_ecc.c-a-separated-module.patch} | 0 ...2-v5.19-spi-add-driver-for-MTK-SPI-NAND-Flash-Interface.patch} | 0 ...19-mtd-nand-mtk-ecc-also-parse-nand-ecc-engine-if-avail.patch} | 0 ...120-14-v5.19-arm64-dts-mediatek-add-mtk-snfi-for-mt7622.patch} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename target/linux/mediatek/patches-5.15/{120-11-mtd-nand-make-mtk_ecc.c-a-separated-module.patch => 120-11-v5.19-mtd-nand-make-mtk_ecc.c-a-separated-module.patch} (100%) rename target/linux/mediatek/patches-5.15/{120-12-spi-add-driver-for-MTK-SPI-NAND-Flash-Interface.patch => 120-12-v5.19-spi-add-driver-for-MTK-SPI-NAND-Flash-Interface.patch} (100%) rename target/linux/mediatek/patches-5.15/{120-13-mtd-nand-mtk-ecc-also-parse-nand-ecc-engine-if-avail.patch => 120-13-v5.19-mtd-nand-mtk-ecc-also-parse-nand-ecc-engine-if-avail.patch} (100%) rename target/linux/mediatek/patches-5.15/{120-14-arm64-dts-mediatek-add-mtk-snfi-for-mt7622.patch => 120-14-v5.19-arm64-dts-mediatek-add-mtk-snfi-for-mt7622.patch} (100%) diff --git a/target/linux/mediatek/patches-5.15/120-11-mtd-nand-make-mtk_ecc.c-a-separated-module.patch b/target/linux/mediatek/patches-5.15/120-11-v5.19-mtd-nand-make-mtk_ecc.c-a-separated-module.patch similarity index 100% rename from target/linux/mediatek/patches-5.15/120-11-mtd-nand-make-mtk_ecc.c-a-separated-module.patch rename to target/linux/mediatek/patches-5.15/120-11-v5.19-mtd-nand-make-mtk_ecc.c-a-separated-module.patch diff --git a/target/linux/mediatek/patches-5.15/120-12-spi-add-driver-for-MTK-SPI-NAND-Flash-Interface.patch b/target/linux/mediatek/patches-5.15/120-12-v5.19-spi-add-driver-for-MTK-SPI-NAND-Flash-Interface.patch similarity index 100% rename from target/linux/mediatek/patches-5.15/120-12-spi-add-driver-for-MTK-SPI-NAND-Flash-Interface.patch rename to target/linux/mediatek/patches-5.15/120-12-v5.19-spi-add-driver-for-MTK-SPI-NAND-Flash-Interface.patch diff --git a/target/linux/mediatek/patches-5.15/120-13-mtd-nand-mtk-ecc-also-parse-nand-ecc-engine-if-avail.patch b/target/linux/mediatek/patches-5.15/120-13-v5.19-mtd-nand-mtk-ecc-also-parse-nand-ecc-engine-if-avail.patch similarity index 100% rename from target/linux/mediatek/patches-5.15/120-13-mtd-nand-mtk-ecc-also-parse-nand-ecc-engine-if-avail.patch rename to target/linux/mediatek/patches-5.15/120-13-v5.19-mtd-nand-mtk-ecc-also-parse-nand-ecc-engine-if-avail.patch diff --git a/target/linux/mediatek/patches-5.15/120-14-arm64-dts-mediatek-add-mtk-snfi-for-mt7622.patch b/target/linux/mediatek/patches-5.15/120-14-v5.19-arm64-dts-mediatek-add-mtk-snfi-for-mt7622.patch similarity index 100% rename from target/linux/mediatek/patches-5.15/120-14-arm64-dts-mediatek-add-mtk-snfi-for-mt7622.patch rename to target/linux/mediatek/patches-5.15/120-14-v5.19-arm64-dts-mediatek-add-mtk-snfi-for-mt7622.patch From f755c4103814cc99fd2c9701ba05aaff1884fc89 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 9 Sep 2022 20:46:33 +0100 Subject: [PATCH 15/21] kernel: backport MediaTek USB Bluetooth additions Backport commits from linux.git adding support for various MT7921 Bluetooth USB IDs. Signed-off-by: Daniel Golle --- ...Support-public-address-configuration.patch | 51 +++++++++++++ ...Fix-application-of-sizeof-to-pointer.patch | 29 ++++++++ ...Add-a-new-PID-VID-13d3-3567-for-MT79.patch | 70 ++++++++++++++++++ ...Add-a-new-PID-VID-0489-e0c8-for-MT79.patch | 68 ++++++++++++++++++ ...Add-a-new-VID-PID-0e8d-0608-for-MT79.patch | 71 +++++++++++++++++++ 5 files changed, 289 insertions(+) create mode 100644 target/linux/generic/backport-5.15/821-v5.16-Bluetooth-btusb-Support-public-address-configuration.patch create mode 100644 target/linux/generic/backport-5.15/822-v5.17-Bluetooth-btusb-Fix-application-of-sizeof-to-pointer.patch create mode 100644 target/linux/generic/backport-5.15/823-v5.18-Bluetooth-btusb-Add-a-new-PID-VID-13d3-3567-for-MT79.patch create mode 100644 target/linux/generic/backport-5.15/824-v5.19-Bluetooth-btusb-Add-a-new-PID-VID-0489-e0c8-for-MT79.patch create mode 100644 target/linux/generic/pending-5.15/825-Bluetooth-btusb-Add-a-new-VID-PID-0e8d-0608-for-MT79.patch diff --git a/target/linux/generic/backport-5.15/821-v5.16-Bluetooth-btusb-Support-public-address-configuration.patch b/target/linux/generic/backport-5.15/821-v5.16-Bluetooth-btusb-Support-public-address-configuration.patch new file mode 100644 index 0000000000..feaabc9d11 --- /dev/null +++ b/target/linux/generic/backport-5.15/821-v5.16-Bluetooth-btusb-Support-public-address-configuration.patch @@ -0,0 +1,51 @@ +From 5cb03751455c299b1bf10cb48631bf359cfb11b5 Mon Sep 17 00:00:00 2001 +From: "mark-yw.chen" +Date: Wed, 1 Sep 2021 11:32:25 +0800 +Subject: [PATCH 1/5] Bluetooth: btusb: Support public address configuration + for MediaTek Chip. + +The MediaTek chip support vendor specific HCI command(0xfc1a) to +change the public address. Add hdev->set_bdaddr handler for MediaTek +Chip. After doing a power cycle or MediaTek Bluetooth reset, BD_ADDR +will bring back the original one. + +Signed-off-by: mark-yw.chen +Signed-off-by: Marcel Holtmann +--- + drivers/bluetooth/btusb.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +--- a/drivers/bluetooth/btusb.c ++++ b/drivers/bluetooth/btusb.c +@@ -2263,6 +2263,23 @@ struct btmtk_section_map { + }; + } __packed; + ++static int btusb_set_bdaddr_mtk(struct hci_dev *hdev, const bdaddr_t *bdaddr) ++{ ++ struct sk_buff *skb; ++ long ret; ++ ++ skb = __hci_cmd_sync(hdev, 0xfc1a, sizeof(bdaddr), bdaddr, HCI_INIT_TIMEOUT); ++ if (IS_ERR(skb)) { ++ ret = PTR_ERR(skb); ++ bt_dev_err(hdev, "changing Mediatek device address failed (%ld)", ++ ret); ++ return ret; ++ } ++ kfree_skb(skb); ++ ++ return 0; ++} ++ + static void btusb_mtk_wmt_recv(struct urb *urb) + { + struct hci_dev *hdev = urb->context; +@@ -3900,6 +3917,7 @@ static int btusb_probe(struct usb_interf + hdev->shutdown = btusb_mtk_shutdown; + hdev->manufacturer = 70; + hdev->cmd_timeout = btusb_mtk_cmd_timeout; ++ hdev->set_bdaddr = btusb_set_bdaddr_mtk; + set_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks); + data->recv_acl = btusb_recv_acl_mtk; + } diff --git a/target/linux/generic/backport-5.15/822-v5.17-Bluetooth-btusb-Fix-application-of-sizeof-to-pointer.patch b/target/linux/generic/backport-5.15/822-v5.17-Bluetooth-btusb-Fix-application-of-sizeof-to-pointer.patch new file mode 100644 index 0000000000..b324cb1aa8 --- /dev/null +++ b/target/linux/generic/backport-5.15/822-v5.17-Bluetooth-btusb-Fix-application-of-sizeof-to-pointer.patch @@ -0,0 +1,29 @@ +From af774a731f7b4c2a90a8476cd44045ba8d1263ba Mon Sep 17 00:00:00 2001 +From: David Yang +Date: Wed, 13 Oct 2021 08:56:33 +0800 +Subject: [PATCH 2/5] Bluetooth: btusb: Fix application of sizeof to pointer + +The coccinelle check report: +"./drivers/bluetooth/btusb.c:2239:36-42: +ERROR: application of sizeof to pointer". +Using the real size to fix it. + +Fixes: 5a87679ffd443 ("Bluetooth: btusb: Support public address configuration for MediaTek Chip.") +Reported-by: Zeal Robot +Signed-off-by: David Yang +Signed-off-by: Marcel Holtmann +--- + drivers/bluetooth/btusb.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/bluetooth/btusb.c ++++ b/drivers/bluetooth/btusb.c +@@ -2268,7 +2268,7 @@ static int btusb_set_bdaddr_mtk(struct h + struct sk_buff *skb; + long ret; + +- skb = __hci_cmd_sync(hdev, 0xfc1a, sizeof(bdaddr), bdaddr, HCI_INIT_TIMEOUT); ++ skb = __hci_cmd_sync(hdev, 0xfc1a, 6, bdaddr, HCI_INIT_TIMEOUT); + if (IS_ERR(skb)) { + ret = PTR_ERR(skb); + bt_dev_err(hdev, "changing Mediatek device address failed (%ld)", diff --git a/target/linux/generic/backport-5.15/823-v5.18-Bluetooth-btusb-Add-a-new-PID-VID-13d3-3567-for-MT79.patch b/target/linux/generic/backport-5.15/823-v5.18-Bluetooth-btusb-Add-a-new-PID-VID-13d3-3567-for-MT79.patch new file mode 100644 index 0000000000..549005c5a7 --- /dev/null +++ b/target/linux/generic/backport-5.15/823-v5.18-Bluetooth-btusb-Add-a-new-PID-VID-13d3-3567-for-MT79.patch @@ -0,0 +1,70 @@ +From e57186fc02cedff191c469a26cce615371e41740 Mon Sep 17 00:00:00 2001 +From: Yake Yang +Date: Wed, 23 Feb 2022 07:55:59 +0800 +Subject: [PATCH 3/5] Bluetooth: btusb: Add a new PID/VID 13d3/3567 for MT7921 + +Add VID 13D3 & PID 3567 for MediaTek MT7921 USB Bluetooth chip. + +The information in /sys/kernel/debug/usb/devices about the Bluetooth +device is listed as the below. + +T: Bus=05 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=480 MxCh= 0 +D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 +P: Vendor=13d3 ProdID=3567 Rev= 1.00 +S: Manufacturer=MediaTek Inc. +S: Product=Wireless_Device +S: SerialNumber=000000000 +C:* #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=100mA +A: FirstIf#= 0 IfCount= 3 Cls=e0(wlcon) Sub=01 Prot=01 +I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=125us +E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms +I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms +I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms +I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms +I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms +I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms +I: If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms +I:* If#= 2 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none) +E: Ad=8a(I) Atr=03(Int.) MxPS= 64 Ivl=125us +E: Ad=0a(O) Atr=03(Int.) MxPS= 64 Ivl=125us +I: If#= 2 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none) +E: Ad=8a(I) Atr=03(Int.) MxPS= 64 Ivl=125us +E: Ad=0a(O) Atr=03(Int.) MxPS= 64 Ivl=125us + +Co-developed-by: Sean Wang +Signed-off-by: Sean Wang +Signed-off-by: Yake Yang +Signed-off-by: Marcel Holtmann +--- + drivers/bluetooth/btusb.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/bluetooth/btusb.c ++++ b/drivers/bluetooth/btusb.c +@@ -460,6 +460,9 @@ static const struct usb_device_id blackl + { USB_DEVICE(0x13d3, 0x3564), .driver_info = BTUSB_MEDIATEK | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, ++ { USB_DEVICE(0x13d3, 0x3567), .driver_info = BTUSB_MEDIATEK | ++ BTUSB_WIDEBAND_SPEECH | ++ BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x0489, 0xe0cd), .driver_info = BTUSB_MEDIATEK | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, diff --git a/target/linux/generic/backport-5.15/824-v5.19-Bluetooth-btusb-Add-a-new-PID-VID-0489-e0c8-for-MT79.patch b/target/linux/generic/backport-5.15/824-v5.19-Bluetooth-btusb-Add-a-new-PID-VID-0489-e0c8-for-MT79.patch new file mode 100644 index 0000000000..54e3388860 --- /dev/null +++ b/target/linux/generic/backport-5.15/824-v5.19-Bluetooth-btusb-Add-a-new-PID-VID-0489-e0c8-for-MT79.patch @@ -0,0 +1,68 @@ +From e507366cd1e8e1d4eebe537c08fd142cf0b617fa Mon Sep 17 00:00:00 2001 +From: Sean Wang +Date: Thu, 28 Apr 2022 02:38:39 +0800 +Subject: [PATCH 4/5] Bluetooth: btusb: Add a new PID/VID 0489/e0c8 for MT7921 + +Add VID 0489 & PID e0c8 for MediaTek MT7921 USB Bluetooth chip. + +The information in /sys/kernel/debug/usb/devices about the Bluetooth +device is listed as the below. + +T: Bus=01 Lev=01 Prnt=01 Port=13 Cnt=03 Dev#= 4 Spd=480 MxCh= 0 +D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 +P: Vendor=0489 ProdID=e0c8 Rev= 1.00 +S: Manufacturer=MediaTek Inc. +S: Product=Wireless_Device +S: SerialNumber=000000000 +C:* #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=100mA +A: FirstIf#= 0 IfCount= 3 Cls=e0(wlcon) Sub=01 Prot=01 +I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=125us +E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms +I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms +I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms +I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms +I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms +I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms +I: If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms +I:* If#= 2 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none) +E: Ad=8a(I) Atr=03(Int.) MxPS= 64 Ivl=125us +E: Ad=0a(O) Atr=03(Int.) MxPS= 64 Ivl=125us +I: If#= 2 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none) +E: Ad=8a(I) Atr=03(Int.) MxPS= 512 Ivl=125us +E: Ad=0a(O) Atr=03(Int.) MxPS= 512 Ivl=125us + +Signed-off-by: Sean Wang +Signed-off-by: Marcel Holtmann +--- + drivers/bluetooth/btusb.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/bluetooth/btusb.c ++++ b/drivers/bluetooth/btusb.c +@@ -451,6 +451,9 @@ static const struct usb_device_id blackl + BTUSB_VALID_LE_STATES }, + + /* Additional MediaTek MT7921 Bluetooth devices */ ++ { USB_DEVICE(0x0489, 0xe0c8), .driver_info = BTUSB_MEDIATEK | ++ BTUSB_WIDEBAND_SPEECH | ++ BTUSB_VALID_LE_STATES }, + { USB_DEVICE(0x04ca, 0x3802), .driver_info = BTUSB_MEDIATEK | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, diff --git a/target/linux/generic/pending-5.15/825-Bluetooth-btusb-Add-a-new-VID-PID-0e8d-0608-for-MT79.patch b/target/linux/generic/pending-5.15/825-Bluetooth-btusb-Add-a-new-VID-PID-0e8d-0608-for-MT79.patch new file mode 100644 index 0000000000..4f9dfc2755 --- /dev/null +++ b/target/linux/generic/pending-5.15/825-Bluetooth-btusb-Add-a-new-VID-PID-0e8d-0608-for-MT79.patch @@ -0,0 +1,71 @@ +From ced9d535126a81a85b022cff1e2fd8e0da46c7ae Mon Sep 17 00:00:00 2001 +From: Daniel Golle +Date: Fri, 9 Sep 2022 18:25:21 +0100 +Subject: [PATCH] Bluetooth: btusb: Add a new VID/PID 0e8d/0608 for MT7921 +To: linux-mediatek@lists.infradead.org, + linux-bluetooth@vger.kernel.org +Cc: Matthias Brugger , + Luiz Augusto von Dentz , + Johan Hedberg , + Marcel Holtmann + +Add a new PID/VID 0e8d/0608 for MT7921K chip found on AMD RZ608 module. + +From /sys/kernel/debug/usb/devices: +T: Bus=01 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#= 3 Spd=480 MxCh= 0 +D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 +P: Vendor=0e8d ProdID=0608 Rev= 1.00 +S: Manufacturer=MediaTek Inc. +S: Product=Wireless_Device +S: SerialNumber=000000000 +C:* #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=100mA +A: FirstIf#= 0 IfCount= 3 Cls=e0(wlcon) Sub=01 Prot=01 +I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=125us +E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms +I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms +I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms +I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms +I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms +I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms +I: If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb +E: Ad=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms +E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms +I:* If#= 2 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none) +E: Ad=8a(I) Atr=03(Int.) MxPS= 64 Ivl=125us +E: Ad=0a(O) Atr=03(Int.) MxPS= 64 Ivl=125us +I: If#= 2 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none) +E: Ad=8a(I) Atr=03(Int.) MxPS= 64 Ivl=125us +E: Ad=0a(O) Atr=03(Int.) MxPS= 64 Ivl=125us + +Signed-off-by: Daniel Golle +--- + drivers/bluetooth/btusb.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/bluetooth/btusb.c ++++ b/drivers/bluetooth/btusb.c +@@ -469,6 +469,9 @@ static const struct usb_device_id blackl + { USB_DEVICE(0x0489, 0xe0cd), .driver_info = BTUSB_MEDIATEK | + BTUSB_WIDEBAND_SPEECH | + BTUSB_VALID_LE_STATES }, ++ { USB_DEVICE(0x0e8d, 0x0608), .driver_info = BTUSB_MEDIATEK | ++ BTUSB_WIDEBAND_SPEECH | ++ BTUSB_VALID_LE_STATES }, + + /* MediaTek MT7922A Bluetooth devices */ + { USB_DEVICE(0x0489, 0xe0d8), .driver_info = BTUSB_MEDIATEK | From 6d1a398c5be046fc4217f61b1215da6291b9fd0f Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 9 Sep 2022 20:27:17 +0100 Subject: [PATCH 16/21] kernel: modules: bluetooth: include support for MediaTek USB Enable MediaTek protocol in btusb module to support e.g. the Bluetooth part of the MT7921K NGFF/M.2 module. Signed-off-by: Daniel Golle --- package/kernel/linux/modules/other.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk index 519bd2048f..0ab8c7ad4a 100644 --- a/package/kernel/linux/modules/other.mk +++ b/package/kernel/linux/modules/other.mk @@ -40,6 +40,8 @@ define KernelPackage/bluetooth CONFIG_BT_BNEP \ CONFIG_BT_HCIBTUSB \ CONFIG_BT_HCIBTUSB_BCM=n \ + CONFIG_BT_HCIBTUSB_MTK=y \ + CONFIG_BT_HCIBTUSB_RTL=n \ CONFIG_BT_HCIUART \ CONFIG_BT_HCIUART_BCM=n \ CONFIG_BT_HCIUART_INTEL=n \ From 2510a587a69101e0f2e7f73a84e1c348e0113d2a Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 9 Sep 2022 20:29:10 +0100 Subject: [PATCH 17/21] linux-firmware: package MediaTek MT792[12] Bluetooth firmware btusb fails to start on MT792[12] hardware without the appropriate firmware being loaded first: [ 9.750285] bluetooth hci0: Direct firmware load for mediatek/BT_RAM_CODE_MT7961_1_2_hdr.bin failed with error -2 [ 9.765723] bluetooth hci0: Falling back to sysfs fallback for: mediatek/BT_RAM_CODE_MT7961_1_2_hdr.bin Package firmware for MediaTek MT792[12] Bluetooth from linux-firmware. Signed-off-by: Daniel Golle --- package/firmware/linux-firmware/mediatek.mk | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/package/firmware/linux-firmware/mediatek.mk b/package/firmware/linux-firmware/mediatek.mk index 18677bc748..9c8f68b889 100644 --- a/package/firmware/linux-firmware/mediatek.mk +++ b/package/firmware/linux-firmware/mediatek.mk @@ -50,3 +50,21 @@ define Package/mt7622bt-firmware/install $(1)/lib/firmware/mediatek endef $(eval $(call BuildPackage,mt7622bt-firmware)) + +Package/mt7921bt-firmware = $(call Package/firmware-default,mt7921bt firmware) +define Package/mt7921bt-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/mediatek + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/mediatek/BT_RAM_CODE_MT7961_1_2_hdr.bin \ + $(1)/lib/firmware/mediatek +endef +$(eval $(call BuildPackage,mt7921bt-firmware)) + +Package/mt7922bt-firmware = $(call Package/firmware-default,mt7922bt firmware) +define Package/mt7922bt-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/mediatek + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/mediatek/BT_RAM_CODE_MT7922_1_1_hdr.bin \ + $(1)/lib/firmware/mediatek +endef +$(eval $(call BuildPackage,mt7922bt-firmware)) From 2ca56028645c305d3d6b2a64b4bc8bbb5aaeebef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= Date: Fri, 9 Sep 2022 08:28:13 +0200 Subject: [PATCH 18/21] realtek: fix RTL839x receive tag decoding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous fixup was incomplete, and the offsets for the queue and crc_error cpu_tag bitfields were still wrong on RTL839x. Fixes: 545c6113c93b ("realtek: fix RTL838x receive tag decoding") Suggested-by: Jan Hoffmann Signed-off-by: Bjørn Mork --- .../realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c b/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c index d9ade65526..e96c5a7216 100644 --- a/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c +++ b/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.c @@ -282,9 +282,9 @@ bool rtl839x_decode_tag(struct p_hdr *h, struct dsa_tag *t) { /* cpu_tag[0] is reserved. Fields are off-by-one */ t->reason = h->cpu_tag[5] & 0x1f; - t->queue = (h->cpu_tag[3] & 0xe000) >> 13; + t->queue = (h->cpu_tag[4] & 0xe000) >> 13; t->port = h->cpu_tag[1] & 0x3f; - t->crc_error = h->cpu_tag[3] & BIT(2); + t->crc_error = h->cpu_tag[4] & BIT(6); pr_debug("Reason: %d\n", t->reason); if ((t->reason >= 7 && t->reason <= 13) || // NIC_RX_REASON_RMA From b5675f500daff3ef3f904e53a5566aa7dc09b786 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sat, 10 Sep 2022 01:01:57 +0200 Subject: [PATCH 19/21] rockchip: ensure NanoPi R4S has unique MAC address Ensure the MAC address for all NanoPi R4S boards is assigned unique for each board. FriendlyElec ship two versions of the R4S: The standard as well as the enterprise edition with only the enterprise edition including the EEPROM chip that stores the unique MAC address. In order to assign both board types unique MAC addresses, fall back on the same method used for the NanoPi R2S in case the EEPROM chip is not present by generating the board MAC from the SD card CID. [0] https://wiki.friendlyelec.com/wiki/index.php/NanoPi_R4S#Differences_Between_R4S_Standard_Version_.26_R4S_Enterprise_Version Signed-off-by: David Bauer --- .../armv8/base-files/etc/board.d/02_network | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network index 91bdb760d5..b0e6479947 100644 --- a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network +++ b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network @@ -17,13 +17,36 @@ rockchip_setup_interfaces() esac } -nanopi_r2s_generate_mac() +generate_mac_from_mmc_cid() { - local sd_hash=$(sha256sum /sys/class/block/mmcblk0/device/cid) + local mmc_dev=$1 + + local sd_hash=$(sha256sum /sys/class/block/$mmc_dev/device/cid) local mac_base=$(macaddr_canonicalize "$(echo "${sd_hash}" | dd bs=1 count=12 2>/dev/null)") echo "$(macaddr_unsetbit_mc "$(macaddr_setbit_la "${mac_base}")")" } +nanopi_r4s_get_mac() +{ + local interface=$1 + local eeprom_path="/sys/bus/i2c/devices/2-0051/eeprom" + local address + + if [ -f "$eeprom_path" ]; then + address=$(get_mac_binary "$eeprom_path" 0xfa) + if [ "$interface" = "lan" ]; then + address=$(macaddr_setbit_la "$address") + fi + else + address=$(generate_mac_from_mmc_cid mmcblk1) + if [ "$interface" = "lan" ]; then + address=$(macaddr_add "$address" 1) + fi + fi + + echo "$address" +} + rockchip_setup_macs() { local board="$1" @@ -33,12 +56,12 @@ rockchip_setup_macs() case "$board" in friendlyarm,nanopi-r2s) - wan_mac=$(nanopi_r2s_generate_mac) + wan_mac=$(generate_mac_from_mmc_cid mmcblk0) lan_mac=$(macaddr_add "$wan_mac" 1) ;; friendlyarm,nanopi-r4s) - wan_mac=$(get_mac_binary "/sys/bus/i2c/devices/2-0051/eeprom" 0xfa) - lan_mac=$(macaddr_setbit_la "$wan_mac") + wan_mac=$(nanopi_r4s_get_mac wan) + lan_mac=$(nanopi_r4s_get_mac lan) ;; esac From 1588069612f5db0720cbb942a6f8787878c223c3 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Fri, 9 Sep 2022 23:35:49 +0200 Subject: [PATCH 20/21] rockchip: add system-LED aliases specific to OpenWrt Add the aliases sections required to detect LEDs specific to OpenWrt boot / update indication for the NanoPi R4S. Signed-off-by: David Bauer --- .../patches-5.10/106-r4s-openwrt-leds.patch | 16 ++++++++++++++++ .../patches-5.15/106-r4s-openwrt-leds.patch | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 target/linux/rockchip/patches-5.10/106-r4s-openwrt-leds.patch create mode 100644 target/linux/rockchip/patches-5.15/106-r4s-openwrt-leds.patch diff --git a/target/linux/rockchip/patches-5.10/106-r4s-openwrt-leds.patch b/target/linux/rockchip/patches-5.10/106-r4s-openwrt-leds.patch new file mode 100644 index 0000000000..d7579d61e9 --- /dev/null +++ b/target/linux/rockchip/patches-5.10/106-r4s-openwrt-leds.patch @@ -0,0 +1,16 @@ +--- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts +@@ -19,6 +19,13 @@ + model = "FriendlyElec NanoPi R4S"; + compatible = "friendlyarm,nanopi-r4s", "rockchip,rk3399"; + ++ aliases { ++ led-boot = &sys_led; ++ led-failsafe = &sys_led; ++ led-running = &sys_led; ++ led-upgrade = &sys_led; ++ }; ++ + /delete-node/ display-subsystem; + + gpio-leds { diff --git a/target/linux/rockchip/patches-5.15/106-r4s-openwrt-leds.patch b/target/linux/rockchip/patches-5.15/106-r4s-openwrt-leds.patch new file mode 100644 index 0000000000..d7579d61e9 --- /dev/null +++ b/target/linux/rockchip/patches-5.15/106-r4s-openwrt-leds.patch @@ -0,0 +1,16 @@ +--- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts +@@ -19,6 +19,13 @@ + model = "FriendlyElec NanoPi R4S"; + compatible = "friendlyarm,nanopi-r4s", "rockchip,rk3399"; + ++ aliases { ++ led-boot = &sys_led; ++ led-failsafe = &sys_led; ++ led-running = &sys_led; ++ led-upgrade = &sys_led; ++ }; ++ + /delete-node/ display-subsystem; + + gpio-leds { From ff55e54fa36cca46b47613053188b6a316baecfa Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 10 Sep 2022 01:24:08 +0100 Subject: [PATCH 21/21] kernel: fix build on bcm27xx target platform The bump to Linux 5.15.67 brought some changes in the VC4 display driver which we had also patched downstream. Fix our local patches to fix the build. Fixes: fbe2f7db86 ("kernel: bump 5.15 to 5.15.67") Signed-off-by: Daniel Golle --- ...c4-hdmi-Raise-the-maximum-clock-rate.patch | 2 +- .../950-0019-drm-vc4-select-PM.patch | 7 +++++- ...ce-quirks-for-Freeway-Airmouse-T3-an.patch | 2 +- ...vice-quirks-for-A4Tech-FHD-1080p-web.patch | 2 +- ...c4_hdmi-doesn-t-use-2711-HPD-registe.patch | 4 ++-- ...drm-vc4-Move-HDMI-reset-to-pm_resume.patch | 24 ------------------- 6 files changed, 11 insertions(+), 30 deletions(-) diff --git a/target/linux/bcm27xx/patches-5.15/950-0005-drm-vc4-hdmi-Raise-the-maximum-clock-rate.patch b/target/linux/bcm27xx/patches-5.15/950-0005-drm-vc4-hdmi-Raise-the-maximum-clock-rate.patch index 21d3148af7..054cc1a583 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0005-drm-vc4-hdmi-Raise-the-maximum-clock-rate.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0005-drm-vc4-hdmi-Raise-the-maximum-clock-rate.patch @@ -20,7 +20,7 @@ Link: https://lore.kernel.org/r/20211025152903.1088803-9-maxime@cerno.tech --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -2386,7 +2386,7 @@ static const struct vc4_hdmi_variant bcm +@@ -2385,7 +2385,7 @@ static const struct vc4_hdmi_variant bcm .encoder_type = VC4_ENCODER_TYPE_HDMI0, .debugfs_name = "hdmi0_regs", .card_name = "vc4-hdmi-0", diff --git a/target/linux/bcm27xx/patches-5.15/950-0019-drm-vc4-select-PM.patch b/target/linux/bcm27xx/patches-5.15/950-0019-drm-vc4-select-PM.patch index e87ea31388..d1183245c4 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0019-drm-vc4-select-PM.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0019-drm-vc4-select-PM.patch @@ -14,7 +14,12 @@ Signed-off-by: Maxime Ripard --- a/drivers/gpu/drm/vc4/Kconfig +++ b/drivers/gpu/drm/vc4/Kconfig -@@ -9,6 +9,7 @@ config DRM_VC4 +@@ -5,11 +5,11 @@ config DRM_VC4 + depends on DRM + depends on SND && SND_SOC + depends on COMMON_CLK +- depends on PM + select DRM_KMS_HELPER select DRM_KMS_CMA_HELPER select DRM_GEM_CMA_HELPER select DRM_PANEL_BRIDGE diff --git a/target/linux/bcm27xx/patches-5.15/950-0163-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch b/target/linux/bcm27xx/patches-5.15/950-0163-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch index 725f7f69e2..1d43bf59e0 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0163-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0163-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch @@ -33,7 +33,7 @@ Signed-off-by: Jonathan Bell #define USB_VENDOR_ID_BELKIN 0x050d #define USB_DEVICE_ID_FLIP_KVM 0x3201 -@@ -1307,6 +1310,9 @@ +@@ -1308,6 +1311,9 @@ #define USB_VENDOR_ID_XAT 0x2505 #define USB_DEVICE_ID_XAT_CSR 0x0220 diff --git a/target/linux/bcm27xx/patches-5.15/950-0470-sound-usb-add-device-quirks-for-A4Tech-FHD-1080p-web.patch b/target/linux/bcm27xx/patches-5.15/950-0470-sound-usb-add-device-quirks-for-A4Tech-FHD-1080p-web.patch index 7502adee5a..9f0aa6fcd4 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0470-sound-usb-add-device-quirks-for-A4Tech-FHD-1080p-web.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0470-sound-usb-add-device-quirks-for-A4Tech-FHD-1080p-web.patch @@ -16,7 +16,7 @@ Signed-off-by: Jonathan Bell --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c -@@ -1923,6 +1923,8 @@ static const struct usb_audio_quirk_flag +@@ -1925,6 +1925,8 @@ static const struct usb_audio_quirk_flag QUIRK_FLAG_GENERIC_IMPLICIT_FB), DEVICE_FLG(0x2b53, 0x0031, /* Fiero SC-01 (firmware v1.1.0) */ QUIRK_FLAG_GENERIC_IMPLICIT_FB), diff --git a/target/linux/bcm27xx/patches-5.15/950-0580-drm-vc4-Ensure-vc4_hdmi-doesn-t-use-2711-HPD-registe.patch b/target/linux/bcm27xx/patches-5.15/950-0580-drm-vc4-Ensure-vc4_hdmi-doesn-t-use-2711-HPD-registe.patch index 73f7ea871a..0327929bd6 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0580-drm-vc4-Ensure-vc4_hdmi-doesn-t-use-2711-HPD-registe.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0580-drm-vc4-Ensure-vc4_hdmi-doesn-t-use-2711-HPD-registe.patch @@ -55,7 +55,7 @@ Signed-off-by: Dave Stevenson /* HDMI audio codec callbacks */ static void vc4_hdmi_audio_set_mai_clock(struct vc4_hdmi *vc4_hdmi, unsigned int samplerate) -@@ -2777,6 +2783,7 @@ static const struct vc4_hdmi_variant bcm +@@ -2776,6 +2782,7 @@ static const struct vc4_hdmi_variant bcm .phy_rng_disable = vc5_hdmi_phy_rng_disable, .channel_map = vc5_hdmi_channel_map, .supports_hdr = true, @@ -63,7 +63,7 @@ Signed-off-by: Dave Stevenson }; static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = { -@@ -2805,6 +2812,7 @@ static const struct vc4_hdmi_variant bcm +@@ -2804,6 +2811,7 @@ static const struct vc4_hdmi_variant bcm .phy_rng_disable = vc5_hdmi_phy_rng_disable, .channel_map = vc5_hdmi_channel_map, .supports_hdr = true, diff --git a/target/linux/bcm27xx/patches-5.15/950-0590-drm-vc4-Move-HDMI-reset-to-pm_resume.patch b/target/linux/bcm27xx/patches-5.15/950-0590-drm-vc4-Move-HDMI-reset-to-pm_resume.patch index f5d1c7cc0d..bec81e3f16 100644 --- a/target/linux/bcm27xx/patches-5.15/950-0590-drm-vc4-Move-HDMI-reset-to-pm_resume.patch +++ b/target/linux/bcm27xx/patches-5.15/950-0590-drm-vc4-Move-HDMI-reset-to-pm_resume.patch @@ -103,30 +103,6 @@ Signed-off-by: Dave Stevenson return 0; } -@@ -2615,20 +2641,11 @@ static int vc4_hdmi_bind(struct device * - if (ret) - goto err_put_ddc; - -- /* -- * We need to have the device powered up at this point to call -- * our reset hook and for the CEC init. -- */ -- ret = vc4_hdmi_runtime_resume(dev); -- if (ret) -- goto err_put_ddc; -- -- pm_runtime_get_noresume(dev); -- pm_runtime_set_active(dev); - pm_runtime_enable(dev); - -- if (vc4_hdmi->variant->reset) -- vc4_hdmi->variant->reset(vc4_hdmi); -+ ret = pm_runtime_resume_and_get(dev); -+ if (ret) -+ goto err_put_ddc; - - if ((of_device_is_compatible(dev->of_node, "brcm,bcm2711-hdmi0") || - of_device_is_compatible(dev->of_node, "brcm,bcm2711-hdmi1")) && --- a/drivers/gpu/drm/vc4/vc4_hdmi_regs.h +++ b/drivers/gpu/drm/vc4/vc4_hdmi_regs.h @@ -417,7 +417,7 @@ static inline u32 vc4_hdmi_read(struct v