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