Lines Matching refs:interface
88 int cvmx_helper_ports_on_interface(int interface) in cvmx_helper_ports_on_interface() argument
90 return interface_port_count[interface]; in cvmx_helper_ports_on_interface()
98 static cvmx_helper_interface_mode_t __cvmx_get_mode_cn68xx(int interface) in __cvmx_get_mode_cn68xx() argument
101 switch (interface) { in __cvmx_get_mode_cn68xx()
117 qlm_cfg.u64 = cvmx_read_csr(CVMX_MIO_QLMX_CFG(interface)); in __cvmx_get_mode_cn68xx()
150 static cvmx_helper_interface_mode_t __cvmx_get_mode_octeon2(int interface) in __cvmx_get_mode_octeon2() argument
155 return __cvmx_get_mode_cn68xx(interface); in __cvmx_get_mode_octeon2()
157 if (interface == 2) in __cvmx_get_mode_octeon2()
160 if (interface == 3) in __cvmx_get_mode_octeon2()
165 (interface == 4 || interface == 5)) || in __cvmx_get_mode_octeon2()
167 interface >= 4 && interface <= 7)) { in __cvmx_get_mode_octeon2()
175 if (interface == 0) in __cvmx_get_mode_octeon2()
177 else if (interface == 1) in __cvmx_get_mode_octeon2()
194 if (interface == 0) { in __cvmx_get_mode_octeon2()
202 } else if (interface == 1) { in __cvmx_get_mode_octeon2()
212 if (interface == 0) { in __cvmx_get_mode_octeon2()
221 if (interface == 1 && OCTEON_IS_MODEL(OCTEON_CN63XX)) in __cvmx_get_mode_octeon2()
224 mode.u64 = cvmx_read_csr(CVMX_GMXX_INF_MODE(interface)); in __cvmx_get_mode_octeon2()
250 static cvmx_helper_interface_mode_t __cvmx_get_mode_cn7xxx(int interface) in __cvmx_get_mode_cn7xxx() argument
254 mode.u64 = cvmx_read_csr(CVMX_GMXX_INF_MODE(interface)); in __cvmx_get_mode_cn7xxx()
256 switch (interface) { in __cvmx_get_mode_cn7xxx()
292 cvmx_helper_interface_mode_t cvmx_helper_interface_get_mode(int interface) in cvmx_helper_interface_get_mode() argument
296 if (interface < 0 || in cvmx_helper_interface_get_mode()
297 interface >= cvmx_helper_get_number_of_interfaces()) in cvmx_helper_interface_get_mode()
304 return __cvmx_get_mode_cn7xxx(interface); in cvmx_helper_interface_get_mode()
310 return __cvmx_get_mode_octeon2(interface); in cvmx_helper_interface_get_mode()
315 if (interface == 2) in cvmx_helper_interface_get_mode()
318 if (interface == 3) { in cvmx_helper_interface_get_mode()
327 if ((interface == 1) in cvmx_helper_interface_get_mode()
333 mode.u64 = cvmx_read_csr(CVMX_GMXX_INF_MODE(interface)); in cvmx_helper_interface_get_mode()
422 int cvmx_helper_interface_enumerate(int interface) in cvmx_helper_interface_enumerate() argument
424 switch (cvmx_helper_interface_get_mode(interface)) { in cvmx_helper_interface_enumerate()
428 interface_port_count[interface] = 0; in cvmx_helper_interface_enumerate()
432 interface_port_count[interface] = in cvmx_helper_interface_enumerate()
433 __cvmx_helper_xaui_enumerate(interface); in cvmx_helper_interface_enumerate()
441 interface_port_count[interface] = in cvmx_helper_interface_enumerate()
442 __cvmx_helper_rgmii_enumerate(interface); in cvmx_helper_interface_enumerate()
449 interface_port_count[interface] = in cvmx_helper_interface_enumerate()
450 __cvmx_helper_spi_enumerate(interface); in cvmx_helper_interface_enumerate()
458 interface_port_count[interface] = in cvmx_helper_interface_enumerate()
459 __cvmx_helper_sgmii_enumerate(interface); in cvmx_helper_interface_enumerate()
463 interface_port_count[interface] = in cvmx_helper_interface_enumerate()
464 __cvmx_helper_npi_enumerate(interface); in cvmx_helper_interface_enumerate()
471 interface_port_count[interface] = in cvmx_helper_interface_enumerate()
472 __cvmx_helper_loop_enumerate(interface); in cvmx_helper_interface_enumerate()
476 interface_port_count[interface] = in cvmx_helper_interface_enumerate()
477 __cvmx_helper_board_interface_probe(interface, in cvmx_helper_interface_enumerate()
479 [interface]); in cvmx_helper_interface_enumerate()
498 int cvmx_helper_interface_probe(int interface) in cvmx_helper_interface_probe() argument
500 cvmx_helper_interface_enumerate(interface); in cvmx_helper_interface_probe()
504 switch (cvmx_helper_interface_get_mode(interface)) { in cvmx_helper_interface_probe()
511 __cvmx_helper_xaui_probe(interface); in cvmx_helper_interface_probe()
519 __cvmx_helper_rgmii_probe(interface); in cvmx_helper_interface_probe()
526 __cvmx_helper_spi_probe(interface); in cvmx_helper_interface_probe()
534 __cvmx_helper_sgmii_probe(interface); in cvmx_helper_interface_probe()
538 __cvmx_helper_npi_probe(interface); in cvmx_helper_interface_probe()
545 __cvmx_helper_loop_probe(interface); in cvmx_helper_interface_probe()
565 static int __cvmx_helper_interface_setup_ipd(int interface) in __cvmx_helper_interface_setup_ipd() argument
567 int ipd_port = cvmx_helper_get_ipd_port(interface, 0); in __cvmx_helper_interface_setup_ipd()
568 int num_ports = interface_port_count[interface]; in __cvmx_helper_interface_setup_ipd()
608 static int __cvmx_helper_interface_setup_pko(int interface) in __cvmx_helper_interface_setup_pko() argument
630 int ipd_port = cvmx_helper_get_ipd_port(interface, 0); in __cvmx_helper_interface_setup_pko()
631 int num_ports = interface_port_count[interface]; in __cvmx_helper_interface_setup_pko()
689 int interface; in __cvmx_helper_global_setup_backpressure() local
690 for (interface = 0; interface < num_interfaces; interface++) { in __cvmx_helper_global_setup_backpressure()
691 switch (cvmx_helper_interface_get_mode(interface)) { in __cvmx_helper_global_setup_backpressure()
703 cvmx_gmx_set_backpressure_override(interface, 0xf); in __cvmx_helper_global_setup_backpressure()
723 static int __cvmx_helper_packet_hardware_enable(int interface) in __cvmx_helper_packet_hardware_enable() argument
726 switch (cvmx_helper_interface_get_mode(interface)) { in __cvmx_helper_packet_hardware_enable()
734 result = __cvmx_helper_xaui_enable(interface); in __cvmx_helper_packet_hardware_enable()
742 result = __cvmx_helper_rgmii_enable(interface); in __cvmx_helper_packet_hardware_enable()
749 result = __cvmx_helper_spi_enable(interface); in __cvmx_helper_packet_hardware_enable()
757 result = __cvmx_helper_sgmii_enable(interface); in __cvmx_helper_packet_hardware_enable()
761 result = __cvmx_helper_npi_enable(interface); in __cvmx_helper_packet_hardware_enable()
768 result = __cvmx_helper_loop_enable(interface); in __cvmx_helper_packet_hardware_enable()
977 int interface; in cvmx_helper_ipd_and_packet_input_enable() local
988 for (interface = 0; interface < num_interfaces; interface++) { in cvmx_helper_ipd_and_packet_input_enable()
989 if (cvmx_helper_ports_on_interface(interface) > 0) in cvmx_helper_ipd_and_packet_input_enable()
990 __cvmx_helper_packet_hardware_enable(interface); in cvmx_helper_ipd_and_packet_input_enable()
1016 int interface; in cvmx_helper_initialize_packet_io_global() local
1038 for (interface = 0; interface < num_interfaces; interface++) { in cvmx_helper_initialize_packet_io_global()
1039 result |= cvmx_helper_interface_probe(interface); in cvmx_helper_initialize_packet_io_global()
1040 if (cvmx_helper_ports_on_interface(interface) > 0) in cvmx_helper_initialize_packet_io_global()
1042 interface, in cvmx_helper_initialize_packet_io_global()
1043 cvmx_helper_ports_on_interface(interface), in cvmx_helper_initialize_packet_io_global()
1046 (interface))); in cvmx_helper_initialize_packet_io_global()
1047 result |= __cvmx_helper_interface_setup_ipd(interface); in cvmx_helper_initialize_packet_io_global()
1048 result |= __cvmx_helper_interface_setup_pko(interface); in cvmx_helper_initialize_packet_io_global()
1077 int interface = cvmx_helper_get_interface_num(ipd_port); in cvmx_helper_link_get() local
1084 if (index >= cvmx_helper_ports_on_interface(interface)) in cvmx_helper_link_get()
1087 switch (cvmx_helper_interface_get_mode(interface)) { in cvmx_helper_link_get()
1138 int interface = cvmx_helper_get_interface_num(ipd_port); in cvmx_helper_link_set() local
1141 if (index >= cvmx_helper_ports_on_interface(interface)) in cvmx_helper_link_set()
1144 switch (cvmx_helper_interface_get_mode(interface)) { in cvmx_helper_link_set()