Skip to content

Commit

Permalink
kernel: qca-ssdk: update to QSDK 12.1.5.r3
Browse files Browse the repository at this point in the history
This "newer" version allows using 3rd party PHYs that are already
supported in the upstream kernel. Some devices use non-QCA PHYs, and
thus must rely on the kernel PHY drivers instead.

Signed-off-by: Alexandru Gagniuc <[email protected]>
  • Loading branch information
mrnuke authored and robimarko committed Oct 4, 2022
1 parent 30ee62e commit 679200d
Show file tree
Hide file tree
Showing 12 changed files with 124 additions and 46 deletions.
6 changes: 3 additions & 3 deletions package/kernel/qca-ssdk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ PKG_RELEASE:=$(AUTORELEASE)

PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/qca-ssdk.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2022-04-07
PKG_SOURCE_VERSION:=62955de3c838028d3f72313eef99c57fa4babb71
PKG_MIRROR_HASH:=84c7de6d1ce82fb15acebea0e44158695a33ed6f18335da32ec9f248dcb4b285
PKG_SOURCE_DATE:=2022-09-12
PKG_SOURCE_VERSION:=628b22bc3d5ee81414b75ab3de6a255c82754dec
PKG_MIRROR_HASH:=859344f79504b9953639dc5aa27042249f68e3a9a269e66d7f7a25e1ab38c110

include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 472c0c8132784608312c80c4b02c03ea7c132235 Mon Sep 17 00:00:00 2001
From 6ee395e1cab32d1d4899d7846ea99e6e2dc0a9e4 Mon Sep 17 00:00:00 2001
From: Robert Marko <[email protected]>
Date: Wed, 12 May 2021 13:41:12 +0200
Subject: [PATCH] SSDK: config: add kernel 5.10
Subject: [PATCH 01/11] SSDK: config: add kernel 5.10

This is purely to identify it and be able to set
flags correctly.
Expand Down Expand Up @@ -36,7 +36,7 @@ Signed-off-by: Robert Marko <[email protected]>
endif
--- a/make/linux_opt.mk
+++ b/make/linux_opt.mk
@@ -422,7 +422,7 @@ ifeq (KSLIB, $(MODULE_TYPE))
@@ -437,7 +437,7 @@ ifeq (KSLIB, $(MODULE_TYPE))
KASAN_SHADOW_SCALE_SHIFT := 3
endif

Expand All @@ -45,7 +45,7 @@ Signed-off-by: Robert Marko <[email protected]>
ifeq ($(ARCH), arm64)
KASAN_OPTION += -DKASAN_SHADOW_SCALE_SHIFT=$(KASAN_SHADOW_SCALE_SHIFT)
endif
@@ -453,7 +453,7 @@ ifeq (KSLIB, $(MODULE_TYPE))
@@ -468,7 +468,7 @@ ifeq (KSLIB, $(MODULE_TYPE))

endif

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 784f2cfdfaf3bdf44917924e157049230a0ef5f8 Mon Sep 17 00:00:00 2001
From 845a89b05aae807fb837f8e8f27f95c89de6023f Mon Sep 17 00:00:00 2001
From: Robert Marko <[email protected]>
Date: Wed, 12 May 2021 13:45:45 +0200
Subject: [PATCH] SSDK: replace ioremap_nocache with ioremap
Subject: [PATCH 02/11] SSDK: replace ioremap_nocache with ioremap

ioremap_nocache was dropped upstream, simply use the
generic variety.
Expand All @@ -15,7 +15,7 @@ Signed-off-by: Robert Marko <[email protected]>

