Lines Matching refs:interface
82 int cvmx_helper_ports_on_interface(int interface) in cvmx_helper_ports_on_interface() argument
84 return interface_port_count[interface]; in cvmx_helper_ports_on_interface()
92 static cvmx_helper_interface_mode_t __cvmx_get_mode_cn68xx(int interface) in __cvmx_get_mode_cn68xx() argument
95 switch (interface) { in __cvmx_get_mode_cn68xx()
111 qlm_cfg.u64 = cvmx_read_csr(CVMX_MIO_QLMX_CFG(interface)); in __cvmx_get_mode_cn68xx()
144 static cvmx_helper_interface_mode_t __cvmx_get_mode_octeon2(int interface) in __cvmx_get_mode_octeon2() argument
149 return __cvmx_get_mode_cn68xx(interface); in __cvmx_get_mode_octeon2()
151 if (interface == 2) in __cvmx_get_mode_octeon2()
154 if (interface == 3) in __cvmx_get_mode_octeon2()
159 (interface == 4 || interface == 5)) || in __cvmx_get_mode_octeon2()
161 interface >= 4 && interface <= 7)) { in __cvmx_get_mode_octeon2()
169 if (interface == 0) in __cvmx_get_mode_octeon2()
171 else if (interface == 1) in __cvmx_get_mode_octeon2()
188 if (interface == 0) { in __cvmx_get_mode_octeon2()
196 } else if (interface == 1) { in __cvmx_get_mode_octeon2()
206 if (interface == 0) { in __cvmx_get_mode_octeon2()
215 if (interface == 1 && OCTEON_IS_MODEL(OCTEON_CN63XX)) in __cvmx_get_mode_octeon2()
218 mode.u64 = cvmx_read_csr(CVMX_GMXX_INF_MODE(interface)); in __cvmx_get_mode_octeon2()
244 static cvmx_helper_interface_mode_t __cvmx_get_mode_cn7xxx(int interface) in __cvmx_get_mode_cn7xxx() argument
248 mode.u64 = cvmx_read_csr(CVMX_GMXX_INF_MODE(interface)); in __cvmx_get_mode_cn7xxx()
250 switch (interface) { in __cvmx_get_mode_cn7xxx()
286 cvmx_helper_interface_mode_t cvmx_helper_interface_get_mode(int interface) in cvmx_helper_interface_get_mode() argument
290 if (interface < 0 || in cvmx_helper_interface_get_mode()
291 interface >= cvmx_helper_get_number_of_interfaces()) in cvmx_helper_interface_get_mode()
298 return __cvmx_get_mode_cn7xxx(interface); in cvmx_helper_interface_get_mode()
304 return __cvmx_get_mode_octeon2(interface); in cvmx_helper_interface_get_mode()
309 if (interface == 2) in cvmx_helper_interface_get_mode()
312 if (interface == 3) { in cvmx_helper_interface_get_mode()
321 if ((interface == 1) in cvmx_helper_interface_get_mode()
327 mode.u64 = cvmx_read_csr(CVMX_GMXX_INF_MODE(interface)); in cvmx_helper_interface_get_mode()
416 int cvmx_helper_interface_enumerate(int interface) in cvmx_helper_interface_enumerate() argument
418 switch (cvmx_helper_interface_get_mode(interface)) { in cvmx_helper_interface_enumerate()
422 interface_port_count[interface] = 0; in cvmx_helper_interface_enumerate()
426 interface_port_count[interface] = in cvmx_helper_interface_enumerate()
427 __cvmx_helper_xaui_enumerate(interface); in cvmx_helper_interface_enumerate()
435 interface_port_count[interface] = in cvmx_helper_interface_enumerate()
436 __cvmx_helper_rgmii_enumerate(interface); in cvmx_helper_interface_enumerate()
443 interface_port_count[interface] = in cvmx_helper_interface_enumerate()
444 __cvmx_helper_spi_enumerate(interface); in cvmx_helper_interface_enumerate()
452 interface_port_count[interface] = in cvmx_helper_interface_enumerate()
453 __cvmx_helper_sgmii_enumerate(interface); in cvmx_helper_interface_enumerate()
457 interface_port_count[interface] = in cvmx_helper_interface_enumerate()
458 __cvmx_helper_npi_enumerate(interface); in cvmx_helper_interface_enumerate()
465 interface_port_count[interface] = in cvmx_helper_interface_enumerate()
466 __cvmx_helper_loop_enumerate(interface); in cvmx_helper_interface_enumerate()
470 interface_port_count[interface] = in cvmx_helper_interface_enumerate()
471 __cvmx_helper_board_interface_probe(interface, in cvmx_helper_interface_enumerate()
473 [interface]); in cvmx_helper_interface_enumerate()
492 int cvmx_helper_interface_probe(int interface) in cvmx_helper_interface_probe() argument
494 cvmx_helper_interface_enumerate(interface); in cvmx_helper_interface_probe()
498 switch (cvmx_helper_interface_get_mode(interface)) { in cvmx_helper_interface_probe()
505 __cvmx_helper_xaui_probe(interface); in cvmx_helper_interface_probe()
513 __cvmx_helper_rgmii_probe(interface); in cvmx_helper_interface_probe()
520 __cvmx_helper_spi_probe(interface); in cvmx_helper_interface_probe()
528 __cvmx_helper_sgmii_probe(interface); in cvmx_helper_interface_probe()
532 __cvmx_helper_npi_probe(interface); in cvmx_helper_interface_probe()
539 __cvmx_helper_loop_probe(interface); in cvmx_helper_interface_probe()
559 static int __cvmx_helper_interface_setup_ipd(int interface) in __cvmx_helper_interface_setup_ipd() argument
561 int ipd_port = cvmx_helper_get_ipd_port(interface, 0); in __cvmx_helper_interface_setup_ipd()
562 int num_ports = interface_port_count[interface]; in __cvmx_helper_interface_setup_ipd()
602 static int __cvmx_helper_interface_setup_pko(int interface) in __cvmx_helper_interface_setup_pko() argument
624 int ipd_port = cvmx_helper_get_ipd_port(interface, 0); in __cvmx_helper_interface_setup_pko()
625 int num_ports = interface_port_count[interface]; in __cvmx_helper_interface_setup_pko()
683 int interface; in __cvmx_helper_global_setup_backpressure() local
684 for (interface = 0; interface < num_interfaces; interface++) { in __cvmx_helper_global_setup_backpressure()
685 switch (cvmx_helper_interface_get_mode(interface)) { in __cvmx_helper_global_setup_backpressure()
697 cvmx_gmx_set_backpressure_override(interface, 0xf); in __cvmx_helper_global_setup_backpressure()
717 static int __cvmx_helper_packet_hardware_enable(int interface) in __cvmx_helper_packet_hardware_enable() argument
720 switch (cvmx_helper_interface_get_mode(interface)) { in __cvmx_helper_packet_hardware_enable()
728 result = __cvmx_helper_xaui_enable(interface); in __cvmx_helper_packet_hardware_enable()
736 result = __cvmx_helper_rgmii_enable(interface); in __cvmx_helper_packet_hardware_enable()
743 result = __cvmx_helper_spi_enable(interface); in __cvmx_helper_packet_hardware_enable()
751 result = __cvmx_helper_sgmii_enable(interface); in __cvmx_helper_packet_hardware_enable()
755 result = __cvmx_helper_npi_enable(interface); in __cvmx_helper_packet_hardware_enable()
762 result = __cvmx_helper_loop_enable(interface); in __cvmx_helper_packet_hardware_enable()
971 int interface; in cvmx_helper_ipd_and_packet_input_enable() local
982 for (interface = 0; interface < num_interfaces; interface++) { in cvmx_helper_ipd_and_packet_input_enable()
983 if (cvmx_helper_ports_on_interface(interface) > 0) in cvmx_helper_ipd_and_packet_input_enable()
984 __cvmx_helper_packet_hardware_enable(interface); in cvmx_helper_ipd_and_packet_input_enable()
1010 int interface; in cvmx_helper_initialize_packet_io_global() local
1032 for (interface = 0; interface < num_interfaces; interface++) { in cvmx_helper_initialize_packet_io_global()
1033 result |= cvmx_helper_interface_probe(interface); in cvmx_helper_initialize_packet_io_global()
1034 if (cvmx_helper_ports_on_interface(interface) > 0) in cvmx_helper_initialize_packet_io_global()
1036 interface, in cvmx_helper_initialize_packet_io_global()
1037 cvmx_helper_ports_on_interface(interface), in cvmx_helper_initialize_packet_io_global()
1040 (interface))); in cvmx_helper_initialize_packet_io_global()
1041 result |= __cvmx_helper_interface_setup_ipd(interface); in cvmx_helper_initialize_packet_io_global()
1042 result |= __cvmx_helper_interface_setup_pko(interface); in cvmx_helper_initialize_packet_io_global()
1081 int interface = cvmx_helper_get_interface_num(ipd_port); in cvmx_helper_link_get() local
1088 if (index >= cvmx_helper_ports_on_interface(interface)) in cvmx_helper_link_get()
1091 switch (cvmx_helper_interface_get_mode(interface)) { in cvmx_helper_link_get()
1142 int interface = cvmx_helper_get_interface_num(ipd_port); in cvmx_helper_link_set() local
1145 if (index >= cvmx_helper_ports_on_interface(interface)) in cvmx_helper_link_set()
1148 switch (cvmx_helper_interface_get_mode(interface)) { in cvmx_helper_link_set()