1 // SPDX-License-Identifier: GPL-2.0
3 /* Copyright (C) 2019-2020 Linaro Ltd. */
5 #include <linux/log2.h>
9 #include "ipa_endpoint.h"
12 /* Endpoint configuration for the SC7180 SoC. */
13 static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = {
14 [IPA_ENDPOINT_AP_COMMAND_TX] = {
25 .seq_type = IPA_SEQ_DMA_ONLY,
28 .dma_endpoint = IPA_ENDPOINT_AP_LAN_RX,
32 [IPA_ENDPOINT_AP_LAN_RX] = {
43 .seq_type = IPA_SEQ_INVALID,
46 .status_enable = true,
48 .pad_align = ilog2(sizeof(u32)),
53 [IPA_ENDPOINT_AP_MODEM_TX] = {
64 .filter_support = true,
66 IPA_SEQ_PKT_PROCESS_NO_DEC_NO_UCP_DMAP,
70 .status_enable = true,
73 IPA_ENDPOINT_MODEM_AP_RX,
78 [IPA_ENDPOINT_AP_MODEM_RX] = {
89 .seq_type = IPA_SEQ_INVALID,
95 .aggr_close_eof = true,
100 [IPA_ENDPOINT_MODEM_COMMAND_TX] = {
101 .ee_id = GSI_EE_MODEM,
106 [IPA_ENDPOINT_MODEM_LAN_RX] = {
107 .ee_id = GSI_EE_MODEM,
112 [IPA_ENDPOINT_MODEM_AP_TX] = {
113 .ee_id = GSI_EE_MODEM,
118 .filter_support = true,
121 [IPA_ENDPOINT_MODEM_AP_RX] = {
122 .ee_id = GSI_EE_MODEM,
129 /* For the SC7180, resource groups are allocated this way:
132 static const struct ipa_resource_src ipa_resource_src[] = {
134 .type = IPA_RESOURCE_TYPE_SRC_PKT_CONTEXTS,
141 .type = IPA_RESOURCE_TYPE_SRC_DESCRIPTOR_LISTS,
148 .type = IPA_RESOURCE_TYPE_SRC_DESCRIPTOR_BUFF,
155 .type = IPA_RESOURCE_TYPE_SRC_HPS_DMARS,
162 .type = IPA_RESOURCE_TYPE_SRC_ACK_ENTRIES,
170 static const struct ipa_resource_dst ipa_resource_dst[] = {
172 .type = IPA_RESOURCE_TYPE_DST_DATA_SECTORS,
179 .type = IPA_RESOURCE_TYPE_DST_DPS_DMARS,
187 /* Resource configuration for the SC7180 SoC. */
188 static const struct ipa_resource_data ipa_resource_data = {
189 .resource_src_count = ARRAY_SIZE(ipa_resource_src),
190 .resource_src = ipa_resource_src,
191 .resource_dst_count = ARRAY_SIZE(ipa_resource_dst),
192 .resource_dst = ipa_resource_dst,
195 /* IPA-resident memory region configuration for the SC7180 SoC. */
196 static const struct ipa_mem ipa_mem_data[] = {
197 [IPA_MEM_UC_SHARED] = {
202 [IPA_MEM_UC_INFO] = {
207 [IPA_MEM_V4_FILTER_HASHED] = {
212 [IPA_MEM_V4_FILTER] = {
217 [IPA_MEM_V6_FILTER_HASHED] = {
222 [IPA_MEM_V6_FILTER] = {
227 [IPA_MEM_V4_ROUTE_HASHED] = {
232 [IPA_MEM_V4_ROUTE] = {
237 [IPA_MEM_V6_ROUTE_HASHED] = {
242 [IPA_MEM_V6_ROUTE] = {
247 [IPA_MEM_MODEM_HEADER] = {
252 [IPA_MEM_AP_HEADER] = {
257 [IPA_MEM_MODEM_PROC_CTX] = {
262 [IPA_MEM_AP_PROC_CTX] = {
267 [IPA_MEM_PDN_CONFIG] = {
272 [IPA_MEM_STATS_QUOTA] = {
277 [IPA_MEM_STATS_TETHERING] = {
282 [IPA_MEM_STATS_DROP] = {
292 [IPA_MEM_UC_EVENT_RING] = {
299 /* Configuration data for the SC7180 SoC. */
300 const struct ipa_data ipa_data_sc7180 = {
301 .version = IPA_VERSION_4_2,
302 .endpoint_count = ARRAY_SIZE(ipa_gsi_endpoint_data),
303 .endpoint_data = ipa_gsi_endpoint_data,
304 .resource_data = &ipa_resource_data,
305 .mem_count = ARRAY_SIZE(ipa_mem_data),
306 .mem_data = ipa_mem_data,