From 14aafb259dde4224b7d00557f2bceed898c6d06a Mon Sep 17 00:00:00 2001 From: "xiangyang.yan" Date: Wed, 19 Apr 2023 14:54:21 +0800 Subject: [PATCH] ethernet: add cali_val item [1/1] PD#SWPL-120093 Problem: add cali_val item Solution: add cali_val item Verify: S928X-AX201-REF(V2+)#327 Change-Id: I253812eeaf114da113299fd5e8787d6951183c8a Signed-off-by: xiangyang.yan --- drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c index 94d0e4703860..e65db981b932 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c @@ -436,6 +436,7 @@ static int aml_custom_setting(struct platform_device *pdev, struct meson8b_dwmac struct device_node *np = pdev->dev.of_node; struct net_device *ndev = platform_get_drvdata(pdev); unsigned int mc_val = 0; + unsigned int cali_val = 0; pr_info("aml_cust_setting\n"); @@ -453,6 +454,13 @@ static int aml_custom_setting(struct platform_device *pdev, struct meson8b_dwmac pr_info("feature mac_wol\n"); #endif + /*internal_phy 1:inphy;2:exphy; 0 as default*/ + if (internal_phy == 2) { + if (of_property_read_u32(np, "cali_val", &cali_val) != 0) + pr_err("set default cali_val as 0\n"); + writel(cali_val, dwmac->regs + PRG_ETH1); + } + return 0; } #endif