This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[FAQ] DRA821U: DRA829 : Guide to Do Board specific modifications for CPSW 5G/9G

Part Number: DRA821U

What changes are required to do board specific modifications for CPSW 5G/9G in enet-lld and EthFW ?

  • Guide to Do Board specific modifications for Ethernet on RTOS

    • Generic Pinmux : This is taken care by board library in pdk/packages/ti/board. Generate the files J7200_pinmux_data.c and J7200_pinmux.h (examples for J7200) files from PINMUX tool and replace in pdk/packages/ti/board/src/j7200_evm

    • Ethernet specific pinmux :
      • Modify enet/examples/utils/V1/enet_board_pinmux_j7200_data.c to make ethernet specific pinmux changes like RGMII/SGMII. The structure gEthFwPinmuxData contains all the pinmux data and this is in turn called by the function EnetBoard_configEthFwPinmux() in enet/examples/utils/V1/enet_board_pinmux.c
      • SGMII pin-muxing is not required. SGMII as it's connected to SERDES and SERDES has dedicated pins on the SoC, within SERDES, USB, SGMII and PCIe are selected using multiplexer registers.

    • Board Configuration in ENET-LLD : For examples like enet_loopback, EnetBoard_setEnetControl() API can be used to configure the switch directly.
      • Configuration with PHY's : If you are using SGMII/RGMII PHY then you can also use the helper functions EnetBoard_setPhyConfigSgmii(), EnetBoard_setPhyConfigRgmii() in examples/utils/V1/enet_appboardutils_j721e_evm.c as an example.
      • Configuration without PHY's : If you are not using PHY's, then please take a look at the helper functions EnetAppUtils_setNoPhyCfgRgmii() and EnetAppUtils_setNoPhyCfgSgmii() respectively in enet/examples/utils/enet_apputils.c . This file also contains helper functions for other configurations like RMII etc.
      • Board Configuration in EthFw (may be skipped if only examples are being run) : Configuration inside EthFw is done using a well defined structure EthFw_Config (defined in ethfw/ethfw.h). This structure is then initialized using the array gEthAppPorts[] which configures the port number and number of them. It is used in the initialization routine EthApp_initEthFw() to configure enet-lld. Various other configurations like VLAN, ALE, MTU size are done using the function EthFw_initConfigParams() defined in ethfw/src/ethfw.c. This function in turn initializes the ALE using the function EthFw_initAleCfg()

    •    ENET-LLD integration : User/Application needs to take care of the following steps in terms of ENET configuration
      1. Init Sequence : One-time initialization before using any Enet LLD APIs.
      2. Peripheral Open Sequence : Opens an Ethernet peripheral, it's called for each peripheral that the application intends to use, eg. CPSW.
      3. Port Open Sequence : Opens a MAC port. For peripherals that provide multiple MAC port (i.e. CPSW9G that has 8 MAC ports), this sequence must be followed foreach MAC port. This section also covers MAC-PHY and MAC-MAC links.
      4. Packet Send/Receive Sequence : DMA TX and RX channel open sequences as well as functions to use to submit and retrieve queue of packets to/from the driver. This is usually not modified by the user application and should be left untouched.
      5. Packet Timestamping Sequence :  TX and RX packet timestamping sequence to enable timestamping and retrieval mechanism.:
      6. Port Close Sequence : Closes a MAC port. Application has to close all MAC ports which were opened in step 3 when no longer needs those ports
      7. Peripheral Close Sequence: Closes an Ethernet peripheral when the application no longer needs it. This sequence must be followed for each peripheral that was opened in Step 2
      8. Deinit Sequence One-time deinitialization once application is done using ENET-LLD

         The last point is described in depth in this guide . In particular pay attention to Port Open Sequence which describes MAC-PHY and MAC-MAC configurations

         A snippet is provided below :

       

     

    Regards

    Vineet