summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-04-27net: phylink: handle MDIO_USXGMII_LINK when decoding USXGMIIRussell King (Oracle)
If MDIO_USXGMII_LINK is not set, it means that the PHYs media side link is down. Indicate back to phylink that the link as a whole is down. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27arm64: dts: configure Macchiatobin 10G PHY LED modesRussell King
Configure the Macchiatobin 10G PHY LED modes to correct their polarity. We keep the existing LED behaviours, but switch their polarity to reflect how they are connected. Tweak the LED modes as well to be: left: off = no link solid green = RJ45 link up (not SFP+ cage) flash green = traffic right: off = no link solid green = 10G solid yellow = 1G flash green = 100M flash yellow = 10M Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2024-04-27net: phy: marvell10g: add support for configuring LEDsRussell King
Add support for configuring the LEDs. Macchiatobin has an oddity in that the left LED goes out when the cable is connected, and flashes when there's link activity. This is because the reset default for the LED outputs assume that the LED is connected to supply, not to ground. Add support for configuring the LED modes and polarities. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2024-04-27dt-bindings: net: add dt bindings for marvell10g driverRussell King
Add a DT bindings document for the Marvell 10G driver, which will augment the generic ethernet PHY binding by having LED mode configuration. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2024-04-27net: phylink: clean up phylink_resolve()Russell King (Oracle)
The switch() statement doesn't sit very well with the preceeding if() statements, so let's just convert everything to if()s. This allows better formatting of the code. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: phylink: move manual flow control settingRussell King (Oracle)
Move the handling of manual flow control configuration to a common location during resolve. We currently evaluate this for all but fixed links. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: phylink: remove phylink_phy_no_inband()Russell King (Oracle)
Remove phylink_phy_no_inband() now that we are handling the lack of inband negotiation by querying the capabilities of the PHY and PCS, and the BCM84881 PHY driver provides us the information necessary to make the decision. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: phylink: add pcs_query_inband() *WIP*Russell King (Oracle)
Add a pcs_query_inband() interface which reflects phy_query_inband() for PHYs. This can be used to determine for the specified interface mode whether in-band signalling is supported by the PCS, and whether the PCS requires in-band signalling. This is used to determine whether we should use inband autonegotiation in inband mode, which may be required or may be unsupported in various interface modes. This revised version uses enable/disable/bypass flags to indicate the capabilities. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: mvpp2: add support for querying PCS inband propertiesRussell King (Oracle)
Report the PCS inband properties to phylink for Marvell PP2 interfaces. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: mvneta: add support for querying PCS inband propertiesRussell King (Oracle)
Report the PCS inband properties to phylink for Marvell NETA interfaces. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: phylink: add pcs_query_inband() methodRussell King (Oracle)
Add a pcs_query_inband() method to query the PCS for its inband link capabilities, and use this to determine whether link modes used with optical SFPs can be supported. When a PCS does not provide a method, we allow inband negotiation to be either on or off, making this a no-op until the pcs_query_inband() method is implemented by a PCS driver. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: phy: marvell: provide phy_query_inband() implementationRussell King (Oracle)
Provide an implementation for phy_query_inband() for Marvell PHYs used on SFP modules. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: phy: bcm84881: provide phy_query_inband() implementationRussell King (Oracle)
BCM84881 has no support for inband signalling, so this is a trivial implementation that returns no support for inband. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: phy: add phy_query_inband()Russell King (Oracle)
Add a method to query the PHY's in-band capabilities for a PHY interface mode. This can be used to determine for the specified interface mode whether in-band signalling is supported, and whether the PHY requires in-band signalling. When not implemented, or the PHY driver doesn't report any modes for the interface, LINK_INBAND_VALID will not be set. When set, the remainder of the flags can be interpreted. LINK_INBAND_POSSIBLE means that the device can be configured to use or not use in-band signalling. Later patches may add support to configure this at the PHY. LINK_INBAND_REQUIRED means that the device uses in-band signalling which can not be disabled. When only LINK_INBAND_VALID has been set, this means that the device does not support any in-band signalling, and can't be configured to do so. "Bypass" mode (where the device may be configured for in-band, but may still bring the link up if there is no in-band received from the link partner) is not considered in this patch. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: phylink: move phylink_pcs_neg_mode() in phylink_major_config()Russell King (Oracle)
Move the call to phylink_pcs_neg_mode() in phylink_major_config() after we have selected the appropriate PCS to later allow the capabilities of the PCS to be used when deciding which pcs_neg_mode should be used. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: phylink: add debug for phylink_major_config()Russell King (Oracle)
Now that we have a more complexity in phylink_major_config(), augment the debugging so we can see what's going on there. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: phylink: switch to MLO_AN_PHY when PCS uses outbandRussell King (Oracle)
phylink_pcs_neg_mode() currently only outband mode when we are using MLO_AN_PHY or MLO_AN_FIXED. However, we want to extend the use of this to MLO_AN_INBAND when the PCS and/or PHY are unable to use inband mode. For example, when a PHY is not capable of supporting inband mode, we need to operate in outband mode. However, using outband mode for the PCS while using MLO_AN_INBAND causes drivers to misbehave as it is not a situation they are expecting. Therefore, we need to switch to MLO_AN_PHY when using outband mode. Add the logic to select MLO_AN_PHY mode when phylink_pcs_neg_mode() indicates that it will be using outband mode with a PHY and the requested mode is MLO_AN_INBAND. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: phylink: split cur_link_an_mode into requested and activeRussell King (Oracle)
There is an interdependence between the link_an_mode and pcs_neg_mode that at least drivers rely upon. In order to support changing the MAC link_an_mode when we switch interfaces, we need to keep track of its original setting so that we can appropriately re-calculate pcs_neg_mode from the same starting point. Split the current link_an_mode into a requested link_an_mode and an active link_an_mode. This will allow us to keep the MAC's link_an_mode synchronised with the pcs_neg_mode should we decide to switch to outband with a PHY. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: phylink: simplify how SFP PHYs are attachedRussell King (Oracle)
There are a few issues with how SFP PHYs are attached: a) The phylink_sfp_connect_phy() and phylink_sfp_config_phy() code validates the configuration three times: 1. To discover the support/advertising masks that the PHY/PCS/MAC can support in order to select an interface. 2. To validate the selected interface. 3. When the PHY is brought up after being attached, another validation is done. This is needlessly complex. b) The configuration is set prior to the PHY being attached, which means we don't have the PHY available in phylink_major_config() for phylink_pcs_neg_mode() to make decisions upon. We have already added an extra step to validate the selected interface, so we can now move the attachment and bringup of the PHY earlier, inside phylink_sfp_config_phy(). This results in the validation at step 2 above becoming entirely unnecessary, so remove that too. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: phylink: validate sfp_select_interface() returned interfaceRussell King (Oracle)
When configuring for a SFP PHY, validate that the MAC supports the interface returned from sfp_select_interface(). This is a preparatory step to reorganising how a PHY on a SFP module is handled. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: sfp-bus: constify link_modes to sfp_select_interface()Russell King (Oracle)
sfp_select_interface() does not modify its link_modes argument, so make this a const pointer. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: phylink: allow EEE management for SFPs without PHYsRussell King (Oracle)
Allow EEE management for SFPs without accessible PHYs. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: dsa: mt7530: convert to phylink managed EEERussell King (Oracle)
Fixme: doesn't bit 25 and 26 also need to be set in the PMCR for PMCR_FORCE_EEE100 and PMCR_FORCE_EEE1G to take effect? Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: dsa: add support for phylink managed EEERussell King (Oracle)
Add support to allow DSA drivers to use phylink managed EEE, with only needing support for controlling the LPI state. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: dsa: mv88e6xxx: add EEE controlsRussell King (Oracle)
Add phylink EEE control methods to allow EEE to be configured. When LPI is to be disabled, we force the port to have EEE disabled, but when enabling EEE, if the port is under the control of the PPU, we stop forcing it, otherwise we force-enable EEE. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: dsa: mv88e6xxx: add support for EEE forcingRussell King (Oracle)
Add support for EEE forcing using the MAC control register. Replace the 88e6393x errata 4.5 EEE disable code with a call to the new EEE forcing code. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: dsa: mv88e6xxx: add port_set_eee() methodRussell King (Oracle)
Add a port_set_eee() method to allow the EEE settings for a port to be configured. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: mvpp2: add EEE implementationRussell King (Oracle)
Add EEE support for mvpp2, using phylink's EEE implementation, which means we just need to implement the two methods for LPI control, and with the initial configuration. Only the GMAC is supported, so only 100M, 1G and 2.5G speeds. Disabling LPI requires clearing a single bit. Enabling LPI needs a full configuration of several values, as the timer values are dependent on the MAC operating speed. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: mvneta: convert to phylink EEE implementationRussell King (Oracle)
Convert mvneta to use phylink's EEE implementation, which means we just need to implement the two methods for LPI control, and adding the initial configuration. Disabling LPI requires clearing a single bit. Enabling LPI needs a full configuration of several values, as the timer values are dependent on the MAC operating speed. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: phylink: add EEE managementRussell King (Oracle)
Add EEE management to phylink. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: add helpers for EEE configurationRussell King (Oracle)
Add helpers that phylib and phylink can use to manage EEE configuration and determine whether the MAC should be permitted to use LPI based on that configuration. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: dsa: felix: provide own phylink MAC operationsRussell King (Oracle)
Convert felix to provide its own phylink MAC operations, thus avoiding the shim layer in DSA's port.c. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: sfp: allow use 2500base-X for 2500base-T modulesRussell King (Oracle)
Allow use of 2500base-X interface mode for PHY modules that support 2500base-T. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-27net: phylink: add debug print for empty posssible_interfacesRussell King (Oracle)
Add a debugging print in phylink_validate_phy() when we detect that the PHY has not supplied a possible_interfaces bitmap. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-26net: txgbe: use phylink_pcs_change() to report PCS link change eventsRussell King (Oracle)
Use phylink_pcs_change() when reporting changes in PCS link state to phylink as the interrupts are informing us about changes to the PCS state. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-26net: prestera: use phylink_pcs_change() to report PCS link change eventsRussell King (Oracle)
Use phylink_pcs_change() when reporting changes in PCS link state to phylink as the interrupts are informing us about changes to the PCS state. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-26net: mvneta: use phylink_pcs_change() to report PCS link change eventsRussell King (Oracle)
Use phylink_pcs_change() when reporting changes in PCS link state to phylink as the interrupts are informing us about changes to the PCS state. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-26net: mvpp2: use phylink_pcs_change() to report PCS link change eventsRussell King (Oracle)
Use phylink_pcs_change() when reporting changes in PCS link state to phylink as the interrupts are informing us about changes to the PCS state. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-26net: dsa: ksz_common: use separate phylink_mac_ops for ksz8830Russell King (Oracle)
Use a separate phylink_mac_ops for the KSZ8830 chip-id. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-26net: dsa: ksz_common: sub-driver phylink opsRussell King (Oracle)
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-26net: dsa: ksz_common: provide own phylink MAC operationsRussell King (Oracle)
Convert ksz_common to provide its own phylink MAC operations, thus avoiding the shim layer in DSA's port.c Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-26net: dsa: ksz_common: remove phylink_mac_config from ksz_dev_opsRussell King (Oracle)
The phylink_mac_config function pointer member of struct ksz_dev_ops is never initialised, so let's remove it to simplify the code. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-18net: dsa: xrs700x: provide own phylink MAC operationsRussell King (Oracle)
Convert xrs700x to provide its own phylink MAC operations, thus avoiding the shim layer in DSA's port.c. We need to provide stubs for the mac_link_down() and mac_config() methods which are mandatory. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-18net: dsa: rzn1_a5psw: provide own phylink MAC operationsRussell King (Oracle)
Convert rzn1_a5psw to provide its own phylink MAC operations, thus avoiding the shim layer in DSA's port.c. We need to provide a stub for the mac_config() method which is mandatory. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-18net: dsa: lan9303: provide own phylink MAC operationsRussell King (Oracle)
Convert lan9303 to provide its own phylink MAC operations, thus avoiding the shim layer in DSA's port.c. We need to provide stubs for the mac_link_down() and mac_config() methods which are mandatory. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-16net: dsa: bcm_sf2: provide own phylink MAC operationsRussell King (Oracle)
Convert bcm_sf2 to provide its own phylink MAC operations, thus avoiding the shim layer in DSA's port.c Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-16net: dsa: lantiq_gswip: provide own phylink MAC operationsRussell King (Oracle)
Convert lantiq_gswip to provide its own phylink MAC operations, thus avoiding the shim layer in DSA's port.c. For lantiq_gswip, it means we end up with a common instance of phylink MAC operations that are shared between the different variants, rather than having duplicated initialisers in dsa_switch_ops. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-16net: dsa: qca8k: provide own phylink MAC operationsRussell King (Oracle)
Convert qca8k to provide its own phylink MAC operations, thus avoiding the shim layer in DSA's port.c. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-16net: dsa: ar9331: provide own phylink MAC operationsRussell King (Oracle)
Convert ar9331 to provide its own phylink MAC operations, thus avoiding the shim layer in DSA's port.c. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2024-04-16net: dsa: sja1105: provide own phylink MAC operationsRussell King (Oracle)
Convert sja1105 to provide its own phylink MAC operations, thus avoiding the shim layer in DSA's port.c Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>