Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Enumerations | Functions | Variables
cvmx-helper-board.h File Reference
#include <asm/octeon/cvmx-helper.h>

Go to the source code of this file.

Macros

#define CVMX_HELPER_BOARD_MGMT_IPD_PORT   -10
 

Enumerations

enum  cvmx_helper_board_set_phy_link_flags_types_t {
  set_phy_link_flags_autoneg = 0x1, set_phy_link_flags_flow_control_dont_touch = 0x0 << 1, set_phy_link_flags_flow_control_enable = 0x1 << 1, set_phy_link_flags_flow_control_disable = 0x2 << 1,
  set_phy_link_flags_flow_control_mask = 0x3 << 1
}
 

Functions

int cvmx_helper_board_get_mii_address (int ipd_port)
 
int cvmx_helper_board_link_set_phy (int phy_addr, cvmx_helper_board_set_phy_link_flags_types_t link_flags, cvmx_helper_link_info_t link_info)
 
cvmx_helper_link_info_t __cvmx_helper_board_link_get (int ipd_port)
 
int __cvmx_helper_board_interface_probe (int interface, int supported_ports)
 
int __cvmx_helper_board_hardware_enable (int interface)
 

Variables

cvmx_helper_link_info_t(* cvmx_override_board_link_get )(int ipd_port)
 

Macro Definition Documentation

#define CVMX_HELPER_BOARD_MGMT_IPD_PORT   -10

Definition at line 51 of file cvmx-helper-board.h.

Enumeration Type Documentation

Helper functions to abstract board specific data about network ports from the rest of the cvmx-helper files.

Enumerator:
set_phy_link_flags_autoneg 
set_phy_link_flags_flow_control_dont_touch 
set_phy_link_flags_flow_control_enable 
set_phy_link_flags_flow_control_disable 
set_phy_link_flags_flow_control_mask 

Definition at line 39 of file cvmx-helper-board.h.

Function Documentation

int __cvmx_helper_board_hardware_enable ( int  interface)

Definition at line 650 of file cvmx-helper-board.c.

int __cvmx_helper_board_interface_probe ( int  interface,
int  supported_ports 
)

Definition at line 615 of file cvmx-helper-board.c.

cvmx_helper_link_info_t __cvmx_helper_board_link_get ( int  ipd_port)

This function is the board specific method of determining an ethernet ports link speed. Most Octeon boards have Marvell PHYs and are handled by the fall through case. This function must be updated for boards that don't have the normal Marvell PHYs.

This function must be modifed for every new Octeon board. Internally it uses switch statements based on the cvmx_sysinfo data to determine board types and revisions. It relys on the fact that every Octeon board receives a unique board type enumeration from the bootloader.

: IPD input port associated with the port we want to get link status for.

Returns The ports link status. If the link isn't fully resolved, this must return zero.

This function is the board specific method of determining an ethernet ports link speed. Most Octeon boards have Marvell PHYs and are handled by the fall through case. This function must be updated for boards that don't have the normal Marvell PHYs.

This function must be modified for every new Octeon board. Internally it uses switch statements based on the cvmx_sysinfo data to determine board types and revisions. It relies on the fact that every Octeon board receives a unique board type enumeration from the bootloader.

: IPD input port associated with the port we want to get link status for.

Returns The ports link status. If the link isn't fully resolved, this must return zero.

Definition at line 211 of file cvmx-helper-board.c.

int cvmx_helper_board_get_mii_address ( int  ipd_port)

Return the MII PHY address associated with the given IPD port. A result of -1 means there isn't a MII capable PHY connected to this port. On chips supporting multiple MII busses the bus number is encoded in bits <15:8>.

This function must be modifed for every new Octeon board. Internally it uses switch statements based on the cvmx_sysinfo data to determine board types and revisions. It relys on the fact that every Octeon board receives a unique board type enumeration from the bootloader.

: Octeon IPD port to get the MII address for.

Returns MII PHY address and bus number or -1.

Return the MII PHY address associated with the given IPD port. A result of -1 means there isn't a MII capable PHY connected to this port. On chips supporting multiple MII busses the bus number is encoded in bits <15:8>.

This function must be modified for every new Octeon board. Internally it uses switch statements based on the cvmx_sysinfo data to determine board types and revisions. It replies on the fact that every Octeon board receives a unique board type enumeration from the bootloader.

: Octeon IPD port to get the MII address for.

Returns MII PHY address and bus number or -1.

Definition at line 75 of file cvmx-helper-board.c.

int cvmx_helper_board_link_set_phy ( int  phy_addr,
cvmx_helper_board_set_phy_link_flags_types_t  link_flags,
cvmx_helper_link_info_t  link_info 
)

This function as a board specific method of changing the PHY speed, duplex, and autonegotiation. This programs the PHY and not Octeon. This can be used to force Octeon's links to specific settings.

: The address of the PHY to program : Flags to control autonegotiation. Bit 0 is autonegotiation enable/disable to maintain backware compatibility. : Link speed to program. If the speed is zero and autonegotiation is enabled, all possible negotiation speeds are advertised.

Returns Zero on success, negative on failure

This function as a board specific method of changing the PHY speed, duplex, and auto-negotiation. This programs the PHY and not Octeon. This can be used to force Octeon's links to specific settings.

: The address of the PHY to program : Non zero if you want to enable auto-negotiation. : Link speed to program. If the speed is zero and auto-negotiation is enabled, all possible negotiation speeds are advertised.

Returns Zero on success, negative on failure

Definition at line 438 of file cvmx-helper-board.c.

Variable Documentation

cvmx_helper_link_info_t(* cvmx_override_board_link_get)(int ipd_port)

cvmx_override_board_link_get(int ipd_port) is a function pointer. It is meant to allow customization of the process of talking to a PHY to determine link speed. It is called every time a PHY must be polled for link status. Users should set this pointer to a function before calling any cvmx-helper operations.

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