linux-stable/drivers/net/ipa
Alex Elder 6bf754c7e6 net: ipa: update IPA aggregation registers for IPA v4.5
IPA v4.5 significantly changes the format of the configuration
register used for endpoint aggregation.  The AGGR_BYTE_LIMIT field
is now larger, and the positions of other fields are shifted.  This
complicates the way we have to access this register because functions
like u32_encode_bits() require their field mask argument to be constant.

A further complication is that we want to know the maximum value
representable by at least one of these fields, and that too requires
a constant field mask.

This patch adds support for IPA v4.5 endpoint aggregation registers
in a way that continues to support "legacy" IPA hardware.  It does
so in a way that keeps field masks constant.

First, for each variable field mask, we define an inline function
whose return value is either the legacy value or the IPA v4.5 value.

Second, we define functions for these fields that encode a value
to use in each field based on the IPA version (this approach is
already used elsewhere).  The field mask provided is supplied by
the function mentioned above.

Finally, for the aggregation byte limit fields where we want to
know the maximum representable value, we define a function that
returns that maximum, computed from the appropriate field mask.

We can no longer verify at build time that our buffer size is
in the range that can be represented by the aggregation byte
limit field.  So remove the test done by a BUILD_BUG_ON() call
in ipa_endpoint_validate_build(), and implement a comparable check
at the top of ipa_endpoint_data_valid().

Doing that makes ipa_endpoint_validate_build() contain a single
line BUILD_BUG_ON() call, so just remove that function and move
the remaining line into ipa_endpoint_data_valid().

One final note:  the aggregation time limit value for IPA v4.5 needs
to be computed differently.  That is handled in an upcoming patch.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2020-12-01 18:05:28 -08:00
..
gsi.c net: ipa: adjust GSI register addresses 2020-11-28 12:13:55 -08:00
gsi.h net: ipa: support retries on generic GSI commands 2020-11-20 18:45:52 -08:00
gsi_private.h net: ipa: fix kerneldoc comments 2020-07-13 17:11:53 -07:00
gsi_reg.h net: ipa: adjust GSI register addresses 2020-11-28 12:13:55 -08:00
gsi_trans.c net: ipa: lock when freeing transaction 2020-11-16 17:32:22 -08:00
gsi_trans.h net: ipa: fix kerneldoc comments 2020-07-13 17:11:53 -07:00
ipa.h net: ipa: repurpose CLOCK_HELD flag 2020-09-18 17:47:07 -07:00
ipa_clock.c net: ipa: use config data for clocking 2020-11-20 18:45:00 -08:00
ipa_clock.h net: ipa: define clock and interconnect data 2020-11-20 18:44:59 -08:00
ipa_cmd.c net: ipa: define enumerated types consistently 2020-11-18 15:53:48 -08:00
ipa_cmd.h net: ipa: define enumerated types consistently 2020-11-18 15:53:48 -08:00
ipa_data-sc7180.c net: ipa: populate clock and interconnect data 2020-11-20 18:45:00 -08:00
ipa_data-sdm845.c net: ipa: populate clock and interconnect data 2020-11-20 18:45:00 -08:00
ipa_data.h net: ipa: define clock and interconnect data 2020-11-20 18:44:59 -08:00
ipa_endpoint.c net: ipa: update IPA aggregation registers for IPA v4.5 2020-12-01 18:05:28 -08:00
ipa_endpoint.h net: ipa: define enumerated types consistently 2020-11-18 15:53:48 -08:00
ipa_gsi.c net: ipa: include declarations in "ipa_gsi.c" 2020-07-07 12:43:18 -07:00
ipa_gsi.h net: ipa: fix kerneldoc comments 2020-07-13 17:11:53 -07:00
ipa_interrupt.c net: ipa: fix two inconsistent IPA register names 2020-11-18 15:53:48 -08:00
ipa_interrupt.h net: ipa: move definition of enum ipa_irq_id 2020-11-18 15:53:49 -08:00
ipa_main.c net: ipa: add support to code for IPA v4.5 2020-11-28 12:13:55 -08:00
ipa_mem.c net: ipa: change a warning to debug 2020-11-11 14:07:00 -08:00
ipa_mem.h net: ipa: redefine struct ipa_mem_data 2020-05-04 11:26:55 -07:00
ipa_modem.c net: ipa: new notification infrastructure 2020-07-28 17:10:47 -07:00
ipa_modem.h soc: qcom: ipa: modem and microcontroller 2020-03-08 22:07:10 -07:00
ipa_qmi.c soc: qcom: ipa: Constify static qmi structs 2020-11-25 13:54:41 -08:00
ipa_qmi.h soc: qcom: ipa: AP/modem communications 2020-03-08 22:07:10 -07:00
ipa_qmi_msg.c net: ipa: fix QMI structure definition bugs 2020-07-07 12:43:18 -07:00
ipa_qmi_msg.h net: ipa: define enumerated types consistently 2020-11-18 15:53:48 -08:00
ipa_reg.c
ipa_reg.h net: ipa: update IPA aggregation registers for IPA v4.5 2020-12-01 18:05:28 -08:00
ipa_smp2p.c drivers: ipa: fix typos for ipa_smp2p structure doc 2020-05-14 13:06:55 -07:00
ipa_smp2p.h net: ipa: fix kerneldoc comments 2020-07-13 17:11:53 -07:00
ipa_table.c net: ipa: share field mask values for IPA hash registers 2020-11-18 15:53:48 -08:00
ipa_table.h net: ipa: fix kerneldoc comments 2020-07-13 17:11:53 -07:00
ipa_uc.c net: ipa: a few last IPA register cleanups 2020-11-18 15:53:49 -08:00
ipa_uc.h soc: qcom: ipa: modem and microcontroller 2020-03-08 22:07:10 -07:00
ipa_version.h net: ipa: update IPA registers for IPA v4.5 2020-11-28 12:13:54 -08:00
Kconfig remoteproc: clean up notification config 2020-03-16 17:31:51 -07:00
Makefile soc: qcom: ipa: support build of IPA code 2020-03-08 22:07:10 -07:00