1. 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
  2. 15 6月, 2021 5 次提交
  3. 26 2月, 2021 1 次提交
  4. 12 2月, 2021 1 次提交
  5. 10 2月, 2021 1 次提交
  6. 06 1月, 2021 1 次提交
  7. 28 11月, 2020 1 次提交
  8. 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
  9. 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
  10. 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
  11. 15 4月, 2020 1 次提交
  12. 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
  13. 30 3月, 2020 1 次提交
  14. 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
  15. 28 9月, 2019 1 次提交
  16. 30 4月, 2019 1 次提交
  17. 17 4月, 2019 1 次提交
  18. 16 4月, 2019 1 次提交
  19. 28 2月, 2019 1 次提交
    • R
      net: phy: Micrel KSZ8061: link failure after cable connect · 232ba3a5
      Rajasingh Thavamani 提交于
      With Micrel KSZ8061 PHY, the link may occasionally not come up after
      Ethernet cable connect. The vendor's (Microchip, former Micrel) errata
      sheet 80000688A.pdf descripes the problem and possible workarounds in
      detail, see below.
      The batch implements workaround 1, which permanently fixes the issue.
      
      DESCRIPTION
      Link-up may not occur properly when the Ethernet cable is initially
      connected. This issue occurs more commonly when the cable is connected
      slowly, but it may occur any time a cable is connected. This issue occurs
      in the auto-negotiation circuit, and will not occur if auto-negotiation
      is disabled (which requires that the two link partners be set to the
      same speed and duplex).
      
      END USER IMPLICATIONS
      When this issue occurs, link is not established. Subsequent cable
      plug/unplaug cycle will not correct the issue.
      
      WORk AROUND
      There are four approaches to work around this issue:
      1. This issue can be prevented by setting bit 15 in MMD device address 1,
         register 2, prior to connecting the cable or prior to setting the
         Restart Auto-negotiation bit in register 0h. The MMD registers are
         accessed via the indirect access registers Dh and Eh, or via the Micrel
         EthUtil utility as shown here:
         . if using the EthUtil utility (usually with a Micrel KSZ8061
           Evaluation Board), type the following commands:
           > address 1
           > mmd 1
           > iw 2 b61a
         . Alternatively, write the following registers to write to the
           indirect MMD register:
           Write register Dh, data 0001h
           Write register Eh, data 0002h
           Write register Dh, data 4001h
           Write register Eh, data B61Ah
      2. The issue can be avoided by disabling auto-negotiation in the KSZ8061,
         either by the strapping option, or by clearing bit 12 in register 0h.
         Care must be taken to ensure that the KSZ8061 and the link partner
         will link with the same speed and duplex. Note that the KSZ8061
         defaults to full-duplex when auto-negotiation is off, but other
         devices may default to half-duplex in the event of failed
         auto-negotiation.
      3. The issue can be avoided by connecting the cable prior to powering-up
         or resetting the KSZ8061, and leaving it plugged in thereafter.
      4. If the above measures are not taken and the problem occurs, link can
         be recovered by setting the Restart Auto-Negotiation bit in
         register 0h, or by resetting or power cycling the device. Reset may
         be either hardware reset or software reset (register 0h, bit 15).
      
      PLAN
      This errata will not be corrected in the future revision.
      
      Fixes: 7ab59dc1 ("drivers/net/phy/micrel_phy: Add support for new PHYs")
      Signed-off-by: NAlexander Onnasch <alexander.onnasch@landisgyr.com>
      Signed-off-by: NRajasingh Thavamani <T.Rajasingh@landisgyr.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      232ba3a5
  20. 23 1月, 2019 1 次提交
  21. 18 1月, 2019 1 次提交
  22. 17 1月, 2019 1 次提交
  23. 16 1月, 2019 1 次提交
  24. 05 12月, 2018 1 次提交
  25. 04 12月, 2018 1 次提交
  26. 12 11月, 2018 2 次提交
  27. 20 10月, 2018 1 次提交
  28. 17 5月, 2018 1 次提交
    • M
      net: phy: micrel: add 125MHz reference clock workaround · e1b505a6
      Markus Niebel 提交于
      The micrel KSZ9031 phy has a optional clock pin (CLK125_NDO) which can be
      used as reference clock for the MAC unit. The clock signal must meet the
      RGMII requirements to ensure the correct data transmission between the
      MAC and the PHY. The KSZ9031 phy does not fulfill the duty cycle
      requirement if the phy is configured as slave. For a complete
      describtion look at the errata sheets: DS80000691D or DS80000692D.
      
      The errata sheet recommends to force the phy into master mode whenever
      there is a 1000Base-T link-up as work around. Only set the
      "micrel,force-master" property if you use the phy reference clock provided
      by CLK125_NDO pin as MAC reference clock in your application.
      
      Attenation, this workaround is only usable if the link partner can
      be configured to slave mode for 1000Base-T.
      Signed-off-by: NMarkus Niebel <Markus.Niebel@tqs.de>
      [m.felsch@pengutronix.de: fix dt-binding documentation]
      [m.felsch@pengutronix.de: use already existing result var for read/write]
      [m.felsch@pengutronix.de: add error handling]
      [m.felsch@pengutronix.de: add more comments]
      Signed-off-by: NMarco Felsch <m.felsch@pengutronix.de>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e1b505a6
  29. 28 4月, 2018 1 次提交
  30. 22 3月, 2018 1 次提交
  31. 07 3月, 2018 1 次提交
  32. 27 12月, 2017 1 次提交
  33. 02 12月, 2017 1 次提交