ETHFW API Guide
Ethernet Board Utils

Introduction

This section contains APIs for board initialization needed by Ethernet Firmware.

Ethernet Firmware board library is small set of functions intended to initialize board related functionality needed for Ethernet Firmware to run, ie. setup GPIOs to take PHY out of reset, configure SerDes, etc.

This utils library has been written to support TI EVMs and can be used as reference when porting Ethernet Firmware to a different platform.

Functions

int32_t EthFwBoard_init (uint32_t flags)
 Initialize board-related functionality needed by Ethernet Firmware. More...
 
uint32_t EthFwBoard_getMacPorts (Enet_MacPort macPorts[ENET_MAC_PORT_NUM])
 Get the list of enabled MAC ports. More...
 
int32_t EthFwBoard_setPortCfg (Enet_MacPort macPort, CpswMacPort_Cfg *macCfg, EnetMacPort_Interface *mii, EnetPhy_Cfg *phyCfg, EnetMacPort_LinkCfg *linkCfg)
 Set the port configuration parameters for the specified MAC port. More...
 
uint32_t EthFwBoard_getMacAddrPool (uint8_t macAddr[][ENET_MAC_ADDR_LEN], uint32_t poolSize)
 Get the MAC address pool of this board. More...
 

Configuration flags for EthFw board utils

The following configuration flags are used to indicate the board initialization that must be done by EthFw board function EthFwBoard_init().

#define ETHFW_BOARD_GESI_ENABLE   (ENET_BIT(0))
 Whether Enet board utils should enable GESI expansion board. More...
 
#define ETHFW_BOARD_QENET_ENABLE   (ENET_BIT(1))
 Whether Enet board utils should enable ENET expansion board (QSGMII board) More...
 
#define ETHFW_BOARD_SERDES_CONFIG   (ENET_BIT(2))
 Whether Enet board utils can configure SerDes. More...
 
#define ETHFW_BOARD_UART_ALLOWED   (ENET_BIT(3))
 Whether Enet board utils can configure UART for logging. More...
 
#define ETHFW_BOARD_I2C_ALLOWED   (ENET_BIT(4))
 Whether Enet board utils can run I2C-related operations, i.e. read EEPROM. More...
 
#define ETHFW_BOARD_GPIO_ALLOWED   (ENET_BIT(5))
 Whether Enet board utils can set GPIOs, i.e. PHY reset. More...
 
#define ETHFW_BOARD_ENET_BRIDGE_ENABLE   (ENET_BIT(6))
 

Macro Definition Documentation

◆ ETHFW_BOARD_GESI_ENABLE

#define ETHFW_BOARD_GESI_ENABLE   (ENET_BIT(0))

Whether Enet board utils should enable GESI expansion board.

◆ ETHFW_BOARD_QENET_ENABLE

#define ETHFW_BOARD_QENET_ENABLE   (ENET_BIT(1))

Whether Enet board utils should enable ENET expansion board (QSGMII board)

◆ ETHFW_BOARD_SERDES_CONFIG

#define ETHFW_BOARD_SERDES_CONFIG   (ENET_BIT(2))

Whether Enet board utils can configure SerDes.

◆ ETHFW_BOARD_UART_ALLOWED

#define ETHFW_BOARD_UART_ALLOWED   (ENET_BIT(3))

Whether Enet board utils can configure UART for logging.

◆ ETHFW_BOARD_I2C_ALLOWED

#define ETHFW_BOARD_I2C_ALLOWED   (ENET_BIT(4))

Whether Enet board utils can run I2C-related operations, i.e. read EEPROM.

◆ ETHFW_BOARD_GPIO_ALLOWED

#define ETHFW_BOARD_GPIO_ALLOWED   (ENET_BIT(5))

Whether Enet board utils can set GPIOs, i.e. PHY reset.

◆ ETHFW_BOARD_ENET_BRIDGE_ENABLE

#define ETHFW_BOARD_ENET_BRIDGE_ENABLE   (ENET_BIT(6))

Whether Enet board utils should enable ENET expansion bridge, which is used to connect two EVMs in MAC-to-MAC mode. Mutually exclusive with ETHFW_BOARD_QENET_ENABLE.

Function Documentation

◆ EthFwBoard_init()

int32_t EthFwBoard_init ( uint32_t  flags)

Initialize board-related functionality needed by Ethernet Firmware.

Initializes board related functionality for Ethernet Firmware to run. This includes clocking CPSW, configuring expansion boards, etc.

Parameters
flagsFlags to indicate the functionality to be enabled.
Returns
0 in case of success, error code otherwise.

◆ EthFwBoard_getMacPorts()

uint32_t EthFwBoard_getMacPorts ( Enet_MacPort  macPorts[ENET_MAC_PORT_NUM])

Get the list of enabled MAC ports.

Gets the list of MAC ports enabled in this board implementation.

Parameters
macPortsArray to be populated with list of enabled MAC ports.
Returns
Number of enabled MAC ports.

◆ EthFwBoard_setPortCfg()

int32_t EthFwBoard_setPortCfg ( Enet_MacPort  macPort,
CpswMacPort_Cfg *  macCfg,
EnetMacPort_Interface *  mii,
EnetPhy_Cfg *  phyCfg,
EnetMacPort_LinkCfg *  linkCfg 
)

Set the port configuration parameters for the specified MAC port.

Populates the MAC port configuration, MII interface type (RMII, RGMII, Q/SGMII), PHY configuration parameters and link configuration type (manual, auto-negotiation) for the passed MAC port number.

Parameters
macPortMAC port to get its configuration parameters for.
macCfgMAC config to be populated: SGMII mode.
miiMII interface type to populated: RMII, RGMII, Q/SGMII.
phyCfgPHY config to be populated: PHY address, strapping, etc.
linkCfgLink config to be populated: manual, auto-negotiation.
Returns
0 in case of success, error code otherwise.

◆ EthFwBoard_getMacAddrPool()

uint32_t EthFwBoard_getMacAddrPool ( uint8_t  macAddr[][ENET_MAC_ADDR_LEN],
uint32_t  poolSize 
)

Get the MAC address pool of this board.

Populates the passed MAC address pool array with board's MAC addresses. The addresses are usually read from EEPROM, but it's implementation choice (i.e. static pool).

Parameters
macAddrArray to be populated with list of enabled MAC ports.
poolSizePool size, the max number of entries to be populated.
Returns
Actual number of MAC addresses added into pool array.