• Home
  • Raw
  • Download

Lines Matching refs:serdes_regs

127 static void netcp_xgbe_serdes_cmu_init(void __iomem *serdes_regs)  in netcp_xgbe_serdes_cmu_init()  argument
133 reg_rmw(serdes_regs + cfg_phyb_1p25g_156p25mhz_cmu0[i].ofs, in netcp_xgbe_serdes_cmu_init()
140 reg_rmw(serdes_regs + cfg_phyb_10p3125g_156p25mhz_cmu1[i].ofs, in netcp_xgbe_serdes_cmu_init()
148 void __iomem *serdes_regs, int lane) in netcp_xgbe_serdes_lane_config() argument
154 reg_rmw(serdes_regs + in netcp_xgbe_serdes_lane_config()
162 reg_rmw(serdes_regs + (0x200 * lane) + 0x0380, in netcp_xgbe_serdes_lane_config()
166 reg_rmw(serdes_regs + (0x200 * lane) + 0x03c0, in netcp_xgbe_serdes_lane_config()
170 static void netcp_xgbe_serdes_com_enable(void __iomem *serdes_regs) in netcp_xgbe_serdes_com_enable() argument
175 reg_rmw(serdes_regs + cfg_phyb_10p3125g_comlane[i].ofs, in netcp_xgbe_serdes_com_enable()
182 void __iomem *serdes_regs, int lane) in netcp_xgbe_serdes_lane_enable() argument
185 writel(0xe0e9e038, serdes_regs + 0x1fe0 + (4 * lane)); in netcp_xgbe_serdes_lane_enable()
188 static void netcp_xgbe_serdes_phyb_rst_clr(void __iomem *serdes_regs) in netcp_xgbe_serdes_phyb_rst_clr() argument
190 reg_rmw(serdes_regs + 0x0a00, 0x0000001f, 0x000000ff); in netcp_xgbe_serdes_phyb_rst_clr()
193 static void netcp_xgbe_serdes_pll_disable(void __iomem *serdes_regs) in netcp_xgbe_serdes_pll_disable() argument
195 writel(0x88000000, serdes_regs + 0x1ff4); in netcp_xgbe_serdes_pll_disable()
198 static void netcp_xgbe_serdes_pll_enable(void __iomem *serdes_regs) in netcp_xgbe_serdes_pll_enable() argument
200 netcp_xgbe_serdes_phyb_rst_clr(serdes_regs); in netcp_xgbe_serdes_pll_enable()
201 writel(0xee000000, serdes_regs + 0x1ff4); in netcp_xgbe_serdes_pll_enable()
235 static u32 netcp_xgbe_serdes_read_tbus_val(void __iomem *serdes_regs) in netcp_xgbe_serdes_read_tbus_val() argument
239 if (PHY_A(serdes_regs)) { in netcp_xgbe_serdes_read_tbus_val()
240 tmp = (readl(serdes_regs + 0x0ec) >> 24) & 0x0ff; in netcp_xgbe_serdes_read_tbus_val()
241 tmp |= ((readl(serdes_regs + 0x0fc) >> 16) & 0x00f00); in netcp_xgbe_serdes_read_tbus_val()
243 tmp = (readl(serdes_regs + 0x0f8) >> 16) & 0x0fff; in netcp_xgbe_serdes_read_tbus_val()
249 static void netcp_xgbe_serdes_write_tbus_addr(void __iomem *serdes_regs, in netcp_xgbe_serdes_write_tbus_addr() argument
252 if (PHY_A(serdes_regs)) { in netcp_xgbe_serdes_write_tbus_addr()
253 reg_rmw(serdes_regs + 0x0008, ((select << 5) + ofs) << 24, in netcp_xgbe_serdes_write_tbus_addr()
270 reg_rmw(serdes_regs + 0x00fc, ((select << 8) + ofs) << 16, ~0xf800ffff); in netcp_xgbe_serdes_write_tbus_addr()
273 static u32 netcp_xgbe_serdes_read_select_tbus(void __iomem *serdes_regs, in netcp_xgbe_serdes_read_select_tbus() argument
277 netcp_xgbe_serdes_write_tbus_addr(serdes_regs, select, ofs); in netcp_xgbe_serdes_read_select_tbus()
279 return netcp_xgbe_serdes_read_tbus_val(serdes_regs); in netcp_xgbe_serdes_read_select_tbus()
282 static void netcp_xgbe_serdes_reset_cdr(void __iomem *serdes_regs, in netcp_xgbe_serdes_reset_cdr() argument
289 serdes_regs, lane + 1, 5); in netcp_xgbe_serdes_reset_cdr()
298 tbus = netcp_xgbe_serdes_read_select_tbus(serdes_regs, lane + in netcp_xgbe_serdes_reset_cdr()
307 static int netcp_xgbe_check_link_status(void __iomem *serdes_regs, in netcp_xgbe_check_link_status() argument
318 loss = readl(serdes_regs + 0x1fc0 + 0x20 + (i * 0x04)) & 0x1; in netcp_xgbe_check_link_status()
326 sig_detect_reg = serdes_regs + (i * 0x200) + 0x200 + 0x04; in netcp_xgbe_check_link_status()
343 netcp_xgbe_serdes_reset_cdr(serdes_regs, in netcp_xgbe_check_link_status()
364 netcp_xgbe_serdes_reset_cdr(serdes_regs, in netcp_xgbe_check_link_status()
391 static int netcp_xgbe_serdes_check_lane(void __iomem *serdes_regs, in netcp_xgbe_serdes_check_lane() argument
402 link_up = netcp_xgbe_check_link_status(serdes_regs, sw_regs, 2, in netcp_xgbe_serdes_check_lane()
429 static void netcp_xgbe_serdes_setup_cm_c1_c2(void __iomem *serdes_regs, in netcp_xgbe_serdes_setup_cm_c1_c2() argument
435 reg_rmw(serdes_regs + cfg_cm_c1_c2[i].ofs + (0x200 * lane), in netcp_xgbe_serdes_setup_cm_c1_c2()
441 static void netcp_xgbe_reset_serdes(void __iomem *serdes_regs) in netcp_xgbe_reset_serdes() argument
445 reg_rmw(serdes_regs + PCSR_CPU_CTRL_OFFSET, POR_EN, POR_EN); in netcp_xgbe_reset_serdes()
449 reg_rmw(serdes_regs + PCSR_CPU_CTRL_OFFSET, 0, POR_EN); in netcp_xgbe_reset_serdes()
453 static int netcp_xgbe_serdes_config(void __iomem *serdes_regs, in netcp_xgbe_serdes_config() argument
458 netcp_xgbe_serdes_pll_disable(serdes_regs); in netcp_xgbe_serdes_config()
459 netcp_xgbe_serdes_cmu_init(serdes_regs); in netcp_xgbe_serdes_config()
462 netcp_xgbe_serdes_lane_config(serdes_regs, i); in netcp_xgbe_serdes_config()
464 netcp_xgbe_serdes_com_enable(serdes_regs); in netcp_xgbe_serdes_config()
467 netcp_xgbe_serdes_setup_cm_c1_c2(serdes_regs, i, 0, 0, 5); in netcp_xgbe_serdes_config()
469 netcp_xgbe_serdes_pll_enable(serdes_regs); in netcp_xgbe_serdes_config()
471 netcp_xgbe_serdes_lane_enable(serdes_regs, i); in netcp_xgbe_serdes_config()
479 netcp_xgbe_serdes_check_lane(serdes_regs, sw_regs); in netcp_xgbe_serdes_config()
483 int netcp_xgbe_serdes_init(void __iomem *serdes_regs, void __iomem *xgbe_regs) in netcp_xgbe_serdes_init() argument
488 val = readl(serdes_regs + 0xa00); in netcp_xgbe_serdes_init()
491 netcp_xgbe_reset_serdes(serdes_regs); in netcp_xgbe_serdes_init()
493 return netcp_xgbe_serdes_config(serdes_regs, xgbe_regs); in netcp_xgbe_serdes_init()