net: ipa: update configuration data
Subsystems (3)
cover net: ipa: update configuration data
Each IPA version has a "data" file defining how various things are configured. This series gathers a few updates to this information:
- The first patch makes all configuration data constant
- The second fixes an incorrect (but seemingly harmless) value
- The third simplifies things a bit by using implicit zero initialization for memory regions that are empty
- The fourth adds definitions for memory regions that exist but are not yet used
- The fifth use configuration data rather than conditional code to set some bus parameters
-Alex
Alex Elder (5):
net: ipa: make all configuration data constant
net: ipa: fix canary count for SC7180 UC_INFO region
net: ipa: don't define empty memory regions
net: ipa: define some new memory regions
net: ipa: define QSB limits in configuration data
drivers/net/ipa/ipa_data-sc7180.c | 30 +++++++++++++++--------------- drivers/net/ipa/ipa_data-sdm845.c | 25 +++++++++++++++++-------- drivers/net/ipa/ipa_data.h | 24 ++++++++++++++++++++++-- drivers/net/ipa/ipa_mem.h | 10 +++++++++- drivers/net/ipa/ipa_qmi.c | 2 +- 5 files changed, 64 insertions(+), 27 deletions(-)
Signature · 1 line
2.27.0
PATCH 1/5 net: ipa: make all configuration data constant
All of the platform configuration data should be constant, but that isn't the case for the memory regions, interconnects, and clocks. Fix this.
--- drivers/net/ipa/ipa_data-sc7180.c | 6 +++--- drivers/net/ipa/ipa_data-sdm845.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/net/ipa/ipa_data-sc7180.c +3 -3
@@ -300,7 +300,7 @@ static const struct ipa_mem ipa_mem_local_data[] = { }, }; -static struct ipa_mem_data ipa_mem_data = { +static const struct ipa_mem_data ipa_mem_data = { .local_count =ARRAY_SIZE (ipa_mem_local_data), .local = ipa_mem_local_data, .imem_addr =0x146a8000 ,
@@ -310,7 +310,7 @@ static struct ipa_mem_data ipa_mem_data = { };/* Interconnect bandwidths are in 1000 byte/second units */ -static struct ipa_interconnect_data ipa_interconnect_data[] = { +static const struct ipa_interconnect_data ipa_interconnect_data[] = { { .name ="memory" , .peak_bandwidth =465000 ,/* 465 MBps */
@@ -329,7 +329,7 @@ static struct ipa_interconnect_data ipa_interconnect_data[] = { }, }; -static struct ipa_clock_data ipa_clock_data = { +static const struct ipa_clock_data ipa_clock_data = { .core_clock_rate =100 *1000 *1000 ,/* Hz */ .interconnect_count =ARRAY_SIZE (ipa_interconnect_data), .interconnect_data = ipa_interconnect_data,
drivers/net/ipa/ipa_data-sdm845.c +3 -3
@@ -320,7 +320,7 @@ static const struct ipa_mem ipa_mem_local_data[] = { }, }; -static struct ipa_mem_data ipa_mem_data = { +static const struct ipa_mem_data ipa_mem_data = { .local_count =ARRAY_SIZE (ipa_mem_local_data), .local = ipa_mem_local_data, .imem_addr =0x146bd000 ,
@@ -330,7 +330,7 @@ static struct ipa_mem_data ipa_mem_data = { };/* Interconnect bandwidths are in 1000 byte/second units */ -static struct ipa_interconnect_data ipa_interconnect_data[] = { +static const struct ipa_interconnect_data ipa_interconnect_data[] = { { .name ="memory" , .peak_bandwidth =600000 ,/* 600 MBps */
@@ -349,7 +349,7 @@ static struct ipa_interconnect_data ipa_interconnect_data[] = { }, }; -static struct ipa_clock_data ipa_clock_data = { +static const struct ipa_clock_data ipa_clock_data = { .core_clock_rate =75 *1000 *1000 ,/* Hz */ .interconnect_count =ARRAY_SIZE (ipa_interconnect_data), .interconnect_data = ipa_interconnect_data,
Signature · 1 line
2.27.0
PATCH 2/5 net: ipa: fix canary count for SC7180 UC_INFO region
In reply to Alex ElderThere should be no canary values written before the beginning of the UC_INFO memory region. This was correct for SDM845, but somehow was committed with the wrong value for SC7180.
This bug seems to cause no harm, so we'll just correct it without back-porting.
--- drivers/net/ipa/ipa_data-sc7180.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ipa/ipa_data-sc7180.c +1 -1
@@ -206,7 +206,7 @@ static const struct ipa_mem ipa_mem_local_data[] = { [IPA_MEM_UC_INFO] = { .offset = 0x0080, .size = 0x0200, - .canary_count = 2, + .canary_count = 0, }, [IPA_MEM_V4_FILTER_HASHED] = { .offset = 0x0288,
Signature · 1 line
2.27.0
PATCH 3/5 net: ipa: don't define empty memory regions
In reply to Alex ElderThe AP_HEADER memory region for both the SDM845 and SC7180 SoCs has zero size, and has no canaries. Defining an offset for such a zero-length region is not meaningful, so it's better not to define it at all. The size of this region is used in the code, but its value will still be zero because the memory regions are defined in statically initialized memory.
For the SC7180, the STATS_DROP memory region has a zero size and no canaries as well.
These regions are the only place where a zero-sized region is defined despite having no canaries. Remove them.
--- drivers/net/ipa/ipa_data-sc7180.c | 10 ---------- drivers/net/ipa/ipa_data-sdm845.c | 5 ----- 2 files changed, 15 deletions(-)
drivers/net/ipa/ipa_data-sc7180.c +0 -10
@@ -253,11 +253,6 @@ static const struct ipa_mem ipa_mem_local_data[] = { .size = 0x0140, .canary_count = 2, }, - [IPA_MEM_AP_HEADER] = { - .offset = 0x05e8, - .size = 0x0000, - .canary_count = 0, - }, [IPA_MEM_MODEM_PROC_CTX] = { .offset = 0x05f0, .size = 0x0200,
@@ -283,11 +278,6 @@ static const struct ipa_mem ipa_mem_local_data[] = { .size = 0x0140, .canary_count = 0, }, - [IPA_MEM_STATS_DROP] = { - .offset = 0x0bf0, - .size = 0, - .canary_count = 0, - }, [IPA_MEM_MODEM] = { .offset = 0x0bf0, .size = 0x140c,
drivers/net/ipa/ipa_data-sdm845.c +0 -5
@@ -293,11 +293,6 @@ static const struct ipa_mem ipa_mem_local_data[] = { .size = 0x0140, .canary_count = 2, }, - [IPA_MEM_AP_HEADER] = { - .offset = 0x07c8, - .size = 0x0000, - .canary_count = 0, - }, [IPA_MEM_MODEM_PROC_CTX] = { .offset = 0x07d0, .size = 0x0200,
Signature · 1 line
2.27.0
PATCH 4/5 net: ipa: define some new memory regions
In reply to Alex ElderThere are several memory regions that are defined starting with IPA v4.0, but which were not used for the SC7180 SoC (IPA v4.2). Even though they're not used (yet), define them so they are ready to be used for SoCs when they become supported.
There are two QUOTA statistics memory regions, one for the modem and one for the AP. Define distinct names for these regions, and get rid of the definition of IPA_MEM_STATS_QUOTA.
--- drivers/net/ipa/ipa_data-sc7180.c | 2 +- drivers/net/ipa/ipa_mem.h | 10 +++++++++- drivers/net/ipa/ipa_qmi.c | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-)
drivers/net/ipa/ipa_data-sc7180.c +1 -1
@@ -268,7 +268,7 @@ static const struct ipa_mem ipa_mem_local_data[] = { .size = 0x0050, .canary_count = 2, }, - [IPA_MEM_STATS_QUOTA] = { + [IPA_MEM_STATS_QUOTA_MODEM] = { .offset = 0x0a50, .size = 0x0060, .canary_count = 2,
drivers/net/ipa/ipa_mem.h +9 -1
@@ -28,6 +28,7 @@ struct ipa_mem_data;* The set of memory regions is defined in configuration data. They are * subject to these constraints: * - a zero offset and zero size represents and undefined region +* - a region's size does not include space for its "canary" values * - a region's offset is defined to be *past* all "canary" values * - offset must be large enough to account for all canaries * - a region's size may be zero, but may still have canaries
@@ -56,9 +57,16 @@ enum ipa_mem_id {IPA_MEM_AP_HEADER ,/* 0 canaries */ IPA_MEM_MODEM_PROC_CTX ,/* 2 canaries */ IPA_MEM_AP_PROC_CTX ,/* 0 canaries */ +IPA_MEM_NAT_TABLE ,/* 4 canaries (IPA v4.5 and above) */ IPA_MEM_PDN_CONFIG ,/* 2 canaries (IPA v4.0 and above) */ -IPA_MEM_STATS_QUOTA ,/* 2 canaries (IPA v4.0 and above) */ +IPA_MEM_STATS_QUOTA_MODEM ,/* 2 canaries (IPA v4.0 and above) */ +IPA_MEM_STATS_QUOTA_AP ,/* 0 canaries (IPA v4.0 and above) */ IPA_MEM_STATS_TETHERING ,/* 0 canaries (IPA v4.0 and above) */ +IPA_MEM_STATS_V4_FILTER ,/* 0 canaries (IPA v4.0-v4.2) */ +IPA_MEM_STATS_V6_FILTER ,/* 0 canaries (IPA v4.0-v4.2) */ +IPA_MEM_STATS_V4_ROUTE ,/* 0 canaries (IPA v4.0-v4.2) */ +IPA_MEM_STATS_V6_ROUTE ,/* 0 canaries (IPA v4.0-v4.2) */ +IPA_MEM_STATS_FILTER_ROUTE ,/* 0 canaries (IPA v4.5 and above) */ IPA_MEM_STATS_DROP ,/* 0 canaries (IPA v4.0 and above) */ IPA_MEM_MODEM ,/* 0 canaries */ IPA_MEM_UC_EVENT_RING, /* 1 canary */
drivers/net/ipa/ipa_qmi.c +1 -1
@@ -378,7 +378,7 @@ init_modem_driver_req(struct ipa_qmi *ipa_qmi)/* None of the stats fields are valid (IPA v4.0 and above) */ if (ipa->version !=IPA_VERSION_3_5_1 ) { - mem = &ipa->mem[IPA_MEM_STATS_QUOTA ]; + mem = &ipa->mem[IPA_MEM_STATS_QUOTA_MODEM ];if (mem->size) { req.hw_stats_quota_base_addr_valid =1 ; req.hw_stats_quota_base_addr =
Signature · 1 line
2.27.0
PATCH 5/5 net: ipa: define QSB limits in configuration data
In reply to Alex ElderDefine the maximum number of reads and writes to configure for the QSB masters used for IPA in configuration data.
We don't use these values yet; the next commit takes care of that.
--- drivers/net/ipa/ipa_data-sc7180.c | 10 ++++++++++ drivers/net/ipa/ipa_data-sdm845.c | 14 ++++++++++++++ drivers/net/ipa/ipa_data.h | 24 ++++++++++++++++++++++-- 3 files changed, 46 insertions(+), 2 deletions(-)
drivers/net/ipa/ipa_data-sc7180.c +10 -0
@@ -9,6 +9,14 @@#include "ipa_endpoint.h" #include "ipa_mem.h" +/* QSB configuration for the SC7180 SoC. */ +static const struct ipa_qsb_data ipa_qsb_data[] = { + [IPA_QSB_MASTER_DDR ] = { + .max_writes =8 , + .max_reads =12 , + }, +}; +/* Endpoint configuration for the SC7180 SoC. */ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = { [IPA_ENDPOINT_AP_COMMAND_TX ] = {
@@ -328,6 +336,8 @@ static const struct ipa_clock_data ipa_clock_data = {/* Configuration data for the SC7180 SoC. */ const struct ipa_data ipa_data_sc7180 = { .version =IPA_VERSION_4_2 , + .qsb_count =ARRAY_SIZE (ipa_qsb_data), + .qsb_data = ipa_qsb_data, .endpoint_count =ARRAY_SIZE (ipa_gsi_endpoint_data), .endpoint_data = ipa_gsi_endpoint_data, .resource_data = &ipa_resource_data,
drivers/net/ipa/ipa_data-sdm845.c +14 -0
@@ -11,6 +11,18 @@#include "ipa_endpoint.h" #include "ipa_mem.h" +/* QSB configuration for the SDM845 SoC. */ +static const struct ipa_qsb_data ipa_qsb_data[] = { + [IPA_QSB_MASTER_DDR ] = { + .max_writes =8 , + .max_reads =8 , + }, + [IPA_QSB_MASTER_PCIE ] = { + .max_writes =4 , + .max_reads =12 , + }, +}; +/* Endpoint configuration for the SDM845 SoC. */ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = { [IPA_ENDPOINT_AP_COMMAND_TX ] = {
@@ -353,6 +365,8 @@ static const struct ipa_clock_data ipa_clock_data = {/* Configuration data for the SDM845 SoC. */ const struct ipa_data ipa_data_sdm845 = { .version =IPA_VERSION_3_5_1 , + .qsb_count =ARRAY_SIZE (ipa_qsb_data), + .qsb_data = ipa_qsb_data, .endpoint_count =ARRAY_SIZE (ipa_gsi_endpoint_data), .endpoint_data = ipa_gsi_endpoint_data, .resource_data = &ipa_resource_data,
drivers/net/ipa/ipa_data.h +22 -2
@@ -49,6 +49,22 @@#define IPA_RESOURCE_GROUP_SRC_MAX 5#define IPA_RESOURCE_GROUP_DST_MAX 5 +/** enum ipa_qsb_master_id - array index for IPA QSB configuration data */ +enum ipa_qsb_master_id { +IPA_QSB_MASTER_DDR , +IPA_QSB_MASTER_PCIE , +}; + +/** +* struct ipa_qsb_data - Qualcomm System Bus configuration data +* @max_writes: Maximum outstanding write requests for this master +* @max_reads: Maximum outstanding read requests for this master +*/ +struct ipa_qsb_data { +u8 max_writes; +u8 max_reads; +}; +/** * struct gsi_channel_data - GSI channel configuration data * @tre_count: number of TREs in the channel ring
@@ -285,14 +301,18 @@ struct ipa_clock_data {/** * struct ipa_data - combined IPA/GSI configuration data * @version: IPA hardware version -* @endpoint_count: number of entries in endpoint_data array +* @qsb_count: number of entries in the qsb_data array +* @qsb_data: Qualcomm System Bus configuration data +* @endpoint_count: number of entries in the endpoint_data array * @endpoint_data: IPA endpoint/GSI channel data * @resource_data: IPA resource configuration data -* @mem_count: number of entries in mem_data array +* @mem_count: number of entries in the mem_data array * @mem_data: IPA-local shared memory region data */ struct ipa_data {enum ipa_version version; +u32 qsb_count;/* # entries in qsb_data[] */ +const struct ipa_qsb_data *qsb_data;u32 endpoint_count;/* # entries in endpoint_data[] */ const struct ipa_gsi_endpoint_data *endpoint_data;const struct ipa_resource_data *resource_data;
Signature · 1 line
2.27.0
This series was applied to netdev/net-next.git (refs/heads/master):
Hello:
This series was applied to netdev/net-next.git (refs/heads/master):
Quoted 11 lines · On Fri, 19 Mar 2021 10:24:17 -0500 you wrote:
Each IPA version has a "data" file defining how various things are configured. This series gathers a few updates to this information:
- The first patch makes all configuration data constant
- The second fixes an incorrect (but seemingly harmless) value
- The third simplifies things a bit by using implicit zero initialization for memory regions that are empty
- The fourth adds definitions for memory regions that exist but are not yet used
- The fifth use configuration data rather than conditional code to set some bus parameters
Quoted 1 line
[...]
Here is the summary with links:
- [net-next,1/5] net: ipa: make all configuration data constant
https://git.kernel.org/netdev/net-next/c/e4a9f45b0be5 - [net-next,2/5] net: ipa: fix canary count for SC7180 UC_INFO region https://git.kernel.org/netdev/net-next/c/22e3b314302c - [net-next,3/5] net: ipa: don't define empty memory regions https://git.kernel.org/netdev/net-next/c/8f692169b138 - [net-next,4/5] net: ipa: define some new memory regions https://git.kernel.org/netdev/net-next/c/2ef88644e5d4 - [net-next,5/5] net: ipa: define QSB limits in configuration data https://git.kernel.org/netdev/net-next/c/37537fa8e973
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html