Lines Matching +full:2 +full:- +full:lane
1 // SPDX-License-Identifier: GPL-2.0
7 * WingMan Kwok <w-kwok2@ti.com>
17 /* PCS-R registers */
26 #define MASK_WID_SH(w, s) (((1 << w) - 1) << s)
146 /* lane is 0 based */
148 void __iomem *serdes_regs, int lane) in netcp_xgbe_serdes_lane_config() argument
152 /* lane setup */ in netcp_xgbe_serdes_lane_config()
156 (0x200 * lane), 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()
182 void __iomem *serdes_regs, int lane) in netcp_xgbe_serdes_lane_enable() argument
184 /* Set Lane Control Rate */ in netcp_xgbe_serdes_lane_enable()
185 writel(0xe0e9e038, serdes_regs + 0x1fe0 + (4 * lane)); in netcp_xgbe_serdes_lane_enable()
219 ret = -ETIMEDOUT; in netcp_xgbe_wait_pll_locked()
258 /* For 2 lane Phy-B, lane0 is actually lane1 */ in netcp_xgbe_serdes_write_tbus_addr()
261 select = 2; in netcp_xgbe_serdes_write_tbus_addr()
263 case 2: in netcp_xgbe_serdes_write_tbus_addr()
283 void __iomem *sig_detect_reg, int lane) in netcp_xgbe_serdes_reset_cdr() argument
289 serdes_regs, lane + 1, 5); in netcp_xgbe_serdes_reset_cdr()
291 dlpf = tmp >> 2; in netcp_xgbe_serdes_reset_cdr()
294 reg_rmw(sig_detect_reg, VAL_SH(2, 1), MASK_WID_SH(2, 1)); in netcp_xgbe_serdes_reset_cdr()
296 reg_rmw(sig_detect_reg, VAL_SH(0, 1), MASK_WID_SH(2, 1)); in netcp_xgbe_serdes_reset_cdr()
298 tbus = netcp_xgbe_serdes_read_select_tbus(serdes_regs, lane + in netcp_xgbe_serdes_reset_cdr()
302 tmp >> 2, tmp & 3, (tbus >> 2) & 3); in netcp_xgbe_serdes_reset_cdr()
336 pr_debug("XGBE PCSR Linked Lane: %d\n", i); in netcp_xgbe_check_link_status()
338 MASK_WID_SH(2, 1)); in netcp_xgbe_check_link_status()
342 pr_debug("XGBE PCSR Recover Lane: %d\n", i); in netcp_xgbe_check_link_status()
352 current_state[i] = 2; in netcp_xgbe_check_link_status()
356 case 2: in netcp_xgbe_check_link_status()
394 u32 current_state[2] = {0, 0}; in netcp_xgbe_serdes_check_lane()
396 u32 lane_down[2]; in netcp_xgbe_serdes_check_lane()
402 link_up = netcp_xgbe_check_link_status(serdes_regs, sw_regs, 2, in netcp_xgbe_serdes_check_lane()
413 pr_debug("XGBE: detected link down on lane 0\n"); in netcp_xgbe_serdes_check_lane()
416 pr_debug("XGBE: detected link down on lane 1\n"); in netcp_xgbe_serdes_check_lane()
420 return -ETIMEDOUT; in netcp_xgbe_serdes_check_lane()
430 int lane, int cm, int c1, int c2) 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()
461 for (i = 0; i < 2; i++) in netcp_xgbe_serdes_config()
465 /* This is EVM + RTM-BOC specific */ in netcp_xgbe_serdes_config()
466 for (i = 0; i < 2; i++) in netcp_xgbe_serdes_config()
470 for (i = 0; i < 2; i++) in netcp_xgbe_serdes_config()
490 pr_debug("XGBE: serdes already in operation - reset\n"); in netcp_xgbe_serdes_init()