summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-01-05ARM: dts: armada388-clearfog: document MPP usageclearfog-4.9Russell King
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2017-01-05PCI: mvebu: extend PCIe reset durationRussell King
Some PCIe cards (such as ASM1062 based SATA cards) appear to need a slightly longer delay between reset being released and the first card access. Increase the default delay from 20ms to 30ms. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2017-01-05sfp: removal of defsRussell King
2017-01-05implement slot capabilities (SSPL)Russell King
2017-01-05mvebu/clearfog updatesRussell King
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2017-01-05ARM: dts: armada388-clearfog: add SFP module supportRussell King
Add SFP module support for Clearfog using the SFP phylink support. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2017-01-05ARM: dts: armada388-clearfog: increase speed of i2c0 to 400kHzRussell King
All the devices on I2C0 support fast mode, so increase the bus speed to match. The Armada 388 is known to have a timing issue when in standard mode, which we believe causes the ficticious device at 0x64 to appear. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2017-01-05ARM: dts: armada388-clearfog: emmc on clearfog baseRussell King
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2017-01-05Merge branches 'clearfog-sent', 'mvebu-cpuidle' and 'phy' into clearfogRussell King
2017-01-05phylink: ensure link drops are reportedRussell King
When the MAC reports a link failure, it can be momentary. Ensure that the event is reported by latching the loss of link, so that the worker reports link down. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2017-01-05phylink: propagate PHY interface mode to MAC driverRussell King
Some 10Gigabit PHYs automatically switch the mode of their host interface depending on their negotiated speed. We need to communicate this to the MAC driver so the MAC can switch its host interface to match the PHYs new operating mode. Provide the current PHY interface mode to the MAC driver. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2017-01-05net: phy: fix marvell phy status readingRussell King
The Marvell driver incorrectly provides phydev->lp_advertising as the logical and of the link partner's advert and our advert. This is incorrect - this field is supposed to store the link parter's unmodified advertisment. This allows ethtool to report the correct link partner auto-negotiation status. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2017-01-05phy: marvell: 88E1540: add flow control supportRussell King
The Marvell PHYs support pause frame advertisments, so we should not be masking their support off. Add the necessary flag to the Marvell PHY to allow any MAC level pause frame support to be advertised. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2017-01-05phy: marvell: 88E1111: add flow control supportRussell King
The Marvell PHYs support pause frame advertisments, so we should not be masking their support off. Add the necessary flag to the Marvell PHY to allow any MAC level pause frame support to be advertised. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2017-01-05phy: marvell: 88E1512: add flow control supportRussell King
The Marvell PHYs support pause frame advertisments, so we should not be masking their support off. Add the necessary flag to the Marvell PHY to allow any MAC level pause frame support to be advertised. Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2017-01-05sfp/phylink: hook up eeprom functionsRussell King
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2017-01-05net: mvneta: add module EEPROM reading supportRussell King
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2017-01-05phylink: add module EEPROM supportRussell King
Add support for reading module EEPROMs through phylink. Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2017-01-05net: mvneta: add EEE supportRussell King
Add EEE support to mvneta. This allows us to enable the low power idle support at MAC level if there is a PHY attached through phylink which supports LPI. The appropriate ethtool support is provided to allow the feature to be controlled, including ethtool statistics for EEE wakeup errors. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2017-01-05phylink: add EEE supportRussell King
Add EEE hooks to phylink to allow the phylib EEE functions for the connected phy to be safely accessed. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2017-01-05net: mvneta: enable flow control for fixed connectionsRussell King
Allow symetric flow control to be enabled for fixed link connections as well as other types of connections by setting the supported and advertised capability bits. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2017-01-05net: mvneta: enable flow control for PHY connectionsRussell King
Enable flow control support for PHY connections by indicating our support via the ethtool capabilities. phylink takes care of the appropriate handling. Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2017-01-05net: mvneta: add flow control support via phylinkRussell King
Add flow control support to mvneta, including the ethtool hooks. This uses the phylink code to calculate the result of autonegotiation where a phy is attached, and to handle the ethtool settings. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2017-01-05phylink: add flow control supportRussell King
Add flow control support, including ethtool support, to phylink. We add support to allow ethtool to get and set the current flow control settings, and the 802.3 specified resolution for the local and remote link partner abilities. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2017-01-05net: mvneta: add nway_reset supportRussell King
Add ethtool nway_reset support to mvneta via phylink, so that userspace can request the link in whatever mode to be renegotiated via ethtool -r ethX. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2017-01-05phylink: add ethtool nway_reset supportRussell King
Add ethtool nway_reset support to phylink, to allow userspace to request a re-negotiation of the link. Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2017-01-05phy: fixed-phy: remove fixed_phy_update_state()Russell King
mvneta is the only user of fixed_phy_update_state(), which has been converted to use phylink instead. Remove fixed_phy_update_state(). Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2017-01-05net: mvneta: disable MVNETA_CAUSE_PSC_SYNC_CHANGE interruptRussell King
The PSC sync change interrupt can fire multiple times while the link is down. As this isn't information we make use of, it's pointless having the interrupt enabled, so let's disable this interrupt. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2017-01-05net: mvneta: convert to phylinkRussell King
Convert mvneta to use phylink, which models the MAC to PHY link in a generic, reusable form. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> - remove unused sync status
2017-01-05sfp: display SFP module informationRussell King
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2017-01-05sfp: add phylink based SFP module supportRussell King
Add support for SFP hotpluggable modules via phylink. This supports both copper and optical SFP modules, which require different Serdes modes in order to properly negotiate the link. Optical SFP modules typically require the Serdes link to be talking 1000base-X mode - this is the gigabit ethernet mode defined by the 802.3 standard. Copper SFP modules typically integrate a PHY in the module to convert from Serdes to copper, and the PHY will be configured by the vendor to either present a 1000base-X Serdes link (for fixed 1000base-T) or a SGMII Serdes link. However, this is vendor defined, so we instead detect the PHY, switch the link to SGMII mode, and use traditional PHY based negotiation. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> - set port and port capability depending on connector type - move autoneg mode setting to probe function - set "supported" speed capabilities depending on reported ethernet capabilities - checks for short read - dump eeprom base ID when checksum fails
2017-01-05phylink: add support for MII ioctl access to Clause 45 PHYsRussell King
Add support for reading and writing the clause 45 MII registers. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2017-01-05phylink: add hooks for SFP supportRussell King
Add support to phylink for SFP, which needs to control and configure the ethernet MAC link state. Specifically, SFP needs to: 1. set the negotiation mode between SGMII and 1000base-X 2. attach and detach the module PHY 3. prevent the link coming up when errors are reported In the absence of a PHY, we also need to set the ethtool port type according to the module plugged in. Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> - rework phylink_set_link_*(), combining into a single function.
2017-01-05phylink: add phylink infrastructureRussell King
The link between the ethernet MAC and its PHY has become more complex as the interface evolves. This is especially true with serdes links, where the part of the PHY is effectively integrated into the MAC. Serdes links can be connected to a variety of devices, including SFF modules soldered down onto the board with the MAC, a SFP cage with a hotpluggable SFP module which may contain a PHY or directly modulate the serdes signals onto optical media with or without a PHY, or even a classical PHY connection. Moreover, the negotiation information on serdes links comes in two varieties - SGMII mode, where the PHY provides its speed/duplex/flow control information to the MAC, and 1000base-X mode where both ends exchange their abilities and each resolve the link capabilities. This means we need a more flexible means to support these arrangements, particularly with the hotpluggable nature of SFP, where the PHY can be attached or detached after the network device has been brought up. Ethtool information can come from multiple sources: - we may have a PHY operating in either SGMII or 1000base-X mode, in which case we take ethtool/mii data directly from the PHY. - we may have a optical SFP module without a PHY, with the MAC operating in 1000base-X mode - the ethtool/mii data needs to come from the MAC. - we may have a copper SFP module with a PHY whic can't be accessed, which means we need to take ethtool/mii data from the MAC. Phylink aims to solve this by providing an intermediary between the MAC and PHY, providing a safe way for PHYs to be hotplugged, and allowing a SFP driver to reconfigure the serdes connection. Phylink also takes over support of fixed link connections, where the speed/duplex/flow control are fixed, but link status may be controlled by a GPIO signal. By avoiding the fixed-phy implementation, phylink can provide a faster response to link events: fixed-phy has to wait for phylib to operate its state machine, which can take several seconds. In comparison, phylink takes milliseconds. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> - remove sync status - rework supported and advertisment handling - add 1000base-x speed for fixed links - use functionality exported from phy-core, reworking __phylink_ethtool_ksettings_set for it
2017-01-05phy: add I2C mdio busRussell King
Add an I2C MDIO bus bridge library, to allow phylib to access PHYs which are connected to an I2C bus instead of the more conventional MDIO bus. Such PHYs can be found in SFP adapters and SFF modules. Since PHYs appear at I2C bus address 0x40..0x5f, and 0x50/0x51 are reserved for SFP EEPROMs/diagnostics, we must not allow the MDIO bus to access these I2C addresses. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2017-01-05phy: export phy_start_machine() for phylinkRussell King
phylink will need phy_start_machine exported, so lets export it as a GPL symbol. Documentation/networking/phy.txt indicates that this should be a PHY API function. Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2017-01-05phy: provide a hook for link up/link down eventsRussell King
Sometimes, we need to do additional work between the PHY coming up and marking the carrier present - for example, we may need to wait for the PHY to MAC link to finish negotiation. This changes phylib to provide a notification function pointer which avoids the built-in netif_carrier_on() and netif_carrier_off() functions. Standard ->adjust_link functionality is provided by hooking a helper into the new ->phy_link_change method. Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2017-01-05net: phy: add 1000Base-X to phy settings tableRussell King
Add the missing 1000Base-X entry to the phy settings table. This was not included because the original code could not cope with more than 32 bits of link mode mask. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2017-01-05net: phy: move phy_lookup_setting() to phy-coreRussell King
phy_lookup_setting() provides useful functionality in ethtool code outside phylib. Move it to phy-core and allow it to be re-used (eg, in phylink) rather than duplicated elsewhere. Note that this supports the larger linkmode space. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2017-01-05net: phy: split out PHY speed and duplex string generationRussell King
Other code would like to make use of this, so make the speed and duplex string generation visible, and place it in a separate file. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2017-01-05net: phy: improve phylib correctness for non-autoneg settingsRussell King
phylib has some undesirable behaviour when forcing a link mode through ethtool. phylib uses this code: idx = phy_find_valid(phy_find_setting(phydev->speed, phydev->duplex), features); to find an index in the settings table. phy_find_setting() starts at index 0, and scans upwards looking for an exact speed and duplex match. When it doesn't find it, it returns MAX_NUM_SETTINGS - 1, which is 10baseT-Half duplex. phy_find_valid() then scans from the point (and effectively only checks one entry) before bailing out, returning MAX_NUM_SETTINGS - 1. phy_sanitize_settings() then sets ->speed to SPEED_10 and ->duplex to DUPLEX_HALF whether or not 10baseT-Half is supported or not. This goes against all the comments against these functions, and 10baseT-Half may not even be supported by the hardware. Rework these functions, introducing a new method of scanning the table. There are two modes of lookup that phylib wants: exact, and inexact. - in exact mode, we return either an exact match or failure - in inexact mode, we return an exact match if it exists, a match at the highest speed that is not greater than the requested speed (ignoring duplex), or failing that, the lowest supported speed, or failure. The biggest difference is that we always check whether the entry is supported before further consideration, so all unsupported entries are not considered as candidates. This results in arguably saner behaviour, better matches the comments, and is probably what users would expect. This becomes important as ethernet speeds increase, PHYs exist which do not support the 10Mbit speeds, and half-duplex is likely to become obsolete - it's already not even an option on 10Gbit and faster links. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2017-01-05net: phy: avoid setting unsupported EEE advertismentsRussell King
We currently allow userspace to set any EEE advertisments it desires, whether or not the PHY supports them. For example: # ethtool --set-eee eth1 advertise 0xffffffff # ethtool --show-eee eth1 EEE Settings for eth1: EEE status: disabled Tx LPI: disabled Supported EEE link modes: 100baseT/Full 1000baseT/Full 10000baseT/Full Advertised EEE link modes: 100baseT/Full 1000baseT/Full 1000baseKX/Full 10000baseT/Full 10000baseKX4/Full 10000baseKR/Full Clearly, this is not sane, we should only allow link modes that are supported to be advertised (as we do elsewhere.) Ensure that we mask the MDIO_AN_EEE_ADV value with the capabilities retrieved from the MDIO_PCS_EEE_ABLE register. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2017-01-05net: phy: clean up mmd_phy_indirect()Russell King
Make mmd_phy_indirect() use the same terminology as the rest of the code, making clear what each address is - phy address, devad, and register number. While here, remove the "inline" from this static function, leaving it to the compiler to decide whether to inline this function, and get rid of unnecessary parens. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2017-01-05net: phy: remove the indirect MMD read/write methodsRussell King
Remove the indirect MMD read/write methods which are now no longer necessary. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2017-01-05net: phy: convert micrel to new read_mmd/write_mmd driver methodsRussell King
Convert micrel to the new read_mmd/write_mmd driver methods. This Clause 22 PHY does not support any MMD access method. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2017-01-05net: phy: switch all users to phy_(read|write)_mmd()Russell King
Switch everyone over to using phy_read_mmd() and phy_write_mmd() now that it is able to handle both Clause 22 indirect addressing and Clause 45 direct addressing. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2017-01-05net: phy: make phy_(read|write)_mmd() generic MMD accessorsRussell King
Make phy_(read|write)_mmd() generic 802.3 clause 45 register accessors for both Clause 22 and Clause 45 PHYs, using either the direct register reading for Clause 45, or the indirect method for Clause 22 PHYs. Allow this behaviour to be overriden by PHY drivers where necessary. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2017-01-05net: phy: move phy MMD accessors to phy-core.cRussell King
Move the phy_(read|write)__mmd() helpers out of line, they will become our main MMD accessor functions, and so will be a little more complex. This complexity doesn't belong in an inline function. Also move the _indirect variants as well to keep like functionality together. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2017-01-05ARM: dts: armada388-clearfog: move uart nodesRussell King
Move the uart nodes over to use the label form to reference the serial devices, rather than replicating the device node path. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2017-01-05ARM: dts: armada388-clearfog: move ethernet related nodesRussell King
Move the ethernet, buffer manager, and mdio nodes over to use label form to reference the devices rather than replicating the device path. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>