mirror of
https://github.com/openwrt/openwrt.git
synced 2026-10-12 04:47:17 +04:00
qualcommax: qca_ppe: fix EEE on the 2.5G and 10G ports
phylink sets the PHY EEE advertisement from lpi_capabilities and does not
check lpi_interfaces, so the PHY of a USXGMII or 10GBASE-R port
advertises EEE although the MAC never enables LPI there. The XPCS behind
those modes reports no EEE ability (SR_XS_PCS_EEE_ABL reads 0 on IPQ8074),
and qca-ssdk does not enable MAC EEE on them for that reason. Offer EEE
only on a port whose phy-mode has MAC LPI, and add 2500BASE-X at
2.5 Gbit/s on ports 5 and 6, which qca-ssdk treats as EEE capable.
Fixes: dd052b4594 ("qualcommax: qca_ppe: add EEE support")
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/25754
Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
1 parent
c282dd1f4d
commit
9f2b8a35f1
1 file changed
+17
-1
@@ -916,6 +916,7 @@ static void qca_ppe_phylink_get_caps(struct dsa_switch *ds, int port,
|
||||
struct phylink_config *config)
|
||||
{
|
||||
struct dsa_port *dp = dsa_to_port(ds, port);
|
||||
phy_interface_t mode;
|
||||
|
||||
if (port != 0) {
|
||||
config->num_possible_pcs = fwnode_phylink_pcs_count(of_fwnode_handle(dp->dn));
|
||||
@@ -968,10 +969,25 @@ static void qca_ppe_phylink_get_caps(struct dsa_switch *ds, int port,
|
||||
config->supported_interfaces);
|
||||
|
||||
if (port != 0) {
|
||||
config->lpi_capabilities = MAC_100FD | MAC_1000FD;
|
||||
__set_bit(PHY_INTERFACE_MODE_QSGMII, config->lpi_interfaces);
|
||||
__set_bit(PHY_INTERFACE_MODE_PSGMII, config->lpi_interfaces);
|
||||
__set_bit(PHY_INTERFACE_MODE_SGMII, config->lpi_interfaces);
|
||||
if (port >= 5)
|
||||
__set_bit(PHY_INTERFACE_MODE_2500BASEX,
|
||||
config->lpi_interfaces);
|
||||
|
||||
/* phylink sets the PHY EEE advertisement from lpi_capabilities
|
||||
* alone, and the XPCS behind USXGMII and 10GBASE-R reports no
|
||||
* EEE ability, so EEE is offered only on a port whose phy-mode
|
||||
* has MAC LPI.
|
||||
*/
|
||||
if (of_get_phy_mode(dp->dn, &mode) ||
|
||||
!test_bit(mode, config->lpi_interfaces))
|
||||
return;
|
||||
|
||||
config->lpi_capabilities = MAC_100FD | MAC_1000FD;
|
||||
if (port >= 5)
|
||||
config->lpi_capabilities |= MAC_2500FD;
|
||||
config->lpi_timer_default = 256;
|
||||
config->eee_enabled_default = true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user