diff --git a/0008-qca807x-add-a-LED-quirk-for-Xiaomi-AX9000.patch b/0008-qca807x-add-a-LED-quirk-for-Xiaomi-AX9000.patch new file mode 100644 index 0000000..5be60a4 --- /dev/null +++ b/0008-qca807x-add-a-LED-quirk-for-Xiaomi-AX9000.patch @@ -0,0 +1,67 @@ +From 86624624c2b593c57999780a3838e6a9fe40b30c Mon Sep 17 00:00:00 2001 +From: Robert Marko +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 +--- + 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 +@@ -12,6 +12,8 @@ + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + ++#include ++ + #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_ + 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/qca/qca-ssdk/patches/0008-qca807x-add-a-LED-quirk-for-Xiaomi-AX9000.patch b/qca/qca-ssdk/patches/0008-qca807x-add-a-LED-quirk-for-Xiaomi-AX9000.patch new file mode 100644 index 0000000..76f71be --- /dev/null +++ b/qca/qca-ssdk/patches/0008-qca807x-add-a-LED-quirk-for-Xiaomi-AX9000.patch @@ -0,0 +1,74 @@ +From 86624624c2b593c57999780a3838e6a9fe40b30c Mon Sep 17 00:00:00 2001 +From: Robert Marko +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 +--- + 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 ++ + #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 +