![]() |
ETHFW API Guide
|
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)) |
#define ETHFW_BOARD_GESI_ENABLE (ENET_BIT(0)) |
Whether Enet board utils should enable GESI expansion board.
#define ETHFW_BOARD_QENET_ENABLE (ENET_BIT(1)) |
Whether Enet board utils should enable ENET expansion board (QSGMII board)
#define ETHFW_BOARD_SERDES_CONFIG (ENET_BIT(2)) |
Whether Enet board utils can configure SerDes.
#define ETHFW_BOARD_UART_ALLOWED (ENET_BIT(3)) |
Whether Enet board utils can configure UART for logging.
#define ETHFW_BOARD_I2C_ALLOWED (ENET_BIT(4)) |
Whether Enet board utils can run I2C-related operations, i.e. read EEPROM.
#define ETHFW_BOARD_GPIO_ALLOWED (ENET_BIT(5)) |
Whether Enet board utils can set GPIOs, i.e. PHY reset.
#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.
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.
flags | Flags to indicate the functionality to be enabled. |
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.
macPorts | Array to be populated with list of enabled MAC ports. |
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.
macPort | MAC port to get its configuration parameters for. |
macCfg | MAC config to be populated: SGMII mode. |
mii | MII interface type to populated: RMII, RGMII, Q/SGMII. |
phyCfg | PHY config to be populated: PHY address, strapping, etc. |
linkCfg | Link config to be populated: manual, auto-negotiation. |
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).
macAddr | Array to be populated with list of enabled MAC ports. |
poolSize | Pool size, the max number of entries to be populated. |