Energy Efficient Ethernet
™
BCM5718 Programmer’s Guide
Broadcom
®
January 29, 2016 • 5718-PG108-R
Page 149
mii_write(0x0E, 0x0006);
val = mii_read(0x0E);
//Enable MAC control of LPI
reg_write(0x36BC,0x01000004);
reg_write(0x36D0,0x000001F8);
reg_write(0x36B0,0x00100348);
// Set EEE timer debounce values
reg_write(0x36B4,0x07ff07ff);
reg_write(0x36B8,0x07ff07ff);
}
else
{
// Disable EEE advertisement for 100Base-TX and 1000Base-T modes
mii_write(0x0D, 0x0007);
mii_write(0x0E, 0x003C);
mii_write(0x0D, 0x4007);
mii_write(0x0E, 0x0000);
val = mii_read(0x0E);
// Disable MAC control of LPI
reg_write(0x36B0,reg_read(0x36B0) &= 0x00100000);
}
/*
* Link status interrupt handler
*/
// Check for PHY link status
if ((mii_read(0x11) & 0x100) == 0x100)
{
// Check for 1000mb link
if ((mii_read(0x19) & 0x700) == 0x700)
{
// Set EEE LPI exit timing for 1000mb link speed
reg_write(0x36d0, 0x19d);
}
// Check for 100mb link
elseif ((mii_read(0x19) & 0x500) == 0x500)
{
// Set EEE LPI exit timing for 100mb link speed
reg_write(0x36d0, 0x384);
}
//delay 1000 milliseconds
ms_delay(1000);
// Read PHY’s EEE negotiation status
mii_write(0x0d, 7);
mii_write(0x0e, 0x803e);
mii_write(0x0d, 0x4007);
val = mii_read(0x0e);