From 3ed7abfc5af63c7fe1137a0bb78d95eb6f2455ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 13 Dec 2023 00:02:12 +0100 Subject: [PATCH 01/14] uboot-envtools: fix reading NVMEM device's compatible value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: fea4ffdef28f ("uboot-envtools: update to 2023.04") Signed-off-by: Rafał Miłecki --- ...ding-NVMEM-device-s-compatible-value.patch | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 package/boot/uboot-envtools/patches/010-fw_env-fix-reading-NVMEM-device-s-compatible-value.patch diff --git a/package/boot/uboot-envtools/patches/010-fw_env-fix-reading-NVMEM-device-s-compatible-value.patch b/package/boot/uboot-envtools/patches/010-fw_env-fix-reading-NVMEM-device-s-compatible-value.patch new file mode 100644 index 0000000000..5af8a1aa0e --- /dev/null +++ b/package/boot/uboot-envtools/patches/010-fw_env-fix-reading-NVMEM-device-s-compatible-value.patch @@ -0,0 +1,70 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 12 Dec 2023 18:23:45 +0100 +Subject: [PATCH] fw_env: fix reading NVMEM device's "compatible" value +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Call to fread() was changed to check for return value. The problem is it +can't be checked for returning 1 (as it is) to determine success. + +We call fread() with buffer size as "size" argument. Reading any +"compatible" value shorter than buffer size will result in returning 0 +even on success. + +Modify code to use fstat() to determine expected read length. + +This fixes regression that broke using fw_env with NVMEM devices. + +Fixes: c059a22b7776 ("tools: env: fw_env: Fix unused-result warning") +Cc: Jaehoon Chung +Signed-off-by: Rafał Miłecki +--- + tools/env/fw_env.c | 18 ++++++++++++++---- + 1 file changed, 14 insertions(+), 4 deletions(-) + +--- a/tools/env/fw_env.c ++++ b/tools/env/fw_env.c +@@ -1732,6 +1732,7 @@ static int find_nvmem_device(void) + } + + while (!nvmem && (dent = readdir(dir))) { ++ struct stat s; + FILE *fp; + size_t size; + +@@ -1749,14 +1750,22 @@ static int find_nvmem_device(void) + continue; + } + +- size = fread(buf, sizeof(buf), 1, fp); ++ if (fstat(fileno(fp), &s)) { ++ fprintf(stderr, "Failed to fstat %s\n", comp); ++ goto next; ++ } ++ ++ if (s.st_size >= sizeof(buf)) { ++ goto next; ++ } ++ ++ size = fread(buf, s.st_size, 1, fp); + if (size != 1) { + fprintf(stderr, + "read failed about %s\n", comp); +- fclose(fp); +- return -EIO; ++ goto next; + } +- ++ buf[s.st_size] = '\0'; + + if (!strcmp(buf, "u-boot,env")) { + bytes = asprintf(&nvmem, "%s/%s/nvmem", path, dent->d_name); +@@ -1765,6 +1774,7 @@ static int find_nvmem_device(void) + } + } + ++next: + fclose(fp); + } + From de94eceee682fee3e6b7a0c89f70965648018c59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 13 Dec 2023 08:52:59 +0100 Subject: [PATCH 02/14] uboot-envtools: bump PKG_RELEASE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Miłecki --- package/boot/uboot-envtools/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile index f4063ed362..9647b38385 100644 --- a/package/boot/uboot-envtools/Makefile +++ b/package/boot/uboot-envtools/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uboot-envtools PKG_DISTNAME:=u-boot PKG_VERSION:=2023.07.02 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_DISTNAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ From b09e060e2c12535fb71f18bf0b47a0fc3e267896 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Wed, 13 Dec 2023 17:00:17 +0100 Subject: [PATCH 03/14] package: kernel: move pcs-xpcs from armsr to generic Move pcs-xpcs kmod from armsr modules.mk to generic modules package. Also add additional dependency to x86_64 as stmmac-core it's now used by x86_64 target and depends on this package. Fixes: 4b4c940fbc8f ("x86: Add kmod-dwmac-intel") Signed-off-by: Christian Marangi --- package/kernel/linux/modules/netdevices.mk | 12 ++++++++++++ target/linux/armsr/modules.mk | 11 ----------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk index d357b233f2..ab6bead9c2 100644 --- a/package/kernel/linux/modules/netdevices.mk +++ b/package/kernel/linux/modules/netdevices.mk @@ -1543,6 +1543,18 @@ endef $(eval $(call KernelPackage,sfp)) +define KernelPackage/pcs-xpcs + SUBMENU:=$(NETWORK_DEVICES_MENU) + TITLE:=Synopsis DesignWare PCS driver + DEPENDS:=@(TARGET_x86_64||TARGET_armsr_armv8) +kmod-phylink + KCONFIG:=CONFIG_PCS_XPCS + FILES:=$(LINUX_DIR)/drivers/net/pcs/pcs_xpcs.ko + AUTOLOAD:=$(call AutoLoad,20,pcs_xpcs) +endef + +$(eval $(call KernelPackage,pcs-xpcs)) + + define KernelPackage/stmmac-core SUBMENU:=$(NETWORK_DEVICES_MENU) TITLE:=Synopsis Ethernet Controller core (NXP,STMMicro,others) diff --git a/target/linux/armsr/modules.mk b/target/linux/armsr/modules.mk index 521a52fec1..7612b258c3 100644 --- a/target/linux/armsr/modules.mk +++ b/target/linux/armsr/modules.mk @@ -47,17 +47,6 @@ endef $(eval $(call KernelPackage,fsl-pcs-lynx)) -define KernelPackage/pcs-xpcs - SUBMENU:=$(NETWORK_DEVICES_MENU) - TITLE:=Synopsis DesignWare PCS driver - DEPENDS:=@(TARGET_armsr_armv8) +kmod-phylink - KCONFIG:=CONFIG_PCS_XPCS - FILES:=$(LINUX_DIR)/drivers/net/pcs/pcs_xpcs.ko - AUTOLOAD:=$(call AutoLoad,20,pcs_xpcs) -endef - -$(eval $(call KernelPackage,pcs-xpcs)) - define KernelPackage/fsl-fec SUBMENU:=$(NETWORK_DEVICES_MENU) DEPENDS:=@(TARGET_armsr_armv8) +kmod-libphy +kmod-of-mdio \ From 8fc954aeb76fe5991204646f7bee0ac521453159 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Wed, 13 Dec 2023 17:03:13 +0100 Subject: [PATCH 04/14] package: kernel: detach of-mdio dependency from stmmac-core Detach of-mdio dependency from stmmac-core kmod to fix support for x86_64 target. This target doesn't use OpenFirmware infrastructure and stmmac-core for the dwmac-intel driver doesn't depends on it. Add kmod-of-mdio to any other user of stmmac-core as it's not inherit from stmmac-core anymore. Fixes: #14209 Fixes: 4b4c940fbc8f ("x86: Add kmod-dwmac-intel") Signed-off-by: Christian Marangi --- package/kernel/linux/modules/netdevices.mk | 3 +-- target/linux/armsr/modules.mk | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk index ab6bead9c2..46dcdfdef7 100644 --- a/package/kernel/linux/modules/netdevices.mk +++ b/package/kernel/linux/modules/netdevices.mk @@ -1558,8 +1558,7 @@ $(eval $(call KernelPackage,pcs-xpcs)) define KernelPackage/stmmac-core SUBMENU:=$(NETWORK_DEVICES_MENU) TITLE:=Synopsis Ethernet Controller core (NXP,STMMicro,others) - DEPENDS:=@TARGET_x86_64||TARGET_armsr_armv8 +kmod-pcs-xpcs +kmod-ptp \ - +kmod-of-mdio + DEPENDS:=@TARGET_x86_64||TARGET_armsr_armv8 +kmod-pcs-xpcs +kmod-ptp KCONFIG:=CONFIG_STMMAC_ETH \ CONFIG_STMMAC_SELFTESTS=n \ CONFIG_STMMAC_PLATFORM \ diff --git a/target/linux/armsr/modules.mk b/target/linux/armsr/modules.mk index 7612b258c3..7dd3739ffa 100644 --- a/target/linux/armsr/modules.mk +++ b/target/linux/armsr/modules.mk @@ -208,7 +208,7 @@ $(eval $(call KernelPackage,imx7-ulp-wdt)) define KernelPackage/dwmac-imx SUBMENU=$(NETWORK_DEVICES_MENU) TITLE:=NXP i.MX8 Ethernet controller - DEPENDS:=+kmod-stmmac-core + DEPENDS:=+kmod-stmmac-core +kmod-of-mdio KCONFIG:=CONFIG_DWMAC_IMX8 FILES=$(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.ko AUTOLOAD=$(call AutoLoad,45,dwmac-imx) @@ -219,7 +219,7 @@ $(eval $(call KernelPackage,dwmac-imx)) define KernelPackage/dwmac-sun8i SUBMENU=$(NETWORK_DEVICES_MENU) TITLE:=Allwinner H3/A83T/A64 (sun8i) Ethernet - DEPENDS:=+kmod-stmmac-core +kmod-mdio-bus-mux + DEPENDS:=+kmod-stmmac-core +kmod-of-mdio +kmod-mdio-bus-mux KCONFIG:=CONFIG_DWMAC_SUN8I FILES=$(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.ko AUTOLOAD=$(call AutoLoad,45,dwmac-sun8i) @@ -230,7 +230,7 @@ $(eval $(call KernelPackage,dwmac-sun8i)) define KernelPackage/dwmac-rockchip SUBMENU=$(NETWORK_DEVICES_MENU) TITLE:=Rockchip RK3328/RK3399/RK3568 Ethernet - DEPENDS:=+kmod-stmmac-core +kmod-mdio-bus-mux + DEPENDS:=+kmod-stmmac-core +kmod-of-mdio +kmod-mdio-bus-mux KCONFIG:=CONFIG_DWMAC_ROCKCHIP FILES=$(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.ko AUTOLOAD=$(call AutoLoad,45,dwmac-rk) From 9920eebedc1a9266f4113f1e19e91bbba280ab4f Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Fri, 20 Oct 2023 23:30:21 +0800 Subject: [PATCH 05/14] kernel: add support for Toshiba TH58NYG3S0HBAI4 Correct oob size from 128 to 256 for Toshiba TH58NYG3S0HBAI4 flash. Since it is not ONFI compliant NAND, the model name cannot be read from anywhere, add a static NAND ID entry to correct this. However, the NAND ID of this flash is inconsistent with the datasheet. The actual NAND ID is only 4 ID bytes, the last ID byte is missing.[1] Maybe this flash is counterfeit, or maybe it's another problem. Another Toshiba flash had the same problem before. Refer to commit a83dc6b ("kernel: move Toshiba-TC58NVG0S3H patch to ipq40xx"), put the patch into qualcommax target to avoid affecting other devices. The patch is verified on Arcadyan AW1000. [1] Datasheet available at (the ID table is on page 50): https://europe.kioxia.com/content/dam/kioxia/newidr/productinfo/datasheet/201910/DST_TH58NYG3S0HBAI4-TDE_EN_31565.pdf Signed-off-by: Chukun Pan Reviewed-by: Robert Marko --- ...nand-add-support-for-TH58NYG3S0HBAI4.patch | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 target/linux/qualcommax/patches-6.1/0400-mtd-rawnand-add-support-for-TH58NYG3S0HBAI4.patch diff --git a/target/linux/qualcommax/patches-6.1/0400-mtd-rawnand-add-support-for-TH58NYG3S0HBAI4.patch b/target/linux/qualcommax/patches-6.1/0400-mtd-rawnand-add-support-for-TH58NYG3S0HBAI4.patch new file mode 100644 index 0000000000..c52681928b --- /dev/null +++ b/target/linux/qualcommax/patches-6.1/0400-mtd-rawnand-add-support-for-TH58NYG3S0HBAI4.patch @@ -0,0 +1,42 @@ +From 8d8b37d3af2bdccf0a37d2017d876bfc6ce42552 Mon Sep 17 00:00:00 2001 +From: Chukun Pan +Date: Fri, 20 Oct 2023 23:18:21 +0800 +Subject: [PATCH 1/1] mtd: rawnand: add support for TH58NYG3S0HBAI4 NAND flash + +The Toshiba TH58NYG3S0HBAI4 is detected with 128 byte OOB while the flash +has 256 bytes OOB. Since it is not an ONFI compliant NAND, the model name +cannot be read from anywhere, add a static NAND ID entry to correct this. + +However, the NAND ID of this flash is inconsistent with the datasheet. +The actual NAND ID is only 4 ID bytes, the last ID byte is missing. + +Datasheet available at (the ID table is on page 50): +https://europe.kioxia.com/content/dam/kioxia/newidr/productinfo/datasheet/201910/DST_TH58NYG3S0HBAI4-TDE_EN_31565.pdf + +Datasheet NAND ID: {0x98, 0xa3, 0x91, 0x26, 0x76} +Actual NAND ID: {0x98, 0xa3, 0x91, 0x26} + +It seems that this flash may be counterfeit, but another Toshiba flash +also has the same problem. Maybe the driver has a bug, or some Toshiba +nand flash is like this. Anyway, add a static NAND ID entry with only +4 ID bytes as a hack to make sure it works. + +Tested on Arcadyan AW1000 flashed with OpenWrt. + +Signed-off-by: Chukun Pan +--- + drivers/mtd/nand/raw/nand_ids.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/mtd/nand/raw/nand_ids.c ++++ b/drivers/mtd/nand/raw/nand_ids.c +@@ -55,6 +55,9 @@ struct nand_flash_dev nand_flash_ids[] = + { .id = {0xad, 0xde, 0x14, 0xa7, 0x42, 0x4a} }, + SZ_16K, SZ_8K, SZ_4M, NAND_NEED_SCRAMBLING, 6, 1664, + NAND_ECC_INFO(40, SZ_1K) }, ++ {"TH58NYG3S0HBAI4 8G 1.8V 8-bit", /* Last ID bytes missing */ ++ { .id = {0x98, 0xa3, 0x91, 0x26} }, ++ SZ_4K, SZ_1K, SZ_256K, 0, 4, 256, NAND_ECC_INFO(8, SZ_512) }, + {"TH58NVG2S3HBAI4 4G 3.3V 8-bit", + { .id = {0x98, 0xdc, 0x91, 0x15, 0x76} }, + SZ_2K, SZ_512, SZ_128K, 0, 5, 128, NAND_ECC_INFO(8, SZ_512) }, From ab6a0295738e395d094e2e8244d7a4defe7c8d00 Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Sun, 29 Oct 2023 23:26:06 +0800 Subject: [PATCH 06/14] qualcommax: cleanup whitespace and sort-order Replace blanks with tabs, also sort base-files alphabetically. Signed-off-by: Chukun Pan Reviewed-by: Robert Marko --- target/linux/qualcommax/image/ipq807x.mk | 43 +++++++++--------- .../ipq807x/base-files/etc/board.d/02_network | 10 ++--- .../etc/hotplug.d/firmware/11-ath11k-caldata | 6 +-- .../ipq807x/base-files/lib/upgrade/mmc.sh | 8 ++-- .../base-files/lib/upgrade/platform.sh | 44 +++++++++---------- 5 files changed, 54 insertions(+), 57 deletions(-) diff --git a/target/linux/qualcommax/image/ipq807x.mk b/target/linux/qualcommax/image/ipq807x.mk index ee7707540b..6eb8ed2ce2 100644 --- a/target/linux/qualcommax/image/ipq807x.mk +++ b/target/linux/qualcommax/image/ipq807x.mk @@ -48,16 +48,16 @@ endef TARGET_DEVICES += buffalo_wxr-5950ax12 define Device/compex_wpq873 - $(call Device/FitImage) - $(call Device/UbiFit) - DEVICE_VENDOR := Compex - DEVICE_MODEL := WPQ873 - BLOCKSIZE := 128k - PAGESIZE := 2048 - DEVICE_DTS_CONFIG := config@hk09.wpq873 - SOC := ipq8072 - DEVICE_PACKAGES := ipq-wifi-compex_wpq873 - IMAGE/factory.ubi := append-ubi | qsdk-ipq-factory-nand + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Compex + DEVICE_MODEL := WPQ873 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_DTS_CONFIG := config@hk09.wpq873 + SOC := ipq8072 + DEVICE_PACKAGES := ipq-wifi-compex_wpq873 + IMAGE/factory.ubi := append-ubi | qsdk-ipq-factory-nand endef TARGET_DEVICES += compex_wpq873 @@ -242,18 +242,6 @@ endif endef TARGET_DEVICES += xiaomi_ax9000 -define Device/zyxel_nbg7815 - $(call Device/FitImage) - $(call Device/EmmcImage) - DEVICE_VENDOR := ZYXEL - DEVICE_MODEL := NBG7815 - DEVICE_DTS_CONFIG := config@nbg7815 - SOC := ipq8074 - DEVICE_PACKAGES += ipq-wifi-zyxel_nbg7815 kmod-ath11k-pci kmod-hwmon-tmp103 \ - kmod-bluetooth -endef -TARGET_DEVICES += zyxel_nbg7815 - define Device/yuncore_ax880 $(call Device/FitImage) $(call Device/UbiFit) @@ -269,3 +257,14 @@ define Device/yuncore_ax880 endef TARGET_DEVICES += yuncore_ax880 +define Device/zyxel_nbg7815 + $(call Device/FitImage) + $(call Device/EmmcImage) + DEVICE_VENDOR := ZYXEL + DEVICE_MODEL := NBG7815 + DEVICE_DTS_CONFIG := config@nbg7815 + SOC := ipq8074 + DEVICE_PACKAGES += ipq-wifi-zyxel_nbg7815 kmod-ath11k-pci \ + kmod-bluetooth kmod-hwmon-tmp103 +endef +TARGET_DEVICES += zyxel_nbg7815 diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network index 95f1ab4bdf..82f16519aa 100644 --- a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network +++ b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network @@ -16,6 +16,11 @@ ipq807x_setup_interfaces() xiaomi,ax9000) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan" ;; + compex,wpq873|\ + redmi,ax6|\ + xiaomi,ax3600) + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan" + ;; edgecore,eap102|\ yuncore,ax880) ucidef_set_interfaces_lan_wan "lan" "wan" @@ -39,11 +44,6 @@ ipq807x_setup_interfaces() qnap,301w) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 10g-2" "10g-1" ;; - compex,wpq873|\ - redmi,ax6|\ - xiaomi,ax3600) - ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan" - ;; zyxel,nbg7815) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 10g" "wan" ;; diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata index f427009669..6139ff0faa 100644 --- a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata +++ b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata @@ -11,9 +11,9 @@ case "$FIRMWARE" in case "$board" in buffalo,wxr-5950ax12|\ compex,wpq873|\ + dynalink,dl-wrx36|\ edgecore,eap102|\ edimax,cax1800|\ - dynalink,dl-wrx36|\ netgear,rax120v2|\ netgear,wax218|\ netgear,wax620|\ @@ -27,7 +27,7 @@ case "$FIRMWARE" in caldata_extract "0:art" 0x1000 0x20000 ;; prpl,haze) - caldata_extract_mmc "0:ART" 0x1000 0x20000 + caldata_extract_mmc "0:ART" 0x1000 0x20000 ;; esac ;; @@ -35,7 +35,7 @@ case "$FIRMWARE" in "ath11k/QCN9074/hw1.0/cal-pci-0001:01:00.0.bin") case "$board" in prpl,haze) - caldata_extract_mmc "0:ART" 0x26800 0x20000 + caldata_extract_mmc "0:ART" 0x26800 0x20000 ;; xiaomi,ax9000) caldata_extract "0:art" 0x26800 0x20000 diff --git a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/mmc.sh b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/mmc.sh index dac9ddd568..21cd7928e3 100644 --- a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/mmc.sh +++ b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/mmc.sh @@ -18,11 +18,11 @@ mmc_do_upgrade() { local rootfs= local kernel= - [ -z "$kernel" ] && kernel=$(find_mmc_part ${kernelname}) - [ -z "$rootfs" ] && rootfs=$(find_mmc_part ${rootfsname}) + [ -z "$kernel" ] && kernel=$(find_mmc_part ${kernelname}) + [ -z "$rootfs" ] && rootfs=$(find_mmc_part ${rootfsname}) - [ -z "$kernel" ] && echo "Upgrade failed: kernel partition not found! Rebooting..." && reboot -f - [ -z "$rootfs" ] && echo "Upgrade failed: rootfs partition not found! Rebooting..." && reboot -f + [ -z "$kernel" ] && echo "Upgrade failed: kernel partition not found! Rebooting..." && reboot -f + [ -z "$rootfs" ] && echo "Upgrade failed: rootfs partition not found! Rebooting..." && reboot -f mmc_do_flash $tar_file $kernel $rootfs diff --git a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh index 19bd54cf4e..cddf287b5e 100644 --- a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh +++ b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh @@ -51,7 +51,13 @@ platform_do_upgrade() { nand_do_restore_config || nand_do_upgrade_failed buffalo_upgrade_optvol ;; - dynalink,dl-wrx36) + compex,wpq873|\ + dynalink,dl-wrx36|\ + edimax,cax1800|\ + netgear,rax120v2|\ + netgear,wax218|\ + netgear,wax620|\ + netgear,wax630) nand_do_upgrade "$1" ;; edgecore,eap102) @@ -66,34 +72,12 @@ platform_do_upgrade() { fw_setenv upgrade_available 1 nand_do_upgrade "$1" ;; - compex,wpq873|\ - edimax,cax1800|\ - netgear,rax120v2|\ - netgear,wax218|\ - netgear,wax620|\ - netgear,wax630) - nand_do_upgrade "$1" - ;; prpl,haze|\ qnap,301w) kernelname="0:HLOS" rootfsname="rootfs" mmc_do_upgrade "$1" ;; - zyxel,nbg7815) - local config_mtdnum="$(find_mtd_index 0:bootconfig)" - [ -z "$config_mtdnum" ] && reboot - part_num="$(hexdump -e '1/1 "%01x|"' -n 1 -s 168 -C /dev/mtd$config_mtdnum | cut -f 1 -d "|" | head -n1)" - if [ "$part_num" -eq "0" ]; then - kernelname="0:HLOS" - rootfsname="rootfs" - mmc_do_upgrade "$1" - else - kernelname="0:HLOS_1" - rootfsname="rootfs_1" - mmc_do_upgrade "$1" - fi - ;; redmi,ax6|\ xiaomi,ax3600|\ xiaomi,ax9000) @@ -125,6 +109,20 @@ platform_do_upgrade() { fw_setenv upgrade_available 1 nand_do_upgrade "$1" ;; + zyxel,nbg7815) + local config_mtdnum="$(find_mtd_index 0:bootconfig)" + [ -z "$config_mtdnum" ] && reboot + part_num="$(hexdump -e '1/1 "%01x|"' -n 1 -s 168 -C /dev/mtd$config_mtdnum | cut -f 1 -d "|" | head -n1)" + if [ "$part_num" -eq "0" ]; then + kernelname="0:HLOS" + rootfsname="rootfs" + mmc_do_upgrade "$1" + else + kernelname="0:HLOS_1" + rootfsname="rootfs_1" + mmc_do_upgrade "$1" + fi + ;; *) default_do_upgrade "$1" ;; From fbcda3616e2c18b533a552fad9b724a636bcae5e Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Fri, 25 Aug 2023 23:10:35 +0800 Subject: [PATCH 07/14] ipq807x: add Arcadyan AW1000 support Hardware specification: SoC: Qualcomm IPQ8072A Flash: Toshiba NAND 1GiB RAM: 1 GiB of DDR3 466 MHz Ethernet: 4x 1Gbps + 1x 2.5Gbps WiFi1: QCN5024 2.4GHz ax 4x4 WiFi2: QCN5054 5GHz ax 4x4 Button: WiFi, WPS, Reset Modem: RG500Q-EA USB: 1 x USB 3.0 Power: DC 12V 4A Flash instructions: 1. Download the initramfs image, rename it to initramfs.bin, and host it with tftp server. 2. Interrupt U-Boot and run these commands: tftpboot initramfs.bin bootm 3. After openwrt boots up, use scp or luci web to upload sysupgrade.bin to upgrade. Signed-off-by: Chukun Pan Reviewed-by: Robert Marko --- package/firmware/ipq-wifi/Makefile | 2 + .../arm64/boot/dts/qcom/ipq8072-aw1000.dts | 345 ++++++++++++++++++ target/linux/qualcommax/image/ipq807x.mk | 14 + .../ipq807x/base-files/etc/board.d/01_leds | 4 + .../ipq807x/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/11-ath11k-caldata | 1 + .../etc/hotplug.d/ieee80211/11_fix_wifi_mac | 17 + .../base-files/lib/upgrade/platform.sh | 17 +- 8 files changed, 393 insertions(+), 8 deletions(-) create mode 100644 target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-aw1000.dts create mode 100644 target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 8da2ac4e1f..cbd61c5be8 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -28,6 +28,7 @@ endef # ALLWIFIBOARDS:= \ + arcadyan_aw1000 \ buffalo_wxr-5950ax12 \ compex_wpq873 \ dynalink_dl-wrx36 \ @@ -136,6 +137,7 @@ endef # Board files should follow this name structure: # board-. +$(eval $(call generate-ipq-wifi-package,arcadyan_aw1000,Arcadyan AW1000)) $(eval $(call generate-ipq-wifi-package,buffalo_wxr-5950ax12,Buffalo WXR-5950AX12)) $(eval $(call generate-ipq-wifi-package,compex_wpq873,Compex WPQ-873)) $(eval $(call generate-ipq-wifi-package,dynalink_dl-wrx36,Dynalink DL-WRX36)) diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-aw1000.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-aw1000.dts new file mode 100644 index 0000000000..495ebad17a --- /dev/null +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-aw1000.dts @@ -0,0 +1,345 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/* Copyright (c) 2023, Chukun Pan */ + +/dts-v1/; + +#include "ipq8074.dtsi" +#include "ipq8074-hk-cpu.dtsi" +#include "ipq8074-ess.dtsi" +#include +#include + +/ { + model = "Arcadyan AW1000"; + compatible = "arcadyan,aw1000", "qcom,ipq8074"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + serial0 = &blsp1_uart5; + /* + * Aliases as required by u-boot + * to patch MAC addresses + */ + ethernet0 = &dp1; + ethernet1 = &dp2; + ethernet2 = &dp3; + ethernet3 = &dp4; + ethernet4 = &dp6_syn; + label-mac-device = &dp1; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs-append = " root=/dev/ubiblock0_1"; + }; + + gpio-export { + compatible = "gpio-export"; + + lte-pwrkey { + gpio-export,name = "lte_pwrkey"; + gpio-export,output = <1>; + gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>; + }; + + lte-power { + gpio-export,name = "lte_power"; + gpio-export,output = <1>; + gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>; + }; + + lte-reset { + gpio-export,name = "lte_reset"; + gpio-export,output = <1>; + gpios = <&tlmm 63 GPIO_ACTIVE_HIGH>; + }; + + usb-vbus { + gpio-export,name = "usb_vbus"; + gpio-export,output = <0>; + gpios = <&tlmm 9 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + wlan { + label = "wlan"; + linux,code = ; + gpios = <&tlmm 2 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "wps"; + linux,code = ; + gpios = <&tlmm 62 GPIO_ACTIVE_LOW>; + }; + + reset { + label = "reset"; + linux,code = ; + gpios = <&tlmm 67 GPIO_ACTIVE_LOW>; + }; + }; + + led-spi { + compatible = "spi-gpio"; + #address-cells = <1>; + #size-cells = <0>; + + sck-gpios = <&tlmm 18 GPIO_ACTIVE_HIGH>; + mosi-gpios = <&tlmm 19 GPIO_ACTIVE_HIGH>; + + led_gpio: led-gpio@0 { + compatible = "fairchild,74hc595"; + reg = <0>; + gpio-controller; + #gpio-cells = <2>; + registers-number = <2>; + spi-max-frequency = <1000000>; + enable-gpios = <&tlmm 20 GPIO_ACTIVE_HIGH>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "green:power"; + gpios = <&led_gpio 0 GPIO_ACTIVE_HIGH>; + }; + + wifi { + label = "green:wifi"; + gpios = <&led_gpio 1 GPIO_ACTIVE_HIGH>; + }; + + internet { + label = "green:internet"; + gpios = <&led_gpio 2 GPIO_ACTIVE_HIGH>; + }; + + 5g-red { + label = "red:5g"; + gpios = <&led_gpio 3 GPIO_ACTIVE_LOW>; + }; + + 5g-green { + label = "green:5g"; + gpios = <&led_gpio 4 GPIO_ACTIVE_LOW>; + }; + + 5g-blue { + label = "blue:5g"; + gpios = <&led_gpio 5 GPIO_ACTIVE_LOW>; + }; + + signal-red { + label = "red:signal"; + gpios = <&led_gpio 6 GPIO_ACTIVE_LOW>; + }; + + signal-green { + label = "green:signal"; + gpios = <&led_gpio 8 GPIO_ACTIVE_LOW>; + }; + + signal-blue { + label = "blue:signal"; + gpios = <&led_gpio 9 GPIO_ACTIVE_LOW>; + }; + + phone { + label = "green:phone"; + gpios = <&led_gpio 11 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&tlmm { + mdio_pins: mdio-pins { + mdc { + pins = "gpio68"; + function = "mdc"; + drive-strength = <8>; + bias-pull-up; + }; + + mdio { + pins = "gpio69"; + function = "mdio"; + drive-strength = <8>; + bias-pull-up; + }; + }; +}; + +&blsp1_uart5 { + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&crypto { + status = "okay"; +}; + +&prng { + status = "okay"; +}; + +&qpic_bam { + status = "okay"; +}; + +&qpic_nand { + status = "okay"; + + nand@0 { + reg = <0>; + nand-ecc-strength = <8>; + nand-ecc-step-size = <512>; + nand-bus-width = <8>; + + partitions { + compatible = "qcom,smem-part"; + }; + }; +}; + +&qusb_phy_0 { + status = "okay"; +}; + +&qusb_phy_1 { + status = "okay"; +}; + +&ssphy_0 { + status = "okay"; +}; + +&ssphy_1 { + status = "okay"; +}; + +&usb_0 { + status = "okay"; +}; + +&usb_1 { + status = "okay"; +}; + +&mdio { + status = "okay"; + + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + reset-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>; + + qca8075_0: ethernet-phy@0 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0>; + }; + + qca8075_1: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + }; + + qca8075_2: ethernet-phy@2 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <2>; + }; + + qca8075_3: ethernet-phy@3 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <3>; + }; + + qca8081: ethernet-phy@28 { + compatible = "ethernet-phy-id004d.d101"; + reg = <28>; + reset-gpios = <&tlmm 64 GPIO_ACTIVE_LOW>; + }; +}; + +&switch { + status = "okay"; + + switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4)>; /* lan port bitmap */ + switch_wan_bmp = ; /* wan port bitmap */ + switch_mac_mode = ; /* mac mode for uniphy instance0*/ + switch_mac_mode2 = ; /* mac mode for uniphy instance2*/ + + qcom,port_phyinfo { + port@1 { + port_id = <1>; + phy_address = <0>; + }; + port@2 { + port_id = <2>; + phy_address = <1>; + }; + port@3 { + port_id = <3>; + phy_address = <2>; + }; + port@4 { + port_id = <4>; + phy_address = <3>; + }; + port@6 { + port_id = <6>; + phy_address = <28>; + port_mac_sel = "QGMAC_PORT"; + }; + }; +}; + +&edma { + status = "okay"; +}; + +&dp1 { + status = "okay"; + phy-handle = <&qca8075_0>; + label = "lan1"; +}; + +&dp2 { + status = "okay"; + phy-handle = <&qca8075_1>; + label = "lan2"; +}; + +&dp3 { + status = "okay"; + phy-handle = <&qca8075_2>; + label = "lan3"; +}; + +&dp4 { + status = "okay"; + phy-handle = <&qca8075_3>; + label = "lan4"; +}; + +&dp6_syn { + status = "okay"; + phy-handle = <&qca8081>; + label = "wan"; +}; + +&wifi { + status = "okay"; + + qcom,ath11k-calibration-variant = "Arcadyan-AW1000"; +}; diff --git a/target/linux/qualcommax/image/ipq807x.mk b/target/linux/qualcommax/image/ipq807x.mk index 6eb8ed2ce2..ce4d62d571 100644 --- a/target/linux/qualcommax/image/ipq807x.mk +++ b/target/linux/qualcommax/image/ipq807x.mk @@ -33,6 +33,20 @@ define Build/wax6xx-netgear-tar rm -rf $@.tmp endef +define Device/arcadyan_aw1000 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := Arcadyan + DEVICE_MODEL := AW1000 + BLOCKSIZE := 256k + PAGESIZE := 4096 + DEVICE_DTS_CONFIG := config@hk09 + SOC := ipq8072 + DEVICE_PACKAGES := ipq-wifi-arcadyan_aw1000 kmod-spi-gpio \ + kmod-gpio-nxp-74hc164 kmod-usb-serial-option uqmi +endef +TARGET_DEVICES += arcadyan_aw1000 + define Device/buffalo_wxr-5950ax12 $(call Device/FitImage) DEVICE_VENDOR := Buffalo diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/01_leds b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/01_leds index fb14a667cb..5e478d75ee 100644 --- a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/01_leds +++ b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/01_leds @@ -6,6 +6,10 @@ board_config_update board=$(board_name) case "$board" in +arcadyan,aw1000) + ucidef_set_led_netdev "5g" "5G" "green:5g" "wwan0" + ucidef_set_led_netdev "wan" "WAN" "green:internet" "wan" + ;; edgecore,eap102) ucidef_set_led_netdev "wan" "WAN" "green:wanpoe" "wan" ;; diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network index 82f16519aa..cb70b27283 100644 --- a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network +++ b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network @@ -11,6 +11,7 @@ ipq807x_setup_interfaces() local board="$1" case "$board" in + arcadyan,aw1000|\ buffalo,wxr-5950ax12|\ dynalink,dl-wrx36|\ xiaomi,ax9000) diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata index 6139ff0faa..e14af79598 100644 --- a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata +++ b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata @@ -9,6 +9,7 @@ board=$(board_name) case "$FIRMWARE" in "ath11k/IPQ8074/hw2.0/cal-ahb-c000000.wifi.bin") case "$board" in + arcadyan,aw1000|\ buffalo,wxr-5950ax12|\ compex,wpq873|\ dynalink,dl-wrx36|\ diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac new file mode 100644 index 0000000000..c7cacc99fe --- /dev/null +++ b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -0,0 +1,17 @@ +[ "$ACTION" == "add" ] || exit 0 + +PHYNBR=${DEVPATH##*/phy} + +[ -n $PHYNBR ] || exit 0 + +. /lib/functions.sh +. /lib/functions/system.sh + +board=$(board_name) + +case "$board" in + arcadyan,aw1000) + [ "$PHYNBR" = "0" ] && macaddr_add $(get_mac_label) 1 > /sys${DEVPATH}/macaddress + [ "$PHYNBR" = "1" ] && macaddr_add $(get_mac_label) 2 > /sys${DEVPATH}/macaddress + ;; +esac diff --git a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh index cddf287b5e..5a40d53883 100644 --- a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh +++ b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh @@ -43,14 +43,7 @@ platform_pre_upgrade() { platform_do_upgrade() { case "$(board_name)" in - buffalo,wxr-5950ax12) - CI_KERN_UBIPART="rootfs" - CI_ROOT_UBIPART="user_property" - buffalo_upgrade_prepare - nand_do_flash_file "$1" || nand_do_upgrade_failed - nand_do_restore_config || nand_do_upgrade_failed - buffalo_upgrade_optvol - ;; + arcadyan,aw1000|\ compex,wpq873|\ dynalink,dl-wrx36|\ edimax,cax1800|\ @@ -60,6 +53,14 @@ platform_do_upgrade() { netgear,wax630) nand_do_upgrade "$1" ;; + buffalo,wxr-5950ax12) + CI_KERN_UBIPART="rootfs" + CI_ROOT_UBIPART="user_property" + buffalo_upgrade_prepare + nand_do_flash_file "$1" || nand_do_upgrade_failed + nand_do_restore_config || nand_do_upgrade_failed + buffalo_upgrade_optvol + ;; edgecore,eap102) active="$(fw_printenv -n active)" if [ "$active" -eq "1" ]; then From 9b598ec8d5585ca81cd472ca1d1b4f93d18dc3d5 Mon Sep 17 00:00:00 2001 From: Dirk Buchwalder Date: Fri, 24 Nov 2023 15:56:39 +0100 Subject: [PATCH 08/14] ipq807x: fix edgecore EAP102 lan/wan We have a report in the forum, that lan/wan is non-functional on the EAP102 (https://forum.openwrt.org/t/edgecore-eap102/178449) Fixing that by swapping label and phy-handle of the dp-nodes and updating the lan/wan bmp. Note: the original commiter of the device support seems absent for a long time in the forum and on the OpenWrt github group. Tested-by: Antonio Della Selva Signed-off-by: Dirk Buchwalder Reviewed-by: Robert Marko --- .../arch/arm64/boot/dts/qcom/ipq8071-eap102.dts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-eap102.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-eap102.dts index 7067f92968..d40b3f0d24 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-eap102.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-eap102.dts @@ -21,8 +21,8 @@ led-running = &led_system_green; led-upgrade = &led_system_green; /* Aliases as required by u-boot to patch MAC addresses */ - ethernet0 = &dp5; - ethernet1 = &dp6; + ethernet0 = &dp6; + ethernet1 = &dp5; label-mac-device = &dp5; }; @@ -343,8 +343,8 @@ &switch { status = "okay"; - switch_lan_bmp = ; /* lan port bitmap */ - switch_wan_bmp = ; /* wan port bitmap */ + switch_lan_bmp = ; /* lan port bitmap */ + switch_wan_bmp = ; /* wan port bitmap */ switch_mac_mode1 = ; /* mac mode for uniphy instance1*/ switch_mac_mode2 = ; /* mac mode for uniphy instance2*/ @@ -368,14 +368,14 @@ &dp5 { status = "okay"; - phy-handle = <&qca8081_28>; - label = "wan"; + phy-handle = <&qca8081_24>; + label = "lan"; }; &dp6 { status = "okay"; - phy-handle = <&qca8081_24>; - label = "lan"; + phy-handle = <&qca8081_28>; + label = "wan"; }; &wifi { From daba89bca3720c1e900dfff329b7dfe5861eaab1 Mon Sep 17 00:00:00 2001 From: Raylynn Knight Date: Fri, 1 Dec 2023 00:17:07 -0500 Subject: [PATCH 09/14] realtek: Clean up and standardize realtek-poe support This patch cleans up and standardizes realtek-poe support for realtek based switches that have supported PoE ports. The power output of switches supported by realtek-poe package can be configured in the 02_network ucidef_set_poe() function. This was missed when some PoE capable switches supported by realtek-poe were added. The realtek-poe package at one point replaced a lua-rs232 based script and some devices were not updated to use the realtek-poe package. Consistently add realtek-poe package to DEVICE_PACKAGES for switches with supported PoE. Signed-off-by: Raylynn Knight --- .../realtek/base-files/etc/board.d/02_network | 13 +++++++++++++ target/linux/realtek/image/rtl838x.mk | 14 ++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/target/linux/realtek/base-files/etc/board.d/02_network b/target/linux/realtek/base-files/etc/board.d/02_network index a8579ea275..4a5fe7666c 100644 --- a/target/linux/realtek/base-files/etc/board.d/02_network +++ b/target/linux/realtek/base-files/etc/board.d/02_network @@ -69,6 +69,19 @@ done [ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac case $board in +d-link,dgs-1210-10mp-f) + ucidef_set_poe 130 "$lan_list" "lan9 lan10" + ;; +d-link,dgs-1210-10p) + ucidef_set_poe 65 "$lan_list" "lan9 lan10" + ;; +d-link,dgs-1210-28mp-f) + ucidef_set_poe 370 "lan8 lan7 lan6 lan5 lan4 lan3 lan2 lan1 lan16 lan15 lan14 lan13 lan12 lan11 lan10 lan9 lan24 lan23 + lan22 lan21 lan20 lan19 lan18 lan17" "lan25 lan26 lan27 lan28" + ;; +engenius,ews2910p) + ucidef_set_poe 60 "$lan_list" "lan9 lan10" + ;; hpe,1920-8g-poe-65w) ucidef_set_poe 65 "$lan_list_rev" "lan9 lan10" ;; diff --git a/target/linux/realtek/image/rtl838x.mk b/target/linux/realtek/image/rtl838x.mk index de98954284..9a9a310713 100644 --- a/target/linux/realtek/image/rtl838x.mk +++ b/target/linux/realtek/image/rtl838x.mk @@ -41,7 +41,7 @@ define Device/d-link_dgs-1210-10p $(Device/d-link_dgs-1210) SOC := rtl8382 DEVICE_MODEL := DGS-1210-10P - DEVICE_PACKAGES += lua-rs232 + DEVICE_PACKAGES += realtek-poe endef TARGET_DEVICES += d-link_dgs-1210-10p @@ -82,6 +82,7 @@ define Device/engenius_ews2910p IMAGE_SIZE := 8192k DEVICE_VENDOR := EnGenius DEVICE_MODEL := EWS2910P + DEVICE_PACKAGES += realtek-poe UIMAGE_MAGIC := 0x03802910 KERNEL_INITRAMFS := \ kernel-bin | \ @@ -112,6 +113,7 @@ define Device/hpe_1920-8g-poe-180w $(Device/hpe_1920) SOC := rtl8380 DEVICE_MODEL := 1920-8G-PoE+ 180W (JG922A) + DEVICE_PACKAGES += realtek-poe H3C_DEVICE_ID := 0x00010025 SUPPORTED_DEVICES += hpe_1920-8g-poe endef @@ -180,6 +182,7 @@ define Device/netgear_gs110tpp-v1 $(Device/netgear_nge) DEVICE_MODEL := GS110TPP DEVICE_VARIANT := v1 + DEVICE_PACKAGES += realtek-poe endef TARGET_DEVICES += netgear_gs110tpp-v1 @@ -196,7 +199,7 @@ define Device/netgear_gs310tp-v1 DEVICE_MODEL := GS310TP DEVICE_VARIANT := v1 UIMAGE_MAGIC := 0x4e474335 - DEVICE_PACKAGES += lua-rs232 + DEVICE_PACKAGES += realtek-poe endef TARGET_DEVICES += netgear_gs310tp-v1 @@ -267,6 +270,7 @@ define Device/zyxel_gs1900-10hp SOC := rtl8380 DEVICE_MODEL := GS1900-10HP ZYXEL_VERS := AAZI + DEVICE_PACKAGES += realtek-poe endef TARGET_DEVICES += zyxel_gs1900-10hp @@ -292,7 +296,7 @@ define Device/zyxel_gs1900-8hp-v1 DEVICE_MODEL := GS1900-8HP DEVICE_VARIANT := v1 ZYXEL_VERS := AAHI - DEVICE_PACKAGES += lua-rs232 + DEVICE_PACKAGES += realtek-poe endef TARGET_DEVICES += zyxel_gs1900-8hp-v1 @@ -302,7 +306,7 @@ define Device/zyxel_gs1900-8hp-v2 DEVICE_MODEL := GS1900-8HP DEVICE_VARIANT := v2 ZYXEL_VERS := AAHI - DEVICE_PACKAGES += lua-rs232 + DEVICE_PACKAGES += realtek-poe endef TARGET_DEVICES += zyxel_gs1900-8hp-v2 @@ -329,6 +333,7 @@ define Device/zyxel_gs1900-24hp-v1 DEVICE_MODEL := GS1900-24HP DEVICE_VARIANT := v1 ZYXEL_VERS := AAHM + DEVICE_PACKAGES += realtek-poe endef TARGET_DEVICES += zyxel_gs1900-24hp-v1 @@ -338,5 +343,6 @@ define Device/zyxel_gs1900-24hp-v2 DEVICE_MODEL := GS1900-24HP DEVICE_VARIANT := v2 ZYXEL_VERS := ABTP + DEVICE_PACKAGES += realtek-poe endef TARGET_DEVICES += zyxel_gs1900-24hp-v2 From c22aa0be3e2df4d46010fa57a1004c17c1288781 Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Sat, 3 Jun 2023 23:20:13 +0800 Subject: [PATCH 10/14] ipq807x: add support for ZTE MF269 Hardware specifications: SoC: Qualcomm IPQ8071A RAM: 512MB of DDR3 Flash1: Eon EN25S64 8MB Flash2: MX30UF2G18AC 256MB Ethernet: 2x 2.5G RJ45 port Phone: 1x RJ11 port (SPI) USB: 1x Type-C 2.0 port WiFi1: QCN5024 2.4GHz WiFi2: QCN5054 5GHz Button: Reset, WPS Flash instructions: 1. Connect the router via serial port (115200 8N1 1.8V) 2. Download the initramfs image, rename it to initramfs.bin, and host it with the tftp server. 3. Interrupt U-Boot and run these commands: tftpboot initramfs.bin bootm 4. After openwrt boots up, use scp or luci web to upload sysupgrade.bin to upgrade. Signed-off-by: Chukun Pan Reviewed-by: Robert Marko --- package/firmware/ipq-wifi/Makefile | 2 + .../arm64/boot/dts/qcom/ipq8071-mf269.dts | 448 ++++++++++++++++++ target/linux/qualcommax/image/ipq807x.mk | 14 + .../ipq807x/base-files/etc/board.d/02_network | 3 +- .../etc/hotplug.d/firmware/11-ath11k-caldata | 1 + .../etc/hotplug.d/ieee80211/11_fix_wifi_mac | 4 + .../base-files/lib/upgrade/platform.sh | 5 + 7 files changed, 476 insertions(+), 1 deletion(-) create mode 100644 target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-mf269.dts diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index cbd61c5be8..ef1a456403 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -46,6 +46,7 @@ ALLWIFIBOARDS:= \ xiaomi_ax9000 \ yyets_le1 \ yuncore_ax880 \ + zte_mf269 \ zte_mf289f \ zte_mf287 \ zte_mf287plus \ @@ -155,6 +156,7 @@ $(eval $(call generate-ipq-wifi-package,xiaomi_ax3600,Xiaomi AX3600)) $(eval $(call generate-ipq-wifi-package,xiaomi_ax9000,Xiaomi AX9000)) $(eval $(call generate-ipq-wifi-package,yyets_le1,YYeTs LE1)) $(eval $(call generate-ipq-wifi-package,yuncore_ax880,Yuncore AX880)) +$(eval $(call generate-ipq-wifi-package,zte_mf269,ZTE MF269)) $(eval $(call generate-ipq-wifi-package,zte_mf289f,ZTE MF289F)) $(eval $(call generate-ipq-wifi-package,zte_mf287,ZTE MF287)) $(eval $(call generate-ipq-wifi-package,zte_mf287plus,ZTE MF287Plus)) diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-mf269.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-mf269.dts new file mode 100644 index 0000000000..8b055800e1 --- /dev/null +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-mf269.dts @@ -0,0 +1,448 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include "ipq8074-512m.dtsi" +#include "ipq8074-ac-cpu.dtsi" +#include "ipq8074-ess.dtsi" +#include +#include + +/ { + model = "ZTE MF269"; + compatible = "zte,mf269", "qcom,ipq8074"; + + aliases { + serial0 = &blsp1_uart5; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = &dp6_syn; + }; + + chosen { + stdout-path = "serial0:115200n8"; + bootargs-append = " root=/dev/ubiblock0_0"; + }; + + keys { + compatible = "gpio-keys"; + pinctrl-0 = <&button_pins>; + pinctrl-names = "default"; + + wps { + label = "wps"; + linux,code = ; + gpios = <&tlmm 37 GPIO_ACTIVE_LOW>; + }; + + reset { + label = "reset"; + linux,code = ; + gpios = <&tlmm 46 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "white:power"; + gpio = <&tlmm 56 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&tlmm { + button_pins: button_pins { + mux { + pins = "gpio37", "gpio46"; + function = "gpio"; + drive-strength = <8>; + bias-pull-up; + }; + }; + + i2c_pins: i2c-pins { + pins = "gpio21", "gpio22"; + function = "blsp4_i2c1"; + drive-strength = <8>; + bias-disable; + }; + + mdio_pins: mdio-pins { + mdc { + pins = "gpio68"; + function = "mdc"; + drive-strength = <8>; + bias-pull-up; + }; + + mdio { + pins = "gpio69"; + function = "mdio"; + drive-strength = <8>; + bias-pull-up; + }; + }; + + usb_pwr_pins: usb_pwr_pins { + mux { + pins = "gpio29"; + function = "gpio"; + drive-strength = <8>; + bias-disable; + output-high; + }; + }; +}; + +&blsp1_spi1 { + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + cs-select = <0>; + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "0:sbl1"; + reg = <0x0 0x50000>; + read-only; + }; + + partition@50000 { + label = "0:mibib"; + reg = <0x50000 0x10000>; + read-only; + }; + + partition@60000 { + label = "0:bootconfig"; + reg = <0x60000 0x20000>; + read-only; + }; + + partition@80000 { + label = "0:bootconfig1"; + reg = <0x80000 0x20000>; + read-only; + }; + + partition@a0000 { + label = "0:qsee"; + reg = <0xa0000 0x180000>; + read-only; + }; + + partition@220000 { + label = "0:qsee_1"; + reg = <0x220000 0x180000>; + read-only; + }; + + partition@3a0000 { + label = "0:devcfg"; + reg = <0x3a0000 0x10000>; + read-only; + }; + + partition@3b0000 { + label = "0:devcfg_1"; + reg = <0x3b0000 0x10000>; + read-only; + }; + + partition@3c0000 { + label = "0:apdp"; + reg = <0x3c0000 0x10000>; + read-only; + }; + + partition@3d0000 { + label = "0:apdp_1"; + reg = <0x3d0000 0x10000>; + read-only; + }; + + partition@3e0000 { + label = "0:rpm"; + reg = <0x3e0000 0x40000>; + read-only; + }; + + partition@420000 { + label = "0:rpm_1"; + reg = <0x420000 0x40000>; + read-only; + }; + + partition@460000 { + label = "0:cdt"; + reg = <0x460000 0x10000>; + read-only; + }; + + partition@470000 { + label = "0:cdt_1"; + reg = <0x470000 0x10000>; + read-only; + }; + + partition@480000 { + label = "0:appsblenv"; + reg = <0x480000 0x10000>; + }; + + partition@490000 { + label = "0:appsbl"; + reg = <0x490000 0xc0000>; + read-only; + }; + + partition@550000 { + label = "0:appsbl_1"; + reg = <0x550000 0xc0000>; + read-only; + }; + + partition@610000 { + label = "0:art"; + reg = <0x610000 0x40000>; + read-only; + }; + + partition@650000 { + label = "0:ethphyfw"; + reg = <0x650000 0x80000>; + read-only; + }; + }; + }; +}; + +&blsp1_i2c5 { + pinctrl-0 = <&i2c_pins>; + pinctrl-names = "default"; + status = "okay"; + + /* No driver exists */ + aw9106: gpio-expander@5b { + reg = <0x5b>; + reset-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>; + }; +}; + +&blsp1_uart5 { + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&crypto { + status = "okay"; +}; + +&prng { + status = "okay"; +}; + +&qpic_bam { + status = "okay"; +}; + +&qpic_nand { + status = "okay"; + + /* + * Bootloader will find the NAND DT node by the compatible and + * then "fixup" it by adding the partitions from the SMEM table + * using the legacy bindings thus making it impossible for us + * to change the partition table or utilize NVMEM for calibration. + * So add a dummy partitions node that bootloader will populate + * and set it as disabled so the kernel ignores it instead of + * printing warnings due to the broken way bootloader adds the + * partitions. + */ + partitions { + status = "disabled"; + }; + + nand@0 { + reg = <0>; + nand-ecc-strength = <4>; + nand-ecc-step-size = <512>; + nand-bus-width = <8>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "fota-flag"; + reg = <0x0000000 0x00a0000>; + read-only; + }; + + partition@a0000 { + label = "mac"; + reg = <0x00a0000 0x0080000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_mac_0: macaddr@0 { + compatible = "mac-base"; + reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@120000 { + label = "cfg-param"; + reg = <0x0120000 0x1400000>; + read-only; + }; + + partition@1520000 { + label = "log"; + reg = <0x1520000 0x0600000>; + read-only; + }; + + partition@1b20000 { + label = "oops"; + reg = <0x1b20000 0x00a0000>; + read-only; + }; + + partition@1bc0000 { + label = "web"; + reg = <0x1bc0000 0x0800000>; + read-only; + }; + + partition@23c0000 { + label = "ubi_kernel"; + reg = <0x23c0000 0x3400000>; + }; + + partition@57c0000 { + label = "0:wififw"; + reg = <0x57c0000 0x0800000>; + read-only; + }; + + /* rootfs partition is the result of squashing + * consecutive stock partitions: + * - openwrt_data (25 MiB) + * - data (30 MiB) + * - fota (99 MiB) + */ + partition@5fc0000 { + label = "rootfs"; + reg = <0x5fc0000 0x9a00000>; + }; + }; + }; +}; + +&qusb_phy_0 { + status = "okay"; +}; + +&ssphy_0 { + status = "okay"; +}; + +&usb_0 { + pinctrl-0 = <&usb_pwr_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&mdio { + status = "okay"; + + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + + qca8081_24: ethernet-phy@24 { + compatible = "ethernet-phy-id004d.d101"; + reg = <24>; + reset-gpios = <&tlmm 25 GPIO_ACTIVE_LOW>; + }; + + qca8081_28: ethernet-phy@28 { + compatible = "ethernet-phy-id004d.d101"; + reg = <28>; + reset-gpios = <&tlmm 44 GPIO_ACTIVE_LOW>; + }; +}; + +&switch { + status = "okay"; + + switch_lan_bmp = ; /* lan port bitmap */ + switch_wan_bmp = ; /* wan port bitmap */ + switch_mac_mode1 = ; /* mac mode for uniphy instance1*/ + switch_mac_mode2 = ; /* mac mode for uniphy instance2*/ + + qcom,port_phyinfo { + port@5 { + port_id = <5>; + phy_address = <24>; + port_mac_sel = "QGMAC_PORT"; + }; + port@6 { + port_id = <6>; + phy_address = <28>; + port_mac_sel = "QGMAC_PORT"; + }; + }; +}; + +&edma { + status = "okay"; +}; + +&dp5_syn { + status = "okay"; + phy-handle = <&qca8081_24>; + label = "lan"; + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_mac_0 1>; +}; + +&dp6_syn { + status = "okay"; + phy-handle = <&qca8081_28>; + label = "wan"; + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_mac_0 0>; +}; + +&wifi { + status = "okay"; + + qcom,ath11k-calibration-variant = "ZTE-MF269"; + qcom,ath11k-fw-memory-mode = <1>; +}; diff --git a/target/linux/qualcommax/image/ipq807x.mk b/target/linux/qualcommax/image/ipq807x.mk index ce4d62d571..d8416d10fb 100644 --- a/target/linux/qualcommax/image/ipq807x.mk +++ b/target/linux/qualcommax/image/ipq807x.mk @@ -271,6 +271,20 @@ define Device/yuncore_ax880 endef TARGET_DEVICES += yuncore_ax880 +define Device/zte_mf269 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := ZTE + DEVICE_MODEL := MF269 + BLOCKSIZE := 128k + PAGESIZE := 2048 + DEVICE_DTS_CONFIG := config@ac04 + SOC := ipq8071 + KERNEL_SIZE := 53248k + DEVICE_PACKAGES := ipq-wifi-zte_mf269 +endef +TARGET_DEVICES += zte_mf269 + define Device/zyxel_nbg7815 $(call Device/FitImage) $(call Device/EmmcImage) diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network index cb70b27283..5da17db3fa 100644 --- a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network +++ b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network @@ -23,7 +23,8 @@ ipq807x_setup_interfaces() ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan" ;; edgecore,eap102|\ - yuncore,ax880) + yuncore,ax880|\ + zte,mf269) ucidef_set_interfaces_lan_wan "lan" "wan" ;; edimax,cax1800) diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata index e14af79598..ac1405739d 100644 --- a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata +++ b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata @@ -24,6 +24,7 @@ case "$FIRMWARE" in xiaomi,ax3600|\ xiaomi,ax9000|\ yuncore,ax880|\ + zte,mf269|\ zyxel,nbg7815) caldata_extract "0:art" 0x1000 0x20000 ;; diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index c7cacc99fe..3573942c54 100644 --- a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -14,4 +14,8 @@ case "$board" in [ "$PHYNBR" = "0" ] && macaddr_add $(get_mac_label) 1 > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && macaddr_add $(get_mac_label) 2 > /sys${DEVPATH}/macaddress ;; + zte,mf269) + [ "$PHYNBR" = "0" ] && macaddr_add $(get_mac_label) 2 > /sys${DEVPATH}/macaddress + [ "$PHYNBR" = "1" ] && macaddr_add $(get_mac_label) 3 > /sys${DEVPATH}/macaddress + ;; esac diff --git a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh index 5a40d53883..67fd0f5402 100644 --- a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh +++ b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh @@ -110,6 +110,11 @@ platform_do_upgrade() { fw_setenv upgrade_available 1 nand_do_upgrade "$1" ;; + zte,mf269) + CI_KERN_UBIPART="ubi_kernel" + CI_ROOT_UBIPART="rootfs" + nand_do_upgrade "$1" + ;; zyxel,nbg7815) local config_mtdnum="$(find_mtd_index 0:bootconfig)" [ -z "$config_mtdnum" ] && reboot From a14240d384af3454598dae4c582f264ddda86e2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Fri, 15 Dec 2023 11:43:08 +0100 Subject: [PATCH 11/14] kernel: backport list_count_nodes() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's needed by various stuff we backport. That includes NVMEM changes queued for v6.8. Signed-off-by: Rafał Miłecki --- package/kernel/mac80211/Makefile | 2 +- ...list-don-t-backport-list_count_nodes.patch | 26 +++++++ ...ount-to-list.h-as-list_count_nodes-f.patch | 75 +++++++++++++++++++ ...ount-to-list.h-as-list_count_nodes-f.patch | 73 ++++++++++++++++++ 4 files changed, 175 insertions(+), 1 deletion(-) create mode 100644 package/kernel/mac80211/patches/build/220-list-don-t-backport-list_count_nodes.patch create mode 100644 target/linux/generic/backport-5.15/829-v6.3-i915-Move-list_count-to-list.h-as-list_count_nodes-f.patch create mode 100644 target/linux/generic/backport-6.1/810-v6.3-i915-Move-list_count-to-list.h-as-list_count_nodes-f.patch diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index c9e2a37f6d..17e0d9451e 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 PKG_VERSION:=6.5 -PKG_RELEASE:=1 +PKG_RELEASE:=2 # PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.15.58/ PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/ PKG_HASH:=908c22dceba185eab83caa5a1e58ce6b3ebdc58f099c3fd3e11c7352ebfab2d7 diff --git a/package/kernel/mac80211/patches/build/220-list-don-t-backport-list_count_nodes.patch b/package/kernel/mac80211/patches/build/220-list-don-t-backport-list_count_nodes.patch new file mode 100644 index 0000000000..6d3000278b --- /dev/null +++ b/package/kernel/mac80211/patches/build/220-list-don-t-backport-list_count_nodes.patch @@ -0,0 +1,26 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Fri, 15 Dec 2023 10:17:21 +0100 +Subject: [PATCH] list: don't backport list_count_nodes() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +It's redundant in OpenWrt as it backports it on its own. This fixes: +backport-include/linux/list.h:11:22: error: redefinition of 'list_count_nodes' + +Signed-off-by: Rafał Miłecki +--- + backport-include/linux/list.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/backport-include/linux/list.h ++++ b/backport-include/linux/list.h +@@ -3,7 +3,7 @@ + #include_next + #include + +-#if LINUX_VERSION_IS_LESS(6,3,0) ++#if 0 /* OpenWrt backports list_count_nodes() on its own */ + /** + * list_count_nodes - count nodes in the list + * @head: the head for your list. diff --git a/target/linux/generic/backport-5.15/829-v6.3-i915-Move-list_count-to-list.h-as-list_count_nodes-f.patch b/target/linux/generic/backport-5.15/829-v6.3-i915-Move-list_count-to-list.h-as-list_count_nodes-f.patch new file mode 100644 index 0000000000..1365834563 --- /dev/null +++ b/target/linux/generic/backport-5.15/829-v6.3-i915-Move-list_count-to-list.h-as-list_count_nodes-f.patch @@ -0,0 +1,75 @@ +From 4d70c74659d9746502b23d055dba03d1d28ec388 Mon Sep 17 00:00:00 2001 +From: Andy Shevchenko +Date: Wed, 30 Nov 2022 15:48:35 +0200 +Subject: [PATCH] i915: Move list_count() to list.h as list_count_nodes() for + broader use + +Some of the existing users, and definitely will be new ones, want to +count existing nodes in the list. Provide a generic API for that by +moving code from i915 to list.h. + +Reviewed-by: Lucas De Marchi +Acked-by: Jani Nikula +Signed-off-by: Andy Shevchenko +Link: https://lore.kernel.org/r/20221130134838.23805-1-andriy.shevchenko@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/i915/gt/intel_engine_cs.c | 15 ++------------- + include/linux/list.h | 15 +++++++++++++++ + 2 files changed, 17 insertions(+), 13 deletions(-) + +--- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c ++++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c +@@ -1639,17 +1639,6 @@ static void print_request_ring(struct dr + } + } + +-static unsigned long list_count(struct list_head *list) +-{ +- struct list_head *pos; +- unsigned long count = 0; +- +- list_for_each(pos, list) +- count++; +- +- return count; +-} +- + static unsigned long read_ul(void *p, size_t x) + { + return *(unsigned long *)(p + x); +@@ -1824,8 +1813,8 @@ void intel_engine_dump(struct intel_engi + spin_lock_irqsave(&engine->sched_engine->lock, flags); + engine_dump_active_requests(engine, m); + +- drm_printf(m, "\tOn hold?: %lu\n", +- list_count(&engine->sched_engine->hold)); ++ drm_printf(m, "\tOn hold?: %zu\n", ++ list_count_nodes(&engine->sched_engine->hold)); + spin_unlock_irqrestore(&engine->sched_engine->lock, flags); + + drm_printf(m, "\tMMIO base: 0x%08x\n", engine->mmio_base); +--- a/include/linux/list.h ++++ b/include/linux/list.h +@@ -628,6 +628,21 @@ static inline void list_splice_tail_init + pos = n, n = pos->prev) + + /** ++ * list_count_nodes - count nodes in the list ++ * @head: the head for your list. ++ */ ++static inline size_t list_count_nodes(struct list_head *head) ++{ ++ struct list_head *pos; ++ size_t count = 0; ++ ++ list_for_each(pos, head) ++ count++; ++ ++ return count; ++} ++ ++/** + * list_entry_is_head - test if the entry points to the head of the list + * @pos: the type * to cursor + * @head: the head for your list. diff --git a/target/linux/generic/backport-6.1/810-v6.3-i915-Move-list_count-to-list.h-as-list_count_nodes-f.patch b/target/linux/generic/backport-6.1/810-v6.3-i915-Move-list_count-to-list.h-as-list_count_nodes-f.patch new file mode 100644 index 0000000000..95dca93dd9 --- /dev/null +++ b/target/linux/generic/backport-6.1/810-v6.3-i915-Move-list_count-to-list.h-as-list_count_nodes-f.patch @@ -0,0 +1,73 @@ +From 4d70c74659d9746502b23d055dba03d1d28ec388 Mon Sep 17 00:00:00 2001 +From: Andy Shevchenko +Date: Wed, 30 Nov 2022 15:48:35 +0200 +Subject: [PATCH] i915: Move list_count() to list.h as list_count_nodes() for + broader use + +Some of the existing users, and definitely will be new ones, want to +count existing nodes in the list. Provide a generic API for that by +moving code from i915 to list.h. + +Reviewed-by: Lucas De Marchi +Acked-by: Jani Nikula +Signed-off-by: Andy Shevchenko +Link: https://lore.kernel.org/r/20221130134838.23805-1-andriy.shevchenko@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/i915/gt/intel_engine_cs.c | 15 ++------------- + include/linux/list.h | 15 +++++++++++++++ + 2 files changed, 17 insertions(+), 13 deletions(-) + +--- a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c ++++ b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c +@@ -4154,17 +4154,6 @@ void intel_execlists_show_requests(struc + spin_unlock_irqrestore(&sched_engine->lock, flags); + } + +-static unsigned long list_count(struct list_head *list) +-{ +- struct list_head *pos; +- unsigned long count = 0; +- +- list_for_each(pos, list) +- count++; +- +- return count; +-} +- + void intel_execlists_dump_active_requests(struct intel_engine_cs *engine, + struct i915_request *hung_rq, + struct drm_printer *m) +@@ -4176,7 +4165,7 @@ void intel_execlists_dump_active_request + intel_engine_dump_active_requests(&engine->sched_engine->requests, hung_rq, m); + + drm_printf(m, "\tOn hold?: %lu\n", +- list_count(&engine->sched_engine->hold)); ++ list_count_nodes(&engine->sched_engine->hold)); + + spin_unlock_irqrestore(&engine->sched_engine->lock, flags); + } +--- a/include/linux/list.h ++++ b/include/linux/list.h +@@ -656,6 +656,21 @@ static inline void list_splice_tail_init + pos = n, n = pos->prev) + + /** ++ * list_count_nodes - count nodes in the list ++ * @head: the head for your list. ++ */ ++static inline size_t list_count_nodes(struct list_head *head) ++{ ++ struct list_head *pos; ++ size_t count = 0; ++ ++ list_for_each(pos, head) ++ count++; ++ ++ return count; ++} ++ ++/** + * list_entry_is_head - test if the entry points to the head of the list + * @pos: the type * to cursor + * @head: the head for your list. From 5b14a352d9123a910a96ab94f0fecce7204d279d Mon Sep 17 00:00:00 2001 From: Pawel Dembicki Date: Fri, 8 Dec 2023 09:32:41 +0100 Subject: [PATCH 12/14] kirkwood: backport fix Ctera C200 V1 ubi part name to 6.1 From the original Patch: |In 749237967a12 downstream dts was replaced with upstream accepted |patch. But in upstream version last partition was called "rootfs" |instead "ubi". OpenWrt require "ubi" label for ubi rootfs. |This patch restore proper label. | |Fixes: 749237967a12 ("kirkwood: Replace dtses with upstream accepted") | |Signed-off-by: Pawel Dembicki (patch updated to include 6.1, dropped label properties) Signed-off-by: Christian Lamparter --- .../kirkwood/patches-6.1/114-ctera-c-200-v1.patch | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/target/linux/kirkwood/patches-6.1/114-ctera-c-200-v1.patch b/target/linux/kirkwood/patches-6.1/114-ctera-c-200-v1.patch index 23922b8d88..eb62e1a5ed 100644 --- a/target/linux/kirkwood/patches-6.1/114-ctera-c-200-v1.patch +++ b/target/linux/kirkwood/patches-6.1/114-ctera-c-200-v1.patch @@ -31,13 +31,12 @@ }; led-3 { -@@ -94,13 +104,15 @@ +@@ -94,13 +104,13 @@ gpios = <&gpio0 17 GPIO_ACTIVE_LOW>; }; - led-4 { + led_status_red: led-4 { -+ label = "red:status"; function = LED_FUNCTION_STATUS; color = ; gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; @@ -45,7 +44,15 @@ - led-5 { + led_status_green: led-5 { -+ label = "green:status"; function = LED_FUNCTION_STATUS; color = ; gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; +@@ -240,7 +250,7 @@ + }; + + partition@7a00000 { +- label = "rootfs"; ++ label = "ubi"; + reg = <0x7a00000 0x8600000>; + }; + }; From 314af7018a08a5a193b53848c9cd6a94f30a0055 Mon Sep 17 00:00:00 2001 From: Furong Xu Date: Wed, 13 Dec 2023 13:43:43 +0800 Subject: [PATCH 13/14] rockchip: make SMP affinity of RTL8152 on XHCI more robust XHCI bus numbers are assigned dynamically, it may varies among boards, match the device irq name with regexp, drop the hardcoded name. Signed-off-by: Furong Xu --- .../armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity b/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity index fc181dff46..09fc420fec 100644 --- a/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity +++ b/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity @@ -9,7 +9,7 @@ get_device_irq() { # wait up to 10 seconds for the irq/device to appear while [ "${seconds}" -le 10 ]; do - line=$(grep -m 1 "${device}\$" /proc/interrupts) && break + line=$(grep -E -m 1 "${device}\$" /proc/interrupts) && break seconds="$(( seconds + 2 ))" sleep 2 done @@ -34,7 +34,7 @@ friendlyarm,nanopi-r2s|\ xunlong,orangepi-r1-plus|\ xunlong,orangepi-r1-plus-lts) set_interface_core 2 "eth0" - set_interface_core 4 "eth1" "xhci-hcd:usb1" + set_interface_core 4 "eth1" "xhci-hcd:usb[0-9]+" ;; friendlyarm,nanopi-r4s) set_interface_core 10 "eth0" From 85f59c8e271f917835f1b97ab8afc8c7f148236f Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Fri, 15 Dec 2023 16:02:19 +0100 Subject: [PATCH 14/14] generic: 6.1: fix list_count_nodes backport patch Commit 25746a3fa2da ("drm/i915: fix up merge with usb-next branch") was internally applied to the 5.15 patch but wasn0t applied to the backport for kernel 6.1. Apply the same treatement also there to fix compilation warning. Fixes: a14240d384af ("kernel: backport list_count_nodes()") Signed-off-by: Christian Marangi --- ...15-Move-list_count-to-list.h-as-list_count_nodes-f.patch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/linux/generic/backport-6.1/810-v6.3-i915-Move-list_count-to-list.h-as-list_count_nodes-f.patch b/target/linux/generic/backport-6.1/810-v6.3-i915-Move-list_count-to-list.h-as-list_count_nodes-f.patch index 95dca93dd9..60a90136c9 100644 --- a/target/linux/generic/backport-6.1/810-v6.3-i915-Move-list_count-to-list.h-as-list_count_nodes-f.patch +++ b/target/linux/generic/backport-6.1/810-v6.3-i915-Move-list_count-to-list.h-as-list_count_nodes-f.patch @@ -38,11 +38,13 @@ Signed-off-by: Greg Kroah-Hartman void intel_execlists_dump_active_requests(struct intel_engine_cs *engine, struct i915_request *hung_rq, struct drm_printer *m) -@@ -4176,7 +4165,7 @@ void intel_execlists_dump_active_request +@@ -4175,8 +4164,8 @@ void intel_execlists_dump_active_request + intel_engine_dump_active_requests(&engine->sched_engine->requests, hung_rq, m); - drm_printf(m, "\tOn hold?: %lu\n", +- drm_printf(m, "\tOn hold?: %lu\n", - list_count(&engine->sched_engine->hold)); ++ drm_printf(m, "\tOn hold?: %zu\n", + list_count_nodes(&engine->sched_engine->hold)); spin_unlock_irqrestore(&engine->sched_engine->lock, flags);