1. 15 Feb, 2023 4 commits
    • Alex Elder's avatar
      net: ipa: define fields for event-ring related registers · edc6158b
      Alex Elder authored
      Define field IDs for the EV_CH_E_CNTXT_0 and EV_CH_E_CNTXT_8 GSI
      registers, and populate the register definition files accordingly.
      Use the reg_*() functions to access field values for those regiters,
      and get rid of the previous field definition constants.
      
      The remaining EV_CH_E_CNTXT_* registers are written with full 32-bit
      values (and have no fields).
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      edc6158b
    • Alex Elder's avatar
      net: ipa: define more fields for GSI registers · 330ce9d3
      Alex Elder authored
      Beyond the CH_C_QOS register, two other registers whose offset is
      related to channel number have fields within them.
      
      Define the fields within the CH_C_CNTXT_0 GSI register, using an
      enumerated type to identify the register's fields, and define an
      array of field masks to use for that register's reg structure.
      
      For the CH_C_CNTXT_1 GSI register, ch_c_cntxt_1_length_encode()
      previously hid the difference in bit width in the channel ring
      length field.  Instead, define a new field CH_R_LENGTH and encode
      the ring size with reg_encode().
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      330ce9d3
    • Alex Elder's avatar
      net: ipa: define GSI CH_C_QOS register fields · f50ca7ce
      Alex Elder authored
      Define the fields within the CH_C_QOS GSI register using an array of
      field masks in that register's reg structure.  Use the reg functions
      for encoding values in those fields.
      
      One field in the register is present for IPA v4.0-4.2 only, two
      others are present starting at IPA v4.5, and one more is there
      starting at IPA v4.9.
      
      Drop the "GSI_" prefix in symbols defined in the gsi_prefetch_mode
      enumerated type, and define their values using decimal rather than
      hexidecimal values.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      f50ca7ce
    • Alex Elder's avatar
      net: ipa: populate more GSI register files · 4a4270cf
      Alex Elder authored
      Create "gsi_v4.0.c", "gsi_v4.5.c", and "gsi_v4.9.c" as essentially
      identical copies of "gsi_v3.5.1.c".  The only difference is the name
      of the exported "gsi_regs_vX_Y" structure.  The next patch will
      start differentiating them.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      4a4270cf
  2. 14 Feb, 2023 25 commits
  3. 13 Feb, 2023 11 commits
    • David S. Miller's avatar
      Merge branch 'ksz9477-eee-support' · 9b0bf4f7
      David S. Miller authored
      Oleksij Rempel says:
      
      ====================
      net: add EEE support for KSZ9477 switch family
      
      changes v8:
      - fix comment for linkmode_to_mii_eee_cap1_t() function
      - add Acked-by: Arun Ramadoss <arun.ramadoss@microchip.com>
      - add Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
      
      changes v7:
      - update documentation for genphy_c45_eee_is_active()
      - address review comments on "net: dsa: microchip: enable EEE support"
        patch
      
      changes v6:
      - split patch set and send only first 9 patches
      - Add Reviewed-by: Andrew Lunn <andrew@lunn.ch>
      - use 0xffff instead of GENMASK
      - Document @supported_eee
      - use "()" with function name in comments
      
      changes v5:
      - spell fixes
      - move part of genphy_c45_read_eee_abilities() to
        genphy_c45_read_eee_cap1()
      - validate MDIO_PCS_EEE_ABLE register against 0xffff val.
      - rename *eee_100_10000* to *eee_cap1*
      - use linkmode_intersects(phydev->supported, PHY_EEE_CAP1_FEATURES)
        instead of !linkmode_empty()
      - add documentation to linkmode/register helpers
      
      changes v4:
      - remove following helpers:
        mmd_eee_cap_to_ethtool_sup_t
        mmd_eee_adv_to_ethtool_adv_t
        ethtool_adv_to_mmd_eee_adv_t
        and port drivers from this helpers to linkmode helpers.
      - rebase against latest net-next
      - port phy_init_eee() to genphy_c45_eee_is_active()
      
      changes v3:
      - rework some parts of EEE infrastructure and move it to c45 code.
      - add supported_eee storage and start using it in EEE code and by the
        micrel driver.
      - add EEE support for ar8035 PHY
      - add SmartEEE support to FEC i.MX series.
      
      changes v2:
      - use phydev->supported instead of reading MII_BMSR regiaster
      - fix @get_eee > @set_eee
      
      With this patch series we provide EEE control for KSZ9477 family of
      switches and
      AR8035 with i.MX6 configuration.
      According to my tests, on a system with KSZ8563 switch and 100Mbit idle
      link,
      we consume 0,192W less power per port if EEE is enabled.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9b0bf4f7
    • Oleksij Rempel's avatar
      net: phy: start using genphy_c45_ethtool_get/set_eee() · 8b68710a
      Oleksij Rempel authored
      All preparations are done. Now we can start using new functions and remove
      the old code.
      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>
      8b68710a
    • Oleksij Rempel's avatar
      net: phy: migrate phy_init_eee() to genphy_c45_eee_is_active() · 6340f9fd
      Oleksij Rempel authored
      Reduce code duplicated by migrating phy_init_eee() to
      genphy_c45_eee_is_active().
      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>
      6340f9fd
    • Oleksij Rempel's avatar
      net: phy: c45: migrate to genphy_c45_write_eee_adv() · 5827b168
      Oleksij Rempel authored
      Migrate from genphy_config_eee_advert() to genphy_c45_write_eee_adv().
      
      It should work as before except write operation to the EEE adv registers
      will be done only if some EEE abilities was detected.
      
      If some driver will have a regression, related driver should provide own
      .get_features callback. See micrel.c:ksz9477_get_features() as example.
      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>
      5827b168
    • Oleksij Rempel's avatar
      net: phy: c22: migrate to genphy_c45_write_eee_adv() · 9b01c885
      Oleksij Rempel authored
      Migrate from genphy_config_eee_advert() to genphy_c45_write_eee_adv().
      
      It should work as before except write operation to the EEE adv registers
      will be done only if some EEE abilities was detected.
      
      If some driver will have a regression, related driver should provide own
      .get_features callback. See micrel.c:ksz9477_get_features() as example.
      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>
      9b01c885
    • Oleksij Rempel's avatar
      net: phy: add genphy_c45_ethtool_get/set_eee() support · 022c3f87
      Oleksij Rempel authored
      Add replacement for phy_ethtool_get/set_eee() functions.
      
      Current phy_ethtool_get/set_eee() implementation is great and it is
      possible to make it even better:
      - this functionality is for devices implementing parts of IEEE 802.3
        specification beyond Clause 22. The better place for this code is
        phy-c45.c
      - currently it is able to do read/write operations on PHYs with
        different abilities to not existing registers. It is better to
        use stored supported_eee abilities to avoid false read/write
        operations.
      - the eee_active detection will provide wrong results on not supported
        link modes. It is better to validate speed/duplex properties against
        supported EEE link modes.
      - it is able to support only limited amount of link modes. We have more
        EEE link modes...
      
      By refactoring this code I address most of this point except of the last
      one. Adding additional EEE link modes will need more work.
      Signed-off-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      022c3f87
    • Oleksij Rempel's avatar
      net: phy: export phy_check_valid() function · cf9f6079
      Oleksij Rempel authored
      This function will be needed for genphy_c45_ethtool_get_eee() provided
      by next patch.
      Signed-off-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
      Reviewed-by: default avatarAlexander Duyck <alexanderduyck@fb.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cf9f6079
    • Oleksij Rempel's avatar
      net: phy: micrel: add ksz9477_get_features() · 48fb1994
      Oleksij Rempel authored
      KSZ8563R, which has same PHYID as KSZ9477 family, will change "EEE control
      and capability 1" (Register 3.20) content depending on configuration of
      "EEE advertisement 1" (Register 7.60). Changes on the 7.60 will affect
      3.20 register.
      
      So, instead of depending on register 3.20, driver should set supported_eee.
      
      Proper supported_eee configuration is needed to make use of generic
      PHY c45 set/get_eee functions provided by next patches.
      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>
      48fb1994
    • Oleksij Rempel's avatar
      net: phy: add genphy_c45_read_eee_abilities() function · 14e47d1f
      Oleksij Rempel authored
      Add generic function for EEE abilities defined by IEEE 802.3
      specification. For now following registers are supported:
      - IEEE 802.3-2018 45.2.3.10 EEE control and capability 1 (Register 3.20)
      - IEEE 802.3cg-2019 45.2.1.186b 10BASE-T1L PMA status register
        (Register 1.2295)
      
      Since I was not able to find any flag signaling support of these
      registers, we should detect link mode abilities first and then based on
      these abilities doing EEE link modes detection.
      
      Results of EEE ability detection will be stored into new variable
      phydev->supported_eee.
      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>
      14e47d1f
    • Oleksij Rempel's avatar
      net: dsa: microchip: enable EEE support · 69d3b36c
      Oleksij Rempel authored
      Some of KSZ9477 family switches provides EEE support. To enable it, we
      just need to register set_mac_eee/set_mac_eee handlers and validate
      supported chip version and port.
      
      Currently supported chip variants are: KSZ8563, KSZ9477, KSZ9563,
      KSZ9567, KSZ9893, KSZ9896, KSZ9897. KSZ8563 supports EEE only with
      100BaseTX/Full.  Other chips support 100BaseTX/Full and 1000BaseTX/Full.
      Low Power Idle configuration is not supported and currently not
      documented in the datasheets.
      
      EEE PHY specific tunings are not documented in the switch datasheets, but can
      overlap with KSZ9131 specification.
      Signed-off-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Acked-by: default avatarArun Ramadoss <arun.ramadoss@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      69d3b36c
    • David S. Miller's avatar
      Merge branch 'ionic-on-chip-desc' · 79cdf17e
      David S. Miller authored
      Shannon Nelson says:
      
      ====================
      ionic: on-chip descriptors
      
      We start with a couple of house-keeping patches that were originally
      presented for 'net', then we add support for on-chip descriptor rings
      for tx-push, as well as adding support for rx-push.
      
      I have a patch for the ethtool userland utility that I can send out
      once this has been accepted.
      
      v4: added rx-push attributes to ethtool netlink
          converted CMB feature from using a priv-flag to using ethtool tx/rx-push
      
      v3: edited commit message to describe interface-down limitation
          added warn msg if cmb_inuse alloc fails
          removed unnecessary clearing of phy_cmb_pages and cmb_npages
          changed cmb_rings_toggle to use cmb_inuse
          removed unrelated pci_set_drvdata()
          removed unnecessary (u32) cast
          added static inline func for writing CMB descriptors
      
      v2: dropped the rx buffers patch
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      79cdf17e