mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
add qca
This commit is contained in:
parent
083306174f
commit
8f8028cb7f
86 changed files with 50519 additions and 0 deletions
56
qca/qca-ssdk/patches/0001-SSDK-config-add-kernel-5.10.patch
Normal file
56
qca/qca-ssdk/patches/0001-SSDK-config-add-kernel-5.10.patch
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
From 472c0c8132784608312c80c4b02c03ea7c132235 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Wed, 12 May 2021 13:41:12 +0200
|
||||
Subject: [PATCH] SSDK: config: add kernel 5.10
|
||||
|
||||
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
|
||||
@@ -22,6 +22,10 @@ ifeq ($(KVER),$(filter 5.4%,$(KVER)))
|
||||
OS_VER=5_4
|
||||
endif
|
||||
|
||||
+ifeq ($(KVER),$(filter 5.10%,$(KVER)))
|
||||
+OS_VER=5_10
|
||||
+endif
|
||||
+
|
||||
ifeq ($(KVER), 3.4.0)
|
||||
OS_VER=3_4
|
||||
endif
|
||||
@@ -123,7 +127,7 @@ endif
|
||||
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% 5.10%,$(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 (5_4, $(OS_VER))
|
||||
+ ifeq ($(OS_VER),$(filter 5_4 5_10, $(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, $(OS_VER)))
|
||||
+ ifeq ($(OS_VER),$(filter 4_4 5_4 5_10, $(OS_VER)))
|
||||
MODULE_CFLAG += -DKVER34
|
||||
MODULE_CFLAG += -DKVER32
|
||||
MODULE_CFLAG += -DLNX26_22
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
From 784f2cfdfaf3bdf44917924e157049230a0ef5f8 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Wed, 12 May 2021 13:45:45 +0200
|
||||
Subject: [PATCH] SSDK: replace ioremap_nocache with ioremap
|
||||
|
||||
ioremap_nocache was dropped upstream, simply use the
|
||||
generic variety.
|
||||
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
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
|
||||
@@ -623,7 +623,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");
|
||||
@@ -640,7 +640,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");
|
||||
@@ -688,7 +688,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;
|
||||
@@ -745,7 +745,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;
|
||||
@@ -766,7 +766,7 @@ static void ssdk_cmnblk_init(enum cmnblk
|
||||
void __iomem *gcc_pll_base = NULL;
|
||||
a_uint32_t reg_val;
|
||||
|
||||
- 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
|
||||
@@ -2770,7 +2770,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
|
||||
@@ -1312,7 +1312,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__);
|
||||
@@ -1327,7 +1327,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__);
|
||||
@@ -1358,7 +1358,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__);
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
From b6190ca46287d01a895c7cc14de30410c09ff1b8 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Wed, 12 May 2021 17:15:46 +0200
|
||||
Subject: [PATCH] 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 <baruch@tkos.co.il>
|
||||
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
---
|
||||
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
|
||||
@@ -551,7 +551,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_phy_priv *priv;
|
||||
hsl_reg_mode reg_mode = HSL_REG_LOCAL_BUS;
|
||||
priv = qca_phy_priv_global[dev_id];
|
||||
@@ -584,12 +583,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);
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
From f3a7b93137c1a6a1b8010b86296242178eed5d9e Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Fri, 13 Aug 2021 20:03:21 +0200
|
||||
Subject: [PATCH] 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 <robimarko@gmail.com>
|
||||
---
|
||||
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
|
||||
@@ -779,8 +779,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);
|
||||
@@ -788,11 +789,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);
|
||||
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,
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
From 86624624c2b593c57999780a3838e6a9fe40b30c Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Tue, 11 Jan 2022 00:28:42 +0100
|
||||
Subject: [PATCH] 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 <robimarko@gmail.com>
|
||||
---
|
||||
include/hsl/phy/malibu_phy.h | 2 ++
|
||||
src/hsl/phy/malibu_phy.c | 11 +++++++++++
|
||||
2 files changed, 13 insertions(+)
|
||||
|
||||
diff --git a/include/hsl/phy/malibu_phy.h b/include/hsl/phy/malibu_phy.h
|
||||
index b7354041..ec7a0621 100755
|
||||
--- 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
|
||||
|
||||
|
||||
diff --git a/src/hsl/phy/malibu_phy.c b/src/hsl/phy/malibu_phy.c
|
||||
index 1f4dba15..2bef9fa3 100644
|
||||
--- a/src/hsl/phy/malibu_phy.c
|
||||
+++ b/src/hsl/phy/malibu_phy.c
|
||||
@@ -12,6 +12,8 @@
|
||||
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
+#include <linux/of.h>
|
||||
+
|
||||
#include "sw.h"
|
||||
#include "fal_port_ctrl.h"
|
||||
#include "hsl_api.h"
|
||||
@@ -2726,6 +2728,15 @@ malibu_phy_hw_init(a_uint32_t dev_id, a_uint32_t port_bmp)
|
||||
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;
|
||||
--
|
||||
2.34.1
|
||||
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
From 913514b9177e77836f2c8d61fc498b54f54c6775 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Marko <robimarko@gmail.com>
|
||||
Date: Wed, 26 Jan 2022 14:47:33 +0100
|
||||
Subject: [PATCH] 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 <robimarko@gmail.com>
|
||||
---
|
||||
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
|
||||
@@ -2728,8 +2728,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;
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
From 8e3500df074625b3eb3a8ed4e8e0b1b116f13d0c Mon Sep 17 00:00:00 2001
|
||||
From: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
Date: Sat, 7 May 2022 19:03:55 +0200
|
||||
Subject: [PATCH] include: fix compilation error for parse_uci_option
|
||||
|
||||
Fix missing include for parse_uci_option
|
||||
|
||||
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
---
|
||||
include/ref/ref_uci.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/include/ref/ref_uci.h b/include/ref/ref_uci.h
|
||||
index a42ea153..0906c5ba 100755
|
||||
--- a/include/ref/ref_uci.h
|
||||
+++ b/include/ref/ref_uci.h
|
||||
@@ -19,6 +19,7 @@
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
+#include <linux/switch.h>
|
||||
|
||||
#if defined(IN_SWCONFIG)
|
||||
int
|
||||
--
|
||||
2.34.1
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue