1. 05 Nov, 2020 8 commits
    • DENG Qingfang's avatar
      net: dsa: mt7530: support setting MTU · 9470174e
      DENG Qingfang authored
      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: default avatarDENG Qingfang <dqfext@gmail.com>
      Link: https://lore.kernel.org/r/20201103050618.11419-1-dqfext@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      9470174e
    • Jakub Kicinski's avatar
      Merge branch 'net-ipa-tell-gsi-the-ipa-version' · 2c24eefb
      Jakub Kicinski authored
      Alex Elder says:
      
      ====================
      net: ipa: tell GSI the IPA version
      
      The GSI code that supports IPA avoids having knowledge about the
      IPA layer it serves.  One result of this is that Boolean flags are
      used during GSI initialization to convey that certain hardware
      version-dependent special behaviors should be used.
      
      A given version of IPA hardware uses a fixed/well-defined version
      of GSI, so the IPA version really implies the GSI version.
      
      If given only the IPA version, the GSI code supporting IPA can
      use it to implement certain special behaviors required for IPA
      *or* GSI.  This avoids the need to pass and maintain numerous
      Boolean flags.
      ====================
      
      Link: https://lore.kernel.org/r/20201102175400.6282-1-elder@linaro.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      2c24eefb
    • Alex Elder's avatar
      net: ipa: eliminate legacy arguments · d387c761
      Alex Elder authored
      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: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      d387c761
    • Alex Elder's avatar
      net: ipa: use version in gsi_channel_program() · ce54993d
      Alex Elder authored
      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: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      ce54993d
    • Alex Elder's avatar
      net: ipa: use version in gsi_channel_reset() · 9de4a4cc
      Alex Elder authored
      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: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      9de4a4cc
    • Alex Elder's avatar
      net: ipa: use version in gsi_channel_init() · 56dfe8de
      Alex Elder authored
      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: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      56dfe8de
    • Alex Elder's avatar
      net: ipa: record IPA version in GSI structure · 14dbf977
      Alex Elder authored
      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: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      14dbf977
    • Alex Elder's avatar
      net: ipa: expose IPA version to the GSI layer · 1d0c09de
      Alex Elder authored
      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: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      1d0c09de
  2. 04 Nov, 2020 32 commits