1. 27 7月, 2021 2 次提交
  2. 22 6月, 2021 2 次提交
  3. 18 6月, 2021 1 次提交
  4. 12 6月, 2021 2 次提交
  5. 17 4月, 2021 1 次提交
    • A
      net: ipa: optionally define firmware name via DT · 9ce062ba
      Alex Elder 提交于
      IPA initialization includes loading some firmware.  This step is
      done either by the modem or by the AP under Trust Zone.  If the
      AP loads firmware, the name of the firmware file is currently
      hard-coded ("ipa_fws.mdt").
      
      Add the ability to specify the relative path of the firmware file to
      use in a property in the Device Tree IPA node.  If the property is
      not found (or if any other error occurs attempting to get it), fall
      back to using a default relative path.
      
      Use the "old" fixed name as the default.  Rename the symbol that
      represents this default to emphasize its purpose.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9ce062ba
  6. 14 4月, 2021 1 次提交
  7. 12 4月, 2021 2 次提交
  8. 10 4月, 2021 1 次提交
    • A
      net: ipa: get rid of empty IPA functions · 74858b63
      Alex Elder 提交于
      There are place holder functions in the IPA code that do nothing.
      For the most part these are inverse functions, for example, once the
      routing or filter tables are set up there is no need to perform any
      matching teardown activity at shutdown, or in the case of an error.
      
      These can be safely removed, resulting in some code simplification.
      Add comments in these spots making it explicit that there is no
      inverse.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      74858b63
  9. 29 3月, 2021 3 次提交
  10. 27 3月, 2021 1 次提交
  11. 26 3月, 2021 1 次提交
    • A
      net: ipa: update component config register · cc5199ed
      Alex Elder 提交于
      IPA version 4.9 and later use a different layout of some fields
      found in the COMP_CFG register.
      
      Define arbitration_lock_disable_encoded(), and use it to encode a
      value into the ATOMIC_FETCHER_ARB_LOCK_DIS field based on the IPA
      version.
      
      And define full_flush_rsc_closure_en_encoded() to encode a value
      into the FULL_FLUSH_WAIT_RSC_CLOSE_EN field based on the IPA
      version.
      
      The values of these fields are neither modified nor extracted by
      current code, but this patch makes this possible for all supported
      versions.
      
      Fix a mistaken comment above ipa_hardware_config_comp() intended to
      describe the purpose for the register.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cc5199ed
  12. 25 3月, 2021 2 次提交
    • A
      net: ipa: move ipa_aggr_granularity_val() · 1910494e
      Alex Elder 提交于
      We only use ipa_aggr_granularity_val() inside "ipa_main.c", so it
      doesn't really need to be defined in a header file.  It makes some
      sense to be grouped with the register definitions, but it is unlike
      the other inline functions now defined in "ipa_reg.h".  So move it
      into "ipa_main.c" where it's used.  TIMER_FREQUENCY is used only
      by that function, so move that definition as well.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1910494e
    • A
      net: ipa: reduce IPA version assumptions · d7f3087b
      Alex Elder 提交于
      Modify conditional tests throughout the IPA code so they do not
      assume that IPA v3.5.1 is the oldest version supported.  Also remove
      assumptions that IPA v4.5 is the newest version of IPA supported.
      
      Augment versions in comments with "+", to be clearer that the
      comment applies to a version and subsequent versions.  (E.g.,
      "present for IPA v4.2+" instead of just "present for v4.2".)
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d7f3087b
  13. 21 3月, 2021 2 次提交
  14. 19 3月, 2021 1 次提交
    • A
      net: ipa: relax 64-bit build requirement · 99e75a37
      Alex Elder 提交于
      We currently assume the IPA driver is built only for a 64 bit kernel.
      
      When this constraint was put in place it eliminated some do_div()
      calls, replacing them with the "/" and "%" operators.  We now only
      use these operations on u32 and size_t objects.  In a 32-bit kernel
      build, size_t will be 32 bits wide, so there remains no reason to
      use do_div() for divide and modulo.
      
      A few recent commits also fix some code that assumes that DMA
      addresses are 64 bits wide.
      
      With that, we can get rid of the 64-bit build requirement.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      99e75a37
  15. 16 2月, 2021 1 次提交
    • A
      net: ipa: initialize all resources · 25c5a7e8
      Alex Elder 提交于
      We configure the minimum and maximum number of various types of IPA
      resources in ipa_resource_config().  It iterates over resource types
      in the configuration data and assigns resource limits to each
      resource group for each type.
      
      Unfortunately, we are repeatedly initializing the resource data for
      the first type, rather than initializing each of the types whose
      limits are specified.
      
      Fix this bug.
      
      Fixes: 4a0d7579 ("net: ipa: avoid going past end of resource group array")
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      25c5a7e8
  16. 29 1月, 2021 1 次提交
    • A
      net: ipa: signal when tag transfer completes · 51c48ce2
      Alex Elder 提交于
      There are times, such as when the modem crashes, when we issue
      commands to clear the IPA hardware pipeline.  These commands include
      a data transfer command that delivers a small packet directly to the
      default (AP<-LAN RX) endpoint.
      
      The places that do this wait for the transactions that contain these
      commands to complete, but the pipeline can't be assumed clear until
      the sent packet has been *received*.
      
      The small transfer will be delivered with a status structure, and
      that status will indicate its tag is valid.  This is the only place
      we send a tagged packet, so we use the tag to determine when the
      pipeline clear packet has arrived.
      
      Add a completion to the IPA structure to to be used to signal
      the receipt of a pipeline clear packet.  Create a new function
      ipa_cmd_pipeline_clear_wait() that will wait for that completion.
      
      Reinitialize the completion whenever pipeline clear commands are
      added to a transaction.  Extend ipa_endpoint_status_tag() to check
      whether a packet whose status contains a valid tag was sent from the
      AP->command TX endpoint, and if so, signal the new IPA completion.
      
      Have all callers of ipa_cmd_pipeline_clear_add() wait for the
      pipeline clear indication after the transaction that clears the
      pipeline has completed.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Acked-by: NWillem de Bruijn <willemb@google.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      51c48ce2
  17. 22 1月, 2021 1 次提交
    • A
      net: ipa: remove a remoteproc dependency · 86fdf1fc
      Alex Elder 提交于
      The IPA driver currently requires a DT property to be defined whose
      value is the phandle for the modem subsystem.  This was needed to
      look up a remoteproc structure pointer used when registering for
      notifications in the original IPA notification mechanism.
      
      Remoteproc provides a more generic SSR notifier system, and the IPA
      driver switched over to it last summer, but this remoteproc phandle
      dependency was not removed at that time.
      
      Get rid of the IPA remoteproc pointer and stop requiring the phandle
      be specified.
      
      This avoids a link error (rproc_put() not defined) for certain
      configurations.
      Reported-by: NRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      86fdf1fc
  18. 03 12月, 2020 1 次提交
  19. 02 12月, 2020 1 次提交
    • A
      net: ipa: set up IPA v4.5 Qtime configuration · 36426411
      Alex Elder 提交于
      IPA v4.5 introduces a new unified timer architecture driven on the
      19.2 MHz SoC crystal oscillator (XO).  It is independent of the IPA
      core clock and avoids some duplication.
      
      Lower-resolution time stamps are derived from this by using only the
      high-order bits of the 19.2 MHz Qtime clock.  And timers are derived
      from this based on "pulse generators" configured to fire at a fixed
      rate based on the Qtime clock.
      
      This patch introduces ipa_qtime_config(), which configures the Qtime
      mechanism for use.  It also adds to the IPA register definitions
      related to timers and time stamping.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      36426411
  20. 29 11月, 2020 2 次提交
    • A
      net: ipa: add support to code for IPA v4.5 · 8bfc4e21
      Alex Elder 提交于
      Update the IPA code to make use of the updated IPA v4.5 register
      definitions.  Generally what this patch does is, if IPA v4.5
      hardware is in use:
        - Ensure new registers or fields in IPA v4.5 are updated where
          required
        - Ensure registers or fields not supported in IPA v4.5 are not
          examined when read, or are set to 0 when written
      It does this while preserving the existing functionality for IPA
      versions lower than v4.5.
      
      The values to program for QSB_MAX_READS and QSB_MAX_WRITES and the
      source and destination resource counts are updated to be correct for
      all versions through v4.5 as well.
      
      Note that IPA_RESOURCE_GROUP_SRC_MAX and IPA_RESOURCE_GROUP_DST_MAX
      already reflect that 5 is an acceptable number of resources (which
      IPA v4.5 implements).
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      8bfc4e21
    • A
      net: ipa: update IPA registers for IPA v4.5 · 5b6cd69e
      Alex Elder 提交于
      Update "ipa_reg.h" so that register definitions support IPA hardware
      version 4.5, in addition to versions 3.5.1 through v4.2.  Most of
      the register definitions are the same, but in some cases fields are
      added, changed, or eliminated.
      
      Updates for a few IPA v4.5 registers are more complex, and adding
      those definition will be deferred to separate patches.  This patch
      only updates the register offset and field definitions, and adds
      informational comments.
      
      The only code change avoids accessing the backward compatibility
      register for IPA version 4.5 in ipa_hardware_config().  Other IPA
      v4.5-specific code changes will come later.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      5b6cd69e
  21. 21 11月, 2020 3 次提交
    • A
      net: ipa: add driver shutdown callback · ae1d72f9
      Alex Elder 提交于
      A system shutdown can happen at essentially any time, and it's
      possible that the IPA driver is busy when a shutdown is underway.
      IPA hardware accesses IMEM and SMEM memory regions using an IOMMU,
      and at some point during shutdown, needed I/O mappings could become
      invalid.  This could be disastrous for any "in flight" IPA activity.
      
      Avoid this by defining a new driver shutdown callback that stops all
      IPA activity and cleanly shuts down the driver.  It merely calls the
      driver's existing remove callback, reporting the error if it returns
      one.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      ae1d72f9
    • A
      net: ipa: retry modem stop if busy · 7c80e838
      Alex Elder 提交于
      The IPA driver remove callback, ipa_remove(), calls ipa_modem_stop()
      if the setup stage of initialization is complete.  If a concurrent
      call to ipa_modem_start() or ipa_modem_stop() has begin but not
      completed, ipa_modem_stop() can return an error (-EBUSY).
      
      The next patch adds a driver shutdown callback, which will simply
      call ipa_remove().  We really want our shutdown callback to clean
      things up.  So add a single retry to the ipa_modem_stop() call in
      ipa_remove() after a short (millisecond) delay.  This offers no
      guarantee the shutdown will complete successfully, but we'll at
      least try a little harder before giving up.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      7c80e838
    • A
      net: ipa: define clock and interconnect data · dfccb8b1
      Alex Elder 提交于
      Define a new type of configuration data, used to initialize the
      IPA core clock and interconnects.  This is the first of three
      patches, and defines the data types and interface but doesn't
      yet use them.
      
      Switch the return value if there is no matching configuration data
      to ENODEV instead of ENOTSUPP (to avoid using the nonstandard errno).
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      dfccb8b1
  22. 19 11月, 2020 2 次提交
  23. 12 11月, 2020 2 次提交
    • A
      net: ipa: get rid of a useless line of code · 49e3aeeb
      Alex Elder 提交于
      Delete a spurious line of code in ipa_hardware_config().  It reads a
      register value then ignores the value, so is completely unnecessary.
      
      Add a missing word in a comment.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      49e3aeeb
    • A
      net: ipa: don't break build on large transaction size · 5b8b2262
      Alex Elder 提交于
      The following call in ipa_validate_build() is erroneous:
      
          BUILD_BUG_ON(sizeof(struct gsi_trans) > 128);
      
      The fact is, it is not a bug for the size of a GSI transaction to be
      bigger than 128 bytes.  The correct operation of the driver is not
      dependent on the size of this structure.  The only consequence of
      the transaction being large is that the amount of memory required
      is larger.
      
      The problem this was trying to flag is that a *slight* increase in
      the size of this structure will have a disproportionate effect on
      the amount of memory used.  E.g. if the structure grew to 132 bytes
      the memory requirement for the transaction arrays would be about
      double.
      
      With various debugging build flags enabled, the size grows to 160
      bytes.  But there's no reason to treat that as a build-time bug.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      5b8b2262
  24. 05 11月, 2020 2 次提交
    • 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: 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
  25. 31 10月, 2020 2 次提交
    • A
      net: ipa: avoid going past end of resource group array · 4a0d7579
      Alex Elder 提交于
      The minimum and maximum limits for resources assigned to a given
      resource group are programmed in pairs, with the limits for two
      groups set in a single register.
      
      If the number of supported resource groups is odd, only half of the
      register that defines these limits is valid for the last group; that
      group has no second group in the pair.
      
      Currently we ignore this constraint, and it turns out to be harmless,
      but it is not guaranteed to be.  This patch addresses that, and adds
      support for programming the 5th resource group's limits.
      
      Rework how the resource group limit registers are programmed by
      having a single function program all group pairs rather than having
      one function program each pair.  Add the programming of the 4-5
      resource group pair limits to this function.  If a resource group is
      not supported, pass a null pointer to ipa_resource_config_common()
      for that group and have that function write zeroes in that case.
      Tested-by: NSujit Kautkar <sujitka@chromium.org>
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Acked-by: NWillem de Bruijn <willemb@google.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      4a0d7579
    • A
      net: ipa: distinguish between resource group types · 8c365f74
      Alex Elder 提交于
      The number of resource groups supported by the hardware can be
      different for source and destination resources.  Determine the
      number supported for each using separate functions.  Make the
      functions inline end move their definitions into "ipa_reg.h",
      because they determine whether certain register definitions are
      valid.  Pass just the IPA hardware version as argument.
      
      IPA_RESOURCE_GROUP_COUNT represents the maximum number of resource
      groups the driver supports for any hardware version.  Change that
      symbol to be two separate constants, one for source and the other
      for destination resource groups.  Rename them to end with "_MAX"
      rather than "_COUNT", to reflect their true purpose.
      Tested-by: NSujit Kautkar <sujitka@chromium.org>
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      8c365f74