This section explains how to enable
Ethernet features on a custom board. The examples provided in MCU+SDK are tested on
TI EVMs like the LaunchPad™ development kit, control-cards, and systems on module
devices. Such devices have EEPROMs and IO expanders configured to route Ethernet
signals from the SoC to the PHY and to store data like the Ethernet MAC address.
These examples cannot be directly ported to custom hardware because custom hardware
generally lacks EEROMs and IO expanders.
In scenarios where users want to run SDK examples on custom hardware, the user must
adapt the contents of the ti_board_config.c file based on the custom hardware. This
file has mainly two board level dependencies:
- EEPROM Dependency: An EEPROM dependency is present because the MAC
address of the device is stored in EEPROM.
- IO Expander: The IO expander dependency is present because EVMs use this
to route signals from the SoC to the PHY.
Please use the following steps for enabling Ethernet support on custom hardware.
- Expand the board configuration section.
- The Custom Board option is now visible. The Custom Board
option is disabled by default. This option must be enabled.
- Select the check box to enable
the Custom Board option.
- The ti_board_config.c and
ti_board_config.h files generate when the Custom Board check box
is enabled.
- Manually reconstruct the .c file
based on the custom board design.
- The file is responsible for the following:
- PHY driver
function registration
- PHY driver
configuration
- MAC port
configuration
- Getting MAC
address list
Note: An example demonstrating the custom board integration is
available in SDK. The file is available at
source\networking\enet\core\examples\enet_layer2_multi_channel\am263x-lp\r5fss0-0_freertos\enet_custom_board_config.c.
For
users, the same file can be chosen as a reference while developing the
board_config.c file.
The following is an overview of the
contents of the file:
- const EnetPhy_DrvInfoTbl
gEnetPhyDrvTbl: This is a table of ENET PHY drivers supported on the
board. Refer to the ENET Custom PHY Integration Guide for details on how
to populate this table. This guide can be referenced from the MCU+SDK
documentation.
- If the Ethernet PHY used
in the custom board is supported in MCU+SDK out-of-box, include the
appropriate header files and populate the table.
- Pay attention to the data
structures mentioned in Figure 4-19
and Figure 4-20
and populate the structures accordingly.
- EnetBoard_setupPorts():
This function sets up any board-level muxes and configures any SoC-level RGMII
internal delay or RMII configuration for the specific port. In some AM26x EVMs,
like the AM263P CC, there are some board-level muxes that are used to route MDIO
and RGMII signals from the SoC to the PHY using an IO expander. This file has
the configuration related to that set-up. If the custom board lacks these IO
expanders, then the EnetBoard_setMacPort2IOExpanderCfg() function must be
removed. If the IO expander is used, then the corresponding logic must be
implemented.
- EnetBoard_getPhyCfg():
This function returns the ETHPHY specific configuration for a given port
including any extended PHY configuration.
- EnetBoard_getMacAddrList(): This function returns the board-specific
Ethernet MAC addresses that are available. The MAC address can be statically
configured in code or can be stored in some non-volatile memory. In any case,
the corresponding logic must be implemented in this function.
- EnetBoard_getId(): This
function returns the board ID. This function is not used anywhere outside this
file, so the board ID returned depends on the implementation of the
EnetBoard_setupPorts() function.
- EnetBoard_getPhyCfg():
This function returns the Ethernet PHY specific configuration for a given port
including any extended PHY configuration.
- The function basically
returns the configurations in the structure shown in Figure 4-21. Please pay attention and configure this structure correctly.
To summarize, to run SDK examples on a custom board, enable the Custom Board
option in SYSCFG and create a replica of the ti_board_config.c file based on the
custom board hardware design.