• Home
  • Raw
  • Download

Lines Matching full:interface

49 /* Port count per interface */
53 * Return the number of interfaces the chip has. Each interface
56 * one interface.
74 * Return the number of ports on an interface. Depending on the
76 * specifies that the interface doesn't exist or isn't usable.
78 * @interface: Interface to get the port count for
80 * Returns Number of ports on interface. Can be Zero.
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()
90 * Return interface mode for CN68xx.
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()
142 * Return interface mode for an Octeon II
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()
242 * Return interface mode for CN7XXX.
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()
277 * Get the operating mode of an interface. Depending on the Octeon
279 * of the type of packet I/O supported by an interface.
281 * @interface: Interface to probe
283 * Returns Mode of the interface. Unknown or unsupported interfaces return
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()
320 /* Interface 1 is always disabled on CN31XX and CN30XX */ 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()
365 * per interface numbering
408 * This function sets the interface_port_count[interface] correctly,
412 * @interface: Interface to probe
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()
455 /* PCI target Network Packet 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()
482 * This function probes an interface to determine the actual
485 * interface_port_count[interface] correctly. Hardware setup of the
488 * @interface: Interface to probe
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()
530 /* PCI target Network Packet 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()
550 * Setup the IPD/PIP for the ports on an interface. Packet
552 * interface. The number of ports on the interface must already
555 * @interface: Interface to setup IPD/PIP for
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()
573 * interface or port. This must be called before IPD is enabled.
594 * Setup the PKO for the ports on an interface. The number of
598 * @interface: Interface to setup PKO for
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()
639 * interface or port. This must be called before PKO is enabled.
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()
713 * @interface: Interface to enable
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()
753 /* PCI target Network Packet 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()
781 /* Ports 0-15 are interface 0, 16-31 are interface 1 */ in __cvmx_helper_errata_fix_ipd_ptr_alignment()
782 #define INTERFACE(port) (port >> 4) in __cvmx_helper_errata_fix_ipd_ptr_alignment() macro
797 (INDEX(FIX_IPD_OUTPORT), INTERFACE(FIX_IPD_OUTPORT))); in __cvmx_helper_errata_fix_ipd_ptr_alignment()
799 cvmx_read_csr(CVMX_ASXX_TX_PRT_EN(INTERFACE(FIX_IPD_OUTPORT))); in __cvmx_helper_errata_fix_ipd_ptr_alignment()
801 cvmx_read_csr(CVMX_ASXX_RX_PRT_EN(INTERFACE(FIX_IPD_OUTPORT))); in __cvmx_helper_errata_fix_ipd_ptr_alignment()
804 (INDEX(FIX_IPD_OUTPORT), INTERFACE(FIX_IPD_OUTPORT))); in __cvmx_helper_errata_fix_ipd_ptr_alignment()
807 (INDEX(FIX_IPD_OUTPORT), INTERFACE(FIX_IPD_OUTPORT))); in __cvmx_helper_errata_fix_ipd_ptr_alignment()
816 cvmx_write_csr(CVMX_ASXX_RX_PRT_EN(INTERFACE(FIX_IPD_OUTPORT)), 0); in __cvmx_helper_errata_fix_ipd_ptr_alignment()
838 cvmx_write_csr(CVMX_ASXX_PRT_LOOP(INTERFACE(FIX_IPD_OUTPORT)), in __cvmx_helper_errata_fix_ipd_ptr_alignment()
894 INTERFACE(FIX_IPD_OUTPORT))); in __cvmx_helper_errata_fix_ipd_ptr_alignment()
898 INTERFACE(FIX_IPD_OUTPORT)), gmx_cfg.u64); in __cvmx_helper_errata_fix_ipd_ptr_alignment()
899 cvmx_write_csr(CVMX_ASXX_TX_PRT_EN(INTERFACE(FIX_IPD_OUTPORT)), in __cvmx_helper_errata_fix_ipd_ptr_alignment()
901 cvmx_write_csr(CVMX_ASXX_RX_PRT_EN(INTERFACE(FIX_IPD_OUTPORT)), in __cvmx_helper_errata_fix_ipd_ptr_alignment()
906 INTERFACE(FIX_IPD_OUTPORT)), 65392 - 14 - 4); in __cvmx_helper_errata_fix_ipd_ptr_alignment()
909 INTERFACE(FIX_IPD_OUTPORT)), 65392 - 14 - 4); in __cvmx_helper_errata_fix_ipd_ptr_alignment()
940 (INDEX(FIX_IPD_OUTPORT), INTERFACE(FIX_IPD_OUTPORT)), in __cvmx_helper_errata_fix_ipd_ptr_alignment()
942 cvmx_write_csr(CVMX_ASXX_TX_PRT_EN(INTERFACE(FIX_IPD_OUTPORT)), in __cvmx_helper_errata_fix_ipd_ptr_alignment()
944 cvmx_write_csr(CVMX_ASXX_RX_PRT_EN(INTERFACE(FIX_IPD_OUTPORT)), in __cvmx_helper_errata_fix_ipd_ptr_alignment()
947 (INDEX(FIX_IPD_OUTPORT), INTERFACE(FIX_IPD_OUTPORT)), in __cvmx_helper_errata_fix_ipd_ptr_alignment()
950 (INDEX(FIX_IPD_OUTPORT), INTERFACE(FIX_IPD_OUTPORT)), in __cvmx_helper_errata_fix_ipd_ptr_alignment()
952 cvmx_write_csr(CVMX_ASXX_PRT_LOOP(INTERFACE(FIX_IPD_OUTPORT)), 0); in __cvmx_helper_errata_fix_ipd_ptr_alignment()
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()
1035 cvmx_dprintf("Interface %d has %d ports (%s)\n", 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()