Skip to content
Snippets Groups Projects
  1. Nov 11, 2018
  2. Nov 10, 2018
  3. Nov 08, 2018
  4. Nov 05, 2018
    • Holger Hoffstätte's avatar
      net: phy: realtek: fix RTL8201F sysfs name · 0432e833
      Holger Hoffstätte authored
      
      Since 4.19 the following error in sysfs has appeared when using the
      r8169 NIC driver:
      
      $cd /sys/module/realtek/drivers
      $ls -l
      ls: cannot access 'mdio_bus:RTL8201F 10/100Mbps Ethernet': No such file or directory
      [..garbled dir entries follow..]
      
      Apparently the forward slash in "10/100Mbps Ethernet" is interpreted
      as directory separator that leads nowhere, and was introduced in commit
      513588dd ("net: phy: realtek: add RTL8201F phy-id and functions").
      
      Fix this by removing the offending slash in the driver name.
      
      Other drivers in net/phy seem to have the same problem, but I cannot
      test/verify them.
      
      Fixes: 513588dd ("net: phy: realtek: add RTL8201F phy-id and functions")
      Signed-off-by: default avatarHolger Hoffstätte <holger@applied-asynchrony.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0432e833
  5. Oct 25, 2018
  6. Oct 23, 2018
  7. Oct 22, 2018
  8. Oct 20, 2018
  9. Oct 18, 2018
  10. Oct 16, 2018
  11. Oct 11, 2018
  12. Oct 08, 2018
    • Quentin Schulz's avatar
      net: phy: mscc: add support for VSC8574 PHY · 00d70d8e
      Quentin Schulz authored
      
      The VSC8574 PHY is a 4-ports PHY that is 10/100/1000BASE-T, 100BASE-FX,
      1000BASE-X and triple-speed copper SFP capable, can communicate with
      the MAC via SGMII, QSGMII or 1000BASE-X, supports WOL, downshifting and
      can set the blinking pattern of each of its 4 LEDs, supports SyncE as
      well as HP Auto-MDIX detection.
      
      This adds support for 10/100/1000BASE-T, SGMII/QSGMII link with the MAC,
      WOL, downshifting, HP Auto-MDIX detection and blinking pattern for its 4
      LEDs.
      
      The VSC8574 has also an internal Intel 8051 microcontroller whose
      firmware needs to be patched when the PHY is reset. If the 8051's
      firmware has the expected CRC, its patching can be skipped. The
      microcontroller can be accessed from any port of the PHY, though the CRC
      function can only be done through the PHY that is the base PHY of the
      package (internal address 0) due to a limitation of the firmware.
      
      The GPIO register bank is a set of registers that are common to all PHYs
      in the package. So any modification in any register of this bank affects
      all PHYs of the package.
      
      If the PHYs haven't been reset before booting the Linux kernel and were
      configured to use interrupts for e.g. link status updates, it is
      required to clear the interrupts mask register of all PHYs before being
      able to use interrupts with any PHY. The first PHY of the package that
      will be init will take care of clearing all PHYs interrupts mask
      registers. Thus, we need to keep track of the init sequence in the
      package, if it's already been done or if it's to be done.
      
      Most of the init sequence of a PHY of the package is common to all PHYs
      in the package, thus we use the SMI broadcast feature which enables us
      to propagate a write in one register of one PHY to all PHYs in the same
      package.
      
      Signed-off-by: default avatarQuentin Schulz <quentin.schulz@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      00d70d8e
    • Quentin Schulz's avatar
      net: phy: mscc: add support for VSC8584 PHY · a5afc167
      Quentin Schulz authored
      
      The VSC8584 PHY is a 4-ports PHY that is 10/100/1000BASE-T, 100BASE-FX,
      1000BASE-X and triple-speed copper SFP capable, can communicate with the
      MAC via SGMII, QSGMII or 1000BASE-X, supports downshifting and can set
      the blinking pattern of each of its 4 LEDs, supports hardware offloading
      of MACsec and supports SyncE as well as HP Auto-MDIX detection.
      
      This adds support for 10/100/1000BASE-T, SGMII/QSGMII link with the MAC,
      downshifting, HP Auto-MDIX detection and blinking pattern for its 4
      LEDs.
      
      The VSC8584 has also an internal Intel 8051 microcontroller whose
      firmware needs to be patched when the PHY is reset. If the 8051's
      firmware has the expected CRC, its patching can be skipped. The
      microcontroller can be accessed from any port of the PHY, though the CRC
      function can only be done through the PHY that is the base PHY of the
      package (internal address 0) due to a limitation of the firmware.
      
      The GPIO register bank is a set of registers that are common to all PHYs
      in the package. So any modification in any register of this bank affects
      all PHYs of the package.
      
      If the PHYs haven't been reset before booting the Linux kernel and were
      configured to use interrupts for e.g. link status updates, it is
      required to clear the interrupts mask register of all PHYs before being
      able to use interrupts with any PHY. The first PHY of the package that
      will be init will take care of clearing all PHYs interrupts mask
      registers. Thus, we need to keep track of the init sequence in the
      package, if it's already been done or if it's to be done.
      
      Most of the init sequence of a PHY of the package is common to all PHYs
      in the package, thus we use the SMI broadcast feature which enables us
      to propagate a write in one register of one PHY to all PHYs in the same
      package.
      
      The revA of the VSC8584 PHY (which is not and will not be publicly
      released) should NOT patch the firmware of the microcontroller or it'll
      make things worse, the easiest way is just to not support it.
      
      Signed-off-by: default avatarQuentin Schulz <quentin.schulz@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a5afc167
    • Quentin Schulz's avatar
      net: phy: mscc: remove unneeded temporary variable · 629ea0f1
      Quentin Schulz authored
      
      Here, the rc variable is either used only for the condition right after
      the assignment or right before being used as the return value of the
      function it's being used in.
      
      So let's remove this unneeded temporary variable whenever possible.
      
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarQuentin Schulz <quentin.schulz@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      629ea0f1
    • Quentin Schulz's avatar
      net: phy: mscc: shorten `x != 0` condition to `x` · 6f0430c7
      Quentin Schulz authored
      
      `if (x != 0)` is basically a more verbose version of `if (x)` so let's
      use the latter so it's consistent throughout the whole driver.
      
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarQuentin Schulz <quentin.schulz@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6f0430c7
    • Quentin Schulz's avatar
      net: phy: mscc: remove unneeded parenthesis · b7d373c5
      Quentin Schulz authored
      
      The == operator precedes the || operator, so we can remove the
      parenthesis around (a == b) || (c == d).
      
      The condition is rather explicit and short so removing the parenthesis
      definitely does not make it harder to read.
      
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarQuentin Schulz <quentin.schulz@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b7d373c5
    • Raju Lakkaraju's avatar
      net: phy: mscc: Add EEE init sequence · 96dae01f
      Raju Lakkaraju authored
      
      Microsemi PHYs (VSC 8530/31/40/41) need to update the Energy Efficient
      Ethernet initialization sequence.
      In order to avoid certain link state errors that could result in link
      drops and packet loss, the physical coding sublayer (PCS) must be
      updated with settings related to EEE in order to improve performance.
      
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarRaju Lakkaraju <Raju.Lakkaraju@microchip.com>
      Signed-off-by: default avatarQuentin Schulz <quentin.schulz@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      96dae01f
    • Raju Lakkaraju's avatar
      net: phy: mscc: add ethtool statistics counters · f76178dc
      Raju Lakkaraju authored
      
      There are a few counters available in the PHY: receive errors, false
      carriers, link disconnects, media CRC errors and valids counters.
      
      So let's expose those in the PHY driver.
      
      Use the priv structure as the next PHY to be supported has a few
      additional counters.
      
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarRaju Lakkaraju <Raju.Lakkaraju@microsemi.com>
      Signed-off-by: default avatarQuentin Schulz <quentin.schulz@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f76178dc
    • Quentin Schulz's avatar
      net: phy: mscc: migrate to phy_select/restore_page functions · 6a0bfbbe
      Quentin Schulz authored
      
      The Microsemi PHYs have multiple banks of registers (called pages).
      Registers can only be accessed from one page, if we need a register from
      another page, we need to switch the page and the registers of all other
      pages are not accessible anymore.
      
      Basically, to read register 5 from page 0, 1, 2, etc., you do the same
      phy_read(phydev, 5); but you need to set the desired page beforehand.
      
      In order to guarantee that two concurrent functions do not change the
      page, we need to do some locking per page. This can be achieved with the
      use of phy_select_page and phy_restore_page functions but phy_write/read
      calls in-between those two functions shall be replaced by their
      lock-free alternative __phy_write/read.
      
      Let's migrate this driver to those functions.
      
      Suggested-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarQuentin Schulz <quentin.schulz@bootlin.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6a0bfbbe
  13. Oct 05, 2018
  14. Oct 02, 2018
Loading