Cyclone® V Hard Processor System Technical Reference Manual

ID 683126
Date 8/28/2023
Public
Document Table of Contents

18.6.3. EMAC HPS Interface Initialization

To initialize the Ethernet controller to use the HPS interface, specific software steps must be followed including selecting the correct PHY interface through the System Manager.

In general, the Ethernet Controller must be in a reset state during static configuration and the clock must be active and valid before the Ethernet Controller is brought out of reset.

  1. After the HPS is released from cold or warm reset, reset the Ethernet Controller module by setting the appropriate emac bit in the permodrst register in the Reset Manager.
  2. Configure the EMAC Controller clock to 250 MHz by programming the appropriate cnt value in the emac*clk register in the Clock Manager.
  3. Bring the Ethernet PHY out of reset to allow PHY to generate RX clocks.
    There are no registers to verify, but you can create the following custom logic block to cross check:
    • If the RX clock is routed through FPGA IO—you can use Signal Tap to check, or create a simple counter block with the RX clock as clock source to check if it runs.
    • If the RX clock is routed as HPS IO—you need to explore if the kernel application code is able to source through RX clock to check its status.
  4. When all the clocks are valid, program the following clock settings:
    1. Set the physel_* field in the ctrl register of the System Manager (EMAC Group) to 0x1 to select the RGMII PHY interface.
    2. Disable the Ethernet Controller FPGA interfaces by clearing the emac_* bit in the module register of the System Manager (FPGA Interface group).
  5. Configure all of the EMAC static settings if the user requires a different setting from the default value. These settings include AXI AxCache signal values, which are programmed in l3 register in the EMAC group of the System Manager.
  6. Execute a register read back to confirm the clock and static configuration settings are valid.
  7. After confirming the settings are valid, software can clear the emac bit in the permodrst register of the Reset Manager to bring the EMAC out of reset..
When these steps are completed, general Ethernet controller and DMA software initialization and configuration can continue.