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,
29 .dma_endpoint = IPA_ENDPOINT_AP_LAN_RX,
33 [IPA_ENDPOINT_AP_LAN_RX] = {
44 .seq_type = IPA_SEQ_INVALID,
48 .status_enable = true,
50 .pad_align = ilog2(sizeof(u32)),
55 [IPA_ENDPOINT_AP_MODEM_TX] = {
66 .filter_support = true,
68 IPA_SEQ_PKT_PROCESS_NO_DEC_NO_UCP_DMAP,
73 .status_enable = true,
76 IPA_ENDPOINT_MODEM_AP_RX,
81 [IPA_ENDPOINT_AP_MODEM_RX] = {
92 .seq_type = IPA_SEQ_INVALID,
99 .aggr_close_eof = true,
104 [IPA_ENDPOINT_MODEM_COMMAND_TX] = {
105 .ee_id = GSI_EE_MODEM,
110 [IPA_ENDPOINT_MODEM_LAN_RX] = {
111 .ee_id = GSI_EE_MODEM,
116 [IPA_ENDPOINT_MODEM_AP_TX] = {
117 .ee_id = GSI_EE_MODEM,
122 .filter_support = true,
125 [IPA_ENDPOINT_MODEM_AP_RX] = {
126 .ee_id = GSI_EE_MODEM,
133 /* For the SC7180, resource groups are allocated this way:
136 static const struct ipa_resource_src ipa_resource_src[] = {
138 .type = IPA_RESOURCE_TYPE_SRC_PKT_CONTEXTS,
145 .type = IPA_RESOURCE_TYPE_SRC_DESCRIPTOR_LISTS,
152 .type = IPA_RESOURCE_TYPE_SRC_DESCRIPTOR_BUFF,
159 .type = IPA_RESOURCE_TYPE_SRC_HPS_DMARS,
166 .type = IPA_RESOURCE_TYPE_SRC_ACK_ENTRIES,
174 static const struct ipa_resource_dst ipa_resource_dst[] = {
176 .type = IPA_RESOURCE_TYPE_DST_DATA_SECTORS,
183 .type = IPA_RESOURCE_TYPE_DST_DPS_DMARS,
191 /* Resource configuration for the SC7180 SoC. */
192 static const struct ipa_resource_data ipa_resource_data = {
193 .resource_src_count = ARRAY_SIZE(ipa_resource_src),
194 .resource_src = ipa_resource_src,
195 .resource_dst_count = ARRAY_SIZE(ipa_resource_dst),
196 .resource_dst = ipa_resource_dst,
199 /* IPA-resident memory region configuration for the SC7180 SoC. */
200 static const struct ipa_mem ipa_mem_local_data[] = {
201 [IPA_MEM_UC_SHARED] = {
206 [IPA_MEM_UC_INFO] = {
211 [IPA_MEM_V4_FILTER_HASHED] = {
216 [IPA_MEM_V4_FILTER] = {
221 [IPA_MEM_V6_FILTER_HASHED] = {
226 [IPA_MEM_V6_FILTER] = {
231 [IPA_MEM_V4_ROUTE_HASHED] = {
236 [IPA_MEM_V4_ROUTE] = {
241 [IPA_MEM_V6_ROUTE_HASHED] = {
246 [IPA_MEM_V6_ROUTE] = {
251 [IPA_MEM_MODEM_HEADER] = {
256 [IPA_MEM_AP_HEADER] = {
261 [IPA_MEM_MODEM_PROC_CTX] = {
266 [IPA_MEM_AP_PROC_CTX] = {
271 [IPA_MEM_PDN_CONFIG] = {
276 [IPA_MEM_STATS_QUOTA] = {
281 [IPA_MEM_STATS_TETHERING] = {
286 [IPA_MEM_STATS_DROP] = {
296 [IPA_MEM_UC_EVENT_RING] = {
303 static struct ipa_mem_data ipa_mem_data = {
304 .local_count = ARRAY_SIZE(ipa_mem_local_data),
305 .local = ipa_mem_local_data,
306 .imem_addr = 0x146a8000,
307 .imem_size = 0x00002000,
309 .smem_size = 0x00002000,
312 static struct ipa_clock_data ipa_clock_data = {
313 .core_clock_rate = 100 * 1000 * 1000, /* Hz */
314 /* Interconnect rates are in 1000 byte/second units */
316 [IPA_INTERCONNECT_MEMORY] = {
317 .peak_rate = 465000, /* 465 MBps */
318 .average_rate = 80000, /* 80 MBps */
320 /* Average rate is unused for the next two interconnects */
321 [IPA_INTERCONNECT_IMEM] = {
322 .peak_rate = 68570, /* 68.570 MBps */
323 .average_rate = 0, /* unused */
325 [IPA_INTERCONNECT_CONFIG] = {
326 .peak_rate = 30000, /* 30 MBps */
327 .average_rate = 0, /* unused */
332 /* Configuration data for the SC7180 SoC. */
333 const struct ipa_data ipa_data_sc7180 = {
334 .version = IPA_VERSION_4_2,
335 .endpoint_count = ARRAY_SIZE(ipa_gsi_endpoint_data),
336 .endpoint_data = ipa_gsi_endpoint_data,
337 .resource_data = &ipa_resource_data,
338 .mem_data = &ipa_mem_data,
339 .clock_data = &ipa_clock_data,