1. 24 Sep, 2022 4 commits
    • Alex Elder's avatar
      net: ipa: define BCR values using an enum · 21ab2078
      Alex Elder authored
      The backward compatibility register (BCR) has a set of bit flags
      that indicate ways in which the IPA hardware should operate in a
      backward compatible way.  The register is not supported starting
      with IPA v4.5, and where it is supported, defined bits all have the
      same numeric value.
      
      Redefine these flags using an enumerated type, with each member's
      value representing the bit position that encodes it in the BCR.
      This replaces all of the single-bit field masks previously defined.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      21ab2078
    • Alex Elder's avatar
      net: ipa: rearrange functions for similarity · 48395fa8
      Alex Elder authored
      Both aggr_time_limit_encode() and hol_block_timer_encode() figure
      out how to encode a millisecond time value so it can be programmed
      into a register.  Rearranging them a bit can make their similarity
      more obvious, with both taking essentially the same form.
      
      To do this:
        - Return 0 immediately in aggr_time_limit_encode() if the
          microseconds value supplied is zero.
        - Reverse the test at top of aggr_time_limit_encode(), so we
          compute and return the Qtime value in the "true" block,
          and compute the result the old way otherwise.
        - Open-code (and eliminate) hol_block_timer_qtime_encode() at the
          top of hol_block_timer_encode() in the case we use Qtimer.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      48395fa8
    • Alex Elder's avatar
      net: ipa: introduce ipa_qtime_val() · 8be440e1
      Alex Elder authored
      Create a new function ipa_qtime_val() which returns a value that
      indicates what should be encoded for a register with a time field
      expressed using Qtime.  Use it to factor out common code in
      aggr_time_limit_encoded() and hol_block_timer_qtime_val().
      
      Rename aggr_time_limit_encoded() and hol_block_timer_qtime_val() so
      their names are both verbs ending in "encode".  Rename the "limit"
      argument to the former to be "milliseconds" for consistency.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      8be440e1
    • Alex Elder's avatar
      net: ipa: don't use u32p_replace_bits() · a50d37b7
      Alex Elder authored
      In two spots we use u32_replace_bits() to replace a set of bits in a
      register while preserving the rest.  Both of those cases just zero
      the bits being replaced, and this can be done more simply without
      using that function.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a50d37b7
  2. 23 Sep, 2022 36 commits