Age | Commit message (Collapse) | Author |
|
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
|
|
Report the PCS inband properties to phylink for Marvell PP2 interfaces.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
|
|
Report the PCS inband properties to phylink for Marvell NETA
interfaces.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
|
|
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.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
|
|
Use phylink_pcs_change() when reporting changes in PCS link state to
phylink.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
|
|
Use phylink_pcs_change() when reporting changes in PCS link state to
phylink.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
|
|
Use phylink_pcs_change() when reporting changes in PCS link state to
phylink.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
|
|
Use phy_query_inband() with the initial mode when configuring copper
SFP modules to determine whether we should use inband or PHY mode. This
allows us to remove the BCM84881 specific detection from phylink, and
instead rely on the PHY driver giving us this detail.
We can use a simple check here - if the PHY reports that the inband
information is valid, but sets no other bits, then inband is definitely
not supported.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
|
|
Since the BCM84881 driver always provides phy->supported_interfaces,
and the driver is required for this PHY, move phylink_phy_no_inband()
to the case where this is non-empty.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
|
|
Move the SFP autoneg mode into struct phylink rather than passing it
into phylink_sfp_config(). This is generally MLO_AN_INBAND except when
we have a copper SFP with a Broadcom 84881 PHY.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
|
|
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
|
|
The modalias string provided in the uevent sysfs file does not conform
to the format used in PHY driver modules. One of the reasons is that
udev loading of PHY driver modules has not been an expected use case.
This patch changes the MODALIAS entry for only PHY devices from:
MODALIAS=of:Nethernet-phyT(null)
to:
MODALIAS=mdio:00000000001000100001010100010011
Other MDIO devices (such as DSA) remain as before.
However, having udev automatically load the module has the advantage
of making use of existing functionality to have the module loaded
before the device is bound to the driver, thus taking advantage of
multithreaded boot systems, potentially decreasing the boot time.
However, this patch will not solve any issues with the driver module
not being loaded prior to the network device needing to use the PHY.
This is something that is completely out of control of any patch to
change the uevent mechanism.
Reported-by: Yinbo Zhu <zhuyinbo@loongson.cn>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
|
|
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
|
|
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
|
|
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
|
|
Use the phylink_mode_*() helpers in all drivers so we can change the
definition of the "mode" argument.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
|
|
Add helpers to decode the mode argument passed to the various MAC and
PCS functions.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
|
|
Use the phy interface mode bitmaps for SFP modules and PHYs to select
the operating interface for SFPs and PHYs with SFPs.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
|
|
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
|
|
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
|
|
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
|
|
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
|
|
Add a supported_interfaces member to phylib so we know which
interfaces a PHY supports. Currently, set any unconverted driver
to indicate all interfaces are supported.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
|
|
Display SFP module information verbosely, splitting the generic parts
into a separate file.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
|
|
Add a compatible for SFP+ cages. SFP+ cages are backwards compatible,
but the ethernet device behind them may not support the slower speeds
of SFP modules.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
|
|
Cooled SFP+ transceivers need a longer initialisation (startup) time.
Select the initialisation time depending on the cooled option bit.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
|
|
phy_error() is called from phy_interrupt() or phy_state_machine(), and
uses WARN_ON() to print a backtrace. The backtrace is not useful when
reporting a PHY error.
However, a system may contain multiple ethernet PHYs, and phy_error()
gives no clue which one caused the problem.
Replace WARN_ON() with a call to phydev_err() so that we can see which
PHY had an error, and also inform the user that we are halting the PHY.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
|
|
Allow the PHY to probe when there is no firmware, but do not allow the
link to come up by forcing the PHY state to PHY_HALTED in a similar way
to phy_error().
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
|
|
Provide phy driver start/stop hooks so that the PHY driver knows when
the network driver is starting or stopping. This will be used for the
Marvell 10G driver so that we can sanely refuse to start if the PHYs
firmware is not present, and also so that we can sanely support SFPs
behind the PHY.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
|
|
Support reporting the hardware resolved pause enablement states via
phylib, overriding our software implementation.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
|
|
Allow phylib drivers to pass the hardware-resolved pause state to MAC
drivers, rather than using the software-based pause resolution code.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Allow EEE management for SFPs without accessible PHYs.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Add EEE management to phylink.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
The comment in m88e1111_config_init_1000basex() is wrong - it claims
that Autoneg will be enabled, but this doesn't actually happen.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
|
|
b53_get_mac_eee() sets both eee_enabled and eee_active, and then
returns zero.
dsa_user_get_eee(), which calls this function, will then continue to
call phylink_ethtool_get_eee(), which will return -EOPNOTSUPP if there
is no PHY present, otherwise calling phy_ethtool_get_eee() which in
turn will call genphy_c45_ethtool_get_eee().
genphy_c45_ethtool_get_eee() will overwrite eee_enabled and eee_active
with its own interpretation from the PHYs settings and negotiation
result.
Thus, when there is no PHY, dsa_user_get_eee() will fail with
-EOPNOTSUPP, meaning eee_enabled and eee_active will not be returned to
userspace. When there is a PHY, eee_enabled and eee_active will be
overwritten by phylib, making the setting of these members in
b53_get_mac_eee() entirely unnecessary.
Remove this code, thus simplifying b53_get_mac_eee().
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
|