Lines Matching full:interface
47 * @interface: Interface to init
48 * @index: Index of prot on the interface
52 static int __cvmx_helper_sgmii_hardware_init_one_time(int interface, int index) in __cvmx_helper_sgmii_hardware_init_one_time() argument
60 gmxx_prtx_cfg.u64 = cvmx_read_csr(CVMX_GMXX_PRTX_CFG(index, interface)); in __cvmx_helper_sgmii_hardware_init_one_time()
62 cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index, interface), gmxx_prtx_cfg.u64); in __cvmx_helper_sgmii_hardware_init_one_time()
70 cvmx_read_csr(CVMX_PCSX_MISCX_CTL_REG(index, interface)); in __cvmx_helper_sgmii_hardware_init_one_time()
72 cvmx_read_csr(CVMX_PCSX_LINKX_TIMER_COUNT_REG(index, interface)); in __cvmx_helper_sgmii_hardware_init_one_time()
82 cvmx_write_csr(CVMX_PCSX_LINKX_TIMER_COUNT_REG(index, interface), in __cvmx_helper_sgmii_hardware_init_one_time()
98 cvmx_read_csr(CVMX_PCSX_ANX_ADV_REG(index, interface)); in __cvmx_helper_sgmii_hardware_init_one_time()
103 cvmx_write_csr(CVMX_PCSX_ANX_ADV_REG(index, interface), in __cvmx_helper_sgmii_hardware_init_one_time()
108 cvmx_read_csr(CVMX_PCSX_MISCX_CTL_REG(index, interface)); in __cvmx_helper_sgmii_hardware_init_one_time()
114 (index, interface)); in __cvmx_helper_sgmii_hardware_init_one_time()
119 (index, interface), in __cvmx_helper_sgmii_hardware_init_one_time()
132 * @interface: Interface to init
133 * @index: Index of prot on the interface
137 static int __cvmx_helper_sgmii_hardware_init_link(int interface, int index) in __cvmx_helper_sgmii_hardware_init_link() argument
150 cvmx_read_csr(CVMX_PCSX_MRX_CONTROL_REG(index, interface)); in __cvmx_helper_sgmii_hardware_init_link()
153 cvmx_write_csr(CVMX_PCSX_MRX_CONTROL_REG(index, interface), in __cvmx_helper_sgmii_hardware_init_link()
156 (CVMX_PCSX_MRX_CONTROL_REG(index, interface), in __cvmx_helper_sgmii_hardware_init_link()
160 interface, index); in __cvmx_helper_sgmii_hardware_init_link()
172 cvmx_write_csr(CVMX_PCSX_MRX_CONTROL_REG(index, interface), in __cvmx_helper_sgmii_hardware_init_link()
182 CVMX_WAIT_FOR_FIELD64(CVMX_PCSX_MRX_STATUS_REG(index, interface), in __cvmx_helper_sgmii_hardware_init_link()
185 /* cvmx_dprintf("SGMII%d: Port %d link timeout\n", interface, index); */ in __cvmx_helper_sgmii_hardware_init_link()
195 * @interface: Interface to init
196 * @index: Index of prot on the interface
201 static int __cvmx_helper_sgmii_hardware_init_link_speed(int interface, in __cvmx_helper_sgmii_hardware_init_link_speed() argument
211 gmxx_prtx_cfg.u64 = cvmx_read_csr(CVMX_GMXX_PRTX_CFG(index, interface)); in __cvmx_helper_sgmii_hardware_init_link_speed()
214 cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index, interface), gmxx_prtx_cfg.u64); in __cvmx_helper_sgmii_hardware_init_link_speed()
218 (CVMX_GMXX_PRTX_CFG(index, interface), union cvmx_gmxx_prtx_cfg, in __cvmx_helper_sgmii_hardware_init_link_speed()
220 || CVMX_WAIT_FOR_FIELD64(CVMX_GMXX_PRTX_CFG(index, interface), in __cvmx_helper_sgmii_hardware_init_link_speed()
225 interface, index); in __cvmx_helper_sgmii_hardware_init_link_speed()
230 gmxx_prtx_cfg.u64 = cvmx_read_csr(CVMX_GMXX_PRTX_CFG(index, interface)); in __cvmx_helper_sgmii_hardware_init_link_speed()
237 cvmx_read_csr(CVMX_PCSX_MISCX_CTL_REG(index, interface)); in __cvmx_helper_sgmii_hardware_init_link_speed()
257 cvmx_write_csr(CVMX_GMXX_TXX_SLOT(index, interface), 64); in __cvmx_helper_sgmii_hardware_init_link_speed()
258 cvmx_write_csr(CVMX_GMXX_TXX_BURST(index, interface), 0); in __cvmx_helper_sgmii_hardware_init_link_speed()
265 cvmx_write_csr(CVMX_GMXX_TXX_SLOT(index, interface), 64); in __cvmx_helper_sgmii_hardware_init_link_speed()
266 cvmx_write_csr(CVMX_GMXX_TXX_BURST(index, interface), 0); in __cvmx_helper_sgmii_hardware_init_link_speed()
273 cvmx_write_csr(CVMX_GMXX_TXX_SLOT(index, interface), 512); in __cvmx_helper_sgmii_hardware_init_link_speed()
274 cvmx_write_csr(CVMX_GMXX_TXX_BURST(index, interface), 8192); in __cvmx_helper_sgmii_hardware_init_link_speed()
281 cvmx_write_csr(CVMX_PCSX_MISCX_CTL_REG(index, interface), in __cvmx_helper_sgmii_hardware_init_link_speed()
285 cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index, interface), gmxx_prtx_cfg.u64); in __cvmx_helper_sgmii_hardware_init_link_speed()
288 gmxx_prtx_cfg.u64 = cvmx_read_csr(CVMX_GMXX_PRTX_CFG(index, interface)); in __cvmx_helper_sgmii_hardware_init_link_speed()
292 cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index, interface), gmxx_prtx_cfg.u64); in __cvmx_helper_sgmii_hardware_init_link_speed()
298 * Bring up the SGMII interface to be ready for packet I/O but
302 * @interface: Interface to bringup
303 * @num_ports: Number of ports on the interface
307 static int __cvmx_helper_sgmii_hardware_init(int interface, int num_ports) in __cvmx_helper_sgmii_hardware_init() argument
311 __cvmx_helper_setup_gmx(interface, num_ports); in __cvmx_helper_sgmii_hardware_init()
314 int ipd_port = cvmx_helper_get_ipd_port(interface, index); in __cvmx_helper_sgmii_hardware_init()
315 __cvmx_helper_sgmii_hardware_init_one_time(interface, index); in __cvmx_helper_sgmii_hardware_init()
329 int __cvmx_helper_sgmii_enumerate(int interface) in __cvmx_helper_sgmii_enumerate() argument
334 * Probe a SGMII interface and determine the number of ports
335 * connected to it. The SGMII interface should still be down after
338 * @interface: Interface to probe
340 * Returns Number of ports on the interface. Zero to disable.
342 int __cvmx_helper_sgmii_probe(int interface) in __cvmx_helper_sgmii_probe() argument
348 * interface needs to be enabled before IPD otherwise per port in __cvmx_helper_sgmii_probe()
351 mode.u64 = cvmx_read_csr(CVMX_GMXX_INF_MODE(interface)); in __cvmx_helper_sgmii_probe()
353 cvmx_write_csr(CVMX_GMXX_INF_MODE(interface), mode.u64); in __cvmx_helper_sgmii_probe()
354 return __cvmx_helper_sgmii_enumerate(interface); in __cvmx_helper_sgmii_probe()
358 * Bringup and enable a SGMII interface. After this call packet
362 * @interface: Interface to bring up
366 int __cvmx_helper_sgmii_enable(int interface) in __cvmx_helper_sgmii_enable() argument
368 int num_ports = cvmx_helper_ports_on_interface(interface); in __cvmx_helper_sgmii_enable()
371 __cvmx_helper_sgmii_hardware_init(interface, num_ports); in __cvmx_helper_sgmii_enable()
376 cvmx_read_csr(CVMX_GMXX_PRTX_CFG(index, interface)); in __cvmx_helper_sgmii_enable()
378 cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index, interface), in __cvmx_helper_sgmii_enable()
380 __cvmx_interrupt_pcsx_intx_en_reg_enable(index, interface); in __cvmx_helper_sgmii_enable()
382 __cvmx_interrupt_pcsxx_int_en_reg_enable(interface); in __cvmx_helper_sgmii_enable()
383 __cvmx_interrupt_gmxx_enable(interface); in __cvmx_helper_sgmii_enable()
401 int interface = cvmx_helper_get_interface_num(ipd_port); in __cvmx_helper_sgmii_link_get() local
416 cvmx_read_csr(CVMX_PCSX_MRX_CONTROL_REG(index, interface)); in __cvmx_helper_sgmii_link_get()
426 cvmx_read_csr(CVMX_PCSX_MISCX_CTL_REG(index, interface)); in __cvmx_helper_sgmii_link_get()
433 cvmx_read_csr(CVMX_PCSX_MISCX_CTL_REG(index, interface)); in __cvmx_helper_sgmii_link_get()
445 (index, interface)); in __cvmx_helper_sgmii_link_get()
448 (interface, index) != 0) in __cvmx_helper_sgmii_link_get()
455 (index, interface)); in __cvmx_helper_sgmii_link_get()
510 int interface = cvmx_helper_get_interface_num(ipd_port); in __cvmx_helper_sgmii_link_set() local
512 __cvmx_helper_sgmii_hardware_init_link(interface, index); in __cvmx_helper_sgmii_link_set()
513 return __cvmx_helper_sgmii_hardware_init_link_speed(interface, index, in __cvmx_helper_sgmii_link_set()