From b522da5b16c7e5952d364b933b921786198f9fe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Thu, 15 Jun 2023 16:11:26 +0200 Subject: [PATCH 01/12] scan.mk: do not silence output of dump phase MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make it easier to spot currently hidden issues: $ make defconfig V=sc ... Collecting target info: target/linux/airohabash: -c: line 1: syntax error near unexpected token `|' bash: -c: line 1: `echo 1686815253 | staging_dir/host/bin/mkhash md5 | cut -b1-8' bash: -c: line 1: syntax error near unexpected token `|' bash: -c: line 1: `echo 1686815253 | staging_dir/host/bin/mkhash md5 | sed -E 's/(.{8})(.{4})(.{4})(.{4})(.{10})../\1-\2-\3-\4-\500/'' ... Signed-off-by: Petr Štetiar --- include/scan.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/scan.mk b/include/scan.mk index 33a5832ff5..2e0ee0c960 100644 --- a/include/scan.mk +++ b/include/scan.mk @@ -50,7 +50,8 @@ define PackageDir $$(call progress,Collecting $(SCAN_NAME) info: $(SCAN_DIR)/$(2)) \ echo Source-Makefile: $(SCAN_DIR)/$(2)/Makefile; \ $(if $(3),echo Override: $(3),true); \ - $(NO_TRACE_MAKE) --no-print-dir -r DUMP=1 FEED="$(call feedname,$(2))" -C $(SCAN_DIR)/$(2) $(SCAN_MAKEOPTS) 2>/dev/null || { \ + $(if $(findstring c,$(OPENWRT_VERBOSE)),$(MAKE),$(NO_TRACE_MAKE) --no-print-dir) -r DUMP=1 FEED="$(call feedname,$(2))" -C $(SCAN_DIR)/$(2) $(SCAN_MAKEOPTS) \ + $(if $(findstring c,$(OPENWRT_VERBOSE)),,2>/dev/null) || { \ mkdir -p "$(TOPDIR)/logs/$(SCAN_DIR)/$(2)"; \ $(NO_TRACE_MAKE) --no-print-dir -r DUMP=1 FEED="$(call feedname,$(2))" -C $(SCAN_DIR)/$(2) $(SCAN_MAKEOPTS) > $(TOPDIR)/logs/$(SCAN_DIR)/$(2)/dump.txt 2>&1; \ $$(call progress,ERROR: please fix $(SCAN_DIR)/$(2)/Makefile - see logs/$(SCAN_DIR)/$(2)/dump.txt for details\n) \ From 8fc496be860192f8bd1f16913657626014c8863f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Thu, 15 Jun 2023 16:11:27 +0200 Subject: [PATCH 02/12] treewide: fix shell errors during dump stage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes following issues: bash: -c: line 1: `echo 1686820180 | /staging_dir/host/bin/mkhash md5 | cut -b1-8' bash: -c: line 1: `echo 1686820180 | /staging_dir/host/bin/mkhash md5 | sed -E 's/(.{8})(.{4})(.{4})(.{4})(.{10})../\1-\2-\3-\4-\500/'' bash: -c: line 1: syntax error near unexpected token `|' bash: line 1: *1024*1024: syntax error: operand expected (error token is "*1024*1024") bash: line 1: (64 + ): syntax error: operand expected (error token is ")") expr: syntax error: missing argument after '+' Signed-off-by: Petr Štetiar --- include/image.mk | 4 ++++ target/linux/layerscape/image/Makefile | 3 +++ target/linux/mediatek/image/filogic.mk | 2 ++ target/linux/mediatek/image/mt7622.mk | 2 ++ target/linux/mediatek/image/mt7623.mk | 4 ++++ 5 files changed, 15 insertions(+) diff --git a/include/image.mk b/include/image.mk index 9736e4e164..4ebff2e9ae 100644 --- a/include/image.mk +++ b/include/image.mk @@ -40,8 +40,10 @@ IMG_PREFIX_VERCODE:=$(if $(CONFIG_VERSION_CODE_FILENAMES),$(call sanitize,$(VERS IMG_PREFIX:=$(VERSION_DIST_SANITIZED)-$(IMG_PREFIX_VERNUM)$(IMG_PREFIX_VERCODE)$(IMG_PREFIX_EXTRA)$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET)) IMG_ROOTFS:=$(IMG_PREFIX)-rootfs IMG_COMBINED:=$(IMG_PREFIX)-combined +ifeq ($(DUMP),) IMG_PART_SIGNATURE:=$(shell echo $(SOURCE_DATE_EPOCH)$(LINUX_VERMAGIC) | $(MKHASH) md5 | cut -b1-8) IMG_PART_DISKGUID:=$(shell echo $(SOURCE_DATE_EPOCH)$(LINUX_VERMAGIC) | $(MKHASH) md5 | sed -E 's/(.{8})(.{4})(.{4})(.{4})(.{10})../\1-\2-\3-\4-\500/') +endif MKFS_DEVTABLE_OPT := -D $(INCLUDE_DIR)/device_table.txt @@ -167,7 +169,9 @@ define Image/pad-to mv $(1).new $(1) endef +ifeq ($(DUMP),) ROOTFS_PARTSIZE=$(shell echo $$(($(CONFIG_TARGET_ROOTFS_PARTSIZE)*1024*1024))) +endif define Image/pad-root-squashfs $(call Image/pad-to,$(KDIR)/root.squashfs,$(if $(1),$(1),$(ROOTFS_PARTSIZE))) diff --git a/target/linux/layerscape/image/Makefile b/target/linux/layerscape/image/Makefile index dfbda85b36..f2ac9b6f04 100644 --- a/target/linux/layerscape/image/Makefile +++ b/target/linux/layerscape/image/Makefile @@ -8,8 +8,11 @@ include $(INCLUDE_DIR)/image.mk LS_SD_KERNELPART_SIZE = 40 LS_SD_KERNELPART_OFFSET = 16 LS_SD_ROOTFSPART_OFFSET = 64 + +ifeq ($(DUMP),) LS_SD_IMAGE_SIZE = $(shell echo $$((($(LS_SD_ROOTFSPART_OFFSET) + \ $(CONFIG_TARGET_ROOTFS_PARTSIZE))))) +endif # The limitation of flash sysupgrade.bin is 1MB dtb + 16MB kernel + 32MB rootfs LS_SYSUPGRADE_IMAGE_SIZE = 49m diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 4ce9b7f2ba..0ef3e94575 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -192,7 +192,9 @@ define Device/bananapi_bpi-r3 pad-to 64M | append-image squashfs-sysupgrade.itb | check-size |\ ) \ gzip +ifeq ($(DUMP),) IMAGE_SIZE := $$(shell expr 64 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m +endif KERNEL := kernel-bin | gzip KERNEL_INITRAMFS := kernel-bin | lzma | \ fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k diff --git a/target/linux/mediatek/image/mt7622.mk b/target/linux/mediatek/image/mt7622.mk index 85776ef6d9..e362e7428b 100644 --- a/target/linux/mediatek/image/mt7622.mk +++ b/target/linux/mediatek/image/mt7622.mk @@ -107,7 +107,9 @@ define Device/bananapi_bpi-r64 pad-to 46080k | append-image squashfs-sysupgrade.itb | check-size |\ ) \ gzip +ifeq ($(DUMP),) IMAGE_SIZE := $$(shell expr 45 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m +endif 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 diff --git a/target/linux/mediatek/image/mt7623.mk b/target/linux/mediatek/image/mt7623.mk index 5828c4d763..2c4402da66 100644 --- a/target/linux/mediatek/image/mt7623.mk +++ b/target/linux/mediatek/image/mt7623.mk @@ -96,7 +96,9 @@ define Device/bananapi_bpi-r2 KERNEL := kernel-bin | gzip KERNEL_INITRAMFS_SUFFIX := -recovery.itb KERNEL_INITRAMFS := kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb with-initrd +ifeq ($(DUMP),) IMAGE_SIZE := $$(shell expr 48 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m +endif IMAGE/sysupgrade.itb := append-kernel | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb external-static-with-rootfs | append-metadata ARTIFACT/preloader.bin := mt7623-mbr emmc |\ pad-to 2k | append-preloader $$(UBOOT_TARGET) @@ -130,7 +132,9 @@ define Device/unielec_u7623-02 UBOOT_TARGET := mt7623a_unielec_u7623 UBOOT_IMAGE := u-boot-mtk.bin UBOOT_PATH := $(STAGING_DIR_IMAGE)/$$(UBOOT_TARGET)-$$(UBOOT_IMAGE) +ifeq ($(DUMP),) IMAGE_SIZE := $$(shell expr 48 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m +endif IMAGES := sysupgrade.itb KERNEL := kernel-bin | gzip KERNEL_INITRAMFS_SUFFIX := -recovery.itb From 9b4628eaee74632120a3647f49cee3b7cc047ee7 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 12 Nov 2023 20:23:19 +0100 Subject: [PATCH 03/12] Revert "qca-ssdk: fix unsupported scenario with PORT1 not declared in switch bmp" This reverts commit 8cce00bc9dddc3fc47d63625b0f512693c27ce2f. The confusion was real and this change cause regression on other advanced devices that makes actual use of the first_phy_addr value. Signed-off-by: Christian Marangi --- package/kernel/qca-ssdk/Makefile | 2 +- ...ibu-phy-drop-usage-of-first_phy_addr.patch | 264 ------------------ 2 files changed, 1 insertion(+), 265 deletions(-) delete mode 100644 package/kernel/qca-ssdk/patches/100-malibu-phy-drop-usage-of-first_phy_addr.patch diff --git a/package/kernel/qca-ssdk/Makefile b/package/kernel/qca-ssdk/Makefile index 4107208c0e..f5d8260503 100644 --- a/package/kernel/qca-ssdk/Makefile +++ b/package/kernel/qca-ssdk/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=qca-ssdk -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/qca-ssdk.git PKG_SOURCE_PROTO:=git diff --git a/package/kernel/qca-ssdk/patches/100-malibu-phy-drop-usage-of-first_phy_addr.patch b/package/kernel/qca-ssdk/patches/100-malibu-phy-drop-usage-of-first_phy_addr.patch deleted file mode 100644 index 905f1cde01..0000000000 --- a/package/kernel/qca-ssdk/patches/100-malibu-phy-drop-usage-of-first_phy_addr.patch +++ /dev/null @@ -1,264 +0,0 @@ -From 46ed8163ac0d9a11a629f1c446e8c5e711cf35d6 Mon Sep 17 00:00:00 2001 -From: Christian Marangi -Date: Sat, 11 Nov 2023 18:13:02 +0100 -Subject: [PATCH] malibu-phy: drop usage of first_phy_addr - -I'm very confused by this and to me it's not clear the real usage of -this logic. - -From what I can see the usage of this is EXTREMELY FRAGILE and results -in dangerous results if the OEM (or anyone that by chance try to -implement things in a logical manner) deviates from the default values -from the "magical template". - -To be in more details. With QSDK 12.4, some tweaks were done to improve -autoneg and now on every call of port status, the phydev is tried to -add. This resulted in the call and log spam of an error with ports that -are actually not present on the system with qsdk reporting phydev is -NULL. This itself is not an error and printing the error is correct. - -What is actually an error from ages is setting generic bitmap reporting -presence of port that are actually not present. This is very common on -OEM where the switch_lan_bmp is always a variant of 0x1e (that on bitmap -results in PORT1 PORT2 PORT3 PORT4 present) or 0x3e (PORT1 PORT2 PORT3 -PORT4 PORT5). Reality is that many device are used as AP with one LAN -port or one WAN port. (or even exotic configuration with PORT1 not -present and PORT2 PORT3 PORT4 present (Xiaomi 3600) - -With this finding one can say... ok nice, then lets update the DT and -set the correct bitmap... - -Again world is a bad place and reality is that this cause wonderful -regression in some case of by extreme luck the first ever connected -port working and the rest of the switch dead. - -The problem has been bisected to all the device that doesn't have the -PORT1 declared in any of the bitmap. - -With this perfection in mind, on to the REAL problem. - -malibu_phy_hw_init FOR SOME REASON, set a global variable first_phy_addr -to the first detected PHY addr that coincidentally is always PORT1. -PORT1 addr is 0x0. The entire code in malibu_phy use this variable to -derive the phy addrs in some function. - -Declaring a bitmap where the PORT1 is missing (or worse PORT4 the only -one connected) result in first_phy_addr set to 1 or whatever phy addr is -detected first setting wrong value all over the init stage. - -To fix this, just drop this variable and hardcode everything to assume -the first phy adrr is ALWAYS 0 and remove calculation and use define for -special case. - -With the following change normal switch traffic is restored and ports -function is recovered. - -Signed-off-by: Christian Marangi ---- - src/hsl/phy/malibu_phy.c | 63 +++++++++++++++++----------------------- - 1 file changed, 26 insertions(+), 37 deletions(-) - ---- a/src/hsl/phy/malibu_phy.c -+++ b/src/hsl/phy/malibu_phy.c -@@ -26,8 +26,9 @@ - #include "qcaphy_common.h" - #include "ssdk_plat.h" - --static a_uint32_t first_phy_addr = MAX_PHY_ADDR; - static a_uint32_t combo_phy_addr = MAX_PHY_ADDR; -+#define PORT4_PHY_ID 0x4 -+#define PORT5_PHY_ID 0x5 - #define COMBO_PHY_ID combo_phy_addr - - /****************************************************************************** -@@ -1250,10 +1251,10 @@ sw_error_t - malibu_phy_serdes_reset(a_uint32_t dev_id) - { - -- hsl_phy_mii_reg_write(dev_id, first_phy_addr + MALIBU_PHY_PSGMII_ADDR_INC, -+ hsl_phy_mii_reg_write(dev_id, MALIBU_PHY_PSGMII_ADDR_INC, - MALIBU_MODE_RESET_REG, MALIBU_MODE_CHANAGE_RESET); - mdelay(100); -- hsl_phy_mii_reg_write(dev_id, first_phy_addr + MALIBU_PHY_PSGMII_ADDR_INC, -+ hsl_phy_mii_reg_write(dev_id, MALIBU_PHY_PSGMII_ADDR_INC, - MALIBU_MODE_RESET_REG, MALIBU_MODE_RESET_DEFAULT_VALUE); - - return SW_OK; -@@ -1271,8 +1272,7 @@ malibu_phy_interface_set_mode(a_uint32_t - a_uint16_t phy_data = 0; - static fal_port_interface_mode_t phy_mode = PORT_INTERFACE_MODE_MAX; - -- if ((phy_addr < first_phy_addr) || -- (phy_addr > (first_phy_addr + MALIBU_PHY_MAX_ADDR_INC))) -+ if (phy_addr > MALIBU_PHY_MAX_ADDR_INC) - return SW_NOT_SUPPORTED; - /*if interface_mode have been configured, then no need to configure again*/ - if(phy_mode == interface_mode) -@@ -1295,20 +1295,19 @@ malibu_phy_interface_set_mode(a_uint32_t - return SW_BAD_PARAM; - } - -- hsl_phy_modify_mii(dev_id, -- first_phy_addr + MALIBU_PHY_MAX_ADDR_INC, MALIBU_PHY_CHIP_CONFIG, -+ hsl_phy_modify_mii(dev_id, MALIBU_PHY_MAX_ADDR_INC, MALIBU_PHY_CHIP_CONFIG, - BITS(0, 4), phy_data); - - /* reset operation */ - malibu_phy_serdes_reset(dev_id); - - if (interface_mode == PHY_PSGMII_FIBER) { -- hsl_phy_mii_reg_write(dev_id, first_phy_addr + MALIBU_PHY_MAX_ADDR_INC, -+ hsl_phy_mii_reg_write(dev_id, MALIBU_PHY_MAX_ADDR_INC, - MALIBU_PHY_CHIP_CONFIG, MALIBU_MODECTRL_DFLT); -- hsl_phy_mii_reg_write(dev_id, first_phy_addr + MALIBU_PHY_MAX_ADDR_INC, -+ hsl_phy_mii_reg_write(dev_id, MALIBU_PHY_MAX_ADDR_INC, - MALIBU_PHY_CONTROL, MALIBU_MIICTRL_DFLT); - hsl_phy_phydev_autoneg_update(dev_id, -- first_phy_addr + MALIBU_PHY_MAX_ADDR_INC, A_FALSE, 0); -+ MALIBU_PHY_MAX_ADDR_INC, A_FALSE, 0); - } - phy_mode = interface_mode; - SSDK_DEBUG("malibu phy is configured as phy_mode:0x%x\n", phy_mode); -@@ -1329,13 +1328,12 @@ malibu_phy_interface_get_mode(a_uint32_t - a_uint16_t phy_data; - a_uint16_t copper_mode; - -- if ((phy_addr < first_phy_addr) || -- (phy_addr > (first_phy_addr + MALIBU_PHY_MAX_ADDR_INC))) { -+ if (phy_addr > MALIBU_PHY_MAX_ADDR_INC) { - return SW_NOT_SUPPORTED; - } - - phy_data = hsl_phy_mii_reg_read(dev_id, -- first_phy_addr + MALIBU_PHY_MAX_ADDR_INC, MALIBU_PHY_CHIP_CONFIG); -+ MALIBU_PHY_MAX_ADDR_INC, MALIBU_PHY_CHIP_CONFIG); - copper_mode = ((phy_data & MALIBU_PHY_COPPER_MODE) >> 0xf); - phy_data &= 0x000f; - -@@ -1344,13 +1342,13 @@ malibu_phy_interface_get_mode(a_uint32_t - *interface_mode = PHY_PSGMII_BASET; - break; - case MALIBU_PHY_PSGMII_BX1000: -- if (phy_addr == first_phy_addr + MALIBU_PHY_MAX_ADDR_INC) -+ if (phy_addr == MALIBU_PHY_MAX_ADDR_INC) - *interface_mode = PHY_PSGMII_BX1000; - else - *interface_mode = PHY_PSGMII_BASET; - break; - case MALIBU_PHY_PSGMII_FX100: -- if (phy_addr == first_phy_addr + MALIBU_PHY_MAX_ADDR_INC) -+ if (phy_addr == MALIBU_PHY_MAX_ADDR_INC) - *interface_mode = PHY_PSGMII_FX100; - else - *interface_mode = PHY_PSGMII_BASET; -@@ -1359,14 +1357,14 @@ malibu_phy_interface_get_mode(a_uint32_t - if (copper_mode) { - *interface_mode = PHY_PSGMII_BASET; - } else { -- if (phy_addr == first_phy_addr + MALIBU_PHY_MAX_ADDR_INC) -+ if (phy_addr == MALIBU_PHY_MAX_ADDR_INC) - *interface_mode = PHY_PSGMII_FIBER; - else - *interface_mode = PHY_PSGMII_BASET; - } - break; - case MALIBU_PHY_SGMII_BASET: -- if (phy_addr == first_phy_addr + MALIBU_PHY_MAX_ADDR_INC) -+ if (phy_addr == MALIBU_PHY_MAX_ADDR_INC) - *interface_mode = PHY_SGMII_BASET; - else - *interface_mode = PORT_QSGMII; -@@ -1392,13 +1390,12 @@ malibu_phy_interface_get_mode_status(a_u - a_uint16_t phy_data, phy_mode, phy_mode_status; - a_uint16_t copper_mode; - -- if ((phy_addr < first_phy_addr) || -- (phy_addr > (first_phy_addr + MALIBU_PHY_MAX_ADDR_INC))) { -+ if (phy_addr > MALIBU_PHY_MAX_ADDR_INC) { - return SW_NOT_SUPPORTED; - } - - phy_data = hsl_phy_mii_reg_read(dev_id, -- first_phy_addr + MALIBU_PHY_MAX_ADDR_INC, MALIBU_PHY_CHIP_CONFIG); -+ MALIBU_PHY_MAX_ADDR_INC, MALIBU_PHY_CHIP_CONFIG); - copper_mode = ((phy_data & MALIBU_PHY_COPPER_MODE) >> 0xf); - phy_mode = phy_data & 0x000f; - phy_mode_status = (phy_data & 0x00f0) >> 0x4; -@@ -1407,7 +1404,7 @@ malibu_phy_interface_get_mode_status(a_u - if (copper_mode) { - *interface_mode_status = PHY_PSGMII_BASET; - } else { -- if (phy_addr == first_phy_addr + MALIBU_PHY_MAX_ADDR_INC) -+ if (phy_addr == MALIBU_PHY_MAX_ADDR_INC) - *interface_mode_status = PHY_PSGMII_FIBER; - else - *interface_mode_status = PHY_PSGMII_BASET; -@@ -1418,19 +1415,19 @@ malibu_phy_interface_get_mode_status(a_u - *interface_mode_status = PHY_PSGMII_BASET; - break; - case MALIBU_PHY_PSGMII_BX1000: -- if (phy_addr == first_phy_addr + MALIBU_PHY_MAX_ADDR_INC) -+ if (phy_addr == MALIBU_PHY_MAX_ADDR_INC) - *interface_mode_status = PHY_PSGMII_BX1000; - else - *interface_mode_status = PHY_PSGMII_BASET; - break; - case MALIBU_PHY_PSGMII_FX100: -- if (phy_addr == first_phy_addr + MALIBU_PHY_MAX_ADDR_INC) -+ if (phy_addr == MALIBU_PHY_MAX_ADDR_INC) - *interface_mode_status = PHY_PSGMII_FX100; - else - *interface_mode_status = PHY_PSGMII_BASET; - break; - case MALIBU_PHY_SGMII_BASET: -- if (phy_addr == first_phy_addr + MALIBU_PHY_MAX_ADDR_INC) -+ if (phy_addr == MALIBU_PHY_MAX_ADDR_INC) - *interface_mode_status = PHY_SGMII_BASET; - else - *interface_mode_status = PORT_QSGMII; -@@ -1795,10 +1792,6 @@ malibu_phy_hw_init(a_uint32_t dev_id, a_ - { - phy_cnt ++; - phy_addr = qca_ssdk_port_to_phy_addr(dev_id, port_id); -- if (phy_addr < first_phy_addr) -- { -- first_phy_addr = phy_addr; -- } - /*enable phy power saving function by default */ - malibu_phy_set_8023az(dev_id, phy_addr, A_TRUE); - malibu_phy_set_powersave(dev_id, phy_addr, A_TRUE); -@@ -1824,29 +1817,25 @@ malibu_phy_hw_init(a_uint32_t dev_id, a_ - MALIBU_EXTENDED_NEXT_PAGE_EN, 0); - } - } -- /* qca 8072 two ports phy chip's firstly address to init phy chip */ -- if ((phy_cnt == QCA8072_PHY_NUM) && (first_phy_addr >= 0x3)) { -- first_phy_addr = first_phy_addr - 0x3; -- } - - /*workaround to enable AZ transmitting ability*/ -- hsl_phy_mmd_reg_write(dev_id, first_phy_addr + 5, A_FALSE, MALIBU_PHY_MMD1_NUM, -+ hsl_phy_mmd_reg_write(dev_id, PORT5_PHY_ID, A_FALSE, MALIBU_PHY_MMD1_NUM, - MALIBU_PSGMII_MODE_CTRL, MALIBU_PHY_PSGMII_MODE_CTRL_ADJUST_VALUE); - - /* adjust psgmii serdes tx amp */ -- hsl_phy_mii_reg_write(dev_id, first_phy_addr + 5, -+ hsl_phy_mii_reg_write(dev_id, PORT5_PHY_ID, - MALIBU_PSGMII_TX_DRIVER_1_CTRL, MALIBU_PHY_PSGMII_REDUCE_SERDES_TX_AMP); - - /* to avoid psgmii module goes into hibernation, work with psgmii self test*/ -- hsl_phy_modify_mmd(dev_id, first_phy_addr + 4, A_FALSE, MALIBU_PHY_MMD3_NUM, -+ hsl_phy_modify_mmd(dev_id, PORT4_PHY_ID, A_FALSE, MALIBU_PHY_MMD3_NUM, - MALIBU_PHY_MMD3_ADDR_REMOTE_LOOPBACK_CTRL, BIT(1), 0); - - mode = ssdk_dt_global_get_mac_mode(dev_id, 0); - if (mode == PORT_WRAPPER_PSGMII_FIBER) -- malibu_phy_interface_set_mode(dev_id, first_phy_addr, PHY_PSGMII_FIBER); -+ malibu_phy_interface_set_mode(dev_id, 0x0, PHY_PSGMII_FIBER); - - /*init combo phy address*/ -- combo_phy_addr = first_phy_addr+4; -+ combo_phy_addr = PORT4_PHY_ID; - - return SW_OK; - } From e927456ec3d9cd7e92ba884a3065ecc303564720 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 12 Nov 2023 20:25:24 +0100 Subject: [PATCH 04/12] qca-ssdk: fix unsupported scenario with PORT1 not declared in switch bmp Commit 947b44d ("ipq807x: fix wrong define for LAN and WAN ess mask") started fixing wrong switch_lan_bmp that defined lan there weren't actually present. This displayed a fragility in the malibu phy init code in qca-ssdk. Add patch to fix this. Also update each DTS with the new required property if needed. The new binding malibu_phy_start_addr is required with devices that place the malibu first PHY referring port1 on a different PHY addres than 0. The most common configuration is 0 but some device (for example Qnap 301W) place the malibu PHY at an offset to address 16. Refer to ipq8074-ess dtsi for extensive description on how to derive this value. Quoting the patch detailed description: The usage of first_phy_addr is EXTREMELY FRAGILE and results in dangerous results if the OEM (or anyone that by chance try to implement things in a logical manner) deviates from the default values from the "magical template". To be in more details. With QSDK 12.4, some tweaks were done to improve autoneg and now on every call of port status, the phydev is tried to add. This resulted in the call and log spam of an error with ports that are actually not present on the system with qsdk reporting phydev is NULL. This itself is not an error and printing the error is correct. What is actually an error from ages is setting generic bitmap reporting presence of port that are actually not present. This is very common on OEM where the switch_lan_bmp is always a variant of 0x1e (that on bitmap results in PORT1 PORT2 PORT3 PORT4 present) or 0x3e (PORT1 PORT2 PORT3 PORT4 PORT5). Reality is that many device are used as AP with one LAN port or one WAN port. (or even exotic configuration with PORT1 not present and PORT2 PORT3 PORT4 present (Xiaomi 3600) With this finding one can say... ok nice, then lets update the DT and set the correct bitmap... Again world is a bad place and reality is that this cause wonderful regression in some case of by extreme luck the first ever connected port working and the rest of the switch dead. The problem has been bisected to all the device that doesn't have the PORT1 declared in any of the bitmap. With this prefaction in mind, on to the REAL problem. malibu_phy_hw_init FOR SOME REASON, set a global variable first_phy_addr to the first detected PHY addr that coincidentally is always PORT1. PORT1 addr is 0x0. The entire code in malibu_phy use this variable to derive the phy addrs in some function. Declaring a bitmap where the PORT1 is missing (or worse PORT4 the only one connected) result in first_phy_addr set to 1 or whatever phy addr is detected first setting wrong value all over the init stage. To fix this, introduce a new binding malibu_first_phy_addr to manually declare the first phy that the malibu PHY driver should use and permit to detach it from port bmp detection. The legacy detection is kept for compatibility reason. Fixes: #13945 Fixes: 947b44d9ae17 ("ipq807x: fix wrong define for LAN and WAN ess mask") Signed-off-by: Christian Marangi Tested-by: Robert Marko # Qnap 301W Reviewed-by: Robert Marko Signed-off-by: Christian Marangi --- package/kernel/qca-ssdk/Makefile | 2 +- ...upport-for-manual-define-of-first-ph.patch | 131 ++++++++++++++++++ .../arch/arm64/boot/dts/qcom/ipq8072-301w.dts | 1 + .../arch/arm64/boot/dts/qcom/ipq8074-ess.dtsi | 18 +++ 4 files changed, 151 insertions(+), 1 deletion(-) create mode 100644 package/kernel/qca-ssdk/patches/100-malibu-phy-add-support-for-manual-define-of-first-ph.patch diff --git a/package/kernel/qca-ssdk/Makefile b/package/kernel/qca-ssdk/Makefile index f5d8260503..4107208c0e 100644 --- a/package/kernel/qca-ssdk/Makefile +++ b/package/kernel/qca-ssdk/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=qca-ssdk -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/qca-ssdk.git PKG_SOURCE_PROTO:=git diff --git a/package/kernel/qca-ssdk/patches/100-malibu-phy-add-support-for-manual-define-of-first-ph.patch b/package/kernel/qca-ssdk/patches/100-malibu-phy-add-support-for-manual-define-of-first-ph.patch new file mode 100644 index 0000000000..6aaa579c09 --- /dev/null +++ b/package/kernel/qca-ssdk/patches/100-malibu-phy-add-support-for-manual-define-of-first-ph.patch @@ -0,0 +1,131 @@ +From a651d10fbd880098d7b98dee27dfd1eb15146fb2 Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Sun, 12 Nov 2023 18:40:22 +0100 +Subject: [PATCH] malibu-phy: add support for manual define of first phy addr + +The usage of first_phy_addr is EXTREMELY FRAGILE and results +in dangerous results if the OEM (or anyone that by chance try to +implement things in a logical manner) deviates from the default values +from the "magical template". + +To be in more details. With QSDK 12.4, some tweaks were done to improve +autoneg and now on every call of port status, the phydev is tried to +add. This resulted in the call and log spam of an error with ports that +are actually not present on the system with qsdk reporting phydev is +NULL. This itself is not an error and printing the error is correct. + +What is actually an error from ages is setting generic bitmap reporting +presence of port that are actually not present. This is very common on +OEM where the switch_lan_bmp is always a variant of 0x1e (that on bitmap +results in PORT1 PORT2 PORT3 PORT4 present) or 0x3e (PORT1 PORT2 PORT3 +PORT4 PORT5). Reality is that many device are used as AP with one LAN +port or one WAN port. (or even exotic configuration with PORT1 not +present and PORT2 PORT3 PORT4 present (Xiaomi 3600) + +With this finding one can say... ok nice, then lets update the DT and +set the correct bitmap... + +Again world is a bad place and reality is that this cause wonderful +regression in some case of by extreme luck the first ever connected +port working and the rest of the switch dead. + +The problem has been bisected to all the device that doesn't have the +PORT1 declared in any of the bitmap. + +With this prefaction in mind, on to the REAL problem. + +malibu_phy_hw_init FOR SOME REASON, set a global variable first_phy_addr +to the first detected PHY addr that coincidentally is always PORT1. +PORT1 addr is 0x0. The entire code in malibu_phy use this variable to +derive the phy addrs in some function. + +Declaring a bitmap where the PORT1 is missing (or worse PORT4 the only +one connected) result in first_phy_addr set to 1 or whatever phy addr is +detected first setting wrong value all over the init stage. + +To fix this, introduce a new binding malibu_first_phy_addr to manually +declare the first phy that the malibu PHY driver should use and permit +to detach it from port bmp detection. The legacy detection is kept for +compatibility reason. + +Signed-off-by: Christian Marangi +--- + include/init/ssdk_dts.h | 1 + + include/init/ssdk_init.h | 2 ++ + src/hsl/phy/malibu_phy.c | 5 +++++ + src/init/ssdk_dts.c | 15 +++++++++++++++ + 4 files changed, 23 insertions(+) + +--- a/include/init/ssdk_dts.h ++++ b/include/init/ssdk_dts.h +@@ -146,6 +146,7 @@ a_uint32_t ssdk_wan_bmp_get(a_uint32_t d + sw_error_t ssdk_lan_bmp_set(a_uint32_t dev_id, a_uint32_t lan_bmp); + sw_error_t ssdk_wan_bmp_set(a_uint32_t dev_id, a_uint32_t wan_bmp); + a_uint32_t ssdk_inner_bmp_get(a_uint32_t dev_id); ++a_uint32_t ssdk_malibu_first_phy_addr_get(a_uint32_t dev_id); + hsl_reg_mode ssdk_switch_reg_access_mode_get(a_uint32_t dev_id); + void ssdk_switch_reg_map_info_get(a_uint32_t dev_id, ssdk_reg_map_info *info); + a_uint32_t ssdk_switch_pcie_base_get(a_uint32_t dev_id); +--- a/include/init/ssdk_init.h ++++ b/include/init/ssdk_init.h +@@ -194,6 +194,7 @@ enum ssdk_port_wrapper_cfg { + a_uint32_t lan_bmp; + a_uint32_t wan_bmp; + a_uint32_t inner_bmp; ++ a_uint32_t malibu_first_phy_addr; + } ssdk_port_cfg; + + typedef struct +@@ -384,6 +385,7 @@ ssdk_hsl_access_mode_set(a_uint32_t dev_ + + a_uint32_t ssdk_dt_global_get_mac_mode(a_uint32_t dev_id, a_uint32_t index); + a_uint32_t ssdk_dt_global_set_mac_mode(a_uint32_t dev_id, a_uint32_t index, a_uint32_t mode); ++a_uint32_t ssdk_malibu_first_phy_addr_get(a_uint32_t dev_id); + + a_uint32_t + qca_hppe_port_mac_type_get(a_uint32_t dev_id, a_uint32_t port_id); +--- a/src/hsl/phy/malibu_phy.c ++++ b/src/hsl/phy/malibu_phy.c +@@ -1945,6 +1945,11 @@ static int malibu_phy_api_ops_init(void) + int malibu_phy_init(a_uint32_t dev_id, a_uint32_t port_bmp) + { + static a_uint32_t phy_ops_flag = 0; ++ a_uint32_t malibu_first_phy_addr; ++ ++ malibu_first_phy_addr = ssdk_malibu_first_phy_addr_get(dev_id); ++ if (malibu_first_phy_addr != MAX_PHY_ADDR) ++ first_phy_addr = malibu_first_phy_addr; + + if(phy_ops_flag == 0) { + malibu_phy_api_ops_init(); +--- a/src/init/ssdk_dts.c ++++ b/src/init/ssdk_dts.c +@@ -186,6 +186,13 @@ a_uint32_t ssdk_inner_bmp_get(a_uint32_t + return cfg->port_cfg.inner_bmp; + } + ++a_uint32_t ssdk_malibu_first_phy_addr_get(a_uint32_t dev_id) ++{ ++ ssdk_dt_cfg* cfg = ssdk_dt_global.ssdk_dt_switch_nodes[dev_id]; ++ ++ return cfg->port_cfg.malibu_first_phy_addr; ++} ++ + hsl_reg_mode ssdk_switch_reg_access_mode_get(a_uint32_t dev_id) + { + ssdk_dt_cfg* cfg = ssdk_dt_global.ssdk_dt_switch_nodes[dev_id]; +@@ -1039,6 +1046,14 @@ static void ssdk_dt_parse_port_bmp(a_uin + cfg->port_cfg.inner_bmp; + } + ++ /* Permit to manually declare start phy addr for malibu PHY. If not found set to legacy detection. */ ++ if (!of_property_read_u32(switch_node, "malibu_first_phy_addr", &cfg->port_cfg.malibu_first_phy_addr)) { ++ ssdk_dt_global.ssdk_dt_switch_nodes[dev_id]->port_cfg.malibu_first_phy_addr = ++ cfg->port_cfg.malibu_first_phy_addr; ++ } else { ++ ssdk_dt_global.ssdk_dt_switch_nodes[dev_id]->port_cfg.malibu_first_phy_addr = MAX_PHY_ADDR; ++ } ++ + ssdk_dt_global.ssdk_dt_switch_nodes[dev_id]->port_cfg.cpu_bmp = cfg->port_cfg.cpu_bmp; + ssdk_dt_global.ssdk_dt_switch_nodes[dev_id]->port_cfg.lan_bmp = cfg->port_cfg.lan_bmp; + ssdk_dt_global.ssdk_dt_switch_nodes[dev_id]->port_cfg.wan_bmp = cfg->port_cfg.wan_bmp; diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-301w.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-301w.dts index ce82f24ae8..6c7ec2e588 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-301w.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-301w.dts @@ -323,6 +323,7 @@ switch_lan_bmp = <(ESS_PORT1 | ESS_PORT2 | ESS_PORT3 | ESS_PORT4 | ESS_PORT5)>; /* lan port bitmap */ switch_wan_bmp = ; /* wan port bitmap */ + malibu_first_phy_addr = <16>; /* PHY addr of the first malibu PHY */ switch_mac_mode = <0xb>; /* mac mode for uniphy instance0*/ switch_mac_mode1 = <0xd>; /* mac mode for uniphy instance1*/ switch_mac_mode2 = <0xd>; /* mac mode for uniphy instance2*/ diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-ess.dtsi b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-ess.dtsi index 597f7f1ff9..f0c1efce9e 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-ess.dtsi +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-ess.dtsi @@ -23,6 +23,24 @@ switch_access_mode = "local bus"; switch_cpu_bmp = ; /* cpu port bitmap */ switch_inner_bmp = ; /*inner port bitmap*/ + /* This is a special binding that controls how the malibu PHY are + * init. This value reflect the PHY addr of the first malibu PHY. + * Malibu PHY are in a bundle of 5 PHY. + * Some device might have some port not connected. + * SSDK still needs the addrs of the first PHY (even if not connected) + * to correctly setup the malibu PHY. + * + * This is needed as previously SSDK based this on the port bmp, but + * this can be problematic now that we specify correct bmp. + * + * Most common configuration have the malibu PHY placed at 0. + * But some device might have it placed at address 16. + * To drive the correct value, check the port id of the malibu PHY + * and try to understand what is the first one in devices where some + * port are missing. port_phyinfo is normally the way to go to derive + * this value in the few special cases. + */ + malibu_first_phy_addr = <0>; clocks = <&gcc GCC_CMN_12GPLL_AHB_CLK>, <&gcc GCC_CMN_12GPLL_SYS_CLK>, <&gcc GCC_UNIPHY0_AHB_CLK>, From 5ddebb5fd9aa94a70629ff3708a281cf039f7eea Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Sun, 12 Nov 2023 20:34:45 +0200 Subject: [PATCH 05/12] devel/gdb: Disable libzstd explicitly New gdb has got libzstd support, and libzstd gets detected at buildbot build. Explicitly disable it to avoid dependency. Fixes: f79de8ec65 ("gdb: Update to 13.2") Signed-off-by: Hannu Nyman --- package/devel/gdb/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/devel/gdb/Makefile b/package/devel/gdb/Makefile index 20a40eb8bb..3efbce28f4 100644 --- a/package/devel/gdb/Makefile +++ b/package/devel/gdb/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gdb PKG_VERSION:=13.2 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/gdb @@ -58,6 +58,7 @@ CONFIGURE_ARGS+= \ --with-system-zlib \ --without-expat \ --without-lzma \ + --without-zstd \ --disable-unit-tests \ --disable-ubsan \ --disable-sim \ From 4e268803d0d82b3b67946e77d6bd361a91c1fd82 Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Mon, 25 Sep 2023 23:40:02 +0800 Subject: [PATCH 06/12] linux-firmware: add Realtek RTL8723DE/RTL8821CE firmware This adds packages for the Realtek RTL8723DE/RTL8821CE firmware to be used with the rtw88 driver. Signed-off-by: Chukun Pan --- package/firmware/linux-firmware/realtek.mk | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/package/firmware/linux-firmware/realtek.mk b/package/firmware/linux-firmware/realtek.mk index 6d9238b8a4..4a3b6cd28a 100644 --- a/package/firmware/linux-firmware/realtek.mk +++ b/package/firmware/linux-firmware/realtek.mk @@ -86,6 +86,13 @@ define Package/rtl8723bu-firmware/install endef $(eval $(call BuildPackage,rtl8723bu-firmware)) +Package/rtl8723de-firmware = $(call Package/firmware-default,RealTek RTL8723DE firmware) +define Package/rtl8723de-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/rtw88 + $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw88/rtw8723d_fw.bin $(1)/lib/firmware/rtw88 +endef +$(eval $(call BuildPackage,rtl8723de-firmware)) + Package/rtl8761a-firmware = $(call Package/firmware-default,RealTek RTL8761A firmware) define Package/rtl8761a-firmware/install $(INSTALL_DIR) $(1)/lib/firmware/rtl_bt @@ -117,6 +124,13 @@ define Package/rtl8821ae-firmware/install endef $(eval $(call BuildPackage,rtl8821ae-firmware)) +Package/rtl8821ce-firmware = $(call Package/firmware-default,RealTek RTL8821CE firmware) +define Package/rtl8821ce-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/rtw88 + $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw88/rtw8821c_fw.bin $(1)/lib/firmware/rtw88 +endef +$(eval $(call BuildPackage,rtl8821ce-firmware)) + Package/rtl8822be-firmware = $(call Package/firmware-default,RealTek RTL8822BE firmware) define Package/rtl8822be-firmware/install $(INSTALL_DIR) $(1)/lib/firmware/rtw88 From 083a096390b36b295aa71de84e8c957eb3d0e2ca Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Tue, 26 Sep 2023 23:03:28 +0800 Subject: [PATCH 07/12] linux-firmware: add Realtek RTW89 firmware This is the firmware required for the rtw89 driver. Signed-off-by: Chukun Pan --- package/firmware/linux-firmware/realtek.mk | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/package/firmware/linux-firmware/realtek.mk b/package/firmware/linux-firmware/realtek.mk index 4a3b6cd28a..b4880b6a7f 100644 --- a/package/firmware/linux-firmware/realtek.mk +++ b/package/firmware/linux-firmware/realtek.mk @@ -145,3 +145,32 @@ define Package/rtl8822ce-firmware/install $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw88/rtw8822c_wow_fw.bin $(1)/lib/firmware/rtw88 endef $(eval $(call BuildPackage,rtl8822ce-firmware)) + +Package/rtl8851be-firmware = $(call Package/firmware-default,RealTek RTL8851BE firmware) +define Package/rtl8851be-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/rtw89 + $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw89/rtw8851b_fw.bin $(1)/lib/firmware/rtw89 +endef +$(eval $(call BuildPackage,rtl8851be-firmware)) + +Package/rtl8852ae-firmware = $(call Package/firmware-default,RealTek RTL8852AE firmware) +define Package/rtl8852ae-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/rtw89 + $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw89/rtw8852a_fw.bin $(1)/lib/firmware/rtw89 +endef +$(eval $(call BuildPackage,rtl8852ae-firmware)) + +Package/rtl8852be-firmware = $(call Package/firmware-default,RealTek RTL8852BE firmware) +define Package/rtl8852be-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/rtw89 + $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw89/rtw8852b_fw.bin $(1)/lib/firmware/rtw89 + $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw89/rtw8852b_fw-1.bin $(1)/lib/firmware/rtw89 +endef +$(eval $(call BuildPackage,rtl8852be-firmware)) + +Package/rtl8852ce-firmware = $(call Package/firmware-default,RealTek RTL8852CE firmware) +define Package/rtl8852ce-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/rtw89 + $(INSTALL_DATA) $(PKG_BUILD_DIR)/rtw89/rtw8852c_fw.bin $(1)/lib/firmware/rtw89 +endef +$(eval $(call BuildPackage,rtl8852ce-firmware)) From 16cff054f108f7c7747a0bf9da1d3fb9211012b8 Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Mon, 13 Nov 2023 22:18:06 +0800 Subject: [PATCH 08/12] mac80211: realtek: fix rtw88 driver dependencies The RTW88 PCI/USB driver uses the same firmware, so add firmware dependencies. Also CI report that: Package kmod-rtw88-usb is missing dependencies for the following libraries: usbcore.ko This commit fixes it. Fixes: 3538a19 ("mac80211: split rtw88 configuration for each supported chip") Signed-off-by: Chukun Pan --- package/kernel/mac80211/realtek.mk | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package/kernel/mac80211/realtek.mk b/package/kernel/mac80211/realtek.mk index 48109b94b2..0fc9fb0e6d 100644 --- a/package/kernel/mac80211/realtek.mk +++ b/package/kernel/mac80211/realtek.mk @@ -196,7 +196,7 @@ endef define KernelPackage/rtw88-usb $(call KernelPackage/mac80211/Default) TITLE:=Realtek RTW88 USB chips support - DEPENDS+= @USB_SUPPORT +kmod-rtw88 + DEPENDS+= @USB_SUPPORT +kmod-rtw88 +kmod-usb-core FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_usb.ko AUTOLOAD:=$(call AutoProbe,rtw88_usb) HIDDEN:=1 @@ -205,7 +205,7 @@ endef define KernelPackage/rtw88-8822b $(call KernelPackage/mac80211/Default) TITLE:=Realtek RTL8822B family support - DEPENDS+= +kmod-rtw88 +@DRIVER_11AC_SUPPORT + DEPENDS+= +kmod-rtw88 +rtl8822be-firmware +@DRIVER_11AC_SUPPORT FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822b.ko AUTOLOAD:=$(call AutoProbe,rtw88_8822b) HIDDEN:=1 @@ -214,7 +214,7 @@ endef define KernelPackage/rtw88-8822c $(call KernelPackage/mac80211/Default) TITLE:=Realtek RTL8822C family support - DEPENDS+= +kmod-rtw88 +@DRIVER_11AC_SUPPORT + DEPENDS+= +kmod-rtw88 +rtl8822ce-firmware +@DRIVER_11AC_SUPPORT FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822c.ko AUTOLOAD:=$(call AutoProbe,rtw88_8822c) HIDDEN:=1 @@ -223,7 +223,7 @@ endef define KernelPackage/rtw88-8723d $(call KernelPackage/mac80211/Default) TITLE:=Realtek RTL8723D family support - DEPENDS+= +kmod-rtw88 + DEPENDS+= +kmod-rtw88 +rtl8723de-firmware FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8723d.ko AUTOLOAD:=$(call AutoProbe,rtw88_8723d) HIDDEN:=1 @@ -240,7 +240,7 @@ endef define KernelPackage/rtw88-8822bu $(call KernelPackage/mac80211/Default) TITLE:=Realtek RTL8822BU support - DEPENDS+= +kmod-rtw88-usb +rtl8822be-firmware +kmod-rtw88-8822b + DEPENDS+= +kmod-rtw88-usb +kmod-rtw88-8822b FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822bu.ko AUTOLOAD:=$(call AutoProbe,rtw88_8822bu) endef From 1418d9568a3ae2a17785c15ce90e505f2357fa76 Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Wed, 27 Sep 2023 23:01:50 +0800 Subject: [PATCH 09/12] mac80211: realtek: rtw88: add RTL8821CE support Add the Realtek RTL8821CE support to rtw88 package. Signed-off-by: Chukun Pan --- package/kernel/mac80211/realtek.mk | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/package/kernel/mac80211/realtek.mk b/package/kernel/mac80211/realtek.mk index 0fc9fb0e6d..5e04f9d5e1 100644 --- a/package/kernel/mac80211/realtek.mk +++ b/package/kernel/mac80211/realtek.mk @@ -1,8 +1,8 @@ PKG_DRIVERS += \ rtlwifi rtlwifi-pci rtlwifi-btcoexist rtlwifi-usb rtl8192c-common \ rtl8192ce rtl8192se rtl8192de rtl8192cu rtl8723bs rtl8821ae \ - rtl8xxxu rtw88 rtw88-pci rtw88-usb rtw88-8822b rtw88-8822c rtw88-8723d \ - rtw88-8822be rtw88-8822bu rtw88-8822ce rtw88-8723de + rtl8xxxu rtw88 rtw88-pci rtw88-usb rtw88-8821c rtw88-8822b rtw88-8822c \ + rtw88-8723d rtw88-8821ce rtw88-8822be rtw88-8822bu rtw88-8822ce rtw88-8723de config-$(call config_package,rtlwifi) += RTL_CARDS RTLWIFI config-$(call config_package,rtlwifi-pci) += RTLWIFI_PCI @@ -25,6 +25,8 @@ config-y += STAGING config-$(call config_package,rtw88) += RTW88 RTW88_CORE config-$(call config_package,rtw88-pci) += RTW88_PCI config-$(call config_package,rtw88-usb) += RTW88_USB +config-$(call config_package,rtw88-8821c) += RTW88_8821C +config-$(call config_package,rtw88-8821ce) += RTW88_8821CE config-$(call config_package,rtw88-8822b) += RTW88_8822B config-$(call config_package,rtw88-8822be) += RTW88_8822BE config-$(call config_package,rtw88-8822bu) += RTW88_8822BU @@ -202,6 +204,15 @@ define KernelPackage/rtw88-usb HIDDEN:=1 endef +define KernelPackage/rtw88-8821c + $(call KernelPackage/mac80211/Default) + TITLE:=Realtek RTL8821C family support + DEPENDS+= +kmod-rtw88 +rtl8821ce-firmware +@DRIVER_11AC_SUPPORT + FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8821c.ko + AUTOLOAD:=$(call AutoProbe,rtw88_8821c) + HIDDEN:=1 +endef + define KernelPackage/rtw88-8822b $(call KernelPackage/mac80211/Default) TITLE:=Realtek RTL8822B family support @@ -229,6 +240,14 @@ define KernelPackage/rtw88-8723d HIDDEN:=1 endef +define KernelPackage/rtw88-8821ce + $(call KernelPackage/mac80211/Default) + TITLE:=Realtek RTL8821CE support + DEPENDS+= +kmod-rtw88-pci +kmod-rtw88-8821c + FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8821ce.ko + AUTOLOAD:=$(call AutoProbe,rtw88_8821ce) +endef + define KernelPackage/rtw88-8822be $(call KernelPackage/mac80211/Default) TITLE:=Realtek RTL8822BE support From 055f6dd6f29ba715912a4c8ee1e4ada110f7ac79 Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Thu, 28 Sep 2023 23:09:20 +0800 Subject: [PATCH 10/12] mac80211: realtek: rtw88: add RTL8821CU support Add the Realtek RTL8821CU support to rtw88 package. Signed-off-by: Chukun Pan --- package/kernel/mac80211/realtek.mk | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/package/kernel/mac80211/realtek.mk b/package/kernel/mac80211/realtek.mk index 5e04f9d5e1..322bbd4986 100644 --- a/package/kernel/mac80211/realtek.mk +++ b/package/kernel/mac80211/realtek.mk @@ -2,7 +2,8 @@ PKG_DRIVERS += \ rtlwifi rtlwifi-pci rtlwifi-btcoexist rtlwifi-usb rtl8192c-common \ rtl8192ce rtl8192se rtl8192de rtl8192cu rtl8723bs rtl8821ae \ rtl8xxxu rtw88 rtw88-pci rtw88-usb rtw88-8821c rtw88-8822b rtw88-8822c \ - rtw88-8723d rtw88-8821ce rtw88-8822be rtw88-8822bu rtw88-8822ce rtw88-8723de + rtw88-8723d rtw88-8821ce rtw88-8821cu rtw88-8822be rtw88-8822bu \ + rtw88-8822ce rtw88-8723de config-$(call config_package,rtlwifi) += RTL_CARDS RTLWIFI config-$(call config_package,rtlwifi-pci) += RTLWIFI_PCI @@ -27,6 +28,7 @@ config-$(call config_package,rtw88-pci) += RTW88_PCI config-$(call config_package,rtw88-usb) += RTW88_USB config-$(call config_package,rtw88-8821c) += RTW88_8821C config-$(call config_package,rtw88-8821ce) += RTW88_8821CE +config-$(call config_package,rtw88-8821cu) += RTW88_8821CU config-$(call config_package,rtw88-8822b) += RTW88_8822B config-$(call config_package,rtw88-8822be) += RTW88_8822BE config-$(call config_package,rtw88-8822bu) += RTW88_8822BU @@ -248,6 +250,14 @@ define KernelPackage/rtw88-8821ce AUTOLOAD:=$(call AutoProbe,rtw88_8821ce) endef +define KernelPackage/rtw88-8821cu + $(call KernelPackage/mac80211/Default) + TITLE:=Realtek RTL8821CU support + DEPENDS+= +kmod-rtw88-usb +kmod-rtw88-8821c + FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8821cu.ko + AUTOLOAD:=$(call AutoProbe,rtw88_8821cu) +endef + define KernelPackage/rtw88-8822be $(call KernelPackage/mac80211/Default) TITLE:=Realtek RTL8822BE support From 3f5e0fb66f45a0509698d17c406623b9c0ef0fad Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Fri, 29 Sep 2023 23:05:26 +0800 Subject: [PATCH 11/12] mac80211: realtek: rtw88: add RTL8822CU support Add the Realtek RTL8822CU support to rtw88 package. Signed-off-by: Chukun Pan --- package/kernel/mac80211/realtek.mk | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/package/kernel/mac80211/realtek.mk b/package/kernel/mac80211/realtek.mk index 322bbd4986..04057b3106 100644 --- a/package/kernel/mac80211/realtek.mk +++ b/package/kernel/mac80211/realtek.mk @@ -3,7 +3,7 @@ PKG_DRIVERS += \ rtl8192ce rtl8192se rtl8192de rtl8192cu rtl8723bs rtl8821ae \ rtl8xxxu rtw88 rtw88-pci rtw88-usb rtw88-8821c rtw88-8822b rtw88-8822c \ rtw88-8723d rtw88-8821ce rtw88-8821cu rtw88-8822be rtw88-8822bu \ - rtw88-8822ce rtw88-8723de + rtw88-8822ce rtw88-8822cu rtw88-8723de config-$(call config_package,rtlwifi) += RTL_CARDS RTLWIFI config-$(call config_package,rtlwifi-pci) += RTLWIFI_PCI @@ -34,6 +34,7 @@ config-$(call config_package,rtw88-8822be) += RTW88_8822BE config-$(call config_package,rtw88-8822bu) += RTW88_8822BU config-$(call config_package,rtw88-8822c) += RTW88_8822C config-$(call config_package,rtw88-8822ce) += RTW88_8822CE +config-$(call config_package,rtw88-8822cu) += RTW88_8822CU config-$(call config_package,rtw88-8723d) += RTW88_8723D config-$(call config_package,rtw88-8723de) += RTW88_8723DE config-$(CONFIG_PACKAGE_RTW88_DEBUG) += RTW88_DEBUG @@ -282,6 +283,14 @@ define KernelPackage/rtw88-8822ce AUTOLOAD:=$(call AutoProbe,rtw88_8822ce) endef +define KernelPackage/rtw88-8822cu + $(call KernelPackage/mac80211/Default) + TITLE:=Realtek RTL8822CU support + DEPENDS+= +kmod-rtw88-usb +kmod-rtw88-8822c + FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/realtek/rtw88/rtw88_8822cu.ko + AUTOLOAD:=$(call AutoProbe,rtw88_8822cu) +endef + define KernelPackage/rtw88-8723de $(call KernelPackage/mac80211/Default) TITLE:=Realtek RTL8723DE support From 09b7e1955c92e0b05197174b7bd4aef2c4073a35 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Mon, 13 Nov 2023 23:32:12 +0100 Subject: [PATCH 12/12] Revert "prereq-build: add Python 3.12 support" This reverts commit 7ceb76ca3a37ba6b722df39ba0838909fa7cf7b4. Python 3.12 removes the distutils package and is therefore not compatible. We have to check downstream what relies on distutils before adding actual support for Python 3.12. Sorry for the noise. With this in-place, the macOS CI job fails and turns things red, revert for now. Signed-off-by: Paul Spooren --- include/prereq-build.mk | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/prereq-build.mk b/include/prereq-build.mk index 2378f5ad90..49340ce3e4 100644 --- a/include/prereq-build.mk +++ b/include/prereq-build.mk @@ -182,7 +182,6 @@ $(eval $(call SetupHostCommand,perl,Please install Perl 5.x, \ perl --version | grep "perl.*v5")) $(eval $(call SetupHostCommand,python,Please install Python >= 3.7, \ - python3.12 -V 2>&1 | grep 'Python 3', \ python3.11 -V 2>&1 | grep 'Python 3', \ python3.10 -V 2>&1 | grep 'Python 3', \ python3.9 -V 2>&1 | grep 'Python 3', \ @@ -191,7 +190,6 @@ $(eval $(call SetupHostCommand,python,Please install Python >= 3.7, \ python3 -V 2>&1 | grep -E 'Python 3\.([7-9]|[0-9][0-9])\.?')) $(eval $(call SetupHostCommand,python3,Please install Python >= 3.7, \ - python3.12 -V 2>&1 | grep 'Python 3', \ python3.11 -V 2>&1 | grep 'Python 3', \ python3.10 -V 2>&1 | grep 'Python 3', \ python3.9 -V 2>&1 | grep 'Python 3', \