Lines Matching refs:phy

42 static u32 __combo_phy_reg_read(u8 phy, u8 dev, u32 addr)  in __combo_phy_reg_read()  argument
45 writel(CPHY_MAP(dev, addr), CPHY_BASE + 0x800 + CPHY_WIDTH * phy); in __combo_phy_reg_read()
46 data = readl(CPHY_ADDR(CPHY_BASE + CPHY_WIDTH * phy, dev, addr)); in __combo_phy_reg_read()
50 static void __combo_phy_reg_write(u8 phy, u8 dev, u32 addr, u32 data) in __combo_phy_reg_write() argument
52 writel(CPHY_MAP(dev, addr), CPHY_BASE + 0x800 + CPHY_WIDTH * phy); in __combo_phy_reg_write()
53 writel(data, CPHY_ADDR(CPHY_BASE + CPHY_WIDTH * phy, dev, addr)); in __combo_phy_reg_write()
56 static u32 combo_phy_read(u8 phy, u32 addr) in combo_phy_read() argument
59 if (phy == 5) in combo_phy_read()
61 while (__combo_phy_reg_read(phy, dev, SERDES_CR_CTL) & CR_BUSY) in combo_phy_read()
63 __combo_phy_reg_write(phy, dev, SERDES_CR_ADDR, addr); in combo_phy_read()
64 __combo_phy_reg_write(phy, dev, SERDES_CR_CTL, CR_START); in combo_phy_read()
65 while (__combo_phy_reg_read(phy, dev, SERDES_CR_CTL) & CR_BUSY) in combo_phy_read()
67 return __combo_phy_reg_read(phy, dev, SERDES_CR_DATA); in combo_phy_read()
70 static void combo_phy_write(u8 phy, u32 addr, u32 data) in combo_phy_write() argument
73 if (phy == 5) in combo_phy_write()
75 while (__combo_phy_reg_read(phy, dev, SERDES_CR_CTL) & CR_BUSY) in combo_phy_write()
77 __combo_phy_reg_write(phy, dev, SERDES_CR_ADDR, addr); in combo_phy_write()
78 __combo_phy_reg_write(phy, dev, SERDES_CR_DATA, data); in combo_phy_write()
79 __combo_phy_reg_write(phy, dev, SERDES_CR_CTL, CR_WR_RDN | CR_START); in combo_phy_write()
82 static void cphy_spread_spectrum_override(u8 phy, u8 lane, u32 val) in cphy_spread_spectrum_override() argument
85 tmp = combo_phy_read(phy, CPHY_RX_INPUT_STS + lane * SPHY_LANE); in cphy_spread_spectrum_override()
87 combo_phy_write(phy, CPHY_RX_INPUT_OVERRIDE + lane * SPHY_LANE, tmp); in cphy_spread_spectrum_override()
90 combo_phy_write(phy, CPHY_RX_INPUT_OVERRIDE + lane * SPHY_LANE, tmp); in cphy_spread_spectrum_override()
94 combo_phy_write(phy, CPHY_RX_INPUT_OVERRIDE + lane * SPHY_LANE, tmp); in cphy_spread_spectrum_override()
97 static void cphy_tx_attenuation_override(u8 phy, u8 lane) in cphy_tx_attenuation_override() argument
103 shift = ((phy == 5) ? 4 : lane) * 4; in cphy_tx_attenuation_override()
110 tmp = combo_phy_read(phy, CPHY_TX_INPUT_STS + lane * SPHY_LANE); in cphy_tx_attenuation_override()
112 combo_phy_write(phy, CPHY_TX_INPUT_OVERRIDE + lane * SPHY_LANE, tmp); in cphy_tx_attenuation_override()
115 combo_phy_write(phy, CPHY_TX_INPUT_OVERRIDE + lane * SPHY_LANE, tmp); in cphy_tx_attenuation_override()
118 combo_phy_write(phy, CPHY_TX_INPUT_OVERRIDE + lane * SPHY_LANE, tmp); in cphy_tx_attenuation_override()
124 u8 lane = 0, phy = 0; in cphy_disable_port_overrides() local
127 phy = 5; in cphy_disable_port_overrides()
132 tmp = combo_phy_read(phy, CPHY_RX_INPUT_STS + lane * SPHY_LANE); in cphy_disable_port_overrides()
134 combo_phy_write(phy, CPHY_RX_INPUT_OVERRIDE + lane * SPHY_LANE, tmp); in cphy_disable_port_overrides()
136 tmp = combo_phy_read(phy, CPHY_TX_INPUT_OVERRIDE + lane * SPHY_LANE); in cphy_disable_port_overrides()
138 combo_phy_write(phy, CPHY_TX_INPUT_OVERRIDE + lane * SPHY_LANE, tmp); in cphy_disable_port_overrides()
156 u8 lane = 0, phy = 0; in cphy_override_lane() local
159 phy = 5; in cphy_override_lane()
169 cphy_spread_spectrum_override(phy, lane, 3); in cphy_override_lane()
170 cphy_tx_attenuation_override(phy, lane); in cphy_override_lane()