Ghanim Fodi | 37b6495 | 2017-01-24 15:42:30 +0200 | [diff] [blame] | 1 | /* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | |
| 13 | #include <net/ip.h> |
| 14 | #include <linux/genalloc.h> /* gen_pool_alloc() */ |
| 15 | #include <linux/io.h> |
| 16 | #include <linux/ratelimit.h> |
| 17 | #include <linux/msm-bus.h> |
| 18 | #include <linux/msm-bus-board.h> |
| 19 | #include <linux/msm_gsi.h> |
| 20 | #include <linux/elf.h> |
| 21 | #include "ipa_i.h" |
| 22 | #include "ipahal/ipahal.h" |
| 23 | #include "ipahal/ipahal_fltrt.h" |
Skylar Chang | 6f6e307 | 2017-07-28 10:03:47 -0700 | [diff] [blame] | 24 | #include "ipahal/ipahal_hw_stats.h" |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 25 | #include "../ipa_rm_i.h" |
| 26 | |
| 27 | #define IPA_V3_0_CLK_RATE_SVS (75 * 1000 * 1000UL) |
| 28 | #define IPA_V3_0_CLK_RATE_NOMINAL (150 * 1000 * 1000UL) |
| 29 | #define IPA_V3_0_CLK_RATE_TURBO (200 * 1000 * 1000UL) |
Skylar Chang | f88124c | 2017-07-18 18:11:25 -0700 | [diff] [blame] | 30 | |
| 31 | #define IPA_V3_5_CLK_RATE_SVS (200 * 1000 * 1000UL) |
| 32 | #define IPA_V3_5_CLK_RATE_NOMINAL (400 * 1000 * 1000UL) |
| 33 | #define IPA_V3_5_CLK_RATE_TURBO (42640 * 10 * 1000UL) |
| 34 | |
| 35 | #define IPA_V4_0_CLK_RATE_SVS (125 * 1000 * 1000UL) |
| 36 | #define IPA_V4_0_CLK_RATE_NOMINAL (220 * 1000 * 1000UL) |
| 37 | #define IPA_V4_0_CLK_RATE_TURBO (250 * 1000 * 1000UL) |
| 38 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 39 | #define IPA_V3_0_MAX_HOLB_TMR_VAL (4294967296 - 1) |
| 40 | |
| 41 | #define IPA_V3_0_BW_THRESHOLD_TURBO_MBPS (1000) |
| 42 | #define IPA_V3_0_BW_THRESHOLD_NOMINAL_MBPS (600) |
| 43 | |
| 44 | #define IPA_ENDP_INIT_HDR_METADATA_n_MUX_ID_BMASK 0xFF0000 |
| 45 | #define IPA_ENDP_INIT_HDR_METADATA_n_MUX_ID_SHFT 0x10 |
| 46 | |
| 47 | /* Max pipes + ICs for TAG process */ |
| 48 | #define IPA_TAG_MAX_DESC (IPA3_MAX_NUM_PIPES + 6) |
| 49 | |
| 50 | #define IPA_TAG_SLEEP_MIN_USEC (1000) |
| 51 | #define IPA_TAG_SLEEP_MAX_USEC (2000) |
| 52 | #define IPA_FORCE_CLOSE_TAG_PROCESS_TIMEOUT (10 * HZ) |
| 53 | #define IPA_BCR_REG_VAL_v3_0 (0x00000001) |
| 54 | #define IPA_BCR_REG_VAL_v3_5 (0x0000003B) |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 55 | #define IPA_BCR_REG_VAL_v4_0 (0x00000039) |
Michael Adisumarta | d68ab11 | 2017-06-14 11:40:06 -0700 | [diff] [blame] | 56 | #define IPA_CLKON_CFG_v4_0 (0x30000000) |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 57 | #define IPA_AGGR_GRAN_MIN (1) |
| 58 | #define IPA_AGGR_GRAN_MAX (32) |
| 59 | #define IPA_EOT_COAL_GRAN_MIN (1) |
| 60 | #define IPA_EOT_COAL_GRAN_MAX (16) |
| 61 | |
Gidon Studinski | 3021a6f | 2016-11-10 12:48:48 +0200 | [diff] [blame] | 62 | #define IPA_DMA_TASK_FOR_GSI_TIMEOUT_MSEC (15) |
| 63 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 64 | #define IPA_AGGR_BYTE_LIMIT (\ |
| 65 | IPA_ENDP_INIT_AGGR_N_AGGR_BYTE_LIMIT_BMSK >> \ |
| 66 | IPA_ENDP_INIT_AGGR_N_AGGR_BYTE_LIMIT_SHFT) |
| 67 | #define IPA_AGGR_PKT_LIMIT (\ |
| 68 | IPA_ENDP_INIT_AGGR_n_AGGR_PKT_LIMIT_BMSK >> \ |
| 69 | IPA_ENDP_INIT_AGGR_n_AGGR_PKT_LIMIT_SHFT) |
| 70 | |
| 71 | /* In IPAv3 only endpoints 0-3 can be configured to deaggregation */ |
| 72 | #define IPA_EP_SUPPORTS_DEAGGR(idx) ((idx) >= 0 && (idx) <= 3) |
| 73 | |
| 74 | /* configure IPA spare register 1 in order to have correct IPA version |
| 75 | * set bits 0,2,3 and 4. see SpareBits documentation.xlsx |
| 76 | */ |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 77 | |
| 78 | /* HPS, DPS sequencers Types*/ |
| 79 | #define IPA_DPS_HPS_SEQ_TYPE_DMA_ONLY 0x00000000 |
| 80 | /* DMA + DECIPHER/CIPHER */ |
| 81 | #define IPA_DPS_HPS_SEQ_TYPE_DMA_DEC 0x00000011 |
| 82 | /* Packet Processing + no decipher + uCP (for Ethernet Bridging) */ |
| 83 | #define IPA_DPS_HPS_SEQ_TYPE_PKT_PROCESS_NO_DEC_UCP 0x00000002 |
| 84 | /* Packet Processing + decipher + uCP */ |
| 85 | #define IPA_DPS_HPS_SEQ_TYPE_PKT_PROCESS_DEC_UCP 0x00000013 |
| 86 | /* 2 Packet Processing pass + no decipher + uCP */ |
| 87 | #define IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP 0x00000004 |
| 88 | /* 2 Packet Processing pass + decipher + uCP */ |
| 89 | #define IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_DEC_UCP 0x00000015 |
| 90 | /* Packet Processing + no decipher + no uCP */ |
| 91 | #define IPA_DPS_HPS_SEQ_TYPE_PKT_PROCESS_NO_DEC_NO_UCP 0x00000006 |
| 92 | /* Packet Processing + no decipher + no uCP */ |
| 93 | #define IPA_DPS_HPS_SEQ_TYPE_PKT_PROCESS_DEC_NO_UCP 0x00000017 |
| 94 | /* COMP/DECOMP */ |
| 95 | #define IPA_DPS_HPS_SEQ_TYPE_DMA_COMP_DECOMP 0x00000020 |
| 96 | /* Invalid sequencer type */ |
| 97 | #define IPA_DPS_HPS_SEQ_TYPE_INVALID 0xFFFFFFFF |
| 98 | |
| 99 | #define IPA_DPS_HPS_SEQ_TYPE_IS_DMA(seq_type) \ |
| 100 | (seq_type == IPA_DPS_HPS_SEQ_TYPE_DMA_ONLY || \ |
| 101 | seq_type == IPA_DPS_HPS_SEQ_TYPE_DMA_DEC || \ |
| 102 | seq_type == IPA_DPS_HPS_SEQ_TYPE_DMA_COMP_DECOMP) |
| 103 | |
| 104 | #define QMB_MASTER_SELECT_DDR (0) |
| 105 | #define QMB_MASTER_SELECT_PCIE (1) |
| 106 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 107 | /* Resource Group index*/ |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 108 | #define IPA_v3_0_GROUP_UL (0) |
| 109 | #define IPA_v3_0_GROUP_DL (1) |
| 110 | #define IPA_v3_0_GROUP_DPL IPA_v3_0_GROUP_DL |
| 111 | #define IPA_v3_0_GROUP_DIAG (2) |
| 112 | #define IPA_v3_0_GROUP_DMA (3) |
| 113 | #define IPA_v3_0_GROUP_IMM_CMD IPA_v3_0_GROUP_UL |
| 114 | #define IPA_v3_0_GROUP_Q6ZIP (4) |
| 115 | #define IPA_v3_0_GROUP_Q6ZIP_GENERAL IPA_v3_0_GROUP_Q6ZIP |
| 116 | #define IPA_v3_0_GROUP_UC_RX_Q (5) |
| 117 | #define IPA_v3_0_GROUP_Q6ZIP_ENGINE IPA_v3_0_GROUP_UC_RX_Q |
| 118 | #define IPA_v3_0_GROUP_MAX (6) |
| 119 | |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 120 | #define IPA_v3_5_GROUP_LWA_DL (0) /* currently not used */ |
| 121 | #define IPA_v3_5_MHI_GROUP_PCIE IPA_v3_5_GROUP_LWA_DL |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 122 | #define IPA_v3_5_GROUP_UL_DL (1) |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 123 | #define IPA_v3_5_MHI_GROUP_DDR IPA_v3_5_GROUP_UL_DL |
| 124 | #define IPA_v3_5_MHI_GROUP_DMA (2) |
| 125 | #define IPA_v3_5_GROUP_UC_RX_Q (3) /* currently not used */ |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 126 | #define IPA_v3_5_SRC_GROUP_MAX (4) |
| 127 | #define IPA_v3_5_DST_GROUP_MAX (3) |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 128 | |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 129 | #define IPA_v4_0_GROUP_LWA_DL (0) |
| 130 | #define IPA_v4_0_MHI_GROUP_PCIE (0) |
| 131 | #define IPA_v4_0_ETHERNET (0) |
| 132 | #define IPA_v4_0_GROUP_UL_DL (1) |
| 133 | #define IPA_v4_0_MHI_GROUP_DDR (1) |
| 134 | #define IPA_v4_0_MHI_GROUP_DMA (2) |
| 135 | #define IPA_v4_0_GROUP_UC_RX_Q (3) |
| 136 | #define IPA_v4_0_SRC_GROUP_MAX (4) |
| 137 | #define IPA_v4_0_DST_GROUP_MAX (4) |
| 138 | |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 139 | #define IPA_GROUP_MAX IPA_v3_0_GROUP_MAX |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 140 | |
| 141 | enum ipa_rsrc_grp_type_src { |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 142 | IPA_v3_0_RSRC_GRP_TYPE_SRC_PKT_CONTEXTS, |
| 143 | IPA_v3_0_RSRC_GRP_TYPE_SRC_HDR_SECTORS, |
| 144 | IPA_v3_0_RSRC_GRP_TYPE_SRC_HDRI1_BUFFER, |
| 145 | IPA_v3_0_RSRC_GRP_TYPE_SRS_DESCRIPTOR_LISTS, |
| 146 | IPA_v3_0_RSRC_GRP_TYPE_SRC_DESCRIPTOR_BUFF, |
| 147 | IPA_v3_0_RSRC_GRP_TYPE_SRC_HDRI2_BUFFERS, |
| 148 | IPA_v3_0_RSRC_GRP_TYPE_SRC_HPS_DMARS, |
| 149 | IPA_v3_0_RSRC_GRP_TYPE_SRC_ACK_ENTRIES, |
| 150 | IPA_v3_0_RSRC_GRP_TYPE_SRC_MAX, |
| 151 | |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 152 | IPA_v3_5_RSRC_GRP_TYPE_SRC_PKT_CONTEXTS = 0, |
| 153 | IPA_v3_5_RSRC_GRP_TYPE_SRS_DESCRIPTOR_LISTS, |
| 154 | IPA_v3_5_RSRC_GRP_TYPE_SRC_DESCRIPTOR_BUFF, |
| 155 | IPA_v3_5_RSRC_GRP_TYPE_SRC_HPS_DMARS, |
| 156 | IPA_v3_5_RSRC_GRP_TYPE_SRC_ACK_ENTRIES, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 157 | IPA_v3_5_RSRC_GRP_TYPE_SRC_MAX, |
| 158 | |
| 159 | IPA_v4_0_RSRC_GRP_TYPE_SRC_PKT_CONTEXTS = 0, |
| 160 | IPA_v4_0_RSRC_GRP_TYPE_SRS_DESCRIPTOR_LISTS, |
| 161 | IPA_v4_0_RSRC_GRP_TYPE_SRC_DESCRIPTOR_BUFF, |
| 162 | IPA_v4_0_RSRC_GRP_TYPE_SRC_HPS_DMARS, |
| 163 | IPA_v4_0_RSRC_GRP_TYPE_SRC_ACK_ENTRIES, |
| 164 | IPA_v4_0_RSRC_GRP_TYPE_SRC_MAX |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 165 | }; |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 166 | |
| 167 | #define IPA_RSRC_GRP_TYPE_SRC_MAX IPA_v3_0_RSRC_GRP_TYPE_SRC_MAX |
| 168 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 169 | enum ipa_rsrc_grp_type_dst { |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 170 | IPA_v3_0_RSRC_GRP_TYPE_DST_DATA_SECTORS, |
| 171 | IPA_v3_0_RSRC_GRP_TYPE_DST_DATA_SECTOR_LISTS, |
| 172 | IPA_v3_0_RSRC_GRP_TYPE_DST_DPS_DMARS, |
| 173 | IPA_v3_0_RSRC_GRP_TYPE_DST_MAX, |
| 174 | |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 175 | IPA_v3_5_RSRC_GRP_TYPE_DST_DATA_SECTORS = 0, |
| 176 | IPA_v3_5_RSRC_GRP_TYPE_DST_DPS_DMARS, |
| 177 | IPA_v3_5_RSRC_GRP_TYPE_DST_MAX, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 178 | |
| 179 | IPA_v4_0_RSRC_GRP_TYPE_DST_DATA_SECTORS = 0, |
| 180 | IPA_v4_0_RSRC_GRP_TYPE_DST_DPS_DMARS, |
| 181 | IPA_v4_0_RSRC_GRP_TYPE_DST_MAX, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 182 | }; |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 183 | #define IPA_RSRC_GRP_TYPE_DST_MAX IPA_v3_0_RSRC_GRP_TYPE_DST_MAX |
| 184 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 185 | enum ipa_rsrc_grp_type_rx { |
| 186 | IPA_RSRC_GRP_TYPE_RX_HPS_CMDQ, |
| 187 | IPA_RSRC_GRP_TYPE_RX_MAX |
| 188 | }; |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 189 | |
| 190 | enum ipa_rsrc_grp_rx_hps_weight_config { |
| 191 | IPA_RSRC_GRP_TYPE_RX_HPS_WEIGHT_CONFIG, |
| 192 | IPA_RSRC_GRP_TYPE_RX_HPS_WEIGHT_MAX |
| 193 | }; |
| 194 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 195 | struct rsrc_min_max { |
| 196 | u32 min; |
| 197 | u32 max; |
| 198 | }; |
| 199 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 200 | enum ipa_ver { |
| 201 | IPA_3_0, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 202 | IPA_3_5, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 203 | IPA_3_5_MHI, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 204 | IPA_3_5_1, |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 205 | IPA_4_0, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 206 | IPA_4_0_MHI, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 207 | IPA_VER_MAX, |
| 208 | }; |
| 209 | |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 210 | static const struct rsrc_min_max ipa3_rsrc_src_grp_config |
| 211 | [IPA_VER_MAX][IPA_RSRC_GRP_TYPE_SRC_MAX][IPA_GROUP_MAX] = { |
| 212 | [IPA_3_0] = { |
| 213 | /*UL DL DIAG DMA Not Used uC Rx*/ |
| 214 | [IPA_v3_0_RSRC_GRP_TYPE_SRC_PKT_CONTEXTS] = { |
| 215 | {3, 255}, {3, 255}, {1, 255}, {1, 255}, {1, 255}, {2, 255} }, |
| 216 | [IPA_v3_0_RSRC_GRP_TYPE_SRC_HDR_SECTORS] = { |
| 217 | {0, 255}, {0, 255}, {0, 255}, {0, 255}, {0, 255}, {0, 255} }, |
| 218 | [IPA_v3_0_RSRC_GRP_TYPE_SRC_HDRI1_BUFFER] = { |
| 219 | {0, 255}, {0, 255}, {0, 255}, {0, 255}, {0, 255}, {0, 255} }, |
| 220 | [IPA_v3_0_RSRC_GRP_TYPE_SRS_DESCRIPTOR_LISTS] = { |
| 221 | {14, 14}, {16, 16}, {5, 5}, {5, 5}, {0, 0}, {8, 8} }, |
| 222 | [IPA_v3_0_RSRC_GRP_TYPE_SRC_DESCRIPTOR_BUFF] = { |
| 223 | {19, 19}, {26, 26}, {3, 3}, {7, 7}, {0, 0}, {8, 8} }, |
| 224 | [IPA_v3_0_RSRC_GRP_TYPE_SRC_HDRI2_BUFFERS] = { |
| 225 | {0, 255}, {0, 255}, {0, 255}, {0, 255}, {0, 255}, {0, 255} }, |
| 226 | [IPA_v3_0_RSRC_GRP_TYPE_SRC_HPS_DMARS] = { |
| 227 | {0, 255}, {0, 255}, {0, 255}, {0, 255}, {0, 255}, {0, 255} }, |
| 228 | [IPA_v3_0_RSRC_GRP_TYPE_SRC_ACK_ENTRIES] = { |
| 229 | {14, 14}, {16, 16}, {5, 5}, {5, 5}, {0, 0}, {8, 8} }, |
| 230 | }, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 231 | [IPA_3_5] = { |
| 232 | /* LWA_DL UL_DL not used UC_RX_Q, other are invalid */ |
| 233 | [IPA_v3_5_RSRC_GRP_TYPE_SRC_PKT_CONTEXTS] = { |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 234 | {0, 0}, {1, 255}, {0, 0}, {1, 255}, {0, 0}, {0, 0} }, |
| 235 | [IPA_v3_5_RSRC_GRP_TYPE_SRS_DESCRIPTOR_LISTS] = { |
| 236 | {0, 0}, {10, 10}, {0, 0}, {8, 8}, {0, 0}, {0, 0} }, |
| 237 | [IPA_v3_5_RSRC_GRP_TYPE_SRC_DESCRIPTOR_BUFF] = { |
| 238 | {0, 0}, {14, 14}, {0, 0}, {8, 8}, {0, 0}, {0, 0} }, |
| 239 | [IPA_v3_5_RSRC_GRP_TYPE_SRC_HPS_DMARS] = { |
| 240 | {0, 255}, {0, 255}, {0, 255}, {0, 255}, {0, 0}, {0, 0} }, |
| 241 | [IPA_v3_5_RSRC_GRP_TYPE_SRC_ACK_ENTRIES] = { |
| 242 | {0, 0}, {20, 20}, {0, 0}, {14, 14}, {0, 0}, {0, 0} }, |
| 243 | }, |
| 244 | [IPA_3_5_MHI] = { |
| 245 | /* PCIE DDR DMA not used, other are invalid */ |
| 246 | [IPA_v3_5_RSRC_GRP_TYPE_SRC_PKT_CONTEXTS] = { |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 247 | {4, 4}, {5, 5}, {1, 1}, {0, 0}, {0, 0}, {0, 0} }, |
| 248 | [IPA_v3_5_RSRC_GRP_TYPE_SRS_DESCRIPTOR_LISTS] = { |
| 249 | {10, 10}, {10, 10}, {8, 8}, {0, 0}, {0, 0}, {0, 0} }, |
| 250 | [IPA_v3_5_RSRC_GRP_TYPE_SRC_DESCRIPTOR_BUFF] = { |
| 251 | {12, 12}, {12, 12}, {8, 8}, {0, 0}, {0, 0}, {0, 0} }, |
| 252 | [IPA_v3_5_RSRC_GRP_TYPE_SRC_HPS_DMARS] = { |
| 253 | {0, 255}, {0, 255}, {0, 255}, {0, 255}, {0, 0}, {0, 0} }, |
| 254 | [IPA_v3_5_RSRC_GRP_TYPE_SRC_ACK_ENTRIES] = { |
| 255 | {14, 14}, {14, 14}, {14, 14}, {0, 0}, {0, 0}, {0, 0} }, |
| 256 | }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 257 | [IPA_3_5_1] = { |
| 258 | /* LWA_DL UL_DL not used UC_RX_Q, other are invalid */ |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 259 | [IPA_v3_5_RSRC_GRP_TYPE_SRC_PKT_CONTEXTS] = { |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 260 | {1, 255}, {1, 255}, {0, 0}, {1, 255}, {0, 0}, {0, 0} }, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 261 | [IPA_v3_5_RSRC_GRP_TYPE_SRS_DESCRIPTOR_LISTS] = { |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 262 | {10, 10}, {10, 10}, {0, 0}, {8, 8}, {0, 0}, {0, 0} }, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 263 | [IPA_v3_5_RSRC_GRP_TYPE_SRC_DESCRIPTOR_BUFF] = { |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 264 | {12, 12}, {14, 14}, {0, 0}, {8, 8}, {0, 0}, {0, 0} }, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 265 | [IPA_v3_5_RSRC_GRP_TYPE_SRC_HPS_DMARS] = { |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 266 | {0, 255}, {0, 255}, {0, 255}, {0, 255}, {0, 0}, {0, 0} }, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 267 | [IPA_v3_5_RSRC_GRP_TYPE_SRC_ACK_ENTRIES] = { |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 268 | {14, 14}, {20, 20}, {0, 0}, {14, 14}, {0, 0}, {0, 0} }, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 269 | }, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 270 | [IPA_4_0] = { |
| 271 | /* LWA_DL UL_DL not used UC_RX_Q, other are invalid */ |
| 272 | [IPA_v4_0_RSRC_GRP_TYPE_SRC_PKT_CONTEXTS] = { |
| 273 | {1, 255}, {1, 255}, {0, 0}, {1, 255}, {0, 0}, {0, 0} }, |
| 274 | [IPA_v4_0_RSRC_GRP_TYPE_SRS_DESCRIPTOR_LISTS] = { |
| 275 | {10, 10}, {10, 10}, {0, 0}, {8, 8}, {0, 0}, {0, 0} }, |
| 276 | [IPA_v4_0_RSRC_GRP_TYPE_SRC_DESCRIPTOR_BUFF] = { |
| 277 | {12, 12}, {14, 14}, {0, 0}, {8, 8}, {0, 0}, {0, 0} }, |
| 278 | [IPA_v4_0_RSRC_GRP_TYPE_SRC_HPS_DMARS] = { |
| 279 | {0, 255}, {0, 255}, {0, 255}, {0, 255}, {0, 0}, {0, 0} }, |
| 280 | [IPA_v4_0_RSRC_GRP_TYPE_SRC_ACK_ENTRIES] = { |
| 281 | {14, 14}, {20, 20}, {0, 0}, {14, 14}, {0, 0}, {0, 0} }, |
| 282 | }, |
| 283 | [IPA_4_0_MHI] = { |
| 284 | /* PCIE DDR DMA not used, other are invalid */ |
| 285 | [IPA_v4_0_RSRC_GRP_TYPE_SRC_PKT_CONTEXTS] = { |
| 286 | {4, 4}, {5, 5}, {1, 1}, {0, 0}, {0, 0}, {0, 0} }, |
| 287 | [IPA_v4_0_RSRC_GRP_TYPE_SRS_DESCRIPTOR_LISTS] = { |
| 288 | {10, 10}, {10, 10}, {8, 8}, {0, 0}, {0, 0}, {0, 0} }, |
| 289 | [IPA_v4_0_RSRC_GRP_TYPE_SRC_DESCRIPTOR_BUFF] = { |
| 290 | {12, 12}, {12, 12}, {8, 8}, {0, 0}, {0, 0}, {0, 0} }, |
| 291 | [IPA_v4_0_RSRC_GRP_TYPE_SRC_HPS_DMARS] = { |
| 292 | {0, 255}, {0, 255}, {0, 255}, {0, 255}, {0, 0}, {0, 0} }, |
| 293 | [IPA_v4_0_RSRC_GRP_TYPE_SRC_ACK_ENTRIES] = { |
| 294 | {14, 14}, {14, 14}, {14, 14}, {0, 0}, {0, 0}, {0, 0} }, |
| 295 | }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 296 | }; |
| 297 | |
| 298 | static const struct rsrc_min_max ipa3_rsrc_dst_grp_config |
| 299 | [IPA_VER_MAX][IPA_RSRC_GRP_TYPE_DST_MAX][IPA_GROUP_MAX] = { |
| 300 | [IPA_3_0] = { |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 301 | /* UL DL/DPL DIAG DMA Q6zip_gen Q6zip_eng */ |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 302 | [IPA_v3_0_RSRC_GRP_TYPE_DST_DATA_SECTORS] = { |
| 303 | {2, 2}, {3, 3}, {0, 0}, {2, 2}, {3, 3}, {3, 3} }, |
| 304 | [IPA_v3_0_RSRC_GRP_TYPE_DST_DATA_SECTOR_LISTS] = { |
| 305 | {0, 255}, {0, 255}, {0, 255}, {0, 255}, {0, 255}, {0, 255} }, |
| 306 | [IPA_v3_0_RSRC_GRP_TYPE_DST_DPS_DMARS] = { |
| 307 | {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {0, 0} }, |
| 308 | }, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 309 | [IPA_3_5] = { |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 310 | /* unused UL/DL/DPL unused N/A N/A N/A */ |
| 311 | [IPA_v3_5_RSRC_GRP_TYPE_DST_DATA_SECTORS] = { |
| 312 | {4, 4}, {4, 4}, {3, 3}, {0, 0}, {0, 0}, {0, 0} }, |
| 313 | [IPA_v3_5_RSRC_GRP_TYPE_DST_DPS_DMARS] = { |
| 314 | {2, 255}, {1, 255}, {1, 2}, {0, 0}, {0, 0}, {0, 0} }, |
| 315 | }, |
| 316 | [IPA_3_5_MHI] = { |
| 317 | /* PCIE DDR DMA N/A N/A N/A */ |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 318 | [IPA_v3_5_RSRC_GRP_TYPE_DST_DATA_SECTORS] = { |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 319 | {4, 4}, {4, 4}, {3, 3}, {0, 0}, {0, 0}, {0, 0} }, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 320 | [IPA_v3_5_RSRC_GRP_TYPE_DST_DPS_DMARS] = { |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 321 | {2, 255}, {1, 255}, {1, 2}, {0, 0}, {0, 0}, {0, 0} }, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 322 | }, |
| 323 | [IPA_3_5_1] = { |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 324 | /* LWA_DL UL/DL/DPL unused N/A N/A N/A */ |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 325 | [IPA_v3_5_RSRC_GRP_TYPE_DST_DATA_SECTORS] = { |
| 326 | {4, 4}, {4, 4}, {3, 3}, {0, 0}, {0, 0}, {0, 0} }, |
| 327 | [IPA_v3_5_RSRC_GRP_TYPE_DST_DPS_DMARS] = { |
| 328 | {2, 255}, {1, 255}, {1, 2}, {0, 0}, {0, 0}, {0, 0} }, |
| 329 | }, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 330 | [IPA_4_0] = { |
| 331 | /*LWA_DL UL/DL/DPL uC, other are invalid */ |
| 332 | [IPA_v4_0_RSRC_GRP_TYPE_DST_DATA_SECTORS] = { |
| 333 | {4, 4}, {4, 4}, {3, 3}, {2, 2}, {0, 0}, {0, 0} }, |
| 334 | [IPA_v4_0_RSRC_GRP_TYPE_DST_DPS_DMARS] = { |
| 335 | {2, 255}, {1, 255}, {1, 2}, {0, 2}, {0, 0}, {0, 0} }, |
| 336 | }, |
| 337 | [IPA_4_0_MHI] = { |
| 338 | /*LWA_DL UL/DL/DPL uC, other are invalid */ |
| 339 | [IPA_v4_0_RSRC_GRP_TYPE_DST_DATA_SECTORS] = { |
| 340 | {4, 4}, {4, 4}, {3, 3}, {2, 2}, {0, 0}, {0, 0} }, |
| 341 | [IPA_v4_0_RSRC_GRP_TYPE_DST_DPS_DMARS] = { |
| 342 | {2, 255}, {1, 255}, {1, 2}, {0, 2}, {0, 0}, {0, 0} }, |
| 343 | }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 344 | }; |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 345 | |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 346 | static const struct rsrc_min_max ipa3_rsrc_rx_grp_config |
| 347 | [IPA_VER_MAX][IPA_RSRC_GRP_TYPE_RX_MAX][IPA_GROUP_MAX] = { |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 348 | [IPA_3_0] = { |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 349 | /* UL DL DIAG DMA Unused uC Rx */ |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 350 | [IPA_RSRC_GRP_TYPE_RX_HPS_CMDQ] = { |
| 351 | {16, 16}, {24, 24}, {8, 8}, {8, 8}, {0, 0}, {8, 8} }, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 352 | }, |
| 353 | [IPA_3_5] = { |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 354 | /* unused UL_DL unused UC_RX_Q N/A N/A */ |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 355 | [IPA_RSRC_GRP_TYPE_RX_HPS_CMDQ] = { |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 356 | {0, 0}, {7, 7}, {0, 0}, {2, 2}, {0, 0}, {0, 0} }, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 357 | }, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 358 | [IPA_3_5_MHI] = { |
| 359 | /* PCIE DDR DMA unused N/A N/A */ |
| 360 | [IPA_RSRC_GRP_TYPE_RX_HPS_CMDQ] = { |
| 361 | { 3, 3 }, { 7, 7 }, { 2, 2 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 362 | }, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 363 | [IPA_3_5_1] = { |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 364 | /* LWA_DL UL_DL unused UC_RX_Q N/A N/A */ |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 365 | [IPA_RSRC_GRP_TYPE_RX_HPS_CMDQ] = { |
| 366 | {3, 3}, {7, 7}, {0, 0}, {2, 2}, {0, 0}, {0, 0} }, |
| 367 | }, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 368 | [IPA_4_0] = { |
| 369 | /* LWA_DL UL_DL not used UC_RX_Q, other are invalid */ |
| 370 | [IPA_RSRC_GRP_TYPE_RX_HPS_CMDQ] = { |
| 371 | {3, 3}, {7, 7}, {0, 0}, {2, 2}, {0, 0}, {0, 0} }, |
| 372 | }, |
| 373 | [IPA_4_0_MHI] = { |
| 374 | /* PCIE DDR DMA unused N/A N/A */ |
| 375 | [IPA_RSRC_GRP_TYPE_RX_HPS_CMDQ] = { |
| 376 | { 3, 3 }, { 7, 7 }, { 2, 2 }, { 0, 0 }, { 0, 0 }, { 0, 0 } }, |
| 377 | }, |
| 378 | }; |
| 379 | |
| 380 | static const u32 ipa3_rsrc_rx_grp_hps_weight_config |
| 381 | [IPA_VER_MAX][IPA_RSRC_GRP_TYPE_RX_HPS_WEIGHT_MAX][IPA_GROUP_MAX] = { |
| 382 | [IPA_3_0] = { |
| 383 | /* UL DL DIAG DMA Unused uC Rx */ |
| 384 | [IPA_RSRC_GRP_TYPE_RX_HPS_WEIGHT_CONFIG] = { 0, 0, 0, 0, 0, 0 }, |
| 385 | }, |
| 386 | [IPA_3_5] = { |
| 387 | /* unused UL_DL unused UC_RX_Q N/A N/A */ |
| 388 | [IPA_RSRC_GRP_TYPE_RX_HPS_WEIGHT_CONFIG] = { 1, 1, 1, 1, 0, 0 }, |
| 389 | }, |
| 390 | [IPA_3_5_MHI] = { |
| 391 | /* PCIE DDR DMA unused N/A N/A */ |
| 392 | [IPA_RSRC_GRP_TYPE_RX_HPS_WEIGHT_CONFIG] = { 3, 5, 1, 1, 0, 0 }, |
| 393 | }, |
| 394 | [IPA_3_5_1] = { |
| 395 | /* LWA_DL UL_DL unused UC_RX_Q N/A N/A */ |
| 396 | [IPA_RSRC_GRP_TYPE_RX_HPS_WEIGHT_CONFIG] = { 1, 1, 1, 1, 0, 0 }, |
| 397 | }, |
| 398 | [IPA_4_0] = { |
| 399 | /* LWA_DL UL_DL not used UC_RX_Q, other are invalid */ |
| 400 | [IPA_RSRC_GRP_TYPE_RX_HPS_WEIGHT_CONFIG] = { 1, 1, 1, 1, 0, 0 }, |
| 401 | }, |
| 402 | [IPA_4_0_MHI] = { |
| 403 | /* PCIE DDR DMA unused N/A N/A */ |
| 404 | [IPA_RSRC_GRP_TYPE_RX_HPS_WEIGHT_CONFIG] = { 3, 5, 1, 1, 0, 0 }, |
| 405 | }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 406 | }; |
| 407 | |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 408 | enum ipa_ees { |
| 409 | IPA_EE_AP = 0, |
| 410 | IPA_EE_Q6 = 1, |
| 411 | IPA_EE_UC = 3, |
| 412 | }; |
| 413 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 414 | struct ipa_ep_configuration { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 415 | bool valid; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 416 | int group_num; |
| 417 | bool support_flt; |
| 418 | int sequencer_type; |
| 419 | u8 qmb_master_sel; |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 420 | struct ipa_gsi_ep_config ipa_gsi_ep_info; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 421 | }; |
| 422 | |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 423 | /* clients not included in the list below are considered as invalid */ |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 424 | static const struct ipa_ep_configuration ipa3_ep_mapping |
| 425 | [IPA_VER_MAX][IPA_CLIENT_MAX] = { |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 426 | [IPA_3_0][IPA_CLIENT_WLAN1_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 427 | true, IPA_v3_0_GROUP_UL, true, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 428 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 429 | QMB_MASTER_SELECT_DDR, |
| 430 | { 10, 1, 8, 16, IPA_EE_UC } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 431 | [IPA_3_0][IPA_CLIENT_USB_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 432 | true, IPA_v3_0_GROUP_UL, true, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 433 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 434 | QMB_MASTER_SELECT_DDR, |
| 435 | { 1, 3, 8, 16, IPA_EE_AP } }, |
Ghanim Fodi | c6b6749 | 2017-03-15 14:19:56 +0200 | [diff] [blame] | 436 | [IPA_3_0][IPA_CLIENT_APPS_LAN_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 437 | true, IPA_v3_0_GROUP_DL, false, |
Ghanim Fodi | c6b6749 | 2017-03-15 14:19:56 +0200 | [diff] [blame] | 438 | IPA_DPS_HPS_SEQ_TYPE_PKT_PROCESS_NO_DEC_UCP, |
Amir Levy | d664d50 | 2017-03-22 21:24:23 +0200 | [diff] [blame] | 439 | QMB_MASTER_SELECT_DDR, |
| 440 | { 14, 11, 8, 16, IPA_EE_AP } }, |
Ghanim Fodi | c6b6749 | 2017-03-15 14:19:56 +0200 | [diff] [blame] | 441 | [IPA_3_0][IPA_CLIENT_APPS_WAN_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 442 | true, IPA_v3_0_GROUP_UL, true, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 443 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 444 | QMB_MASTER_SELECT_DDR, |
Amir Levy | d664d50 | 2017-03-22 21:24:23 +0200 | [diff] [blame] | 445 | { 3, 5, 16, 32, IPA_EE_AP } }, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 446 | [IPA_3_0][IPA_CLIENT_APPS_CMD_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 447 | true, IPA_v3_0_GROUP_IMM_CMD, false, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 448 | IPA_DPS_HPS_SEQ_TYPE_DMA_ONLY, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 449 | QMB_MASTER_SELECT_DDR, |
| 450 | { 22, 6, 18, 28, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 451 | [IPA_3_0][IPA_CLIENT_ODU_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 452 | true, IPA_v3_0_GROUP_UL, true, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 453 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 454 | QMB_MASTER_SELECT_DDR, |
| 455 | { 12, 9, 8, 16, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 456 | [IPA_3_0][IPA_CLIENT_MHI_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 457 | true, IPA_v3_0_GROUP_UL, true, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 458 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 459 | QMB_MASTER_SELECT_PCIE, |
| 460 | { 0, 0, 8, 16, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 461 | [IPA_3_0][IPA_CLIENT_Q6_LAN_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 462 | true, IPA_v3_0_GROUP_UL, false, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 463 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 464 | QMB_MASTER_SELECT_DDR, |
| 465 | { 9, 4, 8, 12, IPA_EE_Q6 } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 466 | [IPA_3_0][IPA_CLIENT_Q6_WAN_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 467 | true, IPA_v3_0_GROUP_DL, true, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 468 | IPA_DPS_HPS_SEQ_TYPE_PKT_PROCESS_NO_DEC_UCP, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 469 | QMB_MASTER_SELECT_DDR, |
| 470 | { 5, 0, 16, 32, IPA_EE_Q6 } }, |
| 471 | [IPA_3_0][IPA_CLIENT_Q6_CMD_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 472 | true, IPA_v3_0_GROUP_IMM_CMD, false, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 473 | IPA_DPS_HPS_SEQ_TYPE_PKT_PROCESS_NO_DEC_UCP, |
| 474 | QMB_MASTER_SELECT_DDR, |
| 475 | { 6, 1, 18, 28, IPA_EE_Q6 } }, |
| 476 | [IPA_3_0][IPA_CLIENT_Q6_DECOMP_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 477 | true, IPA_v3_0_GROUP_Q6ZIP, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 478 | false, IPA_DPS_HPS_SEQ_TYPE_PKT_PROCESS_NO_DEC_UCP, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 479 | QMB_MASTER_SELECT_DDR, |
| 480 | { 7, 2, 0, 0, IPA_EE_Q6 } }, |
| 481 | [IPA_3_0][IPA_CLIENT_Q6_DECOMP2_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 482 | true, IPA_v3_0_GROUP_Q6ZIP, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 483 | false, IPA_DPS_HPS_SEQ_TYPE_PKT_PROCESS_NO_DEC_UCP, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 484 | QMB_MASTER_SELECT_DDR, |
| 485 | { 8, 3, 0, 0, IPA_EE_Q6 } }, |
| 486 | [IPA_3_0][IPA_CLIENT_MEMCPY_DMA_SYNC_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 487 | true, IPA_v3_0_GROUP_DMA, false, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 488 | IPA_DPS_HPS_SEQ_TYPE_DMA_ONLY, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 489 | QMB_MASTER_SELECT_PCIE, |
| 490 | { 12, 9, 8, 16, IPA_EE_AP } }, |
| 491 | [IPA_3_0][IPA_CLIENT_MEMCPY_DMA_ASYNC_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 492 | true, IPA_v3_0_GROUP_DMA, false, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 493 | IPA_DPS_HPS_SEQ_TYPE_DMA_ONLY, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 494 | QMB_MASTER_SELECT_PCIE, |
| 495 | { 13, 10, 8, 16, IPA_EE_AP } }, |
Sunil Paidimarri | 5139aa2 | 2017-02-13 11:07:32 -0800 | [diff] [blame] | 496 | [IPA_3_0][IPA_CLIENT_ETHERNET_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 497 | true, IPA_v3_0_GROUP_UL, true, |
Sunil Paidimarri | 5139aa2 | 2017-02-13 11:07:32 -0800 | [diff] [blame] | 498 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 499 | QMB_MASTER_SELECT_DDR, |
| 500 | {2, 0, 8, 16, IPA_EE_UC} }, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 501 | /* Only for test purpose */ |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 502 | [IPA_3_0][IPA_CLIENT_TEST_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 503 | true, IPA_v3_0_GROUP_UL, true, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 504 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 505 | QMB_MASTER_SELECT_DDR, |
| 506 | { 1, 3, 8, 16, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 507 | [IPA_3_0][IPA_CLIENT_TEST1_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 508 | true, IPA_v3_0_GROUP_UL, true, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 509 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 510 | QMB_MASTER_SELECT_DDR, |
| 511 | { 1, 3, 8, 16, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 512 | [IPA_3_0][IPA_CLIENT_TEST2_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 513 | true, IPA_v3_0_GROUP_UL, true, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 514 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 515 | QMB_MASTER_SELECT_DDR, |
| 516 | { 3, 5, 16, 32, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 517 | [IPA_3_0][IPA_CLIENT_TEST3_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 518 | true, IPA_v3_0_GROUP_UL, true, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 519 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 520 | QMB_MASTER_SELECT_DDR, |
| 521 | { 12, 9, 8, 16, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 522 | [IPA_3_0][IPA_CLIENT_TEST4_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 523 | true, IPA_v3_0_GROUP_UL, true, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 524 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 525 | QMB_MASTER_SELECT_DDR, |
| 526 | { 13, 10, 8, 16, IPA_EE_AP } }, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 527 | |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 528 | [IPA_3_0][IPA_CLIENT_WLAN1_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 529 | true, IPA_v3_0_GROUP_DL, false, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 530 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 531 | QMB_MASTER_SELECT_DDR, |
| 532 | { 25, 4, 8, 8, IPA_EE_UC } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 533 | [IPA_3_0][IPA_CLIENT_WLAN2_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 534 | true, IPA_v3_0_GROUP_DL, false, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 535 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 536 | QMB_MASTER_SELECT_DDR, |
| 537 | { 27, 4, 8, 8, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 538 | [IPA_3_0][IPA_CLIENT_WLAN3_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 539 | true, IPA_v3_0_GROUP_DL, false, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 540 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 541 | QMB_MASTER_SELECT_DDR, |
| 542 | { 28, 13, 8, 8, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 543 | [IPA_3_0][IPA_CLIENT_WLAN4_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 544 | true, IPA_v3_0_GROUP_DL, false, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 545 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 546 | QMB_MASTER_SELECT_DDR, |
| 547 | { 29, 14, 8, 8, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 548 | [IPA_3_0][IPA_CLIENT_USB_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 549 | true, IPA_v3_0_GROUP_DL, false, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 550 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 551 | QMB_MASTER_SELECT_DDR, |
| 552 | { 26, 12, 8, 8, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 553 | [IPA_3_0][IPA_CLIENT_USB_DPL_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 554 | true, IPA_v3_0_GROUP_DPL, false, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 555 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 556 | QMB_MASTER_SELECT_DDR, |
| 557 | { 17, 2, 8, 12, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 558 | [IPA_3_0][IPA_CLIENT_APPS_LAN_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 559 | true, IPA_v3_0_GROUP_UL, false, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 560 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 561 | QMB_MASTER_SELECT_DDR, |
| 562 | { 15, 7, 8, 12, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 563 | [IPA_3_0][IPA_CLIENT_APPS_WAN_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 564 | true, IPA_v3_0_GROUP_DL, false, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 565 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 566 | QMB_MASTER_SELECT_DDR, |
| 567 | { 16, 8, 8, 12, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 568 | [IPA_3_0][IPA_CLIENT_ODU_EMB_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 569 | true, IPA_v3_0_GROUP_DL, false, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 570 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 571 | QMB_MASTER_SELECT_DDR, |
| 572 | { 23, 1, 8, 8, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 573 | [IPA_3_0][IPA_CLIENT_MHI_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 574 | true, IPA_v3_0_GROUP_DL, false, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 575 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 576 | QMB_MASTER_SELECT_PCIE, |
| 577 | { 23, 1, 8, 8, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 578 | [IPA_3_0][IPA_CLIENT_Q6_LAN_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 579 | true, IPA_v3_0_GROUP_DL, false, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 580 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 581 | QMB_MASTER_SELECT_DDR, |
| 582 | { 19, 6, 8, 12, IPA_EE_Q6 } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 583 | [IPA_3_0][IPA_CLIENT_Q6_WAN_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 584 | true, IPA_v3_0_GROUP_UL, false, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 585 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 586 | QMB_MASTER_SELECT_DDR, |
| 587 | { 18, 5, 8, 12, IPA_EE_Q6 } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 588 | [IPA_3_0][IPA_CLIENT_Q6_DUN_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 589 | true, IPA_v3_0_GROUP_DIAG, false, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 590 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 591 | QMB_MASTER_SELECT_DDR, |
| 592 | { 30, 7, 4, 4, IPA_EE_Q6 } }, |
| 593 | [IPA_3_0][IPA_CLIENT_Q6_DECOMP_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 594 | true, IPA_v3_0_GROUP_Q6ZIP, false, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 595 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 596 | QMB_MASTER_SELECT_DDR, |
| 597 | { 21, 8, 4, 4, IPA_EE_Q6 } }, |
| 598 | [IPA_3_0][IPA_CLIENT_Q6_DECOMP2_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 599 | true, IPA_v3_0_GROUP_Q6ZIP, false, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 600 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 601 | QMB_MASTER_SELECT_DDR, |
| 602 | { 4, 9, 4, 4, IPA_EE_Q6 } }, |
| 603 | [IPA_3_0][IPA_CLIENT_MEMCPY_DMA_SYNC_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 604 | true, IPA_v3_0_GROUP_DMA, false, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 605 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 606 | QMB_MASTER_SELECT_PCIE, |
| 607 | { 28, 13, 8, 8, IPA_EE_AP } }, |
| 608 | [IPA_3_0][IPA_CLIENT_MEMCPY_DMA_ASYNC_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 609 | true, IPA_v3_0_GROUP_DMA, false, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 610 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 611 | QMB_MASTER_SELECT_PCIE, |
| 612 | { 29, 14, 8, 8, IPA_EE_AP } }, |
Sunil Paidimarri | 5139aa2 | 2017-02-13 11:07:32 -0800 | [diff] [blame] | 613 | [IPA_3_0][IPA_CLIENT_ETHERNET_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 614 | true, IPA_v3_0_GROUP_DL, false, |
Sunil Paidimarri | 5139aa2 | 2017-02-13 11:07:32 -0800 | [diff] [blame] | 615 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 616 | QMB_MASTER_SELECT_DDR, |
| 617 | {24, 3, 8, 8, IPA_EE_UC} }, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 618 | /* Only for test purpose */ |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 619 | [IPA_3_0][IPA_CLIENT_TEST_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 620 | true, IPA_v3_0_GROUP_DL, false, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 621 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 622 | QMB_MASTER_SELECT_DDR, |
| 623 | { 26, 12, 8, 8, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 624 | [IPA_3_0][IPA_CLIENT_TEST1_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 625 | true, IPA_v3_0_GROUP_DL, false, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 626 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 627 | QMB_MASTER_SELECT_DDR, |
| 628 | { 26, 12, 8, 8, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 629 | [IPA_3_0][IPA_CLIENT_TEST2_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 630 | true, IPA_v3_0_GROUP_DL, false, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 631 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 632 | QMB_MASTER_SELECT_DDR, |
| 633 | { 27, 4, 8, 8, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 634 | [IPA_3_0][IPA_CLIENT_TEST3_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 635 | true, IPA_v3_0_GROUP_DL, false, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 636 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 637 | QMB_MASTER_SELECT_DDR, |
| 638 | { 28, 13, 8, 8, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 639 | [IPA_3_0][IPA_CLIENT_TEST4_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 640 | true, IPA_v3_0_GROUP_DL, false, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 641 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 642 | QMB_MASTER_SELECT_DDR, |
| 643 | { 29, 14, 8, 8, IPA_EE_AP } }, |
Skylar Chang | 7fa2271 | 2017-04-03 18:29:21 -0700 | [diff] [blame] | 644 | /* Dummy consumer (pipe 31) is used in L2TP rt rule */ |
| 645 | [IPA_3_0][IPA_CLIENT_DUMMY_CONS] = { |
| 646 | true, IPA_v3_0_GROUP_DL, false, |
| 647 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 648 | QMB_MASTER_SELECT_DDR, |
| 649 | { 31, 31, 8, 8, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 650 | |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 651 | /* IPA_3_5 */ |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 652 | [IPA_3_5][IPA_CLIENT_WLAN1_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 653 | true, IPA_v3_5_GROUP_UL_DL, true, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 654 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 655 | QMB_MASTER_SELECT_DDR, |
Amir Levy | 1d68d70 | 2017-01-13 12:03:08 -0800 | [diff] [blame] | 656 | { 6, 1, 8, 16, IPA_EE_UC } }, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 657 | [IPA_3_5][IPA_CLIENT_USB_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 658 | true, IPA_v3_5_GROUP_UL_DL, true, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 659 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 660 | QMB_MASTER_SELECT_DDR, |
| 661 | { 0, 7, 8, 16, IPA_EE_AP } }, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 662 | [IPA_3_5][IPA_CLIENT_APPS_LAN_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 663 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | d664d50 | 2017-03-22 21:24:23 +0200 | [diff] [blame] | 664 | IPA_DPS_HPS_SEQ_TYPE_PKT_PROCESS_NO_DEC_UCP, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 665 | QMB_MASTER_SELECT_DDR, |
| 666 | { 8, 9, 8, 16, IPA_EE_AP } }, |
| 667 | [IPA_3_5][IPA_CLIENT_APPS_WAN_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 668 | true, IPA_v3_5_GROUP_UL_DL, true, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 669 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 670 | QMB_MASTER_SELECT_DDR, |
| 671 | { 2, 3, 16, 32, IPA_EE_AP } }, |
| 672 | [IPA_3_5][IPA_CLIENT_APPS_CMD_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 673 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 674 | IPA_DPS_HPS_SEQ_TYPE_DMA_ONLY, |
| 675 | QMB_MASTER_SELECT_DDR, |
| 676 | { 5, 4, 20, 23, IPA_EE_AP } }, |
| 677 | [IPA_3_5][IPA_CLIENT_ODU_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 678 | true, IPA_v3_5_GROUP_UL_DL, true, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 679 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 680 | QMB_MASTER_SELECT_DDR, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 681 | { 1, 0, 8, 16, IPA_EE_UC } }, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 682 | [IPA_3_5][IPA_CLIENT_Q6_LAN_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 683 | true, IPA_v3_5_GROUP_UL_DL, true, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 684 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 685 | QMB_MASTER_SELECT_DDR, |
| 686 | { 3, 0, 16, 32, IPA_EE_Q6 } }, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 687 | [IPA_3_5][IPA_CLIENT_Q6_CMD_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 688 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 689 | IPA_DPS_HPS_SEQ_TYPE_PKT_PROCESS_NO_DEC_UCP, |
| 690 | QMB_MASTER_SELECT_DDR, |
| 691 | { 4, 1, 20, 23, IPA_EE_Q6 } }, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 692 | /* Only for test purpose */ |
| 693 | [IPA_3_5][IPA_CLIENT_TEST_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 694 | true, IPA_v3_5_GROUP_UL_DL, true, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 695 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 696 | QMB_MASTER_SELECT_DDR, |
| 697 | {0, 7, 8, 16, IPA_EE_AP } }, |
| 698 | [IPA_3_5][IPA_CLIENT_TEST1_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 699 | true, IPA_v3_5_GROUP_UL_DL, true, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 700 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 701 | QMB_MASTER_SELECT_DDR, |
| 702 | {0, 7, 8, 16, IPA_EE_AP } }, |
| 703 | [IPA_3_5][IPA_CLIENT_TEST2_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 704 | true, IPA_v3_5_GROUP_UL_DL, true, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 705 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 706 | QMB_MASTER_SELECT_DDR, |
| 707 | { 1, 0, 8, 16, IPA_EE_AP } }, |
| 708 | [IPA_3_5][IPA_CLIENT_TEST3_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 709 | true, IPA_v3_5_GROUP_UL_DL, true, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 710 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 711 | QMB_MASTER_SELECT_DDR, |
| 712 | {7, 8, 8, 16, IPA_EE_AP } }, |
| 713 | [IPA_3_5][IPA_CLIENT_TEST4_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 714 | true, IPA_v3_5_GROUP_UL_DL, true, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 715 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 716 | QMB_MASTER_SELECT_DDR, |
| 717 | { 8, 9, 8, 16, IPA_EE_AP } }, |
| 718 | |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 719 | [IPA_3_5][IPA_CLIENT_WLAN1_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 720 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 721 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 722 | QMB_MASTER_SELECT_DDR, |
| 723 | { 16, 3, 8, 8, IPA_EE_UC } }, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 724 | [IPA_3_5][IPA_CLIENT_WLAN2_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 725 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 726 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 727 | QMB_MASTER_SELECT_DDR, |
| 728 | { 18, 12, 8, 8, IPA_EE_AP } }, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 729 | [IPA_3_5][IPA_CLIENT_WLAN3_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 730 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 731 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 732 | QMB_MASTER_SELECT_DDR, |
| 733 | { 19, 13, 8, 8, IPA_EE_AP } }, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 734 | [IPA_3_5][IPA_CLIENT_USB_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 735 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 736 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 737 | QMB_MASTER_SELECT_PCIE, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 738 | { 17, 11, 8, 8, IPA_EE_AP } }, |
| 739 | [IPA_3_5][IPA_CLIENT_USB_DPL_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 740 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 741 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 742 | QMB_MASTER_SELECT_DDR, |
| 743 | { 14, 10, 4, 6, IPA_EE_AP } }, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 744 | [IPA_3_5][IPA_CLIENT_APPS_LAN_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 745 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 746 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 747 | QMB_MASTER_SELECT_DDR, |
| 748 | { 9, 5, 8, 12, IPA_EE_AP } }, |
| 749 | [IPA_3_5][IPA_CLIENT_APPS_WAN_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 750 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 751 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 752 | QMB_MASTER_SELECT_DDR, |
| 753 | { 10, 6, 8, 12, IPA_EE_AP } }, |
| 754 | [IPA_3_5][IPA_CLIENT_ODU_EMB_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 755 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 756 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 757 | QMB_MASTER_SELECT_DDR, |
| 758 | { 15, 1, 8, 8, IPA_EE_AP } }, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 759 | [IPA_3_5][IPA_CLIENT_Q6_LAN_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 760 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 761 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 762 | QMB_MASTER_SELECT_DDR, |
| 763 | { 13, 3, 8, 12, IPA_EE_Q6 } }, |
| 764 | [IPA_3_5][IPA_CLIENT_Q6_WAN_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 765 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 766 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 767 | QMB_MASTER_SELECT_DDR, |
| 768 | { 12, 2, 8, 12, IPA_EE_Q6 } }, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 769 | /* Only for test purpose */ |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 770 | /* MBIM aggregation test pipes should have the same QMB as USB_CONS */ |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 771 | [IPA_3_5][IPA_CLIENT_TEST_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 772 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 773 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 774 | QMB_MASTER_SELECT_PCIE, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 775 | { 15, 1, 8, 8, IPA_EE_AP } }, |
| 776 | [IPA_3_5][IPA_CLIENT_TEST1_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 777 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 778 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 779 | QMB_MASTER_SELECT_DDR, |
| 780 | { 15, 1, 8, 8, IPA_EE_AP } }, |
| 781 | [IPA_3_5][IPA_CLIENT_TEST2_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 782 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 783 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 784 | QMB_MASTER_SELECT_PCIE, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 785 | { 17, 11, 8, 8, IPA_EE_AP } }, |
| 786 | [IPA_3_5][IPA_CLIENT_TEST3_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 787 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 788 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 789 | QMB_MASTER_SELECT_DDR, |
| 790 | { 18, 12, 8, 8, IPA_EE_AP } }, |
| 791 | [IPA_3_5][IPA_CLIENT_TEST4_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 792 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 793 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 794 | QMB_MASTER_SELECT_PCIE, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 795 | { 19, 13, 8, 8, IPA_EE_AP } }, |
Skylar Chang | 7fa2271 | 2017-04-03 18:29:21 -0700 | [diff] [blame] | 796 | /* Dummy consumer (pipe 31) is used in L2TP rt rule */ |
| 797 | [IPA_3_5][IPA_CLIENT_DUMMY_CONS] = { |
| 798 | true, IPA_v3_5_GROUP_UL_DL, false, |
| 799 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 800 | QMB_MASTER_SELECT_PCIE, |
| 801 | { 31, 31, 8, 8, IPA_EE_AP } }, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 802 | |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 803 | /* IPA_3_5_MHI */ |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 804 | [IPA_3_5_MHI][IPA_CLIENT_USB_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 805 | true, IPA_v3_5_MHI_GROUP_DDR, true, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 806 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 807 | QMB_MASTER_SELECT_DDR, |
| 808 | { 0, 7, 8, 16, IPA_EE_AP } }, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 809 | [IPA_3_5_MHI][IPA_CLIENT_APPS_WAN_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 810 | true, IPA_v3_5_MHI_GROUP_DDR, true, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 811 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 812 | QMB_MASTER_SELECT_DDR, |
| 813 | { 2, 3, 16, 32, IPA_EE_AP } }, |
| 814 | [IPA_3_5_MHI][IPA_CLIENT_APPS_CMD_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 815 | true, IPA_v3_5_MHI_GROUP_DDR, false, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 816 | IPA_DPS_HPS_SEQ_TYPE_DMA_ONLY, |
| 817 | QMB_MASTER_SELECT_DDR, |
| 818 | { 5, 4, 20, 23, IPA_EE_AP } }, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 819 | [IPA_3_5_MHI][IPA_CLIENT_MHI_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 820 | true, IPA_v3_5_MHI_GROUP_PCIE, true, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 821 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 822 | QMB_MASTER_SELECT_PCIE, |
| 823 | { 1, 0, 8, 16, IPA_EE_AP } }, |
| 824 | [IPA_3_5_MHI][IPA_CLIENT_Q6_LAN_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 825 | true, IPA_v3_5_MHI_GROUP_DDR, true, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 826 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 827 | QMB_MASTER_SELECT_DDR, |
| 828 | { 3, 0, 16, 32, IPA_EE_Q6 } }, |
| 829 | [IPA_3_5_MHI][IPA_CLIENT_Q6_WAN_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 830 | true, IPA_v3_5_MHI_GROUP_DDR, true, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 831 | IPA_DPS_HPS_SEQ_TYPE_PKT_PROCESS_NO_DEC_UCP, |
| 832 | QMB_MASTER_SELECT_DDR, |
| 833 | { 6, 4, 10, 30, IPA_EE_Q6 } }, |
| 834 | [IPA_3_5_MHI][IPA_CLIENT_Q6_CMD_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 835 | true, IPA_v3_5_MHI_GROUP_PCIE, false, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 836 | IPA_DPS_HPS_SEQ_TYPE_PKT_PROCESS_NO_DEC_UCP, |
| 837 | QMB_MASTER_SELECT_DDR, |
| 838 | { 4, 1, 20, 23, IPA_EE_Q6 } }, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 839 | [IPA_3_5_MHI][IPA_CLIENT_MEMCPY_DMA_SYNC_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 840 | true, IPA_v3_5_MHI_GROUP_DMA, false, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 841 | IPA_DPS_HPS_SEQ_TYPE_DMA_ONLY, |
| 842 | QMB_MASTER_SELECT_DDR, |
| 843 | { 7, 8, 8, 16, IPA_EE_AP } }, |
| 844 | [IPA_3_5_MHI][IPA_CLIENT_MEMCPY_DMA_ASYNC_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 845 | true, IPA_v3_5_MHI_GROUP_DMA, false, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 846 | IPA_DPS_HPS_SEQ_TYPE_DMA_ONLY, |
| 847 | QMB_MASTER_SELECT_DDR, |
| 848 | { 8, 9, 8, 16, IPA_EE_AP } }, |
| 849 | /* Only for test purpose */ |
| 850 | [IPA_3_5_MHI][IPA_CLIENT_TEST_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 851 | true, IPA_v3_5_MHI_GROUP_DDR, true, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 852 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 853 | QMB_MASTER_SELECT_DDR, |
| 854 | {0, 7, 8, 16, IPA_EE_AP } }, |
| 855 | [IPA_3_5_MHI][IPA_CLIENT_TEST1_PROD] = { |
| 856 | 0, IPA_v3_5_MHI_GROUP_DDR, true, |
| 857 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 858 | QMB_MASTER_SELECT_DDR, |
| 859 | {0, 7, 8, 16, IPA_EE_AP } }, |
| 860 | [IPA_3_5_MHI][IPA_CLIENT_TEST2_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 861 | true, IPA_v3_5_MHI_GROUP_PCIE, true, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 862 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 863 | QMB_MASTER_SELECT_PCIE, |
| 864 | { 1, 0, 8, 16, IPA_EE_AP } }, |
| 865 | [IPA_3_5_MHI][IPA_CLIENT_TEST3_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 866 | true, IPA_v3_5_MHI_GROUP_DMA, true, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 867 | IPA_DPS_HPS_SEQ_TYPE_DMA_ONLY, |
| 868 | QMB_MASTER_SELECT_DDR, |
| 869 | {7, 8, 8, 16, IPA_EE_AP } }, |
| 870 | [IPA_3_5_MHI][IPA_CLIENT_TEST4_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 871 | true, IPA_v3_5_MHI_GROUP_DMA, true, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 872 | IPA_DPS_HPS_SEQ_TYPE_DMA_ONLY, |
| 873 | QMB_MASTER_SELECT_DDR, |
| 874 | { 8, 9, 8, 16, IPA_EE_AP } }, |
| 875 | |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 876 | [IPA_3_5_MHI][IPA_CLIENT_WLAN1_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 877 | true, IPA_v3_5_MHI_GROUP_DDR, false, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 878 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 879 | QMB_MASTER_SELECT_DDR, |
| 880 | { 16, 3, 8, 8, IPA_EE_UC } }, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 881 | [IPA_3_5_MHI][IPA_CLIENT_USB_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 882 | true, IPA_v3_5_MHI_GROUP_DDR, false, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 883 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 884 | QMB_MASTER_SELECT_DDR, |
| 885 | { 17, 11, 8, 8, IPA_EE_AP } }, |
| 886 | [IPA_3_5_MHI][IPA_CLIENT_USB_DPL_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 887 | true, IPA_v3_5_MHI_GROUP_DDR, false, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 888 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 889 | QMB_MASTER_SELECT_DDR, |
| 890 | { 14, 10, 4, 6, IPA_EE_AP } }, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 891 | [IPA_3_5_MHI][IPA_CLIENT_APPS_LAN_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 892 | true, IPA_v3_5_MHI_GROUP_DDR, false, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 893 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 894 | QMB_MASTER_SELECT_DDR, |
| 895 | { 9, 5, 8, 12, IPA_EE_AP } }, |
| 896 | [IPA_3_5_MHI][IPA_CLIENT_APPS_WAN_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 897 | true, IPA_v3_5_MHI_GROUP_DDR, false, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 898 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 899 | QMB_MASTER_SELECT_DDR, |
| 900 | { 10, 6, 8, 12, IPA_EE_AP } }, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 901 | [IPA_3_5_MHI][IPA_CLIENT_MHI_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 902 | true, IPA_v3_5_MHI_GROUP_PCIE, false, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 903 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 904 | QMB_MASTER_SELECT_PCIE, |
| 905 | { 15, 1, 8, 8, IPA_EE_AP } }, |
| 906 | [IPA_3_5_MHI][IPA_CLIENT_Q6_LAN_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 907 | true, IPA_v3_5_MHI_GROUP_DDR, false, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 908 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 909 | QMB_MASTER_SELECT_DDR, |
| 910 | { 13, 3, 8, 12, IPA_EE_Q6 } }, |
| 911 | [IPA_3_5_MHI][IPA_CLIENT_Q6_WAN_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 912 | true, IPA_v3_5_MHI_GROUP_DDR, false, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 913 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 914 | QMB_MASTER_SELECT_DDR, |
| 915 | { 12, 2, 8, 12, IPA_EE_Q6 } }, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 916 | [IPA_3_5_MHI][IPA_CLIENT_MEMCPY_DMA_SYNC_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 917 | true, IPA_v3_5_MHI_GROUP_DMA, false, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 918 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 919 | QMB_MASTER_SELECT_PCIE, |
| 920 | { 18, 12, 8, 8, IPA_EE_AP } }, |
| 921 | [IPA_3_5_MHI][IPA_CLIENT_MEMCPY_DMA_ASYNC_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 922 | true, IPA_v3_5_MHI_GROUP_DMA, false, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 923 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 924 | QMB_MASTER_SELECT_PCIE, |
| 925 | { 19, 13, 8, 8, IPA_EE_AP } }, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 926 | /* Only for test purpose */ |
| 927 | [IPA_3_5_MHI][IPA_CLIENT_TEST_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 928 | true, IPA_v3_5_MHI_GROUP_PCIE, false, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 929 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 930 | QMB_MASTER_SELECT_PCIE, |
| 931 | { 15, 1, 8, 8, IPA_EE_AP } }, |
| 932 | [IPA_3_5_MHI][IPA_CLIENT_TEST1_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 933 | true, IPA_v3_5_MHI_GROUP_PCIE, false, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 934 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 935 | QMB_MASTER_SELECT_PCIE, |
| 936 | { 15, 1, 8, 8, IPA_EE_AP } }, |
| 937 | [IPA_3_5_MHI][IPA_CLIENT_TEST2_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 938 | true, IPA_v3_5_MHI_GROUP_DDR, false, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 939 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 940 | QMB_MASTER_SELECT_DDR, |
| 941 | { 17, 11, 8, 8, IPA_EE_AP } }, |
| 942 | [IPA_3_5_MHI][IPA_CLIENT_TEST3_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 943 | true, IPA_v3_5_MHI_GROUP_DMA, false, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 944 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 945 | QMB_MASTER_SELECT_PCIE, |
| 946 | { 18, 12, 8, 8, IPA_EE_AP } }, |
| 947 | [IPA_3_5_MHI][IPA_CLIENT_TEST4_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 948 | true, IPA_v3_5_MHI_GROUP_DMA, false, |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 949 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 950 | QMB_MASTER_SELECT_PCIE, |
| 951 | { 19, 13, 8, 8, IPA_EE_AP } }, |
Skylar Chang | 7fa2271 | 2017-04-03 18:29:21 -0700 | [diff] [blame] | 952 | /* Dummy consumer (pipe 31) is used in L2TP rt rule */ |
| 953 | [IPA_3_5_MHI][IPA_CLIENT_DUMMY_CONS] = { |
| 954 | true, IPA_v3_5_MHI_GROUP_DMA, false, |
| 955 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 956 | QMB_MASTER_SELECT_PCIE, |
| 957 | { 31, 31, 8, 8, IPA_EE_AP } }, |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 958 | |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 959 | /* IPA_3_5_1 */ |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 960 | [IPA_3_5_1][IPA_CLIENT_WLAN1_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 961 | true, IPA_v3_5_GROUP_UL_DL, true, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 962 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 963 | QMB_MASTER_SELECT_DDR, |
| 964 | { 7, 1, 8, 16, IPA_EE_UC } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 965 | [IPA_3_5_1][IPA_CLIENT_USB_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 966 | true, IPA_v3_5_GROUP_UL_DL, true, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 967 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 968 | QMB_MASTER_SELECT_DDR, |
| 969 | { 0, 0, 8, 16, IPA_EE_AP } }, |
Ghanim Fodi | c6b6749 | 2017-03-15 14:19:56 +0200 | [diff] [blame] | 970 | [IPA_3_5_1][IPA_CLIENT_APPS_LAN_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 971 | true, IPA_v3_5_GROUP_UL_DL, false, |
Ghanim Fodi | c6b6749 | 2017-03-15 14:19:56 +0200 | [diff] [blame] | 972 | IPA_DPS_HPS_SEQ_TYPE_PKT_PROCESS_NO_DEC_UCP, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 973 | QMB_MASTER_SELECT_DDR, |
| 974 | { 8, 7, 8, 16, IPA_EE_AP } }, |
Ghanim Fodi | c6b6749 | 2017-03-15 14:19:56 +0200 | [diff] [blame] | 975 | [IPA_3_5_1][IPA_CLIENT_APPS_WAN_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 976 | true, IPA_v3_5_GROUP_UL_DL, true, |
Ghanim Fodi | c6b6749 | 2017-03-15 14:19:56 +0200 | [diff] [blame] | 977 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 978 | QMB_MASTER_SELECT_DDR, |
| 979 | { 2, 3, 16, 32, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 980 | [IPA_3_5_1][IPA_CLIENT_APPS_CMD_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 981 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 982 | IPA_DPS_HPS_SEQ_TYPE_DMA_ONLY, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 983 | QMB_MASTER_SELECT_DDR, |
| 984 | { 5, 4, 20, 23, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 985 | [IPA_3_5_1][IPA_CLIENT_Q6_LAN_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 986 | true, IPA_v3_5_GROUP_UL_DL, true, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 987 | IPA_DPS_HPS_SEQ_TYPE_PKT_PROCESS_NO_DEC_UCP, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 988 | QMB_MASTER_SELECT_DDR, |
| 989 | { 3, 0, 16, 32, IPA_EE_Q6 } }, |
| 990 | [IPA_3_5_1][IPA_CLIENT_Q6_WAN_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 991 | true, IPA_v3_5_GROUP_UL_DL, true, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 992 | IPA_DPS_HPS_SEQ_TYPE_PKT_PROCESS_NO_DEC_UCP, |
| 993 | QMB_MASTER_SELECT_DDR, |
| 994 | { 6, 4, 12, 30, IPA_EE_Q6 } }, |
| 995 | [IPA_3_5_1][IPA_CLIENT_Q6_CMD_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 996 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 997 | IPA_DPS_HPS_SEQ_TYPE_PKT_PROCESS_NO_DEC_UCP, |
| 998 | QMB_MASTER_SELECT_DDR, |
| 999 | { 4, 1, 20, 23, IPA_EE_Q6 } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1000 | /* Only for test purpose */ |
| 1001 | [IPA_3_5_1][IPA_CLIENT_TEST_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1002 | true, IPA_v3_5_GROUP_UL_DL, true, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1003 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 1004 | QMB_MASTER_SELECT_DDR, |
| 1005 | { 0, 0, 8, 16, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1006 | [IPA_3_5_1][IPA_CLIENT_TEST1_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1007 | true, IPA_v3_5_GROUP_UL_DL, true, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1008 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 1009 | QMB_MASTER_SELECT_DDR, |
| 1010 | { 0, 0, 8, 16, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1011 | [IPA_3_5_1][IPA_CLIENT_TEST2_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1012 | true, IPA_v3_5_GROUP_UL_DL, true, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1013 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 1014 | QMB_MASTER_SELECT_DDR, |
| 1015 | { 2, 3, 16, 32, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1016 | [IPA_3_5_1][IPA_CLIENT_TEST3_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1017 | true, IPA_v3_5_GROUP_UL_DL, true, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1018 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 1019 | QMB_MASTER_SELECT_DDR, |
| 1020 | { 4, 1, 20, 23, IPA_EE_Q6 } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1021 | [IPA_3_5_1][IPA_CLIENT_TEST4_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1022 | true, IPA_v3_5_GROUP_UL_DL, true, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1023 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 1024 | QMB_MASTER_SELECT_DDR, |
| 1025 | { 1, 0, 8, 16, IPA_EE_UC } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1026 | |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1027 | [IPA_3_5_1][IPA_CLIENT_WLAN1_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1028 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1029 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 1030 | QMB_MASTER_SELECT_DDR, |
| 1031 | { 16, 3, 8, 8, IPA_EE_UC } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1032 | [IPA_3_5_1][IPA_CLIENT_WLAN2_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1033 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1034 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 1035 | QMB_MASTER_SELECT_DDR, |
| 1036 | { 18, 9, 8, 8, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1037 | [IPA_3_5_1][IPA_CLIENT_WLAN3_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1038 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1039 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 1040 | QMB_MASTER_SELECT_DDR, |
| 1041 | { 19, 10, 8, 8, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1042 | [IPA_3_5_1][IPA_CLIENT_USB_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1043 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1044 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 1045 | QMB_MASTER_SELECT_DDR, |
| 1046 | { 17, 8, 8, 8, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1047 | [IPA_3_5_1][IPA_CLIENT_USB_DPL_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1048 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1049 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 1050 | QMB_MASTER_SELECT_DDR, |
| 1051 | { 11, 2, 4, 6, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1052 | [IPA_3_5_1][IPA_CLIENT_APPS_LAN_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1053 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1054 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 1055 | QMB_MASTER_SELECT_DDR, |
| 1056 | { 9, 5, 8, 12, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1057 | [IPA_3_5_1][IPA_CLIENT_APPS_WAN_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1058 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1059 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 1060 | QMB_MASTER_SELECT_DDR, |
| 1061 | { 10, 6, 8, 12, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1062 | [IPA_3_5_1][IPA_CLIENT_Q6_LAN_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1063 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1064 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 1065 | QMB_MASTER_SELECT_DDR, |
| 1066 | { 13, 3, 8, 12, IPA_EE_Q6 } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1067 | [IPA_3_5_1][IPA_CLIENT_Q6_WAN_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1068 | true, IPA_v3_5_GROUP_UL_DL, false, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1069 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 1070 | QMB_MASTER_SELECT_DDR, |
| 1071 | { 12, 2, 8, 12, IPA_EE_Q6 } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1072 | /* Only for test purpose */ |
| 1073 | [IPA_3_5_1][IPA_CLIENT_TEST_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1074 | true, IPA_v3_5_GROUP_UL_DL, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1075 | false, |
| 1076 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 1077 | QMB_MASTER_SELECT_DDR, |
| 1078 | { 17, 8, 8, 8, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1079 | [IPA_3_5_1][IPA_CLIENT_TEST1_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1080 | true, IPA_v3_5_GROUP_UL_DL, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1081 | false, |
| 1082 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 1083 | QMB_MASTER_SELECT_DDR, |
| 1084 | { 17, 8, 8, 8, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1085 | [IPA_3_5_1][IPA_CLIENT_TEST2_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1086 | true, IPA_v3_5_GROUP_UL_DL, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1087 | false, |
| 1088 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 1089 | QMB_MASTER_SELECT_DDR, |
| 1090 | { 18, 9, 8, 8, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1091 | [IPA_3_5_1][IPA_CLIENT_TEST3_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1092 | true, IPA_v3_5_GROUP_UL_DL, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1093 | false, |
| 1094 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 1095 | QMB_MASTER_SELECT_DDR, |
| 1096 | { 19, 10, 8, 8, IPA_EE_AP } }, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1097 | [IPA_3_5_1][IPA_CLIENT_TEST4_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1098 | true, IPA_v3_5_GROUP_UL_DL, |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 1099 | false, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1100 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 1101 | QMB_MASTER_SELECT_DDR, |
| 1102 | { 11, 2, 4, 6, IPA_EE_AP } }, |
Skylar Chang | 7fa2271 | 2017-04-03 18:29:21 -0700 | [diff] [blame] | 1103 | /* Dummy consumer (pipe 31) is used in L2TP rt rule */ |
| 1104 | [IPA_3_5_1][IPA_CLIENT_DUMMY_CONS] = { |
| 1105 | true, IPA_v3_5_GROUP_UL_DL, |
| 1106 | false, |
| 1107 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1108 | QMB_MASTER_SELECT_DDR, |
| 1109 | { 31, 31, 8, 8, IPA_EE_AP } }, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1110 | |
| 1111 | /* IPA_4_0 */ |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1112 | [IPA_4_0][IPA_CLIENT_WLAN1_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1113 | true, IPA_v4_0_GROUP_UL_DL, |
| 1114 | true, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1115 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 1116 | QMB_MASTER_SELECT_DDR, |
| 1117 | { 7, 9, 8, 16, IPA_EE_AP } }, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1118 | [IPA_4_0][IPA_CLIENT_USB_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1119 | true, IPA_v4_0_GROUP_UL_DL, |
| 1120 | true, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1121 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 1122 | QMB_MASTER_SELECT_DDR, |
| 1123 | { 0, 8, 8, 16, IPA_EE_AP } }, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1124 | [IPA_4_0][IPA_CLIENT_APPS_LAN_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1125 | true, IPA_v4_0_GROUP_UL_DL, |
| 1126 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1127 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 1128 | QMB_MASTER_SELECT_DDR, |
| 1129 | { 8, 10, 8, 16, IPA_EE_AP } }, |
| 1130 | [IPA_4_0][IPA_CLIENT_APPS_WAN_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1131 | true, IPA_v4_0_GROUP_UL_DL, |
| 1132 | true, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1133 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 1134 | QMB_MASTER_SELECT_DDR, |
| 1135 | { 2, 3, 16, 32, IPA_EE_AP } }, |
| 1136 | [IPA_4_0][IPA_CLIENT_APPS_CMD_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1137 | true, IPA_v4_0_GROUP_UL_DL, |
| 1138 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1139 | IPA_DPS_HPS_SEQ_TYPE_DMA_ONLY, |
| 1140 | QMB_MASTER_SELECT_DDR, |
| 1141 | { 5, 4, 20, 24, IPA_EE_AP } }, |
| 1142 | [IPA_4_0][IPA_CLIENT_ODU_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1143 | true, IPA_v4_0_GROUP_UL_DL, |
| 1144 | true, |
Skylar Chang | 6f6e307 | 2017-07-28 10:03:47 -0700 | [diff] [blame] | 1145 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1146 | QMB_MASTER_SELECT_DDR, |
Michael Adisumarta | 22b1721 | 2017-05-31 10:41:12 -0700 | [diff] [blame] | 1147 | { 1, 0, 8, 16, IPA_EE_AP } }, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1148 | [IPA_4_0][IPA_CLIENT_ETHERNET_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1149 | true, IPA_v4_0_GROUP_UL_DL, |
| 1150 | true, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1151 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 1152 | QMB_MASTER_SELECT_DDR, |
| 1153 | { 9, 0, 8, 16, IPA_EE_UC } }, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1154 | [IPA_4_0][IPA_CLIENT_Q6_LAN_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1155 | true, IPA_v4_0_GROUP_UL_DL, |
| 1156 | true, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1157 | IPA_DPS_HPS_SEQ_TYPE_PKT_PROCESS_NO_DEC_UCP, |
| 1158 | QMB_MASTER_SELECT_DDR, |
| 1159 | { 6, 2, 12, 24, IPA_EE_Q6 } }, |
| 1160 | [IPA_4_0][IPA_CLIENT_Q6_WAN_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1161 | true, IPA_v4_0_GROUP_UL_DL, |
| 1162 | true, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1163 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 1164 | QMB_MASTER_SELECT_DDR, |
| 1165 | { 3, 0, 16, 32, IPA_EE_Q6 } }, |
| 1166 | [IPA_4_0][IPA_CLIENT_Q6_CMD_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1167 | true, IPA_v4_0_GROUP_UL_DL, |
| 1168 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1169 | IPA_DPS_HPS_SEQ_TYPE_PKT_PROCESS_NO_DEC_UCP, |
| 1170 | QMB_MASTER_SELECT_DDR, |
| 1171 | { 4, 1, 20, 24, IPA_EE_Q6 } }, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1172 | /* Only for test purpose */ |
| 1173 | [IPA_4_0][IPA_CLIENT_TEST_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1174 | true, IPA_v4_0_GROUP_UL_DL, |
| 1175 | true, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1176 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 1177 | QMB_MASTER_SELECT_DDR, |
| 1178 | {0, 8, 8, 16, IPA_EE_AP } }, |
| 1179 | [IPA_4_0][IPA_CLIENT_TEST1_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1180 | true, IPA_v4_0_GROUP_UL_DL, |
| 1181 | true, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1182 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 1183 | QMB_MASTER_SELECT_DDR, |
| 1184 | {0, 8, 8, 16, IPA_EE_AP } }, |
| 1185 | [IPA_4_0][IPA_CLIENT_TEST2_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1186 | true, IPA_v4_0_GROUP_UL_DL, |
| 1187 | true, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1188 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 1189 | QMB_MASTER_SELECT_DDR, |
| 1190 | { 1, 0, 8, 16, IPA_EE_AP } }, |
| 1191 | [IPA_4_0][IPA_CLIENT_TEST3_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1192 | true, IPA_v4_0_GROUP_UL_DL, |
| 1193 | true, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1194 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 1195 | QMB_MASTER_SELECT_DDR, |
| 1196 | {7, 9, 8, 16, IPA_EE_AP } }, |
| 1197 | [IPA_4_0][IPA_CLIENT_TEST4_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1198 | true, IPA_v4_0_GROUP_UL_DL, |
| 1199 | true, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1200 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 1201 | QMB_MASTER_SELECT_DDR, |
| 1202 | { 8, 10, 8, 16, IPA_EE_AP } }, |
| 1203 | |
| 1204 | |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1205 | [IPA_4_0][IPA_CLIENT_WLAN1_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1206 | true, IPA_v4_0_GROUP_UL_DL, |
| 1207 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1208 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1209 | QMB_MASTER_SELECT_DDR, |
| 1210 | { 18, 12, 6, 9, IPA_EE_AP } }, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1211 | [IPA_4_0][IPA_CLIENT_WLAN2_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1212 | true, IPA_v4_0_GROUP_UL_DL, |
| 1213 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1214 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1215 | QMB_MASTER_SELECT_DDR, |
| 1216 | { 20, 14, 9, 9, IPA_EE_AP } }, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1217 | [IPA_4_0][IPA_CLIENT_WLAN3_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1218 | true, IPA_v4_0_GROUP_UL_DL, |
| 1219 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1220 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1221 | QMB_MASTER_SELECT_DDR, |
| 1222 | { 21, 15, 9, 9, IPA_EE_AP } }, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1223 | [IPA_4_0][IPA_CLIENT_USB_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1224 | true, IPA_v4_0_GROUP_UL_DL, |
| 1225 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1226 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1227 | QMB_MASTER_SELECT_PCIE, |
| 1228 | { 19, 13, 9, 9, IPA_EE_AP } }, |
| 1229 | [IPA_4_0][IPA_CLIENT_USB_DPL_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1230 | true, IPA_v4_0_GROUP_UL_DL, |
| 1231 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1232 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1233 | QMB_MASTER_SELECT_DDR, |
| 1234 | { 15, 7, 5, 5, IPA_EE_AP } }, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1235 | [IPA_4_0][IPA_CLIENT_APPS_LAN_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1236 | true, IPA_v4_0_GROUP_UL_DL, |
| 1237 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1238 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1239 | QMB_MASTER_SELECT_DDR, |
| 1240 | { 10, 5, 9, 9, IPA_EE_AP } }, |
| 1241 | [IPA_4_0][IPA_CLIENT_APPS_WAN_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1242 | true, IPA_v4_0_GROUP_UL_DL, |
| 1243 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1244 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1245 | QMB_MASTER_SELECT_DDR, |
| 1246 | { 11, 6, 9, 9, IPA_EE_AP } }, |
| 1247 | [IPA_4_0][IPA_CLIENT_ODU_EMB_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1248 | true, IPA_v4_0_GROUP_UL_DL, |
| 1249 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1250 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1251 | QMB_MASTER_SELECT_DDR, |
| 1252 | { 17, 1, 17, 17, IPA_EE_AP } }, |
| 1253 | [IPA_4_0][IPA_CLIENT_ETHERNET_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1254 | true, IPA_v4_0_GROUP_UL_DL, |
| 1255 | true, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1256 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1257 | QMB_MASTER_SELECT_DDR, |
| 1258 | { 22, 1, 17, 17, IPA_EE_UC } }, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1259 | [IPA_4_0][IPA_CLIENT_Q6_LAN_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1260 | true, IPA_v4_0_GROUP_UL_DL, |
| 1261 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1262 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1263 | QMB_MASTER_SELECT_DDR, |
| 1264 | { 14, 4, 9, 9, IPA_EE_Q6 } }, |
| 1265 | [IPA_4_0][IPA_CLIENT_Q6_WAN_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1266 | true, IPA_v4_0_GROUP_UL_DL, |
| 1267 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1268 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1269 | QMB_MASTER_SELECT_DDR, |
| 1270 | { 13, 3, 9, 9, IPA_EE_Q6 } }, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1271 | [IPA_4_0][IPA_CLIENT_Q6_LTE_WIFI_AGGR_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1272 | true, IPA_v4_0_GROUP_UL_DL, |
| 1273 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1274 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1275 | QMB_MASTER_SELECT_DDR, |
| 1276 | { 16, 5, 9, 9, IPA_EE_Q6 } }, |
| 1277 | /* Only for test purpose */ |
| 1278 | /* MBIM aggregation test pipes should have the same QMB as USB_CONS */ |
| 1279 | [IPA_4_0][IPA_CLIENT_TEST_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1280 | true, IPA_v4_0_GROUP_UL_DL, |
| 1281 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1282 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1283 | QMB_MASTER_SELECT_PCIE, |
| 1284 | { 12, 2, 5, 5, IPA_EE_AP } }, |
| 1285 | [IPA_4_0][IPA_CLIENT_TEST1_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1286 | true, IPA_v4_0_GROUP_UL_DL, |
| 1287 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1288 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1289 | QMB_MASTER_SELECT_DDR, |
| 1290 | { 12, 2, 5, 5, IPA_EE_AP } }, |
| 1291 | [IPA_4_0][IPA_CLIENT_TEST2_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1292 | true, IPA_v4_0_GROUP_UL_DL, |
| 1293 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1294 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1295 | QMB_MASTER_SELECT_PCIE, |
| 1296 | { 18, 12, 6, 9, IPA_EE_AP } }, |
| 1297 | [IPA_4_0][IPA_CLIENT_TEST3_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1298 | true, IPA_v4_0_GROUP_UL_DL, |
| 1299 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1300 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1301 | QMB_MASTER_SELECT_DDR, |
| 1302 | { 20, 14, 9, 9, IPA_EE_AP } }, |
| 1303 | [IPA_4_0][IPA_CLIENT_TEST4_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1304 | true, IPA_v4_0_GROUP_UL_DL, |
| 1305 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1306 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1307 | QMB_MASTER_SELECT_PCIE, |
| 1308 | { 21, 15, 9, 9, IPA_EE_AP } }, |
Skylar Chang | 7fa2271 | 2017-04-03 18:29:21 -0700 | [diff] [blame] | 1309 | /* Dummy consumer (pipe 31) is used in L2TP rt rule */ |
| 1310 | [IPA_4_0][IPA_CLIENT_DUMMY_CONS] = { |
| 1311 | true, IPA_v4_0_GROUP_UL_DL, |
| 1312 | false, |
| 1313 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1314 | QMB_MASTER_SELECT_DDR, |
| 1315 | { 31, 31, 8, 8, IPA_EE_AP } }, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1316 | |
| 1317 | /* IPA_4_0_MHI */ |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1318 | [IPA_4_0_MHI][IPA_CLIENT_USB_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1319 | true, IPA_v4_0_MHI_GROUP_DDR, |
| 1320 | true, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1321 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 1322 | QMB_MASTER_SELECT_DDR, |
| 1323 | { 0, 8, 8, 16, IPA_EE_AP } }, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1324 | [IPA_4_0_MHI][IPA_CLIENT_APPS_WAN_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1325 | true, IPA_v4_0_MHI_GROUP_DDR, |
| 1326 | true, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1327 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 1328 | QMB_MASTER_SELECT_DDR, |
| 1329 | { 2, 3, 16, 32, IPA_EE_AP } }, |
| 1330 | [IPA_4_0_MHI][IPA_CLIENT_APPS_CMD_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1331 | true, IPA_v4_0_MHI_GROUP_DDR, |
| 1332 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1333 | IPA_DPS_HPS_SEQ_TYPE_DMA_ONLY, |
| 1334 | QMB_MASTER_SELECT_DDR, |
| 1335 | { 5, 4, 20, 24, IPA_EE_AP } }, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1336 | [IPA_4_0_MHI][IPA_CLIENT_MHI_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1337 | true, IPA_v4_0_MHI_GROUP_PCIE, |
| 1338 | true, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1339 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 1340 | QMB_MASTER_SELECT_PCIE, |
| 1341 | { 1, 0, 8, 16, IPA_EE_AP } }, |
| 1342 | [IPA_4_0_MHI][IPA_CLIENT_Q6_LAN_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1343 | true, IPA_v4_0_MHI_GROUP_DDR, |
| 1344 | true, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1345 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 1346 | QMB_MASTER_SELECT_DDR, |
| 1347 | { 3, 0, 16, 32, IPA_EE_Q6 } }, |
| 1348 | [IPA_4_0_MHI][IPA_CLIENT_Q6_WAN_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1349 | true, IPA_v4_0_GROUP_UL_DL, |
| 1350 | true, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1351 | IPA_DPS_HPS_SEQ_TYPE_PKT_PROCESS_NO_DEC_UCP, |
| 1352 | QMB_MASTER_SELECT_DDR, |
| 1353 | { 6, 2, 12, 24, IPA_EE_Q6 } }, |
| 1354 | [IPA_4_0_MHI][IPA_CLIENT_Q6_CMD_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1355 | true, IPA_v4_0_MHI_GROUP_PCIE, |
| 1356 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1357 | IPA_DPS_HPS_SEQ_TYPE_PKT_PROCESS_NO_DEC_UCP, |
| 1358 | QMB_MASTER_SELECT_DDR, |
| 1359 | { 4, 1, 20, 24, IPA_EE_Q6 } }, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1360 | [IPA_4_0_MHI][IPA_CLIENT_MEMCPY_DMA_SYNC_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1361 | true, IPA_v4_0_MHI_GROUP_DMA, |
| 1362 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1363 | IPA_DPS_HPS_SEQ_TYPE_DMA_ONLY, |
| 1364 | QMB_MASTER_SELECT_DDR, |
| 1365 | { 7, 9, 8, 16, IPA_EE_AP } }, |
| 1366 | [IPA_4_0_MHI][IPA_CLIENT_MEMCPY_DMA_ASYNC_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1367 | true, IPA_v4_0_MHI_GROUP_DMA, |
| 1368 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1369 | IPA_DPS_HPS_SEQ_TYPE_DMA_ONLY, |
| 1370 | QMB_MASTER_SELECT_DDR, |
| 1371 | { 8, 10, 8, 16, IPA_EE_AP } }, |
| 1372 | /* Only for test purpose */ |
| 1373 | [IPA_4_0_MHI][IPA_CLIENT_TEST_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1374 | true, IPA_v4_0_GROUP_UL_DL, |
| 1375 | true, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1376 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 1377 | QMB_MASTER_SELECT_DDR, |
| 1378 | {0, 8, 8, 16, IPA_EE_AP } }, |
| 1379 | [IPA_4_0][IPA_CLIENT_TEST1_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1380 | true, IPA_v4_0_GROUP_UL_DL, |
| 1381 | true, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1382 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 1383 | QMB_MASTER_SELECT_DDR, |
| 1384 | {0, 8, 8, 16, IPA_EE_AP } }, |
| 1385 | [IPA_4_0_MHI][IPA_CLIENT_TEST2_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1386 | true, IPA_v4_0_GROUP_UL_DL, |
| 1387 | true, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1388 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 1389 | QMB_MASTER_SELECT_DDR, |
| 1390 | { 1, 0, 8, 16, IPA_EE_AP } }, |
| 1391 | [IPA_4_0_MHI][IPA_CLIENT_TEST3_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1392 | true, IPA_v4_0_GROUP_UL_DL, |
| 1393 | true, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1394 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 1395 | QMB_MASTER_SELECT_DDR, |
| 1396 | {7, 9, 8, 16, IPA_EE_AP } }, |
| 1397 | [IPA_4_0_MHI][IPA_CLIENT_TEST4_PROD] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1398 | true, IPA_v4_0_GROUP_UL_DL, |
| 1399 | true, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1400 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP, |
| 1401 | QMB_MASTER_SELECT_DDR, |
| 1402 | { 8, 10, 8, 16, IPA_EE_AP } }, |
| 1403 | |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1404 | [IPA_4_0_MHI][IPA_CLIENT_USB_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1405 | true, IPA_v4_0_MHI_GROUP_DDR, |
| 1406 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1407 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1408 | QMB_MASTER_SELECT_DDR, |
| 1409 | { 19, 13, 9, 9, IPA_EE_AP } }, |
| 1410 | [IPA_4_0_MHI][IPA_CLIENT_USB_DPL_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1411 | true, IPA_v4_0_MHI_GROUP_DDR, |
| 1412 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1413 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1414 | QMB_MASTER_SELECT_DDR, |
| 1415 | { 15, 7, 5, 5, IPA_EE_AP } }, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1416 | [IPA_4_0_MHI][IPA_CLIENT_APPS_LAN_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1417 | true, IPA_v4_0_MHI_GROUP_DDR, |
| 1418 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1419 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1420 | QMB_MASTER_SELECT_DDR, |
| 1421 | { 10, 5, 9, 9, IPA_EE_AP } }, |
| 1422 | [IPA_4_0_MHI][IPA_CLIENT_APPS_WAN_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1423 | true, IPA_v4_0_MHI_GROUP_DDR, |
| 1424 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1425 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1426 | QMB_MASTER_SELECT_DDR, |
| 1427 | { 11, 6, 9, 9, IPA_EE_AP } }, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1428 | [IPA_4_0_MHI][IPA_CLIENT_MHI_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1429 | true, IPA_v4_0_MHI_GROUP_PCIE, |
| 1430 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1431 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1432 | QMB_MASTER_SELECT_PCIE, |
| 1433 | { 17, 1, 17, 17, IPA_EE_AP } }, |
| 1434 | [IPA_4_0_MHI][IPA_CLIENT_Q6_LAN_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1435 | true, IPA_v4_0_MHI_GROUP_DDR, |
| 1436 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1437 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1438 | QMB_MASTER_SELECT_DDR, |
| 1439 | { 14, 4, 9, 9, IPA_EE_Q6 } }, |
| 1440 | [IPA_4_0_MHI][IPA_CLIENT_Q6_WAN_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1441 | true, IPA_v4_0_MHI_GROUP_DDR, |
| 1442 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1443 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1444 | QMB_MASTER_SELECT_DDR, |
| 1445 | { 13, 3, 9, 9, IPA_EE_Q6 } }, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1446 | [IPA_4_0_MHI][IPA_CLIENT_MEMCPY_DMA_SYNC_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1447 | true, IPA_v4_0_MHI_GROUP_DMA, |
| 1448 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1449 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1450 | QMB_MASTER_SELECT_PCIE, |
| 1451 | { 20, 14, 9, 9, IPA_EE_AP } }, |
| 1452 | [IPA_4_0_MHI][IPA_CLIENT_MEMCPY_DMA_ASYNC_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1453 | true, IPA_v4_0_MHI_GROUP_DMA, |
| 1454 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1455 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1456 | QMB_MASTER_SELECT_PCIE, |
| 1457 | { 21, 15, 9, 9, IPA_EE_AP } }, |
| 1458 | [IPA_4_0_MHI][IPA_CLIENT_Q6_LTE_WIFI_AGGR_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1459 | true, IPA_v4_0_GROUP_UL_DL, |
| 1460 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1461 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1462 | QMB_MASTER_SELECT_DDR, |
| 1463 | { 16, 5, 9, 9, IPA_EE_Q6 } }, |
| 1464 | /* Only for test purpose */ |
| 1465 | [IPA_4_0_MHI][IPA_CLIENT_TEST_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1466 | true, IPA_v4_0_GROUP_UL_DL, |
| 1467 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1468 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1469 | QMB_MASTER_SELECT_PCIE, |
| 1470 | { 12, 2, 5, 5, IPA_EE_AP } }, |
| 1471 | [IPA_4_0_MHI][IPA_CLIENT_TEST1_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1472 | true, IPA_v4_0_GROUP_UL_DL, |
| 1473 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1474 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1475 | QMB_MASTER_SELECT_DDR, |
| 1476 | { 12, 2, 5, 5, IPA_EE_AP } }, |
| 1477 | [IPA_4_0_MHI][IPA_CLIENT_TEST2_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1478 | true, IPA_v4_0_GROUP_UL_DL, |
| 1479 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1480 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1481 | QMB_MASTER_SELECT_PCIE, |
| 1482 | { 18, 12, 6, 9, IPA_EE_AP } }, |
| 1483 | [IPA_4_0_MHI][IPA_CLIENT_TEST3_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1484 | true, IPA_v4_0_GROUP_UL_DL, |
| 1485 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1486 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1487 | QMB_MASTER_SELECT_DDR, |
| 1488 | { 20, 14, 9, 9, IPA_EE_AP } }, |
| 1489 | [IPA_4_0_MHI][IPA_CLIENT_TEST4_CONS] = { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 1490 | true, IPA_v4_0_GROUP_UL_DL, |
| 1491 | false, |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 1492 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1493 | QMB_MASTER_SELECT_PCIE, |
| 1494 | { 21, 15, 9, 9, IPA_EE_AP } }, |
Skylar Chang | 7fa2271 | 2017-04-03 18:29:21 -0700 | [diff] [blame] | 1495 | /* Dummy consumer (pipe 31) is used in L2TP rt rule */ |
| 1496 | [IPA_4_0_MHI][IPA_CLIENT_DUMMY_CONS] = { |
| 1497 | true, IPA_v4_0_GROUP_UL_DL, |
| 1498 | false, |
| 1499 | IPA_DPS_HPS_SEQ_TYPE_INVALID, |
| 1500 | QMB_MASTER_SELECT_DDR, |
| 1501 | { 31, 31, 8, 8, IPA_EE_AP } }, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1502 | }; |
| 1503 | |
| 1504 | static struct msm_bus_vectors ipa_init_vectors_v3_0[] = { |
| 1505 | { |
| 1506 | .src = MSM_BUS_MASTER_IPA, |
| 1507 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 1508 | .ab = 0, |
| 1509 | .ib = 0, |
| 1510 | }, |
| 1511 | { |
| 1512 | .src = MSM_BUS_MASTER_IPA, |
| 1513 | .dst = MSM_BUS_SLAVE_OCIMEM, |
| 1514 | .ab = 0, |
| 1515 | .ib = 0, |
| 1516 | }, |
| 1517 | }; |
| 1518 | |
| 1519 | static struct msm_bus_vectors ipa_nominal_perf_vectors_v3_0[] = { |
| 1520 | { |
| 1521 | .src = MSM_BUS_MASTER_IPA, |
| 1522 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 1523 | .ab = 100000000, |
| 1524 | .ib = 1300000000, |
| 1525 | }, |
| 1526 | { |
| 1527 | .src = MSM_BUS_MASTER_IPA, |
| 1528 | .dst = MSM_BUS_SLAVE_OCIMEM, |
| 1529 | .ab = 100000000, |
| 1530 | .ib = 1300000000, |
| 1531 | }, |
| 1532 | }; |
| 1533 | |
| 1534 | static struct msm_bus_paths ipa_usecases_v3_0[] = { |
| 1535 | { |
Ghanim Fodi | 651854c | 2017-04-13 17:16:39 -0700 | [diff] [blame] | 1536 | .num_paths = ARRAY_SIZE(ipa_init_vectors_v3_0), |
| 1537 | .vectors = ipa_init_vectors_v3_0, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1538 | }, |
| 1539 | { |
Ghanim Fodi | 651854c | 2017-04-13 17:16:39 -0700 | [diff] [blame] | 1540 | .num_paths = ARRAY_SIZE(ipa_nominal_perf_vectors_v3_0), |
| 1541 | .vectors = ipa_nominal_perf_vectors_v3_0, |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1542 | }, |
| 1543 | }; |
| 1544 | |
| 1545 | static struct msm_bus_scale_pdata ipa_bus_client_pdata_v3_0 = { |
Ghanim Fodi | 651854c | 2017-04-13 17:16:39 -0700 | [diff] [blame] | 1546 | .usecase = ipa_usecases_v3_0, |
| 1547 | .num_usecases = ARRAY_SIZE(ipa_usecases_v3_0), |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1548 | .name = "ipa", |
| 1549 | }; |
| 1550 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1551 | /** |
| 1552 | * ipa3_get_clients_from_rm_resource() - get IPA clients which are related to an |
| 1553 | * IPA_RM resource |
| 1554 | * |
| 1555 | * @resource: [IN] IPA Resource Manager resource |
| 1556 | * @clients: [OUT] Empty array which will contain the list of clients. The |
| 1557 | * caller must initialize this array. |
| 1558 | * |
| 1559 | * Return codes: 0 on success, negative on failure. |
| 1560 | */ |
| 1561 | int ipa3_get_clients_from_rm_resource( |
| 1562 | enum ipa_rm_resource_name resource, |
| 1563 | struct ipa3_client_names *clients) |
| 1564 | { |
| 1565 | int i = 0; |
| 1566 | |
| 1567 | if (resource < 0 || |
| 1568 | resource >= IPA_RM_RESOURCE_MAX || |
| 1569 | !clients) { |
| 1570 | IPAERR("Bad parameters\n"); |
| 1571 | return -EINVAL; |
| 1572 | } |
| 1573 | |
| 1574 | switch (resource) { |
| 1575 | case IPA_RM_RESOURCE_USB_CONS: |
| 1576 | clients->names[i++] = IPA_CLIENT_USB_CONS; |
| 1577 | break; |
| 1578 | case IPA_RM_RESOURCE_USB_DPL_CONS: |
| 1579 | clients->names[i++] = IPA_CLIENT_USB_DPL_CONS; |
| 1580 | break; |
| 1581 | case IPA_RM_RESOURCE_HSIC_CONS: |
| 1582 | clients->names[i++] = IPA_CLIENT_HSIC1_CONS; |
| 1583 | break; |
| 1584 | case IPA_RM_RESOURCE_WLAN_CONS: |
| 1585 | clients->names[i++] = IPA_CLIENT_WLAN1_CONS; |
| 1586 | clients->names[i++] = IPA_CLIENT_WLAN2_CONS; |
| 1587 | clients->names[i++] = IPA_CLIENT_WLAN3_CONS; |
| 1588 | clients->names[i++] = IPA_CLIENT_WLAN4_CONS; |
| 1589 | break; |
| 1590 | case IPA_RM_RESOURCE_MHI_CONS: |
| 1591 | clients->names[i++] = IPA_CLIENT_MHI_CONS; |
| 1592 | break; |
Skylar Chang | 79699ec | 2016-11-18 10:21:33 -0800 | [diff] [blame] | 1593 | case IPA_RM_RESOURCE_ODU_ADAPT_CONS: |
| 1594 | clients->names[i++] = IPA_CLIENT_ODU_EMB_CONS; |
| 1595 | clients->names[i++] = IPA_CLIENT_ODU_TETH_CONS; |
| 1596 | break; |
Sunil Paidimarri | 5139aa2 | 2017-02-13 11:07:32 -0800 | [diff] [blame] | 1597 | case IPA_RM_RESOURCE_ETHERNET_CONS: |
| 1598 | clients->names[i++] = IPA_CLIENT_ETHERNET_CONS; |
| 1599 | break; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1600 | case IPA_RM_RESOURCE_USB_PROD: |
| 1601 | clients->names[i++] = IPA_CLIENT_USB_PROD; |
| 1602 | break; |
| 1603 | case IPA_RM_RESOURCE_HSIC_PROD: |
| 1604 | clients->names[i++] = IPA_CLIENT_HSIC1_PROD; |
| 1605 | break; |
| 1606 | case IPA_RM_RESOURCE_MHI_PROD: |
| 1607 | clients->names[i++] = IPA_CLIENT_MHI_PROD; |
| 1608 | break; |
Skylar Chang | 79699ec | 2016-11-18 10:21:33 -0800 | [diff] [blame] | 1609 | case IPA_RM_RESOURCE_ODU_ADAPT_PROD: |
| 1610 | clients->names[i++] = IPA_CLIENT_ODU_PROD; |
Sunil Paidimarri | 5139aa2 | 2017-02-13 11:07:32 -0800 | [diff] [blame] | 1611 | break; |
| 1612 | case IPA_RM_RESOURCE_ETHERNET_PROD: |
| 1613 | clients->names[i++] = IPA_CLIENT_ETHERNET_PROD; |
| 1614 | break; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1615 | default: |
| 1616 | break; |
| 1617 | } |
| 1618 | clients->length = i; |
| 1619 | |
| 1620 | return 0; |
| 1621 | } |
| 1622 | |
| 1623 | /** |
| 1624 | * ipa3_should_pipe_be_suspended() - returns true when the client's pipe should |
| 1625 | * be suspended during a power save scenario. False otherwise. |
| 1626 | * |
| 1627 | * @client: [IN] IPA client |
| 1628 | */ |
| 1629 | bool ipa3_should_pipe_be_suspended(enum ipa_client_type client) |
| 1630 | { |
| 1631 | struct ipa3_ep_context *ep; |
| 1632 | int ipa_ep_idx; |
| 1633 | |
| 1634 | ipa_ep_idx = ipa3_get_ep_mapping(client); |
| 1635 | if (ipa_ep_idx == -1) { |
| 1636 | IPAERR("Invalid client.\n"); |
| 1637 | WARN_ON(1); |
| 1638 | return false; |
| 1639 | } |
| 1640 | |
| 1641 | ep = &ipa3_ctx->ep[ipa_ep_idx]; |
| 1642 | |
Skylar Chang | a699afd | 2017-06-06 10:06:21 -0700 | [diff] [blame] | 1643 | /* |
| 1644 | * starting IPA 4.0 pipe no longer can be suspended. Instead, |
| 1645 | * the corresponding GSI channel should be stopped. Usually client |
| 1646 | * driver will take care of stopping the channel. For client drivers |
| 1647 | * that are not stopping the channel, IPA RM will do that based on |
| 1648 | * ipa3_should_pipe_channel_be_stopped(). |
| 1649 | */ |
| 1650 | if (ipa3_ctx->ipa_hw_type >= IPA_HW_v4_0) |
| 1651 | return false; |
| 1652 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1653 | if (ep->keep_ipa_awake) |
| 1654 | return false; |
| 1655 | |
| 1656 | if (client == IPA_CLIENT_USB_CONS || |
| 1657 | client == IPA_CLIENT_USB_DPL_CONS || |
| 1658 | client == IPA_CLIENT_MHI_CONS || |
| 1659 | client == IPA_CLIENT_HSIC1_CONS || |
| 1660 | client == IPA_CLIENT_WLAN1_CONS || |
| 1661 | client == IPA_CLIENT_WLAN2_CONS || |
| 1662 | client == IPA_CLIENT_WLAN3_CONS || |
Skylar Chang | 79699ec | 2016-11-18 10:21:33 -0800 | [diff] [blame] | 1663 | client == IPA_CLIENT_WLAN4_CONS || |
| 1664 | client == IPA_CLIENT_ODU_EMB_CONS || |
Sunil Paidimarri | 5139aa2 | 2017-02-13 11:07:32 -0800 | [diff] [blame] | 1665 | client == IPA_CLIENT_ODU_TETH_CONS || |
| 1666 | client == IPA_CLIENT_ETHERNET_CONS) |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1667 | return true; |
| 1668 | |
| 1669 | return false; |
| 1670 | } |
| 1671 | |
| 1672 | /** |
Skylar Chang | a699afd | 2017-06-06 10:06:21 -0700 | [diff] [blame] | 1673 | * ipa3_should_pipe_channel_be_stopped() - returns true when the client's |
| 1674 | * channel should be stopped during a power save scenario. False otherwise. |
| 1675 | * Most client already stops the GSI channel on suspend, and are not included |
| 1676 | * in the list below. |
| 1677 | * |
| 1678 | * @client: [IN] IPA client |
| 1679 | */ |
| 1680 | static bool ipa3_should_pipe_channel_be_stopped(enum ipa_client_type client) |
| 1681 | { |
| 1682 | struct ipa3_ep_context *ep; |
| 1683 | int ipa_ep_idx; |
| 1684 | |
| 1685 | if (ipa3_ctx->ipa_hw_type < IPA_HW_v4_0) |
| 1686 | return false; |
| 1687 | |
| 1688 | ipa_ep_idx = ipa3_get_ep_mapping(client); |
| 1689 | if (ipa_ep_idx == -1) { |
| 1690 | IPAERR("Invalid client.\n"); |
| 1691 | WARN_ON(1); |
| 1692 | return false; |
| 1693 | } |
| 1694 | |
| 1695 | ep = &ipa3_ctx->ep[ipa_ep_idx]; |
| 1696 | |
| 1697 | if (ep->keep_ipa_awake) |
| 1698 | return false; |
| 1699 | |
| 1700 | if (client == IPA_CLIENT_ODU_EMB_CONS || |
| 1701 | client == IPA_CLIENT_ODU_TETH_CONS) |
| 1702 | return true; |
| 1703 | |
| 1704 | return false; |
| 1705 | } |
| 1706 | |
| 1707 | /** |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1708 | * ipa3_suspend_resource_sync() - suspend client endpoints related to the IPA_RM |
| 1709 | * resource and decrement active clients counter, which may result in clock |
| 1710 | * gating of IPA clocks. |
| 1711 | * |
| 1712 | * @resource: [IN] IPA Resource Manager resource |
| 1713 | * |
| 1714 | * Return codes: 0 on success, negative on failure. |
| 1715 | */ |
| 1716 | int ipa3_suspend_resource_sync(enum ipa_rm_resource_name resource) |
| 1717 | { |
| 1718 | struct ipa3_client_names clients; |
| 1719 | int res; |
| 1720 | int index; |
| 1721 | struct ipa_ep_cfg_ctrl suspend; |
| 1722 | enum ipa_client_type client; |
| 1723 | int ipa_ep_idx; |
| 1724 | bool pipe_suspended = false; |
| 1725 | |
| 1726 | memset(&clients, 0, sizeof(clients)); |
| 1727 | res = ipa3_get_clients_from_rm_resource(resource, &clients); |
| 1728 | if (res) { |
| 1729 | IPAERR("Bad params.\n"); |
| 1730 | return res; |
| 1731 | } |
| 1732 | |
| 1733 | for (index = 0; index < clients.length; index++) { |
| 1734 | client = clients.names[index]; |
| 1735 | ipa_ep_idx = ipa3_get_ep_mapping(client); |
| 1736 | if (ipa_ep_idx == -1) { |
| 1737 | IPAERR("Invalid client.\n"); |
| 1738 | res = -EINVAL; |
| 1739 | continue; |
| 1740 | } |
| 1741 | ipa3_ctx->resume_on_connect[client] = false; |
| 1742 | if (ipa3_ctx->ep[ipa_ep_idx].client == client && |
| 1743 | ipa3_should_pipe_be_suspended(client)) { |
| 1744 | if (ipa3_ctx->ep[ipa_ep_idx].valid) { |
| 1745 | /* suspend endpoint */ |
| 1746 | memset(&suspend, 0, sizeof(suspend)); |
| 1747 | suspend.ipa_ep_suspend = true; |
| 1748 | ipa3_cfg_ep_ctrl(ipa_ep_idx, &suspend); |
| 1749 | pipe_suspended = true; |
| 1750 | } |
| 1751 | } |
Skylar Chang | a699afd | 2017-06-06 10:06:21 -0700 | [diff] [blame] | 1752 | |
| 1753 | if (ipa3_ctx->ep[ipa_ep_idx].client == client && |
| 1754 | ipa3_should_pipe_channel_be_stopped(client)) { |
| 1755 | if (ipa3_ctx->ep[ipa_ep_idx].valid) { |
| 1756 | /* Stop GSI channel */ |
| 1757 | res = ipa3_stop_gsi_channel(ipa_ep_idx); |
| 1758 | if (res) { |
| 1759 | IPAERR("failed stop gsi ch %lu\n", |
| 1760 | ipa3_ctx->ep[ipa_ep_idx].gsi_chan_hdl); |
| 1761 | return res; |
| 1762 | } |
| 1763 | } |
| 1764 | } |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1765 | } |
| 1766 | /* Sleep ~1 msec */ |
| 1767 | if (pipe_suspended) |
| 1768 | usleep_range(1000, 2000); |
| 1769 | |
| 1770 | /* before gating IPA clocks do TAG process */ |
| 1771 | ipa3_ctx->tag_process_before_gating = true; |
| 1772 | IPA_ACTIVE_CLIENTS_DEC_RESOURCE(ipa_rm_resource_str(resource)); |
| 1773 | |
| 1774 | return 0; |
| 1775 | } |
| 1776 | |
| 1777 | /** |
| 1778 | * ipa3_suspend_resource_no_block() - suspend client endpoints related to the |
| 1779 | * IPA_RM resource and decrement active clients counter. This function is |
| 1780 | * guaranteed to avoid sleeping. |
| 1781 | * |
| 1782 | * @resource: [IN] IPA Resource Manager resource |
| 1783 | * |
| 1784 | * Return codes: 0 on success, negative on failure. |
| 1785 | */ |
| 1786 | int ipa3_suspend_resource_no_block(enum ipa_rm_resource_name resource) |
| 1787 | { |
| 1788 | int res; |
| 1789 | struct ipa3_client_names clients; |
| 1790 | int index; |
| 1791 | enum ipa_client_type client; |
| 1792 | struct ipa_ep_cfg_ctrl suspend; |
| 1793 | int ipa_ep_idx; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1794 | struct ipa_active_client_logging_info log_info; |
| 1795 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1796 | memset(&clients, 0, sizeof(clients)); |
| 1797 | res = ipa3_get_clients_from_rm_resource(resource, &clients); |
| 1798 | if (res) { |
| 1799 | IPAERR( |
| 1800 | "ipa3_get_clients_from_rm_resource() failed, name = %d.\n", |
| 1801 | resource); |
| 1802 | goto bail; |
| 1803 | } |
| 1804 | |
| 1805 | for (index = 0; index < clients.length; index++) { |
| 1806 | client = clients.names[index]; |
| 1807 | ipa_ep_idx = ipa3_get_ep_mapping(client); |
| 1808 | if (ipa_ep_idx == -1) { |
| 1809 | IPAERR("Invalid client.\n"); |
| 1810 | res = -EINVAL; |
| 1811 | continue; |
| 1812 | } |
| 1813 | ipa3_ctx->resume_on_connect[client] = false; |
| 1814 | if (ipa3_ctx->ep[ipa_ep_idx].client == client && |
| 1815 | ipa3_should_pipe_be_suspended(client)) { |
| 1816 | if (ipa3_ctx->ep[ipa_ep_idx].valid) { |
| 1817 | /* suspend endpoint */ |
| 1818 | memset(&suspend, 0, sizeof(suspend)); |
| 1819 | suspend.ipa_ep_suspend = true; |
| 1820 | ipa3_cfg_ep_ctrl(ipa_ep_idx, &suspend); |
| 1821 | } |
| 1822 | } |
Skylar Chang | a699afd | 2017-06-06 10:06:21 -0700 | [diff] [blame] | 1823 | |
| 1824 | if (ipa3_ctx->ep[ipa_ep_idx].client == client && |
| 1825 | ipa3_should_pipe_channel_be_stopped(client)) { |
| 1826 | res = -EPERM; |
| 1827 | goto bail; |
| 1828 | } |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1829 | } |
| 1830 | |
| 1831 | if (res == 0) { |
| 1832 | IPA_ACTIVE_CLIENTS_PREP_RESOURCE(log_info, |
| 1833 | ipa_rm_resource_str(resource)); |
Skylar Chang | 242952b | 2017-07-20 15:04:05 -0700 | [diff] [blame] | 1834 | /* before gating IPA clocks do TAG process */ |
| 1835 | ipa3_ctx->tag_process_before_gating = true; |
| 1836 | ipa3_dec_client_disable_clks_no_block(&log_info); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1837 | } |
| 1838 | bail: |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1839 | return res; |
| 1840 | } |
| 1841 | |
| 1842 | /** |
| 1843 | * ipa3_resume_resource() - resume client endpoints related to the IPA_RM |
| 1844 | * resource. |
| 1845 | * |
| 1846 | * @resource: [IN] IPA Resource Manager resource |
| 1847 | * |
| 1848 | * Return codes: 0 on success, negative on failure. |
| 1849 | */ |
| 1850 | int ipa3_resume_resource(enum ipa_rm_resource_name resource) |
| 1851 | { |
| 1852 | |
| 1853 | struct ipa3_client_names clients; |
| 1854 | int res; |
| 1855 | int index; |
| 1856 | struct ipa_ep_cfg_ctrl suspend; |
| 1857 | enum ipa_client_type client; |
| 1858 | int ipa_ep_idx; |
| 1859 | |
| 1860 | memset(&clients, 0, sizeof(clients)); |
| 1861 | res = ipa3_get_clients_from_rm_resource(resource, &clients); |
| 1862 | if (res) { |
| 1863 | IPAERR("ipa3_get_clients_from_rm_resource() failed.\n"); |
| 1864 | return res; |
| 1865 | } |
| 1866 | |
| 1867 | for (index = 0; index < clients.length; index++) { |
| 1868 | client = clients.names[index]; |
| 1869 | ipa_ep_idx = ipa3_get_ep_mapping(client); |
| 1870 | if (ipa_ep_idx == -1) { |
| 1871 | IPAERR("Invalid client.\n"); |
| 1872 | res = -EINVAL; |
| 1873 | continue; |
| 1874 | } |
| 1875 | /* |
| 1876 | * The related ep, will be resumed on connect |
| 1877 | * while its resource is granted |
| 1878 | */ |
| 1879 | ipa3_ctx->resume_on_connect[client] = true; |
| 1880 | IPADBG("%d will be resumed on connect.\n", client); |
| 1881 | if (ipa3_ctx->ep[ipa_ep_idx].client == client && |
| 1882 | ipa3_should_pipe_be_suspended(client)) { |
| 1883 | if (ipa3_ctx->ep[ipa_ep_idx].valid) { |
| 1884 | memset(&suspend, 0, sizeof(suspend)); |
| 1885 | suspend.ipa_ep_suspend = false; |
| 1886 | ipa3_cfg_ep_ctrl(ipa_ep_idx, &suspend); |
| 1887 | } |
| 1888 | } |
Skylar Chang | a699afd | 2017-06-06 10:06:21 -0700 | [diff] [blame] | 1889 | |
| 1890 | if (ipa3_ctx->ep[ipa_ep_idx].client == client && |
| 1891 | ipa3_should_pipe_channel_be_stopped(client)) { |
| 1892 | if (ipa3_ctx->ep[ipa_ep_idx].valid) { |
| 1893 | res = gsi_start_channel( |
| 1894 | ipa3_ctx->ep[ipa_ep_idx].gsi_chan_hdl); |
| 1895 | if (res) { |
| 1896 | IPAERR("failed to start gsi ch %lu\n", |
| 1897 | ipa3_ctx->ep[ipa_ep_idx].gsi_chan_hdl); |
| 1898 | return res; |
| 1899 | } |
| 1900 | } |
| 1901 | } |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1902 | } |
| 1903 | |
| 1904 | return res; |
| 1905 | } |
| 1906 | |
| 1907 | /** |
| 1908 | * _ipa_sram_settings_read_v3_0() - Read SRAM settings from HW |
| 1909 | * |
| 1910 | * Returns: None |
| 1911 | */ |
| 1912 | void _ipa_sram_settings_read_v3_0(void) |
| 1913 | { |
| 1914 | struct ipahal_reg_shared_mem_size smem_sz; |
| 1915 | |
| 1916 | memset(&smem_sz, 0, sizeof(smem_sz)); |
| 1917 | |
| 1918 | ipahal_read_reg_fields(IPA_SHARED_MEM_SIZE, &smem_sz); |
| 1919 | |
| 1920 | ipa3_ctx->smem_restricted_bytes = smem_sz.shared_mem_baddr; |
| 1921 | ipa3_ctx->smem_sz = smem_sz.shared_mem_sz; |
| 1922 | |
| 1923 | /* reg fields are in 8B units */ |
| 1924 | ipa3_ctx->smem_restricted_bytes *= 8; |
| 1925 | ipa3_ctx->smem_sz *= 8; |
| 1926 | ipa3_ctx->smem_reqd_sz = IPA_MEM_PART(end_ofst); |
| 1927 | ipa3_ctx->hdr_tbl_lcl = 0; |
| 1928 | ipa3_ctx->hdr_proc_ctx_tbl_lcl = 1; |
| 1929 | |
| 1930 | /* |
| 1931 | * when proc ctx table is located in internal memory, |
| 1932 | * modem entries resides first. |
| 1933 | */ |
| 1934 | if (ipa3_ctx->hdr_proc_ctx_tbl_lcl) { |
| 1935 | ipa3_ctx->hdr_proc_ctx_tbl.start_offset = |
| 1936 | IPA_MEM_PART(modem_hdr_proc_ctx_size); |
| 1937 | } |
| 1938 | ipa3_ctx->ip4_rt_tbl_hash_lcl = 0; |
| 1939 | ipa3_ctx->ip4_rt_tbl_nhash_lcl = 0; |
| 1940 | ipa3_ctx->ip6_rt_tbl_hash_lcl = 0; |
| 1941 | ipa3_ctx->ip6_rt_tbl_nhash_lcl = 0; |
| 1942 | ipa3_ctx->ip4_flt_tbl_hash_lcl = 0; |
| 1943 | ipa3_ctx->ip4_flt_tbl_nhash_lcl = 0; |
| 1944 | ipa3_ctx->ip6_flt_tbl_hash_lcl = 0; |
| 1945 | ipa3_ctx->ip6_flt_tbl_nhash_lcl = 0; |
| 1946 | } |
| 1947 | |
| 1948 | /** |
| 1949 | * ipa3_cfg_route() - configure IPA route |
| 1950 | * @route: IPA route |
| 1951 | * |
| 1952 | * Return codes: |
| 1953 | * 0: success |
| 1954 | */ |
| 1955 | int ipa3_cfg_route(struct ipahal_reg_route *route) |
| 1956 | { |
| 1957 | |
| 1958 | IPADBG("disable_route_block=%d, default_pipe=%d, default_hdr_tbl=%d\n", |
| 1959 | route->route_dis, |
| 1960 | route->route_def_pipe, |
| 1961 | route->route_def_hdr_table); |
| 1962 | IPADBG("default_hdr_ofst=%d, default_frag_pipe=%d\n", |
| 1963 | route->route_def_hdr_ofst, |
| 1964 | route->route_frag_def_pipe); |
| 1965 | |
| 1966 | IPADBG("default_retain_hdr=%d\n", |
| 1967 | route->route_def_retain_hdr); |
| 1968 | |
| 1969 | if (route->route_dis) { |
| 1970 | IPAERR("Route disable is not supported!\n"); |
| 1971 | return -EPERM; |
| 1972 | } |
| 1973 | |
| 1974 | IPA_ACTIVE_CLIENTS_INC_SIMPLE(); |
| 1975 | |
| 1976 | ipahal_write_reg_fields(IPA_ROUTE, route); |
| 1977 | |
| 1978 | IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); |
| 1979 | |
| 1980 | return 0; |
| 1981 | } |
| 1982 | |
| 1983 | /** |
| 1984 | * ipa3_cfg_filter() - configure filter |
| 1985 | * @disable: disable value |
| 1986 | * |
| 1987 | * Return codes: |
| 1988 | * 0: success |
| 1989 | */ |
| 1990 | int ipa3_cfg_filter(u32 disable) |
| 1991 | { |
Utkarsh Saxena | e978281 | 2017-05-26 17:20:32 +0530 | [diff] [blame] | 1992 | IPAERR_RL("Filter disable is not supported!\n"); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1993 | return -EPERM; |
| 1994 | } |
| 1995 | |
| 1996 | /** |
| 1997 | * ipa3_cfg_qsb() - Configure IPA QSB maximal reads and writes |
| 1998 | * |
| 1999 | * Returns: None |
| 2000 | */ |
| 2001 | void ipa3_cfg_qsb(void) |
| 2002 | { |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 2003 | struct ipahal_reg_qsb_max_reads max_reads = { 0 }; |
| 2004 | struct ipahal_reg_qsb_max_writes max_writes = { 0 }; |
| 2005 | |
| 2006 | max_reads.qmb_0_max_reads = 8, |
| 2007 | max_reads.qmb_1_max_reads = 8, |
| 2008 | |
| 2009 | max_writes.qmb_0_max_writes = 8; |
| 2010 | max_writes.qmb_1_max_writes = 2; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2011 | |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 2012 | if (ipa3_ctx->ipa_hw_type >= IPA_HW_v3_5) { |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 2013 | max_writes.qmb_1_max_writes = 4; |
| 2014 | max_reads.qmb_1_max_reads = 12; |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 2015 | } |
| 2016 | |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 2017 | ipahal_write_reg_fields(IPA_QSB_MAX_WRITES, &max_writes); |
| 2018 | ipahal_write_reg_fields(IPA_QSB_MAX_READS, &max_reads); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2019 | } |
| 2020 | |
| 2021 | /** |
| 2022 | * ipa3_init_hw() - initialize HW |
| 2023 | * |
| 2024 | * Return codes: |
| 2025 | * 0: success |
| 2026 | */ |
| 2027 | int ipa3_init_hw(void) |
| 2028 | { |
| 2029 | u32 ipa_version = 0; |
| 2030 | u32 val; |
| 2031 | |
| 2032 | /* Read IPA version and make sure we have access to the registers */ |
| 2033 | ipa_version = ipahal_read_reg(IPA_VERSION); |
| 2034 | if (ipa_version == 0) |
| 2035 | return -EFAULT; |
| 2036 | |
| 2037 | switch (ipa3_ctx->ipa_hw_type) { |
| 2038 | case IPA_HW_v3_0: |
| 2039 | case IPA_HW_v3_1: |
| 2040 | val = IPA_BCR_REG_VAL_v3_0; |
| 2041 | break; |
| 2042 | case IPA_HW_v3_5: |
| 2043 | case IPA_HW_v3_5_1: |
| 2044 | val = IPA_BCR_REG_VAL_v3_5; |
| 2045 | break; |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 2046 | case IPA_HW_v4_0: |
| 2047 | val = IPA_BCR_REG_VAL_v4_0; |
| 2048 | break; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2049 | default: |
| 2050 | IPAERR("unknown HW type in dts\n"); |
| 2051 | return -EFAULT; |
| 2052 | } |
| 2053 | |
| 2054 | ipahal_write_reg(IPA_BCR, val); |
| 2055 | |
Skylar Chang | f077287 | 2017-07-06 16:11:01 -0700 | [diff] [blame] | 2056 | if (ipa3_ctx->ipa_hw_type >= IPA_HW_v4_0) { |
| 2057 | struct ipahal_reg_tx_cfg cfg; |
| 2058 | |
Michael Adisumarta | d68ab11 | 2017-06-14 11:40:06 -0700 | [diff] [blame] | 2059 | ipahal_write_reg(IPA_CLKON_CFG, IPA_CLKON_CFG_v4_0); |
Skylar Chang | f077287 | 2017-07-06 16:11:01 -0700 | [diff] [blame] | 2060 | ipahal_read_reg_fields(IPA_TX_CFG, &cfg); |
| 2061 | /* disable PA_MASK_EN to allow holb drop */ |
| 2062 | cfg.pa_mask_en = 0; |
| 2063 | ipahal_write_reg_fields(IPA_TX_CFG, &cfg); |
| 2064 | } |
Michael Adisumarta | d68ab11 | 2017-06-14 11:40:06 -0700 | [diff] [blame] | 2065 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2066 | ipa3_cfg_qsb(); |
| 2067 | |
| 2068 | return 0; |
| 2069 | } |
| 2070 | |
| 2071 | /** |
| 2072 | * ipa3_get_hw_type_index() - Get HW type index which is used as the entry index |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 2073 | * for ep\resource groups related arrays . |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2074 | * |
| 2075 | * Return value: HW type index |
| 2076 | */ |
| 2077 | u8 ipa3_get_hw_type_index(void) |
| 2078 | { |
| 2079 | u8 hw_type_index; |
| 2080 | |
| 2081 | switch (ipa3_ctx->ipa_hw_type) { |
| 2082 | case IPA_HW_v3_0: |
| 2083 | case IPA_HW_v3_1: |
| 2084 | hw_type_index = IPA_3_0; |
| 2085 | break; |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 2086 | case IPA_HW_v3_5: |
| 2087 | hw_type_index = IPA_3_5; |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 2088 | /* |
| 2089 | *this flag is initialized only after fw load trigger from |
| 2090 | * user space (ipa3_write) |
| 2091 | */ |
| 2092 | if (ipa3_ctx->ipa_config_is_mhi) |
| 2093 | hw_type_index = IPA_3_5_MHI; |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 2094 | break; |
| 2095 | case IPA_HW_v3_5_1: |
| 2096 | hw_type_index = IPA_3_5_1; |
| 2097 | break; |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 2098 | case IPA_HW_v4_0: |
| 2099 | hw_type_index = IPA_4_0; |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 2100 | /* |
| 2101 | *this flag is initialized only after fw load trigger from |
| 2102 | * user space (ipa3_write) |
| 2103 | */ |
| 2104 | if (ipa3_ctx->ipa_config_is_mhi) |
| 2105 | hw_type_index = IPA_4_0_MHI; |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 2106 | break; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2107 | default: |
| 2108 | IPAERR("Incorrect IPA version %d\n", ipa3_ctx->ipa_hw_type); |
| 2109 | hw_type_index = IPA_3_0; |
| 2110 | break; |
| 2111 | } |
| 2112 | |
| 2113 | return hw_type_index; |
| 2114 | } |
| 2115 | |
| 2116 | /** |
| 2117 | * ipa3_get_ep_mapping() - provide endpoint mapping |
| 2118 | * @client: client type |
| 2119 | * |
| 2120 | * Return value: endpoint mapping |
| 2121 | */ |
| 2122 | int ipa3_get_ep_mapping(enum ipa_client_type client) |
| 2123 | { |
Skylar Chang | 652ee8e | 2017-02-10 11:40:30 -0800 | [diff] [blame] | 2124 | int ipa_ep_idx; |
| 2125 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2126 | if (client >= IPA_CLIENT_MAX || client < 0) { |
Utkarsh Saxena | e978281 | 2017-05-26 17:20:32 +0530 | [diff] [blame] | 2127 | IPAERR_RL("Bad client number! client =%d\n", client); |
Ghanim Fodi | 79ee8d8 | 2017-02-27 16:39:25 +0200 | [diff] [blame] | 2128 | return IPA_EP_NOT_ALLOCATED; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2129 | } |
| 2130 | |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 2131 | if (!ipa3_ep_mapping[ipa3_get_hw_type_index()][client].valid) |
| 2132 | return IPA_EP_NOT_ALLOCATED; |
| 2133 | |
| 2134 | ipa_ep_idx = ipa3_ep_mapping[ipa3_get_hw_type_index()][client]. |
| 2135 | ipa_gsi_ep_info.ipa_ep_num; |
Skylar Chang | 7fa2271 | 2017-04-03 18:29:21 -0700 | [diff] [blame] | 2136 | if (ipa_ep_idx < 0 || (ipa_ep_idx >= IPA3_MAX_NUM_PIPES |
| 2137 | && client != IPA_CLIENT_DUMMY_CONS)) |
Skylar Chang | 652ee8e | 2017-02-10 11:40:30 -0800 | [diff] [blame] | 2138 | return IPA_EP_NOT_ALLOCATED; |
| 2139 | |
| 2140 | return ipa_ep_idx; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2141 | } |
| 2142 | |
| 2143 | /** |
| 2144 | * ipa3_get_gsi_ep_info() - provide gsi ep information |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 2145 | * @client: IPA client value |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2146 | * |
| 2147 | * Return value: pointer to ipa_gsi_ep_info |
| 2148 | */ |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 2149 | const struct ipa_gsi_ep_config *ipa3_get_gsi_ep_info |
| 2150 | (enum ipa_client_type client) |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2151 | { |
Skylar Chang | c1f1531 | 2017-05-09 14:14:32 -0700 | [diff] [blame] | 2152 | int ep_idx; |
| 2153 | |
| 2154 | ep_idx = ipa3_get_ep_mapping(client); |
| 2155 | if (ep_idx == IPA_EP_NOT_ALLOCATED) |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 2156 | return NULL; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2157 | |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 2158 | if (!ipa3_ep_mapping[ipa3_get_hw_type_index()][client].valid) |
| 2159 | return NULL; |
| 2160 | |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 2161 | return &(ipa3_ep_mapping[ipa3_get_hw_type_index()] |
| 2162 | [client].ipa_gsi_ep_info); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2163 | } |
| 2164 | |
| 2165 | /** |
| 2166 | * ipa_get_ep_group() - provide endpoint group by client |
| 2167 | * @client: client type |
| 2168 | * |
| 2169 | * Return value: endpoint group |
| 2170 | */ |
| 2171 | int ipa_get_ep_group(enum ipa_client_type client) |
| 2172 | { |
| 2173 | if (client >= IPA_CLIENT_MAX || client < 0) { |
| 2174 | IPAERR("Bad client number! client =%d\n", client); |
| 2175 | return -EINVAL; |
| 2176 | } |
| 2177 | |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 2178 | if (!ipa3_ep_mapping[ipa3_get_hw_type_index()][client].valid) |
| 2179 | return -EINVAL; |
| 2180 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2181 | return ipa3_ep_mapping[ipa3_get_hw_type_index()][client].group_num; |
| 2182 | } |
| 2183 | |
| 2184 | /** |
| 2185 | * ipa3_get_qmb_master_sel() - provide QMB master selection for the client |
| 2186 | * @client: client type |
| 2187 | * |
| 2188 | * Return value: QMB master index |
| 2189 | */ |
| 2190 | u8 ipa3_get_qmb_master_sel(enum ipa_client_type client) |
| 2191 | { |
| 2192 | if (client >= IPA_CLIENT_MAX || client < 0) { |
| 2193 | IPAERR("Bad client number! client =%d\n", client); |
| 2194 | return -EINVAL; |
| 2195 | } |
| 2196 | |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 2197 | if (!ipa3_ep_mapping[ipa3_get_hw_type_index()][client].valid) |
| 2198 | return -EINVAL; |
| 2199 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2200 | return ipa3_ep_mapping[ipa3_get_hw_type_index()] |
| 2201 | [client].qmb_master_sel; |
| 2202 | } |
| 2203 | |
| 2204 | /* ipa3_set_client() - provide client mapping |
| 2205 | * @client: client type |
| 2206 | * |
| 2207 | * Return value: none |
| 2208 | */ |
| 2209 | |
| 2210 | void ipa3_set_client(int index, enum ipacm_client_enum client, bool uplink) |
| 2211 | { |
Skylar Chang | 09e0e25 | 2017-03-20 14:51:29 -0700 | [diff] [blame] | 2212 | if (client > IPACM_CLIENT_MAX || client < IPACM_CLIENT_USB) { |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2213 | IPAERR("Bad client number! client =%d\n", client); |
| 2214 | } else if (index >= IPA3_MAX_NUM_PIPES || index < 0) { |
| 2215 | IPAERR("Bad pipe index! index =%d\n", index); |
| 2216 | } else { |
| 2217 | ipa3_ctx->ipacm_client[index].client_enum = client; |
| 2218 | ipa3_ctx->ipacm_client[index].uplink = uplink; |
| 2219 | } |
| 2220 | } |
| 2221 | |
Skylar Chang | 6b41f8d | 2016-11-01 12:50:11 -0700 | [diff] [blame] | 2222 | /* ipa3_get_wlan_stats() - get ipa wifi stats |
| 2223 | * |
| 2224 | * Return value: success or failure |
| 2225 | */ |
| 2226 | int ipa3_get_wlan_stats(struct ipa_get_wdi_sap_stats *wdi_sap_stats) |
| 2227 | { |
| 2228 | if (ipa3_ctx->uc_wdi_ctx.stats_notify) { |
| 2229 | ipa3_ctx->uc_wdi_ctx.stats_notify(IPA_GET_WDI_SAP_STATS, |
| 2230 | wdi_sap_stats); |
| 2231 | } else { |
| 2232 | IPAERR("uc_wdi_ctx.stats_notify NULL\n"); |
| 2233 | return -EFAULT; |
| 2234 | } |
| 2235 | return 0; |
| 2236 | } |
| 2237 | |
| 2238 | int ipa3_set_wlan_quota(struct ipa_set_wifi_quota *wdi_quota) |
| 2239 | { |
| 2240 | if (ipa3_ctx->uc_wdi_ctx.stats_notify) { |
| 2241 | ipa3_ctx->uc_wdi_ctx.stats_notify(IPA_SET_WIFI_QUOTA, |
| 2242 | wdi_quota); |
| 2243 | } else { |
| 2244 | IPAERR("uc_wdi_ctx.stats_notify NULL\n"); |
| 2245 | return -EFAULT; |
| 2246 | } |
| 2247 | return 0; |
| 2248 | } |
| 2249 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2250 | /** |
| 2251 | * ipa3_get_client() - provide client mapping |
| 2252 | * @client: client type |
| 2253 | * |
Skylar Chang | 6b41f8d | 2016-11-01 12:50:11 -0700 | [diff] [blame] | 2254 | * Return value: client mapping enum |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2255 | */ |
| 2256 | enum ipacm_client_enum ipa3_get_client(int pipe_idx) |
| 2257 | { |
| 2258 | if (pipe_idx >= IPA3_MAX_NUM_PIPES || pipe_idx < 0) { |
| 2259 | IPAERR("Bad pipe index! pipe_idx =%d\n", pipe_idx); |
| 2260 | return IPACM_CLIENT_MAX; |
| 2261 | } else { |
| 2262 | return ipa3_ctx->ipacm_client[pipe_idx].client_enum; |
| 2263 | } |
| 2264 | } |
| 2265 | |
| 2266 | /** |
| 2267 | * ipa2_get_client_uplink() - provide client mapping |
| 2268 | * @client: client type |
| 2269 | * |
| 2270 | * Return value: none |
| 2271 | */ |
| 2272 | bool ipa3_get_client_uplink(int pipe_idx) |
| 2273 | { |
Skylar Chang | 53f855e | 2017-06-12 10:50:12 -0700 | [diff] [blame] | 2274 | if (pipe_idx < 0 || pipe_idx >= IPA3_MAX_NUM_PIPES) { |
| 2275 | IPAERR("invalid pipe idx %d\n", pipe_idx); |
| 2276 | return false; |
| 2277 | } |
| 2278 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2279 | return ipa3_ctx->ipacm_client[pipe_idx].uplink; |
| 2280 | } |
| 2281 | |
| 2282 | /** |
| 2283 | * ipa3_get_rm_resource_from_ep() - get the IPA_RM resource which is related to |
| 2284 | * the supplied pipe index. |
| 2285 | * |
| 2286 | * @pipe_idx: |
| 2287 | * |
| 2288 | * Return value: IPA_RM resource related to the pipe, -1 if a resource was not |
| 2289 | * found. |
| 2290 | */ |
| 2291 | enum ipa_rm_resource_name ipa3_get_rm_resource_from_ep(int pipe_idx) |
| 2292 | { |
| 2293 | int i; |
| 2294 | int j; |
| 2295 | enum ipa_client_type client; |
| 2296 | struct ipa3_client_names clients; |
| 2297 | bool found = false; |
| 2298 | |
| 2299 | if (pipe_idx >= ipa3_ctx->ipa_num_pipes || pipe_idx < 0) { |
| 2300 | IPAERR("Bad pipe index!\n"); |
| 2301 | return -EINVAL; |
| 2302 | } |
| 2303 | |
| 2304 | client = ipa3_ctx->ep[pipe_idx].client; |
| 2305 | |
| 2306 | for (i = 0; i < IPA_RM_RESOURCE_MAX; i++) { |
| 2307 | memset(&clients, 0, sizeof(clients)); |
| 2308 | ipa3_get_clients_from_rm_resource(i, &clients); |
| 2309 | for (j = 0; j < clients.length; j++) { |
| 2310 | if (clients.names[j] == client) { |
| 2311 | found = true; |
| 2312 | break; |
| 2313 | } |
| 2314 | } |
| 2315 | if (found) |
| 2316 | break; |
| 2317 | } |
| 2318 | |
| 2319 | if (!found) |
| 2320 | return -EFAULT; |
| 2321 | |
| 2322 | return i; |
| 2323 | } |
| 2324 | |
| 2325 | /** |
| 2326 | * ipa3_get_client_mapping() - provide client mapping |
| 2327 | * @pipe_idx: IPA end-point number |
| 2328 | * |
| 2329 | * Return value: client mapping |
| 2330 | */ |
| 2331 | enum ipa_client_type ipa3_get_client_mapping(int pipe_idx) |
| 2332 | { |
| 2333 | if (pipe_idx >= ipa3_ctx->ipa_num_pipes || pipe_idx < 0) { |
| 2334 | IPAERR("Bad pipe index!\n"); |
| 2335 | return -EINVAL; |
| 2336 | } |
| 2337 | |
| 2338 | return ipa3_ctx->ep[pipe_idx].client; |
| 2339 | } |
| 2340 | |
| 2341 | /** |
| 2342 | * ipa_init_ep_flt_bitmap() - Initialize the bitmap |
| 2343 | * that represents the End-points that supports filtering |
| 2344 | */ |
| 2345 | void ipa_init_ep_flt_bitmap(void) |
| 2346 | { |
| 2347 | enum ipa_client_type cl; |
| 2348 | u8 hw_type_idx = ipa3_get_hw_type_index(); |
| 2349 | u32 bitmap; |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 2350 | u32 pipe_num; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2351 | |
| 2352 | bitmap = 0; |
| 2353 | |
| 2354 | BUG_ON(ipa3_ctx->ep_flt_bitmap); |
| 2355 | |
| 2356 | for (cl = 0; cl < IPA_CLIENT_MAX ; cl++) { |
| 2357 | if (ipa3_ep_mapping[hw_type_idx][cl].support_flt) { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 2358 | pipe_num = ipa3_ep_mapping[hw_type_idx][cl]. |
| 2359 | ipa_gsi_ep_info.ipa_ep_num; |
| 2360 | bitmap |= (1U << pipe_num); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2361 | if (bitmap != ipa3_ctx->ep_flt_bitmap) { |
| 2362 | ipa3_ctx->ep_flt_bitmap = bitmap; |
| 2363 | ipa3_ctx->ep_flt_num++; |
| 2364 | } |
| 2365 | } |
| 2366 | } |
| 2367 | } |
| 2368 | |
| 2369 | /** |
| 2370 | * ipa_is_ep_support_flt() - Given an End-point check |
| 2371 | * whether it supports filtering or not. |
| 2372 | * |
| 2373 | * @pipe_idx: |
| 2374 | * |
| 2375 | * Return values: |
| 2376 | * true if supports and false if not |
| 2377 | */ |
| 2378 | bool ipa_is_ep_support_flt(int pipe_idx) |
| 2379 | { |
| 2380 | if (pipe_idx >= ipa3_ctx->ipa_num_pipes || pipe_idx < 0) { |
| 2381 | IPAERR("Bad pipe index!\n"); |
| 2382 | return false; |
| 2383 | } |
| 2384 | |
| 2385 | return ipa3_ctx->ep_flt_bitmap & (1U<<pipe_idx); |
| 2386 | } |
| 2387 | |
| 2388 | /** |
| 2389 | * ipa3_cfg_ep_seq() - IPA end-point HPS/DPS sequencer type configuration |
| 2390 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 2391 | * |
| 2392 | * Returns: 0 on success, negative on failure |
| 2393 | * |
| 2394 | * Note: Should not be called from atomic context |
| 2395 | */ |
| 2396 | int ipa3_cfg_ep_seq(u32 clnt_hdl, const struct ipa_ep_cfg_seq *seq_cfg) |
| 2397 | { |
| 2398 | int type; |
| 2399 | |
| 2400 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 2401 | ipa3_ctx->ep[clnt_hdl].valid == 0) { |
| 2402 | IPAERR("bad param, clnt_hdl = %d", clnt_hdl); |
| 2403 | return -EINVAL; |
| 2404 | } |
| 2405 | |
| 2406 | if (IPA_CLIENT_IS_CONS(ipa3_ctx->ep[clnt_hdl].client)) { |
| 2407 | IPAERR("SEQ does not apply to IPA consumer EP %d\n", clnt_hdl); |
| 2408 | return -EINVAL; |
| 2409 | } |
| 2410 | |
| 2411 | /* |
| 2412 | * Skip Configure sequencers type for test clients. |
| 2413 | * These are configured dynamically in ipa3_cfg_ep_mode |
| 2414 | */ |
| 2415 | if (IPA_CLIENT_IS_TEST(ipa3_ctx->ep[clnt_hdl].client)) { |
| 2416 | IPADBG("Skip sequencers configuration for test clients\n"); |
| 2417 | return 0; |
| 2418 | } |
| 2419 | |
| 2420 | if (seq_cfg->set_dynamic) |
| 2421 | type = seq_cfg->seq_type; |
| 2422 | else |
| 2423 | type = ipa3_ep_mapping[ipa3_get_hw_type_index()] |
| 2424 | [ipa3_ctx->ep[clnt_hdl].client].sequencer_type; |
| 2425 | |
| 2426 | if (type != IPA_DPS_HPS_SEQ_TYPE_INVALID) { |
| 2427 | if (ipa3_ctx->ep[clnt_hdl].cfg.mode.mode == IPA_DMA && |
| 2428 | !IPA_DPS_HPS_SEQ_TYPE_IS_DMA(type)) { |
| 2429 | IPAERR("Configuring non-DMA SEQ type to DMA pipe\n"); |
| 2430 | BUG(); |
| 2431 | } |
| 2432 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2433 | /* Configure sequencers type*/ |
| 2434 | |
| 2435 | IPADBG("set sequencers to sequence 0x%x, ep = %d\n", type, |
| 2436 | clnt_hdl); |
| 2437 | ipahal_write_reg_n(IPA_ENDP_INIT_SEQ_n, clnt_hdl, type); |
| 2438 | |
| 2439 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2440 | } else { |
| 2441 | IPADBG("should not set sequencer type of ep = %d\n", clnt_hdl); |
| 2442 | } |
| 2443 | |
| 2444 | return 0; |
| 2445 | } |
| 2446 | |
| 2447 | /** |
| 2448 | * ipa3_cfg_ep - IPA end-point configuration |
| 2449 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 2450 | * @ipa_ep_cfg: [in] IPA end-point configuration params |
| 2451 | * |
Amir Levy | dc65f4c | 2017-07-06 09:49:50 +0300 | [diff] [blame] | 2452 | * This includes nat, IPv6CT, header, mode, aggregation and route settings and |
| 2453 | * is a one shot API to configure the IPA end-point fully |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2454 | * |
| 2455 | * Returns: 0 on success, negative on failure |
| 2456 | * |
| 2457 | * Note: Should not be called from atomic context |
| 2458 | */ |
| 2459 | int ipa3_cfg_ep(u32 clnt_hdl, const struct ipa_ep_cfg *ipa_ep_cfg) |
| 2460 | { |
| 2461 | int result = -EINVAL; |
| 2462 | |
| 2463 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 2464 | ipa3_ctx->ep[clnt_hdl].valid == 0 || ipa_ep_cfg == NULL) { |
| 2465 | IPAERR("bad parm.\n"); |
| 2466 | return -EINVAL; |
| 2467 | } |
| 2468 | |
| 2469 | result = ipa3_cfg_ep_hdr(clnt_hdl, &ipa_ep_cfg->hdr); |
| 2470 | if (result) |
| 2471 | return result; |
| 2472 | |
| 2473 | result = ipa3_cfg_ep_hdr_ext(clnt_hdl, &ipa_ep_cfg->hdr_ext); |
| 2474 | if (result) |
| 2475 | return result; |
| 2476 | |
| 2477 | result = ipa3_cfg_ep_aggr(clnt_hdl, &ipa_ep_cfg->aggr); |
| 2478 | if (result) |
| 2479 | return result; |
| 2480 | |
| 2481 | result = ipa3_cfg_ep_cfg(clnt_hdl, &ipa_ep_cfg->cfg); |
| 2482 | if (result) |
| 2483 | return result; |
| 2484 | |
| 2485 | if (IPA_CLIENT_IS_PROD(ipa3_ctx->ep[clnt_hdl].client)) { |
| 2486 | result = ipa3_cfg_ep_nat(clnt_hdl, &ipa_ep_cfg->nat); |
| 2487 | if (result) |
| 2488 | return result; |
| 2489 | |
Amir Levy | dc65f4c | 2017-07-06 09:49:50 +0300 | [diff] [blame] | 2490 | if (ipa3_ctx->ipa_hw_type >= IPA_HW_v4_0) { |
| 2491 | result = ipa3_cfg_ep_conn_track(clnt_hdl, |
| 2492 | &ipa_ep_cfg->conn_track); |
| 2493 | if (result) |
| 2494 | return result; |
| 2495 | } |
| 2496 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2497 | result = ipa3_cfg_ep_mode(clnt_hdl, &ipa_ep_cfg->mode); |
| 2498 | if (result) |
| 2499 | return result; |
| 2500 | |
| 2501 | result = ipa3_cfg_ep_seq(clnt_hdl, &ipa_ep_cfg->seq); |
| 2502 | if (result) |
| 2503 | return result; |
| 2504 | |
| 2505 | result = ipa3_cfg_ep_route(clnt_hdl, &ipa_ep_cfg->route); |
| 2506 | if (result) |
| 2507 | return result; |
| 2508 | |
| 2509 | result = ipa3_cfg_ep_deaggr(clnt_hdl, &ipa_ep_cfg->deaggr); |
| 2510 | if (result) |
| 2511 | return result; |
| 2512 | } else { |
| 2513 | result = ipa3_cfg_ep_metadata_mask(clnt_hdl, |
| 2514 | &ipa_ep_cfg->metadata_mask); |
| 2515 | if (result) |
| 2516 | return result; |
| 2517 | } |
| 2518 | |
| 2519 | return 0; |
| 2520 | } |
| 2521 | |
Amir Levy | dc65f4c | 2017-07-06 09:49:50 +0300 | [diff] [blame] | 2522 | static const char *ipa3_get_nat_en_str(enum ipa_nat_en_type nat_en) |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2523 | { |
| 2524 | switch (nat_en) { |
| 2525 | case (IPA_BYPASS_NAT): |
| 2526 | return "NAT disabled"; |
| 2527 | case (IPA_SRC_NAT): |
| 2528 | return "Source NAT"; |
| 2529 | case (IPA_DST_NAT): |
| 2530 | return "Dst NAT"; |
| 2531 | } |
| 2532 | |
| 2533 | return "undefined"; |
| 2534 | } |
| 2535 | |
Amir Levy | dc65f4c | 2017-07-06 09:49:50 +0300 | [diff] [blame] | 2536 | static const char *ipa3_get_ipv6ct_en_str(enum ipa_ipv6ct_en_type ipv6ct_en) |
| 2537 | { |
| 2538 | switch (ipv6ct_en) { |
| 2539 | case (IPA_BYPASS_IPV6CT): |
| 2540 | return "ipv6ct disabled"; |
| 2541 | case (IPA_ENABLE_IPV6CT): |
| 2542 | return "ipv6ct enabled"; |
| 2543 | } |
| 2544 | |
| 2545 | return "undefined"; |
| 2546 | } |
| 2547 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2548 | /** |
| 2549 | * ipa3_cfg_ep_nat() - IPA end-point NAT configuration |
| 2550 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
Amir Levy | dc65f4c | 2017-07-06 09:49:50 +0300 | [diff] [blame] | 2551 | * @ep_nat: [in] IPA NAT end-point configuration params |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2552 | * |
| 2553 | * Returns: 0 on success, negative on failure |
| 2554 | * |
| 2555 | * Note: Should not be called from atomic context |
| 2556 | */ |
| 2557 | int ipa3_cfg_ep_nat(u32 clnt_hdl, const struct ipa_ep_cfg_nat *ep_nat) |
| 2558 | { |
| 2559 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 2560 | ipa3_ctx->ep[clnt_hdl].valid == 0 || ep_nat == NULL) { |
| 2561 | IPAERR("bad parm, clnt_hdl = %d , ep_valid = %d\n", |
| 2562 | clnt_hdl, |
| 2563 | ipa3_ctx->ep[clnt_hdl].valid); |
| 2564 | return -EINVAL; |
| 2565 | } |
| 2566 | |
| 2567 | if (IPA_CLIENT_IS_CONS(ipa3_ctx->ep[clnt_hdl].client)) { |
| 2568 | IPAERR("NAT does not apply to IPA out EP %d\n", clnt_hdl); |
| 2569 | return -EINVAL; |
| 2570 | } |
| 2571 | |
| 2572 | IPADBG("pipe=%d, nat_en=%d(%s)\n", |
| 2573 | clnt_hdl, |
| 2574 | ep_nat->nat_en, |
| 2575 | ipa3_get_nat_en_str(ep_nat->nat_en)); |
| 2576 | |
| 2577 | /* copy over EP cfg */ |
| 2578 | ipa3_ctx->ep[clnt_hdl].cfg.nat = *ep_nat; |
| 2579 | |
| 2580 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2581 | |
| 2582 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_NAT_n, clnt_hdl, ep_nat); |
| 2583 | |
| 2584 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2585 | |
| 2586 | return 0; |
| 2587 | } |
| 2588 | |
Amir Levy | dc65f4c | 2017-07-06 09:49:50 +0300 | [diff] [blame] | 2589 | /** |
| 2590 | * ipa3_cfg_ep_conn_track() - IPA end-point IPv6CT configuration |
| 2591 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 2592 | * @ep_conn_track: [in] IPA IPv6CT end-point configuration params |
| 2593 | * |
| 2594 | * Returns: 0 on success, negative on failure |
| 2595 | * |
| 2596 | * Note: Should not be called from atomic context |
| 2597 | */ |
| 2598 | int ipa3_cfg_ep_conn_track(u32 clnt_hdl, |
| 2599 | const struct ipa_ep_cfg_conn_track *ep_conn_track) |
| 2600 | { |
| 2601 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 2602 | ipa3_ctx->ep[clnt_hdl].valid == 0 || ep_conn_track == NULL) { |
| 2603 | IPAERR("bad parm, clnt_hdl = %d , ep_valid = %d\n", |
| 2604 | clnt_hdl, |
| 2605 | ipa3_ctx->ep[clnt_hdl].valid); |
| 2606 | return -EINVAL; |
| 2607 | } |
| 2608 | |
| 2609 | if (IPA_CLIENT_IS_CONS(ipa3_ctx->ep[clnt_hdl].client)) { |
| 2610 | IPAERR("IPv6CT does not apply to IPA out EP %d\n", clnt_hdl); |
| 2611 | return -EINVAL; |
| 2612 | } |
| 2613 | |
| 2614 | IPADBG("pipe=%d, conn_track_en=%d(%s)\n", |
| 2615 | clnt_hdl, |
| 2616 | ep_conn_track->conn_track_en, |
| 2617 | ipa3_get_ipv6ct_en_str(ep_conn_track->conn_track_en)); |
| 2618 | |
| 2619 | /* copy over EP cfg */ |
| 2620 | ipa3_ctx->ep[clnt_hdl].cfg.conn_track = *ep_conn_track; |
| 2621 | |
| 2622 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2623 | |
| 2624 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_CONN_TRACK_n, clnt_hdl, |
| 2625 | ep_conn_track); |
| 2626 | |
| 2627 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2628 | |
| 2629 | return 0; |
| 2630 | } |
| 2631 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2632 | |
| 2633 | /** |
| 2634 | * ipa3_cfg_ep_status() - IPA end-point status configuration |
| 2635 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 2636 | * @ipa_ep_cfg: [in] IPA end-point configuration params |
| 2637 | * |
| 2638 | * Returns: 0 on success, negative on failure |
| 2639 | * |
| 2640 | * Note: Should not be called from atomic context |
| 2641 | */ |
| 2642 | int ipa3_cfg_ep_status(u32 clnt_hdl, |
| 2643 | const struct ipahal_reg_ep_cfg_status *ep_status) |
| 2644 | { |
| 2645 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 2646 | ipa3_ctx->ep[clnt_hdl].valid == 0 || ep_status == NULL) { |
| 2647 | IPAERR("bad parm, clnt_hdl = %d , ep_valid = %d\n", |
| 2648 | clnt_hdl, |
| 2649 | ipa3_ctx->ep[clnt_hdl].valid); |
| 2650 | return -EINVAL; |
| 2651 | } |
| 2652 | |
| 2653 | IPADBG("pipe=%d, status_en=%d status_ep=%d status_location=%d\n", |
| 2654 | clnt_hdl, |
| 2655 | ep_status->status_en, |
| 2656 | ep_status->status_ep, |
| 2657 | ep_status->status_location); |
| 2658 | |
| 2659 | /* copy over EP cfg */ |
| 2660 | ipa3_ctx->ep[clnt_hdl].status = *ep_status; |
| 2661 | |
| 2662 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2663 | |
| 2664 | ipahal_write_reg_n_fields(IPA_ENDP_STATUS_n, clnt_hdl, ep_status); |
| 2665 | |
| 2666 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2667 | |
| 2668 | return 0; |
| 2669 | } |
| 2670 | |
| 2671 | /** |
| 2672 | * ipa3_cfg_ep_cfg() - IPA end-point cfg configuration |
| 2673 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 2674 | * @ipa_ep_cfg: [in] IPA end-point configuration params |
| 2675 | * |
| 2676 | * Returns: 0 on success, negative on failure |
| 2677 | * |
| 2678 | * Note: Should not be called from atomic context |
| 2679 | */ |
| 2680 | int ipa3_cfg_ep_cfg(u32 clnt_hdl, const struct ipa_ep_cfg_cfg *cfg) |
| 2681 | { |
| 2682 | u8 qmb_master_sel; |
| 2683 | |
| 2684 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 2685 | ipa3_ctx->ep[clnt_hdl].valid == 0 || cfg == NULL) { |
| 2686 | IPAERR("bad parm, clnt_hdl = %d , ep_valid = %d\n", |
| 2687 | clnt_hdl, |
| 2688 | ipa3_ctx->ep[clnt_hdl].valid); |
| 2689 | return -EINVAL; |
| 2690 | } |
| 2691 | |
| 2692 | /* copy over EP cfg */ |
| 2693 | ipa3_ctx->ep[clnt_hdl].cfg.cfg = *cfg; |
| 2694 | |
| 2695 | /* Override QMB master selection */ |
| 2696 | qmb_master_sel = ipa3_get_qmb_master_sel(ipa3_ctx->ep[clnt_hdl].client); |
| 2697 | ipa3_ctx->ep[clnt_hdl].cfg.cfg.gen_qmb_master_sel = qmb_master_sel; |
| 2698 | IPADBG( |
| 2699 | "pipe=%d, frag_ofld_en=%d cs_ofld_en=%d mdata_hdr_ofst=%d gen_qmb_master_sel=%d\n", |
| 2700 | clnt_hdl, |
| 2701 | ipa3_ctx->ep[clnt_hdl].cfg.cfg.frag_offload_en, |
| 2702 | ipa3_ctx->ep[clnt_hdl].cfg.cfg.cs_offload_en, |
| 2703 | ipa3_ctx->ep[clnt_hdl].cfg.cfg.cs_metadata_hdr_offset, |
| 2704 | ipa3_ctx->ep[clnt_hdl].cfg.cfg.gen_qmb_master_sel); |
| 2705 | |
| 2706 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2707 | |
| 2708 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_CFG_n, clnt_hdl, |
| 2709 | &ipa3_ctx->ep[clnt_hdl].cfg.cfg); |
| 2710 | |
| 2711 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2712 | |
| 2713 | return 0; |
| 2714 | } |
| 2715 | |
| 2716 | /** |
| 2717 | * ipa3_cfg_ep_metadata_mask() - IPA end-point meta-data mask configuration |
| 2718 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 2719 | * @ipa_ep_cfg: [in] IPA end-point configuration params |
| 2720 | * |
| 2721 | * Returns: 0 on success, negative on failure |
| 2722 | * |
| 2723 | * Note: Should not be called from atomic context |
| 2724 | */ |
| 2725 | int ipa3_cfg_ep_metadata_mask(u32 clnt_hdl, |
| 2726 | const struct ipa_ep_cfg_metadata_mask |
| 2727 | *metadata_mask) |
| 2728 | { |
| 2729 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 2730 | ipa3_ctx->ep[clnt_hdl].valid == 0 || metadata_mask == NULL) { |
| 2731 | IPAERR("bad parm, clnt_hdl = %d , ep_valid = %d\n", |
| 2732 | clnt_hdl, |
| 2733 | ipa3_ctx->ep[clnt_hdl].valid); |
| 2734 | return -EINVAL; |
| 2735 | } |
| 2736 | |
| 2737 | IPADBG("pipe=%d, metadata_mask=0x%x\n", |
| 2738 | clnt_hdl, |
| 2739 | metadata_mask->metadata_mask); |
| 2740 | |
| 2741 | /* copy over EP cfg */ |
| 2742 | ipa3_ctx->ep[clnt_hdl].cfg.metadata_mask = *metadata_mask; |
| 2743 | |
| 2744 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2745 | |
| 2746 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_HDR_METADATA_MASK_n, |
| 2747 | clnt_hdl, metadata_mask); |
| 2748 | |
| 2749 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2750 | |
| 2751 | return 0; |
| 2752 | } |
| 2753 | |
| 2754 | /** |
| 2755 | * ipa3_cfg_ep_hdr() - IPA end-point header configuration |
| 2756 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 2757 | * @ipa_ep_cfg: [in] IPA end-point configuration params |
| 2758 | * |
| 2759 | * Returns: 0 on success, negative on failure |
| 2760 | * |
| 2761 | * Note: Should not be called from atomic context |
| 2762 | */ |
| 2763 | int ipa3_cfg_ep_hdr(u32 clnt_hdl, const struct ipa_ep_cfg_hdr *ep_hdr) |
| 2764 | { |
| 2765 | struct ipa3_ep_context *ep; |
| 2766 | |
| 2767 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 2768 | ipa3_ctx->ep[clnt_hdl].valid == 0 || ep_hdr == NULL) { |
| 2769 | IPAERR("bad parm, clnt_hdl = %d , ep_valid = %d\n", |
| 2770 | clnt_hdl, ipa3_ctx->ep[clnt_hdl].valid); |
| 2771 | return -EINVAL; |
| 2772 | } |
| 2773 | IPADBG("pipe=%d metadata_reg_valid=%d\n", |
| 2774 | clnt_hdl, |
| 2775 | ep_hdr->hdr_metadata_reg_valid); |
| 2776 | |
| 2777 | IPADBG("remove_additional=%d, a5_mux=%d, ofst_pkt_size=0x%x\n", |
| 2778 | ep_hdr->hdr_remove_additional, |
| 2779 | ep_hdr->hdr_a5_mux, |
| 2780 | ep_hdr->hdr_ofst_pkt_size); |
| 2781 | |
| 2782 | IPADBG("ofst_pkt_size_valid=%d, additional_const_len=0x%x\n", |
| 2783 | ep_hdr->hdr_ofst_pkt_size_valid, |
| 2784 | ep_hdr->hdr_additional_const_len); |
| 2785 | |
| 2786 | IPADBG("ofst_metadata=0x%x, ofst_metadata_valid=%d, len=0x%x", |
| 2787 | ep_hdr->hdr_ofst_metadata, |
| 2788 | ep_hdr->hdr_ofst_metadata_valid, |
| 2789 | ep_hdr->hdr_len); |
| 2790 | |
| 2791 | ep = &ipa3_ctx->ep[clnt_hdl]; |
| 2792 | |
| 2793 | /* copy over EP cfg */ |
| 2794 | ep->cfg.hdr = *ep_hdr; |
| 2795 | |
| 2796 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2797 | |
| 2798 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_HDR_n, clnt_hdl, &ep->cfg.hdr); |
| 2799 | |
| 2800 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2801 | |
| 2802 | return 0; |
| 2803 | } |
| 2804 | |
| 2805 | /** |
| 2806 | * ipa3_cfg_ep_hdr_ext() - IPA end-point extended header configuration |
| 2807 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 2808 | * @ep_hdr_ext: [in] IPA end-point configuration params |
| 2809 | * |
| 2810 | * Returns: 0 on success, negative on failure |
| 2811 | * |
| 2812 | * Note: Should not be called from atomic context |
| 2813 | */ |
| 2814 | int ipa3_cfg_ep_hdr_ext(u32 clnt_hdl, |
| 2815 | const struct ipa_ep_cfg_hdr_ext *ep_hdr_ext) |
| 2816 | { |
| 2817 | struct ipa3_ep_context *ep; |
| 2818 | |
| 2819 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 2820 | ipa3_ctx->ep[clnt_hdl].valid == 0 || ep_hdr_ext == NULL) { |
| 2821 | IPAERR("bad parm, clnt_hdl = %d , ep_valid = %d\n", |
| 2822 | clnt_hdl, ipa3_ctx->ep[clnt_hdl].valid); |
| 2823 | return -EINVAL; |
| 2824 | } |
| 2825 | |
| 2826 | IPADBG("pipe=%d hdr_pad_to_alignment=%d\n", |
| 2827 | clnt_hdl, |
| 2828 | ep_hdr_ext->hdr_pad_to_alignment); |
| 2829 | |
| 2830 | IPADBG("hdr_total_len_or_pad_offset=%d\n", |
| 2831 | ep_hdr_ext->hdr_total_len_or_pad_offset); |
| 2832 | |
| 2833 | IPADBG("hdr_payload_len_inc_padding=%d hdr_total_len_or_pad=%d\n", |
| 2834 | ep_hdr_ext->hdr_payload_len_inc_padding, |
| 2835 | ep_hdr_ext->hdr_total_len_or_pad); |
| 2836 | |
| 2837 | IPADBG("hdr_total_len_or_pad_valid=%d hdr_little_endian=%d\n", |
| 2838 | ep_hdr_ext->hdr_total_len_or_pad_valid, |
| 2839 | ep_hdr_ext->hdr_little_endian); |
| 2840 | |
| 2841 | ep = &ipa3_ctx->ep[clnt_hdl]; |
| 2842 | |
| 2843 | /* copy over EP cfg */ |
| 2844 | ep->cfg.hdr_ext = *ep_hdr_ext; |
| 2845 | |
| 2846 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2847 | |
| 2848 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_HDR_EXT_n, clnt_hdl, |
| 2849 | &ep->cfg.hdr_ext); |
| 2850 | |
| 2851 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2852 | |
| 2853 | return 0; |
| 2854 | } |
| 2855 | |
| 2856 | /** |
| 2857 | * ipa3_cfg_ep_ctrl() - IPA end-point Control configuration |
| 2858 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 2859 | * @ipa_ep_cfg_ctrl: [in] IPA end-point configuration params |
| 2860 | * |
| 2861 | * Returns: 0 on success, negative on failure |
| 2862 | */ |
| 2863 | int ipa3_cfg_ep_ctrl(u32 clnt_hdl, const struct ipa_ep_cfg_ctrl *ep_ctrl) |
| 2864 | { |
| 2865 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || ep_ctrl == NULL) { |
| 2866 | IPAERR("bad parm, clnt_hdl = %d\n", clnt_hdl); |
| 2867 | return -EINVAL; |
| 2868 | } |
| 2869 | |
Skylar Chang | a699afd | 2017-06-06 10:06:21 -0700 | [diff] [blame] | 2870 | if (ipa3_ctx->ipa_hw_type >= IPA_HW_v4_0 && ep_ctrl->ipa_ep_suspend) { |
| 2871 | IPAERR("pipe suspend is not supported\n"); |
| 2872 | WARN_ON(1); |
| 2873 | return -EPERM; |
| 2874 | } |
| 2875 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2876 | IPADBG("pipe=%d ep_suspend=%d, ep_delay=%d\n", |
| 2877 | clnt_hdl, |
| 2878 | ep_ctrl->ipa_ep_suspend, |
| 2879 | ep_ctrl->ipa_ep_delay); |
| 2880 | |
| 2881 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_CTRL_n, clnt_hdl, ep_ctrl); |
| 2882 | |
| 2883 | if (ep_ctrl->ipa_ep_suspend == true && |
| 2884 | IPA_CLIENT_IS_CONS(ipa3_ctx->ep[clnt_hdl].client)) |
| 2885 | ipa3_suspend_active_aggr_wa(clnt_hdl); |
| 2886 | |
| 2887 | return 0; |
| 2888 | } |
| 2889 | |
| 2890 | const char *ipa3_get_mode_type_str(enum ipa_mode_type mode) |
| 2891 | { |
| 2892 | switch (mode) { |
| 2893 | case (IPA_BASIC): |
| 2894 | return "Basic"; |
| 2895 | case (IPA_ENABLE_FRAMING_HDLC): |
| 2896 | return "HDLC framing"; |
| 2897 | case (IPA_ENABLE_DEFRAMING_HDLC): |
| 2898 | return "HDLC de-framing"; |
| 2899 | case (IPA_DMA): |
| 2900 | return "DMA"; |
| 2901 | } |
| 2902 | |
| 2903 | return "undefined"; |
| 2904 | } |
| 2905 | |
| 2906 | /** |
| 2907 | * ipa3_cfg_ep_mode() - IPA end-point mode configuration |
| 2908 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 2909 | * @ipa_ep_cfg: [in] IPA end-point configuration params |
| 2910 | * |
| 2911 | * Returns: 0 on success, negative on failure |
| 2912 | * |
| 2913 | * Note: Should not be called from atomic context |
| 2914 | */ |
| 2915 | int ipa3_cfg_ep_mode(u32 clnt_hdl, const struct ipa_ep_cfg_mode *ep_mode) |
| 2916 | { |
| 2917 | int ep; |
| 2918 | int type; |
| 2919 | struct ipahal_reg_endp_init_mode init_mode; |
| 2920 | |
| 2921 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 2922 | ipa3_ctx->ep[clnt_hdl].valid == 0 || ep_mode == NULL) { |
| 2923 | IPAERR("bad params clnt_hdl=%d , ep_valid=%d ep_mode=%p\n", |
| 2924 | clnt_hdl, ipa3_ctx->ep[clnt_hdl].valid, |
| 2925 | ep_mode); |
| 2926 | return -EINVAL; |
| 2927 | } |
| 2928 | |
| 2929 | if (IPA_CLIENT_IS_CONS(ipa3_ctx->ep[clnt_hdl].client)) { |
| 2930 | IPAERR("MODE does not apply to IPA out EP %d\n", clnt_hdl); |
| 2931 | return -EINVAL; |
| 2932 | } |
| 2933 | |
| 2934 | ep = ipa3_get_ep_mapping(ep_mode->dst); |
| 2935 | if (ep == -1 && ep_mode->mode == IPA_DMA) { |
| 2936 | IPAERR("dst %d does not exist in DMA mode\n", ep_mode->dst); |
| 2937 | return -EINVAL; |
| 2938 | } |
| 2939 | |
| 2940 | WARN_ON(ep_mode->mode == IPA_DMA && IPA_CLIENT_IS_PROD(ep_mode->dst)); |
| 2941 | |
| 2942 | if (!IPA_CLIENT_IS_CONS(ep_mode->dst)) |
| 2943 | ep = ipa3_get_ep_mapping(IPA_CLIENT_APPS_LAN_CONS); |
| 2944 | |
| 2945 | IPADBG("pipe=%d mode=%d(%s), dst_client_number=%d", |
| 2946 | clnt_hdl, |
| 2947 | ep_mode->mode, |
| 2948 | ipa3_get_mode_type_str(ep_mode->mode), |
| 2949 | ep_mode->dst); |
| 2950 | |
| 2951 | /* copy over EP cfg */ |
| 2952 | ipa3_ctx->ep[clnt_hdl].cfg.mode = *ep_mode; |
| 2953 | ipa3_ctx->ep[clnt_hdl].dst_pipe_index = ep; |
| 2954 | |
| 2955 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2956 | |
| 2957 | init_mode.dst_pipe_number = ipa3_ctx->ep[clnt_hdl].dst_pipe_index; |
| 2958 | init_mode.ep_mode = *ep_mode; |
| 2959 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_MODE_n, clnt_hdl, &init_mode); |
| 2960 | |
| 2961 | /* Configure sequencers type for test clients*/ |
| 2962 | if (IPA_CLIENT_IS_TEST(ipa3_ctx->ep[clnt_hdl].client)) { |
| 2963 | if (ep_mode->mode == IPA_DMA) |
| 2964 | type = IPA_DPS_HPS_SEQ_TYPE_DMA_ONLY; |
| 2965 | else |
Skylar Chang | 7fa2271 | 2017-04-03 18:29:21 -0700 | [diff] [blame] | 2966 | type = |
| 2967 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2968 | |
| 2969 | IPADBG(" set sequencers to sequance 0x%x, ep = %d\n", type, |
| 2970 | clnt_hdl); |
| 2971 | ipahal_write_reg_n(IPA_ENDP_INIT_SEQ_n, clnt_hdl, type); |
| 2972 | } |
| 2973 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2974 | |
| 2975 | return 0; |
| 2976 | } |
| 2977 | |
| 2978 | const char *ipa3_get_aggr_enable_str(enum ipa_aggr_en_type aggr_en) |
| 2979 | { |
| 2980 | switch (aggr_en) { |
| 2981 | case (IPA_BYPASS_AGGR): |
| 2982 | return "no aggregation"; |
| 2983 | case (IPA_ENABLE_AGGR): |
| 2984 | return "aggregation enabled"; |
| 2985 | case (IPA_ENABLE_DEAGGR): |
| 2986 | return "de-aggregation enabled"; |
| 2987 | } |
| 2988 | |
| 2989 | return "undefined"; |
| 2990 | } |
| 2991 | |
| 2992 | const char *ipa3_get_aggr_type_str(enum ipa_aggr_type aggr_type) |
| 2993 | { |
| 2994 | switch (aggr_type) { |
| 2995 | case (IPA_MBIM_16): |
| 2996 | return "MBIM_16"; |
| 2997 | case (IPA_HDLC): |
| 2998 | return "HDLC"; |
| 2999 | case (IPA_TLP): |
| 3000 | return "TLP"; |
| 3001 | case (IPA_RNDIS): |
| 3002 | return "RNDIS"; |
| 3003 | case (IPA_GENERIC): |
| 3004 | return "GENERIC"; |
| 3005 | case (IPA_QCMAP): |
| 3006 | return "QCMAP"; |
| 3007 | } |
| 3008 | return "undefined"; |
| 3009 | } |
| 3010 | |
| 3011 | /** |
| 3012 | * ipa3_cfg_ep_aggr() - IPA end-point aggregation configuration |
| 3013 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 3014 | * @ipa_ep_cfg: [in] IPA end-point configuration params |
| 3015 | * |
| 3016 | * Returns: 0 on success, negative on failure |
| 3017 | * |
| 3018 | * Note: Should not be called from atomic context |
| 3019 | */ |
| 3020 | int ipa3_cfg_ep_aggr(u32 clnt_hdl, const struct ipa_ep_cfg_aggr *ep_aggr) |
| 3021 | { |
| 3022 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 3023 | ipa3_ctx->ep[clnt_hdl].valid == 0 || ep_aggr == NULL) { |
| 3024 | IPAERR("bad parm, clnt_hdl = %d , ep_valid = %d\n", |
| 3025 | clnt_hdl, ipa3_ctx->ep[clnt_hdl].valid); |
| 3026 | return -EINVAL; |
| 3027 | } |
| 3028 | |
| 3029 | if (ep_aggr->aggr_en == IPA_ENABLE_DEAGGR && |
| 3030 | !IPA_EP_SUPPORTS_DEAGGR(clnt_hdl)) { |
| 3031 | IPAERR("pipe=%d cannot be configured to DEAGGR\n", clnt_hdl); |
| 3032 | WARN_ON(1); |
| 3033 | return -EINVAL; |
| 3034 | } |
| 3035 | |
| 3036 | IPADBG("pipe=%d en=%d(%s), type=%d(%s), byte_limit=%d, time_limit=%d\n", |
| 3037 | clnt_hdl, |
| 3038 | ep_aggr->aggr_en, |
| 3039 | ipa3_get_aggr_enable_str(ep_aggr->aggr_en), |
| 3040 | ep_aggr->aggr, |
| 3041 | ipa3_get_aggr_type_str(ep_aggr->aggr), |
| 3042 | ep_aggr->aggr_byte_limit, |
| 3043 | ep_aggr->aggr_time_limit); |
| 3044 | IPADBG("hard_byte_limit_en=%d aggr_sw_eof_active=%d\n", |
| 3045 | ep_aggr->aggr_hard_byte_limit_en, |
| 3046 | ep_aggr->aggr_sw_eof_active); |
| 3047 | |
| 3048 | /* copy over EP cfg */ |
| 3049 | ipa3_ctx->ep[clnt_hdl].cfg.aggr = *ep_aggr; |
| 3050 | |
| 3051 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 3052 | |
| 3053 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_AGGR_n, clnt_hdl, ep_aggr); |
| 3054 | |
| 3055 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 3056 | |
| 3057 | return 0; |
| 3058 | } |
| 3059 | |
| 3060 | /** |
| 3061 | * ipa3_cfg_ep_route() - IPA end-point routing configuration |
| 3062 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 3063 | * @ipa_ep_cfg: [in] IPA end-point configuration params |
| 3064 | * |
| 3065 | * Returns: 0 on success, negative on failure |
| 3066 | * |
| 3067 | * Note: Should not be called from atomic context |
| 3068 | */ |
| 3069 | int ipa3_cfg_ep_route(u32 clnt_hdl, const struct ipa_ep_cfg_route *ep_route) |
| 3070 | { |
| 3071 | struct ipahal_reg_endp_init_route init_rt; |
| 3072 | |
| 3073 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 3074 | ipa3_ctx->ep[clnt_hdl].valid == 0 || ep_route == NULL) { |
| 3075 | IPAERR("bad parm, clnt_hdl = %d , ep_valid = %d\n", |
| 3076 | clnt_hdl, ipa3_ctx->ep[clnt_hdl].valid); |
| 3077 | return -EINVAL; |
| 3078 | } |
| 3079 | |
| 3080 | if (IPA_CLIENT_IS_CONS(ipa3_ctx->ep[clnt_hdl].client)) { |
| 3081 | IPAERR("ROUTE does not apply to IPA out EP %d\n", |
| 3082 | clnt_hdl); |
| 3083 | return -EINVAL; |
| 3084 | } |
| 3085 | |
| 3086 | /* |
| 3087 | * if DMA mode was configured previously for this EP, return with |
| 3088 | * success |
| 3089 | */ |
| 3090 | if (ipa3_ctx->ep[clnt_hdl].cfg.mode.mode == IPA_DMA) { |
| 3091 | IPADBG("DMA enabled for ep %d, dst pipe is part of DMA\n", |
| 3092 | clnt_hdl); |
| 3093 | return 0; |
| 3094 | } |
| 3095 | |
| 3096 | if (ep_route->rt_tbl_hdl) |
| 3097 | IPAERR("client specified non-zero RT TBL hdl - ignore it\n"); |
| 3098 | |
| 3099 | IPADBG("pipe=%d, rt_tbl_hdl=%d\n", |
| 3100 | clnt_hdl, |
| 3101 | ep_route->rt_tbl_hdl); |
| 3102 | |
| 3103 | /* always use "default" routing table when programming EP ROUTE reg */ |
| 3104 | ipa3_ctx->ep[clnt_hdl].rt_tbl_idx = |
| 3105 | IPA_MEM_PART(v4_apps_rt_index_lo); |
| 3106 | |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 3107 | if (ipa3_ctx->ipa_hw_type < IPA_HW_v4_0) { |
| 3108 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3109 | |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 3110 | init_rt.route_table_index = ipa3_ctx->ep[clnt_hdl].rt_tbl_idx; |
| 3111 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_ROUTE_n, |
| 3112 | clnt_hdl, &init_rt); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3113 | |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 3114 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 3115 | } |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3116 | |
| 3117 | return 0; |
| 3118 | } |
| 3119 | |
| 3120 | /** |
| 3121 | * ipa3_cfg_ep_holb() - IPA end-point holb configuration |
| 3122 | * |
| 3123 | * If an IPA producer pipe is full, IPA HW by default will block |
| 3124 | * indefinitely till space opens up. During this time no packets |
| 3125 | * including those from unrelated pipes will be processed. Enabling |
| 3126 | * HOLB means IPA HW will be allowed to drop packets as/when needed |
| 3127 | * and indefinite blocking is avoided. |
| 3128 | * |
| 3129 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 3130 | * @ipa_ep_cfg: [in] IPA end-point configuration params |
| 3131 | * |
| 3132 | * Returns: 0 on success, negative on failure |
| 3133 | */ |
| 3134 | int ipa3_cfg_ep_holb(u32 clnt_hdl, const struct ipa_ep_cfg_holb *ep_holb) |
| 3135 | { |
| 3136 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 3137 | ipa3_ctx->ep[clnt_hdl].valid == 0 || ep_holb == NULL || |
| 3138 | ep_holb->tmr_val > ipa3_ctx->ctrl->max_holb_tmr_val || |
| 3139 | ep_holb->en > 1) { |
| 3140 | IPAERR("bad parm.\n"); |
| 3141 | return -EINVAL; |
| 3142 | } |
| 3143 | |
| 3144 | if (IPA_CLIENT_IS_PROD(ipa3_ctx->ep[clnt_hdl].client)) { |
| 3145 | IPAERR("HOLB does not apply to IPA in EP %d\n", clnt_hdl); |
| 3146 | return -EINVAL; |
| 3147 | } |
| 3148 | |
| 3149 | ipa3_ctx->ep[clnt_hdl].holb = *ep_holb; |
| 3150 | |
| 3151 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 3152 | |
| 3153 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_HOL_BLOCK_EN_n, clnt_hdl, |
| 3154 | ep_holb); |
| 3155 | |
| 3156 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_HOL_BLOCK_TIMER_n, clnt_hdl, |
| 3157 | ep_holb); |
| 3158 | |
| 3159 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 3160 | |
| 3161 | IPADBG("cfg holb %u ep=%d tmr=%d\n", ep_holb->en, clnt_hdl, |
| 3162 | ep_holb->tmr_val); |
| 3163 | |
| 3164 | return 0; |
| 3165 | } |
| 3166 | |
| 3167 | /** |
| 3168 | * ipa3_cfg_ep_holb_by_client() - IPA end-point holb configuration |
| 3169 | * |
| 3170 | * Wrapper function for ipa3_cfg_ep_holb() with client name instead of |
| 3171 | * client handle. This function is used for clients that does not have |
| 3172 | * client handle. |
| 3173 | * |
| 3174 | * @client: [in] client name |
| 3175 | * @ipa_ep_cfg: [in] IPA end-point configuration params |
| 3176 | * |
| 3177 | * Returns: 0 on success, negative on failure |
| 3178 | */ |
| 3179 | int ipa3_cfg_ep_holb_by_client(enum ipa_client_type client, |
| 3180 | const struct ipa_ep_cfg_holb *ep_holb) |
| 3181 | { |
| 3182 | return ipa3_cfg_ep_holb(ipa3_get_ep_mapping(client), ep_holb); |
| 3183 | } |
| 3184 | |
| 3185 | /** |
| 3186 | * ipa3_cfg_ep_deaggr() - IPA end-point deaggregation configuration |
| 3187 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 3188 | * @ep_deaggr: [in] IPA end-point configuration params |
| 3189 | * |
| 3190 | * Returns: 0 on success, negative on failure |
| 3191 | * |
| 3192 | * Note: Should not be called from atomic context |
| 3193 | */ |
| 3194 | int ipa3_cfg_ep_deaggr(u32 clnt_hdl, |
| 3195 | const struct ipa_ep_cfg_deaggr *ep_deaggr) |
| 3196 | { |
| 3197 | struct ipa3_ep_context *ep; |
| 3198 | |
| 3199 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 3200 | ipa3_ctx->ep[clnt_hdl].valid == 0 || ep_deaggr == NULL) { |
| 3201 | IPAERR("bad parm, clnt_hdl = %d , ep_valid = %d\n", |
| 3202 | clnt_hdl, ipa3_ctx->ep[clnt_hdl].valid); |
| 3203 | return -EINVAL; |
| 3204 | } |
| 3205 | |
| 3206 | IPADBG("pipe=%d deaggr_hdr_len=%d\n", |
| 3207 | clnt_hdl, |
| 3208 | ep_deaggr->deaggr_hdr_len); |
| 3209 | |
| 3210 | IPADBG("packet_offset_valid=%d\n", |
| 3211 | ep_deaggr->packet_offset_valid); |
| 3212 | |
| 3213 | IPADBG("packet_offset_location=%d max_packet_len=%d\n", |
| 3214 | ep_deaggr->packet_offset_location, |
| 3215 | ep_deaggr->max_packet_len); |
| 3216 | |
| 3217 | ep = &ipa3_ctx->ep[clnt_hdl]; |
| 3218 | |
| 3219 | /* copy over EP cfg */ |
| 3220 | ep->cfg.deaggr = *ep_deaggr; |
| 3221 | |
| 3222 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 3223 | |
| 3224 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_DEAGGR_n, clnt_hdl, |
| 3225 | &ep->cfg.deaggr); |
| 3226 | |
| 3227 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 3228 | |
| 3229 | return 0; |
| 3230 | } |
| 3231 | |
| 3232 | /** |
| 3233 | * ipa3_cfg_ep_metadata() - IPA end-point metadata configuration |
| 3234 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 3235 | * @ipa_ep_cfg: [in] IPA end-point configuration params |
| 3236 | * |
| 3237 | * Returns: 0 on success, negative on failure |
| 3238 | * |
| 3239 | * Note: Should not be called from atomic context |
| 3240 | */ |
| 3241 | int ipa3_cfg_ep_metadata(u32 clnt_hdl, const struct ipa_ep_cfg_metadata *ep_md) |
| 3242 | { |
| 3243 | u32 qmap_id = 0; |
| 3244 | struct ipa_ep_cfg_metadata ep_md_reg_wrt; |
| 3245 | |
| 3246 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 3247 | ipa3_ctx->ep[clnt_hdl].valid == 0 || ep_md == NULL) { |
| 3248 | IPAERR("bad parm, clnt_hdl = %d , ep_valid = %d\n", |
| 3249 | clnt_hdl, ipa3_ctx->ep[clnt_hdl].valid); |
| 3250 | return -EINVAL; |
| 3251 | } |
| 3252 | |
| 3253 | IPADBG("pipe=%d, mux id=%d\n", clnt_hdl, ep_md->qmap_id); |
| 3254 | |
| 3255 | /* copy over EP cfg */ |
| 3256 | ipa3_ctx->ep[clnt_hdl].cfg.meta = *ep_md; |
| 3257 | |
| 3258 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 3259 | |
| 3260 | ep_md_reg_wrt = *ep_md; |
| 3261 | qmap_id = (ep_md->qmap_id << |
| 3262 | IPA_ENDP_INIT_HDR_METADATA_n_MUX_ID_SHFT) & |
| 3263 | IPA_ENDP_INIT_HDR_METADATA_n_MUX_ID_BMASK; |
| 3264 | |
| 3265 | ep_md_reg_wrt.qmap_id = qmap_id; |
| 3266 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_HDR_METADATA_n, clnt_hdl, |
| 3267 | &ep_md_reg_wrt); |
| 3268 | ipa3_ctx->ep[clnt_hdl].cfg.hdr.hdr_metadata_reg_valid = 1; |
| 3269 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_HDR_n, clnt_hdl, |
| 3270 | &ipa3_ctx->ep[clnt_hdl].cfg.hdr); |
| 3271 | |
| 3272 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 3273 | |
| 3274 | return 0; |
| 3275 | } |
| 3276 | |
| 3277 | int ipa3_write_qmap_id(struct ipa_ioc_write_qmapid *param_in) |
| 3278 | { |
| 3279 | struct ipa_ep_cfg_metadata meta; |
| 3280 | struct ipa3_ep_context *ep; |
| 3281 | int ipa_ep_idx; |
| 3282 | int result = -EINVAL; |
| 3283 | |
| 3284 | if (param_in->client >= IPA_CLIENT_MAX) { |
Utkarsh Saxena | e978281 | 2017-05-26 17:20:32 +0530 | [diff] [blame] | 3285 | IPAERR_RL("bad parm client:%d\n", param_in->client); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3286 | goto fail; |
| 3287 | } |
| 3288 | |
| 3289 | ipa_ep_idx = ipa3_get_ep_mapping(param_in->client); |
| 3290 | if (ipa_ep_idx == -1) { |
Utkarsh Saxena | e978281 | 2017-05-26 17:20:32 +0530 | [diff] [blame] | 3291 | IPAERR_RL("Invalid client.\n"); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3292 | goto fail; |
| 3293 | } |
| 3294 | |
| 3295 | ep = &ipa3_ctx->ep[ipa_ep_idx]; |
| 3296 | if (!ep->valid) { |
Utkarsh Saxena | e978281 | 2017-05-26 17:20:32 +0530 | [diff] [blame] | 3297 | IPAERR_RL("EP not allocated.\n"); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3298 | goto fail; |
| 3299 | } |
| 3300 | |
| 3301 | meta.qmap_id = param_in->qmap_id; |
| 3302 | if (param_in->client == IPA_CLIENT_USB_PROD || |
| 3303 | param_in->client == IPA_CLIENT_HSIC1_PROD || |
Sunil Paidimarri | 5139aa2 | 2017-02-13 11:07:32 -0800 | [diff] [blame] | 3304 | param_in->client == IPA_CLIENT_ODU_PROD || |
| 3305 | param_in->client == IPA_CLIENT_ETHERNET_PROD) { |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3306 | result = ipa3_cfg_ep_metadata(ipa_ep_idx, &meta); |
| 3307 | } else if (param_in->client == IPA_CLIENT_WLAN1_PROD) { |
| 3308 | ipa3_ctx->ep[ipa_ep_idx].cfg.meta = meta; |
| 3309 | result = ipa3_write_qmapid_wdi_pipe(ipa_ep_idx, meta.qmap_id); |
| 3310 | if (result) |
Utkarsh Saxena | e978281 | 2017-05-26 17:20:32 +0530 | [diff] [blame] | 3311 | IPAERR_RL("qmap_id %d write failed on ep=%d\n", |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3312 | meta.qmap_id, ipa_ep_idx); |
| 3313 | result = 0; |
| 3314 | } |
| 3315 | |
| 3316 | fail: |
| 3317 | return result; |
| 3318 | } |
| 3319 | |
| 3320 | /** |
| 3321 | * ipa3_dump_buff_internal() - dumps buffer for debug purposes |
| 3322 | * @base: buffer base address |
| 3323 | * @phy_base: buffer physical base address |
| 3324 | * @size: size of the buffer |
| 3325 | */ |
| 3326 | void ipa3_dump_buff_internal(void *base, dma_addr_t phy_base, u32 size) |
| 3327 | { |
| 3328 | int i; |
| 3329 | u32 *cur = (u32 *)base; |
| 3330 | u8 *byt; |
| 3331 | |
| 3332 | IPADBG("system phys addr=%pa len=%u\n", &phy_base, size); |
| 3333 | for (i = 0; i < size / 4; i++) { |
| 3334 | byt = (u8 *)(cur + i); |
| 3335 | IPADBG("%2d %08x %02x %02x %02x %02x\n", i, *(cur + i), |
| 3336 | byt[0], byt[1], byt[2], byt[3]); |
| 3337 | } |
| 3338 | IPADBG("END\n"); |
| 3339 | } |
| 3340 | |
| 3341 | /** |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3342 | * ipa3_set_aggr_mode() - Set the aggregation mode which is a global setting |
| 3343 | * @mode: [in] the desired aggregation mode for e.g. straight MBIM, QCNCM, |
| 3344 | * etc |
| 3345 | * |
| 3346 | * Returns: 0 on success |
| 3347 | */ |
| 3348 | int ipa3_set_aggr_mode(enum ipa_aggr_mode mode) |
| 3349 | { |
| 3350 | struct ipahal_reg_qcncm qcncm; |
| 3351 | |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 3352 | if (ipa3_ctx->ipa_hw_type >= IPA_HW_v4_0) { |
| 3353 | if (mode != IPA_MBIM_AGGR) { |
| 3354 | IPAERR("Only MBIM mode is supported staring 4.0\n"); |
| 3355 | return -EPERM; |
| 3356 | } |
| 3357 | } else { |
| 3358 | IPA_ACTIVE_CLIENTS_INC_SIMPLE(); |
| 3359 | ipahal_read_reg_fields(IPA_QCNCM, &qcncm); |
| 3360 | qcncm.mode_en = mode; |
| 3361 | ipahal_write_reg_fields(IPA_QCNCM, &qcncm); |
| 3362 | IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); |
| 3363 | } |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3364 | |
| 3365 | return 0; |
| 3366 | } |
| 3367 | |
| 3368 | /** |
| 3369 | * ipa3_set_qcncm_ndp_sig() - Set the NDP signature used for QCNCM aggregation |
| 3370 | * mode |
| 3371 | * @sig: [in] the first 3 bytes of QCNCM NDP signature (expected to be |
| 3372 | * "QND") |
| 3373 | * |
| 3374 | * Set the NDP signature used for QCNCM aggregation mode. The fourth byte |
| 3375 | * (expected to be 'P') needs to be set using the header addition mechanism |
| 3376 | * |
| 3377 | * Returns: 0 on success, negative on failure |
| 3378 | */ |
| 3379 | int ipa3_set_qcncm_ndp_sig(char sig[3]) |
| 3380 | { |
| 3381 | struct ipahal_reg_qcncm qcncm; |
| 3382 | |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 3383 | if (ipa3_ctx->ipa_hw_type >= IPA_HW_v4_0) { |
| 3384 | IPAERR("QCNCM mode is not supported staring 4.0\n"); |
| 3385 | return -EPERM; |
| 3386 | } |
| 3387 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3388 | if (sig == NULL) { |
| 3389 | IPAERR("bad argument for ipa3_set_qcncm_ndp_sig/n"); |
| 3390 | return -EINVAL; |
| 3391 | } |
| 3392 | IPA_ACTIVE_CLIENTS_INC_SIMPLE(); |
| 3393 | ipahal_read_reg_fields(IPA_QCNCM, &qcncm); |
| 3394 | qcncm.mode_val = ((sig[0] << 16) | (sig[1] << 8) | sig[2]); |
| 3395 | ipahal_write_reg_fields(IPA_QCNCM, &qcncm); |
| 3396 | IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); |
| 3397 | |
| 3398 | return 0; |
| 3399 | } |
| 3400 | |
| 3401 | /** |
| 3402 | * ipa3_set_single_ndp_per_mbim() - Enable/disable single NDP per MBIM frame |
| 3403 | * configuration |
| 3404 | * @enable: [in] true for single NDP/MBIM; false otherwise |
| 3405 | * |
| 3406 | * Returns: 0 on success |
| 3407 | */ |
| 3408 | int ipa3_set_single_ndp_per_mbim(bool enable) |
| 3409 | { |
| 3410 | struct ipahal_reg_single_ndp_mode mode; |
| 3411 | |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 3412 | if (ipa3_ctx->ipa_hw_type >= IPA_HW_v4_0) { |
| 3413 | IPAERR("QCNCM mode is not supported staring 4.0\n"); |
| 3414 | return -EPERM; |
| 3415 | } |
| 3416 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3417 | IPA_ACTIVE_CLIENTS_INC_SIMPLE(); |
| 3418 | ipahal_read_reg_fields(IPA_SINGLE_NDP_MODE, &mode); |
| 3419 | mode.single_ndp_en = enable; |
| 3420 | ipahal_write_reg_fields(IPA_SINGLE_NDP_MODE, &mode); |
| 3421 | IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); |
| 3422 | |
| 3423 | return 0; |
| 3424 | } |
| 3425 | |
| 3426 | /** |
| 3427 | * ipa3_straddle_boundary() - Checks whether a memory buffer straddles a |
| 3428 | * boundary |
| 3429 | * @start: start address of the memory buffer |
| 3430 | * @end: end address of the memory buffer |
| 3431 | * @boundary: boundary |
| 3432 | * |
| 3433 | * Return value: |
| 3434 | * 1: if the interval [start, end] straddles boundary |
| 3435 | * 0: otherwise |
| 3436 | */ |
| 3437 | int ipa3_straddle_boundary(u32 start, u32 end, u32 boundary) |
| 3438 | { |
| 3439 | u32 next_start; |
| 3440 | u32 prev_end; |
| 3441 | |
| 3442 | IPADBG("start=%u end=%u boundary=%u\n", start, end, boundary); |
| 3443 | |
| 3444 | next_start = (start + (boundary - 1)) & ~(boundary - 1); |
| 3445 | prev_end = ((end + (boundary - 1)) & ~(boundary - 1)) - boundary; |
| 3446 | |
| 3447 | while (next_start < prev_end) |
| 3448 | next_start += boundary; |
| 3449 | |
| 3450 | if (next_start == prev_end) |
| 3451 | return 1; |
| 3452 | else |
| 3453 | return 0; |
| 3454 | } |
| 3455 | |
| 3456 | /** |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3457 | * ipa3_init_mem_partition() - Reads IPA memory map from DTS, performs alignment |
| 3458 | * checks and logs the fetched values. |
| 3459 | * |
| 3460 | * Returns: 0 on success |
| 3461 | */ |
| 3462 | int ipa3_init_mem_partition(struct device_node *node) |
| 3463 | { |
Amir Levy | 9fadeca | 2017-04-25 10:18:32 +0300 | [diff] [blame] | 3464 | const size_t ram_mmap_current_version_size = |
| 3465 | sizeof(ipa3_ctx->ctrl->mem_partition) / sizeof(u32); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3466 | int result; |
| 3467 | |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 3468 | memset(&ipa3_ctx->ctrl->mem_partition, 0, |
| 3469 | sizeof(ipa3_ctx->ctrl->mem_partition)); |
| 3470 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3471 | IPADBG("Reading from DTS as u32 array\n"); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3472 | |
Amir Levy | 9fadeca | 2017-04-25 10:18:32 +0300 | [diff] [blame] | 3473 | /* |
| 3474 | * The size of ipa-ram-mmap array depends on the IPA version. The |
| 3475 | * actual size can't be assumed because of possible DTS versions |
| 3476 | * mismatch. The size of the array monotonically increasing because the |
| 3477 | * obsolete entries are set to zero rather than deleted, so the |
| 3478 | * possible sizes are in range |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 3479 | * [1, ram_mmap_current_version_size] |
Amir Levy | 9fadeca | 2017-04-25 10:18:32 +0300 | [diff] [blame] | 3480 | */ |
| 3481 | result = of_property_read_variable_u32_array(node, "qcom,ipa-ram-mmap", |
| 3482 | (u32 *)&ipa3_ctx->ctrl->mem_partition, |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 3483 | 1, ram_mmap_current_version_size); |
Amir Levy | 9fadeca | 2017-04-25 10:18:32 +0300 | [diff] [blame] | 3484 | |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 3485 | if (IPA_MEM_PART(uc_event_ring_ofst) & 1023) { |
| 3486 | IPAERR("UC EVENT RING OFST 0x%x is unaligned\n", |
| 3487 | IPA_MEM_PART(uc_event_ring_ofst)); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3488 | return -ENODEV; |
| 3489 | } |
Amir Levy | 9fadeca | 2017-04-25 10:18:32 +0300 | [diff] [blame] | 3490 | |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 3491 | IPADBG("UC EVENT RING OFST 0x%x SIZE 0x%x\n", |
| 3492 | IPA_MEM_PART(uc_event_ring_ofst), |
| 3493 | IPA_MEM_PART(uc_event_ring_size)); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3494 | |
| 3495 | IPADBG("NAT OFST 0x%x SIZE 0x%x\n", IPA_MEM_PART(nat_ofst), |
| 3496 | IPA_MEM_PART(nat_size)); |
| 3497 | |
| 3498 | if (IPA_MEM_PART(uc_info_ofst) & 3) { |
| 3499 | IPAERR("UC INFO OFST 0x%x is unaligned\n", |
| 3500 | IPA_MEM_PART(uc_info_ofst)); |
| 3501 | return -ENODEV; |
| 3502 | } |
| 3503 | |
| 3504 | IPADBG("UC INFO OFST 0x%x SIZE 0x%x\n", |
| 3505 | IPA_MEM_PART(uc_info_ofst), IPA_MEM_PART(uc_info_size)); |
| 3506 | |
| 3507 | IPADBG("RAM OFST 0x%x\n", IPA_MEM_PART(ofst_start)); |
| 3508 | |
| 3509 | if (IPA_MEM_PART(v4_flt_hash_ofst) & 7) { |
| 3510 | IPAERR("V4 FLT HASHABLE OFST 0x%x is unaligned\n", |
| 3511 | IPA_MEM_PART(v4_flt_hash_ofst)); |
| 3512 | return -ENODEV; |
| 3513 | } |
| 3514 | |
| 3515 | IPADBG("V4 FLT HASHABLE OFST 0x%x SIZE 0x%x DDR SIZE 0x%x\n", |
| 3516 | IPA_MEM_PART(v4_flt_hash_ofst), |
| 3517 | IPA_MEM_PART(v4_flt_hash_size), |
| 3518 | IPA_MEM_PART(v4_flt_hash_size_ddr)); |
| 3519 | |
| 3520 | if (IPA_MEM_PART(v4_flt_nhash_ofst) & 7) { |
| 3521 | IPAERR("V4 FLT NON-HASHABLE OFST 0x%x is unaligned\n", |
| 3522 | IPA_MEM_PART(v4_flt_nhash_ofst)); |
| 3523 | return -ENODEV; |
| 3524 | } |
| 3525 | |
| 3526 | IPADBG("V4 FLT NON-HASHABLE OFST 0x%x SIZE 0x%x DDR SIZE 0x%x\n", |
| 3527 | IPA_MEM_PART(v4_flt_nhash_ofst), |
| 3528 | IPA_MEM_PART(v4_flt_nhash_size), |
| 3529 | IPA_MEM_PART(v4_flt_nhash_size_ddr)); |
| 3530 | |
| 3531 | if (IPA_MEM_PART(v6_flt_hash_ofst) & 7) { |
| 3532 | IPAERR("V6 FLT HASHABLE OFST 0x%x is unaligned\n", |
| 3533 | IPA_MEM_PART(v6_flt_hash_ofst)); |
| 3534 | return -ENODEV; |
| 3535 | } |
| 3536 | |
| 3537 | IPADBG("V6 FLT HASHABLE OFST 0x%x SIZE 0x%x DDR SIZE 0x%x\n", |
| 3538 | IPA_MEM_PART(v6_flt_hash_ofst), IPA_MEM_PART(v6_flt_hash_size), |
| 3539 | IPA_MEM_PART(v6_flt_hash_size_ddr)); |
| 3540 | |
| 3541 | if (IPA_MEM_PART(v6_flt_nhash_ofst) & 7) { |
| 3542 | IPAERR("V6 FLT NON-HASHABLE OFST 0x%x is unaligned\n", |
| 3543 | IPA_MEM_PART(v6_flt_nhash_ofst)); |
| 3544 | return -ENODEV; |
| 3545 | } |
| 3546 | |
| 3547 | IPADBG("V6 FLT NON-HASHABLE OFST 0x%x SIZE 0x%x DDR SIZE 0x%x\n", |
| 3548 | IPA_MEM_PART(v6_flt_nhash_ofst), |
| 3549 | IPA_MEM_PART(v6_flt_nhash_size), |
| 3550 | IPA_MEM_PART(v6_flt_nhash_size_ddr)); |
| 3551 | |
| 3552 | IPADBG("V4 RT NUM INDEX 0x%x\n", IPA_MEM_PART(v4_rt_num_index)); |
| 3553 | |
| 3554 | IPADBG("V4 RT MODEM INDEXES 0x%x - 0x%x\n", |
| 3555 | IPA_MEM_PART(v4_modem_rt_index_lo), |
| 3556 | IPA_MEM_PART(v4_modem_rt_index_hi)); |
| 3557 | |
| 3558 | IPADBG("V4 RT APPS INDEXES 0x%x - 0x%x\n", |
| 3559 | IPA_MEM_PART(v4_apps_rt_index_lo), |
| 3560 | IPA_MEM_PART(v4_apps_rt_index_hi)); |
| 3561 | |
| 3562 | if (IPA_MEM_PART(v4_rt_hash_ofst) & 7) { |
| 3563 | IPAERR("V4 RT HASHABLE OFST 0x%x is unaligned\n", |
| 3564 | IPA_MEM_PART(v4_rt_hash_ofst)); |
| 3565 | return -ENODEV; |
| 3566 | } |
| 3567 | |
| 3568 | IPADBG("V4 RT HASHABLE OFST 0x%x\n", IPA_MEM_PART(v4_rt_hash_ofst)); |
| 3569 | |
| 3570 | IPADBG("V4 RT HASHABLE SIZE 0x%x DDR SIZE 0x%x\n", |
| 3571 | IPA_MEM_PART(v4_rt_hash_size), |
| 3572 | IPA_MEM_PART(v4_rt_hash_size_ddr)); |
| 3573 | |
| 3574 | if (IPA_MEM_PART(v4_rt_nhash_ofst) & 7) { |
| 3575 | IPAERR("V4 RT NON-HASHABLE OFST 0x%x is unaligned\n", |
| 3576 | IPA_MEM_PART(v4_rt_nhash_ofst)); |
| 3577 | return -ENODEV; |
| 3578 | } |
| 3579 | |
| 3580 | IPADBG("V4 RT NON-HASHABLE OFST 0x%x\n", |
| 3581 | IPA_MEM_PART(v4_rt_nhash_ofst)); |
| 3582 | |
| 3583 | IPADBG("V4 RT HASHABLE SIZE 0x%x DDR SIZE 0x%x\n", |
| 3584 | IPA_MEM_PART(v4_rt_nhash_size), |
| 3585 | IPA_MEM_PART(v4_rt_nhash_size_ddr)); |
| 3586 | |
| 3587 | IPADBG("V6 RT NUM INDEX 0x%x\n", IPA_MEM_PART(v6_rt_num_index)); |
| 3588 | |
| 3589 | IPADBG("V6 RT MODEM INDEXES 0x%x - 0x%x\n", |
| 3590 | IPA_MEM_PART(v6_modem_rt_index_lo), |
| 3591 | IPA_MEM_PART(v6_modem_rt_index_hi)); |
| 3592 | |
| 3593 | IPADBG("V6 RT APPS INDEXES 0x%x - 0x%x\n", |
| 3594 | IPA_MEM_PART(v6_apps_rt_index_lo), |
| 3595 | IPA_MEM_PART(v6_apps_rt_index_hi)); |
| 3596 | |
| 3597 | if (IPA_MEM_PART(v6_rt_hash_ofst) & 7) { |
| 3598 | IPAERR("V6 RT HASHABLE OFST 0x%x is unaligned\n", |
| 3599 | IPA_MEM_PART(v6_rt_hash_ofst)); |
| 3600 | return -ENODEV; |
| 3601 | } |
| 3602 | |
| 3603 | IPADBG("V6 RT HASHABLE OFST 0x%x\n", IPA_MEM_PART(v6_rt_hash_ofst)); |
| 3604 | |
| 3605 | IPADBG("V6 RT HASHABLE SIZE 0x%x DDR SIZE 0x%x\n", |
| 3606 | IPA_MEM_PART(v6_rt_hash_size), |
| 3607 | IPA_MEM_PART(v6_rt_hash_size_ddr)); |
| 3608 | |
| 3609 | if (IPA_MEM_PART(v6_rt_nhash_ofst) & 7) { |
| 3610 | IPAERR("V6 RT NON-HASHABLE OFST 0x%x is unaligned\n", |
| 3611 | IPA_MEM_PART(v6_rt_nhash_ofst)); |
| 3612 | return -ENODEV; |
| 3613 | } |
| 3614 | |
| 3615 | IPADBG("V6 RT NON-HASHABLE OFST 0x%x\n", |
| 3616 | IPA_MEM_PART(v6_rt_nhash_ofst)); |
| 3617 | |
| 3618 | IPADBG("V6 RT NON-HASHABLE SIZE 0x%x DDR SIZE 0x%x\n", |
| 3619 | IPA_MEM_PART(v6_rt_nhash_size), |
| 3620 | IPA_MEM_PART(v6_rt_nhash_size_ddr)); |
| 3621 | |
| 3622 | if (IPA_MEM_PART(modem_hdr_ofst) & 7) { |
| 3623 | IPAERR("MODEM HDR OFST 0x%x is unaligned\n", |
| 3624 | IPA_MEM_PART(modem_hdr_ofst)); |
| 3625 | return -ENODEV; |
| 3626 | } |
| 3627 | |
| 3628 | IPADBG("MODEM HDR OFST 0x%x SIZE 0x%x\n", |
| 3629 | IPA_MEM_PART(modem_hdr_ofst), IPA_MEM_PART(modem_hdr_size)); |
| 3630 | |
| 3631 | if (IPA_MEM_PART(apps_hdr_ofst) & 7) { |
| 3632 | IPAERR("APPS HDR OFST 0x%x is unaligned\n", |
| 3633 | IPA_MEM_PART(apps_hdr_ofst)); |
| 3634 | return -ENODEV; |
| 3635 | } |
| 3636 | |
| 3637 | IPADBG("APPS HDR OFST 0x%x SIZE 0x%x DDR SIZE 0x%x\n", |
| 3638 | IPA_MEM_PART(apps_hdr_ofst), IPA_MEM_PART(apps_hdr_size), |
| 3639 | IPA_MEM_PART(apps_hdr_size_ddr)); |
| 3640 | |
| 3641 | if (IPA_MEM_PART(modem_hdr_proc_ctx_ofst) & 7) { |
| 3642 | IPAERR("MODEM HDR PROC CTX OFST 0x%x is unaligned\n", |
| 3643 | IPA_MEM_PART(modem_hdr_proc_ctx_ofst)); |
| 3644 | return -ENODEV; |
| 3645 | } |
| 3646 | |
| 3647 | IPADBG("MODEM HDR PROC CTX OFST 0x%x SIZE 0x%x\n", |
| 3648 | IPA_MEM_PART(modem_hdr_proc_ctx_ofst), |
| 3649 | IPA_MEM_PART(modem_hdr_proc_ctx_size)); |
| 3650 | |
| 3651 | if (IPA_MEM_PART(apps_hdr_proc_ctx_ofst) & 7) { |
| 3652 | IPAERR("APPS HDR PROC CTX OFST 0x%x is unaligned\n", |
| 3653 | IPA_MEM_PART(apps_hdr_proc_ctx_ofst)); |
| 3654 | return -ENODEV; |
| 3655 | } |
| 3656 | |
| 3657 | IPADBG("APPS HDR PROC CTX OFST 0x%x SIZE 0x%x DDR SIZE 0x%x\n", |
| 3658 | IPA_MEM_PART(apps_hdr_proc_ctx_ofst), |
| 3659 | IPA_MEM_PART(apps_hdr_proc_ctx_size), |
| 3660 | IPA_MEM_PART(apps_hdr_proc_ctx_size_ddr)); |
| 3661 | |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 3662 | if (IPA_MEM_PART(pdn_config_ofst) & 7) { |
| 3663 | IPAERR("PDN CONFIG OFST 0x%x is unaligned\n", |
| 3664 | IPA_MEM_PART(pdn_config_ofst)); |
| 3665 | return -ENODEV; |
| 3666 | } |
| 3667 | |
| 3668 | IPADBG("PDN CONFIG OFST 0x%x SIZE 0x%x\n", |
| 3669 | IPA_MEM_PART(pdn_config_ofst), |
| 3670 | IPA_MEM_PART(pdn_config_size)); |
| 3671 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3672 | if (IPA_MEM_PART(modem_ofst) & 7) { |
| 3673 | IPAERR("MODEM OFST 0x%x is unaligned\n", |
| 3674 | IPA_MEM_PART(modem_ofst)); |
| 3675 | return -ENODEV; |
| 3676 | } |
| 3677 | |
| 3678 | IPADBG("MODEM OFST 0x%x SIZE 0x%x\n", IPA_MEM_PART(modem_ofst), |
| 3679 | IPA_MEM_PART(modem_size)); |
| 3680 | |
| 3681 | IPADBG("V4 APPS HASHABLE FLT OFST 0x%x SIZE 0x%x\n", |
| 3682 | IPA_MEM_PART(apps_v4_flt_hash_ofst), |
| 3683 | IPA_MEM_PART(apps_v4_flt_hash_size)); |
| 3684 | |
| 3685 | IPADBG("V4 APPS NON-HASHABLE FLT OFST 0x%x SIZE 0x%x\n", |
| 3686 | IPA_MEM_PART(apps_v4_flt_nhash_ofst), |
| 3687 | IPA_MEM_PART(apps_v4_flt_nhash_size)); |
| 3688 | |
| 3689 | IPADBG("V6 APPS HASHABLE FLT OFST 0x%x SIZE 0x%x\n", |
| 3690 | IPA_MEM_PART(apps_v6_flt_hash_ofst), |
| 3691 | IPA_MEM_PART(apps_v6_flt_hash_size)); |
| 3692 | |
| 3693 | IPADBG("V6 APPS NON-HASHABLE FLT OFST 0x%x SIZE 0x%x\n", |
| 3694 | IPA_MEM_PART(apps_v6_flt_nhash_ofst), |
| 3695 | IPA_MEM_PART(apps_v6_flt_nhash_size)); |
| 3696 | |
| 3697 | IPADBG("RAM END OFST 0x%x\n", |
| 3698 | IPA_MEM_PART(end_ofst)); |
| 3699 | |
| 3700 | IPADBG("V4 APPS HASHABLE RT OFST 0x%x SIZE 0x%x\n", |
| 3701 | IPA_MEM_PART(apps_v4_rt_hash_ofst), |
| 3702 | IPA_MEM_PART(apps_v4_rt_hash_size)); |
| 3703 | |
| 3704 | IPADBG("V4 APPS NON-HASHABLE RT OFST 0x%x SIZE 0x%x\n", |
| 3705 | IPA_MEM_PART(apps_v4_rt_nhash_ofst), |
| 3706 | IPA_MEM_PART(apps_v4_rt_nhash_size)); |
| 3707 | |
| 3708 | IPADBG("V6 APPS HASHABLE RT OFST 0x%x SIZE 0x%x\n", |
| 3709 | IPA_MEM_PART(apps_v6_rt_hash_ofst), |
| 3710 | IPA_MEM_PART(apps_v6_rt_hash_size)); |
| 3711 | |
| 3712 | IPADBG("V6 APPS NON-HASHABLE RT OFST 0x%x SIZE 0x%x\n", |
| 3713 | IPA_MEM_PART(apps_v6_rt_nhash_ofst), |
| 3714 | IPA_MEM_PART(apps_v6_rt_nhash_size)); |
| 3715 | |
| 3716 | return 0; |
| 3717 | } |
| 3718 | |
| 3719 | /** |
| 3720 | * ipa_ctrl_static_bind() - set the appropriate methods for |
| 3721 | * IPA Driver based on the HW version |
| 3722 | * |
| 3723 | * @ctrl: data structure which holds the function pointers |
| 3724 | * @hw_type: the HW type in use |
| 3725 | * |
| 3726 | * This function can avoid the runtime assignment by using C99 special |
| 3727 | * struct initialization - hard decision... time.vs.mem |
| 3728 | */ |
| 3729 | int ipa3_controller_static_bind(struct ipa3_controller *ctrl, |
| 3730 | enum ipa_hw_type hw_type) |
| 3731 | { |
Skylar Chang | f88124c | 2017-07-18 18:11:25 -0700 | [diff] [blame] | 3732 | if (hw_type >= IPA_HW_v4_0) { |
| 3733 | ctrl->ipa_clk_rate_turbo = IPA_V4_0_CLK_RATE_TURBO; |
| 3734 | ctrl->ipa_clk_rate_nominal = IPA_V4_0_CLK_RATE_NOMINAL; |
| 3735 | ctrl->ipa_clk_rate_svs = IPA_V4_0_CLK_RATE_SVS; |
| 3736 | } else if (hw_type >= IPA_HW_v3_5) { |
| 3737 | ctrl->ipa_clk_rate_turbo = IPA_V3_5_CLK_RATE_TURBO; |
| 3738 | ctrl->ipa_clk_rate_nominal = IPA_V3_5_CLK_RATE_NOMINAL; |
| 3739 | ctrl->ipa_clk_rate_svs = IPA_V3_5_CLK_RATE_SVS; |
| 3740 | } else { |
| 3741 | ctrl->ipa_clk_rate_turbo = IPA_V3_0_CLK_RATE_TURBO; |
| 3742 | ctrl->ipa_clk_rate_nominal = IPA_V3_0_CLK_RATE_NOMINAL; |
| 3743 | ctrl->ipa_clk_rate_svs = IPA_V3_0_CLK_RATE_SVS; |
| 3744 | } |
| 3745 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3746 | ctrl->ipa_init_rt4 = _ipa_init_rt4_v3; |
| 3747 | ctrl->ipa_init_rt6 = _ipa_init_rt6_v3; |
| 3748 | ctrl->ipa_init_flt4 = _ipa_init_flt4_v3; |
| 3749 | ctrl->ipa_init_flt6 = _ipa_init_flt6_v3; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3750 | ctrl->ipa3_read_ep_reg = _ipa_read_ep_reg_v3_0; |
| 3751 | ctrl->ipa3_commit_flt = __ipa_commit_flt_v3; |
| 3752 | ctrl->ipa3_commit_rt = __ipa_commit_rt_v3; |
| 3753 | ctrl->ipa3_commit_hdr = __ipa_commit_hdr_v3_0; |
| 3754 | ctrl->ipa3_enable_clks = _ipa_enable_clks_v3_0; |
| 3755 | ctrl->ipa3_disable_clks = _ipa_disable_clks_v3_0; |
| 3756 | ctrl->msm_bus_data_ptr = &ipa_bus_client_pdata_v3_0; |
| 3757 | ctrl->clock_scaling_bw_threshold_nominal = |
| 3758 | IPA_V3_0_BW_THRESHOLD_NOMINAL_MBPS; |
| 3759 | ctrl->clock_scaling_bw_threshold_turbo = |
| 3760 | IPA_V3_0_BW_THRESHOLD_TURBO_MBPS; |
| 3761 | ctrl->ipa_reg_base_ofst = ipahal_get_reg_base(); |
Amir Levy | 9fadeca | 2017-04-25 10:18:32 +0300 | [diff] [blame] | 3762 | ctrl->ipa_init_sram = _ipa_init_sram_v3; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3763 | ctrl->ipa_sram_read_settings = _ipa_sram_settings_read_v3_0; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3764 | ctrl->ipa_init_hdr = _ipa_init_hdr_v3_0; |
| 3765 | |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 3766 | if (ipa3_ctx->ipa_hw_type >= IPA_HW_v4_0) |
| 3767 | ctrl->ipa3_read_ep_reg = _ipa_read_ep_reg_v4_0; |
| 3768 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3769 | return 0; |
| 3770 | } |
| 3771 | |
| 3772 | void ipa3_skb_recycle(struct sk_buff *skb) |
| 3773 | { |
| 3774 | struct skb_shared_info *shinfo; |
| 3775 | |
| 3776 | shinfo = skb_shinfo(skb); |
| 3777 | memset(shinfo, 0, offsetof(struct skb_shared_info, dataref)); |
| 3778 | atomic_set(&shinfo->dataref, 1); |
| 3779 | |
| 3780 | memset(skb, 0, offsetof(struct sk_buff, tail)); |
| 3781 | skb->data = skb->head + NET_SKB_PAD; |
| 3782 | skb_reset_tail_pointer(skb); |
| 3783 | } |
| 3784 | |
| 3785 | int ipa3_alloc_rule_id(struct idr *rule_ids) |
| 3786 | { |
| 3787 | /* There is two groups of rule-Ids, Modem ones and Apps ones. |
| 3788 | * Distinction by high bit: Modem Ids are high bit asserted. |
| 3789 | */ |
| 3790 | return idr_alloc(rule_ids, NULL, |
| 3791 | ipahal_get_low_rule_id(), ipahal_get_rule_id_hi_bit(), |
| 3792 | GFP_KERNEL); |
| 3793 | } |
| 3794 | |
| 3795 | int ipa3_id_alloc(void *ptr) |
| 3796 | { |
| 3797 | int id; |
| 3798 | |
| 3799 | idr_preload(GFP_KERNEL); |
| 3800 | spin_lock(&ipa3_ctx->idr_lock); |
| 3801 | id = idr_alloc(&ipa3_ctx->ipa_idr, ptr, 0, 0, GFP_NOWAIT); |
| 3802 | spin_unlock(&ipa3_ctx->idr_lock); |
| 3803 | idr_preload_end(); |
| 3804 | |
| 3805 | return id; |
| 3806 | } |
| 3807 | |
| 3808 | void *ipa3_id_find(u32 id) |
| 3809 | { |
| 3810 | void *ptr; |
| 3811 | |
| 3812 | spin_lock(&ipa3_ctx->idr_lock); |
| 3813 | ptr = idr_find(&ipa3_ctx->ipa_idr, id); |
| 3814 | spin_unlock(&ipa3_ctx->idr_lock); |
| 3815 | |
| 3816 | return ptr; |
| 3817 | } |
| 3818 | |
| 3819 | void ipa3_id_remove(u32 id) |
| 3820 | { |
| 3821 | spin_lock(&ipa3_ctx->idr_lock); |
| 3822 | idr_remove(&ipa3_ctx->ipa_idr, id); |
| 3823 | spin_unlock(&ipa3_ctx->idr_lock); |
| 3824 | } |
| 3825 | |
| 3826 | void ipa3_tag_destroy_imm(void *user1, int user2) |
| 3827 | { |
| 3828 | ipahal_destroy_imm_cmd(user1); |
| 3829 | } |
| 3830 | |
| 3831 | static void ipa3_tag_free_skb(void *user1, int user2) |
| 3832 | { |
| 3833 | dev_kfree_skb_any((struct sk_buff *)user1); |
| 3834 | } |
| 3835 | |
| 3836 | #define REQUIRED_TAG_PROCESS_DESCRIPTORS 4 |
| 3837 | |
| 3838 | /* ipa3_tag_process() - Initiates a tag process. Incorporates the input |
| 3839 | * descriptors |
| 3840 | * |
| 3841 | * @desc: descriptors with commands for IC |
| 3842 | * @desc_size: amount of descriptors in the above variable |
| 3843 | * |
| 3844 | * Note: The descriptors are copied (if there's room), the client needs to |
| 3845 | * free his descriptors afterwards |
| 3846 | * |
| 3847 | * Return: 0 or negative in case of failure |
| 3848 | */ |
| 3849 | int ipa3_tag_process(struct ipa3_desc desc[], |
| 3850 | int descs_num, |
| 3851 | unsigned long timeout) |
| 3852 | { |
| 3853 | struct ipa3_sys_context *sys; |
| 3854 | struct ipa3_desc *tag_desc; |
| 3855 | int desc_idx = 0; |
| 3856 | struct ipahal_imm_cmd_ip_packet_init pktinit_cmd; |
| 3857 | struct ipahal_imm_cmd_pyld *cmd_pyld = NULL; |
| 3858 | struct ipahal_imm_cmd_ip_packet_tag_status status; |
| 3859 | int i; |
| 3860 | struct sk_buff *dummy_skb; |
| 3861 | int res; |
| 3862 | struct ipa3_tag_completion *comp; |
| 3863 | int ep_idx; |
| 3864 | |
| 3865 | /* Not enough room for the required descriptors for the tag process */ |
| 3866 | if (IPA_TAG_MAX_DESC - descs_num < REQUIRED_TAG_PROCESS_DESCRIPTORS) { |
| 3867 | IPAERR("up to %d descriptors are allowed (received %d)\n", |
| 3868 | IPA_TAG_MAX_DESC - REQUIRED_TAG_PROCESS_DESCRIPTORS, |
| 3869 | descs_num); |
| 3870 | return -ENOMEM; |
| 3871 | } |
| 3872 | |
| 3873 | ep_idx = ipa3_get_ep_mapping(IPA_CLIENT_APPS_CMD_PROD); |
| 3874 | if (-1 == ep_idx) { |
| 3875 | IPAERR("Client %u is not mapped\n", |
| 3876 | IPA_CLIENT_APPS_CMD_PROD); |
| 3877 | return -EFAULT; |
| 3878 | } |
| 3879 | sys = ipa3_ctx->ep[ep_idx].sys; |
| 3880 | |
| 3881 | tag_desc = kzalloc(sizeof(*tag_desc) * IPA_TAG_MAX_DESC, GFP_KERNEL); |
| 3882 | if (!tag_desc) { |
| 3883 | IPAERR("failed to allocate memory\n"); |
| 3884 | return -ENOMEM; |
| 3885 | } |
| 3886 | |
| 3887 | /* Copy the required descriptors from the client now */ |
| 3888 | if (desc) { |
| 3889 | memcpy(&(tag_desc[0]), desc, descs_num * |
| 3890 | sizeof(tag_desc[0])); |
| 3891 | desc_idx += descs_num; |
| 3892 | } |
| 3893 | |
| 3894 | /* NO-OP IC for ensuring that IPA pipeline is empty */ |
| 3895 | cmd_pyld = ipahal_construct_nop_imm_cmd( |
| 3896 | false, IPAHAL_FULL_PIPELINE_CLEAR, false); |
| 3897 | if (!cmd_pyld) { |
| 3898 | IPAERR("failed to construct NOP imm cmd\n"); |
| 3899 | res = -ENOMEM; |
| 3900 | goto fail_free_tag_desc; |
| 3901 | } |
Michael Adisumarta | b5d170f | 2017-05-17 14:34:11 -0700 | [diff] [blame] | 3902 | tag_desc[desc_idx].opcode = cmd_pyld->opcode; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3903 | tag_desc[desc_idx].pyld = cmd_pyld->data; |
| 3904 | tag_desc[desc_idx].len = cmd_pyld->len; |
| 3905 | tag_desc[desc_idx].type = IPA_IMM_CMD_DESC; |
| 3906 | tag_desc[desc_idx].callback = ipa3_tag_destroy_imm; |
| 3907 | tag_desc[desc_idx].user1 = cmd_pyld; |
| 3908 | desc_idx++; |
| 3909 | |
| 3910 | /* IP_PACKET_INIT IC for tag status to be sent to apps */ |
| 3911 | pktinit_cmd.destination_pipe_index = |
| 3912 | ipa3_get_ep_mapping(IPA_CLIENT_APPS_LAN_CONS); |
| 3913 | cmd_pyld = ipahal_construct_imm_cmd( |
| 3914 | IPA_IMM_CMD_IP_PACKET_INIT, &pktinit_cmd, false); |
| 3915 | if (!cmd_pyld) { |
| 3916 | IPAERR("failed to construct ip_packet_init imm cmd\n"); |
| 3917 | res = -ENOMEM; |
| 3918 | goto fail_free_desc; |
| 3919 | } |
Michael Adisumarta | b5d170f | 2017-05-17 14:34:11 -0700 | [diff] [blame] | 3920 | tag_desc[desc_idx].opcode = cmd_pyld->opcode; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3921 | tag_desc[desc_idx].pyld = cmd_pyld->data; |
| 3922 | tag_desc[desc_idx].len = cmd_pyld->len; |
| 3923 | tag_desc[desc_idx].type = IPA_IMM_CMD_DESC; |
| 3924 | tag_desc[desc_idx].callback = ipa3_tag_destroy_imm; |
| 3925 | tag_desc[desc_idx].user1 = cmd_pyld; |
| 3926 | desc_idx++; |
| 3927 | |
| 3928 | /* status IC */ |
| 3929 | status.tag = IPA_COOKIE; |
| 3930 | cmd_pyld = ipahal_construct_imm_cmd( |
| 3931 | IPA_IMM_CMD_IP_PACKET_TAG_STATUS, &status, false); |
| 3932 | if (!cmd_pyld) { |
| 3933 | IPAERR("failed to construct ip_packet_tag_status imm cmd\n"); |
| 3934 | res = -ENOMEM; |
| 3935 | goto fail_free_desc; |
| 3936 | } |
Michael Adisumarta | b5d170f | 2017-05-17 14:34:11 -0700 | [diff] [blame] | 3937 | tag_desc[desc_idx].opcode = cmd_pyld->opcode; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3938 | tag_desc[desc_idx].pyld = cmd_pyld->data; |
| 3939 | tag_desc[desc_idx].len = cmd_pyld->len; |
| 3940 | tag_desc[desc_idx].type = IPA_IMM_CMD_DESC; |
| 3941 | tag_desc[desc_idx].callback = ipa3_tag_destroy_imm; |
| 3942 | tag_desc[desc_idx].user1 = cmd_pyld; |
| 3943 | desc_idx++; |
| 3944 | |
| 3945 | comp = kzalloc(sizeof(*comp), GFP_KERNEL); |
| 3946 | if (!comp) { |
| 3947 | IPAERR("no mem\n"); |
| 3948 | res = -ENOMEM; |
| 3949 | goto fail_free_desc; |
| 3950 | } |
| 3951 | init_completion(&comp->comp); |
| 3952 | |
| 3953 | /* completion needs to be released from both here and rx handler */ |
| 3954 | atomic_set(&comp->cnt, 2); |
| 3955 | |
| 3956 | /* dummy packet to send to IPA. packet payload is a completion object */ |
| 3957 | dummy_skb = alloc_skb(sizeof(comp), GFP_KERNEL); |
| 3958 | if (!dummy_skb) { |
| 3959 | IPAERR("failed to allocate memory\n"); |
| 3960 | res = -ENOMEM; |
| 3961 | goto fail_free_comp; |
| 3962 | } |
| 3963 | |
| 3964 | memcpy(skb_put(dummy_skb, sizeof(comp)), &comp, sizeof(comp)); |
| 3965 | |
| 3966 | tag_desc[desc_idx].pyld = dummy_skb->data; |
| 3967 | tag_desc[desc_idx].len = dummy_skb->len; |
| 3968 | tag_desc[desc_idx].type = IPA_DATA_DESC_SKB; |
| 3969 | tag_desc[desc_idx].callback = ipa3_tag_free_skb; |
| 3970 | tag_desc[desc_idx].user1 = dummy_skb; |
| 3971 | desc_idx++; |
| 3972 | |
| 3973 | /* send all descriptors to IPA with single EOT */ |
| 3974 | res = ipa3_send(sys, desc_idx, tag_desc, true); |
| 3975 | if (res) { |
| 3976 | IPAERR("failed to send TAG packets %d\n", res); |
| 3977 | res = -ENOMEM; |
| 3978 | goto fail_free_comp; |
| 3979 | } |
| 3980 | kfree(tag_desc); |
| 3981 | tag_desc = NULL; |
| 3982 | |
| 3983 | IPADBG("waiting for TAG response\n"); |
| 3984 | res = wait_for_completion_timeout(&comp->comp, timeout); |
| 3985 | if (res == 0) { |
| 3986 | IPAERR("timeout (%lu msec) on waiting for TAG response\n", |
| 3987 | timeout); |
| 3988 | WARN_ON(1); |
| 3989 | if (atomic_dec_return(&comp->cnt) == 0) |
| 3990 | kfree(comp); |
| 3991 | return -ETIME; |
| 3992 | } |
| 3993 | |
| 3994 | IPADBG("TAG response arrived!\n"); |
| 3995 | if (atomic_dec_return(&comp->cnt) == 0) |
| 3996 | kfree(comp); |
| 3997 | |
Amir Levy | a59ed3f | 2017-03-05 17:30:55 +0200 | [diff] [blame] | 3998 | /* |
| 3999 | * sleep for short period to ensure IPA wrote all packets to |
| 4000 | * the transport |
| 4001 | */ |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4002 | usleep_range(IPA_TAG_SLEEP_MIN_USEC, IPA_TAG_SLEEP_MAX_USEC); |
| 4003 | |
| 4004 | return 0; |
| 4005 | |
| 4006 | fail_free_comp: |
| 4007 | kfree(comp); |
| 4008 | fail_free_desc: |
| 4009 | /* |
| 4010 | * Free only the first descriptors allocated here. |
| 4011 | * [nop, pkt_init, status, dummy_skb] |
| 4012 | * The user is responsible to free his allocations |
| 4013 | * in case of failure. |
| 4014 | * The min is required because we may fail during |
| 4015 | * of the initial allocations above |
| 4016 | */ |
| 4017 | for (i = descs_num; |
| 4018 | i < min(REQUIRED_TAG_PROCESS_DESCRIPTORS, desc_idx); i++) |
| 4019 | if (tag_desc[i].callback) |
| 4020 | tag_desc[i].callback(tag_desc[i].user1, |
| 4021 | tag_desc[i].user2); |
| 4022 | fail_free_tag_desc: |
| 4023 | kfree(tag_desc); |
| 4024 | return res; |
| 4025 | } |
| 4026 | |
| 4027 | /** |
| 4028 | * ipa3_tag_generate_force_close_desc() - generate descriptors for force close |
| 4029 | * immediate command |
| 4030 | * |
| 4031 | * @desc: descriptors for IC |
| 4032 | * @desc_size: desc array size |
| 4033 | * @start_pipe: first pipe to close aggregation |
| 4034 | * @end_pipe: last (non-inclusive) pipe to close aggregation |
| 4035 | * |
| 4036 | * Return: number of descriptors written or negative in case of failure |
| 4037 | */ |
| 4038 | static int ipa3_tag_generate_force_close_desc(struct ipa3_desc desc[], |
| 4039 | int desc_size, int start_pipe, int end_pipe) |
| 4040 | { |
| 4041 | int i; |
| 4042 | struct ipa_ep_cfg_aggr ep_aggr; |
| 4043 | int desc_idx = 0; |
| 4044 | int res; |
| 4045 | struct ipahal_imm_cmd_register_write reg_write_agg_close; |
| 4046 | struct ipahal_imm_cmd_pyld *cmd_pyld; |
| 4047 | struct ipahal_reg_valmask valmask; |
| 4048 | |
| 4049 | for (i = start_pipe; i < end_pipe; i++) { |
| 4050 | ipahal_read_reg_n_fields(IPA_ENDP_INIT_AGGR_n, i, &ep_aggr); |
| 4051 | if (!ep_aggr.aggr_en) |
| 4052 | continue; |
| 4053 | IPADBG("Force close ep: %d\n", i); |
| 4054 | if (desc_idx + 1 > desc_size) { |
| 4055 | IPAERR("Internal error - no descriptors\n"); |
| 4056 | res = -EFAULT; |
| 4057 | goto fail_no_desc; |
| 4058 | } |
| 4059 | |
| 4060 | reg_write_agg_close.skip_pipeline_clear = false; |
| 4061 | reg_write_agg_close.pipeline_clear_options = |
| 4062 | IPAHAL_FULL_PIPELINE_CLEAR; |
| 4063 | reg_write_agg_close.offset = |
| 4064 | ipahal_get_reg_ofst(IPA_AGGR_FORCE_CLOSE); |
Ghanim Fodi | cff9c94 | 2017-08-07 11:40:58 +0300 | [diff] [blame] | 4065 | ipahal_get_aggr_force_close_valmask(i, &valmask); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4066 | reg_write_agg_close.value = valmask.val; |
| 4067 | reg_write_agg_close.value_mask = valmask.mask; |
| 4068 | cmd_pyld = ipahal_construct_imm_cmd(IPA_IMM_CMD_REGISTER_WRITE, |
| 4069 | ®_write_agg_close, false); |
| 4070 | if (!cmd_pyld) { |
| 4071 | IPAERR("failed to construct register_write imm cmd\n"); |
| 4072 | res = -ENOMEM; |
| 4073 | goto fail_alloc_reg_write_agg_close; |
| 4074 | } |
| 4075 | |
Michael Adisumarta | b5d170f | 2017-05-17 14:34:11 -0700 | [diff] [blame] | 4076 | desc[desc_idx].opcode = cmd_pyld->opcode; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4077 | desc[desc_idx].pyld = cmd_pyld->data; |
| 4078 | desc[desc_idx].len = cmd_pyld->len; |
| 4079 | desc[desc_idx].type = IPA_IMM_CMD_DESC; |
| 4080 | desc[desc_idx].callback = ipa3_tag_destroy_imm; |
| 4081 | desc[desc_idx].user1 = cmd_pyld; |
| 4082 | desc_idx++; |
| 4083 | } |
| 4084 | |
| 4085 | return desc_idx; |
| 4086 | |
| 4087 | fail_alloc_reg_write_agg_close: |
| 4088 | for (i = 0; i < desc_idx; i++) |
| 4089 | if (desc[desc_idx].callback) |
| 4090 | desc[desc_idx].callback(desc[desc_idx].user1, |
| 4091 | desc[desc_idx].user2); |
| 4092 | fail_no_desc: |
| 4093 | return res; |
| 4094 | } |
| 4095 | |
| 4096 | /** |
| 4097 | * ipa3_tag_aggr_force_close() - Force close aggregation |
| 4098 | * |
| 4099 | * @pipe_num: pipe number or -1 for all pipes |
| 4100 | */ |
| 4101 | int ipa3_tag_aggr_force_close(int pipe_num) |
| 4102 | { |
| 4103 | struct ipa3_desc *desc; |
| 4104 | int res = -1; |
| 4105 | int start_pipe; |
| 4106 | int end_pipe; |
| 4107 | int num_descs; |
| 4108 | int num_aggr_descs; |
| 4109 | |
| 4110 | if (pipe_num < -1 || pipe_num >= (int)ipa3_ctx->ipa_num_pipes) { |
| 4111 | IPAERR("Invalid pipe number %d\n", pipe_num); |
| 4112 | return -EINVAL; |
| 4113 | } |
| 4114 | |
| 4115 | if (pipe_num == -1) { |
| 4116 | start_pipe = 0; |
| 4117 | end_pipe = ipa3_ctx->ipa_num_pipes; |
| 4118 | } else { |
| 4119 | start_pipe = pipe_num; |
| 4120 | end_pipe = pipe_num + 1; |
| 4121 | } |
| 4122 | |
| 4123 | num_descs = end_pipe - start_pipe; |
| 4124 | |
| 4125 | desc = kcalloc(num_descs, sizeof(*desc), GFP_KERNEL); |
| 4126 | if (!desc) { |
| 4127 | IPAERR("no mem\n"); |
| 4128 | return -ENOMEM; |
| 4129 | } |
| 4130 | |
| 4131 | /* Force close aggregation on all valid pipes with aggregation */ |
| 4132 | num_aggr_descs = ipa3_tag_generate_force_close_desc(desc, num_descs, |
| 4133 | start_pipe, end_pipe); |
| 4134 | if (num_aggr_descs < 0) { |
| 4135 | IPAERR("ipa3_tag_generate_force_close_desc failed %d\n", |
| 4136 | num_aggr_descs); |
| 4137 | goto fail_free_desc; |
| 4138 | } |
| 4139 | |
| 4140 | res = ipa3_tag_process(desc, num_aggr_descs, |
| 4141 | IPA_FORCE_CLOSE_TAG_PROCESS_TIMEOUT); |
| 4142 | |
| 4143 | fail_free_desc: |
| 4144 | kfree(desc); |
| 4145 | |
| 4146 | return res; |
| 4147 | } |
| 4148 | |
| 4149 | /** |
| 4150 | * ipa3_is_ready() - check if IPA module was initialized |
| 4151 | * successfully |
| 4152 | * |
| 4153 | * Return value: true for yes; false for no |
| 4154 | */ |
| 4155 | bool ipa3_is_ready(void) |
| 4156 | { |
| 4157 | bool complete; |
| 4158 | |
| 4159 | if (ipa3_ctx == NULL) |
| 4160 | return false; |
| 4161 | mutex_lock(&ipa3_ctx->lock); |
| 4162 | complete = ipa3_ctx->ipa_initialization_complete; |
| 4163 | mutex_unlock(&ipa3_ctx->lock); |
| 4164 | return complete; |
| 4165 | } |
| 4166 | |
| 4167 | /** |
| 4168 | * ipa3_is_client_handle_valid() - check if IPA client handle is valid handle |
| 4169 | * |
| 4170 | * Return value: true for yes; false for no |
| 4171 | */ |
| 4172 | bool ipa3_is_client_handle_valid(u32 clnt_hdl) |
| 4173 | { |
| 4174 | if (clnt_hdl >= 0 && clnt_hdl < ipa3_ctx->ipa_num_pipes) |
| 4175 | return true; |
| 4176 | return false; |
| 4177 | } |
| 4178 | |
| 4179 | /** |
| 4180 | * ipa3_proxy_clk_unvote() - called to remove IPA clock proxy vote |
| 4181 | * |
| 4182 | * Return value: none |
| 4183 | */ |
| 4184 | void ipa3_proxy_clk_unvote(void) |
| 4185 | { |
| 4186 | if (ipa3_is_ready() && ipa3_ctx->q6_proxy_clk_vote_valid) { |
| 4187 | IPA_ACTIVE_CLIENTS_DEC_SPECIAL("PROXY_CLK_VOTE"); |
| 4188 | ipa3_ctx->q6_proxy_clk_vote_valid = false; |
| 4189 | } |
| 4190 | } |
| 4191 | |
| 4192 | /** |
| 4193 | * ipa3_proxy_clk_vote() - called to add IPA clock proxy vote |
| 4194 | * |
| 4195 | * Return value: none |
| 4196 | */ |
| 4197 | void ipa3_proxy_clk_vote(void) |
| 4198 | { |
| 4199 | if (ipa3_is_ready() && !ipa3_ctx->q6_proxy_clk_vote_valid) { |
| 4200 | IPA_ACTIVE_CLIENTS_INC_SPECIAL("PROXY_CLK_VOTE"); |
| 4201 | ipa3_ctx->q6_proxy_clk_vote_valid = true; |
| 4202 | } |
| 4203 | } |
| 4204 | |
| 4205 | /** |
| 4206 | * ipa3_get_smem_restr_bytes()- Return IPA smem restricted bytes |
| 4207 | * |
| 4208 | * Return value: u16 - number of IPA smem restricted bytes |
| 4209 | */ |
| 4210 | u16 ipa3_get_smem_restr_bytes(void) |
| 4211 | { |
| 4212 | if (ipa3_ctx) |
| 4213 | return ipa3_ctx->smem_restricted_bytes; |
| 4214 | |
| 4215 | IPAERR("IPA Driver not initialized\n"); |
| 4216 | |
| 4217 | return 0; |
| 4218 | } |
| 4219 | |
| 4220 | /** |
| 4221 | * ipa3_get_modem_cfg_emb_pipe_flt()- Return ipa3_ctx->modem_cfg_emb_pipe_flt |
| 4222 | * |
| 4223 | * Return value: true if modem configures embedded pipe flt, false otherwise |
| 4224 | */ |
| 4225 | bool ipa3_get_modem_cfg_emb_pipe_flt(void) |
| 4226 | { |
| 4227 | if (ipa3_ctx) |
| 4228 | return ipa3_ctx->modem_cfg_emb_pipe_flt; |
| 4229 | |
| 4230 | IPAERR("IPA driver has not been initialized\n"); |
| 4231 | |
| 4232 | return false; |
| 4233 | } |
| 4234 | |
| 4235 | /** |
Amir Levy | a59ed3f | 2017-03-05 17:30:55 +0200 | [diff] [blame] | 4236 | * ipa3_get_transport_type() |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4237 | * |
| 4238 | * Return value: enum ipa_transport_type |
| 4239 | */ |
| 4240 | enum ipa_transport_type ipa3_get_transport_type(void) |
| 4241 | { |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4242 | return IPA_TRANSPORT_TYPE_GSI; |
| 4243 | } |
| 4244 | |
| 4245 | u32 ipa3_get_num_pipes(void) |
| 4246 | { |
| 4247 | return ipahal_read_reg(IPA_ENABLED_PIPES); |
| 4248 | } |
| 4249 | |
| 4250 | /** |
| 4251 | * ipa3_disable_apps_wan_cons_deaggr()- |
| 4252 | * set ipa_ctx->ipa_client_apps_wan_cons_agg_gro |
| 4253 | * |
| 4254 | * Return value: 0 or negative in case of failure |
| 4255 | */ |
| 4256 | int ipa3_disable_apps_wan_cons_deaggr(uint32_t agg_size, uint32_t agg_count) |
| 4257 | { |
| 4258 | int res = -1; |
| 4259 | u32 limit; |
| 4260 | |
| 4261 | /* checking if IPA-HW can support */ |
| 4262 | limit = ipahal_aggr_get_max_byte_limit(); |
| 4263 | if ((agg_size >> 10) > limit) { |
| 4264 | IPAERR("IPA-AGG byte limit %d\n", limit); |
| 4265 | IPAERR("exceed aggr_byte_limit\n"); |
| 4266 | return res; |
| 4267 | } |
| 4268 | limit = ipahal_aggr_get_max_pkt_limit(); |
| 4269 | if (agg_count > limit) { |
| 4270 | IPAERR("IPA-AGG pkt limit %d\n", limit); |
| 4271 | IPAERR("exceed aggr_pkt_limit\n"); |
| 4272 | return res; |
| 4273 | } |
| 4274 | |
| 4275 | if (ipa3_ctx) { |
| 4276 | ipa3_ctx->ipa_client_apps_wan_cons_agg_gro = true; |
| 4277 | return 0; |
| 4278 | } |
| 4279 | return res; |
| 4280 | } |
| 4281 | |
| 4282 | static void *ipa3_get_ipc_logbuf(void) |
| 4283 | { |
| 4284 | if (ipa3_ctx) |
| 4285 | return ipa3_ctx->logbuf; |
| 4286 | |
| 4287 | return NULL; |
| 4288 | } |
| 4289 | |
| 4290 | static void *ipa3_get_ipc_logbuf_low(void) |
| 4291 | { |
| 4292 | if (ipa3_ctx) |
| 4293 | return ipa3_ctx->logbuf_low; |
| 4294 | |
| 4295 | return NULL; |
| 4296 | } |
| 4297 | |
| 4298 | static void ipa3_get_holb(int ep_idx, struct ipa_ep_cfg_holb *holb) |
| 4299 | { |
| 4300 | *holb = ipa3_ctx->ep[ep_idx].holb; |
| 4301 | } |
| 4302 | |
| 4303 | static void ipa3_set_tag_process_before_gating(bool val) |
| 4304 | { |
| 4305 | ipa3_ctx->tag_process_before_gating = val; |
| 4306 | } |
| 4307 | |
| 4308 | int ipa3_bind_api_controller(enum ipa_hw_type ipa_hw_type, |
| 4309 | struct ipa_api_controller *api_ctrl) |
| 4310 | { |
| 4311 | if (ipa_hw_type < IPA_HW_v3_0) { |
| 4312 | IPAERR("Unsupported IPA HW version %d\n", ipa_hw_type); |
| 4313 | WARN_ON(1); |
| 4314 | return -EPERM; |
| 4315 | } |
| 4316 | |
Amir Levy | a59ed3f | 2017-03-05 17:30:55 +0200 | [diff] [blame] | 4317 | api_ctrl->ipa_connect = NULL; |
| 4318 | api_ctrl->ipa_disconnect = NULL; |
| 4319 | api_ctrl->ipa_reset_endpoint = NULL; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4320 | api_ctrl->ipa_clear_endpoint_delay = ipa3_clear_endpoint_delay; |
| 4321 | api_ctrl->ipa_disable_endpoint = NULL; |
| 4322 | api_ctrl->ipa_cfg_ep = ipa3_cfg_ep; |
| 4323 | api_ctrl->ipa_cfg_ep_nat = ipa3_cfg_ep_nat; |
Amir Levy | dc65f4c | 2017-07-06 09:49:50 +0300 | [diff] [blame] | 4324 | api_ctrl->ipa_cfg_ep_conn_track = ipa3_cfg_ep_conn_track; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4325 | api_ctrl->ipa_cfg_ep_hdr = ipa3_cfg_ep_hdr; |
| 4326 | api_ctrl->ipa_cfg_ep_hdr_ext = ipa3_cfg_ep_hdr_ext; |
| 4327 | api_ctrl->ipa_cfg_ep_mode = ipa3_cfg_ep_mode; |
| 4328 | api_ctrl->ipa_cfg_ep_aggr = ipa3_cfg_ep_aggr; |
| 4329 | api_ctrl->ipa_cfg_ep_deaggr = ipa3_cfg_ep_deaggr; |
| 4330 | api_ctrl->ipa_cfg_ep_route = ipa3_cfg_ep_route; |
| 4331 | api_ctrl->ipa_cfg_ep_holb = ipa3_cfg_ep_holb; |
| 4332 | api_ctrl->ipa_get_holb = ipa3_get_holb; |
| 4333 | api_ctrl->ipa_set_tag_process_before_gating = |
| 4334 | ipa3_set_tag_process_before_gating; |
| 4335 | api_ctrl->ipa_cfg_ep_cfg = ipa3_cfg_ep_cfg; |
| 4336 | api_ctrl->ipa_cfg_ep_metadata_mask = ipa3_cfg_ep_metadata_mask; |
| 4337 | api_ctrl->ipa_cfg_ep_holb_by_client = ipa3_cfg_ep_holb_by_client; |
| 4338 | api_ctrl->ipa_cfg_ep_ctrl = ipa3_cfg_ep_ctrl; |
| 4339 | api_ctrl->ipa_add_hdr = ipa3_add_hdr; |
| 4340 | api_ctrl->ipa_del_hdr = ipa3_del_hdr; |
| 4341 | api_ctrl->ipa_commit_hdr = ipa3_commit_hdr; |
| 4342 | api_ctrl->ipa_reset_hdr = ipa3_reset_hdr; |
| 4343 | api_ctrl->ipa_get_hdr = ipa3_get_hdr; |
| 4344 | api_ctrl->ipa_put_hdr = ipa3_put_hdr; |
| 4345 | api_ctrl->ipa_copy_hdr = ipa3_copy_hdr; |
| 4346 | api_ctrl->ipa_add_hdr_proc_ctx = ipa3_add_hdr_proc_ctx; |
| 4347 | api_ctrl->ipa_del_hdr_proc_ctx = ipa3_del_hdr_proc_ctx; |
| 4348 | api_ctrl->ipa_add_rt_rule = ipa3_add_rt_rule; |
| 4349 | api_ctrl->ipa_del_rt_rule = ipa3_del_rt_rule; |
| 4350 | api_ctrl->ipa_commit_rt = ipa3_commit_rt; |
| 4351 | api_ctrl->ipa_reset_rt = ipa3_reset_rt; |
| 4352 | api_ctrl->ipa_get_rt_tbl = ipa3_get_rt_tbl; |
| 4353 | api_ctrl->ipa_put_rt_tbl = ipa3_put_rt_tbl; |
| 4354 | api_ctrl->ipa_query_rt_index = ipa3_query_rt_index; |
| 4355 | api_ctrl->ipa_mdfy_rt_rule = ipa3_mdfy_rt_rule; |
| 4356 | api_ctrl->ipa_add_flt_rule = ipa3_add_flt_rule; |
| 4357 | api_ctrl->ipa_del_flt_rule = ipa3_del_flt_rule; |
| 4358 | api_ctrl->ipa_mdfy_flt_rule = ipa3_mdfy_flt_rule; |
| 4359 | api_ctrl->ipa_commit_flt = ipa3_commit_flt; |
| 4360 | api_ctrl->ipa_reset_flt = ipa3_reset_flt; |
| 4361 | api_ctrl->allocate_nat_device = ipa3_allocate_nat_device; |
| 4362 | api_ctrl->ipa_nat_init_cmd = ipa3_nat_init_cmd; |
| 4363 | api_ctrl->ipa_nat_dma_cmd = ipa3_nat_dma_cmd; |
| 4364 | api_ctrl->ipa_nat_del_cmd = ipa3_nat_del_cmd; |
| 4365 | api_ctrl->ipa_send_msg = ipa3_send_msg; |
| 4366 | api_ctrl->ipa_register_pull_msg = ipa3_register_pull_msg; |
| 4367 | api_ctrl->ipa_deregister_pull_msg = ipa3_deregister_pull_msg; |
| 4368 | api_ctrl->ipa_register_intf = ipa3_register_intf; |
| 4369 | api_ctrl->ipa_register_intf_ext = ipa3_register_intf_ext; |
| 4370 | api_ctrl->ipa_deregister_intf = ipa3_deregister_intf; |
| 4371 | api_ctrl->ipa_set_aggr_mode = ipa3_set_aggr_mode; |
| 4372 | api_ctrl->ipa_set_qcncm_ndp_sig = ipa3_set_qcncm_ndp_sig; |
| 4373 | api_ctrl->ipa_set_single_ndp_per_mbim = ipa3_set_single_ndp_per_mbim; |
| 4374 | api_ctrl->ipa_tx_dp = ipa3_tx_dp; |
| 4375 | api_ctrl->ipa_tx_dp_mul = ipa3_tx_dp_mul; |
| 4376 | api_ctrl->ipa_free_skb = ipa3_free_skb; |
| 4377 | api_ctrl->ipa_setup_sys_pipe = ipa3_setup_sys_pipe; |
| 4378 | api_ctrl->ipa_teardown_sys_pipe = ipa3_teardown_sys_pipe; |
| 4379 | api_ctrl->ipa_sys_setup = ipa3_sys_setup; |
| 4380 | api_ctrl->ipa_sys_teardown = ipa3_sys_teardown; |
| 4381 | api_ctrl->ipa_sys_update_gsi_hdls = ipa3_sys_update_gsi_hdls; |
| 4382 | api_ctrl->ipa_connect_wdi_pipe = ipa3_connect_wdi_pipe; |
| 4383 | api_ctrl->ipa_disconnect_wdi_pipe = ipa3_disconnect_wdi_pipe; |
| 4384 | api_ctrl->ipa_enable_wdi_pipe = ipa3_enable_wdi_pipe; |
| 4385 | api_ctrl->ipa_disable_wdi_pipe = ipa3_disable_wdi_pipe; |
| 4386 | api_ctrl->ipa_resume_wdi_pipe = ipa3_resume_wdi_pipe; |
| 4387 | api_ctrl->ipa_suspend_wdi_pipe = ipa3_suspend_wdi_pipe; |
| 4388 | api_ctrl->ipa_get_wdi_stats = ipa3_get_wdi_stats; |
| 4389 | api_ctrl->ipa_get_smem_restr_bytes = ipa3_get_smem_restr_bytes; |
Skylar Chang | 6b41f8d | 2016-11-01 12:50:11 -0700 | [diff] [blame] | 4390 | api_ctrl->ipa_broadcast_wdi_quota_reach_ind = |
| 4391 | ipa3_broadcast_wdi_quota_reach_ind; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4392 | api_ctrl->ipa_uc_wdi_get_dbpa = ipa3_uc_wdi_get_dbpa; |
| 4393 | api_ctrl->ipa_uc_reg_rdyCB = ipa3_uc_reg_rdyCB; |
| 4394 | api_ctrl->ipa_uc_dereg_rdyCB = ipa3_uc_dereg_rdyCB; |
| 4395 | api_ctrl->teth_bridge_init = ipa3_teth_bridge_init; |
| 4396 | api_ctrl->teth_bridge_disconnect = ipa3_teth_bridge_disconnect; |
| 4397 | api_ctrl->teth_bridge_connect = ipa3_teth_bridge_connect; |
| 4398 | api_ctrl->ipa_set_client = ipa3_set_client; |
| 4399 | api_ctrl->ipa_get_client = ipa3_get_client; |
| 4400 | api_ctrl->ipa_get_client_uplink = ipa3_get_client_uplink; |
| 4401 | api_ctrl->ipa_dma_init = ipa3_dma_init; |
| 4402 | api_ctrl->ipa_dma_enable = ipa3_dma_enable; |
| 4403 | api_ctrl->ipa_dma_disable = ipa3_dma_disable; |
| 4404 | api_ctrl->ipa_dma_sync_memcpy = ipa3_dma_sync_memcpy; |
| 4405 | api_ctrl->ipa_dma_async_memcpy = ipa3_dma_async_memcpy; |
| 4406 | api_ctrl->ipa_dma_uc_memcpy = ipa3_dma_uc_memcpy; |
| 4407 | api_ctrl->ipa_dma_destroy = ipa3_dma_destroy; |
| 4408 | api_ctrl->ipa_mhi_init_engine = ipa3_mhi_init_engine; |
| 4409 | api_ctrl->ipa_connect_mhi_pipe = ipa3_connect_mhi_pipe; |
| 4410 | api_ctrl->ipa_disconnect_mhi_pipe = ipa3_disconnect_mhi_pipe; |
| 4411 | api_ctrl->ipa_mhi_stop_gsi_channel = ipa3_mhi_stop_gsi_channel; |
| 4412 | api_ctrl->ipa_uc_mhi_reset_channel = ipa3_uc_mhi_reset_channel; |
| 4413 | api_ctrl->ipa_qmi_enable_force_clear_datapath_send = |
| 4414 | ipa3_qmi_enable_force_clear_datapath_send; |
| 4415 | api_ctrl->ipa_qmi_disable_force_clear_datapath_send = |
| 4416 | ipa3_qmi_disable_force_clear_datapath_send; |
| 4417 | api_ctrl->ipa_mhi_reset_channel_internal = |
| 4418 | ipa3_mhi_reset_channel_internal; |
| 4419 | api_ctrl->ipa_mhi_start_channel_internal = |
| 4420 | ipa3_mhi_start_channel_internal; |
| 4421 | api_ctrl->ipa_mhi_query_ch_info = ipa3_mhi_query_ch_info; |
| 4422 | api_ctrl->ipa_mhi_resume_channels_internal = |
| 4423 | ipa3_mhi_resume_channels_internal; |
| 4424 | api_ctrl->ipa_has_open_aggr_frame = ipa3_has_open_aggr_frame; |
| 4425 | api_ctrl->ipa_mhi_destroy_channel = ipa3_mhi_destroy_channel; |
| 4426 | api_ctrl->ipa_uc_mhi_send_dl_ul_sync_info = |
| 4427 | ipa3_uc_mhi_send_dl_ul_sync_info; |
| 4428 | api_ctrl->ipa_uc_mhi_init = ipa3_uc_mhi_init; |
| 4429 | api_ctrl->ipa_uc_mhi_suspend_channel = ipa3_uc_mhi_suspend_channel; |
| 4430 | api_ctrl->ipa_uc_mhi_stop_event_update_channel = |
| 4431 | ipa3_uc_mhi_stop_event_update_channel; |
| 4432 | api_ctrl->ipa_uc_mhi_cleanup = ipa3_uc_mhi_cleanup; |
| 4433 | api_ctrl->ipa_uc_state_check = ipa3_uc_state_check; |
| 4434 | api_ctrl->ipa_write_qmap_id = ipa3_write_qmap_id; |
| 4435 | api_ctrl->ipa_add_interrupt_handler = ipa3_add_interrupt_handler; |
| 4436 | api_ctrl->ipa_remove_interrupt_handler = ipa3_remove_interrupt_handler; |
| 4437 | api_ctrl->ipa_restore_suspend_handler = ipa3_restore_suspend_handler; |
Amir Levy | a59ed3f | 2017-03-05 17:30:55 +0200 | [diff] [blame] | 4438 | api_ctrl->ipa_bam_reg_dump = NULL; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4439 | api_ctrl->ipa_get_ep_mapping = ipa3_get_ep_mapping; |
| 4440 | api_ctrl->ipa_is_ready = ipa3_is_ready; |
| 4441 | api_ctrl->ipa_proxy_clk_vote = ipa3_proxy_clk_vote; |
| 4442 | api_ctrl->ipa_proxy_clk_unvote = ipa3_proxy_clk_unvote; |
| 4443 | api_ctrl->ipa_is_client_handle_valid = ipa3_is_client_handle_valid; |
| 4444 | api_ctrl->ipa_get_client_mapping = ipa3_get_client_mapping; |
| 4445 | api_ctrl->ipa_get_rm_resource_from_ep = ipa3_get_rm_resource_from_ep; |
| 4446 | api_ctrl->ipa_get_modem_cfg_emb_pipe_flt = |
| 4447 | ipa3_get_modem_cfg_emb_pipe_flt; |
| 4448 | api_ctrl->ipa_get_transport_type = ipa3_get_transport_type; |
| 4449 | api_ctrl->ipa_ap_suspend = ipa3_ap_suspend; |
| 4450 | api_ctrl->ipa_ap_resume = ipa3_ap_resume; |
| 4451 | api_ctrl->ipa_get_smmu_domain = ipa3_get_smmu_domain; |
| 4452 | api_ctrl->ipa_disable_apps_wan_cons_deaggr = |
| 4453 | ipa3_disable_apps_wan_cons_deaggr; |
| 4454 | api_ctrl->ipa_get_dma_dev = ipa3_get_dma_dev; |
| 4455 | api_ctrl->ipa_release_wdi_mapping = ipa3_release_wdi_mapping; |
| 4456 | api_ctrl->ipa_create_wdi_mapping = ipa3_create_wdi_mapping; |
| 4457 | api_ctrl->ipa_get_gsi_ep_info = ipa3_get_gsi_ep_info; |
| 4458 | api_ctrl->ipa_stop_gsi_channel = ipa3_stop_gsi_channel; |
Skylar Chang | 9fbce06 | 2017-07-25 16:20:42 -0700 | [diff] [blame] | 4459 | api_ctrl->ipa_start_gsi_channel = ipa3_start_gsi_channel; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4460 | api_ctrl->ipa_register_ipa_ready_cb = ipa3_register_ipa_ready_cb; |
| 4461 | api_ctrl->ipa_inc_client_enable_clks = ipa3_inc_client_enable_clks; |
| 4462 | api_ctrl->ipa_dec_client_disable_clks = ipa3_dec_client_disable_clks; |
| 4463 | api_ctrl->ipa_inc_client_enable_clks_no_block = |
| 4464 | ipa3_inc_client_enable_clks_no_block; |
| 4465 | api_ctrl->ipa_suspend_resource_no_block = |
| 4466 | ipa3_suspend_resource_no_block; |
| 4467 | api_ctrl->ipa_resume_resource = ipa3_resume_resource; |
| 4468 | api_ctrl->ipa_suspend_resource_sync = ipa3_suspend_resource_sync; |
| 4469 | api_ctrl->ipa_set_required_perf_profile = |
| 4470 | ipa3_set_required_perf_profile; |
| 4471 | api_ctrl->ipa_get_ipc_logbuf = ipa3_get_ipc_logbuf; |
| 4472 | api_ctrl->ipa_get_ipc_logbuf_low = ipa3_get_ipc_logbuf_low; |
| 4473 | api_ctrl->ipa_rx_poll = ipa3_rx_poll; |
| 4474 | api_ctrl->ipa_recycle_wan_skb = ipa3_recycle_wan_skb; |
| 4475 | api_ctrl->ipa_setup_uc_ntn_pipes = ipa3_setup_uc_ntn_pipes; |
| 4476 | api_ctrl->ipa_tear_down_uc_offload_pipes = |
| 4477 | ipa3_tear_down_uc_offload_pipes; |
Amir Levy | c4222c9 | 2016-11-07 16:14:54 +0200 | [diff] [blame] | 4478 | api_ctrl->ipa_get_pdev = ipa3_get_pdev; |
Sunil Paidimarri | fbbcd07 | 2017-04-04 17:43:50 -0700 | [diff] [blame] | 4479 | api_ctrl->ipa_ntn_uc_reg_rdyCB = ipa3_ntn_uc_reg_rdyCB; |
| 4480 | api_ctrl->ipa_ntn_uc_dereg_rdyCB = ipa3_ntn_uc_dereg_rdyCB; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4481 | |
| 4482 | return 0; |
| 4483 | } |
| 4484 | |
| 4485 | /** |
| 4486 | * ipa_is_modem_pipe()- Checks if pipe is owned by the modem |
| 4487 | * |
| 4488 | * @pipe_idx: pipe number |
| 4489 | * Return value: true if owned by modem, false otherwize |
| 4490 | */ |
| 4491 | bool ipa_is_modem_pipe(int pipe_idx) |
| 4492 | { |
| 4493 | int client_idx; |
| 4494 | |
| 4495 | if (pipe_idx >= ipa3_ctx->ipa_num_pipes || pipe_idx < 0) { |
| 4496 | IPAERR("Bad pipe index!\n"); |
| 4497 | return false; |
| 4498 | } |
| 4499 | |
| 4500 | for (client_idx = 0; client_idx < IPA_CLIENT_MAX; client_idx++) { |
| 4501 | if (!IPA_CLIENT_IS_Q6_CONS(client_idx) && |
| 4502 | !IPA_CLIENT_IS_Q6_PROD(client_idx)) |
| 4503 | continue; |
| 4504 | if (ipa3_get_ep_mapping(client_idx) == pipe_idx) |
| 4505 | return true; |
| 4506 | } |
| 4507 | |
| 4508 | return false; |
| 4509 | } |
| 4510 | |
| 4511 | static void ipa3_write_rsrc_grp_type_reg(int group_index, |
| 4512 | enum ipa_rsrc_grp_type_src n, bool src, |
| 4513 | struct ipahal_reg_rsrc_grp_cfg *val) { |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4514 | u8 hw_type_idx; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4515 | |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4516 | hw_type_idx = ipa3_get_hw_type_index(); |
| 4517 | |
| 4518 | switch (hw_type_idx) { |
| 4519 | case IPA_3_0: |
| 4520 | if (src) { |
| 4521 | switch (group_index) { |
| 4522 | case IPA_v3_0_GROUP_UL: |
| 4523 | case IPA_v3_0_GROUP_DL: |
| 4524 | ipahal_write_reg_n_fields( |
| 4525 | IPA_SRC_RSRC_GRP_01_RSRC_TYPE_n, |
| 4526 | n, val); |
| 4527 | break; |
| 4528 | case IPA_v3_0_GROUP_DIAG: |
| 4529 | case IPA_v3_0_GROUP_DMA: |
| 4530 | ipahal_write_reg_n_fields( |
| 4531 | IPA_SRC_RSRC_GRP_23_RSRC_TYPE_n, |
| 4532 | n, val); |
| 4533 | break; |
| 4534 | case IPA_v3_0_GROUP_Q6ZIP: |
| 4535 | case IPA_v3_0_GROUP_UC_RX_Q: |
| 4536 | ipahal_write_reg_n_fields( |
| 4537 | IPA_SRC_RSRC_GRP_45_RSRC_TYPE_n, |
| 4538 | n, val); |
| 4539 | break; |
| 4540 | default: |
| 4541 | IPAERR( |
| 4542 | " Invalid source resource group,index #%d\n", |
| 4543 | group_index); |
| 4544 | break; |
| 4545 | } |
| 4546 | } else { |
| 4547 | switch (group_index) { |
| 4548 | case IPA_v3_0_GROUP_UL: |
| 4549 | case IPA_v3_0_GROUP_DL: |
| 4550 | ipahal_write_reg_n_fields( |
| 4551 | IPA_DST_RSRC_GRP_01_RSRC_TYPE_n, |
| 4552 | n, val); |
| 4553 | break; |
| 4554 | case IPA_v3_0_GROUP_DIAG: |
| 4555 | case IPA_v3_0_GROUP_DMA: |
| 4556 | ipahal_write_reg_n_fields( |
| 4557 | IPA_DST_RSRC_GRP_23_RSRC_TYPE_n, |
| 4558 | n, val); |
| 4559 | break; |
| 4560 | case IPA_v3_0_GROUP_Q6ZIP_GENERAL: |
| 4561 | case IPA_v3_0_GROUP_Q6ZIP_ENGINE: |
| 4562 | ipahal_write_reg_n_fields( |
| 4563 | IPA_DST_RSRC_GRP_45_RSRC_TYPE_n, |
| 4564 | n, val); |
| 4565 | break; |
| 4566 | default: |
| 4567 | IPAERR( |
| 4568 | " Invalid destination resource group,index #%d\n", |
| 4569 | group_index); |
| 4570 | break; |
| 4571 | } |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4572 | } |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4573 | break; |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 4574 | case IPA_3_5: |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 4575 | case IPA_3_5_MHI: |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4576 | case IPA_3_5_1: |
| 4577 | if (src) { |
| 4578 | switch (group_index) { |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 4579 | case IPA_v3_5_GROUP_LWA_DL: |
| 4580 | case IPA_v3_5_GROUP_UL_DL: |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4581 | ipahal_write_reg_n_fields( |
| 4582 | IPA_SRC_RSRC_GRP_01_RSRC_TYPE_n, |
| 4583 | n, val); |
| 4584 | break; |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 4585 | case IPA_v3_5_MHI_GROUP_DMA: |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 4586 | case IPA_v3_5_GROUP_UC_RX_Q: |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4587 | ipahal_write_reg_n_fields( |
| 4588 | IPA_SRC_RSRC_GRP_23_RSRC_TYPE_n, |
| 4589 | n, val); |
| 4590 | break; |
| 4591 | default: |
| 4592 | IPAERR( |
| 4593 | " Invalid source resource group,index #%d\n", |
| 4594 | group_index); |
| 4595 | break; |
| 4596 | } |
| 4597 | } else { |
| 4598 | switch (group_index) { |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 4599 | case IPA_v3_5_GROUP_LWA_DL: |
| 4600 | case IPA_v3_5_GROUP_UL_DL: |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4601 | ipahal_write_reg_n_fields( |
| 4602 | IPA_DST_RSRC_GRP_01_RSRC_TYPE_n, |
| 4603 | n, val); |
| 4604 | break; |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 4605 | case IPA_v3_5_MHI_GROUP_DMA: |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4606 | ipahal_write_reg_n_fields( |
| 4607 | IPA_DST_RSRC_GRP_23_RSRC_TYPE_n, |
| 4608 | n, val); |
| 4609 | break; |
| 4610 | default: |
| 4611 | IPAERR( |
| 4612 | " Invalid destination resource group,index #%d\n", |
| 4613 | group_index); |
| 4614 | break; |
| 4615 | } |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4616 | } |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4617 | break; |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 4618 | case IPA_4_0: |
| 4619 | case IPA_4_0_MHI: |
| 4620 | if (src) { |
| 4621 | switch (group_index) { |
| 4622 | case IPA_v4_0_GROUP_LWA_DL: |
| 4623 | case IPA_v4_0_GROUP_UL_DL: |
| 4624 | ipahal_write_reg_n_fields( |
| 4625 | IPA_SRC_RSRC_GRP_01_RSRC_TYPE_n, |
| 4626 | n, val); |
| 4627 | break; |
| 4628 | case IPA_v4_0_MHI_GROUP_DMA: |
| 4629 | case IPA_v4_0_GROUP_UC_RX_Q: |
| 4630 | ipahal_write_reg_n_fields( |
| 4631 | IPA_SRC_RSRC_GRP_23_RSRC_TYPE_n, |
| 4632 | n, val); |
| 4633 | break; |
| 4634 | default: |
| 4635 | IPAERR( |
| 4636 | " Invalid source resource group,index #%d\n", |
| 4637 | group_index); |
| 4638 | break; |
| 4639 | } |
| 4640 | } else { |
| 4641 | switch (group_index) { |
| 4642 | case IPA_v4_0_GROUP_LWA_DL: |
| 4643 | case IPA_v4_0_GROUP_UL_DL: |
| 4644 | ipahal_write_reg_n_fields( |
| 4645 | IPA_DST_RSRC_GRP_01_RSRC_TYPE_n, |
| 4646 | n, val); |
| 4647 | break; |
| 4648 | case IPA_v4_0_MHI_GROUP_DMA: |
| 4649 | ipahal_write_reg_n_fields( |
| 4650 | IPA_DST_RSRC_GRP_23_RSRC_TYPE_n, |
| 4651 | n, val); |
| 4652 | break; |
| 4653 | default: |
| 4654 | IPAERR( |
| 4655 | " Invalid destination resource group,index #%d\n", |
| 4656 | group_index); |
| 4657 | break; |
| 4658 | } |
| 4659 | } |
| 4660 | break; |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4661 | default: |
| 4662 | IPAERR("invalid hw type\n"); |
| 4663 | WARN_ON(1); |
| 4664 | return; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4665 | } |
| 4666 | } |
| 4667 | |
| 4668 | static void ipa3_configure_rx_hps_clients(int depth, bool min) |
| 4669 | { |
| 4670 | int i; |
| 4671 | struct ipahal_reg_rx_hps_clients val; |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4672 | u8 hw_type_idx; |
| 4673 | |
| 4674 | hw_type_idx = ipa3_get_hw_type_index(); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4675 | |
| 4676 | /* |
| 4677 | * depth 0 contains 4 first clients out of 6 |
| 4678 | * depth 1 contains 2 last clients out of 6 |
| 4679 | */ |
| 4680 | for (i = 0 ; i < (depth ? 2 : 4) ; i++) { |
| 4681 | if (min) |
| 4682 | val.client_minmax[i] = |
| 4683 | ipa3_rsrc_rx_grp_config |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4684 | [hw_type_idx] |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4685 | [IPA_RSRC_GRP_TYPE_RX_HPS_CMDQ] |
| 4686 | [!depth ? i : 4 + i].min; |
| 4687 | else |
| 4688 | val.client_minmax[i] = |
| 4689 | ipa3_rsrc_rx_grp_config |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4690 | [hw_type_idx] |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4691 | [IPA_RSRC_GRP_TYPE_RX_HPS_CMDQ] |
| 4692 | [!depth ? i : 4 + i].max; |
| 4693 | } |
| 4694 | if (depth) { |
| 4695 | ipahal_write_reg_fields(min ? IPA_RX_HPS_CLIENTS_MIN_DEPTH_1 : |
| 4696 | IPA_RX_HPS_CLIENTS_MAX_DEPTH_1, |
| 4697 | &val); |
| 4698 | } else { |
| 4699 | ipahal_write_reg_fields(min ? IPA_RX_HPS_CLIENTS_MIN_DEPTH_0 : |
| 4700 | IPA_RX_HPS_CLIENTS_MAX_DEPTH_0, |
| 4701 | &val); |
| 4702 | } |
| 4703 | } |
| 4704 | |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 4705 | static void ipa3_configure_rx_hps_weight(void) |
| 4706 | { |
| 4707 | struct ipahal_reg_rx_hps_weights val; |
| 4708 | u8 hw_type_idx; |
| 4709 | |
| 4710 | hw_type_idx = ipa3_get_hw_type_index(); |
| 4711 | |
| 4712 | val.hps_queue_weight_0 = |
| 4713 | ipa3_rsrc_rx_grp_hps_weight_config |
| 4714 | [hw_type_idx][IPA_RSRC_GRP_TYPE_RX_HPS_WEIGHT_CONFIG] |
| 4715 | [0]; |
| 4716 | val.hps_queue_weight_1 = |
| 4717 | ipa3_rsrc_rx_grp_hps_weight_config |
| 4718 | [hw_type_idx][IPA_RSRC_GRP_TYPE_RX_HPS_WEIGHT_CONFIG] |
| 4719 | [1]; |
| 4720 | val.hps_queue_weight_2 = |
| 4721 | ipa3_rsrc_rx_grp_hps_weight_config |
| 4722 | [hw_type_idx][IPA_RSRC_GRP_TYPE_RX_HPS_WEIGHT_CONFIG] |
| 4723 | [2]; |
| 4724 | val.hps_queue_weight_3 = |
| 4725 | ipa3_rsrc_rx_grp_hps_weight_config |
| 4726 | [hw_type_idx][IPA_RSRC_GRP_TYPE_RX_HPS_WEIGHT_CONFIG] |
| 4727 | [3]; |
| 4728 | |
| 4729 | ipahal_write_reg_fields(IPA_HPS_FTCH_ARB_QUEUE_WEIGHT, &val); |
| 4730 | } |
| 4731 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4732 | void ipa3_set_resorce_groups_min_max_limits(void) |
| 4733 | { |
| 4734 | int i; |
| 4735 | int j; |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4736 | int src_rsrc_type_max; |
| 4737 | int dst_rsrc_type_max; |
| 4738 | int src_grp_idx_max; |
| 4739 | int dst_grp_idx_max; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4740 | struct ipahal_reg_rsrc_grp_cfg val; |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4741 | u8 hw_type_idx; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4742 | |
| 4743 | IPADBG("ENTER\n"); |
| 4744 | IPADBG("Assign source rsrc groups min-max limits\n"); |
| 4745 | |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4746 | hw_type_idx = ipa3_get_hw_type_index(); |
| 4747 | switch (hw_type_idx) { |
| 4748 | case IPA_3_0: |
| 4749 | src_rsrc_type_max = IPA_v3_0_RSRC_GRP_TYPE_SRC_MAX; |
| 4750 | dst_rsrc_type_max = IPA_v3_0_RSRC_GRP_TYPE_DST_MAX; |
| 4751 | src_grp_idx_max = IPA_v3_0_GROUP_MAX; |
| 4752 | dst_grp_idx_max = IPA_v3_0_GROUP_MAX; |
| 4753 | break; |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 4754 | case IPA_3_5: |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 4755 | case IPA_3_5_MHI: |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4756 | case IPA_3_5_1: |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 4757 | src_rsrc_type_max = IPA_v3_5_RSRC_GRP_TYPE_SRC_MAX; |
| 4758 | dst_rsrc_type_max = IPA_v3_5_RSRC_GRP_TYPE_DST_MAX; |
| 4759 | src_grp_idx_max = IPA_v3_5_SRC_GROUP_MAX; |
| 4760 | dst_grp_idx_max = IPA_v3_5_DST_GROUP_MAX; |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4761 | break; |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 4762 | case IPA_4_0: |
| 4763 | case IPA_4_0_MHI: |
| 4764 | src_rsrc_type_max = IPA_v4_0_RSRC_GRP_TYPE_SRC_MAX; |
| 4765 | dst_rsrc_type_max = IPA_v4_0_RSRC_GRP_TYPE_DST_MAX; |
| 4766 | src_grp_idx_max = IPA_v4_0_SRC_GROUP_MAX; |
| 4767 | dst_grp_idx_max = IPA_v4_0_DST_GROUP_MAX; |
| 4768 | break; |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4769 | default: |
| 4770 | IPAERR("invalid hw type index\n"); |
| 4771 | WARN_ON(1); |
| 4772 | return; |
| 4773 | } |
| 4774 | |
| 4775 | for (i = 0; i < src_rsrc_type_max; i++) { |
| 4776 | for (j = 0; j < src_grp_idx_max; j = j + 2) { |
| 4777 | val.x_min = |
| 4778 | ipa3_rsrc_src_grp_config[hw_type_idx][i][j].min; |
| 4779 | val.x_max = |
| 4780 | ipa3_rsrc_src_grp_config[hw_type_idx][i][j].max; |
| 4781 | val.y_min = |
| 4782 | ipa3_rsrc_src_grp_config[hw_type_idx][i][j + 1].min; |
| 4783 | val.y_max = |
| 4784 | ipa3_rsrc_src_grp_config[hw_type_idx][i][j + 1].max; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4785 | ipa3_write_rsrc_grp_type_reg(j, i, true, &val); |
| 4786 | } |
| 4787 | } |
| 4788 | |
| 4789 | IPADBG("Assign destination rsrc groups min-max limits\n"); |
| 4790 | |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4791 | for (i = 0; i < dst_rsrc_type_max; i++) { |
| 4792 | for (j = 0; j < dst_grp_idx_max; j = j + 2) { |
| 4793 | val.x_min = |
| 4794 | ipa3_rsrc_dst_grp_config[hw_type_idx][i][j].min; |
| 4795 | val.x_max = |
| 4796 | ipa3_rsrc_dst_grp_config[hw_type_idx][i][j].max; |
| 4797 | val.y_min = |
| 4798 | ipa3_rsrc_dst_grp_config[hw_type_idx][i][j + 1].min; |
| 4799 | val.y_max = |
| 4800 | ipa3_rsrc_dst_grp_config[hw_type_idx][i][j + 1].max; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4801 | ipa3_write_rsrc_grp_type_reg(j, i, false, &val); |
| 4802 | } |
| 4803 | } |
| 4804 | |
| 4805 | /* move resource group configuration from HLOS to TZ */ |
| 4806 | if (ipa3_ctx->ipa_hw_type >= IPA_HW_v3_1) { |
| 4807 | IPAERR("skip configuring ipa_rx_hps_clients from HLOS\n"); |
| 4808 | return; |
| 4809 | } |
| 4810 | |
| 4811 | IPADBG("Assign RX_HPS CMDQ rsrc groups min-max limits\n"); |
| 4812 | |
| 4813 | ipa3_configure_rx_hps_clients(0, true); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4814 | ipa3_configure_rx_hps_clients(0, false); |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4815 | |
| 4816 | /* only hw_type v3_0\3_1 have 6 RX_HPS_CMDQ and needs depth 1*/ |
| 4817 | if (ipa3_ctx->ipa_hw_type <= IPA_HW_v3_1) { |
| 4818 | ipa3_configure_rx_hps_clients(1, true); |
| 4819 | ipa3_configure_rx_hps_clients(1, false); |
| 4820 | } |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4821 | |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 4822 | if (ipa3_ctx->ipa_hw_type >= IPA_HW_v3_5) |
| 4823 | ipa3_configure_rx_hps_weight(); |
| 4824 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4825 | IPADBG("EXIT\n"); |
| 4826 | } |
| 4827 | |
| 4828 | static void ipa3_gsi_poll_after_suspend(struct ipa3_ep_context *ep) |
| 4829 | { |
| 4830 | bool empty; |
| 4831 | |
| 4832 | IPADBG("switch ch %ld to poll\n", ep->gsi_chan_hdl); |
| 4833 | gsi_config_channel_mode(ep->gsi_chan_hdl, GSI_CHAN_MODE_POLL); |
| 4834 | gsi_is_channel_empty(ep->gsi_chan_hdl, &empty); |
| 4835 | if (!empty) { |
| 4836 | IPADBG("ch %ld not empty\n", ep->gsi_chan_hdl); |
| 4837 | /* queue a work to start polling if don't have one */ |
| 4838 | atomic_set(&ipa3_ctx->transport_pm.eot_activity, 1); |
| 4839 | if (!atomic_read(&ep->sys->curr_polling_state)) { |
Skylar Chang | ac06f90 | 2017-04-10 15:15:46 -0700 | [diff] [blame] | 4840 | ipa3_inc_acquire_wakelock(); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4841 | atomic_set(&ep->sys->curr_polling_state, 1); |
| 4842 | queue_work(ep->sys->wq, &ep->sys->work); |
| 4843 | } |
| 4844 | } |
| 4845 | } |
| 4846 | |
| 4847 | void ipa3_suspend_apps_pipes(bool suspend) |
| 4848 | { |
| 4849 | struct ipa_ep_cfg_ctrl cfg; |
| 4850 | int ipa_ep_idx; |
| 4851 | struct ipa3_ep_context *ep; |
Skylar Chang | a699afd | 2017-06-06 10:06:21 -0700 | [diff] [blame] | 4852 | int res; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4853 | |
| 4854 | memset(&cfg, 0, sizeof(cfg)); |
| 4855 | cfg.ipa_ep_suspend = suspend; |
| 4856 | |
| 4857 | ipa_ep_idx = ipa3_get_ep_mapping(IPA_CLIENT_APPS_LAN_CONS); |
Ghanim Fodi | 79ee8d8 | 2017-02-27 16:39:25 +0200 | [diff] [blame] | 4858 | if (ipa_ep_idx < 0) { |
| 4859 | IPAERR("IPA client mapping failed\n"); |
| 4860 | ipa_assert(); |
| 4861 | return; |
| 4862 | } |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4863 | ep = &ipa3_ctx->ep[ipa_ep_idx]; |
| 4864 | if (ep->valid) { |
| 4865 | IPADBG("%s pipe %d\n", suspend ? "suspend" : "unsuspend", |
| 4866 | ipa_ep_idx); |
Skylar Chang | a699afd | 2017-06-06 10:06:21 -0700 | [diff] [blame] | 4867 | if (ipa3_ctx->ipa_hw_type >= IPA_HW_v4_0) { |
| 4868 | if (suspend) { |
| 4869 | res = ipa3_stop_gsi_channel(ipa_ep_idx); |
| 4870 | if (res) { |
| 4871 | IPAERR("failed to stop LAN channel\n"); |
| 4872 | ipa_assert(); |
| 4873 | } |
| 4874 | } else { |
| 4875 | res = gsi_start_channel(ep->gsi_chan_hdl); |
| 4876 | if (res) { |
| 4877 | IPAERR("failed to start LAN channel\n"); |
| 4878 | ipa_assert(); |
| 4879 | } |
| 4880 | } |
| 4881 | } else { |
| 4882 | ipa3_cfg_ep_ctrl(ipa_ep_idx, &cfg); |
| 4883 | } |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4884 | if (suspend) |
| 4885 | ipa3_gsi_poll_after_suspend(ep); |
| 4886 | else if (!atomic_read(&ep->sys->curr_polling_state)) |
| 4887 | gsi_config_channel_mode(ep->gsi_chan_hdl, |
| 4888 | GSI_CHAN_MODE_CALLBACK); |
| 4889 | } |
| 4890 | |
| 4891 | ipa_ep_idx = ipa_get_ep_mapping(IPA_CLIENT_APPS_WAN_CONS); |
| 4892 | /* Considering the case for SSR. */ |
| 4893 | if (ipa_ep_idx == -1) { |
| 4894 | IPADBG("Invalid client.\n"); |
| 4895 | return; |
| 4896 | } |
| 4897 | ep = &ipa3_ctx->ep[ipa_ep_idx]; |
| 4898 | if (ep->valid) { |
| 4899 | IPADBG("%s pipe %d\n", suspend ? "suspend" : "unsuspend", |
| 4900 | ipa_ep_idx); |
Skylar Chang | a699afd | 2017-06-06 10:06:21 -0700 | [diff] [blame] | 4901 | if (ipa3_ctx->ipa_hw_type >= IPA_HW_v4_0) { |
| 4902 | if (suspend) { |
| 4903 | res = ipa3_stop_gsi_channel(ipa_ep_idx); |
| 4904 | if (res) { |
| 4905 | IPAERR("failed to stop WAN channel\n"); |
| 4906 | ipa_assert(); |
| 4907 | } |
| 4908 | } else { |
| 4909 | res = gsi_start_channel(ep->gsi_chan_hdl); |
| 4910 | if (res) { |
| 4911 | IPAERR("failed to start WAN channel\n"); |
| 4912 | ipa_assert(); |
| 4913 | } |
| 4914 | } |
| 4915 | } else { |
| 4916 | ipa3_cfg_ep_ctrl(ipa_ep_idx, &cfg); |
| 4917 | } |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4918 | if (suspend) |
| 4919 | ipa3_gsi_poll_after_suspend(ep); |
| 4920 | else if (!atomic_read(&ep->sys->curr_polling_state)) |
| 4921 | gsi_config_channel_mode(ep->gsi_chan_hdl, |
| 4922 | GSI_CHAN_MODE_CALLBACK); |
| 4923 | } |
| 4924 | } |
| 4925 | |
Skylar Chang | 6c4bec9 | 2017-04-21 16:10:14 -0700 | [diff] [blame] | 4926 | int ipa3_allocate_dma_task_for_gsi(void) |
| 4927 | { |
| 4928 | struct ipahal_imm_cmd_dma_task_32b_addr cmd = { 0 }; |
| 4929 | |
| 4930 | IPADBG("Allocate mem\n"); |
| 4931 | ipa3_ctx->dma_task_info.mem.size = IPA_GSI_CHANNEL_STOP_PKT_SIZE; |
| 4932 | ipa3_ctx->dma_task_info.mem.base = dma_alloc_coherent(ipa3_ctx->pdev, |
| 4933 | ipa3_ctx->dma_task_info.mem.size, |
| 4934 | &ipa3_ctx->dma_task_info.mem.phys_base, |
| 4935 | GFP_KERNEL); |
| 4936 | if (!ipa3_ctx->dma_task_info.mem.base) { |
| 4937 | IPAERR("no mem\n"); |
| 4938 | return -EFAULT; |
| 4939 | } |
| 4940 | |
| 4941 | cmd.flsh = 1; |
| 4942 | cmd.size1 = ipa3_ctx->dma_task_info.mem.size; |
| 4943 | cmd.addr1 = ipa3_ctx->dma_task_info.mem.phys_base; |
| 4944 | cmd.packet_size = ipa3_ctx->dma_task_info.mem.size; |
| 4945 | ipa3_ctx->dma_task_info.cmd_pyld = ipahal_construct_imm_cmd( |
| 4946 | IPA_IMM_CMD_DMA_TASK_32B_ADDR, &cmd, false); |
| 4947 | if (!ipa3_ctx->dma_task_info.cmd_pyld) { |
| 4948 | IPAERR("failed to construct dma_task_32b_addr cmd\n"); |
| 4949 | dma_free_coherent(ipa3_ctx->pdev, |
| 4950 | ipa3_ctx->dma_task_info.mem.size, |
| 4951 | ipa3_ctx->dma_task_info.mem.base, |
| 4952 | ipa3_ctx->dma_task_info.mem.phys_base); |
| 4953 | memset(&ipa3_ctx->dma_task_info, 0, |
| 4954 | sizeof(ipa3_ctx->dma_task_info)); |
| 4955 | return -EFAULT; |
| 4956 | } |
| 4957 | |
| 4958 | return 0; |
| 4959 | } |
| 4960 | |
| 4961 | void ipa3_free_dma_task_for_gsi(void) |
| 4962 | { |
| 4963 | dma_free_coherent(ipa3_ctx->pdev, |
| 4964 | ipa3_ctx->dma_task_info.mem.size, |
| 4965 | ipa3_ctx->dma_task_info.mem.base, |
| 4966 | ipa3_ctx->dma_task_info.mem.phys_base); |
| 4967 | ipahal_destroy_imm_cmd(ipa3_ctx->dma_task_info.cmd_pyld); |
| 4968 | memset(&ipa3_ctx->dma_task_info, 0, sizeof(ipa3_ctx->dma_task_info)); |
| 4969 | } |
| 4970 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4971 | /** |
| 4972 | * ipa3_inject_dma_task_for_gsi()- Send DMA_TASK to IPA for GSI stop channel |
| 4973 | * |
| 4974 | * Send a DMA_TASK of 1B to IPA to unblock GSI channel in STOP_IN_PROG. |
| 4975 | * Return value: 0 on success, negative otherwise |
| 4976 | */ |
| 4977 | int ipa3_inject_dma_task_for_gsi(void) |
| 4978 | { |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4979 | struct ipa3_desc desc = {0}; |
| 4980 | |
Michael Adisumarta | b5d170f | 2017-05-17 14:34:11 -0700 | [diff] [blame] | 4981 | desc.opcode = ipa3_ctx->dma_task_info.cmd_pyld->opcode; |
Skylar Chang | 6c4bec9 | 2017-04-21 16:10:14 -0700 | [diff] [blame] | 4982 | desc.pyld = ipa3_ctx->dma_task_info.cmd_pyld->data; |
| 4983 | desc.len = ipa3_ctx->dma_task_info.cmd_pyld->len; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4984 | desc.type = IPA_IMM_CMD_DESC; |
| 4985 | |
| 4986 | IPADBG("sending 1B packet to IPA\n"); |
Gidon Studinski | 3021a6f | 2016-11-10 12:48:48 +0200 | [diff] [blame] | 4987 | if (ipa3_send_cmd_timeout(1, &desc, |
| 4988 | IPA_DMA_TASK_FOR_GSI_TIMEOUT_MSEC)) { |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4989 | IPAERR("ipa3_send_cmd failed\n"); |
| 4990 | return -EFAULT; |
| 4991 | } |
| 4992 | |
| 4993 | return 0; |
| 4994 | } |
| 4995 | |
| 4996 | /** |
| 4997 | * ipa3_stop_gsi_channel()- Stops a GSI channel in IPA |
| 4998 | * @chan_hdl: GSI channel handle |
| 4999 | * |
| 5000 | * This function implements the sequence to stop a GSI channel |
| 5001 | * in IPA. This function returns when the channel is is STOP state. |
| 5002 | * |
| 5003 | * Return value: 0 on success, negative otherwise |
| 5004 | */ |
| 5005 | int ipa3_stop_gsi_channel(u32 clnt_hdl) |
| 5006 | { |
| 5007 | struct ipa_mem_buffer mem; |
| 5008 | int res = 0; |
| 5009 | int i; |
| 5010 | struct ipa3_ep_context *ep; |
| 5011 | |
| 5012 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 5013 | ipa3_ctx->ep[clnt_hdl].valid == 0) { |
| 5014 | IPAERR("bad parm.\n"); |
| 5015 | return -EINVAL; |
| 5016 | } |
| 5017 | |
| 5018 | ep = &ipa3_ctx->ep[clnt_hdl]; |
| 5019 | |
| 5020 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 5021 | |
| 5022 | memset(&mem, 0, sizeof(mem)); |
| 5023 | |
Skylar Chang | 1048855 | 2017-05-02 11:02:58 -0700 | [diff] [blame] | 5024 | if (IPA_CLIENT_IS_PROD(ep->client)) { |
| 5025 | IPADBG("Calling gsi_stop_channel ch:%lu\n", |
| 5026 | ep->gsi_chan_hdl); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 5027 | res = gsi_stop_channel(ep->gsi_chan_hdl); |
Skylar Chang | 1048855 | 2017-05-02 11:02:58 -0700 | [diff] [blame] | 5028 | IPADBG("gsi_stop_channel ch: %lu returned %d\n", |
| 5029 | ep->gsi_chan_hdl, res); |
| 5030 | goto end_sequence; |
| 5031 | } |
| 5032 | |
| 5033 | for (i = 0; i < IPA_GSI_CHANNEL_STOP_MAX_RETRY; i++) { |
| 5034 | IPADBG("Calling gsi_stop_channel ch:%lu\n", |
| 5035 | ep->gsi_chan_hdl); |
| 5036 | res = gsi_stop_channel(ep->gsi_chan_hdl); |
| 5037 | IPADBG("gsi_stop_channel ch: %lu returned %d\n", |
| 5038 | ep->gsi_chan_hdl, res); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 5039 | if (res != -GSI_STATUS_AGAIN && res != -GSI_STATUS_TIMED_OUT) |
| 5040 | goto end_sequence; |
| 5041 | |
Skylar Chang | 1048855 | 2017-05-02 11:02:58 -0700 | [diff] [blame] | 5042 | IPADBG("Inject a DMA_TASK with 1B packet to IPA\n"); |
| 5043 | /* Send a 1B packet DMA_TASK to IPA and try again */ |
| 5044 | res = ipa3_inject_dma_task_for_gsi(); |
| 5045 | if (res) { |
| 5046 | IPAERR("Failed to inject DMA TASk for GSI\n"); |
| 5047 | goto end_sequence; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 5048 | } |
| 5049 | |
| 5050 | /* sleep for short period to flush IPA */ |
| 5051 | usleep_range(IPA_GSI_CHANNEL_STOP_SLEEP_MIN_USEC, |
| 5052 | IPA_GSI_CHANNEL_STOP_SLEEP_MAX_USEC); |
| 5053 | } |
| 5054 | |
| 5055 | IPAERR("Failed to stop GSI channel with retries\n"); |
| 5056 | res = -EFAULT; |
| 5057 | end_sequence: |
| 5058 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 5059 | |
| 5060 | return res; |
| 5061 | } |
| 5062 | |
Ghanim Fodi | 37b6495 | 2017-01-24 15:42:30 +0200 | [diff] [blame] | 5063 | static int ipa3_load_single_fw(const struct firmware *firmware, |
| 5064 | const struct elf32_phdr *phdr) |
| 5065 | { |
| 5066 | uint32_t *fw_mem_base; |
| 5067 | int index; |
| 5068 | const uint32_t *elf_data_ptr; |
| 5069 | |
| 5070 | if (phdr->p_offset > firmware->size) { |
| 5071 | IPAERR("Invalid ELF: offset=%u is beyond elf_size=%zu\n", |
| 5072 | phdr->p_offset, firmware->size); |
| 5073 | return -EINVAL; |
| 5074 | } |
| 5075 | if ((firmware->size - phdr->p_offset) < phdr->p_filesz) { |
| 5076 | IPAERR("Invalid ELF: offset=%u filesz=%u elf_size=%zu\n", |
| 5077 | phdr->p_offset, phdr->p_filesz, firmware->size); |
| 5078 | return -EINVAL; |
| 5079 | } |
| 5080 | |
| 5081 | if (phdr->p_memsz % sizeof(uint32_t)) { |
| 5082 | IPAERR("FW mem size %u doesn't align to 32bit\n", |
| 5083 | phdr->p_memsz); |
| 5084 | return -EFAULT; |
| 5085 | } |
| 5086 | |
| 5087 | if (phdr->p_filesz > phdr->p_memsz) { |
| 5088 | IPAERR("FW image too big src_size=%u dst_size=%u\n", |
| 5089 | phdr->p_filesz, phdr->p_memsz); |
| 5090 | return -EFAULT; |
| 5091 | } |
| 5092 | |
| 5093 | fw_mem_base = ioremap(phdr->p_vaddr, phdr->p_memsz); |
| 5094 | if (!fw_mem_base) { |
| 5095 | IPAERR("Failed to map 0x%x for the size of %u\n", |
| 5096 | phdr->p_vaddr, phdr->p_memsz); |
| 5097 | return -ENOMEM; |
| 5098 | } |
| 5099 | |
| 5100 | /* Set the entire region to 0s */ |
| 5101 | memset(fw_mem_base, 0, phdr->p_memsz); |
| 5102 | |
| 5103 | elf_data_ptr = (uint32_t *)(firmware->data + phdr->p_offset); |
| 5104 | |
| 5105 | /* Write the FW */ |
| 5106 | for (index = 0; index < phdr->p_filesz/sizeof(uint32_t); index++) { |
| 5107 | writel_relaxed(*elf_data_ptr, &fw_mem_base[index]); |
| 5108 | elf_data_ptr++; |
| 5109 | } |
| 5110 | |
| 5111 | iounmap(fw_mem_base); |
| 5112 | |
| 5113 | return 0; |
| 5114 | } |
| 5115 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 5116 | /** |
| 5117 | * ipa3_load_fws() - Load the IPAv3 FWs into IPA&GSI SRAM. |
| 5118 | * |
| 5119 | * @firmware: Structure which contains the FW data from the user space. |
Ghanim Fodi | 37b6495 | 2017-01-24 15:42:30 +0200 | [diff] [blame] | 5120 | * @gsi_mem_base: GSI base address |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 5121 | * |
| 5122 | * Return value: 0 on success, negative otherwise |
| 5123 | * |
| 5124 | */ |
Ghanim Fodi | 37b6495 | 2017-01-24 15:42:30 +0200 | [diff] [blame] | 5125 | int ipa3_load_fws(const struct firmware *firmware, phys_addr_t gsi_mem_base) |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 5126 | { |
| 5127 | const struct elf32_hdr *ehdr; |
| 5128 | const struct elf32_phdr *phdr; |
Ghanim Fodi | 37b6495 | 2017-01-24 15:42:30 +0200 | [diff] [blame] | 5129 | unsigned long gsi_iram_ofst; |
| 5130 | unsigned long gsi_iram_size; |
| 5131 | phys_addr_t ipa_reg_mem_base; |
| 5132 | u32 ipa_reg_ofst; |
| 5133 | int rc; |
| 5134 | |
| 5135 | if (!gsi_mem_base) { |
| 5136 | IPAERR("Invalid GSI base address\n"); |
| 5137 | return -EINVAL; |
| 5138 | } |
| 5139 | |
| 5140 | ipa_assert_on(!firmware); |
| 5141 | /* One program header per FW image: GSI, DPS and HPS */ |
| 5142 | if (firmware->size < (sizeof(*ehdr) + 3 * sizeof(*phdr))) { |
| 5143 | IPAERR("Missing ELF and Program headers firmware size=%zu\n", |
| 5144 | firmware->size); |
| 5145 | return -EINVAL; |
| 5146 | } |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 5147 | |
| 5148 | ehdr = (struct elf32_hdr *) firmware->data; |
Ghanim Fodi | 37b6495 | 2017-01-24 15:42:30 +0200 | [diff] [blame] | 5149 | ipa_assert_on(!ehdr); |
| 5150 | if (ehdr->e_phnum != 3) { |
| 5151 | IPAERR("Unexpected number of ELF program headers\n"); |
| 5152 | return -EINVAL; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 5153 | } |
Ghanim Fodi | 37b6495 | 2017-01-24 15:42:30 +0200 | [diff] [blame] | 5154 | phdr = (struct elf32_phdr *)(firmware->data + sizeof(*ehdr)); |
| 5155 | |
| 5156 | /* |
| 5157 | * Each ELF program header represents a FW image and contains: |
| 5158 | * p_vaddr : The starting address to which the FW needs to loaded. |
| 5159 | * p_memsz : The size of the IRAM (where the image loaded) |
| 5160 | * p_filesz: The size of the FW image embedded inside the ELF |
| 5161 | * p_offset: Absolute offset to the image from the head of the ELF |
| 5162 | */ |
| 5163 | |
| 5164 | /* Load GSI FW image */ |
| 5165 | gsi_get_inst_ram_offset_and_size(&gsi_iram_ofst, &gsi_iram_size); |
| 5166 | if (phdr->p_vaddr != (gsi_mem_base + gsi_iram_ofst)) { |
| 5167 | IPAERR( |
| 5168 | "Invalid GSI FW img load addr vaddr=0x%x gsi_mem_base=%pa gsi_iram_ofst=0x%lx\n" |
| 5169 | , phdr->p_vaddr, &gsi_mem_base, gsi_iram_ofst); |
| 5170 | return -EINVAL; |
| 5171 | } |
| 5172 | if (phdr->p_memsz > gsi_iram_size) { |
| 5173 | IPAERR("Invalid GSI FW img size memsz=%d gsi_iram_size=%lu\n", |
| 5174 | phdr->p_memsz, gsi_iram_size); |
| 5175 | return -EINVAL; |
| 5176 | } |
| 5177 | rc = ipa3_load_single_fw(firmware, phdr); |
| 5178 | if (rc) |
| 5179 | return rc; |
| 5180 | |
| 5181 | phdr++; |
| 5182 | ipa_reg_mem_base = ipa3_ctx->ipa_wrapper_base + ipahal_get_reg_base(); |
| 5183 | |
| 5184 | /* Load IPA DPS FW image */ |
| 5185 | ipa_reg_ofst = ipahal_get_reg_ofst(IPA_DPS_SEQUENCER_FIRST); |
| 5186 | if (phdr->p_vaddr != (ipa_reg_mem_base + ipa_reg_ofst)) { |
| 5187 | IPAERR( |
| 5188 | "Invalid IPA DPS img load addr vaddr=0x%x ipa_reg_mem_base=%pa ipa_reg_ofst=%u\n" |
| 5189 | , phdr->p_vaddr, &ipa_reg_mem_base, ipa_reg_ofst); |
| 5190 | return -EINVAL; |
| 5191 | } |
| 5192 | if (phdr->p_memsz > ipahal_get_dps_img_mem_size()) { |
| 5193 | IPAERR("Invalid IPA DPS img size memsz=%d dps_mem_size=%u\n", |
| 5194 | phdr->p_memsz, ipahal_get_dps_img_mem_size()); |
| 5195 | return -EINVAL; |
| 5196 | } |
| 5197 | rc = ipa3_load_single_fw(firmware, phdr); |
| 5198 | if (rc) |
| 5199 | return rc; |
| 5200 | |
| 5201 | phdr++; |
| 5202 | |
| 5203 | /* Load IPA HPS FW image */ |
| 5204 | ipa_reg_ofst = ipahal_get_reg_ofst(IPA_HPS_SEQUENCER_FIRST); |
| 5205 | if (phdr->p_vaddr != (ipa_reg_mem_base + ipa_reg_ofst)) { |
| 5206 | IPAERR( |
| 5207 | "Invalid IPA HPS img load addr vaddr=0x%x ipa_reg_mem_base=%pa ipa_reg_ofst=%u\n" |
| 5208 | , phdr->p_vaddr, &ipa_reg_mem_base, ipa_reg_ofst); |
| 5209 | return -EINVAL; |
| 5210 | } |
| 5211 | if (phdr->p_memsz > ipahal_get_hps_img_mem_size()) { |
| 5212 | IPAERR("Invalid IPA HPS img size memsz=%d dps_mem_size=%u\n", |
| 5213 | phdr->p_memsz, ipahal_get_hps_img_mem_size()); |
| 5214 | return -EINVAL; |
| 5215 | } |
| 5216 | rc = ipa3_load_single_fw(firmware, phdr); |
| 5217 | if (rc) |
| 5218 | return rc; |
| 5219 | |
| 5220 | IPADBG("IPA FWs (GSI FW, DPS and HPS) loaded successfully\n"); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 5221 | return 0; |
| 5222 | } |
| 5223 | |
| 5224 | /** |
| 5225 | * ipa3_is_msm_device() - Is the running device a MSM or MDM? |
| 5226 | * Determine according to IPA version |
| 5227 | * |
| 5228 | * Return value: true if MSM, false if MDM |
| 5229 | * |
| 5230 | */ |
| 5231 | bool ipa3_is_msm_device(void) |
| 5232 | { |
| 5233 | switch (ipa3_ctx->ipa_hw_type) { |
| 5234 | case IPA_HW_v3_0: |
| 5235 | case IPA_HW_v3_5: |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 5236 | case IPA_HW_v4_0: |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 5237 | return false; |
| 5238 | case IPA_HW_v3_1: |
| 5239 | case IPA_HW_v3_5_1: |
| 5240 | return true; |
| 5241 | default: |
| 5242 | IPAERR("unknown HW type %d\n", ipa3_ctx->ipa_hw_type); |
| 5243 | ipa_assert(); |
| 5244 | } |
| 5245 | |
| 5246 | return false; |
| 5247 | } |
Amir Levy | c4222c9 | 2016-11-07 16:14:54 +0200 | [diff] [blame] | 5248 | |
| 5249 | /** |
Amir Levy | 3afd94a | 2017-01-05 10:19:13 +0200 | [diff] [blame] | 5250 | * ipa3_disable_prefetch() - disable\enable tx prefetch |
| 5251 | * |
| 5252 | * @client: the client which is related to the TX where prefetch will be |
| 5253 | * disabled |
| 5254 | * |
| 5255 | * Return value: Non applicable |
| 5256 | * |
| 5257 | */ |
| 5258 | void ipa3_disable_prefetch(enum ipa_client_type client) |
| 5259 | { |
| 5260 | struct ipahal_reg_tx_cfg cfg; |
| 5261 | u8 qmb; |
| 5262 | |
| 5263 | qmb = ipa3_get_qmb_master_sel(client); |
| 5264 | |
| 5265 | IPADBG("disabling prefetch for qmb %d\n", (int)qmb); |
| 5266 | |
| 5267 | ipahal_read_reg_fields(IPA_TX_CFG, &cfg); |
| 5268 | /* QMB0 (DDR) correlates with TX0, QMB1(PCIE) correlates with TX1 */ |
| 5269 | if (qmb == QMB_MASTER_SELECT_DDR) |
| 5270 | cfg.tx0_prefetch_disable = true; |
| 5271 | else |
| 5272 | cfg.tx1_prefetch_disable = true; |
| 5273 | ipahal_write_reg_fields(IPA_TX_CFG, &cfg); |
| 5274 | } |
| 5275 | |
| 5276 | /** |
Amir Levy | c4222c9 | 2016-11-07 16:14:54 +0200 | [diff] [blame] | 5277 | * ipa3_get_pdev() - return a pointer to IPA dev struct |
| 5278 | * |
| 5279 | * Return value: a pointer to IPA dev struct |
| 5280 | * |
| 5281 | */ |
| 5282 | struct device *ipa3_get_pdev(void) |
| 5283 | { |
| 5284 | if (!ipa3_ctx) |
| 5285 | return NULL; |
| 5286 | |
| 5287 | return ipa3_ctx->pdev; |
| 5288 | } |
Amir Levy | 12ef091 | 2016-08-30 09:27:34 +0300 | [diff] [blame] | 5289 | |
| 5290 | /** |
| 5291 | * ipa3_enable_dcd() - enable dynamic clock division on IPA |
| 5292 | * |
| 5293 | * Return value: Non applicable |
| 5294 | * |
| 5295 | */ |
| 5296 | void ipa3_enable_dcd(void) |
| 5297 | { |
| 5298 | struct ipahal_reg_idle_indication_cfg idle_indication_cfg; |
| 5299 | |
| 5300 | /* recommended values for IPA 3.5 according to IPA HPG */ |
| 5301 | idle_indication_cfg.const_non_idle_enable = 0; |
| 5302 | idle_indication_cfg.enter_idle_debounce_thresh = 256; |
| 5303 | |
| 5304 | ipahal_write_reg_fields(IPA_IDLE_INDICATION_CFG, |
| 5305 | &idle_indication_cfg); |
| 5306 | } |