1. 06 11月, 2020 23 次提交
    • 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
    • I
      net: phy: add genphy_handle_interrupt_no_ack() · 87de1f05
      Ioana Ciornei 提交于
      It seems there are cases where the interrupts are handled by another
      entity (ie an IRQ controller embedded inside the PHY) and do not need
      any other interraction from phylib. For this kind of PHYs, like the
      RTL8366RB, add the genphy_handle_interrupt_no_ack() function which just
      triggers the link state machine.
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      87de1f05
    • I
      net: phy: davicom: remove the use of .ack_interrupt() · 0d65cc18
      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.
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      0d65cc18
    • I
      net: phy: davicom: implement generic .handle_interrupt() calback · e954631c
      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.
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      e954631c
    • I
      net: phy: cicada: remove the use of .ack_interrupt() · a758087f
      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.
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      a758087f
    • I
      net: phy: cicada: implement the generic .handle_interrupt() callback · e5d2b0b6
      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.
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      e5d2b0b6
    • I
      net: phy: broadcom: remove use of ack_interrupt() · 15772e4d
      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: Michael Walle <michael@walle.cc>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      15772e4d
    • I
      net: phy: broadcom: implement generic .handle_interrupt() callback · 4567d5c3
      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: Florian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Tested-by: NMichael Walle <michael@walle.cc>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      4567d5c3
    • I
      net: phy: aquantia: remove the use of .ack_interrupt() · e11ef96d
      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: Heiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      e11ef96d
    • I
      net: phy: aquantia: implement generic .handle_interrupt() callback · 6ab930df
      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: Heiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      6ab930df
    • I
      net: phy: mscc: remove the use of .ack_interrupt() · 30446ae4
      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: Antoine Tenart <atenart@kernel.org>
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Tested-by: Vladimir Oltean <olteanv@gmail.com> # VSC8514
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      30446ae4
    • I
      net: phy: mscc: implement generic .handle_interrupt() callback · 4008f373
      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.
      
      Also, remove the .did_interrupt() callback since it's not anymore used.
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Tested-by: Vladimir Oltean <olteanv@gmail.com> # VSC8514
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      4008f373
    • I
      net: phy: mscc: use phy_trigger_machine() to notify link change · f2e90604
      Ioana Ciornei 提交于
      According to the comment describing the phy_mac_interrupt() function, it
      it intended to be used by MAC drivers which have noticed a link change
      thus its use in the mscc PHY driver is improper and, most probably, was
      added just because phy_trigger_machine() was not exported.
      Now that we have acces to trigger the link state machine, use directly
      the phy_trigger_machine() function to notify a link change detected by
      the PHY driver.
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Tested-by: NVladimir Oltean <olteanv@gmail.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      f2e90604
    • I
      net: phy: at803x: remove the use of .ack_interrupt() · a3417885
      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: Oleksij Rempel <o.rempel@pengutronix.de>
      Cc: Michael Walle <michael@walle.cc>
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Tested-by: NOleksij Rempel <o.rempel@pengutronix.de>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      a3417885
    • I
      net: phy: at803x: implement generic .handle_interrupt() callback · 29773097
      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: Oleksij Rempel <o.rempel@pengutronix.de>
      Cc: Michael Walle <michael@walle.cc>
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Tested-by: NOleksij Rempel <o.rempel@pengutronix.de>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      29773097
    • I
      net: phy: make .ack_interrupt() optional · 7b2d5908
      Ioana Ciornei 提交于
      As a first step into making phylib and all PHY drivers to actually
      have support for shared IRQs, make the .ack_interrupt() callback
      optional.
      
      After all drivers have been moved to implement the generic
      interrupt handle, the phy_drv_supports_irq() check will be
      changed again to only require the .handle_interrupts() callback.
      
      Cc: Alexandru Ardelean <alexandru.ardelean@analog.com>
      Cc: Andre Edich <andre.edich@microchip.com>
      Cc: Antoine Tenart <atenart@kernel.org>
      Cc: Baruch Siach <baruch@tkos.co.il>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Dan Murphy <dmurphy@ti.com>
      Cc: Divya Koppera <Divya.Koppera@microchip.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Hauke Mehrtens <hauke@hauke-m.de>
      Cc: Heiner Kallweit <hkallweit1@gmail.com>
      Cc: Jerome Brunet <jbrunet@baylibre.com>
      Cc: Kavya Sree Kotagiri <kavyasree.kotagiri@microchip.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Marco Felsch <m.felsch@pengutronix.de>
      Cc: Marek Vasut <marex@denx.de>
      Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
      Cc: Mathias Kresin <dev@kresin.me>
      Cc: Maxim Kochetkov <fido_max@inbox.ru>
      Cc: Michael Walle <michael@walle.cc>
      Cc: Neil Armstrong <narmstrong@baylibre.com>
      Cc: Nisar Sayed <Nisar.Sayed@microchip.com>
      Cc: Oleksij Rempel <o.rempel@pengutronix.de>
      Cc: Philippe Schenker <philippe.schenker@toradex.com>
      Cc: Willy Liu <willy.liu@realtek.com>
      Cc: Yuiko Oshino <yuiko.oshino@microchip.com>
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      7b2d5908
    • I
      net: phy: add a shutdown procedure · e2f016cf
      Ioana Ciornei 提交于
      In case of a board which uses a shared IRQ we can easily end up with an
      IRQ storm after a forced reboot.
      
      For example, a 'reboot -f' will trigger a call to the .shutdown()
      callbacks of all devices. Because phylib does not implement that hook,
      the PHY is not quiesced, thus it can very well leave its IRQ enabled.
      
      At the next boot, if that IRQ line is found asserted by the first PHY
      driver that uses it, but _before_ the driver that is _actually_ keeping
      the shared IRQ asserted is probed, the IRQ is not going to be
      acknowledged, thus it will keep being fired preventing the boot process
      of the kernel to continue. This is even worse when the second PHY driver
      is a module.
      
      To fix this, implement the .shutdown() callback and disable the
      interrupts if these are used.
      
      Note that we are still susceptible to IRQ storms if the previous kernel
      exited with a panic or if the bootloader left the shared IRQ active, but
      there is absolutely nothing we can do about these cases.
      
      Cc: Alexandru Ardelean <alexandru.ardelean@analog.com>
      Cc: Andre Edich <andre.edich@microchip.com>
      Cc: Antoine Tenart <atenart@kernel.org>
      Cc: Baruch Siach <baruch@tkos.co.il>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Dan Murphy <dmurphy@ti.com>
      Cc: Divya Koppera <Divya.Koppera@microchip.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Hauke Mehrtens <hauke@hauke-m.de>
      Cc: Heiner Kallweit <hkallweit1@gmail.com>
      Cc: Jerome Brunet <jbrunet@baylibre.com>
      Cc: Kavya Sree Kotagiri <kavyasree.kotagiri@microchip.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Marco Felsch <m.felsch@pengutronix.de>
      Cc: Marek Vasut <marex@denx.de>
      Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
      Cc: Mathias Kresin <dev@kresin.me>
      Cc: Maxim Kochetkov <fido_max@inbox.ru>
      Cc: Michael Walle <michael@walle.cc>
      Cc: Neil Armstrong <narmstrong@baylibre.com>
      Cc: Nisar Sayed <Nisar.Sayed@microchip.com>
      Cc: Oleksij Rempel <o.rempel@pengutronix.de>
      Cc: Philippe Schenker <philippe.schenker@toradex.com>
      Cc: Willy Liu <willy.liu@realtek.com>
      Cc: Yuiko Oshino <yuiko.oshino@microchip.com>
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      e2f016cf
    • I
      net: phy: export phy_error and phy_trigger_machine · 293e9a3d
      Ioana Ciornei 提交于
      These functions are currently used by phy_interrupt() to either signal
      an error condition or to trigger the link state machine. In an attempt
      to actually support shared PHY IRQs, export these two functions so that
      the actual PHY drivers can use them.
      
      Cc: Alexandru Ardelean <alexandru.ardelean@analog.com>
      Cc: Andre Edich <andre.edich@microchip.com>
      Cc: Antoine Tenart <atenart@kernel.org>
      Cc: Baruch Siach <baruch@tkos.co.il>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Dan Murphy <dmurphy@ti.com>
      Cc: Divya Koppera <Divya.Koppera@microchip.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Hauke Mehrtens <hauke@hauke-m.de>
      Cc: Heiner Kallweit <hkallweit1@gmail.com>
      Cc: Jerome Brunet <jbrunet@baylibre.com>
      Cc: Kavya Sree Kotagiri <kavyasree.kotagiri@microchip.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Marco Felsch <m.felsch@pengutronix.de>
      Cc: Marek Vasut <marex@denx.de>
      Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
      Cc: Mathias Kresin <dev@kresin.me>
      Cc: Maxim Kochetkov <fido_max@inbox.ru>
      Cc: Michael Walle <michael@walle.cc>
      Cc: Neil Armstrong <narmstrong@baylibre.com>
      Cc: Nisar Sayed <Nisar.Sayed@microchip.com>
      Cc: Oleksij Rempel <o.rempel@pengutronix.de>
      Cc: Philippe Schenker <philippe.schenker@toradex.com>
      Cc: Willy Liu <willy.liu@realtek.com>
      Cc: Yuiko Oshino <yuiko.oshino@microchip.com>
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      293e9a3d
    • K
      net: dsa: hellcreek: Add PTP status LEDs · 7d9ee2e8
      Kurt Kanzenbach 提交于
      The switch has two controllable I/Os which are usually connected to LEDs. This
      is useful to immediately visually see the PTP status.
      
      These provide two signals:
      
       * is_gm
      
         This LED can be activated if the current device is the grand master in that
         PTP domain.
      
       * sync_good
      
         This LED can be activated if the current device is in sync with the network
         time.
      
      Expose these via the LED framework to be controlled via user space
      e.g. linuxptp.
      Signed-off-by: NKurt Kanzenbach <kurt@linutronix.de>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      7d9ee2e8
    • K
      net: dsa: hellcreek: Add support for hardware timestamping · f0d4ba9e
      Kamil Alkhouri 提交于
      The switch has the ability to take hardware generated time stamps per port for
      PTPv2 event messages in Rx and Tx direction. That is useful for achieving needed
      time synchronization precision for TSN devices/switches. So add support for it.
      
      There are two directions:
      
       * RX
      
         The switch has a single register per port to capture a timestamp. That
         mechanism is not used due to correlation problems. If the software processing
         is too slow and a PTPv2 event message is received before the previous one has
         been processed, false timestamps will be captured. Therefore, the switch can
         do "inline" timestamping which means it can insert the nanoseconds part of
         the timestamp directly into the PTPv2 event message. The reserved field (4
         bytes) is leveraged for that. This might not be in accordance with (older)
         PTP standards, but is the only way to get reliable results.
      
       * TX
      
         In Tx direction there is no correlation problem, because the software and the
         driver has to ensure that only one event message is "on the fly". However,
         the switch provides also a mechanism to check whether a timestamp is
         lost. That can only happen when a timestamp is read and at this point another
         message is timestamped. So, that lost bit is checked just in case to indicate
         to the user that the driver or the software is somewhat buggy.
      Signed-off-by: NKamil Alkhouri <kamil.alkhouri@hs-offenburg.de>
      Signed-off-by: NKurt Kanzenbach <kurt@linutronix.de>
      Acked-by: NRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      f0d4ba9e
    • K
      net: dsa: hellcreek: Add PTP clock support · ddd56dfe
      Kamil Alkhouri 提交于
      The switch has internal PTP hardware clocks. Add support for it. There are three
      clocks:
      
       * Synchronized
       * Syntonized
       * Free running
      
      Currently the synchronized clock is exported to user space which is a good
      default for the beginning. The free running clock might be exported later
      e.g. for implementing 802.1AS-2011/2020 Time Aware Bridges (TAB). The switch
      also supports cross time stamping for that purpose.
      
      The implementation adds support setting/getting the time as well as offset and
      frequency adjustments. However, the clock only holds a partial timeofday
      timestamp. This is why we track the seconds completely in software (see overflow
      work and last_ts).
      
      Furthermore, add the PTP multicast addresses into the FDB to forward that
      packages only to the CPU port where they are processed by a PTP program.
      Signed-off-by: NKamil Alkhouri <kamil.alkhouri@hs-offenburg.de>
      Signed-off-by: NKurt Kanzenbach <kurt@linutronix.de>
      Acked-by: NRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      ddd56dfe
    • K
      net: dsa: Add DSA driver for Hirschmann Hellcreek switches · e4b27ebc
      Kurt Kanzenbach 提交于
      Add a basic DSA driver for Hirschmann Hellcreek switches. Those switches are
      implementing features needed for Time Sensitive Networking (TSN) such as support
      for the Time Precision Protocol and various shapers like the Time Aware Shaper.
      
      This driver includes basic support for networking:
      
       * VLAN handling
       * FDB handling
       * Port statistics
       * STP
       * Phylink
      Signed-off-by: NKurt Kanzenbach <kurt@linutronix.de>
      Reviewed-by: NVladimir Oltean <olteanv@gmail.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      e4b27ebc
  2. 05 11月, 2020 11 次提交
    • C
      enetc: Remove Tx checksumming offload code · 82728b91
      Claudiu Manoil 提交于
      Tx checksumming has been defeatured and completely removed
      from the h/w reference manual. Made a little cleanup for the
      TSE case as this is complementary code.
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@nxp.com>
      Link: https://lore.kernel.org/r/20201103140213.3294-1-claudiu.manoil@nxp.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      82728b91
    • Z
      dpaa_eth: use false and true for bool variables · ebcaa207
      Zou Wei 提交于
      Fix coccicheck warnings:
      
      ./dpaa_eth.c:2549:2-22: WARNING: Assignment of 0/1 to bool variable
      ./dpaa_eth.c:2562:2-22: WARNING: Assignment of 0/1 to bool variable
      Reported-by: NHulk Robot <hulkci@huawei.com>
      Signed-off-by: NZou Wei <zou_wei@huawei.com>
      Acked-by: NMadalin Bucur <madalin.bucur@oss.nxp.com>
      Link: https://lore.kernel.org/r/1604405100-33255-1-git-send-email-zou_wei@huawei.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      ebcaa207
    • A
      net: phy: adin: implement cable-test support · f2531d45
      Alexandru Ardelean 提交于
      The ADIN1300/ADIN1200 support cable diagnostics using TDR.
      
      The cable fault detection is automatically run on all four pairs looking at
      all combinations of pair faults by first putting the PHY in standby (clear
      the LINK_EN bit, PHY_CTRL_3 register, Address 0x0017) and then enabling the
      diagnostic clock (set the DIAG_CLK_EN bit, PHY_CTRL_1 register, Address
      0x0012).
      
      Cable diagnostics can then be run (set the CDIAG_RUN bit in the
      CDIAG_RUN register, Address 0xBA1B). The results are reported for each pair
      in the cable diagnostics results registers, CDIAG_DTLD_RSLTS_0,
      CDIAG_DTLD_RSLTS_1, CDIAG_DTLD_RSLTS_2, and CDIAG_DTLD_RSLTS_3, Address
      0xBA1D to Address 0xBA20).
      
      The distance to the first fault for each pair is reported in the cable
      fault distance registers, CDIAG_FLT_DIST_0, CDIAG_FLT_DIST_1,
      CDIAG_FLT_DIST_2, and CDIAG_FLT_DIST_3, Address 0xBA21 to Address 0xBA24).
      
      This change implements support for this using phylib's cable-test support.
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NAlexandru Ardelean <alexandru.ardelean@analog.com>
      Link: https://lore.kernel.org/r/20201103074436.93790-2-alexandru.ardelean@analog.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      f2531d45
    • A
      net: phy: adin: disable diag clock & disable standby mode in config_aneg · 85ba75bb
      Alexandru Ardelean 提交于
      When the PHY powers up, the diagnostics clock isn't enabled (bit 2 in
      register PHY_CTRL_1 (0x0012)).
      Also, the PHY is not in standby mode, so bit 13 in PHY_CTRL_3 (0x0017) is
      always set at power up.
      
      The standby mode and the diagnostics clock are both meant to be for the
      cable diagnostics feature of the PHY (in phylib this would be equivalent to
      the cable-test support), and for the frame-generator feature of the PHY.
      
      In standby mode, the PHY doesn't negotiate links or manage links.
      
      To use the cable diagnostics/test (or frame-generator), the PHY must be
      first set in standby mode, so that the link operation doesn't interfere.
      Then, the diagnostics clock must be enabled.
      
      For the cable-test feature, when the operation finishes, the PHY goes into
      PHY_UP state, and the config_aneg hook is called.
      
      For the ADIN PHY, we need to make sure that during autonegotiation
      configuration/setup the PHY is removed from standby mode and the
      diagnostics clock is disabled, so that normal operation is resumed.
      
      This change does that by moving the set of the ADIN1300_LINKING_EN bit (2)
      in the config_aneg (to disable standby mode).
      Previously, this was set in the downshift setup, because the downshift
      retry value and the ADIN1300_LINKING_EN are in the same register.
      
      And the ADIN1300_DIAG_CLK_EN bit (13) is cleared, to disable the
      diagnostics clock.
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NAlexandru Ardelean <alexandru.ardelean@analog.com>
      Link: https://lore.kernel.org/r/20201103074436.93790-1-alexandru.ardelean@analog.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      85ba75bb
    • D
      net: dsa: mt7530: support setting MTU · 9470174e
      DENG Qingfang 提交于
      MT7530/7531 has a global RX packet length register, which can be used
      to set MTU.
      
      Supported packet length values are 1522 (1518 if untagged), 1536,
      1552, and multiple of 1024 (from 2048 to 15360).
      Signed-off-by: NDENG Qingfang <dqfext@gmail.com>
      Link: https://lore.kernel.org/r/20201103050618.11419-1-dqfext@gmail.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      9470174e
    • A
      net: ipa: eliminate legacy arguments · d387c761
      Alex Elder 提交于
      We enable a channel doorbell engine only for IPA v3.5.1, and that is
      now handled directly by gsi_channel_program().
      
      When initially setting up a channel, we want that doorbell engine
      enabled, and we can request that independent of the IPA version.
      
      Doing that makes the "legacy" argument to gsi_channel_setup_one()
      unnecessary.  And with that gone we can get rid of the "legacy"
      argument to gsi_channel_setup(), and gsi_setup() as well.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      d387c761
    • A
      net: ipa: use version in gsi_channel_program() · ce54993d
      Alex Elder 提交于
      Use the IPA version in gsi_channel_program() to determine whether
      we should enable the GSI doorbell engine when requested.  This way,
      callers only say whether or not it should be enabled if needed,
      regardless of hardware version.
      
      Rename the "legacy" argument to gsi_channel_reset(), and have
      it indicate whether the doorbell engine should be enabled when
      reprogramming following the reset.
      
      Change all callers of gsi_channel_reset() to indicate whether to
      enable the doorbell engine after reset, independent of hardware
      version.
      
      Rework a little logic in ipa_endpoint_reset() to get rid of the
      "legacy" variable previously passed to gsi_channel_reset().
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      ce54993d
    • A
      net: ipa: use version in gsi_channel_reset() · 9de4a4cc
      Alex Elder 提交于
      A quirk of IPA v3.5.1 requires a channel reset on an RX channel to
      be performed twice.  Use the IPA version in gsi_channel_reset()
      rather than the passed-in legacy flag to determine that.
      
      This is actually a bug fix, because this double reset is supposed
      to occur independent of whether we're enabling the doorbell engine.
      Now they will be independent.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      9de4a4cc
    • A
      net: ipa: use version in gsi_channel_init() · 56dfe8de
      Alex Elder 提交于
      A quirk of IPA v4.2 requires the AP to allocate the GSI channels
      that are owned by the modem.
      
      Rather than pass a flag argument to gsi_channel_init(), use the
      IPA version directly in that function to determine whether modem
      channels need to be allocated.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      56dfe8de
    • A
      net: ipa: record IPA version in GSI structure · 14dbf977
      Alex Elder 提交于
      Record the IPA version passed to gsi_init() in the GSI structure.
      This allows that value to be used directly where needed, rather than
      passing and storing certain flag arguments through the code.
      
      In particular, for all but one supported version of IPA, the command
      channel is programmed to only use an "escape buffer".  By storing
      the IPA version, we can do a simple version check in one location,
      and avoid storing a flag field in every channel (and passing a flag
      along while initializing channels to set that field properly).
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      14dbf977
    • A
      net: ipa: expose IPA version to the GSI layer · 1d0c09de
      Alex Elder 提交于
      Although GSI is integral to IPA, it is a separate hardware component
      and the IPA code supporting it has been structured to avoid explicit
      dependence on IPA details.  An example of this is that gsi_init() is
      passed a number of Boolean flags to indicate special behaviors,
      whose values are dependent on the IPA hardware version.  Looking
      ahead, newer hardware versions would require even more such special
      behaviors.
      
      For any given version of IPA hardware (like 3.5.1 or 4.2), the GSI
      hardware version is fixed (in this case, 1.3 and 2.2, respectively).
      So the IPA version *implies* the GSI version, and the IPA version
      can be used as effectively the equivalent of the GSI hardware version.
      
      Rather than proliferating new special behavior flags, just provide
      the IPA version to the GSI layer when it is initialized.  The GSI
      code can then use that directly to determine whether special
      behaviors are required.  The IPA version enumerated type is already
      isolated to its own header file, so the exposure of this IPA detail
      is very limited.
      
      For now, just change gsi_init() to pass the version rather than the
      Boolean flags, and set the flag values internal to that function.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      1d0c09de
  3. 04 11月, 2020 6 次提交