1 // SPDX-License-Identifier: GPL-2.0
3 /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
4 * Copyright (C) 2019-2020 Linaro Ltd.
7 #include <linux/log2.h>
11 #include "ipa_endpoint.h"
14 /* Endpoint configuration for the SDM845 SoC. */
15 static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = {
16 [IPA_ENDPOINT_AP_COMMAND_TX] = {
27 .seq_type = IPA_SEQ_DMA_ONLY,
31 .dma_endpoint = IPA_ENDPOINT_AP_LAN_RX,
35 [IPA_ENDPOINT_AP_LAN_RX] = {
46 .seq_type = IPA_SEQ_INVALID,
50 .status_enable = true,
52 .pad_align = ilog2(sizeof(u32)),
57 [IPA_ENDPOINT_AP_MODEM_TX] = {
68 .filter_support = true,
70 IPA_SEQ_2ND_PKT_PROCESS_PASS_NO_DEC_UCP,
75 .status_enable = true,
78 IPA_ENDPOINT_MODEM_AP_RX,
83 [IPA_ENDPOINT_AP_MODEM_RX] = {
94 .seq_type = IPA_SEQ_INVALID,
101 .aggr_close_eof = true,
106 [IPA_ENDPOINT_MODEM_COMMAND_TX] = {
107 .ee_id = GSI_EE_MODEM,
112 [IPA_ENDPOINT_MODEM_LAN_TX] = {
113 .ee_id = GSI_EE_MODEM,
118 .filter_support = true,
121 [IPA_ENDPOINT_MODEM_LAN_RX] = {
122 .ee_id = GSI_EE_MODEM,
127 [IPA_ENDPOINT_MODEM_AP_TX] = {
128 .ee_id = GSI_EE_MODEM,
133 .filter_support = true,
136 [IPA_ENDPOINT_MODEM_AP_RX] = {
137 .ee_id = GSI_EE_MODEM,
144 /* For the SDM845, resource groups are allocated this way:
148 static const struct ipa_resource_src ipa_resource_src[] = {
150 .type = IPA_RESOURCE_TYPE_SRC_PKT_CONTEXTS,
161 .type = IPA_RESOURCE_TYPE_SRC_DESCRIPTOR_LISTS,
172 .type = IPA_RESOURCE_TYPE_SRC_DESCRIPTOR_BUFF,
183 .type = IPA_RESOURCE_TYPE_SRC_HPS_DMARS,
194 .type = IPA_RESOURCE_TYPE_SRC_ACK_ENTRIES,
206 static const struct ipa_resource_dst ipa_resource_dst[] = {
208 .type = IPA_RESOURCE_TYPE_DST_DATA_SECTORS,
219 .type = IPA_RESOURCE_TYPE_DST_DPS_DMARS,
231 /* Resource configuration for the SDM845 SoC. */
232 static const struct ipa_resource_data ipa_resource_data = {
233 .resource_src_count = ARRAY_SIZE(ipa_resource_src),
234 .resource_src = ipa_resource_src,
235 .resource_dst_count = ARRAY_SIZE(ipa_resource_dst),
236 .resource_dst = ipa_resource_dst,
239 /* IPA-resident memory region configuration for the SDM845 SoC. */
240 static const struct ipa_mem ipa_mem_local_data[] = {
241 [IPA_MEM_UC_SHARED] = {
246 [IPA_MEM_UC_INFO] = {
251 [IPA_MEM_V4_FILTER_HASHED] = {
256 [IPA_MEM_V4_FILTER] = {
261 [IPA_MEM_V6_FILTER_HASHED] = {
266 [IPA_MEM_V6_FILTER] = {
271 [IPA_MEM_V4_ROUTE_HASHED] = {
276 [IPA_MEM_V4_ROUTE] = {
281 [IPA_MEM_V6_ROUTE_HASHED] = {
286 [IPA_MEM_V6_ROUTE] = {
291 [IPA_MEM_MODEM_HEADER] = {
296 [IPA_MEM_AP_HEADER] = {
301 [IPA_MEM_MODEM_PROC_CTX] = {
306 [IPA_MEM_AP_PROC_CTX] = {
316 [IPA_MEM_UC_EVENT_RING] = {
323 static struct ipa_mem_data ipa_mem_data = {
324 .local_count = ARRAY_SIZE(ipa_mem_local_data),
325 .local = ipa_mem_local_data,
326 .imem_addr = 0x146bd000,
327 .imem_size = 0x00002000,
329 .smem_size = 0x00002000,
332 static struct ipa_clock_data ipa_clock_data = {
333 .core_clock_rate = 75 * 1000 * 1000, /* Hz */
334 /* Interconnect rates are in 1000 byte/second units */
336 [IPA_INTERCONNECT_MEMORY] = {
337 .peak_rate = 600000, /* 600 MBps */
338 .average_rate = 80000, /* 80 MBps */
340 /* Average rate is unused for the next two interconnects */
341 [IPA_INTERCONNECT_IMEM] = {
342 .peak_rate = 350000, /* 350 MBps */
343 .average_rate = 0, /* unused */
345 [IPA_INTERCONNECT_CONFIG] = {
346 .peak_rate = 40000, /* 40 MBps */
347 .average_rate = 0, /* unused */
352 /* Configuration data for the SDM845 SoC. */
353 const struct ipa_data ipa_data_sdm845 = {
354 .version = IPA_VERSION_3_5_1,
355 .endpoint_count = ARRAY_SIZE(ipa_gsi_endpoint_data),
356 .endpoint_data = ipa_gsi_endpoint_data,
357 .resource_data = &ipa_resource_data,
358 .mem_data = &ipa_mem_data,
359 .clock_data = &ipa_clock_data,