1 /***********************license start***************
2 * Author: Cavium Networks
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
7 * Copyright (c) 2003-2008 Cavium Networks
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
30 * Helper functions for common, but complicated tasks.
33 #include <asm/octeon/octeon.h>
35 #include <asm/octeon/cvmx-config.h>
37 #include <asm/octeon/cvmx-fpa.h>
38 #include <asm/octeon/cvmx-pip.h>
39 #include <asm/octeon/cvmx-pko.h>
40 #include <asm/octeon/cvmx-ipd.h>
41 #include <asm/octeon/cvmx-spi.h>
42 #include <asm/octeon/cvmx-helper.h>
43 #include <asm/octeon/cvmx-helper-board.h>
45 #include <asm/octeon/cvmx-pip-defs.h>
46 #include <asm/octeon/cvmx-smix-defs.h>
47 #include <asm/octeon/cvmx-asxx-defs.h>
50 * cvmx_override_pko_queue_priority(int ipd_port, uint64_t
51 * priorities[16]) is a function pointer. It is meant to allow
52 * customization of the PKO queue priorities based on the port
53 * number. Users should set this pointer to a function before
54 * calling any cvmx-helper operations.
56 void (*cvmx_override_pko_queue_priority
) (int pko_port
,
57 uint64_t priorities
[16]);
60 * cvmx_override_ipd_port_setup(int ipd_port) is a function
61 * pointer. It is meant to allow customization of the IPD port
62 * setup before packet input/output comes online. It is called
63 * after cvmx-helper does the default IPD configuration, but
64 * before IPD is enabled. Users should set this pointer to a
65 * function before calling any cvmx-helper operations.
67 void (*cvmx_override_ipd_port_setup
) (int ipd_port
);
69 /* Port count per interface */
70 static int interface_port_count
[5];
73 * Return the number of interfaces the chip has. Each interface
74 * may have multiple ports. Most chips support two interfaces,
75 * but the CNX0XX and CNX1XX are exceptions. These only support
78 * Returns Number of interfaces on chip
80 int cvmx_helper_get_number_of_interfaces(void)
82 if (OCTEON_IS_MODEL(OCTEON_CN68XX
))
84 if (OCTEON_IS_MODEL(OCTEON_CN56XX
) || OCTEON_IS_MODEL(OCTEON_CN52XX
))
86 if (OCTEON_IS_MODEL(OCTEON_CN7XXX
))
91 EXPORT_SYMBOL_GPL(cvmx_helper_get_number_of_interfaces
);
94 * Return the number of ports on an interface. Depending on the
95 * chip and configuration, this can be 1-16. A value of 0
96 * specifies that the interface doesn't exist or isn't usable.
98 * @interface: Interface to get the port count for
100 * Returns Number of ports on interface. Can be Zero.
102 int cvmx_helper_ports_on_interface(int interface
)
104 return interface_port_count
[interface
];
106 EXPORT_SYMBOL_GPL(cvmx_helper_ports_on_interface
);
110 * Return interface mode for CN68xx.
112 static cvmx_helper_interface_mode_t
__cvmx_get_mode_cn68xx(int interface
)
114 union cvmx_mio_qlmx_cfg qlm_cfg
;
117 qlm_cfg
.u64
= cvmx_read_csr(CVMX_MIO_QLMX_CFG(0));
118 /* QLM is disabled when QLM SPD is 15. */
119 if (qlm_cfg
.s
.qlm_spd
== 15)
120 return CVMX_HELPER_INTERFACE_MODE_DISABLED
;
122 if (qlm_cfg
.s
.qlm_cfg
== 2)
123 return CVMX_HELPER_INTERFACE_MODE_SGMII
;
124 else if (qlm_cfg
.s
.qlm_cfg
== 3)
125 return CVMX_HELPER_INTERFACE_MODE_XAUI
;
127 return CVMX_HELPER_INTERFACE_MODE_DISABLED
;
131 qlm_cfg
.u64
= cvmx_read_csr(CVMX_MIO_QLMX_CFG(interface
));
132 /* QLM is disabled when QLM SPD is 15. */
133 if (qlm_cfg
.s
.qlm_spd
== 15)
134 return CVMX_HELPER_INTERFACE_MODE_DISABLED
;
136 if (qlm_cfg
.s
.qlm_cfg
== 2)
137 return CVMX_HELPER_INTERFACE_MODE_SGMII
;
138 else if (qlm_cfg
.s
.qlm_cfg
== 3)
139 return CVMX_HELPER_INTERFACE_MODE_XAUI
;
141 return CVMX_HELPER_INTERFACE_MODE_DISABLED
;
143 qlm_cfg
.u64
= cvmx_read_csr(CVMX_MIO_QLMX_CFG(3));
144 /* QLM is disabled when QLM SPD is 15. */
145 if (qlm_cfg
.s
.qlm_spd
== 15) {
146 return CVMX_HELPER_INTERFACE_MODE_DISABLED
;
147 } else if (qlm_cfg
.s
.qlm_cfg
!= 0) {
148 qlm_cfg
.u64
= cvmx_read_csr(CVMX_MIO_QLMX_CFG(1));
149 if (qlm_cfg
.s
.qlm_cfg
!= 0)
150 return CVMX_HELPER_INTERFACE_MODE_DISABLED
;
152 return CVMX_HELPER_INTERFACE_MODE_NPI
;
154 return CVMX_HELPER_INTERFACE_MODE_LOOP
;
156 return CVMX_HELPER_INTERFACE_MODE_DISABLED
;
162 * Return interface mode for an Octeon II
164 static cvmx_helper_interface_mode_t
__cvmx_get_mode_octeon2(int interface
)
166 union cvmx_gmxx_inf_mode mode
;
168 if (OCTEON_IS_MODEL(OCTEON_CN68XX
))
169 return __cvmx_get_mode_cn68xx(interface
);
172 return CVMX_HELPER_INTERFACE_MODE_NPI
;
175 return CVMX_HELPER_INTERFACE_MODE_LOOP
;
177 /* Only present in CN63XX & CN66XX Octeon model */
178 if ((OCTEON_IS_MODEL(OCTEON_CN63XX
) &&
179 (interface
== 4 || interface
== 5)) ||
180 (OCTEON_IS_MODEL(OCTEON_CN66XX
) &&
181 interface
>= 4 && interface
<= 7)) {
182 return CVMX_HELPER_INTERFACE_MODE_DISABLED
;
185 if (OCTEON_IS_MODEL(OCTEON_CN66XX
)) {
186 union cvmx_mio_qlmx_cfg mio_qlm_cfg
;
188 /* QLM2 is SGMII0 and QLM1 is SGMII1 */
190 mio_qlm_cfg
.u64
= cvmx_read_csr(CVMX_MIO_QLMX_CFG(2));
191 else if (interface
== 1)
192 mio_qlm_cfg
.u64
= cvmx_read_csr(CVMX_MIO_QLMX_CFG(1));
194 return CVMX_HELPER_INTERFACE_MODE_DISABLED
;
196 if (mio_qlm_cfg
.s
.qlm_spd
== 15)
197 return CVMX_HELPER_INTERFACE_MODE_DISABLED
;
199 if (mio_qlm_cfg
.s
.qlm_cfg
== 9)
200 return CVMX_HELPER_INTERFACE_MODE_SGMII
;
201 else if (mio_qlm_cfg
.s
.qlm_cfg
== 11)
202 return CVMX_HELPER_INTERFACE_MODE_XAUI
;
204 return CVMX_HELPER_INTERFACE_MODE_DISABLED
;
205 } else if (OCTEON_IS_MODEL(OCTEON_CN61XX
)) {
206 union cvmx_mio_qlmx_cfg qlm_cfg
;
208 if (interface
== 0) {
209 qlm_cfg
.u64
= cvmx_read_csr(CVMX_MIO_QLMX_CFG(2));
210 if (qlm_cfg
.s
.qlm_cfg
== 2)
211 return CVMX_HELPER_INTERFACE_MODE_SGMII
;
212 else if (qlm_cfg
.s
.qlm_cfg
== 3)
213 return CVMX_HELPER_INTERFACE_MODE_XAUI
;
215 return CVMX_HELPER_INTERFACE_MODE_DISABLED
;
216 } else if (interface
== 1) {
217 qlm_cfg
.u64
= cvmx_read_csr(CVMX_MIO_QLMX_CFG(0));
218 if (qlm_cfg
.s
.qlm_cfg
== 2)
219 return CVMX_HELPER_INTERFACE_MODE_SGMII
;
220 else if (qlm_cfg
.s
.qlm_cfg
== 3)
221 return CVMX_HELPER_INTERFACE_MODE_XAUI
;
223 return CVMX_HELPER_INTERFACE_MODE_DISABLED
;
225 } else if (OCTEON_IS_MODEL(OCTEON_CNF71XX
)) {
226 if (interface
== 0) {
227 union cvmx_mio_qlmx_cfg qlm_cfg
;
228 qlm_cfg
.u64
= cvmx_read_csr(CVMX_MIO_QLMX_CFG(0));
229 if (qlm_cfg
.s
.qlm_cfg
== 2)
230 return CVMX_HELPER_INTERFACE_MODE_SGMII
;
232 return CVMX_HELPER_INTERFACE_MODE_DISABLED
;
235 if (interface
== 1 && OCTEON_IS_MODEL(OCTEON_CN63XX
))
236 return CVMX_HELPER_INTERFACE_MODE_DISABLED
;
238 mode
.u64
= cvmx_read_csr(CVMX_GMXX_INF_MODE(interface
));
240 if (OCTEON_IS_MODEL(OCTEON_CN63XX
)) {
241 switch (mode
.cn63xx
.mode
) {
243 return CVMX_HELPER_INTERFACE_MODE_SGMII
;
245 return CVMX_HELPER_INTERFACE_MODE_XAUI
;
247 return CVMX_HELPER_INTERFACE_MODE_DISABLED
;
251 return CVMX_HELPER_INTERFACE_MODE_DISABLED
;
254 return CVMX_HELPER_INTERFACE_MODE_GMII
;
256 return CVMX_HELPER_INTERFACE_MODE_RGMII
;
262 * Return interface mode for CN7XXX.
264 static cvmx_helper_interface_mode_t
__cvmx_get_mode_cn7xxx(int interface
)
266 union cvmx_gmxx_inf_mode mode
;
268 mode
.u64
= cvmx_read_csr(CVMX_GMXX_INF_MODE(interface
));
273 switch (mode
.cn68xx
.mode
) {
275 return CVMX_HELPER_INTERFACE_MODE_DISABLED
;
278 return CVMX_HELPER_INTERFACE_MODE_SGMII
;
280 return CVMX_HELPER_INTERFACE_MODE_XAUI
;
282 return CVMX_HELPER_INTERFACE_MODE_SGMII
;
285 return CVMX_HELPER_INTERFACE_MODE_NPI
;
287 return CVMX_HELPER_INTERFACE_MODE_LOOP
;
289 return CVMX_HELPER_INTERFACE_MODE_RGMII
;
291 return CVMX_HELPER_INTERFACE_MODE_DISABLED
;
296 * Get the operating mode of an interface. Depending on the Octeon
297 * chip and configuration, this function returns an enumeration
298 * of the type of packet I/O supported by an interface.
300 * @interface: Interface to probe
302 * Returns Mode of the interface. Unknown or unsupported interfaces return
305 cvmx_helper_interface_mode_t
cvmx_helper_interface_get_mode(int interface
)
307 union cvmx_gmxx_inf_mode mode
;
310 interface
>= cvmx_helper_get_number_of_interfaces())
311 return CVMX_HELPER_INTERFACE_MODE_DISABLED
;
316 if (OCTEON_IS_MODEL(OCTEON_CN7XXX
))
317 return __cvmx_get_mode_cn7xxx(interface
);
322 if (OCTEON_IS_MODEL(OCTEON_CN6XXX
) || OCTEON_IS_MODEL(OCTEON_CNF71XX
))
323 return __cvmx_get_mode_octeon2(interface
);
326 * Octeon and Octeon Plus models
329 return CVMX_HELPER_INTERFACE_MODE_NPI
;
331 if (interface
== 3) {
332 if (OCTEON_IS_MODEL(OCTEON_CN56XX
)
333 || OCTEON_IS_MODEL(OCTEON_CN52XX
))
334 return CVMX_HELPER_INTERFACE_MODE_LOOP
;
336 return CVMX_HELPER_INTERFACE_MODE_DISABLED
;
340 && cvmx_sysinfo_get()->board_type
== CVMX_BOARD_TYPE_CN3005_EVB_HS5
341 && cvmx_sysinfo_get()->board_rev_major
== 1) {
343 * Lie about interface type of CN3005 board. This
344 * board has a switch on port 1 like the other
345 * evaluation boards, but it is connected over RGMII
346 * instead of GMII. Report GMII mode so that the
347 * speed is forced to 1 Gbit full duplex. Other than
348 * some initial configuration (which does not use the
349 * output of this function) there is no difference in
350 * setup between GMII and RGMII modes.
352 return CVMX_HELPER_INTERFACE_MODE_GMII
;
355 /* Interface 1 is always disabled on CN31XX and CN30XX */
357 && (OCTEON_IS_MODEL(OCTEON_CN31XX
) || OCTEON_IS_MODEL(OCTEON_CN30XX
)
358 || OCTEON_IS_MODEL(OCTEON_CN50XX
)
359 || OCTEON_IS_MODEL(OCTEON_CN52XX
)))
360 return CVMX_HELPER_INTERFACE_MODE_DISABLED
;
362 mode
.u64
= cvmx_read_csr(CVMX_GMXX_INF_MODE(interface
));
364 if (OCTEON_IS_MODEL(OCTEON_CN56XX
) || OCTEON_IS_MODEL(OCTEON_CN52XX
)) {
365 switch (mode
.cn56xx
.mode
) {
367 return CVMX_HELPER_INTERFACE_MODE_DISABLED
;
369 return CVMX_HELPER_INTERFACE_MODE_XAUI
;
371 return CVMX_HELPER_INTERFACE_MODE_SGMII
;
373 return CVMX_HELPER_INTERFACE_MODE_PICMG
;
375 return CVMX_HELPER_INTERFACE_MODE_DISABLED
;
379 return CVMX_HELPER_INTERFACE_MODE_DISABLED
;
382 if (OCTEON_IS_MODEL(OCTEON_CN38XX
)
383 || OCTEON_IS_MODEL(OCTEON_CN58XX
))
384 return CVMX_HELPER_INTERFACE_MODE_SPI
;
386 return CVMX_HELPER_INTERFACE_MODE_GMII
;
388 return CVMX_HELPER_INTERFACE_MODE_RGMII
;
391 EXPORT_SYMBOL_GPL(cvmx_helper_interface_get_mode
);
394 * Configure the IPD/PIP tagging and QoS options for a specific
395 * port. This function determines the POW work queue entry
396 * contents for a port. The setup performed here is controlled by
397 * the defines in executive-config.h.
399 * @ipd_port: Port to configure. This follows the IPD numbering, not the
400 * per interface numbering
402 * Returns Zero on success, negative on failure
404 static int __cvmx_helper_port_setup_ipd(int ipd_port
)
406 union cvmx_pip_prt_cfgx port_config
;
407 union cvmx_pip_prt_tagx tag_config
;
409 port_config
.u64
= cvmx_read_csr(CVMX_PIP_PRT_CFGX(ipd_port
));
410 tag_config
.u64
= cvmx_read_csr(CVMX_PIP_PRT_TAGX(ipd_port
));
412 /* Have each port go to a different POW queue */
413 port_config
.s
.qos
= ipd_port
& 0x7;
415 /* Process the headers and place the IP header in the work queue */
416 port_config
.s
.mode
= CVMX_HELPER_INPUT_PORT_SKIP_MODE
;
418 tag_config
.s
.ip6_src_flag
= CVMX_HELPER_INPUT_TAG_IPV6_SRC_IP
;
419 tag_config
.s
.ip6_dst_flag
= CVMX_HELPER_INPUT_TAG_IPV6_DST_IP
;
420 tag_config
.s
.ip6_sprt_flag
= CVMX_HELPER_INPUT_TAG_IPV6_SRC_PORT
;
421 tag_config
.s
.ip6_dprt_flag
= CVMX_HELPER_INPUT_TAG_IPV6_DST_PORT
;
422 tag_config
.s
.ip6_nxth_flag
= CVMX_HELPER_INPUT_TAG_IPV6_NEXT_HEADER
;
423 tag_config
.s
.ip4_src_flag
= CVMX_HELPER_INPUT_TAG_IPV4_SRC_IP
;
424 tag_config
.s
.ip4_dst_flag
= CVMX_HELPER_INPUT_TAG_IPV4_DST_IP
;
425 tag_config
.s
.ip4_sprt_flag
= CVMX_HELPER_INPUT_TAG_IPV4_SRC_PORT
;
426 tag_config
.s
.ip4_dprt_flag
= CVMX_HELPER_INPUT_TAG_IPV4_DST_PORT
;
427 tag_config
.s
.ip4_pctl_flag
= CVMX_HELPER_INPUT_TAG_IPV4_PROTOCOL
;
428 tag_config
.s
.inc_prt_flag
= CVMX_HELPER_INPUT_TAG_INPUT_PORT
;
429 tag_config
.s
.tcp6_tag_type
= CVMX_HELPER_INPUT_TAG_TYPE
;
430 tag_config
.s
.tcp4_tag_type
= CVMX_HELPER_INPUT_TAG_TYPE
;
431 tag_config
.s
.ip6_tag_type
= CVMX_HELPER_INPUT_TAG_TYPE
;
432 tag_config
.s
.ip4_tag_type
= CVMX_HELPER_INPUT_TAG_TYPE
;
433 tag_config
.s
.non_tag_type
= CVMX_HELPER_INPUT_TAG_TYPE
;
434 /* Put all packets in group 0. Other groups can be used by the app */
435 tag_config
.s
.grp
= 0;
437 cvmx_pip_config_port(ipd_port
, port_config
, tag_config
);
439 /* Give the user a chance to override our setting for each port */
440 if (cvmx_override_ipd_port_setup
)
441 cvmx_override_ipd_port_setup(ipd_port
);
447 * This function sets the interface_port_count[interface] correctly,
448 * without modifying any hardware configuration. Hardware setup of
449 * the ports will be performed later.
451 * @interface: Interface to probe
453 * Returns Zero on success, negative on failure
455 int cvmx_helper_interface_enumerate(int interface
)
457 switch (cvmx_helper_interface_get_mode(interface
)) {
458 /* These types don't support ports to IPD/PKO */
459 case CVMX_HELPER_INTERFACE_MODE_DISABLED
:
460 case CVMX_HELPER_INTERFACE_MODE_PCIE
:
461 interface_port_count
[interface
] = 0;
463 /* XAUI is a single high speed port */
464 case CVMX_HELPER_INTERFACE_MODE_XAUI
:
465 interface_port_count
[interface
] =
466 __cvmx_helper_xaui_enumerate(interface
);
469 * RGMII/GMII/MII are all treated about the same. Most
470 * functions refer to these ports as RGMII.
472 case CVMX_HELPER_INTERFACE_MODE_RGMII
:
473 case CVMX_HELPER_INTERFACE_MODE_GMII
:
474 interface_port_count
[interface
] =
475 __cvmx_helper_rgmii_enumerate(interface
);
478 * SPI4 can have 1-16 ports depending on the device at
481 case CVMX_HELPER_INTERFACE_MODE_SPI
:
482 interface_port_count
[interface
] =
483 __cvmx_helper_spi_enumerate(interface
);
486 * SGMII can have 1-4 ports depending on how many are
489 case CVMX_HELPER_INTERFACE_MODE_SGMII
:
490 case CVMX_HELPER_INTERFACE_MODE_PICMG
:
491 interface_port_count
[interface
] =
492 __cvmx_helper_sgmii_enumerate(interface
);
494 /* PCI target Network Packet Interface */
495 case CVMX_HELPER_INTERFACE_MODE_NPI
:
496 interface_port_count
[interface
] =
497 __cvmx_helper_npi_enumerate(interface
);
500 * Special loopback only ports. These are not the same
501 * as other ports in loopback mode.
503 case CVMX_HELPER_INTERFACE_MODE_LOOP
:
504 interface_port_count
[interface
] =
505 __cvmx_helper_loop_enumerate(interface
);
509 interface_port_count
[interface
] =
510 __cvmx_helper_board_interface_probe(interface
,
514 /* Make sure all global variables propagate to other cores */
521 * This function probes an interface to determine the actual
522 * number of hardware ports connected to it. It doesn't setup the
523 * ports or enable them. The main goal here is to set the global
524 * interface_port_count[interface] correctly. Hardware setup of the
525 * ports will be performed later.
527 * @interface: Interface to probe
529 * Returns Zero on success, negative on failure
531 int cvmx_helper_interface_probe(int interface
)
533 cvmx_helper_interface_enumerate(interface
);
534 /* At this stage in the game we don't want packets to be moving yet.
535 The following probe calls should perform hardware setup
536 needed to determine port counts. Receive must still be disabled */
537 switch (cvmx_helper_interface_get_mode(interface
)) {
538 /* These types don't support ports to IPD/PKO */
539 case CVMX_HELPER_INTERFACE_MODE_DISABLED
:
540 case CVMX_HELPER_INTERFACE_MODE_PCIE
:
542 /* XAUI is a single high speed port */
543 case CVMX_HELPER_INTERFACE_MODE_XAUI
:
544 __cvmx_helper_xaui_probe(interface
);
547 * RGMII/GMII/MII are all treated about the same. Most
548 * functions refer to these ports as RGMII.
550 case CVMX_HELPER_INTERFACE_MODE_RGMII
:
551 case CVMX_HELPER_INTERFACE_MODE_GMII
:
552 __cvmx_helper_rgmii_probe(interface
);
555 * SPI4 can have 1-16 ports depending on the device at
558 case CVMX_HELPER_INTERFACE_MODE_SPI
:
559 __cvmx_helper_spi_probe(interface
);
562 * SGMII can have 1-4 ports depending on how many are
565 case CVMX_HELPER_INTERFACE_MODE_SGMII
:
566 case CVMX_HELPER_INTERFACE_MODE_PICMG
:
567 __cvmx_helper_sgmii_probe(interface
);
569 /* PCI target Network Packet Interface */
570 case CVMX_HELPER_INTERFACE_MODE_NPI
:
571 __cvmx_helper_npi_probe(interface
);
574 * Special loopback only ports. These are not the same
575 * as other ports in loopback mode.
577 case CVMX_HELPER_INTERFACE_MODE_LOOP
:
578 __cvmx_helper_loop_probe(interface
);
582 /* Make sure all global variables propagate to other cores */
589 * Setup the IPD/PIP for the ports on an interface. Packet
590 * classification and tagging are set for every port on the
591 * interface. The number of ports on the interface must already
594 * @interface: Interface to setup IPD/PIP for
596 * Returns Zero on success, negative on failure
598 static int __cvmx_helper_interface_setup_ipd(int interface
)
600 int ipd_port
= cvmx_helper_get_ipd_port(interface
, 0);
601 int num_ports
= interface_port_count
[interface
];
603 while (num_ports
--) {
604 __cvmx_helper_port_setup_ipd(ipd_port
);
611 * Setup global setting for IPD/PIP not related to a specific
612 * interface or port. This must be called before IPD is enabled.
614 * Returns Zero on success, negative on failure.
616 static int __cvmx_helper_global_setup_ipd(void)
618 /* Setup the global packet input options */
619 cvmx_ipd_config(CVMX_FPA_PACKET_POOL_SIZE
/ 8,
620 CVMX_HELPER_FIRST_MBUFF_SKIP
/ 8,
621 CVMX_HELPER_NOT_FIRST_MBUFF_SKIP
/ 8,
622 /* The +8 is to account for the next ptr */
623 (CVMX_HELPER_FIRST_MBUFF_SKIP
+ 8) / 128,
624 /* The +8 is to account for the next ptr */
625 (CVMX_HELPER_NOT_FIRST_MBUFF_SKIP
+ 8) / 128,
627 CVMX_IPD_OPC_MODE_STT
,
628 CVMX_HELPER_ENABLE_BACK_PRESSURE
);
633 * Setup the PKO for the ports on an interface. The number of
634 * queues per port and the priority of each PKO output queue
635 * is set here. PKO must be disabled when this function is called.
637 * @interface: Interface to setup PKO for
639 * Returns Zero on success, negative on failure
641 static int __cvmx_helper_interface_setup_pko(int interface
)
644 * Each packet output queue has an associated priority. The
645 * higher the priority, the more often it can send a packet. A
646 * priority of 8 means it can send in all 8 rounds of
647 * contention. We're going to make each queue one less than
648 * the last. The vector of priorities has been extended to
649 * support CN5xxx CPUs, where up to 16 queues can be
650 * associated to a port. To keep backward compatibility we
651 * don't change the initial 8 priorities and replicate them in
652 * the second half. With per-core PKO queues (PKO lockless
653 * operation) all queues have the same priority.
655 uint64_t priorities
[16] =
656 { 8, 7, 6, 5, 4, 3, 2, 1, 8, 7, 6, 5, 4, 3, 2, 1 };
659 * Setup the IPD/PIP and PKO for the ports discovered
660 * above. Here packet classification, tagging and output
661 * priorities are set.
663 int ipd_port
= cvmx_helper_get_ipd_port(interface
, 0);
664 int num_ports
= interface_port_count
[interface
];
665 while (num_ports
--) {
667 * Give the user a chance to override the per queue
670 if (cvmx_override_pko_queue_priority
)
671 cvmx_override_pko_queue_priority(ipd_port
, priorities
);
673 cvmx_pko_config_port(ipd_port
,
674 cvmx_pko_get_base_queue_per_core(ipd_port
,
676 cvmx_pko_get_num_queues(ipd_port
),
684 * Setup global setting for PKO not related to a specific
685 * interface or port. This must be called before PKO is enabled.
687 * Returns Zero on success, negative on failure.
689 static int __cvmx_helper_global_setup_pko(void)
692 * Disable tagwait FAU timeout. This needs to be done before
693 * anyone might start packet output using tags.
695 union cvmx_iob_fau_timeout fau_to
;
697 fau_to
.s
.tout_val
= 0xfff;
698 fau_to
.s
.tout_enb
= 0;
699 cvmx_write_csr(CVMX_IOB_FAU_TIMEOUT
, fau_to
.u64
);
701 if (OCTEON_IS_MODEL(OCTEON_CN68XX
)) {
702 union cvmx_pko_reg_min_pkt min_pkt
;
705 min_pkt
.s
.size1
= 59;
706 min_pkt
.s
.size2
= 59;
707 min_pkt
.s
.size3
= 59;
708 min_pkt
.s
.size4
= 59;
709 min_pkt
.s
.size5
= 59;
710 min_pkt
.s
.size6
= 59;
711 min_pkt
.s
.size7
= 59;
712 cvmx_write_csr(CVMX_PKO_REG_MIN_PKT
, min_pkt
.u64
);
719 * Setup global backpressure setting.
721 * Returns Zero on success, negative on failure
723 static int __cvmx_helper_global_setup_backpressure(void)
725 #if CVMX_HELPER_DISABLE_RGMII_BACKPRESSURE
726 /* Disable backpressure if configured to do so */
727 /* Disable backpressure (pause frame) generation */
728 int num_interfaces
= cvmx_helper_get_number_of_interfaces();
730 for (interface
= 0; interface
< num_interfaces
; interface
++) {
731 switch (cvmx_helper_interface_get_mode(interface
)) {
732 case CVMX_HELPER_INTERFACE_MODE_DISABLED
:
733 case CVMX_HELPER_INTERFACE_MODE_PCIE
:
734 case CVMX_HELPER_INTERFACE_MODE_NPI
:
735 case CVMX_HELPER_INTERFACE_MODE_LOOP
:
736 case CVMX_HELPER_INTERFACE_MODE_XAUI
:
738 case CVMX_HELPER_INTERFACE_MODE_RGMII
:
739 case CVMX_HELPER_INTERFACE_MODE_GMII
:
740 case CVMX_HELPER_INTERFACE_MODE_SPI
:
741 case CVMX_HELPER_INTERFACE_MODE_SGMII
:
742 case CVMX_HELPER_INTERFACE_MODE_PICMG
:
743 cvmx_gmx_set_backpressure_override(interface
, 0xf);
753 * Enable packet input/output from the hardware. This function is
754 * called after all internal setup is complete and IPD is enabled.
755 * After this function completes, packets will be accepted from the
756 * hardware ports. PKO should still be disabled to make sure packets
757 * aren't sent out partially setup hardware.
759 * @interface: Interface to enable
761 * Returns Zero on success, negative on failure
763 static int __cvmx_helper_packet_hardware_enable(int interface
)
766 switch (cvmx_helper_interface_get_mode(interface
)) {
767 /* These types don't support ports to IPD/PKO */
768 case CVMX_HELPER_INTERFACE_MODE_DISABLED
:
769 case CVMX_HELPER_INTERFACE_MODE_PCIE
:
772 /* XAUI is a single high speed port */
773 case CVMX_HELPER_INTERFACE_MODE_XAUI
:
774 result
= __cvmx_helper_xaui_enable(interface
);
777 * RGMII/GMII/MII are all treated about the same. Most
778 * functions refer to these ports as RGMII
780 case CVMX_HELPER_INTERFACE_MODE_RGMII
:
781 case CVMX_HELPER_INTERFACE_MODE_GMII
:
782 result
= __cvmx_helper_rgmii_enable(interface
);
785 * SPI4 can have 1-16 ports depending on the device at
788 case CVMX_HELPER_INTERFACE_MODE_SPI
:
789 result
= __cvmx_helper_spi_enable(interface
);
792 * SGMII can have 1-4 ports depending on how many are
795 case CVMX_HELPER_INTERFACE_MODE_SGMII
:
796 case CVMX_HELPER_INTERFACE_MODE_PICMG
:
797 result
= __cvmx_helper_sgmii_enable(interface
);
799 /* PCI target Network Packet Interface */
800 case CVMX_HELPER_INTERFACE_MODE_NPI
:
801 result
= __cvmx_helper_npi_enable(interface
);
804 * Special loopback only ports. These are not the same
805 * as other ports in loopback mode
807 case CVMX_HELPER_INTERFACE_MODE_LOOP
:
808 result
= __cvmx_helper_loop_enable(interface
);
811 result
|= __cvmx_helper_board_hardware_enable(interface
);
816 * Function to adjust internal IPD pointer alignments
818 * Returns 0 on success
821 int __cvmx_helper_errata_fix_ipd_ptr_alignment(void)
823 #define FIX_IPD_FIRST_BUFF_PAYLOAD_BYTES \
824 (CVMX_FPA_PACKET_POOL_SIZE-8-CVMX_HELPER_FIRST_MBUFF_SKIP)
825 #define FIX_IPD_NON_FIRST_BUFF_PAYLOAD_BYTES \
826 (CVMX_FPA_PACKET_POOL_SIZE-8-CVMX_HELPER_NOT_FIRST_MBUFF_SKIP)
827 #define FIX_IPD_OUTPORT 0
828 /* Ports 0-15 are interface 0, 16-31 are interface 1 */
829 #define INTERFACE(port) (port >> 4)
830 #define INDEX(port) (port & 0xf)
832 cvmx_pko_command_word0_t pko_command
;
833 union cvmx_buf_ptr g_buffer
, pkt_buffer
;
835 int size
, num_segs
= 0, wqe_pcnt
, pkt_pcnt
;
836 union cvmx_gmxx_prtx_cfg gmx_cfg
;
841 /* Save values for restore at end */
843 cvmx_read_csr(CVMX_GMXX_PRTX_CFG
844 (INDEX(FIX_IPD_OUTPORT
), INTERFACE(FIX_IPD_OUTPORT
)));
846 cvmx_read_csr(CVMX_ASXX_TX_PRT_EN(INTERFACE(FIX_IPD_OUTPORT
)));
848 cvmx_read_csr(CVMX_ASXX_RX_PRT_EN(INTERFACE(FIX_IPD_OUTPORT
)));
849 uint64_t rxx_jabber
=
850 cvmx_read_csr(CVMX_GMXX_RXX_JABBER
851 (INDEX(FIX_IPD_OUTPORT
), INTERFACE(FIX_IPD_OUTPORT
)));
853 cvmx_read_csr(CVMX_GMXX_RXX_FRM_MAX
854 (INDEX(FIX_IPD_OUTPORT
), INTERFACE(FIX_IPD_OUTPORT
)));
856 /* Configure port to gig FDX as required for loopback mode */
857 cvmx_helper_rgmii_internal_loopback(FIX_IPD_OUTPORT
);
860 * Disable reception on all ports so if traffic is present it
861 * will not interfere.
863 cvmx_write_csr(CVMX_ASXX_RX_PRT_EN(INTERFACE(FIX_IPD_OUTPORT
)), 0);
865 __delay(100000000ull);
867 for (retry_loop_cnt
= 0; retry_loop_cnt
< 10; retry_loop_cnt
++) {
869 wqe_pcnt
= cvmx_read_csr(CVMX_IPD_PTR_COUNT
);
870 pkt_pcnt
= (wqe_pcnt
>> 7) & 0x7f;
873 num_segs
= (2 + pkt_pcnt
- wqe_pcnt
) & 3;
881 FIX_IPD_FIRST_BUFF_PAYLOAD_BYTES
+
882 ((num_segs
- 1) * FIX_IPD_NON_FIRST_BUFF_PAYLOAD_BYTES
) -
883 (FIX_IPD_NON_FIRST_BUFF_PAYLOAD_BYTES
/ 2);
885 cvmx_write_csr(CVMX_ASXX_PRT_LOOP(INTERFACE(FIX_IPD_OUTPORT
)),
886 1 << INDEX(FIX_IPD_OUTPORT
));
891 cvmx_ptr_to_phys(cvmx_fpa_alloc(CVMX_FPA_WQE_POOL
));
892 if (g_buffer
.s
.addr
== 0) {
893 cvmx_dprintf("WARNING: FIX_IPD_PTR_ALIGNMENT "
894 "buffer allocation failure.\n");
898 g_buffer
.s
.pool
= CVMX_FPA_WQE_POOL
;
899 g_buffer
.s
.size
= num_segs
;
903 cvmx_ptr_to_phys(cvmx_fpa_alloc(CVMX_FPA_PACKET_POOL
));
904 if (pkt_buffer
.s
.addr
== 0) {
905 cvmx_dprintf("WARNING: FIX_IPD_PTR_ALIGNMENT "
906 "buffer allocation failure.\n");
910 pkt_buffer
.s
.pool
= CVMX_FPA_PACKET_POOL
;
911 pkt_buffer
.s
.size
= FIX_IPD_FIRST_BUFF_PAYLOAD_BYTES
;
913 p64
= (uint64_t *) cvmx_phys_to_ptr(pkt_buffer
.s
.addr
);
914 p64
[0] = 0xffffffffffff0000ull
;
915 p64
[1] = 0x08004510ull
;
916 p64
[2] = ((uint64_t) (size
- 14) << 48) | 0x5ae740004000ull
;
917 p64
[3] = 0x3a5fc0a81073c0a8ull
;
919 for (i
= 0; i
< num_segs
; i
++) {
922 FIX_IPD_NON_FIRST_BUFF_PAYLOAD_BYTES
;
924 if (i
== (num_segs
- 1))
927 *(uint64_t *) cvmx_phys_to_ptr(g_buffer
.s
.addr
+
928 8 * i
) = pkt_buffer
.u64
;
931 /* Build the PKO command */
933 pko_command
.s
.segs
= num_segs
;
934 pko_command
.s
.total_bytes
= size
;
935 pko_command
.s
.dontfree
= 0;
936 pko_command
.s
.gather
= 1;
939 cvmx_read_csr(CVMX_GMXX_PRTX_CFG
940 (INDEX(FIX_IPD_OUTPORT
),
941 INTERFACE(FIX_IPD_OUTPORT
)));
943 cvmx_write_csr(CVMX_GMXX_PRTX_CFG
944 (INDEX(FIX_IPD_OUTPORT
),
945 INTERFACE(FIX_IPD_OUTPORT
)), gmx_cfg
.u64
);
946 cvmx_write_csr(CVMX_ASXX_TX_PRT_EN(INTERFACE(FIX_IPD_OUTPORT
)),
947 1 << INDEX(FIX_IPD_OUTPORT
));
948 cvmx_write_csr(CVMX_ASXX_RX_PRT_EN(INTERFACE(FIX_IPD_OUTPORT
)),
949 1 << INDEX(FIX_IPD_OUTPORT
));
951 cvmx_write_csr(CVMX_GMXX_RXX_JABBER
952 (INDEX(FIX_IPD_OUTPORT
),
953 INTERFACE(FIX_IPD_OUTPORT
)), 65392 - 14 - 4);
954 cvmx_write_csr(CVMX_GMXX_RXX_FRM_MAX
955 (INDEX(FIX_IPD_OUTPORT
),
956 INTERFACE(FIX_IPD_OUTPORT
)), 65392 - 14 - 4);
958 cvmx_pko_send_packet_prepare(FIX_IPD_OUTPORT
,
959 cvmx_pko_get_base_queue
961 CVMX_PKO_LOCK_CMD_QUEUE
);
962 cvmx_pko_send_packet_finish(FIX_IPD_OUTPORT
,
963 cvmx_pko_get_base_queue
964 (FIX_IPD_OUTPORT
), pko_command
,
965 g_buffer
, CVMX_PKO_LOCK_CMD_QUEUE
);
970 work
= cvmx_pow_work_request_sync(CVMX_POW_WAIT
);
972 } while ((work
== NULL
) && (retry_cnt
> 0));
975 cvmx_dprintf("WARNING: FIX_IPD_PTR_ALIGNMENT "
976 "get_work() timeout occurred.\n");
980 cvmx_helper_free_packet_data(work
);
985 /* Return CSR configs to saved values */
986 cvmx_write_csr(CVMX_GMXX_PRTX_CFG
987 (INDEX(FIX_IPD_OUTPORT
), INTERFACE(FIX_IPD_OUTPORT
)),
989 cvmx_write_csr(CVMX_ASXX_TX_PRT_EN(INTERFACE(FIX_IPD_OUTPORT
)),
991 cvmx_write_csr(CVMX_ASXX_RX_PRT_EN(INTERFACE(FIX_IPD_OUTPORT
)),
993 cvmx_write_csr(CVMX_GMXX_RXX_JABBER
994 (INDEX(FIX_IPD_OUTPORT
), INTERFACE(FIX_IPD_OUTPORT
)),
996 cvmx_write_csr(CVMX_GMXX_RXX_FRM_MAX
997 (INDEX(FIX_IPD_OUTPORT
), INTERFACE(FIX_IPD_OUTPORT
)),
999 cvmx_write_csr(CVMX_ASXX_PRT_LOOP(INTERFACE(FIX_IPD_OUTPORT
)), 0);
1003 cvmx_dprintf("WARNING: FIX_IPD_PTR_ALIGNMENT failed.\n");
1010 * Called after all internal packet IO paths are setup. This
1011 * function enables IPD/PIP and begins packet input and output.
1013 * Returns Zero on success, negative on failure
1015 int cvmx_helper_ipd_and_packet_input_enable(void)
1024 * Time to enable hardware ports packet input and output. Note
1025 * that at this point IPD/PIP must be fully functional and PKO
1028 num_interfaces
= cvmx_helper_get_number_of_interfaces();
1029 for (interface
= 0; interface
< num_interfaces
; interface
++) {
1030 if (cvmx_helper_ports_on_interface(interface
) > 0)
1031 __cvmx_helper_packet_hardware_enable(interface
);
1034 /* Finally enable PKO now that the entire path is up and running */
1037 if ((OCTEON_IS_MODEL(OCTEON_CN31XX_PASS1
)
1038 || OCTEON_IS_MODEL(OCTEON_CN30XX_PASS1
))
1039 && (cvmx_sysinfo_get()->board_type
!= CVMX_BOARD_TYPE_SIM
))
1040 __cvmx_helper_errata_fix_ipd_ptr_alignment();
1043 EXPORT_SYMBOL_GPL(cvmx_helper_ipd_and_packet_input_enable
);
1046 * Initialize the PIP, IPD, and PKO hardware to support
1047 * simple priority based queues for the ethernet ports. Each
1048 * port is configured with a number of priority queues based
1049 * on CVMX_PKO_QUEUES_PER_PORT_* where each queue is lower
1050 * priority than the previous.
1052 * Returns Zero on success, non-zero on failure
1054 int cvmx_helper_initialize_packet_io_global(void)
1058 union cvmx_l2c_cfg l2c_cfg
;
1059 union cvmx_smix_en smix_en
;
1060 const int num_interfaces
= cvmx_helper_get_number_of_interfaces();
1063 * CN52XX pass 1: Due to a bug in 2nd order CDR, it needs to
1066 if (OCTEON_IS_MODEL(OCTEON_CN52XX_PASS1_0
))
1067 __cvmx_helper_errata_qlm_disable_2nd_order_cdr(1);
1070 * Tell L2 to give the IOB statically higher priority compared
1071 * to the cores. This avoids conditions where IO blocks might
1072 * be starved under very high L2 loads.
1074 l2c_cfg
.u64
= cvmx_read_csr(CVMX_L2C_CFG
);
1075 l2c_cfg
.s
.lrf_arb_mode
= 0;
1076 l2c_cfg
.s
.rfb_arb_mode
= 0;
1077 cvmx_write_csr(CVMX_L2C_CFG
, l2c_cfg
.u64
);
1079 /* Make sure SMI/MDIO is enabled so we can query PHYs */
1080 smix_en
.u64
= cvmx_read_csr(CVMX_SMIX_EN(0));
1081 if (!smix_en
.s
.en
) {
1083 cvmx_write_csr(CVMX_SMIX_EN(0), smix_en
.u64
);
1086 /* Newer chips actually have two SMI/MDIO interfaces */
1087 if (!OCTEON_IS_MODEL(OCTEON_CN3XXX
) &&
1088 !OCTEON_IS_MODEL(OCTEON_CN58XX
) &&
1089 !OCTEON_IS_MODEL(OCTEON_CN50XX
)) {
1090 smix_en
.u64
= cvmx_read_csr(CVMX_SMIX_EN(1));
1091 if (!smix_en
.s
.en
) {
1093 cvmx_write_csr(CVMX_SMIX_EN(1), smix_en
.u64
);
1097 cvmx_pko_initialize_global();
1098 for (interface
= 0; interface
< num_interfaces
; interface
++) {
1099 result
|= cvmx_helper_interface_probe(interface
);
1100 if (cvmx_helper_ports_on_interface(interface
) > 0)
1101 cvmx_dprintf("Interface %d has %d ports (%s)\n",
1103 cvmx_helper_ports_on_interface(interface
),
1104 cvmx_helper_interface_mode_to_string
1105 (cvmx_helper_interface_get_mode
1107 result
|= __cvmx_helper_interface_setup_ipd(interface
);
1108 result
|= __cvmx_helper_interface_setup_pko(interface
);
1111 result
|= __cvmx_helper_global_setup_ipd();
1112 result
|= __cvmx_helper_global_setup_pko();
1114 /* Enable any flow control and backpressure */
1115 result
|= __cvmx_helper_global_setup_backpressure();
1117 #if CVMX_HELPER_ENABLE_IPD
1118 result
|= cvmx_helper_ipd_and_packet_input_enable();
1122 EXPORT_SYMBOL_GPL(cvmx_helper_initialize_packet_io_global
);
1125 * Does core local initialization for packet io
1127 * Returns Zero on success, non-zero on failure
1129 int cvmx_helper_initialize_packet_io_local(void)
1131 return cvmx_pko_initialize_local();
1135 * Return the link state of an IPD/PKO port as returned by
1136 * auto negotiation. The result of this function may not match
1137 * Octeon's link config if auto negotiation has changed since
1138 * the last call to cvmx_helper_link_set().
1140 * @ipd_port: IPD/PKO port to query
1142 * Returns Link state
1144 cvmx_helper_link_info_t
cvmx_helper_link_get(int ipd_port
)
1146 cvmx_helper_link_info_t result
;
1147 int interface
= cvmx_helper_get_interface_num(ipd_port
);
1148 int index
= cvmx_helper_get_interface_index_num(ipd_port
);
1150 /* The default result will be a down link unless the code below
1154 if (index
>= cvmx_helper_ports_on_interface(interface
))
1157 switch (cvmx_helper_interface_get_mode(interface
)) {
1158 case CVMX_HELPER_INTERFACE_MODE_DISABLED
:
1159 case CVMX_HELPER_INTERFACE_MODE_PCIE
:
1160 /* Network links are not supported */
1162 case CVMX_HELPER_INTERFACE_MODE_XAUI
:
1163 result
= __cvmx_helper_xaui_link_get(ipd_port
);
1165 case CVMX_HELPER_INTERFACE_MODE_GMII
:
1167 result
= __cvmx_helper_rgmii_link_get(ipd_port
);
1169 result
.s
.full_duplex
= 1;
1170 result
.s
.link_up
= 1;
1171 result
.s
.speed
= 1000;
1174 case CVMX_HELPER_INTERFACE_MODE_RGMII
:
1175 result
= __cvmx_helper_rgmii_link_get(ipd_port
);
1177 case CVMX_HELPER_INTERFACE_MODE_SPI
:
1178 result
= __cvmx_helper_spi_link_get(ipd_port
);
1180 case CVMX_HELPER_INTERFACE_MODE_SGMII
:
1181 case CVMX_HELPER_INTERFACE_MODE_PICMG
:
1182 result
= __cvmx_helper_sgmii_link_get(ipd_port
);
1184 case CVMX_HELPER_INTERFACE_MODE_NPI
:
1185 case CVMX_HELPER_INTERFACE_MODE_LOOP
:
1186 /* Network links are not supported */
1191 EXPORT_SYMBOL_GPL(cvmx_helper_link_get
);
1194 * Configure an IPD/PKO port for the specified link state. This
1195 * function does not influence auto negotiation at the PHY level.
1196 * The passed link state must always match the link state returned
1197 * by cvmx_helper_link_get().
1199 * @ipd_port: IPD/PKO port to configure
1200 * @link_info: The new link state
1202 * Returns Zero on success, negative on failure
1204 int cvmx_helper_link_set(int ipd_port
, cvmx_helper_link_info_t link_info
)
1207 int interface
= cvmx_helper_get_interface_num(ipd_port
);
1208 int index
= cvmx_helper_get_interface_index_num(ipd_port
);
1210 if (index
>= cvmx_helper_ports_on_interface(interface
))
1213 switch (cvmx_helper_interface_get_mode(interface
)) {
1214 case CVMX_HELPER_INTERFACE_MODE_DISABLED
:
1215 case CVMX_HELPER_INTERFACE_MODE_PCIE
:
1217 case CVMX_HELPER_INTERFACE_MODE_XAUI
:
1218 result
= __cvmx_helper_xaui_link_set(ipd_port
, link_info
);
1221 * RGMII/GMII/MII are all treated about the same. Most
1222 * functions refer to these ports as RGMII.
1224 case CVMX_HELPER_INTERFACE_MODE_RGMII
:
1225 case CVMX_HELPER_INTERFACE_MODE_GMII
:
1226 result
= __cvmx_helper_rgmii_link_set(ipd_port
, link_info
);
1228 case CVMX_HELPER_INTERFACE_MODE_SPI
:
1229 result
= __cvmx_helper_spi_link_set(ipd_port
, link_info
);
1231 case CVMX_HELPER_INTERFACE_MODE_SGMII
:
1232 case CVMX_HELPER_INTERFACE_MODE_PICMG
:
1233 result
= __cvmx_helper_sgmii_link_set(ipd_port
, link_info
);
1235 case CVMX_HELPER_INTERFACE_MODE_NPI
:
1236 case CVMX_HELPER_INTERFACE_MODE_LOOP
:
1241 EXPORT_SYMBOL_GPL(cvmx_helper_link_set
);
1244 * Configure a port for internal and/or external loopback. Internal loopback
1245 * causes packets sent by the port to be received by Octeon. External loopback
1246 * causes packets received from the wire to sent out again.
1248 * @ipd_port: IPD/PKO port to loopback.
1250 * Non zero if you want internal loopback
1252 * Non zero if you want external loopback
1254 * Returns Zero on success, negative on failure.
1256 int cvmx_helper_configure_loopback(int ipd_port
, int enable_internal
,
1257 int enable_external
)
1260 int interface
= cvmx_helper_get_interface_num(ipd_port
);
1261 int index
= cvmx_helper_get_interface_index_num(ipd_port
);
1263 if (index
>= cvmx_helper_ports_on_interface(interface
))
1266 switch (cvmx_helper_interface_get_mode(interface
)) {
1267 case CVMX_HELPER_INTERFACE_MODE_DISABLED
:
1268 case CVMX_HELPER_INTERFACE_MODE_PCIE
:
1269 case CVMX_HELPER_INTERFACE_MODE_SPI
:
1270 case CVMX_HELPER_INTERFACE_MODE_NPI
:
1271 case CVMX_HELPER_INTERFACE_MODE_LOOP
:
1273 case CVMX_HELPER_INTERFACE_MODE_XAUI
:
1275 __cvmx_helper_xaui_configure_loopback(ipd_port
,
1279 case CVMX_HELPER_INTERFACE_MODE_RGMII
:
1280 case CVMX_HELPER_INTERFACE_MODE_GMII
:
1282 __cvmx_helper_rgmii_configure_loopback(ipd_port
,
1286 case CVMX_HELPER_INTERFACE_MODE_SGMII
:
1287 case CVMX_HELPER_INTERFACE_MODE_PICMG
:
1289 __cvmx_helper_sgmii_configure_loopback(ipd_port
,