Altera Triple Speed Ethernet MegaCore Function User Manual

Page 182

Advertising
background image

PHY Speed Bits

Speed (Mbps)

LSB

MSB

0

0

10

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.

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.

Example of PHY Profile Structure

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;

Altera Corporation

Software Programming Interface

Send Feedback

11-3

PHY Definition

UG-01008
2014.06.30

Advertising