mirror of
https://github.com/breeze303/nss-packages.git
synced 2025-12-16 16:57:29 +00:00
SSDK: add kernel 5.15 support
Add SSDK support for kernel 5.15, it just required the configuration check and QCA8081 IRQ model update. Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
parent
f29396f467
commit
afb1ac339c
@ -15,8 +15,6 @@ Signed-off-by: Dirk Buchwalder <buchwalder@posteo.de>
|
||||
src/hsl/phy/hsl_phy.c | 1 +
|
||||
2 files changed, 2 insertions(+)
|
||||
|
||||
diff --git a/include/hsl/phy/hsl_phy.h b/include/hsl/phy/hsl_phy.h
|
||||
index 4621e725..7551574a 100755
|
||||
--- a/include/hsl/phy/hsl_phy.h
|
||||
+++ b/include/hsl/phy/hsl_phy.h
|
||||
@@ -579,6 +579,7 @@ typedef struct {
|
||||
@ -27,11 +25,9 @@ index 4621e725..7551574a 100755
|
||||
#define AQUANTIA_PHY_112C 0x03a1b792
|
||||
|
||||
#define PHY_805XV2 0x004DD082
|
||||
diff --git a/src/hsl/phy/hsl_phy.c b/src/hsl/phy/hsl_phy.c
|
||||
index 5866a522..02e6aeea 100755
|
||||
--- a/src/hsl/phy/hsl_phy.c
|
||||
+++ b/src/hsl/phy/hsl_phy.c
|
||||
@@ -235,6 +235,7 @@ phy_type_t hsl_phytype_get_by_phyid(a_uint32_t dev_id, a_uint32_t phy_id)
|
||||
@@ -235,6 +235,7 @@ phy_type_t hsl_phytype_get_by_phyid(a_ui
|
||||
case AQUANTIA_PHY_112:
|
||||
case AQUANTIA_PHY_113C_A0:
|
||||
case AQUANTIA_PHY_113C_A1:
|
||||
@ -39,6 +35,3 @@ index 5866a522..02e6aeea 100755
|
||||
case AQUANTIA_PHY_112C:
|
||||
phytype = AQUANTIA_PHY_CHIP;
|
||||
break;
|
||||
--
|
||||
2.31.1
|
||||
|
||||
|
||||
@ -13,8 +13,6 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
src/init/ssdk_dts.c | 7 ++++---
|
||||
1 file changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/init/ssdk_dts.c b/src/init/ssdk_dts.c
|
||||
index 21804970..257bbf71 100644
|
||||
--- a/src/init/ssdk_dts.c
|
||||
+++ b/src/init/ssdk_dts.c
|
||||
@@ -779,8 +779,9 @@ static void ssdk_dt_parse_intf_mac(void)
|
||||
@ -42,6 +40,3 @@ index 21804970..257bbf71 100644
|
||||
#endif
|
||||
ssdk_dt_global.num_intf_mac++;
|
||||
ether_addr_copy(ssdk_dt_global.intf_mac[dp-1].uc, maddr);
|
||||
--
|
||||
2.31.1
|
||||
|
||||
|
||||
56
qca/qca-ssdk/patches/0006-SSDK-config-add-kernel-5.15.patch
Normal file
56
qca/qca-ssdk/patches/0006-SSDK-config-add-kernel-5.15.patch
Normal file
@ -0,0 +1,56 @@
|
||||
From 599f19551dc8db3cb396e4c139a73bd72300ebf5 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Fri, 24 Dec 2021 19:39:02 +0100
|
||||
Subject: [PATCH] SSDK: config: add kernel 5.15
|
||||
|
||||
This is purely to identify it and be able to set
|
||||
flags correctly.
|
||||
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
config | 6 +++++-
|
||||
make/linux_opt.mk | 4 ++--
|
||||
2 files changed, 7 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/config
|
||||
+++ b/config
|
||||
@@ -26,6 +26,10 @@ ifeq ($(KVER),$(filter 5.10%,$(KVER)))
|
||||
OS_VER=5_10
|
||||
endif
|
||||
|
||||
+ifeq ($(KVER),$(filter 5.15%,$(KVER)))
|
||||
+OS_VER=5_15
|
||||
+endif
|
||||
+
|
||||
ifeq ($(KVER), 3.4.0)
|
||||
OS_VER=3_4
|
||||
endif
|
||||
@@ -127,7 +131,7 @@ endif
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH), arm64)
|
||||
-ifeq ($(KVER),$(filter 4.1% 4.4% 4.9% 5.4% 5.10%,$(KVER)))
|
||||
+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
|
||||
endif
|
||||
endif
|
||||
--- a/make/linux_opt.mk
|
||||
+++ b/make/linux_opt.mk
|
||||
@@ -388,7 +388,7 @@ ifeq (KSLIB, $(MODULE_TYPE))
|
||||
KASAN_SHADOW_SCALE_SHIFT := 3
|
||||
endif
|
||||
|
||||
- ifeq ($(OS_VER),$(filter 5_4 5_10, $(OS_VER)))
|
||||
+ ifeq ($(OS_VER),$(filter 5_4 5_10 5_15, $(OS_VER)))
|
||||
ifeq ($(ARCH), arm64)
|
||||
KASAN_OPTION += -DKASAN_SHADOW_SCALE_SHIFT=$(KASAN_SHADOW_SCALE_SHIFT)
|
||||
endif
|
||||
@@ -419,7 +419,7 @@ ifeq (KSLIB, $(MODULE_TYPE))
|
||||
|
||||
endif
|
||||
|
||||
- ifeq ($(OS_VER),$(filter 4_4 5_4 5_10, $(OS_VER)))
|
||||
+ ifeq ($(OS_VER),$(filter 4_4 5_4 5_10 5_15, $(OS_VER)))
|
||||
MODULE_CFLAG += -DKVER34
|
||||
MODULE_CFLAG += -DKVER32
|
||||
MODULE_CFLAG += -DLNX26_22
|
||||
@ -0,0 +1,83 @@
|
||||
From 25ff0ae02accadd7b05f1dae788505f833d5c019 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Fri, 24 Dec 2021 20:02:32 +0100
|
||||
Subject: [PATCH] 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 <robimarko@gmail.com>
|
||||
---
|
||||
src/hsl/phy/qca808x.c | 46 +++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 46 insertions(+)
|
||||
|
||||
--- a/src/hsl/phy/qca808x.c
|
||||
+++ b/src/hsl/phy/qca808x.c
|
||||
@@ -238,6 +238,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;
|
||||
@@ -257,6 +258,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))
|
||||
@@ -559,7 +601,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,
|
||||
Loading…
Reference in New Issue
Block a user