From: Robert Marko Date: Fri, 23 Jun 2023 11:51:14 +0000 (+0200) Subject: kernel: qca-ssdk: update to 12.4.5.r1 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b45562a69c4c4b886c042971e35975bfb965d435;p=openwrt%2Fstaging%2Fmans0n.git kernel: qca-ssdk: update to 12.4.5.r1 Qualcomm has finally started the preparatory work in order to support kernel 6.1, so lets make use of that and update SSDK 12.4.5.r1 which allows us to drop almost all of the patches. Lets also install the forgotten SSDK netlink header. Signed-off-by: Robert Marko --- diff --git a/package/kernel/qca-ssdk/Makefile b/package/kernel/qca-ssdk/Makefile index a40aefb2ee..7420b03803 100644 --- a/package/kernel/qca-ssdk/Makefile +++ b/package/kernel/qca-ssdk/Makefile @@ -1,13 +1,13 @@ 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 -PKG_SOURCE_DATE:=2022-09-12 -PKG_SOURCE_VERSION:=628b22bc3d5ee81414b75ab3de6a255c82754dec -PKG_MIRROR_HASH:=859344f79504b9953639dc5aa27042249f68e3a9a269e66d7f7a25e1ab38c110 +PKG_SOURCE_DATE:=2023-06-06 +PKG_SOURCE_VERSION:=74caf88aa3b6793c300f676e4fb1c62da7507be9 +PKG_MIRROR_HASH:=6bdb90919b773f5fb432c8b374c9419feac32ba6583ad82dfec5e41628a32dd9 PKG_FLAGS:=nonshared PKG_BUILD_FLAGS:=no-lto @@ -75,6 +75,9 @@ define Build/InstallDev if [ -f $(PKG_BUILD_DIR)/include/init/ssdk_init.h ]; then \ $(CP) -rf $(PKG_BUILD_DIR)/include/init/ssdk_init.h $(1)/usr/include/qca-ssdk/init/; \ fi + if [ -f $(PKG_BUILD_DIR)/include/init/ssdk_netlink.h ]; then \ + $(CP) -rf $(PKG_BUILD_DIR)/include/init/ssdk_netlink.h $(1)/usr/include/qca-ssdk/init/; \ + fi $(CP) -rf $(PKG_BUILD_DIR)/include/fal $(1)/usr/include/qca-ssdk $(CP) -rf $(PKG_BUILD_DIR)/include/common/*.h $(1)/usr/include/qca-ssdk $(CP) -rf $(PKG_BUILD_DIR)/include/sal/os/linux/*.h $(1)/usr/include/qca-ssdk diff --git a/package/kernel/qca-ssdk/patches/0001-SSDK-replace-ioremap_nocache-with-ioremap.patch b/package/kernel/qca-ssdk/patches/0001-SSDK-replace-ioremap_nocache-with-ioremap.patch deleted file mode 100644 index 2b659e1322..0000000000 --- a/package/kernel/qca-ssdk/patches/0001-SSDK-replace-ioremap_nocache-with-ioremap.patch +++ /dev/null @@ -1,102 +0,0 @@ -From 1e46d596701fedb751a669666a74677344fb8724 Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Wed, 12 May 2021 13:45:45 +0200 -Subject: [PATCH 01/14] SSDK: replace ioremap_nocache with ioremap - -ioremap_nocache was dropped upstream, simply use the -generic variety. - -Signed-off-by: Robert Marko ---- - src/init/ssdk_clk.c | 10 +++++----- - src/init/ssdk_init.c | 2 +- - src/init/ssdk_plat.c | 6 +++--- - 3 files changed, 9 insertions(+), 9 deletions(-) - ---- a/src/init/ssdk_clk.c -+++ b/src/init/ssdk_clk.c -@@ -721,7 +721,7 @@ ssdk_mp_tcsr_get(a_uint32_t tcsr_offset, - { - void __iomem *tcsr_base = NULL; - -- tcsr_base = ioremap_nocache(TCSR_ETH_ADDR, TCSR_ETH_SIZE); -+ tcsr_base = ioremap(TCSR_ETH_ADDR, TCSR_ETH_SIZE); - if (!tcsr_base) - { - SSDK_ERROR("Failed to map tcsr eth address!\n"); -@@ -738,7 +738,7 @@ ssdk_mp_tcsr_set(a_uint32_t tcsr_offset, - { - void __iomem *tcsr_base = NULL; - -- tcsr_base = ioremap_nocache(TCSR_ETH_ADDR, TCSR_ETH_SIZE); -+ tcsr_base = ioremap(TCSR_ETH_ADDR, TCSR_ETH_SIZE); - if (!tcsr_base) - { - SSDK_ERROR("Failed to map tcsr eth address!\n"); -@@ -786,7 +786,7 @@ ssdk_mp_cmnblk_stable_check(void) - a_uint32_t reg_val; - int i, loops = 20; - -- pll_lock = ioremap_nocache(CMN_PLL_LOCKED_ADDR, CMN_PLL_LOCKED_SIZE); -+ pll_lock = ioremap(CMN_PLL_LOCKED_ADDR, CMN_PLL_LOCKED_SIZE); - if (!pll_lock) { - SSDK_ERROR("Failed to map CMN PLL LOCK register!\n"); - return A_FALSE; -@@ -843,7 +843,7 @@ static void ssdk_cmnblk_pll_src_set(enum - void __iomem *cmn_pll_src_base = NULL; - a_uint32_t reg_val; - -- cmn_pll_src_base = ioremap_nocache(CMN_BLK_PLL_SRC_ADDR, CMN_BLK_SIZE); -+ cmn_pll_src_base = ioremap(CMN_BLK_PLL_SRC_ADDR, CMN_BLK_SIZE); - if (!cmn_pll_src_base) { - SSDK_ERROR("Failed to map cmn pll source address!\n"); - return; -@@ -869,7 +869,7 @@ static void ssdk_cmnblk_init(enum cmnblk - return; - } - -- gcc_pll_base = ioremap_nocache(CMN_BLK_ADDR, CMN_BLK_SIZE); -+ gcc_pll_base = ioremap(CMN_BLK_ADDR, CMN_BLK_SIZE); - if (!gcc_pll_base) { - SSDK_ERROR("Failed to map gcc pll address!\n"); - return; ---- a/src/init/ssdk_init.c -+++ b/src/init/ssdk_init.c -@@ -3134,7 +3134,7 @@ static int ssdk_dess_mac_mode_init(a_uin - (a_uint8_t *)®_value, 4); - mdelay(10); - /*softreset psgmii, fixme*/ -- gcc_addr = ioremap_nocache(0x1812000, 0x200); -+ gcc_addr = ioremap(0x1812000, 0x200); - if (!gcc_addr) { - SSDK_ERROR("gcc map fail!\n"); - return 0; ---- a/src/init/ssdk_plat.c -+++ b/src/init/ssdk_plat.c -@@ -1708,7 +1708,7 @@ ssdk_plat_init(ssdk_init_cfg *cfg, a_uin - reg_mode = ssdk_uniphy_reg_access_mode_get(dev_id); - if(reg_mode == HSL_REG_LOCAL_BUS) { - ssdk_uniphy_reg_map_info_get(dev_id, &map); -- qca_phy_priv_global[dev_id]->uniphy_hw_addr = ioremap_nocache(map.base_addr, -+ qca_phy_priv_global[dev_id]->uniphy_hw_addr = ioremap(map.base_addr, - map.size); - if (!qca_phy_priv_global[dev_id]->uniphy_hw_addr) { - SSDK_ERROR("%s ioremap fail.", __func__); -@@ -1723,7 +1723,7 @@ ssdk_plat_init(ssdk_init_cfg *cfg, a_uin - reg_mode = ssdk_switch_reg_access_mode_get(dev_id); - if (reg_mode == HSL_REG_LOCAL_BUS) { - ssdk_switch_reg_map_info_get(dev_id, &map); -- qca_phy_priv_global[dev_id]->hw_addr = ioremap_nocache(map.base_addr, -+ qca_phy_priv_global[dev_id]->hw_addr = ioremap(map.base_addr, - map.size); - if (!qca_phy_priv_global[dev_id]->hw_addr) { - SSDK_ERROR("%s ioremap fail.", __func__); -@@ -1764,7 +1764,7 @@ ssdk_plat_init(ssdk_init_cfg *cfg, a_uin - return -1; - } - -- qca_phy_priv_global[dev_id]->psgmii_hw_addr = ioremap_nocache(map.base_addr, -+ qca_phy_priv_global[dev_id]->psgmii_hw_addr = ioremap(map.base_addr, - map.size); - if (!qca_phy_priv_global[dev_id]->psgmii_hw_addr) { - SSDK_ERROR("%s ioremap fail.", __func__); diff --git a/package/kernel/qca-ssdk/patches/0001-qca807x-add-a-LED-quirk-for-Xiaomi-AX9000.patch b/package/kernel/qca-ssdk/patches/0001-qca807x-add-a-LED-quirk-for-Xiaomi-AX9000.patch new file mode 100644 index 0000000000..da5387dafc --- /dev/null +++ b/package/kernel/qca-ssdk/patches/0001-qca807x-add-a-LED-quirk-for-Xiaomi-AX9000.patch @@ -0,0 +1,67 @@ +From cdcafa28c857e4d04c9210feb54dc84e427061fe Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Tue, 11 Jan 2022 00:28:42 +0100 +Subject: [PATCH 1/2] qca807x: add a LED quirk for Xiaomi AX9000 + +Xiaomi AX9000 has a single LED for each of 4 gigabit ethernet ports that +are connected to QCA8075, and that LED is connected to the 100M LED pin. + +So, by default it will only work when in 10 or 100Mbit mode, this is quite +annoying and makes no sense(If they have connected it to the 1000Mbit LED +pin then it would have worked for 10/100 by default as well). + +So, to solve this add a check for system compatible as we cant parse if +from DTS in any other way and set the 100M LED to blink on 1000Base-T +as well. + +Signed-off-by: Robert Marko +--- + include/hsl/phy/malibu_phy.h | 2 ++ + src/hsl/phy/malibu_phy.c | 11 +++++++++++ + 2 files changed, 13 insertions(+) + +--- a/include/hsl/phy/malibu_phy.h ++++ b/include/hsl/phy/malibu_phy.h +@@ -94,6 +94,7 @@ extern "C" + #define MALIBU_DAC_CTRL_MASK 0x380 + #define MALIBU_DAC_CTRL_VALUE 0x280 + #define MALIBU_LED_1000_CTRL1_100_10_MASK 0x30 ++#define MALIBU_LED_100_CTRL1_1000_MASK 0x40 + + #define MALIBU_PHY_EEE_ADV_100M 0x0002 + #define MALIBU_PHY_EEE_ADV_1000M 0x0004 +@@ -118,6 +119,7 @@ extern "C" + #define MALIBU_PHY_MMD7_EGRESS_COUNTER_HIGH 0x802d + #define MALIBU_PHY_MMD7_EGRESS_COUNTER_LOW 0x802e + #define MALIBU_PHY_MMD7_EGRESS_ERROR_COUNTER 0x802f ++#define MALIBU_PHY_MMD7_LED_100_CTRL1 0x8074 + #define MALIBU_PHY_MMD7_LED_1000_CTRL1 0x8076 + + +--- a/src/hsl/phy/malibu_phy.c ++++ b/src/hsl/phy/malibu_phy.c +@@ -15,6 +15,8 @@ + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + ++#include ++ + #include "sw.h" + #include "fal_port_ctrl.h" + #include "hsl_api.h" +@@ -2716,6 +2718,15 @@ malibu_phy_hw_init(a_uint32_t dev_id, a_ + led_status |= MALIBU_LED_1000_CTRL1_100_10_MASK; + malibu_phy_mmd_write(dev_id, phy_addr, MALIBU_PHY_MMD7_NUM, + MALIBU_PHY_MMD7_LED_1000_CTRL1, led_status); ++ if (of_machine_is_compatible("xiaomi,ax9000")) { ++ /* add 1000M link LED behavior for Xiaomi AX9000 */ ++ led_status = malibu_phy_mmd_read(dev_id, phy_addr, MALIBU_PHY_MMD7_NUM, ++ MALIBU_PHY_MMD7_LED_100_CTRL1); ++ led_status &= ~MALIBU_LED_100_CTRL1_1000_MASK; ++ led_status |= MALIBU_LED_100_CTRL1_1000_MASK; ++ malibu_phy_mmd_write(dev_id, phy_addr, MALIBU_PHY_MMD7_NUM, ++ MALIBU_PHY_MMD7_LED_100_CTRL1, led_status); ++ } + /*disable Extended next page*/ + phy_data = malibu_phy_reg_read(dev_id, phy_addr, MALIBU_AUTONEG_ADVERT); + phy_data &= ~MALIBU_EXTENDED_NEXT_PAGE_EN; diff --git a/package/kernel/qca-ssdk/patches/0002-SSDK-platform-use-of_mdio_find_bus-to-get-MDIO-bus.patch b/package/kernel/qca-ssdk/patches/0002-SSDK-platform-use-of_mdio_find_bus-to-get-MDIO-bus.patch deleted file mode 100644 index 21b3491c6f..0000000000 --- a/package/kernel/qca-ssdk/patches/0002-SSDK-platform-use-of_mdio_find_bus-to-get-MDIO-bus.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 60d2b72cacd43796def9b4bd69a9e0e84be9d2e1 Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Wed, 12 May 2021 17:15:46 +0200 -Subject: [PATCH 02/14] SSDK: platform: use of_mdio_find_bus() to get MDIO bus - -Kernel has a generic of_mdio_find_bus() which can get the appropriate -MDIO bus based on the DT node. -So, drop the getting MDIO from platform data, which no longer works -in 5.4 and later and use of_mdio_find_bus(). - -Signed-off-by: Baruch Siach -Signed-off-by: Robert Marko ---- - src/init/ssdk_plat.c | 8 +------- - 1 file changed, 1 insertion(+), 7 deletions(-) - ---- a/src/init/ssdk_plat.c -+++ b/src/init/ssdk_plat.c -@@ -753,7 +753,6 @@ static int miibus_get(a_uint32_t dev_id) - struct device_node *mdio_node = NULL; - struct device_node *switch_node = NULL; - struct platform_device *mdio_plat = NULL; -- struct qca_mdio_data *mdio_data = NULL; - struct qca_phy_priv *priv; - hsl_reg_mode reg_mode = HSL_REG_LOCAL_BUS; - priv = qca_phy_priv_global[dev_id]; -@@ -788,12 +787,7 @@ static int miibus_get(a_uint32_t dev_id) - - if(reg_mode == HSL_REG_LOCAL_BUS) - { -- mdio_data = dev_get_drvdata(&mdio_plat->dev); -- if (!mdio_data) { -- SSDK_ERROR("cannot get mdio_data reference from device data\n"); -- return 1; -- } -- priv->miibus = mdio_data->mii_bus; -+ priv->miibus = of_mdio_find_bus(mdio_node); - } - else - priv->miibus = dev_get_drvdata(&mdio_plat->dev); diff --git a/package/kernel/qca-ssdk/patches/0002-qca807x-add-a-LED-quirk-for-Xiaomi-AX3600.patch b/package/kernel/qca-ssdk/patches/0002-qca807x-add-a-LED-quirk-for-Xiaomi-AX3600.patch new file mode 100644 index 0000000000..9d456b2399 --- /dev/null +++ b/package/kernel/qca-ssdk/patches/0002-qca807x-add-a-LED-quirk-for-Xiaomi-AX3600.patch @@ -0,0 +1,29 @@ +From a750e569aeb4f7b454dbde18cd6d0f2bb1875dfa Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Wed, 26 Jan 2022 14:47:33 +0100 +Subject: [PATCH 2/2] qca807x: add a LED quirk for Xiaomi AX3600 + +AX3600 requires the same LED quirk so that PHY LED-s will blink even +once Linux resets the PHY. + +So, just check for its compatible. + +Signed-off-by: Robert Marko +--- + src/hsl/phy/malibu_phy.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/src/hsl/phy/malibu_phy.c ++++ b/src/hsl/phy/malibu_phy.c +@@ -2718,8 +2718,9 @@ malibu_phy_hw_init(a_uint32_t dev_id, a_ + led_status |= MALIBU_LED_1000_CTRL1_100_10_MASK; + malibu_phy_mmd_write(dev_id, phy_addr, MALIBU_PHY_MMD7_NUM, + MALIBU_PHY_MMD7_LED_1000_CTRL1, led_status); +- if (of_machine_is_compatible("xiaomi,ax9000")) { +- /* add 1000M link LED behavior for Xiaomi AX9000 */ ++ /* add 1000M link LED behavior for Xiaomi boards */ ++ if (of_machine_is_compatible("xiaomi,ax9000") || ++ of_machine_is_compatible("xiaomi,ax3600")) { + led_status = malibu_phy_mmd_read(dev_id, phy_addr, MALIBU_PHY_MMD7_NUM, + MALIBU_PHY_MMD7_LED_100_CTRL1); + led_status &= ~MALIBU_LED_100_CTRL1_1000_MASK; diff --git a/package/kernel/qca-ssdk/patches/0003-SSDK-dts-fix-of_get_mac_address.patch b/package/kernel/qca-ssdk/patches/0003-SSDK-dts-fix-of_get_mac_address.patch deleted file mode 100644 index c004f4acd8..0000000000 --- a/package/kernel/qca-ssdk/patches/0003-SSDK-dts-fix-of_get_mac_address.patch +++ /dev/null @@ -1,42 +0,0 @@ -From c1b6fa42a160763b574dd52aa4845718e4cd0ea6 Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Fri, 13 Aug 2021 20:03:21 +0200 -Subject: [PATCH 03/14] SSDK: dts: fix of_get_mac_address() - -Recently OpenWrt backported the updated of_get_mac_address() -function which returns and error code instead. - -So, patch the SSDK to use it and fix the compilation error. - -Signed-off-by: Robert Marko ---- - src/init/ssdk_dts.c | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - ---- a/src/init/ssdk_dts.c -+++ b/src/init/ssdk_dts.c -@@ -921,8 +921,9 @@ static void ssdk_dt_parse_intf_mac(void) - { - struct device_node *dp_node = NULL; - a_uint32_t dp = 0; -- a_uint8_t *maddr = NULL; -+ u8 maddr[ETH_ALEN]; - char dp_name[8] = {0}; -+ int ret; - - for (dp = 1; dp <= SSDK_MAX_NR_ETH; dp++) { - snprintf(dp_name, sizeof(dp_name), "dp%d", dp); -@@ -930,11 +931,11 @@ static void ssdk_dt_parse_intf_mac(void) - if (!dp_node) { - continue; - } -- maddr = (a_uint8_t *)of_get_mac_address(dp_node); -+ ret = of_get_mac_address(dp_node, maddr); - #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)) - if (maddr && is_valid_ether_addr(maddr)) { - #else -- if (!IS_ERR(maddr) && is_valid_ether_addr(maddr)) { -+ if (!ret && is_valid_ether_addr(maddr)) { - #endif - ssdk_dt_global.num_intf_mac++; - ether_addr_copy(ssdk_dt_global.intf_mac[dp-1].uc, maddr); diff --git a/package/kernel/qca-ssdk/patches/0004-qca8081-convert-to-5.11-IRQ-model.patch b/package/kernel/qca-ssdk/patches/0004-qca8081-convert-to-5.11-IRQ-model.patch deleted file mode 100644 index 1e496ad981..0000000000 --- a/package/kernel/qca-ssdk/patches/0004-qca8081-convert-to-5.11-IRQ-model.patch +++ /dev/null @@ -1,83 +0,0 @@ -From aaac91b5e8756dce1c0242d58074a0b5d4607b57 Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Fri, 24 Dec 2021 20:02:32 +0100 -Subject: [PATCH 04/14] qca8081: convert to 5.11 IRQ model - -Kernel 5.11 introduced new IRQ handling model for PHY-s, -so provide those if 5.11 or later is used. - -Signed-off-by: Robert Marko ---- - src/hsl/phy/qca808x.c | 46 +++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 46 insertions(+) - ---- a/src/hsl/phy/qca808x.c -+++ b/src/hsl/phy/qca808x.c -@@ -247,6 +247,7 @@ static int qca808x_config_intr(struct ph - return err; - } - -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)) - static int qca808x_ack_interrupt(struct phy_device *phydev) - { - int err; -@@ -266,6 +267,47 @@ static int qca808x_ack_interrupt(struct - - return (err < 0) ? err : 0; - } -+#endif -+ -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(5, 11, 0)) -+static irqreturn_t qca808x_handle_interrupt(struct phy_device *phydev) -+{ -+ a_uint16_t irq_status, int_enabled; -+ a_uint32_t dev_id = 0, phy_id = 0; -+ qca808x_priv *priv = phydev->priv; -+ const struct qca808x_phy_info *pdata = priv->phy_info; -+ -+ if (!pdata) { -+ return SW_FAIL; -+ } -+ -+ dev_id = pdata->dev_id; -+ phy_id = pdata->phy_addr; -+ -+ irq_status = qca808x_phy_reg_read(dev_id, phy_id, -+ QCA808X_PHY_INTR_STATUS); -+ if (irq_status < 0) { -+ phy_error(phydev); -+ return IRQ_NONE; -+ } -+ -+ /* Read the current enabled interrupts */ -+ int_enabled = qca808x_phy_reg_read(dev_id, phy_id, -+ QCA808X_PHY_INTR_MASK); -+ if (int_enabled < 0) { -+ phy_error(phydev); -+ return IRQ_NONE; -+ } -+ -+ /* See if this was one of our enabled interrupts */ -+ if (!(irq_status & int_enabled)) -+ return IRQ_NONE; -+ -+ phy_trigger_machine(phydev); -+ -+ return IRQ_HANDLED; -+} -+#endif - - /* switch linux negtiation capability to fal avariable */ - #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)) -@@ -638,7 +680,11 @@ struct phy_driver qca808x_phy_driver = { - .config_intr = qca808x_config_intr, - .config_aneg = qca808x_config_aneg, - .aneg_done = qca808x_aneg_done, -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)) - .ack_interrupt = qca808x_ack_interrupt, -+#else -+ .handle_interrupt = qca808x_handle_interrupt, -+#endif - .read_status = qca808x_read_status, - .suspend = qca808x_suspend, - .resume = qca808x_resume, diff --git a/package/kernel/qca-ssdk/patches/0005-qca807x-add-a-LED-quirk-for-Xiaomi-AX9000.patch b/package/kernel/qca-ssdk/patches/0005-qca807x-add-a-LED-quirk-for-Xiaomi-AX9000.patch deleted file mode 100644 index 6ff92ab95a..0000000000 --- a/package/kernel/qca-ssdk/patches/0005-qca807x-add-a-LED-quirk-for-Xiaomi-AX9000.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 37255b97a9170f6dd1604931f0d7a8f847be5b5d Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Tue, 11 Jan 2022 00:28:42 +0100 -Subject: [PATCH 05/14] qca807x: add a LED quirk for Xiaomi AX9000 - -Xiaomi AX9000 has a single LED for each of 4 gigabit ethernet ports that -are connected to QCA8075, and that LED is connected to the 100M LED pin. - -So, by default it will only work when in 10 or 100Mbit mode, this is quite -annoying and makes no sense(If they have connected it to the 1000Mbit LED -pin then it would have worked for 10/100 by default as well). - -So, to solve this add a check for system compatible as we cant parse if -from DTS in any other way and set the 100M LED to blink on 1000Base-T -as well. - -Signed-off-by: Robert Marko ---- - include/hsl/phy/malibu_phy.h | 2 ++ - src/hsl/phy/malibu_phy.c | 11 +++++++++++ - 2 files changed, 13 insertions(+) - ---- a/include/hsl/phy/malibu_phy.h -+++ b/include/hsl/phy/malibu_phy.h -@@ -94,6 +94,7 @@ extern "C" - #define MALIBU_DAC_CTRL_MASK 0x380 - #define MALIBU_DAC_CTRL_VALUE 0x280 - #define MALIBU_LED_1000_CTRL1_100_10_MASK 0x30 -+#define MALIBU_LED_100_CTRL1_1000_MASK 0x40 - - #define MALIBU_PHY_EEE_ADV_100M 0x0002 - #define MALIBU_PHY_EEE_ADV_1000M 0x0004 -@@ -118,6 +119,7 @@ extern "C" - #define MALIBU_PHY_MMD7_EGRESS_COUNTER_HIGH 0x802d - #define MALIBU_PHY_MMD7_EGRESS_COUNTER_LOW 0x802e - #define MALIBU_PHY_MMD7_EGRESS_ERROR_COUNTER 0x802f -+#define MALIBU_PHY_MMD7_LED_100_CTRL1 0x8074 - #define MALIBU_PHY_MMD7_LED_1000_CTRL1 0x8076 - - ---- a/src/hsl/phy/malibu_phy.c -+++ b/src/hsl/phy/malibu_phy.c -@@ -15,6 +15,8 @@ - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -+#include -+ - #include "sw.h" - #include "fal_port_ctrl.h" - #include "hsl_api.h" -@@ -2708,6 +2710,15 @@ malibu_phy_hw_init(a_uint32_t dev_id, a_ - led_status |= MALIBU_LED_1000_CTRL1_100_10_MASK; - malibu_phy_mmd_write(dev_id, phy_addr, MALIBU_PHY_MMD7_NUM, - MALIBU_PHY_MMD7_LED_1000_CTRL1, led_status); -+ if (of_machine_is_compatible("xiaomi,ax9000")) { -+ /* add 1000M link LED behavior for Xiaomi AX9000 */ -+ led_status = malibu_phy_mmd_read(dev_id, phy_addr, MALIBU_PHY_MMD7_NUM, -+ MALIBU_PHY_MMD7_LED_100_CTRL1); -+ led_status &= ~MALIBU_LED_100_CTRL1_1000_MASK; -+ led_status |= MALIBU_LED_100_CTRL1_1000_MASK; -+ malibu_phy_mmd_write(dev_id, phy_addr, MALIBU_PHY_MMD7_NUM, -+ MALIBU_PHY_MMD7_LED_100_CTRL1, led_status); -+ } - /*disable Extended next page*/ - phy_data = malibu_phy_reg_read(dev_id, phy_addr, MALIBU_AUTONEG_ADVERT); - phy_data &= ~MALIBU_EXTENDED_NEXT_PAGE_EN; diff --git a/package/kernel/qca-ssdk/patches/0006-qca807x-add-a-LED-quirk-for-Xiaomi-AX3600.patch b/package/kernel/qca-ssdk/patches/0006-qca807x-add-a-LED-quirk-for-Xiaomi-AX3600.patch deleted file mode 100644 index 6e044c7466..0000000000 --- a/package/kernel/qca-ssdk/patches/0006-qca807x-add-a-LED-quirk-for-Xiaomi-AX3600.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 1eaed6c8d72cb07e221a94d05615ae45b60ffd82 Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Wed, 26 Jan 2022 14:47:33 +0100 -Subject: [PATCH 06/14] qca807x: add a LED quirk for Xiaomi AX3600 - -AX3600 requires the same LED quirk so that PHY LED-s will blink even -once Linux resets the PHY. - -So, just check for its compatible. - -Signed-off-by: Robert Marko ---- - src/hsl/phy/malibu_phy.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - ---- a/src/hsl/phy/malibu_phy.c -+++ b/src/hsl/phy/malibu_phy.c -@@ -2710,8 +2710,9 @@ malibu_phy_hw_init(a_uint32_t dev_id, a_ - led_status |= MALIBU_LED_1000_CTRL1_100_10_MASK; - malibu_phy_mmd_write(dev_id, phy_addr, MALIBU_PHY_MMD7_NUM, - MALIBU_PHY_MMD7_LED_1000_CTRL1, led_status); -- if (of_machine_is_compatible("xiaomi,ax9000")) { -- /* add 1000M link LED behavior for Xiaomi AX9000 */ -+ /* add 1000M link LED behavior for Xiaomi boards */ -+ if (of_machine_is_compatible("xiaomi,ax9000") || -+ of_machine_is_compatible("xiaomi,ax3600")) { - led_status = malibu_phy_mmd_read(dev_id, phy_addr, MALIBU_PHY_MMD7_NUM, - MALIBU_PHY_MMD7_LED_100_CTRL1); - led_status &= ~MALIBU_LED_100_CTRL1_1000_MASK; diff --git a/package/kernel/qca-ssdk/patches/0007-include-fix-compilation-error-for-parse_uci_option.patch b/package/kernel/qca-ssdk/patches/0007-include-fix-compilation-error-for-parse_uci_option.patch deleted file mode 100644 index 6b084a844d..0000000000 --- a/package/kernel/qca-ssdk/patches/0007-include-fix-compilation-error-for-parse_uci_option.patch +++ /dev/null @@ -1,22 +0,0 @@ -From adc75660a50c5b7a16032921a30a0eaedc8b826f Mon Sep 17 00:00:00 2001 -From: Ansuel Smith -Date: Sat, 7 May 2022 19:03:55 +0200 -Subject: [PATCH 07/14] include: fix compilation error for parse_uci_option - -Fix missing include for parse_uci_option - -Signed-off-by: Ansuel Smith ---- - include/ref/ref_uci.h | 1 + - 1 file changed, 1 insertion(+) - ---- a/include/ref/ref_uci.h -+++ b/include/ref/ref_uci.h -@@ -22,6 +22,7 @@ - extern "C" { - #endif /* __cplusplus */ - -+#include - - #if defined(IN_SWCONFIG) - int diff --git a/package/kernel/qca-ssdk/patches/0008-QSDK-config-Avoid-Werror-heroics.patch b/package/kernel/qca-ssdk/patches/0008-QSDK-config-Avoid-Werror-heroics.patch deleted file mode 100644 index 30b4e4be4f..0000000000 --- a/package/kernel/qca-ssdk/patches/0008-QSDK-config-Avoid-Werror-heroics.patch +++ /dev/null @@ -1,30 +0,0 @@ -From d70d013ac1090565ebb71875f5bdc70840807428 Mon Sep 17 00:00:00 2001 -From: Alexandru Gagniuc -Date: Fri, 23 Sep 2022 08:21:13 -0500 -Subject: [PATCH 08/14] QSDK: config: Avoid -Werror heroics - -Trying to compile the QSDK with warnings as errors is a very brave -endeavor. It's also stupid as it doesn't work on ipq60xx: - - isisc_acl_prv.h:99: error: "FIELD_GET" redefined [-Werror] - 99 | #define FIELD_GET(reg, field, val) \ - | - -Instead of dealing with the braindead code, just disable Werror. - -Signed-off-by: Alexandru Gagniuc ---- - config | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/config -+++ b/config -@@ -133,7 +133,7 @@ endif - - ifeq ($(ARCH), arm64) - ifeq ($(KVER),$(filter 4.1% 4.4% 4.9% 5.4%,$(KVER))) -- CPU_CFLAG= -DMODULE -Os -pipe -march=armv8-a -mcpu=cortex-a53+crypto -fno-caller-saves -fno-strict-aliasing -Werror -fno-common -Wno-format-security -Wno-pointer-sign -Wno-unused-but-set-variable -Wno-error=unused-result -mcmodel=large -+ CPU_CFLAG= -DMODULE -Os -pipe -march=armv8-a -mcpu=cortex-a53+crypto -fno-caller-saves -fno-strict-aliasing -fno-common -Wno-format-security -Wno-pointer-sign -Wno-unused-but-set-variable -Wno-error=unused-result -mcmodel=large - endif - endif - diff --git a/package/kernel/qca-ssdk/patches/0009-Revert-qca-ssdk-remove-bridge-fdb-entry-for-the-auth.patch b/package/kernel/qca-ssdk/patches/0009-Revert-qca-ssdk-remove-bridge-fdb-entry-for-the-auth.patch deleted file mode 100644 index 92c46a815e..0000000000 --- a/package/kernel/qca-ssdk/patches/0009-Revert-qca-ssdk-remove-bridge-fdb-entry-for-the-auth.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 0582c76ce9c35ce8d49cba598e0e17073dd875b5 Mon Sep 17 00:00:00 2001 -From: Alexandru Gagniuc -Date: Fri, 23 Sep 2022 08:30:03 -0500 -Subject: [PATCH 09/14] Revert "qca-ssdk: remove bridge fdb entry for the - authentication failed mac" - -This change causes an undefined reference to "br_fdb_delete_by_netdev". -This reverts commit 144f02b982c8c707aaf84b57d8c277d03d877236. - -Signed-off-by: Alexandru Gagniuc ---- - src/ref/ref_acl.c | 11 ----------- - 1 file changed, 11 deletions(-) - ---- a/src/ref/ref_acl.c -+++ b/src/ref/ref_acl.c -@@ -23,7 +23,6 @@ - #include "ssdk_init.h" - #include "ssdk_plat.h" - #include --#include - - /* entry 0-1 is for global deny all and accept eapol rule - entry 2-9 is for phy port1 specific mac accept rule -@@ -128,7 +127,6 @@ _ref_acl_mac_entry_create_rule(a_uint32_ - { - sw_error_t rv = SW_OK; - fal_acl_rule_t rule = {0}; -- struct net_device *eth_dev = NULL; - a_uint32_t port_id = ssdk_ifname_to_port(dev_id, entry->ifname); - SSDK_DEBUG("port_id %d entry_idx %d\n", port_id, entry_idx); - -@@ -224,15 +222,6 @@ _ref_acl_mac_entry_create_rule(a_uint32_ - ref_acl_mac_entry[dev_id][entry_idx].port_map = BIT(port_id); - ref_acl_mac_entry[dev_id][entry_idx].acl_policy = 1; - } -- else if (!is_deny_all_mac(entry->src_mac.uc) && !entry->acl_policy) -- { -- eth_dev = dev_get_by_name(&init_net, entry->ifname); -- if (eth_dev) -- { -- br_fdb_delete_by_netdev(eth_dev, entry->src_mac.uc, 0); -- dev_put(eth_dev); -- } -- } - return rv; - } - diff --git a/package/kernel/qca-ssdk/patches/0010-Support-Linux-Style-Makefile-for-SSDK.patch b/package/kernel/qca-ssdk/patches/0010-Support-Linux-Style-Makefile-for-SSDK.patch deleted file mode 100644 index 180701bb14..0000000000 --- a/package/kernel/qca-ssdk/patches/0010-Support-Linux-Style-Makefile-for-SSDK.patch +++ /dev/null @@ -1,281 +0,0 @@ -From 2276a0b93751f015ef719dedf9a0d4b55ae684d5 Mon Sep 17 00:00:00 2001 -From: crao -Date: Tue, 15 Nov 2022 18:50:01 +0800 -Subject: [PATCH 10/14] Support Linux-Style Makefile for SSDK - -Change-Id: I8c4399433b6422ef6192f70bf08b0d3023cc94b6 -Signed-off-by: crao ---- - Makefile | 15 +++++++++++++ - Makefile.modules | 16 ++++++++++++++ - make/defs.mk | 1 + - make/linux_opt.mk | 54 ++++++++++++++++++++++++++++------------------- - make/target.mk | 12 +++++++++++ - src/api/Makefile | 2 +- - 6 files changed, 77 insertions(+), 23 deletions(-) - create mode 100644 Makefile.modules - ---- a/Makefile -+++ b/Makefile -@@ -12,6 +12,9 @@ include ./make/$(OS)_opt.mk - SUB_DIR=$(patsubst %/, %, $(dir $(wildcard src/*/Makefile))) - SUB_LIB=$(subst src/, , $(SUB_DIR)) - -+#################################################################### -+# SSDK-Style Makefile -+#################################################################### - all: $(BIN_DIR) kslib - mkdir -p ./temp/;cd ./temp;cp ../build/bin/ssdk_ks_km.a ./;ar -x ssdk_ks_km.a; cp ../ko_Makefile ./Makefile; - make -C $(SYS_PATH) M=$(PRJ_PATH)/temp/ CROSS_COMPILE=$(TOOLPREFIX) modules -@@ -20,6 +23,18 @@ all: $(BIN_DIR) kslib - rm -Rf ./temp/*.o ./temp/*.ko ./temp/*.a - @echo "---Build [SSDK-$(VERSION)] at $(BUILD_DATE) finished." - -+#################################################################### -+# LNX Modules-Style Makefile -+#################################################################### -+modules: $(BIN_DIR) kslib_c -+ cp Makefile.modules ./Makefile; -+ make -C $(SYS_PATH) M=$(PRJ_PATH)/ $(LNX_MAKEOPTS) modules -+ cp *.ko build/bin; -+ @echo "---Build [SSDK-$(VERSION)] at $(BUILD_DATE) finished." -+ -+kslib_c: -+ $(foreach i, $(SUB_LIB), $(MAKE) MODULE_TYPE=KSLIB -C src/$i src_list_loop || exit 1;) -+ - kslib:kslib_o - $(AR) -r $(BIN_DIR)/$(KS_MOD)_$(RUNMODE).a $(wildcard $(BLD_DIR)/KSLIB/*.o) - ---- /dev/null -+++ b/Makefile.modules -@@ -0,0 +1,16 @@ -+#################################################################### -+# Add All Local Flags -+#################################################################### -+ccflags-y += $(LNX_LOCAL_CFLAGS) -Wno-error -+ -+#################################################################### -+# Build Object List -+#################################################################### -+SRC_LIST := $(shell cat $(PRJ_PATH)/src_list.dep) -+OBJ_LIST := $(patsubst %.c,%.o,$(SRC_LIST)) -+ -+#################################################################### -+# Linux Kernel Module -+#################################################################### -+obj-m := qca-ssdk.o -+qca-ssdk-objs := $(OBJ_LIST) ---- a/make/defs.mk -+++ b/make/defs.mk -@@ -7,6 +7,7 @@ ifeq (,$(findstring $(LIB), $(COMPONENTS - endif - - SRC_FILE=$(addprefix $(PRJ_PATH)/$(LOC_DIR)/, $(SRC_LIST)) -+LOC_SRC_FILE=$(addprefix $(LOC_DIR)/, $(SRC_LIST)) - - OBJ_LIST=$(SRC_LIST:.c=.o) - OBJ_FILE=$(addprefix $(DST_DIR)/, $(OBJ_LIST)) ---- a/make/linux_opt.mk -+++ b/make/linux_opt.mk -@@ -295,7 +295,7 @@ ifeq (TRUE, $(DEBUG_ON)) - MODULE_CFLAG += -g - endif - --MODULE_CFLAG += $(OPT_FLAG) -Wall -DVERSION=\"$(VERSION)\" -DBUILD_DATE=\"$(BUILD_DATE)\" -DOS=\"$(OS)\" -D"KBUILD_STR(s)=\#s" -D"KBUILD_MODNAME=KBUILD_STR(qca-ssdk)" -+MODULE_CFLAG += $(OPT_FLAG) -Wall -DVERSION=\"$(VERSION)\" -DBUILD_DATE=\"$(BUILD_DATE)\" -DOS=\"$(OS)\" -D"KBUILD_STR(s)=\#s" - - MODULE_INC += -I$(PRJ_PATH)/include \ - -I$(PRJ_PATH)/include/common \ -@@ -450,7 +450,7 @@ ifeq (KSLIB, $(MODULE_TYPE)) - MODULE_CFLAG += -DKVER34 - MODULE_CFLAG += -DKVER32 - MODULE_CFLAG += -DLNX26_22 -- MODULE_INC += -I$(SYS_PATH) \ -+ SYS_INC += -I$(SYS_PATH) \ - -I$(TOOL_PATH)/../lib/gcc/$(TARGET_NAME)/$(GCC_VERSION)/include/ \ - -I$(SYS_PATH)/include \ - -I$(SYS_PATH)/source/include \ -@@ -473,7 +473,7 @@ ifeq (KSLIB, $(MODULE_TYPE)) - MODULE_CFLAG += -DKVER32 - MODULE_CFLAG += -DLNX26_22 - ifeq ($(ARCH), arm64) -- MODULE_INC += -I$(SYS_PATH) \ -+ SYS_INC += -I$(SYS_PATH) \ - -I$(TOOL_PATH)/../lib/gcc/$(TARGET_NAME)/$(GCC_VERSION)/include/ \ - -I$(SYS_PATH)/include \ - -I$(SYS_PATH)/source \ -@@ -492,13 +492,13 @@ ifeq (KSLIB, $(MODULE_TYPE)) - -I$(SYS_PATH)/source/include/uapi - - ifneq ($(wildcard $(SYS_PATH)/include/linux/kconfig.h),) -- MODULE_INC += -include $(SYS_PATH)/include/linux/kconfig.h -+ SYS_INC += -include $(SYS_PATH)/include/linux/kconfig.h - else -- MODULE_INC += -include $(KERNEL_SRC)/include/linux/kconfig.h -+ SYS_INC += -include $(KERNEL_SRC)/include/linux/kconfig.h - endif - - else ifeq ($(ARCH), arm) -- MODULE_INC += -I$(SYS_PATH) \ -+ SYS_INC += -I$(SYS_PATH) \ - -I$(TOOL_PATH)/../lib/gcc/$(TARGET_NAME)/$(GCC_VERSION)/include/ \ - -I$(TOOL_PATH)/../lib/gcc/$(TARGET_NAME)/7.5.0/include/ \ - -I$(TOOL_PATH)/../../lib/armv7a-vfp-neon-rdk-linux-gnueabi/gcc/arm-rdk-linux-gnueabi/4.8.4/include/ \ -@@ -522,13 +522,13 @@ ifeq (KSLIB, $(MODULE_TYPE)) - -I$(TOOL_PATH)/../../lib/arm-rdk-linux-gnueabi/gcc/arm-rdk-linux-gnueabi/9.3.0/include/ - - ifneq ($(wildcard $(SYS_PATH)/include/linux/kconfig.h),) -- MODULE_INC += -include $(SYS_PATH)/include/linux/kconfig.h -+ SYS_INC += -include $(SYS_PATH)/include/linux/kconfig.h - else -- MODULE_INC += -include $(KERNEL_SRC)/include/linux/kconfig.h -+ SYS_INC += -include $(KERNEL_SRC)/include/linux/kconfig.h - endif - - else -- MODULE_INC += -I$(SYS_PATH) \ -+ SYS_INC += -I$(SYS_PATH) \ - -I$(TOOL_PATH)/../lib/gcc/$(TARGET_NAME)/$(GCC_VERSION)/include/ \ - -I$(SYS_PATH)/include \ - -I$(SYS_PATH)/source \ -@@ -564,7 +564,7 @@ ifeq (KSLIB, $(MODULE_TYPE)) - MODULE_CFLAG += -DLNX26_22 - ifeq ($(ARCH), arm64) - KCONF_FILE = $(SYS_PATH)/source/include/linux/kconfig.h -- MODULE_INC += -I$(SYS_PATH) \ -+ SYS_INC += -I$(SYS_PATH) \ - -I$(TOOL_PATH)/../lib/gcc/$(TARGET_NAME)/$(GCC_VERSION)/include/ \ - -I$(SYS_PATH)/include \ - -I$(SYS_PATH)/source/include \ -@@ -581,7 +581,7 @@ ifeq (KSLIB, $(MODULE_TYPE)) - -I$(SYS_PATH)/source/arch/arm64/include/asm/mach \ - -include $(KCONF_FILE) - else ifeq ($(ARCH), arm) -- MODULE_INC += -I$(SYS_PATH) \ -+ SYS_INC += -I$(SYS_PATH) \ - -I$(TOOL_PATH)/../lib/gcc/$(TARGET_NAME)/$(GCC_VERSION)/include/ \ - -I$(TOOL_PATH)/../../lib/armv7a-vfp-neon-rdk-linux-gnueabi/gcc/arm-rdk-linux-gnueabi/4.8.4/include/ \ - -I$(SYS_PATH)/include \ -@@ -604,7 +604,7 @@ ifeq (KSLIB, $(MODULE_TYPE)) - MODULE_CFLAG += -DKVER34 - MODULE_CFLAG += -DKVER32 - MODULE_CFLAG += -DLNX26_22 -- MODULE_INC += -I$(SYS_PATH) \ -+ SYS_INC += -I$(SYS_PATH) \ - -I$(TOOL_PATH)/../lib/gcc/$(TARGET_NAME)/$(GCC_VERSION)/include/ \ - -I$(TOOL_PATH)/../../lib/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/5.3.0/include/ \ - -I$(TOOL_PATH)/../../lib/armv7a-vfp-neon-rdk-linux-gnueabi/gcc/arm-rdk-linux-gnueabi/4.8.4/include/ \ -@@ -627,10 +627,10 @@ ifeq (KSLIB, $(MODULE_TYPE)) - -I$(EXT_PATH) \ - -I$(SYS_PATH)/source/arch/arm/include/asm/mach - ifneq ($(wildcard $(SYS_PATH)/include/linux/kconfig.h),) -- MODULE_INC += \ -+ SYS_INC += \ - -include $(SYS_PATH)/include/linux/kconfig.h - else -- MODULE_INC += \ -+ SYS_INC += \ - -include $(SYS_PATH)/source/include/linux/kconfig.h - endif - -@@ -641,7 +641,7 @@ ifeq (KSLIB, $(MODULE_TYPE)) - MODULE_CFLAG += -DKVER32 - MODULE_CFLAG += -DLNX26_22 - MODULE_CFLAG += -Werror -- MODULE_INC += -I$(SYS_PATH) \ -+ SYS_INC += -I$(SYS_PATH) \ - -I$(SYS_PATH)/include \ - -I$(SYS_PATH)/source/include \ - -I$(SYS_PATH)/source/arch/arm/mach-msm/include \ -@@ -657,7 +657,7 @@ ifeq (KSLIB, $(MODULE_TYPE)) - MODULE_CFLAG += -DKVER32 - MODULE_CFLAG += -DLNX26_22 - ifeq (mips, $(CPU)) -- MODULE_INC += -I$(SYS_PATH) \ -+ SYS_INC += -I$(SYS_PATH) \ - -I$(SYS_PATH)/include \ - -I$(SYS_PATH)/arch/mips/include \ - -I$(SYS_PATH)/arch/mips/include/asm/mach-ar7240 \ -@@ -678,7 +678,7 @@ ifeq (KSLIB, $(MODULE_TYPE)) - -O2 -fno-pic -pipe -mabi=32 -march=mips32r2 -DMODULE -mlong-calls -DEXPORT_SYMTAB - endif - else -- MODULE_INC += -I$(SYS_PATH) \ -+ SYS_INC += -I$(SYS_PATH) \ - -I$(SYS_PATH)/include \ - -I$(SYS_PATH)/arch/arm/include \ - -I$(SYS_PATH)/arch/arm/include/asm \ -@@ -695,7 +695,7 @@ ifeq (KSLIB, $(MODULE_TYPE)) - MODULE_CFLAG += -DKVER26 - MODULE_CFLAG += -DLNX26_22 - ifeq (mips, $(CPU)) -- MODULE_INC += -I$(SYS_PATH) \ -+ SYS_INC += -I$(SYS_PATH) \ - -I$(SYS_PATH)/include \ - -I$(SYS_PATH)/arch/mips/include \ - -I$(SYS_PATH)/arch/mips/include/asm/mach-ar7240 \ -@@ -708,7 +708,7 @@ ifeq (KSLIB, $(MODULE_TYPE)) - -O2 -fno-pic -pipe -mabi=32 -march=mips32r2 -DMODULE -mlong-calls -DEXPORT_SYMTAB - endif - else -- MODULE_INC += -I$(SYS_PATH) \ -+ SYS_INC += -I$(SYS_PATH) \ - -I$(SYS_PATH)/include \ - -I$(SYS_PATH)/arch/arm/include \ - -I$(SYS_PATH)/arch/arm/include/asm \ -@@ -721,8 +721,7 @@ ifeq (KSLIB, $(MODULE_TYPE)) - - endif - -- MODULE_CFLAG += -D__KERNEL__ -DKERNEL_MODULE $(CPU_CFLAG) -- -+ MODULE_CFLAG += -D__KERNEL__ -DKERNEL_MODULE - - endif - -@@ -748,4 +747,15 @@ ifneq (TRUE, $(KERNEL_MODE)) - endif - endif - --LOCAL_CFLAGS += $(MODULE_INC) $(MODULE_CFLAG) $(EXTRA_CFLAGS) -+LOCAL_CFLAGS += $(MODULE_INC) $(SYS_INC) $(MODULE_CFLAG) $(EXTRA_CFLAGS) -+ -+#################################################################### -+# cflags for SSDK-Style Makefile -+#################################################################### -+LOCAL_CFLAGS += $(CPU_CFLAG) -D"KBUILD_MODNAME=KBUILD_STR(qca-ssdk)" -+ -+#################################################################### -+# cflags for LNX Modules-Style Makefile -+#################################################################### -+LNX_LOCAL_CFLAGS += $(MODULE_INC) $(MODULE_CFLAG) ${EXTRA_INC} -+export LNX_LOCAL_CFLAGS ---- a/make/target.mk -+++ b/make/target.mk -@@ -3,6 +3,18 @@ include $(PRJ_PATH)/make/$(OS)_opt.mk - - include $(PRJ_PATH)/make/tools.mk - -+#################################################################### -+# LNX Modules-Style Makefile -+#################################################################### -+src_list_loop: src_list -+ $(foreach i, $(SUB_DIR), $(MAKE) -C $(i) src_list_loop || exit 1;) -+ -+src_list: -+ echo -n "$(LOC_SRC_FILE) " >> $(PRJ_PATH)/src_list.dep -+ -+#################################################################### -+# SSDK-Style Makefile -+#################################################################### - obj: $(OBJ_LIST) - $(OBJ_LOOP) - ---- a/src/api/Makefile -+++ b/src/api/Makefile -@@ -1,4 +1,4 @@ --LOC_DIR=src/sal -+LOC_DIR=src/api - LIB=API - - include $(PRJ_PATH)/make/config.mk diff --git a/package/kernel/qca-ssdk/patches/0011-fix-compilation-issue-in-Linux-Style-Makefile.patch b/package/kernel/qca-ssdk/patches/0011-fix-compilation-issue-in-Linux-Style-Makefile.patch deleted file mode 100644 index f7d07a7baf..0000000000 --- a/package/kernel/qca-ssdk/patches/0011-fix-compilation-issue-in-Linux-Style-Makefile.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 46a5dd73195081b5d78582f2a13f83e49f36e917 Mon Sep 17 00:00:00 2001 -From: crao -Date: Tue, 7 Mar 2023 17:15:07 +0800 -Subject: [PATCH 11/14] fix compilation issue in Linux-Style Makefile - -Change-Id: If38251fc0a2bf4abc666d30f4812c0d9507310dc -Signed-off-by: crao ---- - Makefile | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - ---- a/Makefile -+++ b/Makefile -@@ -27,9 +27,9 @@ all: $(BIN_DIR) kslib - # LNX Modules-Style Makefile - #################################################################### - modules: $(BIN_DIR) kslib_c -- cp Makefile.modules ./Makefile; -- make -C $(SYS_PATH) M=$(PRJ_PATH)/ $(LNX_MAKEOPTS) modules -- cp *.ko build/bin; -+ mkdir -p ./temp/;cp * ./temp -a;cd ./temp;cp ../Makefile.modules ./Makefile; -+ make -C $(SYS_PATH) M=$(PRJ_PATH)/temp $(LNX_MAKEOPTS) modules -+ cp temp/*.ko build/bin; - @echo "---Build [SSDK-$(VERSION)] at $(BUILD_DATE) finished." - - kslib_c: diff --git a/package/kernel/qca-ssdk/patches/0012-fix-compilation-issue-in-Miami-yocto.patch b/package/kernel/qca-ssdk/patches/0012-fix-compilation-issue-in-Miami-yocto.patch deleted file mode 100644 index 7670d7f354..0000000000 --- a/package/kernel/qca-ssdk/patches/0012-fix-compilation-issue-in-Miami-yocto.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 0060aa1b0d2530672e64708d8062b3f33d007ed3 Mon Sep 17 00:00:00 2001 -From: crao -Date: Wed, 15 Mar 2023 11:19:39 +0800 -Subject: [PATCH 12/14] fix compilation issue in Miami yocto - -Change-Id: I8526b9e43667d72ae9afa4ef8a13167088d194ba -Signed-off-by: crao ---- - Makefile | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/Makefile -+++ b/Makefile -@@ -29,7 +29,9 @@ all: $(BIN_DIR) kslib - modules: $(BIN_DIR) kslib_c - mkdir -p ./temp/;cp * ./temp -a;cd ./temp;cp ../Makefile.modules ./Makefile; - make -C $(SYS_PATH) M=$(PRJ_PATH)/temp $(LNX_MAKEOPTS) modules -+ cp $(PRJ_PATH)/temp/Module.symvers $(PRJ_PATH)/Module.symvers; - cp temp/*.ko build/bin; -+ rm -Rf ./temp/*.o ./temp/*.ko ./temp/*.a - @echo "---Build [SSDK-$(VERSION)] at $(BUILD_DATE) finished." - - kslib_c: diff --git a/package/kernel/qca-ssdk/patches/0013-SSDK-config-add-kernel-6.1.patch b/package/kernel/qca-ssdk/patches/0013-SSDK-config-add-kernel-6.1.patch deleted file mode 100644 index 44b5e625ee..0000000000 --- a/package/kernel/qca-ssdk/patches/0013-SSDK-config-add-kernel-6.1.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 05aba6d6dfd49fe10b33cf221b7e81250a67033c Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Thu, 29 Sep 2022 09:59:20 +0200 -Subject: [PATCH 13/14] SSDK: config: add kernel 6.1 - -Allow kernel 6.1 to be recognized and compiled under it. - -Signed-off-by: Robert Marko ---- - config | 6 +++++- - make/linux_opt.mk | 4 ++-- - 2 files changed, 7 insertions(+), 3 deletions(-) - ---- a/config -+++ b/config -@@ -24,6 +24,10 @@ ifeq ($(KVER),$(filter 5.4%,$(KVER))) - OS_VER=5_4 - endif - -+ifeq ($(KVER),$(filter 6.1%,$(KVER))) -+ OS_VER=6_1 -+endif -+ - ifeq ($(KVER), 3.4.0) - OS_VER=3_4 - endif -@@ -132,7 +136,7 @@ ifeq ($(ARCH), arm) - endif - - ifeq ($(ARCH), arm64) -- ifeq ($(KVER),$(filter 4.1% 4.4% 4.9% 5.4%,$(KVER))) -+ ifeq ($(KVER),$(filter 4.1% 4.4% 4.9% 5.4% 6.1%,$(KVER))) - CPU_CFLAG= -DMODULE -Os -pipe -march=armv8-a -mcpu=cortex-a53+crypto -fno-caller-saves -fno-strict-aliasing -fno-common -Wno-format-security -Wno-pointer-sign -Wno-unused-but-set-variable -Wno-error=unused-result -mcmodel=large - endif - endif ---- a/make/linux_opt.mk -+++ b/make/linux_opt.mk -@@ -437,7 +437,7 @@ ifeq (KSLIB, $(MODULE_TYPE)) - KASAN_SHADOW_SCALE_SHIFT := 3 - endif - -- ifeq (5_4, $(OS_VER)) -+ ifeq (5_4 6_1, $(OS_VER)) - ifeq ($(ARCH), arm64) - KASAN_OPTION += -DKASAN_SHADOW_SCALE_SHIFT=$(KASAN_SHADOW_SCALE_SHIFT) - endif -@@ -468,7 +468,7 @@ ifeq (KSLIB, $(MODULE_TYPE)) - - endif - -- ifeq ($(OS_VER),$(filter 4_4 5_4, $(OS_VER))) -+ ifeq ($(OS_VER),$(filter 4_4 5_4 6_1, $(OS_VER))) - MODULE_CFLAG += -DKVER34 - MODULE_CFLAG += -DKVER32 - MODULE_CFLAG += -DLNX26_22 diff --git a/package/kernel/qca-ssdk/patches/0014-SSDK-qca808x-use-get_random_u32.patch b/package/kernel/qca-ssdk/patches/0014-SSDK-qca808x-use-get_random_u32.patch deleted file mode 100644 index f5aa0e907c..0000000000 --- a/package/kernel/qca-ssdk/patches/0014-SSDK-qca808x-use-get_random_u32.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 6a49dd6bb2e40ce49351adb6100599f176d80494 Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Fri, 21 Oct 2022 13:40:15 +0200 -Subject: [PATCH 14/14] SSDK: qca808x: use get_random_u32 - -prandom has been removed from the kernel in 6.1-rc1, so use get_random_u32 -instead as its the drop-in replacement. - -Signed-off-by: Robert Marko ---- - src/hsl/phy/qca808x_phy.c | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/src/hsl/phy/qca808x_phy.c -+++ b/src/hsl/phy/qca808x_phy.c -@@ -299,7 +299,11 @@ qca808x_phy_ms_random_seed_set(a_uint32_ - phy_data = qca808x_phy_debug_read(dev_id, phy_id, - QCA808X_DEBUG_LOCAL_SEED); - phy_data &= ~(QCA808X_MASTER_SLAVE_SEED_CFG); -+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) - phy_data |= (prandom_u32()%QCA808X_MASTER_SLAVE_SEED_RANGE) << 2; -+#else -+ phy_data |= (get_random_u32()%QCA808X_MASTER_SLAVE_SEED_RANGE) << 2; -+#endif - SSDK_DEBUG("QCA808X_DEBUG_LOCAL_SEED:%x\n", phy_data); - rv = qca808x_phy_debug_write(dev_id, phy_id, - QCA808X_DEBUG_LOCAL_SEED, phy_data);