1. 30 4月, 2022 2 次提交
  2. 09 4月, 2022 1 次提交
    • M
      net: phy: micrel: ksz9031/ksz9131: add cabletest support · 58389c00
      Marek Vasut 提交于
      Add cable test support for Micrel KSZ9x31 PHYs.
      
      Tested on i.MX8M Mini with KSZ9131RNX in 100/Full mode with pairs shuffled
      before magnetics:
      (note: Cable test started/completed messages are omitted)
      
        mx8mm-ksz9131-a-d-connected$ ethtool --cable-test eth0
        Pair A code OK
        Pair B code Short within Pair
        Pair B, fault length: 0.80m
        Pair C code Short within Pair
        Pair C, fault length: 0.80m
        Pair D code OK
      
        mx8mm-ksz9131-a-b-connected$ ethtool --cable-test eth0
        Pair A code OK
        Pair B code OK
        Pair C code Short within Pair
        Pair C, fault length: 0.00m
        Pair D code Short within Pair
        Pair D, fault length: 0.00m
      
      Tested on R8A77951 Salvator-XS with KSZ9031RNX and all four pairs connected:
      (note: Cable test started/completed messages are omitted)
      
        r8a7795-ksz9031-all-connected$ ethtool --cable-test eth0
        Pair A code OK
        Pair B code OK
        Pair C code OK
        Pair D code OK
      
      The CTRL1000 CTL1000_ENABLE_MASTER and CTL1000_AS_MASTER bits are not
      restored by calling phy_init_hw(), they must be manually cached in
      ksz9x31_cable_test_start() and restored at the end of
      ksz9x31_cable_test_get_status().
      Signed-off-by: NMarek Vasut <marex@denx.de>
      Cc: Heiner Kallweit <hkallweit1@gmail.com>
      Cc: Oleksij Rempel <linux@rempel-privat.de>
      Cc: Paolo Abeni <pabeni@redhat.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Tested-by: NClaudiu Beznea <claudiu.beznea@microchip.com>
      Link: https://lore.kernel.org/r/20220407105534.85833-1-marex@denx.deSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      58389c00
  3. 04 4月, 2022 2 次提交
  4. 07 3月, 2022 3 次提交
  5. 04 3月, 2022 2 次提交
  6. 19 1月, 2022 1 次提交
    • C
      net: phy: micrel: use kszphy_suspend()/kszphy_resume for irq aware devices · f1131b9c
      Claudiu Beznea 提交于
      On a setup with KSZ9131 and MACB drivers it happens on suspend path, from
      time to time, that the PHY interrupt arrives after PHY and MACB were
      suspended (PHY via genphy_suspend(), MACB via macb_suspend()). In this
      case the phy_read() at the beginning of kszphy_handle_interrupt() will
      fail (as MACB driver is suspended at this time) leading to phy_error()
      being called and a stack trace being displayed on console. To solve this
      .suspend/.resume functions for all KSZ devices implementing
      .handle_interrupt were replaced with kszphy_suspend()/kszphy_resume()
      which disable/enable interrupt before/after calling
      genphy_suspend()/genphy_resume().
      
      The fix has been adapted for all KSZ devices which implements
      .handle_interrupt but it has been tested only on KSZ9131.
      
      Fixes: 59ca4e58 ("net: phy: micrel: implement generic .handle_interrupt() callback")
      Signed-off-by: NClaudiu Beznea <claudiu.beznea@microchip.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f1131b9c
  7. 24 12月, 2021 1 次提交
  8. 22 12月, 2021 1 次提交
  9. 20 10月, 2021 1 次提交
  10. 15 10月, 2021 1 次提交
  11. 09 10月, 2021 1 次提交
  12. 29 9月, 2021 1 次提交
  13. 08 8月, 2021 1 次提交
  14. 02 8月, 2021 1 次提交
    • S
      net: phy: micrel: Fix detection of ksz87xx switch · a5e63c7d
      Steve Bennett 提交于
      The logic for discerning between KSZ8051 and KSZ87XX PHYs is incorrect
      such that the that KSZ87XX switch is not identified correctly.
      
      ksz8051_ksz8795_match_phy_device() uses the parameter ksz_phy_id
      to discriminate whether it was called from ksz8051_match_phy_device()
      or from ksz8795_match_phy_device() but since PHY_ID_KSZ87XX is the
      same value as PHY_ID_KSZ8051, this doesn't work.
      
      Instead use a bool to discriminate the caller.
      
      Without this patch, the KSZ8795 switch port identifies as:
      
      ksz8795-switch spi3.1 ade1 (uninitialized): PHY [dsa-0.1:03] driver [Generic PHY]
      
      With the patch, it identifies correctly:
      
      ksz8795-switch spi3.1 ade1 (uninitialized): PHY [dsa-0.1:03] driver [Micrel KSZ87XX Switch]
      
      Fixes: 8b95599c ("net: phy: micrel: Discern KSZ8051 and KSZ8795 PHYs")
      Signed-off-by: NSteve Bennett <steveb@workware.net.au>
      Reviewed-by: NMarek Vasut <marex@denx.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a5e63c7d
  15. 15 6月, 2021 5 次提交
  16. 26 2月, 2021 1 次提交
  17. 12 2月, 2021 1 次提交
  18. 10 2月, 2021 1 次提交
  19. 06 1月, 2021 1 次提交
  20. 28 11月, 2020 1 次提交
  21. 26 11月, 2020 2 次提交
    • I
      net: phy: micrel: remove the use of .ack_interrupt() · c0c99d0c
      Ioana Ciornei 提交于
      In preparation of removing the .ack_interrupt() callback, we must replace
      its occurrences (aka phy_clear_interrupt), from the 2 places where it is
      called from (phy_enable_interrupts and phy_disable_interrupts), with
      equivalent functionality.
      
      This means that clearing interrupts now becomes something that the PHY
      driver is responsible of doing, before enabling interrupts and after
      clearing them. Make this driver follow the new contract.
      
      Cc: Divya Koppera <Divya.Koppera@microchip.com>
      Cc: Oleksij Rempel <o.rempel@pengutronix.de>
      Cc: Philippe Schenker <philippe.schenker@toradex.com>
      Cc: Marek Vasut <marex@denx.de>
      Cc: Antoine Tenart <atenart@kernel.org>
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      c0c99d0c
    • I
      net: phy: micrel: implement generic .handle_interrupt() callback · 59ca4e58
      Ioana Ciornei 提交于
      In an attempt to actually support shared IRQs in phylib, we now move the
      responsibility of triggering the phylib state machine or just returning
      IRQ_NONE, based on the IRQ status register, to the PHY driver. Having
      3 different IRQ handling callbacks (.handle_interrupt(),
      .did_interrupt() and .ack_interrupt() ) is confusing so let the PHY
      driver implement directly an IRQ handler like any other device driver.
      Make this driver follow the new convention.
      
      Cc: Divya Koppera <Divya.Koppera@microchip.com>
      Cc: Oleksij Rempel <o.rempel@pengutronix.de>
      Cc: Philippe Schenker <philippe.schenker@toradex.com>
      Cc: Marek Vasut <marex@denx.de>
      Cc: Antoine Tenart <atenart@kernel.org>
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      59ca4e58
  22. 12 9月, 2020 1 次提交
    • D
      net: phy: mchp: Add support for LAN8814 QUAD PHY · 1623ad8e
      Divya Koppera 提交于
      LAN8814 is a low-power, quad-port triple-speed (10BASE-T/100BASETX/1000BASE-T)
      Ethernet physical layer transceiver (PHY). It supports transmission and
      reception of data on standard CAT-5, as well as CAT-5e and CAT-6, unshielded
      twisted pair (UTP) cables.
      
      LAN8814 supports industry-standard QSGMII (Quad Serial Gigabit Media
      Independent Interface) and Q-USGMII (Quad Universal Serial Gigabit Media
      Independent Interface) providing chip-to-chip connection to four Gigabit
      Ethernet MACs using a single serialized link (differential pair) in each
      direction.
      
      The LAN8814 SKU supports high-accuracy timestamping functions to
      support IEEE-1588 solutions using Microchip Ethernet switches, as well as
      customer solutions based on SoCs and FPGAs.
      
      The LAN8804 SKU has same features as that of LAN8814 SKU except that it does
      not support 1588, SyncE, or Q-USGMII with PCH/MCH.
      
      This adds support for 10BASE-T, 100BASE-TX, and 1000BASE-T,
      QSGMII link with the MAC.
      
      Signed-off-by: Divya Koppera<divya.koppera@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1623ad8e
  23. 23 4月, 2020 1 次提交
    • O
      net: phy: micrel: add phy-mode support for the KSZ9031 PHY · bcf3440c
      Oleksij Rempel 提交于
      Add support for following phy-modes: rgmii, rgmii-id, rgmii-txid, rgmii-rxid.
      
      This PHY has an internal RX delay of 1.2ns and no delay for TX.
      
      The pad skew registers allow to set the total TX delay to max 1.38ns and
      the total RX delay to max of 2.58ns (configurable 1.38ns + build in
      1.2ns) and a minimal delay of 0ns.
      
      According to the RGMII v1.3 specification the delay provided by PCB traces
      should be between 1.5ns and 2.0ns. The RGMII v2.0 allows to provide this
      delay by MAC or PHY. So, we configure this PHY to the best values we can
      get by this HW: TX delay to 1.38ns (max supported value) and RX delay to
      1.80ns (best calculated delay)
      
      The phy-modes can still be fine tuned/overwritten by *-skew-ps
      device tree properties described in:
      Documentation/devicetree/bindings/net/micrel-ksz90x1.txt
      Signed-off-by: NOleksij Rempel <o.rempel@pengutronix.de>
      Reviewed-by: NPhilippe Schenker <philippe.schenker@toradex.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bcf3440c
  24. 15 4月, 2020 1 次提交
  25. 04 4月, 2020 1 次提交
    • O
      net: phy: micrel: kszphy_resume(): add delay after genphy_resume() before accessing PHY registers · 6110dff7
      Oleksij Rempel 提交于
      After the power-down bit is cleared, the chip internally triggers a
      global reset. According to the KSZ9031 documentation, we have to wait at
      least 1ms for the reset to finish.
      
      If the chip is accessed during reset, read will return 0xffff, while
      write will be ignored. Depending on the system performance and MDIO bus
      speed, we may or may not run in to this issue.
      
      This bug was discovered on an iMX6QP system with KSZ9031 PHY and
      attached PHY interrupt line. If IRQ was used, the link status update was
      lost. In polling mode, the link status update was always correct.
      
      The investigation showed, that during a read-modify-write access, the
      read returned 0xffff (while the chip was still in reset) and
      corresponding write hit the chip _after_ reset and triggered (due to the
      0xffff) another reset in an undocumented bit (register 0x1f, bit 1),
      resulting in the next write being lost due to the new reset cycle.
      
      This patch fixes the issue by adding a 1...2 ms sleep after the
      genphy_resume().
      
      Fixes: 836384d2 ("net: phy: micrel: Add specific suspend")
      Signed-off-by: NOleksij Rempel <o.rempel@pengutronix.de>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6110dff7
  26. 30 3月, 2020 1 次提交
  27. 18 10月, 2019 2 次提交
    • M
      net: phy: micrel: Update KSZ87xx PHY name · 1d951ba3
      Marek Vasut 提交于
      The KSZ8795 PHY ID is in fact used by KSZ8794/KSZ8795/KSZ8765 switches.
      Update the PHY ID and name to reflect that, as this family of switches
      is commonly refered to as KSZ87xx
      Signed-off-by: NMarek Vasut <marex@denx.de>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: George McCollister <george.mccollister@gmail.com>
      Cc: Heiner Kallweit <hkallweit1@gmail.com>
      Cc: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
      Cc: Tristram Ha <Tristram.Ha@microchip.com>
      Cc: Woojung Huh <woojung.huh@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1d951ba3
    • M
      net: phy: micrel: Discern KSZ8051 and KSZ8795 PHYs · 8b95599c
      Marek Vasut 提交于
      The KSZ8051 PHY and the KSZ8794/KSZ8795/KSZ8765 switch share exactly the
      same PHY ID. Since KSZ8051 is higher in the ksphy_driver[] list of PHYs
      in the micrel PHY driver, it is used even with the KSZ87xx switch. This
      is wrong, since the KSZ8051 configures registers of the PHY which are
      not present on the simplified KSZ87xx switch PHYs and misconfigures
      other registers of the KSZ87xx switch PHYs.
      
      Fortunatelly, it is possible to tell apart the KSZ8051 PHY from the
      KSZ87xx switch by checking the Basic Status register Bit 0, which is
      read-only and indicates presence of the Extended Capability Registers.
      The KSZ8051 PHY has those registers while the KSZ87xx switch does not.
      
      This patch implements simple check for the presence of this bit for
      both the KSZ8051 PHY and KSZ87xx switch, to let both use the correct
      PHY driver instance.
      
      Fixes: 9d162ed6 ("net: phy: micrel: add support for KSZ8795")
      Signed-off-by: NMarek Vasut <marex@denx.de>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: George McCollister <george.mccollister@gmail.com>
      Cc: Heiner Kallweit <hkallweit1@gmail.com>
      Cc: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
      Cc: Tristram Ha <Tristram.Ha@microchip.com>
      Cc: Woojung Huh <woojung.huh@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8b95599c
  28. 28 9月, 2019 1 次提交
  29. 30 4月, 2019 1 次提交