1. 06 11月, 2020 2 次提交
    • I
      net: phy: realtek: remove the use of .ack_interrupt() · 8b43357f
      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: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
      Cc: Willy Liu <willy.liu@realtek.com>
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      8b43357f
    • I
      net: phy: realtek: implement generic .handle_interrupt() callback · 03829163
      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: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
      Cc: Willy Liu <willy.liu@realtek.com>
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      03829163
  2. 04 11月, 2020 1 次提交
  3. 02 10月, 2020 1 次提交
    • W
      net: phy: realtek: Modify 2.5G PHY name to RTL8226 · 7a333af6
      Willy Liu 提交于
      Realtek single-chip Ethernet PHY solutions can be separated as below:
      10M/100Mbps: RTL8201X
      1Gbps: RTL8211X
      2.5Gbps: RTL8226/RTL8221X
      RTL8226 is the first version for realtek that compatible 2.5Gbps single PHY.
      Since RTL8226 is single port only, realtek changes its name to RTL8221B from
      the second version.
      PHY ID for RTL8226 is 0x001cc800 and RTL8226B/RTL8221B is 0x001cc840.
      
      RTL8125 is not a single PHY solution, it integrates PHY/MAC/PCIE bus
      controller and embedded memory.
      Signed-off-by: NWilly Liu <willy.liu@realtek.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7a333af6
  4. 30 9月, 2020 1 次提交
    • W
      net: phy: realtek: fix rtl8211e rx/tx delay config · bbc4d71d
      Willy Liu 提交于
      There are two chip pins named TXDLY and RXDLY which actually adds the 2ns
      delays to TXC and RXC for TXD/RXD latching. These two pins can config via
      4.7k-ohm resistor to 3.3V hw setting, but also config via software setting
      (extension page 0xa4 register 0x1c bit13 12 and 11).
      
      The configuration register definitions from table 13 official PHY datasheet:
      PHYAD[2:0] = PHY Address
      AN[1:0] = Auto-Negotiation
      Mode = Interface Mode Select
      RX Delay = RX Delay
      TX Delay = TX Delay
      SELRGV = RGMII/GMII Selection
      
      This table describes how to config these hw pins via external pull-high or pull-
      low resistor.
      
      It is a misunderstanding that mapping it as register bits below:
      8:6 = PHY Address
      5:4 = Auto-Negotiation
      3 = Interface Mode Select
      2 = RX Delay
      1 = TX Delay
      0 = SELRGV
      So I removed these descriptions above and add related settings as below:
      14 = reserved
      13 = force Tx RX Delay controlled by bit12 bit11
      12 = Tx Delay
      11 = Rx Delay
      10:0 = Test && debug settings reserved by realtek
      
      Test && debug settings are not recommend to modify by default.
      
      Fixes: f81dadbc ("net: phy: realtek: Add rtl8211e rx/tx delays config")
      Signed-off-by: NWilly Liu <willy.liu@realtek.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bbc4d71d
  5. 22 9月, 2020 1 次提交
  6. 15 7月, 2020 1 次提交
  7. 21 4月, 2020 1 次提交
  8. 19 3月, 2020 1 次提交
  9. 27 12月, 2019 2 次提交
    • M
      net: phy: realtek: add support for configuring the RX delay on RTL8211F · 1b3047b5
      Martin Blumenstingl 提交于
      On RTL8211F the RX and TX delays (2ns) can be configured in two ways:
      - pin strapping (RXD1 for the TX delay and RXD0 for the RX delay, LOW
        means "off" and HIGH means "on") which is read during PHY reset
      - using software to configure the TX and RX delay registers
      
      So far only the configuration using pin strapping has been supported.
      Add support for enabling or disabling the RGMII RX delay based on the
      phy-mode to be able to get the RX delay into a known state. This is
      important because the RX delay has to be coordinated between the PHY,
      MAC and the PCB design (trace length). With an invalid RX delay applied
      (for example if both PHY and MAC add a 2ns RX delay) Ethernet may not
      work at all.
      
      Also add debug logging when configuring the RX delay (just like the TX
      delay) because this is a common source of problems.
      Signed-off-by: NMartin Blumenstingl <martin.blumenstingl@googlemail.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1b3047b5
    • M
      net: phy: realtek: add logging for the RGMII TX delay configuration · 3aec743d
      Martin Blumenstingl 提交于
      RGMII requires a delay of 2ns between the data and the clock signal.
      There are at least three ways this can happen. One possibility is by
      having the PHY generate this delay.
      This is a common source for problems (for example with slow TX speeds or
      packet loss when sending data). The TX delay configuration of the
      RTL8211F PHY can be set either by pin-strappping the RXD1 pin (HIGH
      means enabled, LOW means disabled) or through configuring a paged
      register. The setting from the RXD1 pin is also reflected in the
      register.
      
      Add debug logging to the TX delay configuration on RTL8211F so it's
      easier to spot these issues (for example if the TX delay is enabled for
      both, the RTL8211F PHY and the MAC).
      This is especially helpful because there is no public datasheet for the
      RTL8211F PHY available with all the RX/TX delay specifics.
      Signed-off-by: NMartin Blumenstingl <martin.blumenstingl@googlemail.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3aec743d
  10. 02 12月, 2019 1 次提交
  11. 20 8月, 2019 1 次提交
  12. 16 8月, 2019 1 次提交
  13. 15 8月, 2019 1 次提交
  14. 12 8月, 2019 1 次提交
    • H
      net: phy: realtek: add support for the 2.5Gbps PHY in RTL8125 · 087f5b87
      Heiner Kallweit 提交于
      This adds support for the integrated 2.5Gbps PHY in Realtek RTL8125.
      Advertisement of 2.5Gbps mode is done via a vendor-specific register.
      Same applies to reading NBase-T link partner advertisement.
      Unfortunately this 2.5Gbps PHY shares the PHY ID with the integrated
      1Gbps PHY's in other Realtek network chips and so far no method is
      known to differentiate them. As a workaround use a dedicated fake PHY ID
      that is set by the network driver by intercepting the MDIO PHY ID read.
      
      v2:
      - Create dedicated PHY driver and use a fake PHY ID that is injected by
        the network driver. Suggested by Andrew Lunn.
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      087f5b87
  15. 14 5月, 2019 1 次提交
  16. 12 5月, 2019 1 次提交
  17. 11 5月, 2019 1 次提交
  18. 09 5月, 2019 2 次提交
  19. 05 4月, 2019 1 次提交
  20. 03 4月, 2019 1 次提交
  21. 24 2月, 2019 1 次提交
    • L
      net: phy: realtek: Dummy IRQ calls for RTL8366RB · 4c8e0459
      Linus Walleij 提交于
      This fixes a regression introduced by
      commit 0d2e778e
      "net: phy: replace PHY_HAS_INTERRUPT with a check for
      config_intr and ack_interrupt".
      
      This assumes that a PHY cannot trigger interrupt unless
      it has .config_intr() or .ack_interrupt() implemented.
      A later patch makes the code assume both need to be
      implemented for interrupts to be present.
      
      But this PHY (which is inside a DSA) will happily
      fire interrupts without either callback.
      
      Implement dummy callbacks for .config_intr() and
      .ack_interrupt() in the phy header to fix this.
      
      Tested on the RTL8366RB on D-Link DIR-685.
      
      Fixes: 0d2e778e ("net: phy: replace PHY_HAS_INTERRUPT with a check for config_intr and ack_interrupt")
      Cc: Heiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4c8e0459
  22. 04 2月, 2019 1 次提交
  23. 23 1月, 2019 1 次提交
  24. 12 11月, 2018 2 次提交
  25. 08 11月, 2018 1 次提交
  26. 05 11月, 2018 1 次提交
    • H
      net: phy: realtek: fix RTL8201F sysfs name · 0432e833
      Holger Hoffstätte 提交于
      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: NHolger Hoffstätte <holger@applied-asynchrony.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0432e833
  27. 18 7月, 2018 1 次提交
    • L
      net: phy: realtek: Support RTL8366RB variant · d8545825
      Linus Walleij 提交于
      The RTL8366RB is an ASIC with five internal PHYs for
      LAN0..LAN3 and WAN. The PHYs are spawn off the main
      device so they can be handled in a distributed manner
      by the Realtek PHY driver. All that is really needed
      is the power save feature enablement and letting the
      PHY driver core pick up the IRQ from the switch chip.
      
      Cc: Antti Seppälä <a.seppala@gmail.com>
      Cc: Roman Yeryomin <roman@advem.lv>
      Cc: Colin Leitner <colin.leitner@googlemail.com>
      Cc: Gabor Juhos <juhosg@openwrt.org>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d8545825
  28. 17 7月, 2018 1 次提交
  29. 02 7月, 2018 2 次提交
  30. 30 6月, 2018 1 次提交
    • H
      net: phy: realtek: add support for RTL8211 · d241d4aa
      Heiner Kallweit 提交于
      In preparation of adding phylib support to the r8169 driver we need
      PHY drivers for all chip-internal PHY types. Fortunately almost all
      of them are either supported by the Realtek PHY driver already or work
      with the genphy driver.
      Still missing is support for the PHY of RTL8169s, it requires a quirk
      to properly support 100Mbit-fixed mode. The quirk was copied from
      r8169 driver which copied it from the vendor driver.
      Based on the PHYID the internal PHY seems to be a RTL8211.
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d241d4aa
  31. 29 5月, 2018 1 次提交
  32. 22 3月, 2018 1 次提交
  33. 17 1月, 2018 1 次提交
  34. 03 12月, 2017 2 次提交