Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Enumerations | Functions | Variables
cvmx-helper.h File Reference
#include <asm/octeon/cvmx-config.h>
#include <asm/octeon/cvmx-fpa.h>
#include <asm/octeon/cvmx-wqe.h>
#include <asm/octeon/cvmx-helper-errata.h>
#include <asm/octeon/cvmx-helper-loop.h>
#include <asm/octeon/cvmx-helper-npi.h>
#include <asm/octeon/cvmx-helper-rgmii.h>
#include <asm/octeon/cvmx-helper-sgmii.h>
#include <asm/octeon/cvmx-helper-spi.h>
#include <asm/octeon/cvmx-helper-util.h>
#include <asm/octeon/cvmx-helper-xaui.h>

Go to the source code of this file.

Data Structures

union  cvmx_helper_link_info_t
 

Enumerations

enum  cvmx_helper_interface_mode_t {
  CVMX_HELPER_INTERFACE_MODE_DISABLED, CVMX_HELPER_INTERFACE_MODE_RGMII, CVMX_HELPER_INTERFACE_MODE_GMII, CVMX_HELPER_INTERFACE_MODE_SPI,
  CVMX_HELPER_INTERFACE_MODE_PCIE, CVMX_HELPER_INTERFACE_MODE_XAUI, CVMX_HELPER_INTERFACE_MODE_SGMII, CVMX_HELPER_INTERFACE_MODE_PICMG,
  CVMX_HELPER_INTERFACE_MODE_NPI, CVMX_HELPER_INTERFACE_MODE_LOOP
}
 

Functions

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)
 
int cvmx_helper_ports_on_interface (int interface)
 
int cvmx_helper_get_number_of_interfaces (void)
 
cvmx_helper_interface_mode_t cvmx_helper_interface_get_mode (int interface)
 
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_interface_probe (int interface)
 
int cvmx_helper_interface_enumerate (int interface)
 
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)
 

Enumeration Type Documentation

Enumerator:
CVMX_HELPER_INTERFACE_MODE_DISABLED 
CVMX_HELPER_INTERFACE_MODE_RGMII 
CVMX_HELPER_INTERFACE_MODE_GMII 
CVMX_HELPER_INTERFACE_MODE_SPI 
CVMX_HELPER_INTERFACE_MODE_PCIE 
CVMX_HELPER_INTERFACE_MODE_XAUI 
CVMX_HELPER_INTERFACE_MODE_SGMII 
CVMX_HELPER_INTERFACE_MODE_PICMG 
CVMX_HELPER_INTERFACE_MODE_NPI 
CVMX_HELPER_INTERFACE_MODE_LOOP 

Definition at line 41 of file cvmx-helper.h.

Function Documentation

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  )

This function enables the IPD and also enables the packet interfaces. The packet interfaces (RGMII and SPI) must be enabled after the IPD. This should be called by the user program after any additional IPD configuration changes are made if CVMX_HELPER_ENABLE_IPD is not set in the executive-config.h file.

Returns 0 on success -1 on failure

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.