Triple-Speed Ethernet Intel® FPGA IP User Guide

ID 683402
Date 10/04/2021
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

10.3. PHY Definition

By default, the software driver only supports the following PHYs:
  • National DP83848C (10/100 Mbps)
  • National DP83865 (10/100/1000 Mbps)
  • Marvell 88E1111 (10/100/1000 Mbps)
  • Marvell 88E1145 (Quad PHY, 10/100/1000 Mbps).

You can extend the software driver to support other PHYs by defining the PHY profile using the structure alt_tse_phy_profile and adding it to the system using the function alt_tse_phy_add_profile(). For each PHY instance, use the structure alt_tse_system_phy_struct to define it and the function alt_tse_system_add_sys() to add the instance to the system.

The software driver automatically detects the PHY’s operating mode and speed if the PHY conforms to the following specifications:

  • One bit to specify duplex and two consecutive bits (the higher bit being the most significant bit) to specify the speed in the same extended PHY specific register.
  • The speed bits are set according to the convention shown in Table 124.
Table 124.  PHY Speed Bit Values
Speed (Mbps) PHY Speed Bits
MSB LSB
1000 1 0
100 0 1
10 0 0

For PHYs that do not conform to the aforementioned specifications, you can write a function to retrieve the PHY’s operating mode and speed, and set the field *link_status_read in the PHY data structure to your function’s address.

Example of PHY Profile Structure

You can also execute a function to initialize a PHY profile or a PHY instance by setting the function pointer (*phy_cfg and *tse_phy_cfg) in the respective structures to the function’s address.

typedef struct alt_tse_phy_profile_struct{ /* PHY profile */

/*The name of the PHY*/
char name[80];

/*Organizationally Unique Identififier*/
alt_u32 oui;

/*PHY model number*/
alt_u8 model_number;

/*PHY revision number*/
alt_u8 revision_number;

/*The location of the PHY Specific Status Register*/
alt_u8 status_reg_location;

/*The location of the Speed Status bit in the PHY Specific Status
Register*/
alt_u8 speed_lsb_location;

/*The location of the Duplex Status bit in the PHY Status Specific
Register*/
alt_u8 duplex_bit_location;

/*The location of the Link Status bit in PHY Status Specific
Register*/
alt_u8 link_bit_location;

/*PHY initialization function pointer—profile specific*/
alt_32 (*phy_cfg)(np_tse_mac *pmac);

/*Pointer to the function that reads and returns 32-bit link status.Possible status:
full duplex (bit 0 = 1), half duplex (bit 0 = 0),gigabit (bit 1 = 1),
100Mbps (bit 2 = 1), 10Mbps (bit 3 = 1),invalid speed (bit 16 = 1).*/
alt_u32 (*link_status_read)(np_tse_mac *pmac);

} alt_tse_phy_profile;

Example of PHY Instance Structure

typedef struct alt_tse_system_phy_struct { /* PHY instance */

/* PHY's MDIO address */
alt_32tse_phy_mdio_address;
/* PHY initialization function pointer—instance specific */
alt_32 (*tse_phy_cfg)(np_tse_mac *pmac);

} alt_tse_system_phy;