You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement software-managed TX Low Power Idle (LPI) for the Cadence GEM
MAC as part of IEEE 802.3az Energy Efficient Ethernet support.
The GEM MAC has no built-in idle timer - the TXLPIEN bit (NCR bit 19)
immediately asserts LPI and blocks all TX while set. The MAC does not
auto-wake for transmit. Per Microchip GMAC documentation (section
40.6.19): "It is best to use firmware to control LPI."
This patch implements a software idle timer using delayed_work:
- On TX completion with an empty ring, schedule LPI entry after a
configurable idle timeout (default 250ms). The work function
verifies all TX queues are truly idle before entering LPI to
prevent entering LPI while traffic is still active.
- On TX start, wake from LPI by clearing TXLPIEN, cancelling any
pending re-entry, and waiting 50us for the PHY to exit LPI
(conservative vs IEEE 802.3az Tw_sys of ~17us/~30us)
- On link up, check EEE negotiation via phy_init_eee() and defer
first LPI entry by 1 second per IEEE 802.3az requirements
- On link down, immediately cancel pending work and clear TXLPIEN
The timer value is configurable at runtime via ethtool --set-eee
tx-timer.
The implementation is gated on MACB_CAPS_EEE so platforms must
explicitly opt in via their macb_config.
Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
0 commit comments