1 // SPDX-License-Identifier: GPL-2.0
3 /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
4 * Copyright (C) 2019-2021 Linaro Ltd.
7 #include <linux/log2.h>
11 #include "ipa_endpoint.h"
14 /* Resource groups used for the SDM845 SoC */
15 enum ipa_rsrc_group_id {
16 /* Source resource group identifiers */
17 IPA_RSRC_GROUP_SRC_LWA_DL = 0,
18 IPA_RSRC_GROUP_SRC_UL_DL,
19 IPA_RSRC_GROUP_SRC_MHI_DMA,
20 IPA_RSRC_GROUP_SRC_UC_RX_Q,
22 /* Destination resource group identifiers */
23 IPA_RSRC_GROUP_DST_LWA_DL = 0,
24 IPA_RSRC_GROUP_DST_UL_DL_DPL,
25 IPA_RSRC_GROUP_DST_UNUSED_2,
28 /* QSB configuration for the SDM845 SoC. */
29 static const struct ipa_qsb_data ipa_qsb_data[] = {
30 [IPA_QSB_MASTER_DDR] = {
34 [IPA_QSB_MASTER_PCIE] = {
40 /* Endpoint configuration for the SDM845 SoC. */
41 static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = {
42 [IPA_ENDPOINT_AP_COMMAND_TX] = {
54 .resource_group = IPA_RSRC_GROUP_SRC_UL_DL,
56 .dma_endpoint = IPA_ENDPOINT_AP_LAN_RX,
58 .seq_type = IPA_SEQ_DMA,
63 [IPA_ENDPOINT_AP_LAN_RX] = {
75 .resource_group = IPA_RSRC_GROUP_DST_UL_DL_DPL,
77 .status_enable = true,
79 .pad_align = ilog2(sizeof(u32)),
84 [IPA_ENDPOINT_AP_MODEM_TX] = {
95 .filter_support = true,
97 .resource_group = IPA_RSRC_GROUP_SRC_UL_DL,
100 .status_enable = true,
102 .seq_type = IPA_SEQ_2_PASS_SKIP_LAST_UC,
104 IPA_ENDPOINT_MODEM_AP_RX,
109 [IPA_ENDPOINT_AP_MODEM_RX] = {
121 .resource_group = IPA_RSRC_GROUP_DST_UL_DL_DPL,
126 .aggr_close_eof = true,
131 [IPA_ENDPOINT_MODEM_COMMAND_TX] = {
132 .ee_id = GSI_EE_MODEM,
137 [IPA_ENDPOINT_MODEM_LAN_TX] = {
138 .ee_id = GSI_EE_MODEM,
143 .filter_support = true,
146 [IPA_ENDPOINT_MODEM_LAN_RX] = {
147 .ee_id = GSI_EE_MODEM,
152 [IPA_ENDPOINT_MODEM_AP_TX] = {
153 .ee_id = GSI_EE_MODEM,
158 .filter_support = true,
161 [IPA_ENDPOINT_MODEM_AP_RX] = {
162 .ee_id = GSI_EE_MODEM,
169 /* Source resource configuration data for the SDM845 SoC */
170 static const struct ipa_resource_src ipa_resource_src[] = {
172 .type = IPA_RESOURCE_TYPE_SRC_PKT_CONTEXTS,
173 .limits[IPA_RSRC_GROUP_SRC_LWA_DL] = {
177 .limits[IPA_RSRC_GROUP_SRC_UL_DL] = {
183 .type = IPA_RESOURCE_TYPE_SRC_DESCRIPTOR_LISTS,
184 .limits[IPA_RSRC_GROUP_SRC_LWA_DL] = {
188 .limits[IPA_RSRC_GROUP_SRC_UL_DL] = {
194 .type = IPA_RESOURCE_TYPE_SRC_DESCRIPTOR_BUFF,
195 .limits[IPA_RSRC_GROUP_SRC_LWA_DL] = {
199 .limits[IPA_RSRC_GROUP_SRC_UL_DL] = {
205 .type = IPA_RESOURCE_TYPE_SRC_HPS_DMARS,
206 .limits[IPA_RSRC_GROUP_SRC_LWA_DL] = {
210 .limits[IPA_RSRC_GROUP_SRC_UL_DL] = {
216 .type = IPA_RESOURCE_TYPE_SRC_ACK_ENTRIES,
217 .limits[IPA_RSRC_GROUP_SRC_LWA_DL] = {
221 .limits[IPA_RSRC_GROUP_SRC_UL_DL] = {
228 /* Destination resource configuration data for the SDM845 SoC */
229 static const struct ipa_resource_dst ipa_resource_dst[] = {
231 .type = IPA_RESOURCE_TYPE_DST_DATA_SECTORS,
232 .limits[IPA_RSRC_GROUP_DST_LWA_DL] = {
242 .type = IPA_RESOURCE_TYPE_DST_DPS_DMARS,
243 .limits[IPA_RSRC_GROUP_DST_LWA_DL] = {
247 .limits[IPA_RSRC_GROUP_DST_UL_DL_DPL] = {
254 /* Resource configuration for the SDM845 SoC. */
255 static const struct ipa_resource_data ipa_resource_data = {
256 .resource_src_count = ARRAY_SIZE(ipa_resource_src),
257 .resource_src = ipa_resource_src,
258 .resource_dst_count = ARRAY_SIZE(ipa_resource_dst),
259 .resource_dst = ipa_resource_dst,
262 /* IPA-resident memory region configuration for the SDM845 SoC. */
263 static const struct ipa_mem ipa_mem_local_data[] = {
264 [IPA_MEM_UC_SHARED] = {
269 [IPA_MEM_UC_INFO] = {
274 [IPA_MEM_V4_FILTER_HASHED] = {
279 [IPA_MEM_V4_FILTER] = {
284 [IPA_MEM_V6_FILTER_HASHED] = {
289 [IPA_MEM_V6_FILTER] = {
294 [IPA_MEM_V4_ROUTE_HASHED] = {
299 [IPA_MEM_V4_ROUTE] = {
304 [IPA_MEM_V6_ROUTE_HASHED] = {
309 [IPA_MEM_V6_ROUTE] = {
314 [IPA_MEM_MODEM_HEADER] = {
319 [IPA_MEM_MODEM_PROC_CTX] = {
324 [IPA_MEM_AP_PROC_CTX] = {
334 [IPA_MEM_UC_EVENT_RING] = {
341 static const struct ipa_mem_data ipa_mem_data = {
342 .local_count = ARRAY_SIZE(ipa_mem_local_data),
343 .local = ipa_mem_local_data,
344 .imem_addr = 0x146bd000,
345 .imem_size = 0x00002000,
347 .smem_size = 0x00002000,
350 /* Interconnect bandwidths are in 1000 byte/second units */
351 static const struct ipa_interconnect_data ipa_interconnect_data[] = {
354 .peak_bandwidth = 600000, /* 600 MBps */
355 .average_bandwidth = 80000, /* 80 MBps */
357 /* Average bandwidth is unused for the next two interconnects */
360 .peak_bandwidth = 350000, /* 350 MBps */
361 .average_bandwidth = 0, /* unused */
365 .peak_bandwidth = 40000, /* 40 MBps */
366 .average_bandwidth = 0, /* unused */
370 static const struct ipa_clock_data ipa_clock_data = {
371 .core_clock_rate = 75 * 1000 * 1000, /* Hz */
372 .interconnect_count = ARRAY_SIZE(ipa_interconnect_data),
373 .interconnect_data = ipa_interconnect_data,
376 /* Configuration data for the SDM845 SoC. */
377 const struct ipa_data ipa_data_sdm845 = {
378 .version = IPA_VERSION_3_5_1,
379 .qsb_count = ARRAY_SIZE(ipa_qsb_data),
380 .qsb_data = ipa_qsb_data,
381 .endpoint_count = ARRAY_SIZE(ipa_gsi_endpoint_data),
382 .endpoint_data = ipa_gsi_endpoint_data,
383 .resource_data = &ipa_resource_data,
384 .mem_data = &ipa_mem_data,
385 .clock_data = &ipa_clock_data,