[openwrt/openwrt] ath79: commonize SGMII calibration functions of QCA955x in lzma-loader

LEDE Commits lede-commits at lists.infradead.org
Sat Oct 19 08:57:46 PDT 2024


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/0e8af9f5a74f43d66d3ac8649ded96342d9fe413

commit 0e8af9f5a74f43d66d3ac8649ded96342d9fe413
Author: INAGAKI Hiroshi <musashino.open at gmail.com>
AuthorDate: Fri Jun 28 00:53:31 2024 +0900

    ath79: commonize SGMII calibration functions of QCA955x in lzma-loader
    
    Commonize function names of SGMII calibration functions of QCA955x added
    for Meraki MR18, to use them for NEC Aterm series based on QCA9558 as
    well.
    
    Signed-off-by: INAGAKI Hiroshi <musashino.open at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/16297
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/ath79/image/lzma-loader/src/board.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/target/linux/ath79/image/lzma-loader/src/board.c b/target/linux/ath79/image/lzma-loader/src/board.c
index 0d92f3174b..2a037e5ac8 100644
--- a/target/linux/ath79/image/lzma-loader/src/board.c
+++ b/target/linux/ath79/image/lzma-loader/src/board.c
@@ -51,9 +51,9 @@ static void tlwr1043nd_init(void)
 static inline void tlwr1043nd_init(void) {}
 #endif
 
-#ifdef CONFIG_BOARD_MERAKI_MR18
+#if defined(CONFIG_BOARD_MERAKI_MR18)
 
-static int mr18_extract_sgmii_res_cal(void)
+static int extract_qca955x_sgmii_res_cal(void)
 {
 	unsigned int base;
 	unsigned int reversed_sgmii_value;
@@ -138,7 +138,7 @@ static void qca955x_device_reset_clear(unsigned int mask)
 	WRITEREG(reg, t & ~mask);
 }
 
-static void mr18_setup_qca955x_eth_serdes_cal(unsigned int sgmii_value)
+static void setup_qca955x_eth_serdes_cal(unsigned int sgmii_value)
 {
 	unsigned int ethbase, pllbase, t;
 
@@ -166,16 +166,18 @@ static void mr18_setup_qca955x_eth_serdes_cal(unsigned int sgmii_value)
 		QCA955X_SGMII_SERDES_LOCK_DETECT_STATUS))
 		;
 }
+#endif
 
+#ifdef CONFIG_BOARD_MERAKI_MR18
 static inline void mr18_init(void)
 {
 	int res;
 
 	printf("Meraki MR18\n");
 
-	res = mr18_extract_sgmii_res_cal();
+	res = extract_qca955x_sgmii_res_cal();
 	if (res >= 0)
-		mr18_setup_qca955x_eth_serdes_cal(res);
+		setup_qca955x_eth_serdes_cal(res);
 
 }
 #else




More information about the lede-commits mailing list