Enable PHY on U-Boot

Follow the steps below to enable the new PHY on U-Boot.

  1. To enable your new PHY for the U-Boot, first you need to define the macro definition in the board specific header file.
    The following code block provides an example of adding the YT8531 PHY in the VisionFive 2 header file include/configs/starfive-visionfive.h.h.
    #define DWC_NET_PHYADDR
    Note: Make sure the PHY address you defined in the header file is correct, otherwise, the system has to enumerate all the PHY address available.
  2. Then you need to add the defined macro definition in the configuration file.
    The following image shows an example of adding the YT8531 PHY in the configuration file.
    Figure 1. Add PHY in Configuration File
  3. Then you can add a new entry for PHY device initialization.
    The following image provides an example of adding the YT8531 PHY in the file drivers/net/phy/motorcomm.c.
    Figure 2. Add PHY in Device Initialization
  4. Then you need to define the driver structure.
    The following image provides an example of defining the data structure of the YT8531 PHY in the file drivers/net/phy/motorcomm.c.
    Figure 3. Define PHY Data Structure