Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
cvmx-helper.c File Reference
#include <asm/octeon/octeon.h>
#include <asm/octeon/cvmx-config.h>
#include <asm/octeon/cvmx-fpa.h>
#include <asm/octeon/cvmx-pip.h>
#include <asm/octeon/cvmx-pko.h>
#include <asm/octeon/cvmx-ipd.h>
#include <asm/octeon/cvmx-spi.h>
#include <asm/octeon/cvmx-helper.h>
#include <asm/octeon/cvmx-helper-board.h>
#include <asm/octeon/cvmx-pip-defs.h>
#include <asm/octeon/cvmx-smix-defs.h>
#include <asm/octeon/cvmx-asxx-defs.h>

Go to the source code of this file.

Macros

#define FIX_IPD_FIRST_BUFF_PAYLOAD_BYTES   (CVMX_FPA_PACKET_POOL_SIZE-8-CVMX_HELPER_FIRST_MBUFF_SKIP)
 
#define FIX_IPD_NON_FIRST_BUFF_PAYLOAD_BYTES   (CVMX_FPA_PACKET_POOL_SIZE-8-CVMX_HELPER_NOT_FIRST_MBUFF_SKIP)
 
#define FIX_IPD_OUTPORT   0
 
#define INTERFACE(port)   (port >> 4)
 
#define INDEX(port)   (port & 0xf)
 

Functions

int cvmx_helper_get_number_of_interfaces (void)
 
int cvmx_helper_ports_on_interface (int interface)
 
cvmx_helper_interface_mode_t cvmx_helper_interface_get_mode (int interface)
 
int cvmx_helper_interface_enumerate (int interface)
 
int cvmx_helper_interface_probe (int interface)
 
int __cvmx_helper_errata_fix_ipd_ptr_alignment (void)
 
int cvmx_helper_ipd_and_packet_input_enable (void)
 
int cvmx_helper_initialize_packet_io_global (void)
 
int cvmx_helper_initialize_packet_io_local (void)
 
cvmx_helper_link_info_t cvmx_helper_link_autoconf (int ipd_port)
 
cvmx_helper_link_info_t cvmx_helper_link_get (int ipd_port)
 
int cvmx_helper_link_set (int ipd_port, cvmx_helper_link_info_t link_info)
 
int cvmx_helper_configure_loopback (int ipd_port, int enable_internal, int enable_external)
 

Variables

void(* cvmx_override_pko_queue_priority )(int pko_port, uint64_t priorities[16])
 
void(* cvmx_override_ipd_port_setup )(int ipd_port)
 

Macro Definition Documentation

#define FIX_IPD_FIRST_BUFF_PAYLOAD_BYTES   (CVMX_FPA_PACKET_POOL_SIZE-8-CVMX_HELPER_FIRST_MBUFF_SKIP)
#define FIX_IPD_NON_FIRST_BUFF_PAYLOAD_BYTES   (CVMX_FPA_PACKET_POOL_SIZE-8-CVMX_HELPER_NOT_FIRST_MBUFF_SKIP)
#define FIX_IPD_OUTPORT   0
#define INDEX (   port)    (port & 0xf)
#define INTERFACE (   port)    (port >> 4)

Function Documentation

int __cvmx_helper_errata_fix_ipd_ptr_alignment ( void  )

Function to adjust internal IPD pointer alignments

Returns 0 on success !0 on failure

Definition at line 596 of file cvmx-helper.c.

int cvmx_helper_configure_loopback ( int  ipd_port,
int  enable_internal,
int  enable_external 
)

Configure a port for internal and/or external loopback. Internal loopback causes packets sent by the port to be received by Octeon. External loopback causes packets received from the wire to sent out again.

: IPD/PKO port to loopback. : Non zero if you want internal loopback : Non zero if you want external loopback

Returns Zero on success, negative on failure.

Definition at line 1077 of file cvmx-helper.c.

int cvmx_helper_get_number_of_interfaces ( void  )

Return the number of interfaces the chip has. Each interface may have multiple ports. Most chips support two interfaces, but the CNX0XX and CNX1XX are exceptions. These only support one interface.

Returns Number of interfaces on chip

Definition at line 84 of file cvmx-helper.c.

int cvmx_helper_initialize_packet_io_global ( void  )

Initialize the PIP, IPD, and PKO hardware to support simple priority based queues for the ethernet ports. Each port is configured with a number of priority queues based on CVMX_PKO_QUEUES_PER_PORT_* where each queue is lower priority than the previous.

Returns Zero on success, non-zero on failure

Definition at line 838 of file cvmx-helper.c.

int cvmx_helper_initialize_packet_io_local ( void  )

Does core local initialization for packet io

Returns Zero on success, non-zero on failure

Definition at line 912 of file cvmx-helper.c.

int cvmx_helper_interface_enumerate ( int  interface)

Definition at line 245 of file cvmx-helper.c.

cvmx_helper_interface_mode_t cvmx_helper_interface_get_mode ( int  interface)

Definition at line 116 of file cvmx-helper.c.

int cvmx_helper_interface_probe ( int  interface)

Definition at line 321 of file cvmx-helper.c.

int cvmx_helper_ipd_and_packet_input_enable ( void  )

Called after all internal packet IO paths are setup. This function enables IPD/PIP and begins packet input and output.

Returns Zero on success, negative on failure

Definition at line 800 of file cvmx-helper.c.

cvmx_helper_link_info_t cvmx_helper_link_autoconf ( int  ipd_port)

Auto configure an IPD/PKO port link state and speed. This function basically does the equivalent of: cvmx_helper_link_set(ipd_port, cvmx_helper_link_get(ipd_port));

: IPD/PKO port to auto configure

Returns Link state after configure

Definition at line 926 of file cvmx-helper.c.

cvmx_helper_link_info_t cvmx_helper_link_get ( int  ipd_port)

Return the link state of an IPD/PKO port as returned by auto negotiation. The result of this function may not match Octeon's link config if auto negotiation has changed since the last call to cvmx_helper_link_set().

: IPD/PKO port to query

Returns Link state

Definition at line 961 of file cvmx-helper.c.

int cvmx_helper_link_set ( int  ipd_port,
cvmx_helper_link_info_t  link_info 
)

Configure an IPD/PKO port for the specified link state. This function does not influence auto negotiation at the PHY level. The passed link state must always match the link state returned by cvmx_helper_link_get(). It is normally best to use cvmx_helper_link_autoconf() instead.

: IPD/PKO port to configure : The new link state

Returns Zero on success, negative on failure

Definition at line 1021 of file cvmx-helper.c.

int cvmx_helper_ports_on_interface ( int  interface)

Definition at line 101 of file cvmx-helper.c.

Variable Documentation

void(* cvmx_override_ipd_port_setup)(int ipd_port)

cvmx_override_ipd_port_setup(int ipd_port) is a function pointer. It is meant to allow customization of the IPD port setup before packet input/output comes online. It is called after cvmx-helper does the default IPD configuration, but before IPD is enabled. Users should set this pointer to a function before calling any cvmx-helper operations.

Definition at line 67 of file cvmx-helper.c.

void(* cvmx_override_pko_queue_priority)(int pko_port, uint64_t priorities[16])

cvmx_override_pko_queue_priority(int ipd_port, uint64_t priorities[16]) is a function pointer. It is meant to allow customization of the PKO queue priorities based on the port number. Users should set this pointer to a function before calling any cvmx-helper operations.

Definition at line 56 of file cvmx-helper.c.