--- a/src/init/ssdk_clk.c
+++ b/src/init/ssdk_clk.c
@@ -700,7 +700,7 @@ ssdk_mp_tcsr_get(a_uint32_t tcsr_offset,
@@ -721,7 +721,7 @@ ssdk_mp_tcsr_get(a_uint32_t tcsr_offset,
{
void __iomem *tcsr_base = NULL;

Expand All @@ -24,7 +24,7 @@ Signed-off-by: Robert Marko <[email protected]>
if (!tcsr_base)
{
SSDK_ERROR("Failed to map tcsr eth address!\n");
@@ -717,7 +717,7 @@ ssdk_mp_tcsr_set(a_uint32_t tcsr_offset,
@@ -738,7 +738,7 @@ ssdk_mp_tcsr_set(a_uint32_t tcsr_offset,
{
void __iomem *tcsr_base = NULL;

Expand All @@ -33,7 +33,7 @@ Signed-off-by: Robert Marko <[email protected]>
if (!tcsr_base)
{
SSDK_ERROR("Failed to map tcsr eth address!\n");
@@ -765,7 +765,7 @@ ssdk_mp_cmnblk_stable_check(void)
@@ -786,7 +786,7 @@ ssdk_mp_cmnblk_stable_check(void)
a_uint32_t reg_val;
int i, loops = 20;

Expand All @@ -42,7 +42,7 @@ Signed-off-by: Robert Marko <[email protected]>
if (!pll_lock) {
SSDK_ERROR("Failed to map CMN PLL LOCK register!\n");
return A_FALSE;
@@ -822,7 +822,7 @@ static void ssdk_cmnblk_pll_src_set(enum
@@ -843,7 +843,7 @@ static void ssdk_cmnblk_pll_src_set(enum
void __iomem *cmn_pll_src_base = NULL;
a_uint32_t reg_val;

Expand All @@ -51,9 +51,9 @@ Signed-off-by: Robert Marko <[email protected]>
if (!cmn_pll_src_base) {
SSDK_ERROR("Failed to map cmn pll source address!\n");
return;
@@ -843,7 +843,7 @@ static void ssdk_cmnblk_init(enum cmnblk
void __iomem *gcc_pll_base = NULL;
a_uint32_t reg_val;
@@ -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);
Expand All @@ -62,7 +62,7 @@ Signed-off-by: Robert Marko <[email protected]>
return;
--- a/src/init/ssdk_init.c
+++ b/src/init/ssdk_init.c
@@ -2945,7 +2945,7 @@ static int ssdk_dess_mac_mode_init(a_uin
@@ -3134,7 +3134,7 @@ static int ssdk_dess_mac_mode_init(a_uin
(a_uint8_t *)&reg_value, 4);
mdelay(10);
/*softreset psgmii, fixme*/
Expand All @@ -73,7 +73,7 @@ Signed-off-by: Robert Marko <[email protected]>
return 0;
--- a/src/init/ssdk_plat.c
+++ b/src/init/ssdk_plat.c
@@ -1372,7 +1372,7 @@ ssdk_plat_init(ssdk_init_cfg *cfg, a_uin
@@ -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);
Expand All @@ -82,16 +82,16 @@ Signed-off-by: Robert Marko <[email protected]>
map.size);
if (!qca_phy_priv_global[dev_id]->uniphy_hw_addr) {
SSDK_ERROR("%s ioremap fail.", __func__);
@@ -1387,7 +1387,7 @@ ssdk_plat_init(ssdk_init_cfg *cfg, a_uin
@@ -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) {
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__);
@@ -1420,7 +1420,7 @@ ssdk_plat_init(ssdk_init_cfg *cfg, a_uin
@@ -1764,7 +1764,7 @@ ssdk_plat_init(ssdk_init_cfg *cfg, a_uin
return -1;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From b6190ca46287d01a895c7cc14de30410c09ff1b8 Mon Sep 17 00:00:00 2001
From 85f988dbc15559a5a2fee606e6ef400aa39fe444 Mon Sep 17 00:00:00 2001
From: Robert Marko <[email protected]>
Date: Wed, 12 May 2021 17:15:46 +0200
Subject: [PATCH] SSDK: platform: use of_mdio_find_bus() to get MDIO bus
Subject: [PATCH 03/11] 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.
Expand All @@ -16,15 +16,15 @@ Signed-off-by: Robert Marko <[email protected]>

--- a/src/init/ssdk_plat.c
+++ b/src/init/ssdk_plat.c
@@ -566,7 +566,6 @@ static int miibus_get(a_uint32_t dev_id)
@@ -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 ipq40xx_mdio_data *mdio_data = 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];
@@ -601,12 +600,7 @@ static int miibus_get(a_uint32_t dev_id)
@@ -788,12 +787,7 @@ static int miibus_get(a_uint32_t dev_id)

if(reg_mode == HSL_REG_LOCAL_BUS)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From f3a7b93137c1a6a1b8010b86296242178eed5d9e Mon Sep 17 00:00:00 2001
From 079c20aa182c6b623d49e1f375e022dedac7373c Mon Sep 17 00:00:00 2001
From: Robert Marko <[email protected]>
Date: Fri, 13 Aug 2021 20:03:21 +0200
Subject: [PATCH] SSDK: dts: fix of_get_mac_address()
Subject: [PATCH 04/11] SSDK: dts: fix of_get_mac_address()

Recently OpenWrt backported the updated of_get_mac_address()
function which returns and error code instead.
Expand All @@ -15,7 +15,7 @@ Signed-off-by: Robert Marko <[email protected]>

--- a/src/init/ssdk_dts.c
+++ b/src/init/ssdk_dts.c
@@ -824,8 +824,9 @@ static void ssdk_dt_parse_intf_mac(void)
@@ -921,8 +921,9 @@ static void ssdk_dt_parse_intf_mac(void)
{
struct device_node *dp_node = NULL;
a_uint32_t dp = 0;
Expand All @@ -26,7 +26,7 @@ Signed-off-by: Robert Marko <[email protected]>

for (dp = 1; dp <= SSDK_MAX_NR_ETH; dp++) {
snprintf(dp_name, sizeof(dp_name), "dp%d", dp);
@@ -833,11 +834,11 @@ static void ssdk_dt_parse_intf_mac(void)
@@ -930,11 +931,11 @@ static void ssdk_dt_parse_intf_mac(void)
if (!dp_node) {
continue;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 599f19551dc8db3cb396e4c139a73bd72300ebf5 Mon Sep 17 00:00:00 2001
From 0c509f8d8e5a6a03933a112d4487fd1c005442d6 Mon Sep 17 00:00:00 2001
From: Robert Marko <[email protected]>
Date: Fri, 24 Dec 2021 19:39:02 +0100
Subject: [PATCH] SSDK: config: add kernel 5.15
Subject: [PATCH 05/11] SSDK: config: add kernel 5.15

This is purely to identify it and be able to set
flags correctly.
Expand Down Expand Up @@ -36,7 +36,7 @@ Signed-off-by: Robert Marko <[email protected]>
endif
--- a/make/linux_opt.mk
+++ b/make/linux_opt.mk
@@ -422,7 +422,7 @@ ifeq (KSLIB, $(MODULE_TYPE))
@@ -437,7 +437,7 @@ ifeq (KSLIB, $(MODULE_TYPE))
KASAN_SHADOW_SCALE_SHIFT := 3
endif

Expand All @@ -45,7 +45,7 @@ Signed-off-by: Robert Marko <[email protected]>
ifeq ($(ARCH), arm64)
KASAN_OPTION += -DKASAN_SHADOW_SCALE_SHIFT=$(KASAN_SHADOW_SCALE_SHIFT)
endif
@@ -453,7 +453,7 @@ ifeq (KSLIB, $(MODULE_TYPE))
@@ -468,7 +468,7 @@ ifeq (KSLIB, $(MODULE_TYPE))

endif

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 25ff0ae02accadd7b05f1dae788505f833d5c019 Mon Sep 17 00:00:00 2001
From 9278b2794d984f5a8ec2350b9607a35aea2cc106 Mon Sep 17 00:00:00 2001
From: Robert Marko <[email protected]>
Date: Fri, 24 Dec 2021 20:02:32 +0100
Subject: [PATCH] qca8081: convert to 5.11 IRQ model
Subject: [PATCH 06/11] 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.
Expand All @@ -13,15 +13,15 @@ Signed-off-by: Robert Marko <[email protected]>

--- a/src/hsl/phy/qca808x.c
+++ b/src/hsl/phy/qca808x.c
@@ -240,6 +240,7 @@ static int qca808x_config_intr(struct ph
@@ -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;
@@ -259,6 +260,47 @@ static int qca808x_ack_interrupt(struct
@@ -266,6 +267,47 @@ static int qca808x_ack_interrupt(struct

return (err < 0) ? err : 0;
}
Expand Down Expand Up @@ -69,7 +69,7 @@ Signed-off-by: Robert Marko <[email protected]>

/* switch linux negtiation capability to fal avariable */
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0))
@@ -629,7 +671,11 @@ struct phy_driver qca808x_phy_driver = {
@@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 86624624c2b593c57999780a3838e6a9fe40b30c Mon Sep 17 00:00:00 2001
From 20a7945b82a4aefcb9ca0a14978412e4ae0057c9 Mon Sep 17 00:00:00 2001
From: Robert Marko <[email protected]>
Date: Tue, 11 Jan 2022 00:28:42 +0100
Subject: [PATCH] qca807x: add a LED quirk for Xiaomi AX9000
Subject: [PATCH 07/11] 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 913514b9177e77836f2c8d61fc498b54f54c6775 Mon Sep 17 00:00:00 2001
From bad774f43ec253e7e743e23bde87444c9d9cefdc Mon Sep 17 00:00:00 2001
From: Robert Marko <[email protected]>
Date: Wed, 26 Jan 2022 14:47:33 +0100
Subject: [PATCH] qca807x: add a LED quirk for Xiaomi AX3600
Subject: [PATCH 08/11] 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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 8e3500df074625b3eb3a8ed4e8e0b1b116f13d0c Mon Sep 17 00:00:00 2001
From be352dd54d163c005611906ac6b87692c9b8a1e6 Mon Sep 17 00:00:00 2001
From: Ansuel Smith <[email protected]>
Date: Sat, 7 May 2022 19:03:55 +0200
Subject: [PATCH] include: fix compilation error for parse_uci_option
Subject: [PATCH 09/11] include: fix compilation error for parse_uci_option

Fix missing include for parse_uci_option

Expand All @@ -12,7 +12,7 @@ Signed-off-by: Ansuel Smith <[email protected]>

--- a/include/ref/ref_uci.h
+++ b/include/ref/ref_uci.h
@@ -19,6 +19,7 @@
@@ -22,6 +22,7 @@
extern "C" {
#endif /* __cplusplus */

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
From ecd1e0c57fdf7f8916fa20f085e08bb4b6ba0396 Mon Sep 17 00:00:00 2001
From: Alexandru Gagniuc <[email protected]>
Date: Fri, 23 Sep 2022 08:21:13 -0500
Subject: [PATCH 10/11] 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 <[email protected]>
---
config | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/config
+++ b/config
@@ -141,7 +141,7 @@ endif

ifeq ($(ARCH), arm64)
ifeq ($(KVER),$(filter 4.1% 4.4% 4.9% 5.4% 5.10% 5.15%,$(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

Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
From c06e6edfb740d0ba0b804fa16d6222e257349089 Mon Sep 17 00:00:00 2001
From: Alexandru Gagniuc <[email protected]>
Date: Fri, 23 Sep 2022 08:30:03 -0500
Subject: [PATCH 11/11] 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 <[email protected]>
---
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 <linux/etherdevice.h>
-#include <linux/if_bridge.h>

/* 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;
}

0 comments on commit 679200d

Please sign in to comment.