|
80 | 80 |
|
81 | 81 | /* Reference clock selection parameters */
|
82 | 82 | #define L0_Ln_REF_CLK_SEL(n) (0x2860 + (n) * 4)
|
83 |
| -#define L0_REF_CLK_SEL_MASK 0x8f |
| 83 | +#define L0_REF_CLK_LCL_SEL BIT(7) |
| 84 | +#define L0_REF_CLK_SEL_MASK 0x9f |
84 | 85 |
|
85 | 86 | /* Calibration digital logic parameters */
|
86 | 87 | #define L3_TM_CALIB_DIG19 0xec4c
|
@@ -349,11 +350,12 @@ static void xpsgtr_configure_pll(struct xpsgtr_phy *gtr_phy)
|
349 | 350 | PLL_FREQ_MASK, ssc->pll_ref_clk);
|
350 | 351 |
|
351 | 352 | /* Enable lane clock sharing, if required */
|
352 |
| - if (gtr_phy->refclk != gtr_phy->lane) { |
353 |
| - /* Lane3 Ref Clock Selection Register */ |
| 353 | + if (gtr_phy->refclk == gtr_phy->lane) |
| 354 | + xpsgtr_clr_set(gtr_phy->dev, L0_Ln_REF_CLK_SEL(gtr_phy->lane), |
| 355 | + L0_REF_CLK_SEL_MASK, L0_REF_CLK_LCL_SEL); |
| 356 | + else |
354 | 357 | xpsgtr_clr_set(gtr_phy->dev, L0_Ln_REF_CLK_SEL(gtr_phy->lane),
|
355 | 358 | L0_REF_CLK_SEL_MASK, 1 << gtr_phy->refclk);
|
356 |
| - } |
357 | 359 |
|
358 | 360 | /* SSC step size [7:0] */
|
359 | 361 | xpsgtr_clr_set_phy(gtr_phy, L0_PLL_SS_STEP_SIZE_0_LSB,
|
@@ -573,7 +575,7 @@ static int xpsgtr_phy_init(struct phy *phy)
|
573 | 575 | mutex_lock(>r_dev->gtr_mutex);
|
574 | 576 |
|
575 | 577 | /* Configure and enable the clock when peripheral phy_init call */
|
576 |
| - if (clk_prepare_enable(gtr_dev->clk[gtr_phy->lane])) |
| 578 | + if (clk_prepare_enable(gtr_dev->clk[gtr_phy->refclk])) |
577 | 579 | goto out;
|
578 | 580 |
|
579 | 581 | /* Skip initialization if not required. */
|
@@ -625,7 +627,7 @@ static int xpsgtr_phy_exit(struct phy *phy)
|
625 | 627 | gtr_phy->skip_phy_init = false;
|
626 | 628 |
|
627 | 629 | /* Ensure that disable clock only, which configure for lane */
|
628 |
| - clk_disable_unprepare(gtr_dev->clk[gtr_phy->lane]); |
| 630 | + clk_disable_unprepare(gtr_dev->clk[gtr_phy->refclk]); |
629 | 631 |
|
630 | 632 | return 0;
|
631 | 633 | }
|
|
0 commit comments