Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | |
| 3 | /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. |
Alex Elder | 47f71d6 | 2021-03-26 10:11:13 -0500 | [diff] [blame] | 4 | * Copyright (C) 2019-2021 Linaro Ltd. |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <linux/log2.h> |
| 8 | |
| 9 | #include "gsi.h" |
| 10 | #include "ipa_data.h" |
| 11 | #include "ipa_endpoint.h" |
| 12 | #include "ipa_mem.h" |
| 13 | |
Alex Elder | fc566da | 2021-03-28 12:31:08 -0500 | [diff] [blame] | 14 | /** enum ipa_resource_type - IPA resource types for an SoC having IPA v3.5.1 */ |
Alex Elder | cf9a10b | 2021-03-26 10:11:17 -0500 | [diff] [blame] | 15 | enum ipa_resource_type { |
| 16 | /* Source resource types; first must have value 0 */ |
| 17 | IPA_RESOURCE_TYPE_SRC_PKT_CONTEXTS = 0, |
| 18 | IPA_RESOURCE_TYPE_SRC_DESCRIPTOR_LISTS, |
| 19 | IPA_RESOURCE_TYPE_SRC_DESCRIPTOR_BUFF, |
| 20 | IPA_RESOURCE_TYPE_SRC_HPS_DMARS, |
| 21 | IPA_RESOURCE_TYPE_SRC_ACK_ENTRIES, |
| 22 | |
| 23 | /* Destination resource types; first must have value 0 */ |
| 24 | IPA_RESOURCE_TYPE_DST_DATA_SECTORS = 0, |
| 25 | IPA_RESOURCE_TYPE_DST_DPS_DMARS, |
| 26 | }; |
| 27 | |
Alex Elder | fc566da | 2021-03-28 12:31:08 -0500 | [diff] [blame] | 28 | /* Resource groups used for an SoC having IPA v3.5.1 */ |
Alex Elder | 47f71d6 | 2021-03-26 10:11:13 -0500 | [diff] [blame] | 29 | enum ipa_rsrc_group_id { |
| 30 | /* Source resource group identifiers */ |
| 31 | IPA_RSRC_GROUP_SRC_LWA_DL = 0, |
| 32 | IPA_RSRC_GROUP_SRC_UL_DL, |
| 33 | IPA_RSRC_GROUP_SRC_MHI_DMA, |
| 34 | IPA_RSRC_GROUP_SRC_UC_RX_Q, |
Alex Elder | 4fd704b | 2021-03-26 10:11:21 -0500 | [diff] [blame] | 35 | IPA_RSRC_GROUP_SRC_COUNT, /* Last in set; not a source group */ |
Alex Elder | 47f71d6 | 2021-03-26 10:11:13 -0500 | [diff] [blame] | 36 | |
| 37 | /* Destination resource group identifiers */ |
| 38 | IPA_RSRC_GROUP_DST_LWA_DL = 0, |
| 39 | IPA_RSRC_GROUP_DST_UL_DL_DPL, |
| 40 | IPA_RSRC_GROUP_DST_UNUSED_2, |
Alex Elder | 4fd704b | 2021-03-26 10:11:21 -0500 | [diff] [blame] | 41 | IPA_RSRC_GROUP_DST_COUNT, /* Last; not a destination group */ |
Alex Elder | 47f71d6 | 2021-03-26 10:11:13 -0500 | [diff] [blame] | 42 | }; |
| 43 | |
Alex Elder | fc566da | 2021-03-28 12:31:08 -0500 | [diff] [blame] | 44 | /* QSB configuration data for an SoC having IPA v3.5.1 */ |
Alex Elder | 37537fa | 2021-03-19 10:24:22 -0500 | [diff] [blame] | 45 | static const struct ipa_qsb_data ipa_qsb_data[] = { |
| 46 | [IPA_QSB_MASTER_DDR] = { |
| 47 | .max_writes = 8, |
| 48 | .max_reads = 8, |
| 49 | }, |
| 50 | [IPA_QSB_MASTER_PCIE] = { |
| 51 | .max_writes = 4, |
| 52 | .max_reads = 12, |
| 53 | }, |
| 54 | }; |
| 55 | |
Alex Elder | fc566da | 2021-03-28 12:31:08 -0500 | [diff] [blame] | 56 | /* Endpoint datdata for an SoC having IPA v3.5.1 */ |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 57 | static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = { |
| 58 | [IPA_ENDPOINT_AP_COMMAND_TX] = { |
| 59 | .ee_id = GSI_EE_AP, |
| 60 | .channel_id = 4, |
| 61 | .endpoint_id = 5, |
| 62 | .toward_ipa = true, |
| 63 | .channel = { |
| 64 | .tre_count = 512, |
| 65 | .event_count = 256, |
| 66 | .tlv_count = 20, |
| 67 | }, |
| 68 | .endpoint = { |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 69 | .config = { |
Alex Elder | 47f71d6 | 2021-03-26 10:11:13 -0500 | [diff] [blame] | 70 | .resource_group = IPA_RSRC_GROUP_SRC_UL_DL, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 71 | .dma_mode = true, |
| 72 | .dma_endpoint = IPA_ENDPOINT_AP_LAN_RX, |
Alex Elder | 1690d8a | 2021-03-20 10:57:06 -0500 | [diff] [blame] | 73 | .tx = { |
| 74 | .seq_type = IPA_SEQ_DMA, |
| 75 | }, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 76 | }, |
| 77 | }, |
| 78 | }, |
| 79 | [IPA_ENDPOINT_AP_LAN_RX] = { |
| 80 | .ee_id = GSI_EE_AP, |
| 81 | .channel_id = 5, |
| 82 | .endpoint_id = 9, |
| 83 | .toward_ipa = false, |
| 84 | .channel = { |
| 85 | .tre_count = 256, |
| 86 | .event_count = 256, |
| 87 | .tlv_count = 8, |
| 88 | }, |
| 89 | .endpoint = { |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 90 | .config = { |
Alex Elder | 47f71d6 | 2021-03-26 10:11:13 -0500 | [diff] [blame] | 91 | .resource_group = IPA_RSRC_GROUP_DST_UL_DL_DPL, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 92 | .aggregation = true, |
| 93 | .status_enable = true, |
| 94 | .rx = { |
| 95 | .pad_align = ilog2(sizeof(u32)), |
| 96 | }, |
| 97 | }, |
| 98 | }, |
| 99 | }, |
| 100 | [IPA_ENDPOINT_AP_MODEM_TX] = { |
| 101 | .ee_id = GSI_EE_AP, |
| 102 | .channel_id = 3, |
| 103 | .endpoint_id = 2, |
| 104 | .toward_ipa = true, |
| 105 | .channel = { |
| 106 | .tre_count = 512, |
| 107 | .event_count = 512, |
| 108 | .tlv_count = 16, |
| 109 | }, |
| 110 | .endpoint = { |
| 111 | .filter_support = true, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 112 | .config = { |
Alex Elder | 47f71d6 | 2021-03-26 10:11:13 -0500 | [diff] [blame] | 113 | .resource_group = IPA_RSRC_GROUP_SRC_UL_DL, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 114 | .checksum = true, |
| 115 | .qmap = true, |
| 116 | .status_enable = true, |
| 117 | .tx = { |
Alex Elder | 1690d8a | 2021-03-20 10:57:06 -0500 | [diff] [blame] | 118 | .seq_type = IPA_SEQ_2_PASS_SKIP_LAST_UC, |
Alex Elder | 49e76a4 | 2021-04-09 13:07:17 -0500 | [diff] [blame] | 119 | .seq_rep_type = IPA_SEQ_REP_DMA_PARSER, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 120 | .status_endpoint = |
| 121 | IPA_ENDPOINT_MODEM_AP_RX, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 122 | }, |
| 123 | }, |
| 124 | }, |
| 125 | }, |
| 126 | [IPA_ENDPOINT_AP_MODEM_RX] = { |
| 127 | .ee_id = GSI_EE_AP, |
| 128 | .channel_id = 6, |
| 129 | .endpoint_id = 10, |
| 130 | .toward_ipa = false, |
| 131 | .channel = { |
| 132 | .tre_count = 256, |
| 133 | .event_count = 256, |
| 134 | .tlv_count = 8, |
| 135 | }, |
| 136 | .endpoint = { |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 137 | .config = { |
Alex Elder | 47f71d6 | 2021-03-26 10:11:13 -0500 | [diff] [blame] | 138 | .resource_group = IPA_RSRC_GROUP_DST_UL_DL_DPL, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 139 | .checksum = true, |
| 140 | .qmap = true, |
| 141 | .aggregation = true, |
| 142 | .rx = { |
| 143 | .aggr_close_eof = true, |
| 144 | }, |
| 145 | }, |
| 146 | }, |
| 147 | }, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 148 | [IPA_ENDPOINT_MODEM_LAN_TX] = { |
| 149 | .ee_id = GSI_EE_MODEM, |
| 150 | .channel_id = 0, |
| 151 | .endpoint_id = 3, |
| 152 | .toward_ipa = true, |
| 153 | .endpoint = { |
| 154 | .filter_support = true, |
| 155 | }, |
| 156 | }, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 157 | [IPA_ENDPOINT_MODEM_AP_TX] = { |
| 158 | .ee_id = GSI_EE_MODEM, |
| 159 | .channel_id = 4, |
| 160 | .endpoint_id = 6, |
| 161 | .toward_ipa = true, |
| 162 | .endpoint = { |
| 163 | .filter_support = true, |
| 164 | }, |
| 165 | }, |
| 166 | [IPA_ENDPOINT_MODEM_AP_RX] = { |
| 167 | .ee_id = GSI_EE_MODEM, |
| 168 | .channel_id = 2, |
| 169 | .endpoint_id = 12, |
| 170 | .toward_ipa = false, |
| 171 | }, |
| 172 | }; |
| 173 | |
Alex Elder | fc566da | 2021-03-28 12:31:08 -0500 | [diff] [blame] | 174 | /* Source resource configuration data for an SoC having IPA v3.5.1 */ |
Alex Elder | 7336ce1 | 2021-03-26 10:11:19 -0500 | [diff] [blame] | 175 | static const struct ipa_resource ipa_resource_src[] = { |
Alex Elder | 4bcfb35 | 2021-03-26 10:11:16 -0500 | [diff] [blame] | 176 | [IPA_RESOURCE_TYPE_SRC_PKT_CONTEXTS] = { |
Alex Elder | 47f71d6 | 2021-03-26 10:11:13 -0500 | [diff] [blame] | 177 | .limits[IPA_RSRC_GROUP_SRC_LWA_DL] = { |
Alex Elder | cf9a10b | 2021-03-26 10:11:17 -0500 | [diff] [blame] | 178 | .min = 1, .max = 255, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 179 | }, |
Alex Elder | 47f71d6 | 2021-03-26 10:11:13 -0500 | [diff] [blame] | 180 | .limits[IPA_RSRC_GROUP_SRC_UL_DL] = { |
Alex Elder | cf9a10b | 2021-03-26 10:11:17 -0500 | [diff] [blame] | 181 | .min = 1, .max = 255, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 182 | }, |
Alex Elder | 9ab7e72 | 2021-03-26 10:11:14 -0500 | [diff] [blame] | 183 | .limits[IPA_RSRC_GROUP_SRC_UC_RX_Q] = { |
Alex Elder | cf9a10b | 2021-03-26 10:11:17 -0500 | [diff] [blame] | 184 | .min = 1, .max = 63, |
Alex Elder | 9ab7e72 | 2021-03-26 10:11:14 -0500 | [diff] [blame] | 185 | }, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 186 | }, |
Alex Elder | 4bcfb35 | 2021-03-26 10:11:16 -0500 | [diff] [blame] | 187 | [IPA_RESOURCE_TYPE_SRC_DESCRIPTOR_LISTS] = { |
Alex Elder | 47f71d6 | 2021-03-26 10:11:13 -0500 | [diff] [blame] | 188 | .limits[IPA_RSRC_GROUP_SRC_LWA_DL] = { |
Alex Elder | cf9a10b | 2021-03-26 10:11:17 -0500 | [diff] [blame] | 189 | .min = 10, .max = 10, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 190 | }, |
Alex Elder | 47f71d6 | 2021-03-26 10:11:13 -0500 | [diff] [blame] | 191 | .limits[IPA_RSRC_GROUP_SRC_UL_DL] = { |
Alex Elder | cf9a10b | 2021-03-26 10:11:17 -0500 | [diff] [blame] | 192 | .min = 10, .max = 10, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 193 | }, |
Alex Elder | 9ab7e72 | 2021-03-26 10:11:14 -0500 | [diff] [blame] | 194 | .limits[IPA_RSRC_GROUP_SRC_UC_RX_Q] = { |
Alex Elder | cf9a10b | 2021-03-26 10:11:17 -0500 | [diff] [blame] | 195 | .min = 8, .max = 8, |
Alex Elder | 9ab7e72 | 2021-03-26 10:11:14 -0500 | [diff] [blame] | 196 | }, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 197 | }, |
Alex Elder | 4bcfb35 | 2021-03-26 10:11:16 -0500 | [diff] [blame] | 198 | [IPA_RESOURCE_TYPE_SRC_DESCRIPTOR_BUFF] = { |
Alex Elder | 47f71d6 | 2021-03-26 10:11:13 -0500 | [diff] [blame] | 199 | .limits[IPA_RSRC_GROUP_SRC_LWA_DL] = { |
Alex Elder | cf9a10b | 2021-03-26 10:11:17 -0500 | [diff] [blame] | 200 | .min = 12, .max = 12, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 201 | }, |
Alex Elder | 47f71d6 | 2021-03-26 10:11:13 -0500 | [diff] [blame] | 202 | .limits[IPA_RSRC_GROUP_SRC_UL_DL] = { |
Alex Elder | cf9a10b | 2021-03-26 10:11:17 -0500 | [diff] [blame] | 203 | .min = 14, .max = 14, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 204 | }, |
Alex Elder | 9ab7e72 | 2021-03-26 10:11:14 -0500 | [diff] [blame] | 205 | .limits[IPA_RSRC_GROUP_SRC_UC_RX_Q] = { |
Alex Elder | cf9a10b | 2021-03-26 10:11:17 -0500 | [diff] [blame] | 206 | .min = 8, .max = 8, |
Alex Elder | 9ab7e72 | 2021-03-26 10:11:14 -0500 | [diff] [blame] | 207 | }, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 208 | }, |
Alex Elder | 4bcfb35 | 2021-03-26 10:11:16 -0500 | [diff] [blame] | 209 | [IPA_RESOURCE_TYPE_SRC_HPS_DMARS] = { |
Alex Elder | 47f71d6 | 2021-03-26 10:11:13 -0500 | [diff] [blame] | 210 | .limits[IPA_RSRC_GROUP_SRC_LWA_DL] = { |
Alex Elder | cf9a10b | 2021-03-26 10:11:17 -0500 | [diff] [blame] | 211 | .min = 0, .max = 63, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 212 | }, |
Alex Elder | 47f71d6 | 2021-03-26 10:11:13 -0500 | [diff] [blame] | 213 | .limits[IPA_RSRC_GROUP_SRC_UL_DL] = { |
Alex Elder | cf9a10b | 2021-03-26 10:11:17 -0500 | [diff] [blame] | 214 | .min = 0, .max = 63, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 215 | }, |
Alex Elder | 9ab7e72 | 2021-03-26 10:11:14 -0500 | [diff] [blame] | 216 | .limits[IPA_RSRC_GROUP_SRC_MHI_DMA] = { |
Alex Elder | cf9a10b | 2021-03-26 10:11:17 -0500 | [diff] [blame] | 217 | .min = 0, .max = 63, |
Alex Elder | 9ab7e72 | 2021-03-26 10:11:14 -0500 | [diff] [blame] | 218 | }, |
| 219 | .limits[IPA_RSRC_GROUP_SRC_UC_RX_Q] = { |
Alex Elder | cf9a10b | 2021-03-26 10:11:17 -0500 | [diff] [blame] | 220 | .min = 0, .max = 63, |
Alex Elder | 9ab7e72 | 2021-03-26 10:11:14 -0500 | [diff] [blame] | 221 | }, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 222 | }, |
Alex Elder | 4bcfb35 | 2021-03-26 10:11:16 -0500 | [diff] [blame] | 223 | [IPA_RESOURCE_TYPE_SRC_ACK_ENTRIES] = { |
Alex Elder | 47f71d6 | 2021-03-26 10:11:13 -0500 | [diff] [blame] | 224 | .limits[IPA_RSRC_GROUP_SRC_LWA_DL] = { |
Alex Elder | cf9a10b | 2021-03-26 10:11:17 -0500 | [diff] [blame] | 225 | .min = 14, .max = 14, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 226 | }, |
Alex Elder | 47f71d6 | 2021-03-26 10:11:13 -0500 | [diff] [blame] | 227 | .limits[IPA_RSRC_GROUP_SRC_UL_DL] = { |
Alex Elder | cf9a10b | 2021-03-26 10:11:17 -0500 | [diff] [blame] | 228 | .min = 20, .max = 20, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 229 | }, |
Alex Elder | 9ab7e72 | 2021-03-26 10:11:14 -0500 | [diff] [blame] | 230 | .limits[IPA_RSRC_GROUP_SRC_UC_RX_Q] = { |
Alex Elder | cf9a10b | 2021-03-26 10:11:17 -0500 | [diff] [blame] | 231 | .min = 14, .max = 14, |
Alex Elder | 9ab7e72 | 2021-03-26 10:11:14 -0500 | [diff] [blame] | 232 | }, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 233 | }, |
| 234 | }; |
| 235 | |
Alex Elder | fc566da | 2021-03-28 12:31:08 -0500 | [diff] [blame] | 236 | /* Destination resource configuration data for an SoC having IPA v3.5.1 */ |
Alex Elder | 7336ce1 | 2021-03-26 10:11:19 -0500 | [diff] [blame] | 237 | static const struct ipa_resource ipa_resource_dst[] = { |
Alex Elder | 4bcfb35 | 2021-03-26 10:11:16 -0500 | [diff] [blame] | 238 | [IPA_RESOURCE_TYPE_DST_DATA_SECTORS] = { |
Alex Elder | 47f71d6 | 2021-03-26 10:11:13 -0500 | [diff] [blame] | 239 | .limits[IPA_RSRC_GROUP_DST_LWA_DL] = { |
Alex Elder | cf9a10b | 2021-03-26 10:11:17 -0500 | [diff] [blame] | 240 | .min = 4, .max = 4, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 241 | }, |
| 242 | .limits[1] = { |
Alex Elder | cf9a10b | 2021-03-26 10:11:17 -0500 | [diff] [blame] | 243 | .min = 4, .max = 4, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 244 | }, |
Alex Elder | 9ab7e72 | 2021-03-26 10:11:14 -0500 | [diff] [blame] | 245 | .limits[IPA_RSRC_GROUP_DST_UNUSED_2] = { |
Alex Elder | cf9a10b | 2021-03-26 10:11:17 -0500 | [diff] [blame] | 246 | .min = 3, .max = 3, |
Alex Elder | 9ab7e72 | 2021-03-26 10:11:14 -0500 | [diff] [blame] | 247 | } |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 248 | }, |
Alex Elder | 4bcfb35 | 2021-03-26 10:11:16 -0500 | [diff] [blame] | 249 | [IPA_RESOURCE_TYPE_DST_DPS_DMARS] = { |
Alex Elder | 47f71d6 | 2021-03-26 10:11:13 -0500 | [diff] [blame] | 250 | .limits[IPA_RSRC_GROUP_DST_LWA_DL] = { |
Alex Elder | cf9a10b | 2021-03-26 10:11:17 -0500 | [diff] [blame] | 251 | .min = 2, .max = 63, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 252 | }, |
Alex Elder | 47f71d6 | 2021-03-26 10:11:13 -0500 | [diff] [blame] | 253 | .limits[IPA_RSRC_GROUP_DST_UL_DL_DPL] = { |
Alex Elder | cf9a10b | 2021-03-26 10:11:17 -0500 | [diff] [blame] | 254 | .min = 1, .max = 63, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 255 | }, |
Alex Elder | 9ab7e72 | 2021-03-26 10:11:14 -0500 | [diff] [blame] | 256 | .limits[IPA_RSRC_GROUP_DST_UNUSED_2] = { |
Alex Elder | cf9a10b | 2021-03-26 10:11:17 -0500 | [diff] [blame] | 257 | .min = 1, .max = 2, |
Alex Elder | 9ab7e72 | 2021-03-26 10:11:14 -0500 | [diff] [blame] | 258 | } |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 259 | }, |
| 260 | }; |
| 261 | |
Alex Elder | fc566da | 2021-03-28 12:31:08 -0500 | [diff] [blame] | 262 | /* Resource configuration data for an SoC having IPA v3.5.1 */ |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 263 | static const struct ipa_resource_data ipa_resource_data = { |
Alex Elder | 4fd704b | 2021-03-26 10:11:21 -0500 | [diff] [blame] | 264 | .rsrc_group_src_count = IPA_RSRC_GROUP_SRC_COUNT, |
| 265 | .rsrc_group_dst_count = IPA_RSRC_GROUP_DST_COUNT, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 266 | .resource_src_count = ARRAY_SIZE(ipa_resource_src), |
| 267 | .resource_src = ipa_resource_src, |
| 268 | .resource_dst_count = ARRAY_SIZE(ipa_resource_dst), |
| 269 | .resource_dst = ipa_resource_dst, |
| 270 | }; |
| 271 | |
Alex Elder | fc566da | 2021-03-28 12:31:08 -0500 | [diff] [blame] | 272 | /* IPA-resident memory region data for an SoC having IPA v3.5.1 */ |
Alex Elder | 3128aae | 2020-05-04 12:58:57 -0500 | [diff] [blame] | 273 | static const struct ipa_mem ipa_mem_local_data[] = { |
Alex Elder | c61cfb9 | 2021-06-10 14:23:08 -0500 | [diff] [blame^] | 274 | { |
Alex Elder | 14ab6a2 | 2021-06-09 17:34:54 -0500 | [diff] [blame] | 275 | .id = IPA_MEM_UC_SHARED, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 276 | .offset = 0x0000, |
| 277 | .size = 0x0080, |
| 278 | .canary_count = 0, |
| 279 | }, |
Alex Elder | c61cfb9 | 2021-06-10 14:23:08 -0500 | [diff] [blame^] | 280 | { |
Alex Elder | 14ab6a2 | 2021-06-09 17:34:54 -0500 | [diff] [blame] | 281 | .id = IPA_MEM_UC_INFO, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 282 | .offset = 0x0080, |
| 283 | .size = 0x0200, |
| 284 | .canary_count = 0, |
| 285 | }, |
Alex Elder | c61cfb9 | 2021-06-10 14:23:08 -0500 | [diff] [blame^] | 286 | { |
Alex Elder | 14ab6a2 | 2021-06-09 17:34:54 -0500 | [diff] [blame] | 287 | .id = IPA_MEM_V4_FILTER_HASHED, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 288 | .offset = 0x0288, |
| 289 | .size = 0x0078, |
| 290 | .canary_count = 2, |
| 291 | }, |
Alex Elder | c61cfb9 | 2021-06-10 14:23:08 -0500 | [diff] [blame^] | 292 | { |
Alex Elder | 14ab6a2 | 2021-06-09 17:34:54 -0500 | [diff] [blame] | 293 | .id = IPA_MEM_V4_FILTER, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 294 | .offset = 0x0308, |
| 295 | .size = 0x0078, |
| 296 | .canary_count = 2, |
| 297 | }, |
Alex Elder | c61cfb9 | 2021-06-10 14:23:08 -0500 | [diff] [blame^] | 298 | { |
Alex Elder | 14ab6a2 | 2021-06-09 17:34:54 -0500 | [diff] [blame] | 299 | .id = IPA_MEM_V6_FILTER_HASHED, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 300 | .offset = 0x0388, |
| 301 | .size = 0x0078, |
| 302 | .canary_count = 2, |
| 303 | }, |
Alex Elder | c61cfb9 | 2021-06-10 14:23:08 -0500 | [diff] [blame^] | 304 | { |
Alex Elder | 14ab6a2 | 2021-06-09 17:34:54 -0500 | [diff] [blame] | 305 | .id = IPA_MEM_V6_FILTER, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 306 | .offset = 0x0408, |
| 307 | .size = 0x0078, |
| 308 | .canary_count = 2, |
| 309 | }, |
Alex Elder | c61cfb9 | 2021-06-10 14:23:08 -0500 | [diff] [blame^] | 310 | { |
Alex Elder | 14ab6a2 | 2021-06-09 17:34:54 -0500 | [diff] [blame] | 311 | .id = IPA_MEM_V4_ROUTE_HASHED, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 312 | .offset = 0x0488, |
| 313 | .size = 0x0078, |
| 314 | .canary_count = 2, |
| 315 | }, |
Alex Elder | c61cfb9 | 2021-06-10 14:23:08 -0500 | [diff] [blame^] | 316 | { |
Alex Elder | 14ab6a2 | 2021-06-09 17:34:54 -0500 | [diff] [blame] | 317 | .id = IPA_MEM_V4_ROUTE, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 318 | .offset = 0x0508, |
| 319 | .size = 0x0078, |
| 320 | .canary_count = 2, |
| 321 | }, |
Alex Elder | c61cfb9 | 2021-06-10 14:23:08 -0500 | [diff] [blame^] | 322 | { |
Alex Elder | 14ab6a2 | 2021-06-09 17:34:54 -0500 | [diff] [blame] | 323 | .id = IPA_MEM_V6_ROUTE_HASHED, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 324 | .offset = 0x0588, |
| 325 | .size = 0x0078, |
| 326 | .canary_count = 2, |
| 327 | }, |
Alex Elder | c61cfb9 | 2021-06-10 14:23:08 -0500 | [diff] [blame^] | 328 | { |
Alex Elder | 14ab6a2 | 2021-06-09 17:34:54 -0500 | [diff] [blame] | 329 | .id = IPA_MEM_V6_ROUTE, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 330 | .offset = 0x0608, |
| 331 | .size = 0x0078, |
| 332 | .canary_count = 2, |
| 333 | }, |
Alex Elder | c61cfb9 | 2021-06-10 14:23:08 -0500 | [diff] [blame^] | 334 | { |
Alex Elder | 14ab6a2 | 2021-06-09 17:34:54 -0500 | [diff] [blame] | 335 | .id = IPA_MEM_MODEM_HEADER, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 336 | .offset = 0x0688, |
| 337 | .size = 0x0140, |
| 338 | .canary_count = 2, |
| 339 | }, |
Alex Elder | c61cfb9 | 2021-06-10 14:23:08 -0500 | [diff] [blame^] | 340 | { |
Alex Elder | 14ab6a2 | 2021-06-09 17:34:54 -0500 | [diff] [blame] | 341 | .id = IPA_MEM_MODEM_PROC_CTX, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 342 | .offset = 0x07d0, |
| 343 | .size = 0x0200, |
| 344 | .canary_count = 2, |
| 345 | }, |
Alex Elder | c61cfb9 | 2021-06-10 14:23:08 -0500 | [diff] [blame^] | 346 | { |
Alex Elder | 14ab6a2 | 2021-06-09 17:34:54 -0500 | [diff] [blame] | 347 | .id = IPA_MEM_AP_PROC_CTX, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 348 | .offset = 0x09d0, |
| 349 | .size = 0x0200, |
| 350 | .canary_count = 0, |
| 351 | }, |
Alex Elder | c61cfb9 | 2021-06-10 14:23:08 -0500 | [diff] [blame^] | 352 | { |
Alex Elder | 14ab6a2 | 2021-06-09 17:34:54 -0500 | [diff] [blame] | 353 | .id = IPA_MEM_MODEM, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 354 | .offset = 0x0bd8, |
| 355 | .size = 0x1024, |
| 356 | .canary_count = 0, |
| 357 | }, |
Alex Elder | c61cfb9 | 2021-06-10 14:23:08 -0500 | [diff] [blame^] | 358 | { |
Alex Elder | 14ab6a2 | 2021-06-09 17:34:54 -0500 | [diff] [blame] | 359 | .id = IPA_MEM_UC_EVENT_RING, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 360 | .offset = 0x1c00, |
| 361 | .size = 0x0400, |
| 362 | .canary_count = 1, |
| 363 | }, |
| 364 | }; |
| 365 | |
Alex Elder | fc566da | 2021-03-28 12:31:08 -0500 | [diff] [blame] | 366 | /* Memory configuration data for an SoC having IPA v3.5.1 */ |
Alex Elder | e4a9f45 | 2021-03-19 10:24:18 -0500 | [diff] [blame] | 367 | static const struct ipa_mem_data ipa_mem_data = { |
Alex Elder | 3128aae | 2020-05-04 12:58:57 -0500 | [diff] [blame] | 368 | .local_count = ARRAY_SIZE(ipa_mem_local_data), |
| 369 | .local = ipa_mem_local_data, |
Alex Elder | 3e313c3 | 2020-05-04 12:58:58 -0500 | [diff] [blame] | 370 | .imem_addr = 0x146bd000, |
| 371 | .imem_size = 0x00002000, |
Alex Elder | a0036bb | 2020-05-04 12:58:59 -0500 | [diff] [blame] | 372 | .smem_id = 497, |
| 373 | .smem_size = 0x00002000, |
Alex Elder | 3128aae | 2020-05-04 12:58:57 -0500 | [diff] [blame] | 374 | }; |
| 375 | |
Alex Elder | ea151e1 | 2021-01-15 06:50:50 -0600 | [diff] [blame] | 376 | /* Interconnect bandwidths are in 1000 byte/second units */ |
Alex Elder | e4a9f45 | 2021-03-19 10:24:18 -0500 | [diff] [blame] | 377 | static const struct ipa_interconnect_data ipa_interconnect_data[] = { |
Alex Elder | ea151e1 | 2021-01-15 06:50:50 -0600 | [diff] [blame] | 378 | { |
| 379 | .name = "memory", |
| 380 | .peak_bandwidth = 600000, /* 600 MBps */ |
| 381 | .average_bandwidth = 80000, /* 80 MBps */ |
| 382 | }, |
| 383 | /* Average bandwidth is unused for the next two interconnects */ |
| 384 | { |
| 385 | .name = "imem", |
| 386 | .peak_bandwidth = 350000, /* 350 MBps */ |
| 387 | .average_bandwidth = 0, /* unused */ |
| 388 | }, |
| 389 | { |
| 390 | .name = "config", |
| 391 | .peak_bandwidth = 40000, /* 40 MBps */ |
| 392 | .average_bandwidth = 0, /* unused */ |
| 393 | }, |
| 394 | }; |
| 395 | |
Alex Elder | fc566da | 2021-03-28 12:31:08 -0500 | [diff] [blame] | 396 | /* Clock and interconnect configuration data for an SoC having IPA v3.5.1 */ |
Alex Elder | e4a9f45 | 2021-03-19 10:24:18 -0500 | [diff] [blame] | 397 | static const struct ipa_clock_data ipa_clock_data = { |
Alex Elder | f08c992 | 2020-11-19 16:40:40 -0600 | [diff] [blame] | 398 | .core_clock_rate = 75 * 1000 * 1000, /* Hz */ |
Alex Elder | ea151e1 | 2021-01-15 06:50:50 -0600 | [diff] [blame] | 399 | .interconnect_count = ARRAY_SIZE(ipa_interconnect_data), |
| 400 | .interconnect_data = ipa_interconnect_data, |
Alex Elder | f08c992 | 2020-11-19 16:40:40 -0600 | [diff] [blame] | 401 | }; |
| 402 | |
Alex Elder | fc566da | 2021-03-28 12:31:08 -0500 | [diff] [blame] | 403 | /* Configuration data for an SoC having IPA v3.5.1 */ |
| 404 | const struct ipa_data ipa_data_v3_5_1 = { |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 405 | .version = IPA_VERSION_3_5_1, |
Alex Elder | e695bed | 2021-03-28 12:31:06 -0500 | [diff] [blame] | 406 | .backward_compat = BCR_CMDQ_L_LACK_ONE_ENTRY_FMASK | |
| 407 | BCR_TX_NOT_USING_BRESP_FMASK | |
| 408 | BCR_SUSPEND_L2_IRQ_FMASK | |
| 409 | BCR_HOLB_DROP_L2_IRQ_FMASK | |
| 410 | BCR_DUAL_TX_FMASK, |
Alex Elder | 37537fa | 2021-03-19 10:24:22 -0500 | [diff] [blame] | 411 | .qsb_count = ARRAY_SIZE(ipa_qsb_data), |
| 412 | .qsb_data = ipa_qsb_data, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 413 | .endpoint_count = ARRAY_SIZE(ipa_gsi_endpoint_data), |
| 414 | .endpoint_data = ipa_gsi_endpoint_data, |
| 415 | .resource_data = &ipa_resource_data, |
Alex Elder | 3128aae | 2020-05-04 12:58:57 -0500 | [diff] [blame] | 416 | .mem_data = &ipa_mem_data, |
Alex Elder | f08c992 | 2020-11-19 16:40:40 -0600 | [diff] [blame] | 417 | .clock_data = &ipa_clock_data, |
Alex Elder | 1ed7d0c0 | 2020-03-05 22:28:18 -0600 | [diff] [blame] | 418 | }; |