blob: 5bf48b28f2a96e67ad7c965727cbcb4884eef8a3 [file] [log] [blame]
developer8cdcb262022-10-27 14:36:15 +08001From 917388b73b89f2859d795d800a296151d77e6ece Mon Sep 17 00:00:00 2001
2From: Zhanyong Wang <zhanyong.wang@mediatek.com>
3Date: Sat, 15 Oct 2022 17:38:54 +0800
4Subject: [PATCH 5/8] tphy: one setting of TTSSC-Freq-Dev for all IC cases
5
6try to use one setting of TTSSC-Freq-Dev to covery all IC cases
7
8Signed-off-by: Zhanyong Wang <zhanyong.wang@mediatek.com>
9---
10 drivers/phy/mediatek/phy-mtk-tphy.c | 18 ++++++++++++++++++
11 1 file changed, 18 insertions(+)
12
13diff --git a/drivers/phy/mediatek/phy-mtk-tphy.c b/drivers/phy/mediatek/phy-mtk-tphy.c
14index a5b17a1aed5c..a38c50f4529f 100644
15--- a/drivers/phy/mediatek/phy-mtk-tphy.c
16+++ b/drivers/phy/mediatek/phy-mtk-tphy.c
17@@ -219,6 +219,14 @@
18 #define P3D_RG_RXDET_STB2_SET_P3 GENMASK(8, 0)
19 #define P3D_RG_RXDET_STB2_SET_P3_VAL(x) (0x1ff & (x))
20
21+#define U3P_U3_PHYD_REG19 0x338
22+#define P3D_RG_PLL_SSC_DELTA1 GENMASK(15, 0)
23+#define P3D_RG_PLL_SSC_DELTA1_VAL(x) (0xffff & (x))
24+
25+#define U3P_U3_PHYD_REG21 0x340
26+#define P3D_RG_PLL_SSC_DELTA GENMASK(31, 16)
27+#define P3D_RG_PLL_SSC_DELTA_VAL(x) ((0xffff & (x)) << 16)
28+
29 #define U3P_SPLLC_XTALCTL3 0x018
30 #define XC3_RG_U3_XTAL_RX_PWD BIT(9)
31 #define XC3_RG_U3_FRC_XTAL_RX_PWD BIT(8)
32@@ -514,6 +522,16 @@ static void u3_phy_instance_init(struct mtk_tphy *tphy,
33 tmp |= P3D_RG_RXDET_STB2_SET_P3_VAL(0x10);
34 writel(tmp, u3_banks->phyd + U3P_U3_PHYD_RXDET2);
35
36+ tmp = readl(u3_banks->phyd + U3P_U3_PHYD_REG19);
37+ tmp &= ~P3D_RG_PLL_SSC_DELTA1;
38+ tmp |= P3D_RG_PLL_SSC_DELTA1_VAL(0x1c3);
39+ writel(tmp, u3_banks->phyd + U3P_U3_PHYD_REG19);
40+
41+ tmp = readl(u3_banks->phyd + U3P_U3_PHYD_REG21);
42+ tmp &= ~P3D_RG_PLL_SSC_DELTA;
43+ tmp |= P3D_RG_PLL_SSC_DELTA_VAL(0x1c3);
44+ writel(tmp, u3_banks->phyd + U3P_U3_PHYD_REG21);
45+
46 dev_dbg(tphy->dev, "%s(%d)\n", __func__, instance->index);
47 }
48
49--
502.18.0
51