Skip to content
Snippets Groups Projects
  1. May 10, 2020
  2. May 07, 2020
    • Oleksij Rempel's avatar
      ethtool: provide UAPI for PHY master/slave configuration. · bdbdac76
      Oleksij Rempel authored
      
      This UAPI is needed for BroadR-Reach 100BASE-T1 devices. Due to lack of
      auto-negotiation support, we needed to be able to configure the
      MASTER-SLAVE role of the port manually or from an application in user
      space.
      
      The same UAPI can be used for 1000BASE-T or MultiGBASE-T devices to
      force MASTER or SLAVE role. See IEEE 802.3-2018:
      22.2.4.3.7 MASTER-SLAVE control register (Register 9)
      22.2.4.3.8 MASTER-SLAVE status register (Register 10)
      40.5.2 MASTER-SLAVE configuration resolution
      45.2.1.185.1 MASTER-SLAVE config value (1.2100.14)
      45.2.7.10 MultiGBASE-T AN control 1 register (Register 7.32)
      
      The MASTER-SLAVE role affects the clock configuration:
      
      -------------------------------------------------------------------------------
      When the  PHY is configured as MASTER, the PMA Transmit function shall
      source TX_TCLK from a local clock source. When configured as SLAVE, the
      PMA Transmit function shall source TX_TCLK from the clock recovered from
      data stream provided by MASTER.
      
      iMX6Q                     KSZ9031                XXX
      ------\                /-----------\        /------------\
            |                |           |        |            |
       MAC  |<----RGMII----->| PHY Slave |<------>| PHY Master |
            |<--- 125 MHz ---+-<------/  |        | \          |
      ------/                \-----------/        \------------/
                                                     ^
                                                      \-TX_TCLK
      
      -------------------------------------------------------------------------------
      
      Since some clock or link related issues are only reproducible in a
      specific MASTER-SLAVE-role, MAC and PHY configuration, it is beneficial
      to provide generic (not 100BASE-T1 specific) interface to the user space
      for configuration flexibility and trouble shooting.
      
      Signed-off-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bdbdac76
  3. Mar 24, 2020
    • Heiner Kallweit's avatar
      net: phy: add and use phy_check_downshift · 5eee3bb7
      Heiner Kallweit authored
      
      So far PHY drivers have to check whether a downshift occurred to be
      able to notify the user. To make life of drivers authors a little bit
      easier move the downshift notification to phylib. phy_check_downshift()
      compares the highest mutually advertised speed with the actual value
      of phydev->speed (typically read by the PHY driver from a
      vendor-specific register) to detect a downshift.
      
      v2:
      - Add downshift hint to phy_print_status
      
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5eee3bb7
  4. Mar 18, 2020
    • Heiner Kallweit's avatar
      net: phy: improve phy_driver callback handle_interrupt · 9010f9de
      Heiner Kallweit authored
      
      did_interrupt() clears the interrupt, therefore handle_interrupt() can
      not check which event triggered the interrupt. To overcome this
      constraint and allow more flexibility for customer interrupt handlers,
      let's decouple handle_interrupt() from parts of the phylib interrupt
      handling. Custom interrupt handlers now have to implement the
      did_interrupt() functionality in handle_interrupt() if needed.
      
      Fortunately we have just one custom interrupt handler so far (in the
      mscc PHY driver), convert it to the changed API.
      
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9010f9de
  5. Mar 02, 2020
  6. Jan 21, 2020
  7. Jan 20, 2020
  8. Dec 26, 2019
  9. Nov 23, 2019
  10. Nov 19, 2019
  11. Oct 16, 2019
    • Yonglong Liu's avatar
      net: phy: Fix "link partner" information disappear issue · 3de5ae54
      Yonglong Liu authored
      
      Some drivers just call phy_ethtool_ksettings_set() to set the
      links, for those phy drivers that use genphy_read_status(), if
      autoneg is on, and the link is up, than execute "ethtool -s
      ethx autoneg on" will cause "link partner" information disappear.
      
      The call trace is phy_ethtool_ksettings_set()->phy_start_aneg()
      ->linkmode_zero(phydev->lp_advertising)->genphy_read_status(),
      the link didn't change, so genphy_read_status() just return, and
      phydev->lp_advertising is zero now.
      
      This patch moves the clear operation of lp_advertising from
      phy_start_aneg() to genphy_read_lpa()/genphy_c45_read_lpa(), and
      if autoneg on and autoneg not complete, just clear what the
      generic functions care about.
      
      Fixes: 88d6272a ("net: phy: avoid unneeded MDIO reads in genphy_read_status")
      Signed-off-by: default avatarYonglong Liu <liuyonglong@huawei.com>
      Reviewed-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3de5ae54
  12. Oct 05, 2019
  13. Sep 06, 2019
  14. Aug 28, 2019
  15. Aug 14, 2019
  16. Jul 09, 2019
  17. Jun 06, 2019
  18. May 31, 2019
  19. May 30, 2019
  20. May 07, 2019
  21. May 04, 2019
  22. Apr 18, 2019
  23. Mar 20, 2019
    • Heiner Kallweit's avatar
      net: phy: improve handling link_change_notify callback · 5c5f626b
      Heiner Kallweit authored
      Currently the Phy driver's link_change_notify callback is called
      whenever the state machine is run (every second if polling), no matter
      whether the state changed or not. This isn't needed and may confuse
      users considering the name of the callback. Actually it contradicts
      its kernel-doc description. Therefore let's change the behavior and
      call this callback only in case of an actual state change.
      
      This requires changes to the at803x and rockchip drivers.
      at803x can be simplified so that it reacts on a state change to
      PHY_NOLINK only.
      The rockchip driver can also be much simplified. We simply re-init
      the AFE/DSP registers whenever we change to PHY_RUNNING and speed
      is 100Mbps. This causes very small overhead because we do this even
      if the speed was 100Mbps already. But this is negligible and
      I think justified by the much simpler code.
      
      Changes are compile-tested only.
      
      A little bit problematic seems to be to find somebody with the
      hardware to test the changes to the two PHY drivers. See also [0].
      David may be able to test the Rockchip driver.
      
      [0] https://marc.info/?t=153782508800006&r=1&w=2
      
      
      
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5c5f626b
  24. Mar 04, 2019
  25. Feb 14, 2019
  26. Feb 06, 2019
  27. Jan 25, 2019
  28. Jan 23, 2019
  29. Jan 18, 2019
Loading