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; |
| 1586 | clients->names[i++] = IPA_CLIENT_WLAN4_CONS; |
| 1587 | break; |
| 1588 | case IPA_RM_RESOURCE_MHI_CONS: |
| 1589 | clients->names[i++] = IPA_CLIENT_MHI_CONS; |
| 1590 | break; |
Skylar Chang | 79699ec | 2016-11-18 10:21:33 -0800 | [diff] [blame] | 1591 | case IPA_RM_RESOURCE_ODU_ADAPT_CONS: |
| 1592 | clients->names[i++] = IPA_CLIENT_ODU_EMB_CONS; |
| 1593 | clients->names[i++] = IPA_CLIENT_ODU_TETH_CONS; |
| 1594 | break; |
Sunil Paidimarri | 5139aa2 | 2017-02-13 11:07:32 -0800 | [diff] [blame] | 1595 | case IPA_RM_RESOURCE_ETHERNET_CONS: |
| 1596 | clients->names[i++] = IPA_CLIENT_ETHERNET_CONS; |
| 1597 | break; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1598 | case IPA_RM_RESOURCE_USB_PROD: |
| 1599 | clients->names[i++] = IPA_CLIENT_USB_PROD; |
| 1600 | break; |
| 1601 | case IPA_RM_RESOURCE_HSIC_PROD: |
| 1602 | clients->names[i++] = IPA_CLIENT_HSIC1_PROD; |
| 1603 | break; |
| 1604 | case IPA_RM_RESOURCE_MHI_PROD: |
| 1605 | clients->names[i++] = IPA_CLIENT_MHI_PROD; |
| 1606 | break; |
Skylar Chang | 79699ec | 2016-11-18 10:21:33 -0800 | [diff] [blame] | 1607 | case IPA_RM_RESOURCE_ODU_ADAPT_PROD: |
| 1608 | clients->names[i++] = IPA_CLIENT_ODU_PROD; |
Sunil Paidimarri | 5139aa2 | 2017-02-13 11:07:32 -0800 | [diff] [blame] | 1609 | break; |
| 1610 | case IPA_RM_RESOURCE_ETHERNET_PROD: |
| 1611 | clients->names[i++] = IPA_CLIENT_ETHERNET_PROD; |
| 1612 | break; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1613 | default: |
| 1614 | break; |
| 1615 | } |
| 1616 | clients->length = i; |
| 1617 | |
| 1618 | return 0; |
| 1619 | } |
| 1620 | |
| 1621 | /** |
| 1622 | * ipa3_should_pipe_be_suspended() - returns true when the client's pipe should |
| 1623 | * be suspended during a power save scenario. False otherwise. |
| 1624 | * |
| 1625 | * @client: [IN] IPA client |
| 1626 | */ |
| 1627 | bool ipa3_should_pipe_be_suspended(enum ipa_client_type client) |
| 1628 | { |
| 1629 | struct ipa3_ep_context *ep; |
| 1630 | int ipa_ep_idx; |
| 1631 | |
| 1632 | ipa_ep_idx = ipa3_get_ep_mapping(client); |
| 1633 | if (ipa_ep_idx == -1) { |
| 1634 | IPAERR("Invalid client.\n"); |
| 1635 | WARN_ON(1); |
| 1636 | return false; |
| 1637 | } |
| 1638 | |
| 1639 | ep = &ipa3_ctx->ep[ipa_ep_idx]; |
| 1640 | |
Skylar Chang | a699afd | 2017-06-06 10:06:21 -0700 | [diff] [blame] | 1641 | /* |
| 1642 | * starting IPA 4.0 pipe no longer can be suspended. Instead, |
| 1643 | * the corresponding GSI channel should be stopped. Usually client |
| 1644 | * driver will take care of stopping the channel. For client drivers |
| 1645 | * that are not stopping the channel, IPA RM will do that based on |
| 1646 | * ipa3_should_pipe_channel_be_stopped(). |
| 1647 | */ |
| 1648 | if (ipa3_ctx->ipa_hw_type >= IPA_HW_v4_0) |
| 1649 | return false; |
| 1650 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1651 | if (ep->keep_ipa_awake) |
| 1652 | return false; |
| 1653 | |
| 1654 | if (client == IPA_CLIENT_USB_CONS || |
| 1655 | client == IPA_CLIENT_USB_DPL_CONS || |
| 1656 | client == IPA_CLIENT_MHI_CONS || |
| 1657 | client == IPA_CLIENT_HSIC1_CONS || |
| 1658 | client == IPA_CLIENT_WLAN1_CONS || |
| 1659 | client == IPA_CLIENT_WLAN2_CONS || |
| 1660 | client == IPA_CLIENT_WLAN3_CONS || |
Skylar Chang | 79699ec | 2016-11-18 10:21:33 -0800 | [diff] [blame] | 1661 | client == IPA_CLIENT_WLAN4_CONS || |
| 1662 | client == IPA_CLIENT_ODU_EMB_CONS || |
Sunil Paidimarri | 5139aa2 | 2017-02-13 11:07:32 -0800 | [diff] [blame] | 1663 | client == IPA_CLIENT_ODU_TETH_CONS || |
| 1664 | client == IPA_CLIENT_ETHERNET_CONS) |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1665 | return true; |
| 1666 | |
| 1667 | return false; |
| 1668 | } |
| 1669 | |
| 1670 | /** |
Skylar Chang | a699afd | 2017-06-06 10:06:21 -0700 | [diff] [blame] | 1671 | * ipa3_should_pipe_channel_be_stopped() - returns true when the client's |
| 1672 | * channel should be stopped during a power save scenario. False otherwise. |
| 1673 | * Most client already stops the GSI channel on suspend, and are not included |
| 1674 | * in the list below. |
| 1675 | * |
| 1676 | * @client: [IN] IPA client |
| 1677 | */ |
| 1678 | static bool ipa3_should_pipe_channel_be_stopped(enum ipa_client_type client) |
| 1679 | { |
| 1680 | struct ipa3_ep_context *ep; |
| 1681 | int ipa_ep_idx; |
| 1682 | |
| 1683 | if (ipa3_ctx->ipa_hw_type < IPA_HW_v4_0) |
| 1684 | return false; |
| 1685 | |
| 1686 | ipa_ep_idx = ipa3_get_ep_mapping(client); |
| 1687 | if (ipa_ep_idx == -1) { |
| 1688 | IPAERR("Invalid client.\n"); |
| 1689 | WARN_ON(1); |
| 1690 | return false; |
| 1691 | } |
| 1692 | |
| 1693 | ep = &ipa3_ctx->ep[ipa_ep_idx]; |
| 1694 | |
| 1695 | if (ep->keep_ipa_awake) |
| 1696 | return false; |
| 1697 | |
| 1698 | if (client == IPA_CLIENT_ODU_EMB_CONS || |
| 1699 | client == IPA_CLIENT_ODU_TETH_CONS) |
| 1700 | return true; |
| 1701 | |
| 1702 | return false; |
| 1703 | } |
| 1704 | |
| 1705 | /** |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1706 | * ipa3_suspend_resource_sync() - suspend client endpoints related to the IPA_RM |
| 1707 | * resource and decrement active clients counter, which may result in clock |
| 1708 | * gating of IPA clocks. |
| 1709 | * |
| 1710 | * @resource: [IN] IPA Resource Manager resource |
| 1711 | * |
| 1712 | * Return codes: 0 on success, negative on failure. |
| 1713 | */ |
| 1714 | int ipa3_suspend_resource_sync(enum ipa_rm_resource_name resource) |
| 1715 | { |
| 1716 | struct ipa3_client_names clients; |
| 1717 | int res; |
| 1718 | int index; |
| 1719 | struct ipa_ep_cfg_ctrl suspend; |
| 1720 | enum ipa_client_type client; |
| 1721 | int ipa_ep_idx; |
| 1722 | bool pipe_suspended = false; |
| 1723 | |
| 1724 | memset(&clients, 0, sizeof(clients)); |
| 1725 | res = ipa3_get_clients_from_rm_resource(resource, &clients); |
| 1726 | if (res) { |
| 1727 | IPAERR("Bad params.\n"); |
| 1728 | return res; |
| 1729 | } |
| 1730 | |
| 1731 | for (index = 0; index < clients.length; index++) { |
| 1732 | client = clients.names[index]; |
| 1733 | ipa_ep_idx = ipa3_get_ep_mapping(client); |
| 1734 | if (ipa_ep_idx == -1) { |
| 1735 | IPAERR("Invalid client.\n"); |
| 1736 | res = -EINVAL; |
| 1737 | continue; |
| 1738 | } |
| 1739 | ipa3_ctx->resume_on_connect[client] = false; |
| 1740 | if (ipa3_ctx->ep[ipa_ep_idx].client == client && |
| 1741 | ipa3_should_pipe_be_suspended(client)) { |
| 1742 | if (ipa3_ctx->ep[ipa_ep_idx].valid) { |
| 1743 | /* suspend endpoint */ |
| 1744 | memset(&suspend, 0, sizeof(suspend)); |
| 1745 | suspend.ipa_ep_suspend = true; |
| 1746 | ipa3_cfg_ep_ctrl(ipa_ep_idx, &suspend); |
| 1747 | pipe_suspended = true; |
| 1748 | } |
| 1749 | } |
Skylar Chang | a699afd | 2017-06-06 10:06:21 -0700 | [diff] [blame] | 1750 | |
| 1751 | if (ipa3_ctx->ep[ipa_ep_idx].client == client && |
| 1752 | ipa3_should_pipe_channel_be_stopped(client)) { |
| 1753 | if (ipa3_ctx->ep[ipa_ep_idx].valid) { |
| 1754 | /* Stop GSI channel */ |
| 1755 | res = ipa3_stop_gsi_channel(ipa_ep_idx); |
| 1756 | if (res) { |
| 1757 | IPAERR("failed stop gsi ch %lu\n", |
| 1758 | ipa3_ctx->ep[ipa_ep_idx].gsi_chan_hdl); |
| 1759 | return res; |
| 1760 | } |
| 1761 | } |
| 1762 | } |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1763 | } |
| 1764 | /* Sleep ~1 msec */ |
| 1765 | if (pipe_suspended) |
| 1766 | usleep_range(1000, 2000); |
| 1767 | |
| 1768 | /* before gating IPA clocks do TAG process */ |
| 1769 | ipa3_ctx->tag_process_before_gating = true; |
| 1770 | IPA_ACTIVE_CLIENTS_DEC_RESOURCE(ipa_rm_resource_str(resource)); |
| 1771 | |
| 1772 | return 0; |
| 1773 | } |
| 1774 | |
| 1775 | /** |
| 1776 | * ipa3_suspend_resource_no_block() - suspend client endpoints related to the |
| 1777 | * IPA_RM resource and decrement active clients counter. This function is |
| 1778 | * guaranteed to avoid sleeping. |
| 1779 | * |
| 1780 | * @resource: [IN] IPA Resource Manager resource |
| 1781 | * |
| 1782 | * Return codes: 0 on success, negative on failure. |
| 1783 | */ |
| 1784 | int ipa3_suspend_resource_no_block(enum ipa_rm_resource_name resource) |
| 1785 | { |
| 1786 | int res; |
| 1787 | struct ipa3_client_names clients; |
| 1788 | int index; |
| 1789 | enum ipa_client_type client; |
| 1790 | struct ipa_ep_cfg_ctrl suspend; |
| 1791 | int ipa_ep_idx; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1792 | struct ipa_active_client_logging_info log_info; |
| 1793 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1794 | memset(&clients, 0, sizeof(clients)); |
| 1795 | res = ipa3_get_clients_from_rm_resource(resource, &clients); |
| 1796 | if (res) { |
| 1797 | IPAERR( |
| 1798 | "ipa3_get_clients_from_rm_resource() failed, name = %d.\n", |
| 1799 | resource); |
| 1800 | goto bail; |
| 1801 | } |
| 1802 | |
| 1803 | for (index = 0; index < clients.length; index++) { |
| 1804 | client = clients.names[index]; |
| 1805 | ipa_ep_idx = ipa3_get_ep_mapping(client); |
| 1806 | if (ipa_ep_idx == -1) { |
| 1807 | IPAERR("Invalid client.\n"); |
| 1808 | res = -EINVAL; |
| 1809 | continue; |
| 1810 | } |
| 1811 | ipa3_ctx->resume_on_connect[client] = false; |
| 1812 | if (ipa3_ctx->ep[ipa_ep_idx].client == client && |
| 1813 | ipa3_should_pipe_be_suspended(client)) { |
| 1814 | if (ipa3_ctx->ep[ipa_ep_idx].valid) { |
| 1815 | /* suspend endpoint */ |
| 1816 | memset(&suspend, 0, sizeof(suspend)); |
| 1817 | suspend.ipa_ep_suspend = true; |
| 1818 | ipa3_cfg_ep_ctrl(ipa_ep_idx, &suspend); |
| 1819 | } |
| 1820 | } |
Skylar Chang | a699afd | 2017-06-06 10:06:21 -0700 | [diff] [blame] | 1821 | |
| 1822 | if (ipa3_ctx->ep[ipa_ep_idx].client == client && |
| 1823 | ipa3_should_pipe_channel_be_stopped(client)) { |
| 1824 | res = -EPERM; |
| 1825 | goto bail; |
| 1826 | } |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1827 | } |
| 1828 | |
| 1829 | if (res == 0) { |
| 1830 | IPA_ACTIVE_CLIENTS_PREP_RESOURCE(log_info, |
| 1831 | ipa_rm_resource_str(resource)); |
Skylar Chang | 242952b | 2017-07-20 15:04:05 -0700 | [diff] [blame] | 1832 | /* before gating IPA clocks do TAG process */ |
| 1833 | ipa3_ctx->tag_process_before_gating = true; |
| 1834 | ipa3_dec_client_disable_clks_no_block(&log_info); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1835 | } |
| 1836 | bail: |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1837 | return res; |
| 1838 | } |
| 1839 | |
| 1840 | /** |
| 1841 | * ipa3_resume_resource() - resume client endpoints related to the IPA_RM |
| 1842 | * resource. |
| 1843 | * |
| 1844 | * @resource: [IN] IPA Resource Manager resource |
| 1845 | * |
| 1846 | * Return codes: 0 on success, negative on failure. |
| 1847 | */ |
| 1848 | int ipa3_resume_resource(enum ipa_rm_resource_name resource) |
| 1849 | { |
| 1850 | |
| 1851 | struct ipa3_client_names clients; |
| 1852 | int res; |
| 1853 | int index; |
| 1854 | struct ipa_ep_cfg_ctrl suspend; |
| 1855 | enum ipa_client_type client; |
| 1856 | int ipa_ep_idx; |
| 1857 | |
| 1858 | memset(&clients, 0, sizeof(clients)); |
| 1859 | res = ipa3_get_clients_from_rm_resource(resource, &clients); |
| 1860 | if (res) { |
| 1861 | IPAERR("ipa3_get_clients_from_rm_resource() failed.\n"); |
| 1862 | return res; |
| 1863 | } |
| 1864 | |
| 1865 | for (index = 0; index < clients.length; index++) { |
| 1866 | client = clients.names[index]; |
| 1867 | ipa_ep_idx = ipa3_get_ep_mapping(client); |
| 1868 | if (ipa_ep_idx == -1) { |
| 1869 | IPAERR("Invalid client.\n"); |
| 1870 | res = -EINVAL; |
| 1871 | continue; |
| 1872 | } |
| 1873 | /* |
| 1874 | * The related ep, will be resumed on connect |
| 1875 | * while its resource is granted |
| 1876 | */ |
| 1877 | ipa3_ctx->resume_on_connect[client] = true; |
| 1878 | IPADBG("%d will be resumed on connect.\n", client); |
| 1879 | if (ipa3_ctx->ep[ipa_ep_idx].client == client && |
| 1880 | ipa3_should_pipe_be_suspended(client)) { |
| 1881 | if (ipa3_ctx->ep[ipa_ep_idx].valid) { |
| 1882 | memset(&suspend, 0, sizeof(suspend)); |
| 1883 | suspend.ipa_ep_suspend = false; |
| 1884 | ipa3_cfg_ep_ctrl(ipa_ep_idx, &suspend); |
| 1885 | } |
| 1886 | } |
Skylar Chang | a699afd | 2017-06-06 10:06:21 -0700 | [diff] [blame] | 1887 | |
| 1888 | if (ipa3_ctx->ep[ipa_ep_idx].client == client && |
| 1889 | ipa3_should_pipe_channel_be_stopped(client)) { |
| 1890 | if (ipa3_ctx->ep[ipa_ep_idx].valid) { |
| 1891 | res = gsi_start_channel( |
| 1892 | ipa3_ctx->ep[ipa_ep_idx].gsi_chan_hdl); |
| 1893 | if (res) { |
| 1894 | IPAERR("failed to start gsi ch %lu\n", |
| 1895 | ipa3_ctx->ep[ipa_ep_idx].gsi_chan_hdl); |
| 1896 | return res; |
| 1897 | } |
| 1898 | } |
| 1899 | } |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1900 | } |
| 1901 | |
| 1902 | return res; |
| 1903 | } |
| 1904 | |
| 1905 | /** |
| 1906 | * _ipa_sram_settings_read_v3_0() - Read SRAM settings from HW |
| 1907 | * |
| 1908 | * Returns: None |
| 1909 | */ |
| 1910 | void _ipa_sram_settings_read_v3_0(void) |
| 1911 | { |
| 1912 | struct ipahal_reg_shared_mem_size smem_sz; |
| 1913 | |
| 1914 | memset(&smem_sz, 0, sizeof(smem_sz)); |
| 1915 | |
| 1916 | ipahal_read_reg_fields(IPA_SHARED_MEM_SIZE, &smem_sz); |
| 1917 | |
| 1918 | ipa3_ctx->smem_restricted_bytes = smem_sz.shared_mem_baddr; |
| 1919 | ipa3_ctx->smem_sz = smem_sz.shared_mem_sz; |
| 1920 | |
| 1921 | /* reg fields are in 8B units */ |
| 1922 | ipa3_ctx->smem_restricted_bytes *= 8; |
| 1923 | ipa3_ctx->smem_sz *= 8; |
| 1924 | ipa3_ctx->smem_reqd_sz = IPA_MEM_PART(end_ofst); |
| 1925 | ipa3_ctx->hdr_tbl_lcl = 0; |
| 1926 | ipa3_ctx->hdr_proc_ctx_tbl_lcl = 1; |
| 1927 | |
| 1928 | /* |
| 1929 | * when proc ctx table is located in internal memory, |
| 1930 | * modem entries resides first. |
| 1931 | */ |
| 1932 | if (ipa3_ctx->hdr_proc_ctx_tbl_lcl) { |
| 1933 | ipa3_ctx->hdr_proc_ctx_tbl.start_offset = |
| 1934 | IPA_MEM_PART(modem_hdr_proc_ctx_size); |
| 1935 | } |
| 1936 | ipa3_ctx->ip4_rt_tbl_hash_lcl = 0; |
| 1937 | ipa3_ctx->ip4_rt_tbl_nhash_lcl = 0; |
| 1938 | ipa3_ctx->ip6_rt_tbl_hash_lcl = 0; |
| 1939 | ipa3_ctx->ip6_rt_tbl_nhash_lcl = 0; |
| 1940 | ipa3_ctx->ip4_flt_tbl_hash_lcl = 0; |
| 1941 | ipa3_ctx->ip4_flt_tbl_nhash_lcl = 0; |
| 1942 | ipa3_ctx->ip6_flt_tbl_hash_lcl = 0; |
| 1943 | ipa3_ctx->ip6_flt_tbl_nhash_lcl = 0; |
| 1944 | } |
| 1945 | |
| 1946 | /** |
| 1947 | * ipa3_cfg_route() - configure IPA route |
| 1948 | * @route: IPA route |
| 1949 | * |
| 1950 | * Return codes: |
| 1951 | * 0: success |
| 1952 | */ |
| 1953 | int ipa3_cfg_route(struct ipahal_reg_route *route) |
| 1954 | { |
| 1955 | |
| 1956 | IPADBG("disable_route_block=%d, default_pipe=%d, default_hdr_tbl=%d\n", |
| 1957 | route->route_dis, |
| 1958 | route->route_def_pipe, |
| 1959 | route->route_def_hdr_table); |
| 1960 | IPADBG("default_hdr_ofst=%d, default_frag_pipe=%d\n", |
| 1961 | route->route_def_hdr_ofst, |
| 1962 | route->route_frag_def_pipe); |
| 1963 | |
| 1964 | IPADBG("default_retain_hdr=%d\n", |
| 1965 | route->route_def_retain_hdr); |
| 1966 | |
| 1967 | if (route->route_dis) { |
| 1968 | IPAERR("Route disable is not supported!\n"); |
| 1969 | return -EPERM; |
| 1970 | } |
| 1971 | |
| 1972 | IPA_ACTIVE_CLIENTS_INC_SIMPLE(); |
| 1973 | |
| 1974 | ipahal_write_reg_fields(IPA_ROUTE, route); |
| 1975 | |
| 1976 | IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); |
| 1977 | |
| 1978 | return 0; |
| 1979 | } |
| 1980 | |
| 1981 | /** |
| 1982 | * ipa3_cfg_filter() - configure filter |
| 1983 | * @disable: disable value |
| 1984 | * |
| 1985 | * Return codes: |
| 1986 | * 0: success |
| 1987 | */ |
| 1988 | int ipa3_cfg_filter(u32 disable) |
| 1989 | { |
Utkarsh Saxena | e978281 | 2017-05-26 17:20:32 +0530 | [diff] [blame] | 1990 | IPAERR_RL("Filter disable is not supported!\n"); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 1991 | return -EPERM; |
| 1992 | } |
| 1993 | |
| 1994 | /** |
| 1995 | * ipa3_cfg_qsb() - Configure IPA QSB maximal reads and writes |
| 1996 | * |
| 1997 | * Returns: None |
| 1998 | */ |
| 1999 | void ipa3_cfg_qsb(void) |
| 2000 | { |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 2001 | struct ipahal_reg_qsb_max_reads max_reads = { 0 }; |
| 2002 | struct ipahal_reg_qsb_max_writes max_writes = { 0 }; |
| 2003 | |
| 2004 | max_reads.qmb_0_max_reads = 8, |
| 2005 | max_reads.qmb_1_max_reads = 8, |
| 2006 | |
| 2007 | max_writes.qmb_0_max_writes = 8; |
| 2008 | max_writes.qmb_1_max_writes = 2; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2009 | |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 2010 | if (ipa3_ctx->ipa_hw_type >= IPA_HW_v3_5) { |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 2011 | max_writes.qmb_1_max_writes = 4; |
| 2012 | max_reads.qmb_1_max_reads = 12; |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 2013 | } |
| 2014 | |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 2015 | ipahal_write_reg_fields(IPA_QSB_MAX_WRITES, &max_writes); |
| 2016 | ipahal_write_reg_fields(IPA_QSB_MAX_READS, &max_reads); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2017 | } |
| 2018 | |
| 2019 | /** |
| 2020 | * ipa3_init_hw() - initialize HW |
| 2021 | * |
| 2022 | * Return codes: |
| 2023 | * 0: success |
| 2024 | */ |
| 2025 | int ipa3_init_hw(void) |
| 2026 | { |
| 2027 | u32 ipa_version = 0; |
| 2028 | u32 val; |
| 2029 | |
| 2030 | /* Read IPA version and make sure we have access to the registers */ |
| 2031 | ipa_version = ipahal_read_reg(IPA_VERSION); |
| 2032 | if (ipa_version == 0) |
| 2033 | return -EFAULT; |
| 2034 | |
| 2035 | switch (ipa3_ctx->ipa_hw_type) { |
| 2036 | case IPA_HW_v3_0: |
| 2037 | case IPA_HW_v3_1: |
| 2038 | val = IPA_BCR_REG_VAL_v3_0; |
| 2039 | break; |
| 2040 | case IPA_HW_v3_5: |
| 2041 | case IPA_HW_v3_5_1: |
| 2042 | val = IPA_BCR_REG_VAL_v3_5; |
| 2043 | break; |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 2044 | case IPA_HW_v4_0: |
| 2045 | val = IPA_BCR_REG_VAL_v4_0; |
| 2046 | break; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2047 | default: |
| 2048 | IPAERR("unknown HW type in dts\n"); |
| 2049 | return -EFAULT; |
| 2050 | } |
| 2051 | |
| 2052 | ipahal_write_reg(IPA_BCR, val); |
| 2053 | |
Skylar Chang | f077287 | 2017-07-06 16:11:01 -0700 | [diff] [blame] | 2054 | if (ipa3_ctx->ipa_hw_type >= IPA_HW_v4_0) { |
| 2055 | struct ipahal_reg_tx_cfg cfg; |
| 2056 | |
Michael Adisumarta | d68ab11 | 2017-06-14 11:40:06 -0700 | [diff] [blame] | 2057 | ipahal_write_reg(IPA_CLKON_CFG, IPA_CLKON_CFG_v4_0); |
Skylar Chang | f077287 | 2017-07-06 16:11:01 -0700 | [diff] [blame] | 2058 | ipahal_read_reg_fields(IPA_TX_CFG, &cfg); |
| 2059 | /* disable PA_MASK_EN to allow holb drop */ |
| 2060 | cfg.pa_mask_en = 0; |
| 2061 | ipahal_write_reg_fields(IPA_TX_CFG, &cfg); |
| 2062 | } |
Michael Adisumarta | d68ab11 | 2017-06-14 11:40:06 -0700 | [diff] [blame] | 2063 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2064 | ipa3_cfg_qsb(); |
| 2065 | |
| 2066 | return 0; |
| 2067 | } |
| 2068 | |
| 2069 | /** |
| 2070 | * 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] | 2071 | * for ep\resource groups related arrays . |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2072 | * |
| 2073 | * Return value: HW type index |
| 2074 | */ |
| 2075 | u8 ipa3_get_hw_type_index(void) |
| 2076 | { |
| 2077 | u8 hw_type_index; |
| 2078 | |
| 2079 | switch (ipa3_ctx->ipa_hw_type) { |
| 2080 | case IPA_HW_v3_0: |
| 2081 | case IPA_HW_v3_1: |
| 2082 | hw_type_index = IPA_3_0; |
| 2083 | break; |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 2084 | case IPA_HW_v3_5: |
| 2085 | hw_type_index = IPA_3_5; |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 2086 | /* |
| 2087 | *this flag is initialized only after fw load trigger from |
| 2088 | * user space (ipa3_write) |
| 2089 | */ |
| 2090 | if (ipa3_ctx->ipa_config_is_mhi) |
| 2091 | hw_type_index = IPA_3_5_MHI; |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 2092 | break; |
| 2093 | case IPA_HW_v3_5_1: |
| 2094 | hw_type_index = IPA_3_5_1; |
| 2095 | break; |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 2096 | case IPA_HW_v4_0: |
| 2097 | hw_type_index = IPA_4_0; |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 2098 | /* |
| 2099 | *this flag is initialized only after fw load trigger from |
| 2100 | * user space (ipa3_write) |
| 2101 | */ |
| 2102 | if (ipa3_ctx->ipa_config_is_mhi) |
| 2103 | hw_type_index = IPA_4_0_MHI; |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 2104 | break; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2105 | default: |
| 2106 | IPAERR("Incorrect IPA version %d\n", ipa3_ctx->ipa_hw_type); |
| 2107 | hw_type_index = IPA_3_0; |
| 2108 | break; |
| 2109 | } |
| 2110 | |
| 2111 | return hw_type_index; |
| 2112 | } |
| 2113 | |
| 2114 | /** |
| 2115 | * ipa3_get_ep_mapping() - provide endpoint mapping |
| 2116 | * @client: client type |
| 2117 | * |
| 2118 | * Return value: endpoint mapping |
| 2119 | */ |
| 2120 | int ipa3_get_ep_mapping(enum ipa_client_type client) |
| 2121 | { |
Skylar Chang | 652ee8e | 2017-02-10 11:40:30 -0800 | [diff] [blame] | 2122 | int ipa_ep_idx; |
| 2123 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2124 | if (client >= IPA_CLIENT_MAX || client < 0) { |
Utkarsh Saxena | e978281 | 2017-05-26 17:20:32 +0530 | [diff] [blame] | 2125 | IPAERR_RL("Bad client number! client =%d\n", client); |
Ghanim Fodi | 79ee8d8 | 2017-02-27 16:39:25 +0200 | [diff] [blame] | 2126 | return IPA_EP_NOT_ALLOCATED; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2127 | } |
| 2128 | |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 2129 | if (!ipa3_ep_mapping[ipa3_get_hw_type_index()][client].valid) |
| 2130 | return IPA_EP_NOT_ALLOCATED; |
| 2131 | |
| 2132 | ipa_ep_idx = ipa3_ep_mapping[ipa3_get_hw_type_index()][client]. |
| 2133 | ipa_gsi_ep_info.ipa_ep_num; |
Skylar Chang | 7fa2271 | 2017-04-03 18:29:21 -0700 | [diff] [blame] | 2134 | if (ipa_ep_idx < 0 || (ipa_ep_idx >= IPA3_MAX_NUM_PIPES |
| 2135 | && client != IPA_CLIENT_DUMMY_CONS)) |
Skylar Chang | 652ee8e | 2017-02-10 11:40:30 -0800 | [diff] [blame] | 2136 | return IPA_EP_NOT_ALLOCATED; |
| 2137 | |
| 2138 | return ipa_ep_idx; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2139 | } |
| 2140 | |
| 2141 | /** |
| 2142 | * ipa3_get_gsi_ep_info() - provide gsi ep information |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 2143 | * @client: IPA client value |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2144 | * |
| 2145 | * Return value: pointer to ipa_gsi_ep_info |
| 2146 | */ |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 2147 | const struct ipa_gsi_ep_config *ipa3_get_gsi_ep_info |
| 2148 | (enum ipa_client_type client) |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2149 | { |
Skylar Chang | c1f1531 | 2017-05-09 14:14:32 -0700 | [diff] [blame] | 2150 | int ep_idx; |
| 2151 | |
| 2152 | ep_idx = ipa3_get_ep_mapping(client); |
| 2153 | if (ep_idx == IPA_EP_NOT_ALLOCATED) |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 2154 | return NULL; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2155 | |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 2156 | if (!ipa3_ep_mapping[ipa3_get_hw_type_index()][client].valid) |
| 2157 | return NULL; |
| 2158 | |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 2159 | return &(ipa3_ep_mapping[ipa3_get_hw_type_index()] |
| 2160 | [client].ipa_gsi_ep_info); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2161 | } |
| 2162 | |
| 2163 | /** |
| 2164 | * ipa_get_ep_group() - provide endpoint group by client |
| 2165 | * @client: client type |
| 2166 | * |
| 2167 | * Return value: endpoint group |
| 2168 | */ |
| 2169 | int ipa_get_ep_group(enum ipa_client_type client) |
| 2170 | { |
| 2171 | if (client >= IPA_CLIENT_MAX || client < 0) { |
| 2172 | IPAERR("Bad client number! client =%d\n", client); |
| 2173 | return -EINVAL; |
| 2174 | } |
| 2175 | |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 2176 | if (!ipa3_ep_mapping[ipa3_get_hw_type_index()][client].valid) |
| 2177 | return -EINVAL; |
| 2178 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2179 | return ipa3_ep_mapping[ipa3_get_hw_type_index()][client].group_num; |
| 2180 | } |
| 2181 | |
| 2182 | /** |
| 2183 | * ipa3_get_qmb_master_sel() - provide QMB master selection for the client |
| 2184 | * @client: client type |
| 2185 | * |
| 2186 | * Return value: QMB master index |
| 2187 | */ |
| 2188 | u8 ipa3_get_qmb_master_sel(enum ipa_client_type client) |
| 2189 | { |
| 2190 | if (client >= IPA_CLIENT_MAX || client < 0) { |
| 2191 | IPAERR("Bad client number! client =%d\n", client); |
| 2192 | return -EINVAL; |
| 2193 | } |
| 2194 | |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 2195 | if (!ipa3_ep_mapping[ipa3_get_hw_type_index()][client].valid) |
| 2196 | return -EINVAL; |
| 2197 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2198 | return ipa3_ep_mapping[ipa3_get_hw_type_index()] |
| 2199 | [client].qmb_master_sel; |
| 2200 | } |
| 2201 | |
| 2202 | /* ipa3_set_client() - provide client mapping |
| 2203 | * @client: client type |
| 2204 | * |
| 2205 | * Return value: none |
| 2206 | */ |
| 2207 | |
| 2208 | void ipa3_set_client(int index, enum ipacm_client_enum client, bool uplink) |
| 2209 | { |
Skylar Chang | 09e0e25 | 2017-03-20 14:51:29 -0700 | [diff] [blame] | 2210 | if (client > IPACM_CLIENT_MAX || client < IPACM_CLIENT_USB) { |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2211 | IPAERR("Bad client number! client =%d\n", client); |
| 2212 | } else if (index >= IPA3_MAX_NUM_PIPES || index < 0) { |
| 2213 | IPAERR("Bad pipe index! index =%d\n", index); |
| 2214 | } else { |
| 2215 | ipa3_ctx->ipacm_client[index].client_enum = client; |
| 2216 | ipa3_ctx->ipacm_client[index].uplink = uplink; |
| 2217 | } |
| 2218 | } |
| 2219 | |
Skylar Chang | 6b41f8d | 2016-11-01 12:50:11 -0700 | [diff] [blame] | 2220 | /* ipa3_get_wlan_stats() - get ipa wifi stats |
| 2221 | * |
| 2222 | * Return value: success or failure |
| 2223 | */ |
| 2224 | int ipa3_get_wlan_stats(struct ipa_get_wdi_sap_stats *wdi_sap_stats) |
| 2225 | { |
| 2226 | if (ipa3_ctx->uc_wdi_ctx.stats_notify) { |
| 2227 | ipa3_ctx->uc_wdi_ctx.stats_notify(IPA_GET_WDI_SAP_STATS, |
| 2228 | wdi_sap_stats); |
| 2229 | } else { |
| 2230 | IPAERR("uc_wdi_ctx.stats_notify NULL\n"); |
| 2231 | return -EFAULT; |
| 2232 | } |
| 2233 | return 0; |
| 2234 | } |
| 2235 | |
| 2236 | int ipa3_set_wlan_quota(struct ipa_set_wifi_quota *wdi_quota) |
| 2237 | { |
| 2238 | if (ipa3_ctx->uc_wdi_ctx.stats_notify) { |
| 2239 | ipa3_ctx->uc_wdi_ctx.stats_notify(IPA_SET_WIFI_QUOTA, |
| 2240 | wdi_quota); |
| 2241 | } else { |
| 2242 | IPAERR("uc_wdi_ctx.stats_notify NULL\n"); |
| 2243 | return -EFAULT; |
| 2244 | } |
| 2245 | return 0; |
| 2246 | } |
| 2247 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2248 | /** |
| 2249 | * ipa3_get_client() - provide client mapping |
| 2250 | * @client: client type |
| 2251 | * |
Skylar Chang | 6b41f8d | 2016-11-01 12:50:11 -0700 | [diff] [blame] | 2252 | * Return value: client mapping enum |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2253 | */ |
| 2254 | enum ipacm_client_enum ipa3_get_client(int pipe_idx) |
| 2255 | { |
| 2256 | if (pipe_idx >= IPA3_MAX_NUM_PIPES || pipe_idx < 0) { |
| 2257 | IPAERR("Bad pipe index! pipe_idx =%d\n", pipe_idx); |
| 2258 | return IPACM_CLIENT_MAX; |
| 2259 | } else { |
| 2260 | return ipa3_ctx->ipacm_client[pipe_idx].client_enum; |
| 2261 | } |
| 2262 | } |
| 2263 | |
| 2264 | /** |
| 2265 | * ipa2_get_client_uplink() - provide client mapping |
| 2266 | * @client: client type |
| 2267 | * |
| 2268 | * Return value: none |
| 2269 | */ |
| 2270 | bool ipa3_get_client_uplink(int pipe_idx) |
| 2271 | { |
Skylar Chang | 53f855e | 2017-06-12 10:50:12 -0700 | [diff] [blame] | 2272 | if (pipe_idx < 0 || pipe_idx >= IPA3_MAX_NUM_PIPES) { |
| 2273 | IPAERR("invalid pipe idx %d\n", pipe_idx); |
| 2274 | return false; |
| 2275 | } |
| 2276 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2277 | return ipa3_ctx->ipacm_client[pipe_idx].uplink; |
| 2278 | } |
| 2279 | |
| 2280 | /** |
| 2281 | * ipa3_get_rm_resource_from_ep() - get the IPA_RM resource which is related to |
| 2282 | * the supplied pipe index. |
| 2283 | * |
| 2284 | * @pipe_idx: |
| 2285 | * |
| 2286 | * Return value: IPA_RM resource related to the pipe, -1 if a resource was not |
| 2287 | * found. |
| 2288 | */ |
| 2289 | enum ipa_rm_resource_name ipa3_get_rm_resource_from_ep(int pipe_idx) |
| 2290 | { |
| 2291 | int i; |
| 2292 | int j; |
| 2293 | enum ipa_client_type client; |
| 2294 | struct ipa3_client_names clients; |
| 2295 | bool found = false; |
| 2296 | |
| 2297 | if (pipe_idx >= ipa3_ctx->ipa_num_pipes || pipe_idx < 0) { |
| 2298 | IPAERR("Bad pipe index!\n"); |
| 2299 | return -EINVAL; |
| 2300 | } |
| 2301 | |
| 2302 | client = ipa3_ctx->ep[pipe_idx].client; |
| 2303 | |
| 2304 | for (i = 0; i < IPA_RM_RESOURCE_MAX; i++) { |
| 2305 | memset(&clients, 0, sizeof(clients)); |
| 2306 | ipa3_get_clients_from_rm_resource(i, &clients); |
| 2307 | for (j = 0; j < clients.length; j++) { |
| 2308 | if (clients.names[j] == client) { |
| 2309 | found = true; |
| 2310 | break; |
| 2311 | } |
| 2312 | } |
| 2313 | if (found) |
| 2314 | break; |
| 2315 | } |
| 2316 | |
| 2317 | if (!found) |
| 2318 | return -EFAULT; |
| 2319 | |
| 2320 | return i; |
| 2321 | } |
| 2322 | |
| 2323 | /** |
| 2324 | * ipa3_get_client_mapping() - provide client mapping |
| 2325 | * @pipe_idx: IPA end-point number |
| 2326 | * |
| 2327 | * Return value: client mapping |
| 2328 | */ |
| 2329 | enum ipa_client_type ipa3_get_client_mapping(int pipe_idx) |
| 2330 | { |
| 2331 | if (pipe_idx >= ipa3_ctx->ipa_num_pipes || pipe_idx < 0) { |
| 2332 | IPAERR("Bad pipe index!\n"); |
| 2333 | return -EINVAL; |
| 2334 | } |
| 2335 | |
| 2336 | return ipa3_ctx->ep[pipe_idx].client; |
| 2337 | } |
| 2338 | |
| 2339 | /** |
| 2340 | * ipa_init_ep_flt_bitmap() - Initialize the bitmap |
| 2341 | * that represents the End-points that supports filtering |
| 2342 | */ |
| 2343 | void ipa_init_ep_flt_bitmap(void) |
| 2344 | { |
| 2345 | enum ipa_client_type cl; |
| 2346 | u8 hw_type_idx = ipa3_get_hw_type_index(); |
| 2347 | u32 bitmap; |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 2348 | u32 pipe_num; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2349 | |
| 2350 | bitmap = 0; |
| 2351 | |
| 2352 | BUG_ON(ipa3_ctx->ep_flt_bitmap); |
| 2353 | |
| 2354 | for (cl = 0; cl < IPA_CLIENT_MAX ; cl++) { |
| 2355 | if (ipa3_ep_mapping[hw_type_idx][cl].support_flt) { |
Skylar Chang | a951658 | 2017-05-09 11:36:47 -0700 | [diff] [blame] | 2356 | pipe_num = ipa3_ep_mapping[hw_type_idx][cl]. |
| 2357 | ipa_gsi_ep_info.ipa_ep_num; |
| 2358 | bitmap |= (1U << pipe_num); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2359 | if (bitmap != ipa3_ctx->ep_flt_bitmap) { |
| 2360 | ipa3_ctx->ep_flt_bitmap = bitmap; |
| 2361 | ipa3_ctx->ep_flt_num++; |
| 2362 | } |
| 2363 | } |
| 2364 | } |
| 2365 | } |
| 2366 | |
| 2367 | /** |
| 2368 | * ipa_is_ep_support_flt() - Given an End-point check |
| 2369 | * whether it supports filtering or not. |
| 2370 | * |
| 2371 | * @pipe_idx: |
| 2372 | * |
| 2373 | * Return values: |
| 2374 | * true if supports and false if not |
| 2375 | */ |
| 2376 | bool ipa_is_ep_support_flt(int pipe_idx) |
| 2377 | { |
| 2378 | if (pipe_idx >= ipa3_ctx->ipa_num_pipes || pipe_idx < 0) { |
| 2379 | IPAERR("Bad pipe index!\n"); |
| 2380 | return false; |
| 2381 | } |
| 2382 | |
| 2383 | return ipa3_ctx->ep_flt_bitmap & (1U<<pipe_idx); |
| 2384 | } |
| 2385 | |
| 2386 | /** |
| 2387 | * ipa3_cfg_ep_seq() - IPA end-point HPS/DPS sequencer type configuration |
| 2388 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 2389 | * |
| 2390 | * Returns: 0 on success, negative on failure |
| 2391 | * |
| 2392 | * Note: Should not be called from atomic context |
| 2393 | */ |
| 2394 | int ipa3_cfg_ep_seq(u32 clnt_hdl, const struct ipa_ep_cfg_seq *seq_cfg) |
| 2395 | { |
| 2396 | int type; |
| 2397 | |
| 2398 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 2399 | ipa3_ctx->ep[clnt_hdl].valid == 0) { |
| 2400 | IPAERR("bad param, clnt_hdl = %d", clnt_hdl); |
| 2401 | return -EINVAL; |
| 2402 | } |
| 2403 | |
| 2404 | if (IPA_CLIENT_IS_CONS(ipa3_ctx->ep[clnt_hdl].client)) { |
| 2405 | IPAERR("SEQ does not apply to IPA consumer EP %d\n", clnt_hdl); |
| 2406 | return -EINVAL; |
| 2407 | } |
| 2408 | |
| 2409 | /* |
| 2410 | * Skip Configure sequencers type for test clients. |
| 2411 | * These are configured dynamically in ipa3_cfg_ep_mode |
| 2412 | */ |
| 2413 | if (IPA_CLIENT_IS_TEST(ipa3_ctx->ep[clnt_hdl].client)) { |
| 2414 | IPADBG("Skip sequencers configuration for test clients\n"); |
| 2415 | return 0; |
| 2416 | } |
| 2417 | |
| 2418 | if (seq_cfg->set_dynamic) |
| 2419 | type = seq_cfg->seq_type; |
| 2420 | else |
| 2421 | type = ipa3_ep_mapping[ipa3_get_hw_type_index()] |
| 2422 | [ipa3_ctx->ep[clnt_hdl].client].sequencer_type; |
| 2423 | |
| 2424 | if (type != IPA_DPS_HPS_SEQ_TYPE_INVALID) { |
| 2425 | if (ipa3_ctx->ep[clnt_hdl].cfg.mode.mode == IPA_DMA && |
| 2426 | !IPA_DPS_HPS_SEQ_TYPE_IS_DMA(type)) { |
| 2427 | IPAERR("Configuring non-DMA SEQ type to DMA pipe\n"); |
| 2428 | BUG(); |
| 2429 | } |
| 2430 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2431 | /* Configure sequencers type*/ |
| 2432 | |
| 2433 | IPADBG("set sequencers to sequence 0x%x, ep = %d\n", type, |
| 2434 | clnt_hdl); |
| 2435 | ipahal_write_reg_n(IPA_ENDP_INIT_SEQ_n, clnt_hdl, type); |
| 2436 | |
| 2437 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2438 | } else { |
| 2439 | IPADBG("should not set sequencer type of ep = %d\n", clnt_hdl); |
| 2440 | } |
| 2441 | |
| 2442 | return 0; |
| 2443 | } |
| 2444 | |
| 2445 | /** |
| 2446 | * ipa3_cfg_ep - IPA end-point configuration |
| 2447 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 2448 | * @ipa_ep_cfg: [in] IPA end-point configuration params |
| 2449 | * |
Amir Levy | dc65f4c | 2017-07-06 09:49:50 +0300 | [diff] [blame] | 2450 | * This includes nat, IPv6CT, header, mode, aggregation and route settings and |
| 2451 | * is a one shot API to configure the IPA end-point fully |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2452 | * |
| 2453 | * Returns: 0 on success, negative on failure |
| 2454 | * |
| 2455 | * Note: Should not be called from atomic context |
| 2456 | */ |
| 2457 | int ipa3_cfg_ep(u32 clnt_hdl, const struct ipa_ep_cfg *ipa_ep_cfg) |
| 2458 | { |
| 2459 | int result = -EINVAL; |
| 2460 | |
| 2461 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 2462 | ipa3_ctx->ep[clnt_hdl].valid == 0 || ipa_ep_cfg == NULL) { |
| 2463 | IPAERR("bad parm.\n"); |
| 2464 | return -EINVAL; |
| 2465 | } |
| 2466 | |
| 2467 | result = ipa3_cfg_ep_hdr(clnt_hdl, &ipa_ep_cfg->hdr); |
| 2468 | if (result) |
| 2469 | return result; |
| 2470 | |
| 2471 | result = ipa3_cfg_ep_hdr_ext(clnt_hdl, &ipa_ep_cfg->hdr_ext); |
| 2472 | if (result) |
| 2473 | return result; |
| 2474 | |
| 2475 | result = ipa3_cfg_ep_aggr(clnt_hdl, &ipa_ep_cfg->aggr); |
| 2476 | if (result) |
| 2477 | return result; |
| 2478 | |
| 2479 | result = ipa3_cfg_ep_cfg(clnt_hdl, &ipa_ep_cfg->cfg); |
| 2480 | if (result) |
| 2481 | return result; |
| 2482 | |
| 2483 | if (IPA_CLIENT_IS_PROD(ipa3_ctx->ep[clnt_hdl].client)) { |
| 2484 | result = ipa3_cfg_ep_nat(clnt_hdl, &ipa_ep_cfg->nat); |
| 2485 | if (result) |
| 2486 | return result; |
| 2487 | |
Amir Levy | dc65f4c | 2017-07-06 09:49:50 +0300 | [diff] [blame] | 2488 | if (ipa3_ctx->ipa_hw_type >= IPA_HW_v4_0) { |
| 2489 | result = ipa3_cfg_ep_conn_track(clnt_hdl, |
| 2490 | &ipa_ep_cfg->conn_track); |
| 2491 | if (result) |
| 2492 | return result; |
| 2493 | } |
| 2494 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2495 | result = ipa3_cfg_ep_mode(clnt_hdl, &ipa_ep_cfg->mode); |
| 2496 | if (result) |
| 2497 | return result; |
| 2498 | |
| 2499 | result = ipa3_cfg_ep_seq(clnt_hdl, &ipa_ep_cfg->seq); |
| 2500 | if (result) |
| 2501 | return result; |
| 2502 | |
| 2503 | result = ipa3_cfg_ep_route(clnt_hdl, &ipa_ep_cfg->route); |
| 2504 | if (result) |
| 2505 | return result; |
| 2506 | |
| 2507 | result = ipa3_cfg_ep_deaggr(clnt_hdl, &ipa_ep_cfg->deaggr); |
| 2508 | if (result) |
| 2509 | return result; |
| 2510 | } else { |
| 2511 | result = ipa3_cfg_ep_metadata_mask(clnt_hdl, |
| 2512 | &ipa_ep_cfg->metadata_mask); |
| 2513 | if (result) |
| 2514 | return result; |
| 2515 | } |
| 2516 | |
| 2517 | return 0; |
| 2518 | } |
| 2519 | |
Amir Levy | dc65f4c | 2017-07-06 09:49:50 +0300 | [diff] [blame] | 2520 | 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] | 2521 | { |
| 2522 | switch (nat_en) { |
| 2523 | case (IPA_BYPASS_NAT): |
| 2524 | return "NAT disabled"; |
| 2525 | case (IPA_SRC_NAT): |
| 2526 | return "Source NAT"; |
| 2527 | case (IPA_DST_NAT): |
| 2528 | return "Dst NAT"; |
| 2529 | } |
| 2530 | |
| 2531 | return "undefined"; |
| 2532 | } |
| 2533 | |
Amir Levy | dc65f4c | 2017-07-06 09:49:50 +0300 | [diff] [blame] | 2534 | static const char *ipa3_get_ipv6ct_en_str(enum ipa_ipv6ct_en_type ipv6ct_en) |
| 2535 | { |
| 2536 | switch (ipv6ct_en) { |
| 2537 | case (IPA_BYPASS_IPV6CT): |
| 2538 | return "ipv6ct disabled"; |
| 2539 | case (IPA_ENABLE_IPV6CT): |
| 2540 | return "ipv6ct enabled"; |
| 2541 | } |
| 2542 | |
| 2543 | return "undefined"; |
| 2544 | } |
| 2545 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2546 | /** |
| 2547 | * ipa3_cfg_ep_nat() - IPA end-point NAT configuration |
| 2548 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
Amir Levy | dc65f4c | 2017-07-06 09:49:50 +0300 | [diff] [blame] | 2549 | * @ep_nat: [in] IPA NAT end-point configuration params |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2550 | * |
| 2551 | * Returns: 0 on success, negative on failure |
| 2552 | * |
| 2553 | * Note: Should not be called from atomic context |
| 2554 | */ |
| 2555 | int ipa3_cfg_ep_nat(u32 clnt_hdl, const struct ipa_ep_cfg_nat *ep_nat) |
| 2556 | { |
| 2557 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 2558 | ipa3_ctx->ep[clnt_hdl].valid == 0 || ep_nat == NULL) { |
| 2559 | IPAERR("bad parm, clnt_hdl = %d , ep_valid = %d\n", |
| 2560 | clnt_hdl, |
| 2561 | ipa3_ctx->ep[clnt_hdl].valid); |
| 2562 | return -EINVAL; |
| 2563 | } |
| 2564 | |
| 2565 | if (IPA_CLIENT_IS_CONS(ipa3_ctx->ep[clnt_hdl].client)) { |
| 2566 | IPAERR("NAT does not apply to IPA out EP %d\n", clnt_hdl); |
| 2567 | return -EINVAL; |
| 2568 | } |
| 2569 | |
| 2570 | IPADBG("pipe=%d, nat_en=%d(%s)\n", |
| 2571 | clnt_hdl, |
| 2572 | ep_nat->nat_en, |
| 2573 | ipa3_get_nat_en_str(ep_nat->nat_en)); |
| 2574 | |
| 2575 | /* copy over EP cfg */ |
| 2576 | ipa3_ctx->ep[clnt_hdl].cfg.nat = *ep_nat; |
| 2577 | |
| 2578 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2579 | |
| 2580 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_NAT_n, clnt_hdl, ep_nat); |
| 2581 | |
| 2582 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2583 | |
| 2584 | return 0; |
| 2585 | } |
| 2586 | |
Amir Levy | dc65f4c | 2017-07-06 09:49:50 +0300 | [diff] [blame] | 2587 | /** |
| 2588 | * ipa3_cfg_ep_conn_track() - IPA end-point IPv6CT configuration |
| 2589 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 2590 | * @ep_conn_track: [in] IPA IPv6CT end-point configuration params |
| 2591 | * |
| 2592 | * Returns: 0 on success, negative on failure |
| 2593 | * |
| 2594 | * Note: Should not be called from atomic context |
| 2595 | */ |
| 2596 | int ipa3_cfg_ep_conn_track(u32 clnt_hdl, |
| 2597 | const struct ipa_ep_cfg_conn_track *ep_conn_track) |
| 2598 | { |
| 2599 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 2600 | ipa3_ctx->ep[clnt_hdl].valid == 0 || ep_conn_track == NULL) { |
| 2601 | IPAERR("bad parm, clnt_hdl = %d , ep_valid = %d\n", |
| 2602 | clnt_hdl, |
| 2603 | ipa3_ctx->ep[clnt_hdl].valid); |
| 2604 | return -EINVAL; |
| 2605 | } |
| 2606 | |
| 2607 | if (IPA_CLIENT_IS_CONS(ipa3_ctx->ep[clnt_hdl].client)) { |
| 2608 | IPAERR("IPv6CT does not apply to IPA out EP %d\n", clnt_hdl); |
| 2609 | return -EINVAL; |
| 2610 | } |
| 2611 | |
| 2612 | IPADBG("pipe=%d, conn_track_en=%d(%s)\n", |
| 2613 | clnt_hdl, |
| 2614 | ep_conn_track->conn_track_en, |
| 2615 | ipa3_get_ipv6ct_en_str(ep_conn_track->conn_track_en)); |
| 2616 | |
| 2617 | /* copy over EP cfg */ |
| 2618 | ipa3_ctx->ep[clnt_hdl].cfg.conn_track = *ep_conn_track; |
| 2619 | |
| 2620 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2621 | |
| 2622 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_CONN_TRACK_n, clnt_hdl, |
| 2623 | ep_conn_track); |
| 2624 | |
| 2625 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2626 | |
| 2627 | return 0; |
| 2628 | } |
| 2629 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2630 | |
| 2631 | /** |
| 2632 | * ipa3_cfg_ep_status() - IPA end-point status configuration |
| 2633 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 2634 | * @ipa_ep_cfg: [in] IPA end-point configuration params |
| 2635 | * |
| 2636 | * Returns: 0 on success, negative on failure |
| 2637 | * |
| 2638 | * Note: Should not be called from atomic context |
| 2639 | */ |
| 2640 | int ipa3_cfg_ep_status(u32 clnt_hdl, |
| 2641 | const struct ipahal_reg_ep_cfg_status *ep_status) |
| 2642 | { |
| 2643 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 2644 | ipa3_ctx->ep[clnt_hdl].valid == 0 || ep_status == NULL) { |
| 2645 | IPAERR("bad parm, clnt_hdl = %d , ep_valid = %d\n", |
| 2646 | clnt_hdl, |
| 2647 | ipa3_ctx->ep[clnt_hdl].valid); |
| 2648 | return -EINVAL; |
| 2649 | } |
| 2650 | |
| 2651 | IPADBG("pipe=%d, status_en=%d status_ep=%d status_location=%d\n", |
| 2652 | clnt_hdl, |
| 2653 | ep_status->status_en, |
| 2654 | ep_status->status_ep, |
| 2655 | ep_status->status_location); |
| 2656 | |
| 2657 | /* copy over EP cfg */ |
| 2658 | ipa3_ctx->ep[clnt_hdl].status = *ep_status; |
| 2659 | |
| 2660 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2661 | |
| 2662 | ipahal_write_reg_n_fields(IPA_ENDP_STATUS_n, clnt_hdl, ep_status); |
| 2663 | |
| 2664 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2665 | |
| 2666 | return 0; |
| 2667 | } |
| 2668 | |
| 2669 | /** |
| 2670 | * ipa3_cfg_ep_cfg() - IPA end-point cfg configuration |
| 2671 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 2672 | * @ipa_ep_cfg: [in] IPA end-point configuration params |
| 2673 | * |
| 2674 | * Returns: 0 on success, negative on failure |
| 2675 | * |
| 2676 | * Note: Should not be called from atomic context |
| 2677 | */ |
| 2678 | int ipa3_cfg_ep_cfg(u32 clnt_hdl, const struct ipa_ep_cfg_cfg *cfg) |
| 2679 | { |
| 2680 | u8 qmb_master_sel; |
| 2681 | |
| 2682 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 2683 | ipa3_ctx->ep[clnt_hdl].valid == 0 || cfg == NULL) { |
| 2684 | IPAERR("bad parm, clnt_hdl = %d , ep_valid = %d\n", |
| 2685 | clnt_hdl, |
| 2686 | ipa3_ctx->ep[clnt_hdl].valid); |
| 2687 | return -EINVAL; |
| 2688 | } |
| 2689 | |
| 2690 | /* copy over EP cfg */ |
| 2691 | ipa3_ctx->ep[clnt_hdl].cfg.cfg = *cfg; |
| 2692 | |
| 2693 | /* Override QMB master selection */ |
| 2694 | qmb_master_sel = ipa3_get_qmb_master_sel(ipa3_ctx->ep[clnt_hdl].client); |
| 2695 | ipa3_ctx->ep[clnt_hdl].cfg.cfg.gen_qmb_master_sel = qmb_master_sel; |
| 2696 | IPADBG( |
| 2697 | "pipe=%d, frag_ofld_en=%d cs_ofld_en=%d mdata_hdr_ofst=%d gen_qmb_master_sel=%d\n", |
| 2698 | clnt_hdl, |
| 2699 | ipa3_ctx->ep[clnt_hdl].cfg.cfg.frag_offload_en, |
| 2700 | ipa3_ctx->ep[clnt_hdl].cfg.cfg.cs_offload_en, |
| 2701 | ipa3_ctx->ep[clnt_hdl].cfg.cfg.cs_metadata_hdr_offset, |
| 2702 | ipa3_ctx->ep[clnt_hdl].cfg.cfg.gen_qmb_master_sel); |
| 2703 | |
| 2704 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2705 | |
| 2706 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_CFG_n, clnt_hdl, |
| 2707 | &ipa3_ctx->ep[clnt_hdl].cfg.cfg); |
| 2708 | |
| 2709 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2710 | |
| 2711 | return 0; |
| 2712 | } |
| 2713 | |
| 2714 | /** |
| 2715 | * ipa3_cfg_ep_metadata_mask() - IPA end-point meta-data mask configuration |
| 2716 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 2717 | * @ipa_ep_cfg: [in] IPA end-point configuration params |
| 2718 | * |
| 2719 | * Returns: 0 on success, negative on failure |
| 2720 | * |
| 2721 | * Note: Should not be called from atomic context |
| 2722 | */ |
| 2723 | int ipa3_cfg_ep_metadata_mask(u32 clnt_hdl, |
| 2724 | const struct ipa_ep_cfg_metadata_mask |
| 2725 | *metadata_mask) |
| 2726 | { |
| 2727 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 2728 | ipa3_ctx->ep[clnt_hdl].valid == 0 || metadata_mask == NULL) { |
| 2729 | IPAERR("bad parm, clnt_hdl = %d , ep_valid = %d\n", |
| 2730 | clnt_hdl, |
| 2731 | ipa3_ctx->ep[clnt_hdl].valid); |
| 2732 | return -EINVAL; |
| 2733 | } |
| 2734 | |
| 2735 | IPADBG("pipe=%d, metadata_mask=0x%x\n", |
| 2736 | clnt_hdl, |
| 2737 | metadata_mask->metadata_mask); |
| 2738 | |
| 2739 | /* copy over EP cfg */ |
| 2740 | ipa3_ctx->ep[clnt_hdl].cfg.metadata_mask = *metadata_mask; |
| 2741 | |
| 2742 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2743 | |
| 2744 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_HDR_METADATA_MASK_n, |
| 2745 | clnt_hdl, metadata_mask); |
| 2746 | |
| 2747 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2748 | |
| 2749 | return 0; |
| 2750 | } |
| 2751 | |
| 2752 | /** |
| 2753 | * ipa3_cfg_ep_hdr() - IPA end-point header configuration |
| 2754 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 2755 | * @ipa_ep_cfg: [in] IPA end-point configuration params |
| 2756 | * |
| 2757 | * Returns: 0 on success, negative on failure |
| 2758 | * |
| 2759 | * Note: Should not be called from atomic context |
| 2760 | */ |
| 2761 | int ipa3_cfg_ep_hdr(u32 clnt_hdl, const struct ipa_ep_cfg_hdr *ep_hdr) |
| 2762 | { |
| 2763 | struct ipa3_ep_context *ep; |
| 2764 | |
| 2765 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 2766 | ipa3_ctx->ep[clnt_hdl].valid == 0 || ep_hdr == NULL) { |
| 2767 | IPAERR("bad parm, clnt_hdl = %d , ep_valid = %d\n", |
| 2768 | clnt_hdl, ipa3_ctx->ep[clnt_hdl].valid); |
| 2769 | return -EINVAL; |
| 2770 | } |
| 2771 | IPADBG("pipe=%d metadata_reg_valid=%d\n", |
| 2772 | clnt_hdl, |
| 2773 | ep_hdr->hdr_metadata_reg_valid); |
| 2774 | |
| 2775 | IPADBG("remove_additional=%d, a5_mux=%d, ofst_pkt_size=0x%x\n", |
| 2776 | ep_hdr->hdr_remove_additional, |
| 2777 | ep_hdr->hdr_a5_mux, |
| 2778 | ep_hdr->hdr_ofst_pkt_size); |
| 2779 | |
| 2780 | IPADBG("ofst_pkt_size_valid=%d, additional_const_len=0x%x\n", |
| 2781 | ep_hdr->hdr_ofst_pkt_size_valid, |
| 2782 | ep_hdr->hdr_additional_const_len); |
| 2783 | |
Amir Levy | 479cfdd | 2017-10-26 12:23:14 +0300 | [diff] [blame] | 2784 | 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] | 2785 | ep_hdr->hdr_ofst_metadata, |
| 2786 | ep_hdr->hdr_ofst_metadata_valid, |
| 2787 | ep_hdr->hdr_len); |
| 2788 | |
| 2789 | ep = &ipa3_ctx->ep[clnt_hdl]; |
| 2790 | |
| 2791 | /* copy over EP cfg */ |
| 2792 | ep->cfg.hdr = *ep_hdr; |
| 2793 | |
| 2794 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2795 | |
| 2796 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_HDR_n, clnt_hdl, &ep->cfg.hdr); |
| 2797 | |
| 2798 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2799 | |
| 2800 | return 0; |
| 2801 | } |
| 2802 | |
| 2803 | /** |
| 2804 | * ipa3_cfg_ep_hdr_ext() - IPA end-point extended header configuration |
| 2805 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 2806 | * @ep_hdr_ext: [in] IPA end-point configuration params |
| 2807 | * |
| 2808 | * Returns: 0 on success, negative on failure |
| 2809 | * |
| 2810 | * Note: Should not be called from atomic context |
| 2811 | */ |
| 2812 | int ipa3_cfg_ep_hdr_ext(u32 clnt_hdl, |
| 2813 | const struct ipa_ep_cfg_hdr_ext *ep_hdr_ext) |
| 2814 | { |
| 2815 | struct ipa3_ep_context *ep; |
| 2816 | |
| 2817 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 2818 | ipa3_ctx->ep[clnt_hdl].valid == 0 || ep_hdr_ext == NULL) { |
| 2819 | IPAERR("bad parm, clnt_hdl = %d , ep_valid = %d\n", |
| 2820 | clnt_hdl, ipa3_ctx->ep[clnt_hdl].valid); |
| 2821 | return -EINVAL; |
| 2822 | } |
| 2823 | |
| 2824 | IPADBG("pipe=%d hdr_pad_to_alignment=%d\n", |
| 2825 | clnt_hdl, |
| 2826 | ep_hdr_ext->hdr_pad_to_alignment); |
| 2827 | |
| 2828 | IPADBG("hdr_total_len_or_pad_offset=%d\n", |
| 2829 | ep_hdr_ext->hdr_total_len_or_pad_offset); |
| 2830 | |
| 2831 | IPADBG("hdr_payload_len_inc_padding=%d hdr_total_len_or_pad=%d\n", |
| 2832 | ep_hdr_ext->hdr_payload_len_inc_padding, |
| 2833 | ep_hdr_ext->hdr_total_len_or_pad); |
| 2834 | |
| 2835 | IPADBG("hdr_total_len_or_pad_valid=%d hdr_little_endian=%d\n", |
| 2836 | ep_hdr_ext->hdr_total_len_or_pad_valid, |
| 2837 | ep_hdr_ext->hdr_little_endian); |
| 2838 | |
| 2839 | ep = &ipa3_ctx->ep[clnt_hdl]; |
| 2840 | |
| 2841 | /* copy over EP cfg */ |
| 2842 | ep->cfg.hdr_ext = *ep_hdr_ext; |
| 2843 | |
| 2844 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2845 | |
| 2846 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_HDR_EXT_n, clnt_hdl, |
| 2847 | &ep->cfg.hdr_ext); |
| 2848 | |
| 2849 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2850 | |
| 2851 | return 0; |
| 2852 | } |
| 2853 | |
| 2854 | /** |
| 2855 | * ipa3_cfg_ep_ctrl() - IPA end-point Control configuration |
| 2856 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 2857 | * @ipa_ep_cfg_ctrl: [in] IPA end-point configuration params |
| 2858 | * |
| 2859 | * Returns: 0 on success, negative on failure |
| 2860 | */ |
| 2861 | int ipa3_cfg_ep_ctrl(u32 clnt_hdl, const struct ipa_ep_cfg_ctrl *ep_ctrl) |
| 2862 | { |
| 2863 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || ep_ctrl == NULL) { |
| 2864 | IPAERR("bad parm, clnt_hdl = %d\n", clnt_hdl); |
| 2865 | return -EINVAL; |
| 2866 | } |
| 2867 | |
Skylar Chang | a699afd | 2017-06-06 10:06:21 -0700 | [diff] [blame] | 2868 | if (ipa3_ctx->ipa_hw_type >= IPA_HW_v4_0 && ep_ctrl->ipa_ep_suspend) { |
| 2869 | IPAERR("pipe suspend is not supported\n"); |
| 2870 | WARN_ON(1); |
| 2871 | return -EPERM; |
| 2872 | } |
| 2873 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2874 | IPADBG("pipe=%d ep_suspend=%d, ep_delay=%d\n", |
| 2875 | clnt_hdl, |
| 2876 | ep_ctrl->ipa_ep_suspend, |
| 2877 | ep_ctrl->ipa_ep_delay); |
| 2878 | |
| 2879 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_CTRL_n, clnt_hdl, ep_ctrl); |
| 2880 | |
| 2881 | if (ep_ctrl->ipa_ep_suspend == true && |
| 2882 | IPA_CLIENT_IS_CONS(ipa3_ctx->ep[clnt_hdl].client)) |
| 2883 | ipa3_suspend_active_aggr_wa(clnt_hdl); |
| 2884 | |
| 2885 | return 0; |
| 2886 | } |
| 2887 | |
| 2888 | const char *ipa3_get_mode_type_str(enum ipa_mode_type mode) |
| 2889 | { |
| 2890 | switch (mode) { |
| 2891 | case (IPA_BASIC): |
| 2892 | return "Basic"; |
| 2893 | case (IPA_ENABLE_FRAMING_HDLC): |
| 2894 | return "HDLC framing"; |
| 2895 | case (IPA_ENABLE_DEFRAMING_HDLC): |
| 2896 | return "HDLC de-framing"; |
| 2897 | case (IPA_DMA): |
| 2898 | return "DMA"; |
| 2899 | } |
| 2900 | |
| 2901 | return "undefined"; |
| 2902 | } |
| 2903 | |
| 2904 | /** |
| 2905 | * ipa3_cfg_ep_mode() - IPA end-point mode configuration |
| 2906 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 2907 | * @ipa_ep_cfg: [in] IPA end-point configuration params |
| 2908 | * |
| 2909 | * Returns: 0 on success, negative on failure |
| 2910 | * |
| 2911 | * Note: Should not be called from atomic context |
| 2912 | */ |
| 2913 | int ipa3_cfg_ep_mode(u32 clnt_hdl, const struct ipa_ep_cfg_mode *ep_mode) |
| 2914 | { |
| 2915 | int ep; |
| 2916 | int type; |
| 2917 | struct ipahal_reg_endp_init_mode init_mode; |
| 2918 | |
| 2919 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 2920 | ipa3_ctx->ep[clnt_hdl].valid == 0 || ep_mode == NULL) { |
| 2921 | IPAERR("bad params clnt_hdl=%d , ep_valid=%d ep_mode=%p\n", |
| 2922 | clnt_hdl, ipa3_ctx->ep[clnt_hdl].valid, |
| 2923 | ep_mode); |
| 2924 | return -EINVAL; |
| 2925 | } |
| 2926 | |
| 2927 | if (IPA_CLIENT_IS_CONS(ipa3_ctx->ep[clnt_hdl].client)) { |
| 2928 | IPAERR("MODE does not apply to IPA out EP %d\n", clnt_hdl); |
| 2929 | return -EINVAL; |
| 2930 | } |
| 2931 | |
| 2932 | ep = ipa3_get_ep_mapping(ep_mode->dst); |
| 2933 | if (ep == -1 && ep_mode->mode == IPA_DMA) { |
| 2934 | IPAERR("dst %d does not exist in DMA mode\n", ep_mode->dst); |
| 2935 | return -EINVAL; |
| 2936 | } |
| 2937 | |
| 2938 | WARN_ON(ep_mode->mode == IPA_DMA && IPA_CLIENT_IS_PROD(ep_mode->dst)); |
| 2939 | |
| 2940 | if (!IPA_CLIENT_IS_CONS(ep_mode->dst)) |
| 2941 | ep = ipa3_get_ep_mapping(IPA_CLIENT_APPS_LAN_CONS); |
| 2942 | |
Amir Levy | 479cfdd | 2017-10-26 12:23:14 +0300 | [diff] [blame] | 2943 | IPADBG("pipe=%d mode=%d(%s), dst_client_number=%d\n", |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2944 | clnt_hdl, |
| 2945 | ep_mode->mode, |
| 2946 | ipa3_get_mode_type_str(ep_mode->mode), |
| 2947 | ep_mode->dst); |
| 2948 | |
| 2949 | /* copy over EP cfg */ |
| 2950 | ipa3_ctx->ep[clnt_hdl].cfg.mode = *ep_mode; |
| 2951 | ipa3_ctx->ep[clnt_hdl].dst_pipe_index = ep; |
| 2952 | |
| 2953 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2954 | |
| 2955 | init_mode.dst_pipe_number = ipa3_ctx->ep[clnt_hdl].dst_pipe_index; |
| 2956 | init_mode.ep_mode = *ep_mode; |
| 2957 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_MODE_n, clnt_hdl, &init_mode); |
| 2958 | |
| 2959 | /* Configure sequencers type for test clients*/ |
| 2960 | if (IPA_CLIENT_IS_TEST(ipa3_ctx->ep[clnt_hdl].client)) { |
| 2961 | if (ep_mode->mode == IPA_DMA) |
| 2962 | type = IPA_DPS_HPS_SEQ_TYPE_DMA_ONLY; |
| 2963 | else |
Skylar Chang | 7fa2271 | 2017-04-03 18:29:21 -0700 | [diff] [blame] | 2964 | type = |
| 2965 | IPA_DPS_HPS_SEQ_TYPE_2ND_PKT_PROCESS_PASS_NO_DEC_UCP; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 2966 | |
| 2967 | IPADBG(" set sequencers to sequance 0x%x, ep = %d\n", type, |
| 2968 | clnt_hdl); |
| 2969 | ipahal_write_reg_n(IPA_ENDP_INIT_SEQ_n, clnt_hdl, type); |
| 2970 | } |
| 2971 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 2972 | |
| 2973 | return 0; |
| 2974 | } |
| 2975 | |
| 2976 | const char *ipa3_get_aggr_enable_str(enum ipa_aggr_en_type aggr_en) |
| 2977 | { |
| 2978 | switch (aggr_en) { |
| 2979 | case (IPA_BYPASS_AGGR): |
| 2980 | return "no aggregation"; |
| 2981 | case (IPA_ENABLE_AGGR): |
| 2982 | return "aggregation enabled"; |
| 2983 | case (IPA_ENABLE_DEAGGR): |
| 2984 | return "de-aggregation enabled"; |
| 2985 | } |
| 2986 | |
| 2987 | return "undefined"; |
| 2988 | } |
| 2989 | |
| 2990 | const char *ipa3_get_aggr_type_str(enum ipa_aggr_type aggr_type) |
| 2991 | { |
| 2992 | switch (aggr_type) { |
| 2993 | case (IPA_MBIM_16): |
| 2994 | return "MBIM_16"; |
| 2995 | case (IPA_HDLC): |
| 2996 | return "HDLC"; |
| 2997 | case (IPA_TLP): |
| 2998 | return "TLP"; |
| 2999 | case (IPA_RNDIS): |
| 3000 | return "RNDIS"; |
| 3001 | case (IPA_GENERIC): |
| 3002 | return "GENERIC"; |
| 3003 | case (IPA_QCMAP): |
| 3004 | return "QCMAP"; |
| 3005 | } |
| 3006 | return "undefined"; |
| 3007 | } |
| 3008 | |
| 3009 | /** |
| 3010 | * ipa3_cfg_ep_aggr() - IPA end-point aggregation configuration |
| 3011 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 3012 | * @ipa_ep_cfg: [in] IPA end-point configuration params |
| 3013 | * |
| 3014 | * Returns: 0 on success, negative on failure |
| 3015 | * |
| 3016 | * Note: Should not be called from atomic context |
| 3017 | */ |
| 3018 | int ipa3_cfg_ep_aggr(u32 clnt_hdl, const struct ipa_ep_cfg_aggr *ep_aggr) |
| 3019 | { |
| 3020 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 3021 | ipa3_ctx->ep[clnt_hdl].valid == 0 || ep_aggr == NULL) { |
| 3022 | IPAERR("bad parm, clnt_hdl = %d , ep_valid = %d\n", |
| 3023 | clnt_hdl, ipa3_ctx->ep[clnt_hdl].valid); |
| 3024 | return -EINVAL; |
| 3025 | } |
| 3026 | |
| 3027 | if (ep_aggr->aggr_en == IPA_ENABLE_DEAGGR && |
| 3028 | !IPA_EP_SUPPORTS_DEAGGR(clnt_hdl)) { |
| 3029 | IPAERR("pipe=%d cannot be configured to DEAGGR\n", clnt_hdl); |
| 3030 | WARN_ON(1); |
| 3031 | return -EINVAL; |
| 3032 | } |
| 3033 | |
| 3034 | IPADBG("pipe=%d en=%d(%s), type=%d(%s), byte_limit=%d, time_limit=%d\n", |
| 3035 | clnt_hdl, |
| 3036 | ep_aggr->aggr_en, |
| 3037 | ipa3_get_aggr_enable_str(ep_aggr->aggr_en), |
| 3038 | ep_aggr->aggr, |
| 3039 | ipa3_get_aggr_type_str(ep_aggr->aggr), |
| 3040 | ep_aggr->aggr_byte_limit, |
| 3041 | ep_aggr->aggr_time_limit); |
| 3042 | IPADBG("hard_byte_limit_en=%d aggr_sw_eof_active=%d\n", |
| 3043 | ep_aggr->aggr_hard_byte_limit_en, |
| 3044 | ep_aggr->aggr_sw_eof_active); |
| 3045 | |
| 3046 | /* copy over EP cfg */ |
| 3047 | ipa3_ctx->ep[clnt_hdl].cfg.aggr = *ep_aggr; |
| 3048 | |
| 3049 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 3050 | |
| 3051 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_AGGR_n, clnt_hdl, ep_aggr); |
| 3052 | |
| 3053 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 3054 | |
| 3055 | return 0; |
| 3056 | } |
| 3057 | |
| 3058 | /** |
| 3059 | * ipa3_cfg_ep_route() - IPA end-point routing configuration |
| 3060 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 3061 | * @ipa_ep_cfg: [in] IPA end-point configuration params |
| 3062 | * |
| 3063 | * Returns: 0 on success, negative on failure |
| 3064 | * |
| 3065 | * Note: Should not be called from atomic context |
| 3066 | */ |
| 3067 | int ipa3_cfg_ep_route(u32 clnt_hdl, const struct ipa_ep_cfg_route *ep_route) |
| 3068 | { |
| 3069 | struct ipahal_reg_endp_init_route init_rt; |
| 3070 | |
| 3071 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 3072 | ipa3_ctx->ep[clnt_hdl].valid == 0 || ep_route == NULL) { |
| 3073 | IPAERR("bad parm, clnt_hdl = %d , ep_valid = %d\n", |
| 3074 | clnt_hdl, ipa3_ctx->ep[clnt_hdl].valid); |
| 3075 | return -EINVAL; |
| 3076 | } |
| 3077 | |
| 3078 | if (IPA_CLIENT_IS_CONS(ipa3_ctx->ep[clnt_hdl].client)) { |
| 3079 | IPAERR("ROUTE does not apply to IPA out EP %d\n", |
| 3080 | clnt_hdl); |
| 3081 | return -EINVAL; |
| 3082 | } |
| 3083 | |
| 3084 | /* |
| 3085 | * if DMA mode was configured previously for this EP, return with |
| 3086 | * success |
| 3087 | */ |
| 3088 | if (ipa3_ctx->ep[clnt_hdl].cfg.mode.mode == IPA_DMA) { |
| 3089 | IPADBG("DMA enabled for ep %d, dst pipe is part of DMA\n", |
| 3090 | clnt_hdl); |
| 3091 | return 0; |
| 3092 | } |
| 3093 | |
| 3094 | if (ep_route->rt_tbl_hdl) |
| 3095 | IPAERR("client specified non-zero RT TBL hdl - ignore it\n"); |
| 3096 | |
| 3097 | IPADBG("pipe=%d, rt_tbl_hdl=%d\n", |
| 3098 | clnt_hdl, |
| 3099 | ep_route->rt_tbl_hdl); |
| 3100 | |
| 3101 | /* always use "default" routing table when programming EP ROUTE reg */ |
| 3102 | ipa3_ctx->ep[clnt_hdl].rt_tbl_idx = |
| 3103 | IPA_MEM_PART(v4_apps_rt_index_lo); |
| 3104 | |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 3105 | if (ipa3_ctx->ipa_hw_type < IPA_HW_v4_0) { |
| 3106 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3107 | |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 3108 | init_rt.route_table_index = ipa3_ctx->ep[clnt_hdl].rt_tbl_idx; |
| 3109 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_ROUTE_n, |
| 3110 | clnt_hdl, &init_rt); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3111 | |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 3112 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 3113 | } |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3114 | |
| 3115 | return 0; |
| 3116 | } |
| 3117 | |
| 3118 | /** |
| 3119 | * ipa3_cfg_ep_holb() - IPA end-point holb configuration |
| 3120 | * |
| 3121 | * If an IPA producer pipe is full, IPA HW by default will block |
| 3122 | * indefinitely till space opens up. During this time no packets |
| 3123 | * including those from unrelated pipes will be processed. Enabling |
| 3124 | * HOLB means IPA HW will be allowed to drop packets as/when needed |
| 3125 | * and indefinite blocking is avoided. |
| 3126 | * |
| 3127 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 3128 | * @ipa_ep_cfg: [in] IPA end-point configuration params |
| 3129 | * |
| 3130 | * Returns: 0 on success, negative on failure |
| 3131 | */ |
| 3132 | int ipa3_cfg_ep_holb(u32 clnt_hdl, const struct ipa_ep_cfg_holb *ep_holb) |
| 3133 | { |
| 3134 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 3135 | ipa3_ctx->ep[clnt_hdl].valid == 0 || ep_holb == NULL || |
| 3136 | ep_holb->tmr_val > ipa3_ctx->ctrl->max_holb_tmr_val || |
| 3137 | ep_holb->en > 1) { |
| 3138 | IPAERR("bad parm.\n"); |
| 3139 | return -EINVAL; |
| 3140 | } |
| 3141 | |
| 3142 | if (IPA_CLIENT_IS_PROD(ipa3_ctx->ep[clnt_hdl].client)) { |
| 3143 | IPAERR("HOLB does not apply to IPA in EP %d\n", clnt_hdl); |
| 3144 | return -EINVAL; |
| 3145 | } |
| 3146 | |
| 3147 | ipa3_ctx->ep[clnt_hdl].holb = *ep_holb; |
| 3148 | |
| 3149 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 3150 | |
| 3151 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_HOL_BLOCK_EN_n, clnt_hdl, |
| 3152 | ep_holb); |
| 3153 | |
| 3154 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_HOL_BLOCK_TIMER_n, clnt_hdl, |
| 3155 | ep_holb); |
| 3156 | |
| 3157 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 3158 | |
| 3159 | IPADBG("cfg holb %u ep=%d tmr=%d\n", ep_holb->en, clnt_hdl, |
| 3160 | ep_holb->tmr_val); |
| 3161 | |
| 3162 | return 0; |
| 3163 | } |
| 3164 | |
| 3165 | /** |
| 3166 | * ipa3_cfg_ep_holb_by_client() - IPA end-point holb configuration |
| 3167 | * |
| 3168 | * Wrapper function for ipa3_cfg_ep_holb() with client name instead of |
| 3169 | * client handle. This function is used for clients that does not have |
| 3170 | * client handle. |
| 3171 | * |
| 3172 | * @client: [in] client name |
| 3173 | * @ipa_ep_cfg: [in] IPA end-point configuration params |
| 3174 | * |
| 3175 | * Returns: 0 on success, negative on failure |
| 3176 | */ |
| 3177 | int ipa3_cfg_ep_holb_by_client(enum ipa_client_type client, |
| 3178 | const struct ipa_ep_cfg_holb *ep_holb) |
| 3179 | { |
| 3180 | return ipa3_cfg_ep_holb(ipa3_get_ep_mapping(client), ep_holb); |
| 3181 | } |
| 3182 | |
| 3183 | /** |
| 3184 | * ipa3_cfg_ep_deaggr() - IPA end-point deaggregation configuration |
| 3185 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 3186 | * @ep_deaggr: [in] IPA end-point configuration params |
| 3187 | * |
| 3188 | * Returns: 0 on success, negative on failure |
| 3189 | * |
| 3190 | * Note: Should not be called from atomic context |
| 3191 | */ |
| 3192 | int ipa3_cfg_ep_deaggr(u32 clnt_hdl, |
| 3193 | const struct ipa_ep_cfg_deaggr *ep_deaggr) |
| 3194 | { |
| 3195 | struct ipa3_ep_context *ep; |
| 3196 | |
| 3197 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 3198 | ipa3_ctx->ep[clnt_hdl].valid == 0 || ep_deaggr == NULL) { |
| 3199 | IPAERR("bad parm, clnt_hdl = %d , ep_valid = %d\n", |
| 3200 | clnt_hdl, ipa3_ctx->ep[clnt_hdl].valid); |
| 3201 | return -EINVAL; |
| 3202 | } |
| 3203 | |
| 3204 | IPADBG("pipe=%d deaggr_hdr_len=%d\n", |
| 3205 | clnt_hdl, |
| 3206 | ep_deaggr->deaggr_hdr_len); |
| 3207 | |
| 3208 | IPADBG("packet_offset_valid=%d\n", |
| 3209 | ep_deaggr->packet_offset_valid); |
| 3210 | |
| 3211 | IPADBG("packet_offset_location=%d max_packet_len=%d\n", |
| 3212 | ep_deaggr->packet_offset_location, |
| 3213 | ep_deaggr->max_packet_len); |
| 3214 | |
| 3215 | ep = &ipa3_ctx->ep[clnt_hdl]; |
| 3216 | |
| 3217 | /* copy over EP cfg */ |
| 3218 | ep->cfg.deaggr = *ep_deaggr; |
| 3219 | |
| 3220 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 3221 | |
| 3222 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_DEAGGR_n, clnt_hdl, |
| 3223 | &ep->cfg.deaggr); |
| 3224 | |
| 3225 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 3226 | |
| 3227 | return 0; |
| 3228 | } |
| 3229 | |
| 3230 | /** |
| 3231 | * ipa3_cfg_ep_metadata() - IPA end-point metadata configuration |
| 3232 | * @clnt_hdl: [in] opaque client handle assigned by IPA to client |
| 3233 | * @ipa_ep_cfg: [in] IPA end-point configuration params |
| 3234 | * |
| 3235 | * Returns: 0 on success, negative on failure |
| 3236 | * |
| 3237 | * Note: Should not be called from atomic context |
| 3238 | */ |
| 3239 | int ipa3_cfg_ep_metadata(u32 clnt_hdl, const struct ipa_ep_cfg_metadata *ep_md) |
| 3240 | { |
| 3241 | u32 qmap_id = 0; |
| 3242 | struct ipa_ep_cfg_metadata ep_md_reg_wrt; |
| 3243 | |
| 3244 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 3245 | ipa3_ctx->ep[clnt_hdl].valid == 0 || ep_md == NULL) { |
| 3246 | IPAERR("bad parm, clnt_hdl = %d , ep_valid = %d\n", |
| 3247 | clnt_hdl, ipa3_ctx->ep[clnt_hdl].valid); |
| 3248 | return -EINVAL; |
| 3249 | } |
| 3250 | |
| 3251 | IPADBG("pipe=%d, mux id=%d\n", clnt_hdl, ep_md->qmap_id); |
| 3252 | |
| 3253 | /* copy over EP cfg */ |
| 3254 | ipa3_ctx->ep[clnt_hdl].cfg.meta = *ep_md; |
| 3255 | |
| 3256 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 3257 | |
| 3258 | ep_md_reg_wrt = *ep_md; |
| 3259 | qmap_id = (ep_md->qmap_id << |
| 3260 | IPA_ENDP_INIT_HDR_METADATA_n_MUX_ID_SHFT) & |
| 3261 | IPA_ENDP_INIT_HDR_METADATA_n_MUX_ID_BMASK; |
| 3262 | |
| 3263 | ep_md_reg_wrt.qmap_id = qmap_id; |
| 3264 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_HDR_METADATA_n, clnt_hdl, |
| 3265 | &ep_md_reg_wrt); |
| 3266 | ipa3_ctx->ep[clnt_hdl].cfg.hdr.hdr_metadata_reg_valid = 1; |
| 3267 | ipahal_write_reg_n_fields(IPA_ENDP_INIT_HDR_n, clnt_hdl, |
| 3268 | &ipa3_ctx->ep[clnt_hdl].cfg.hdr); |
| 3269 | |
| 3270 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 3271 | |
| 3272 | return 0; |
| 3273 | } |
| 3274 | |
| 3275 | int ipa3_write_qmap_id(struct ipa_ioc_write_qmapid *param_in) |
| 3276 | { |
| 3277 | struct ipa_ep_cfg_metadata meta; |
| 3278 | struct ipa3_ep_context *ep; |
| 3279 | int ipa_ep_idx; |
| 3280 | int result = -EINVAL; |
| 3281 | |
| 3282 | if (param_in->client >= IPA_CLIENT_MAX) { |
Utkarsh Saxena | e978281 | 2017-05-26 17:20:32 +0530 | [diff] [blame] | 3283 | IPAERR_RL("bad parm client:%d\n", param_in->client); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3284 | goto fail; |
| 3285 | } |
| 3286 | |
| 3287 | ipa_ep_idx = ipa3_get_ep_mapping(param_in->client); |
| 3288 | if (ipa_ep_idx == -1) { |
Utkarsh Saxena | e978281 | 2017-05-26 17:20:32 +0530 | [diff] [blame] | 3289 | IPAERR_RL("Invalid client.\n"); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3290 | goto fail; |
| 3291 | } |
| 3292 | |
| 3293 | ep = &ipa3_ctx->ep[ipa_ep_idx]; |
| 3294 | if (!ep->valid) { |
Utkarsh Saxena | e978281 | 2017-05-26 17:20:32 +0530 | [diff] [blame] | 3295 | IPAERR_RL("EP not allocated.\n"); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3296 | goto fail; |
| 3297 | } |
| 3298 | |
| 3299 | meta.qmap_id = param_in->qmap_id; |
| 3300 | if (param_in->client == IPA_CLIENT_USB_PROD || |
| 3301 | param_in->client == IPA_CLIENT_HSIC1_PROD || |
Sunil Paidimarri | 5139aa2 | 2017-02-13 11:07:32 -0800 | [diff] [blame] | 3302 | param_in->client == IPA_CLIENT_ODU_PROD || |
| 3303 | param_in->client == IPA_CLIENT_ETHERNET_PROD) { |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3304 | result = ipa3_cfg_ep_metadata(ipa_ep_idx, &meta); |
| 3305 | } else if (param_in->client == IPA_CLIENT_WLAN1_PROD) { |
| 3306 | ipa3_ctx->ep[ipa_ep_idx].cfg.meta = meta; |
| 3307 | result = ipa3_write_qmapid_wdi_pipe(ipa_ep_idx, meta.qmap_id); |
| 3308 | if (result) |
Utkarsh Saxena | e978281 | 2017-05-26 17:20:32 +0530 | [diff] [blame] | 3309 | IPAERR_RL("qmap_id %d write failed on ep=%d\n", |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3310 | meta.qmap_id, ipa_ep_idx); |
| 3311 | result = 0; |
| 3312 | } |
| 3313 | |
| 3314 | fail: |
| 3315 | return result; |
| 3316 | } |
| 3317 | |
| 3318 | /** |
| 3319 | * ipa3_dump_buff_internal() - dumps buffer for debug purposes |
| 3320 | * @base: buffer base address |
| 3321 | * @phy_base: buffer physical base address |
| 3322 | * @size: size of the buffer |
| 3323 | */ |
| 3324 | void ipa3_dump_buff_internal(void *base, dma_addr_t phy_base, u32 size) |
| 3325 | { |
| 3326 | int i; |
| 3327 | u32 *cur = (u32 *)base; |
| 3328 | u8 *byt; |
| 3329 | |
| 3330 | IPADBG("system phys addr=%pa len=%u\n", &phy_base, size); |
| 3331 | for (i = 0; i < size / 4; i++) { |
| 3332 | byt = (u8 *)(cur + i); |
| 3333 | IPADBG("%2d %08x %02x %02x %02x %02x\n", i, *(cur + i), |
| 3334 | byt[0], byt[1], byt[2], byt[3]); |
| 3335 | } |
| 3336 | IPADBG("END\n"); |
| 3337 | } |
| 3338 | |
| 3339 | /** |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3340 | * ipa3_set_aggr_mode() - Set the aggregation mode which is a global setting |
| 3341 | * @mode: [in] the desired aggregation mode for e.g. straight MBIM, QCNCM, |
| 3342 | * etc |
| 3343 | * |
| 3344 | * Returns: 0 on success |
| 3345 | */ |
| 3346 | int ipa3_set_aggr_mode(enum ipa_aggr_mode mode) |
| 3347 | { |
| 3348 | struct ipahal_reg_qcncm qcncm; |
| 3349 | |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 3350 | if (ipa3_ctx->ipa_hw_type >= IPA_HW_v4_0) { |
| 3351 | if (mode != IPA_MBIM_AGGR) { |
| 3352 | IPAERR("Only MBIM mode is supported staring 4.0\n"); |
| 3353 | return -EPERM; |
| 3354 | } |
| 3355 | } else { |
| 3356 | IPA_ACTIVE_CLIENTS_INC_SIMPLE(); |
| 3357 | ipahal_read_reg_fields(IPA_QCNCM, &qcncm); |
| 3358 | qcncm.mode_en = mode; |
| 3359 | ipahal_write_reg_fields(IPA_QCNCM, &qcncm); |
| 3360 | IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); |
| 3361 | } |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3362 | |
| 3363 | return 0; |
| 3364 | } |
| 3365 | |
| 3366 | /** |
| 3367 | * ipa3_set_qcncm_ndp_sig() - Set the NDP signature used for QCNCM aggregation |
| 3368 | * mode |
| 3369 | * @sig: [in] the first 3 bytes of QCNCM NDP signature (expected to be |
| 3370 | * "QND") |
| 3371 | * |
| 3372 | * Set the NDP signature used for QCNCM aggregation mode. The fourth byte |
| 3373 | * (expected to be 'P') needs to be set using the header addition mechanism |
| 3374 | * |
| 3375 | * Returns: 0 on success, negative on failure |
| 3376 | */ |
| 3377 | int ipa3_set_qcncm_ndp_sig(char sig[3]) |
| 3378 | { |
| 3379 | struct ipahal_reg_qcncm qcncm; |
| 3380 | |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 3381 | if (ipa3_ctx->ipa_hw_type >= IPA_HW_v4_0) { |
| 3382 | IPAERR("QCNCM mode is not supported staring 4.0\n"); |
| 3383 | return -EPERM; |
| 3384 | } |
| 3385 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3386 | if (sig == NULL) { |
| 3387 | IPAERR("bad argument for ipa3_set_qcncm_ndp_sig/n"); |
| 3388 | return -EINVAL; |
| 3389 | } |
| 3390 | IPA_ACTIVE_CLIENTS_INC_SIMPLE(); |
| 3391 | ipahal_read_reg_fields(IPA_QCNCM, &qcncm); |
| 3392 | qcncm.mode_val = ((sig[0] << 16) | (sig[1] << 8) | sig[2]); |
| 3393 | ipahal_write_reg_fields(IPA_QCNCM, &qcncm); |
| 3394 | IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); |
| 3395 | |
| 3396 | return 0; |
| 3397 | } |
| 3398 | |
| 3399 | /** |
| 3400 | * ipa3_set_single_ndp_per_mbim() - Enable/disable single NDP per MBIM frame |
| 3401 | * configuration |
| 3402 | * @enable: [in] true for single NDP/MBIM; false otherwise |
| 3403 | * |
| 3404 | * Returns: 0 on success |
| 3405 | */ |
| 3406 | int ipa3_set_single_ndp_per_mbim(bool enable) |
| 3407 | { |
| 3408 | struct ipahal_reg_single_ndp_mode mode; |
| 3409 | |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 3410 | if (ipa3_ctx->ipa_hw_type >= IPA_HW_v4_0) { |
| 3411 | IPAERR("QCNCM mode is not supported staring 4.0\n"); |
| 3412 | return -EPERM; |
| 3413 | } |
| 3414 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3415 | IPA_ACTIVE_CLIENTS_INC_SIMPLE(); |
| 3416 | ipahal_read_reg_fields(IPA_SINGLE_NDP_MODE, &mode); |
| 3417 | mode.single_ndp_en = enable; |
| 3418 | ipahal_write_reg_fields(IPA_SINGLE_NDP_MODE, &mode); |
| 3419 | IPA_ACTIVE_CLIENTS_DEC_SIMPLE(); |
| 3420 | |
| 3421 | return 0; |
| 3422 | } |
| 3423 | |
| 3424 | /** |
| 3425 | * ipa3_straddle_boundary() - Checks whether a memory buffer straddles a |
| 3426 | * boundary |
| 3427 | * @start: start address of the memory buffer |
| 3428 | * @end: end address of the memory buffer |
| 3429 | * @boundary: boundary |
| 3430 | * |
| 3431 | * Return value: |
| 3432 | * 1: if the interval [start, end] straddles boundary |
| 3433 | * 0: otherwise |
| 3434 | */ |
| 3435 | int ipa3_straddle_boundary(u32 start, u32 end, u32 boundary) |
| 3436 | { |
| 3437 | u32 next_start; |
| 3438 | u32 prev_end; |
| 3439 | |
| 3440 | IPADBG("start=%u end=%u boundary=%u\n", start, end, boundary); |
| 3441 | |
| 3442 | next_start = (start + (boundary - 1)) & ~(boundary - 1); |
| 3443 | prev_end = ((end + (boundary - 1)) & ~(boundary - 1)) - boundary; |
| 3444 | |
| 3445 | while (next_start < prev_end) |
| 3446 | next_start += boundary; |
| 3447 | |
| 3448 | if (next_start == prev_end) |
| 3449 | return 1; |
| 3450 | else |
| 3451 | return 0; |
| 3452 | } |
| 3453 | |
| 3454 | /** |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3455 | * ipa3_init_mem_partition() - Reads IPA memory map from DTS, performs alignment |
| 3456 | * checks and logs the fetched values. |
| 3457 | * |
| 3458 | * Returns: 0 on success |
| 3459 | */ |
| 3460 | int ipa3_init_mem_partition(struct device_node *node) |
| 3461 | { |
Amir Levy | 9fadeca | 2017-04-25 10:18:32 +0300 | [diff] [blame] | 3462 | const size_t ram_mmap_current_version_size = |
| 3463 | sizeof(ipa3_ctx->ctrl->mem_partition) / sizeof(u32); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3464 | int result; |
| 3465 | |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 3466 | memset(&ipa3_ctx->ctrl->mem_partition, 0, |
| 3467 | sizeof(ipa3_ctx->ctrl->mem_partition)); |
| 3468 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3469 | IPADBG("Reading from DTS as u32 array\n"); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3470 | |
Amir Levy | 9fadeca | 2017-04-25 10:18:32 +0300 | [diff] [blame] | 3471 | /* |
| 3472 | * The size of ipa-ram-mmap array depends on the IPA version. The |
| 3473 | * actual size can't be assumed because of possible DTS versions |
| 3474 | * mismatch. The size of the array monotonically increasing because the |
| 3475 | * obsolete entries are set to zero rather than deleted, so the |
| 3476 | * possible sizes are in range |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 3477 | * [1, ram_mmap_current_version_size] |
Amir Levy | 9fadeca | 2017-04-25 10:18:32 +0300 | [diff] [blame] | 3478 | */ |
| 3479 | result = of_property_read_variable_u32_array(node, "qcom,ipa-ram-mmap", |
| 3480 | (u32 *)&ipa3_ctx->ctrl->mem_partition, |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 3481 | 1, ram_mmap_current_version_size); |
Amir Levy | 9fadeca | 2017-04-25 10:18:32 +0300 | [diff] [blame] | 3482 | |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 3483 | if (IPA_MEM_PART(uc_event_ring_ofst) & 1023) { |
| 3484 | IPAERR("UC EVENT RING OFST 0x%x is unaligned\n", |
| 3485 | IPA_MEM_PART(uc_event_ring_ofst)); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3486 | return -ENODEV; |
| 3487 | } |
Amir Levy | 9fadeca | 2017-04-25 10:18:32 +0300 | [diff] [blame] | 3488 | |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 3489 | IPADBG("UC EVENT RING OFST 0x%x SIZE 0x%x\n", |
| 3490 | IPA_MEM_PART(uc_event_ring_ofst), |
| 3491 | IPA_MEM_PART(uc_event_ring_size)); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3492 | |
| 3493 | IPADBG("NAT OFST 0x%x SIZE 0x%x\n", IPA_MEM_PART(nat_ofst), |
| 3494 | IPA_MEM_PART(nat_size)); |
| 3495 | |
| 3496 | if (IPA_MEM_PART(uc_info_ofst) & 3) { |
| 3497 | IPAERR("UC INFO OFST 0x%x is unaligned\n", |
| 3498 | IPA_MEM_PART(uc_info_ofst)); |
| 3499 | return -ENODEV; |
| 3500 | } |
| 3501 | |
| 3502 | IPADBG("UC INFO OFST 0x%x SIZE 0x%x\n", |
| 3503 | IPA_MEM_PART(uc_info_ofst), IPA_MEM_PART(uc_info_size)); |
| 3504 | |
| 3505 | IPADBG("RAM OFST 0x%x\n", IPA_MEM_PART(ofst_start)); |
| 3506 | |
| 3507 | if (IPA_MEM_PART(v4_flt_hash_ofst) & 7) { |
| 3508 | IPAERR("V4 FLT HASHABLE OFST 0x%x is unaligned\n", |
| 3509 | IPA_MEM_PART(v4_flt_hash_ofst)); |
| 3510 | return -ENODEV; |
| 3511 | } |
| 3512 | |
| 3513 | IPADBG("V4 FLT HASHABLE OFST 0x%x SIZE 0x%x DDR SIZE 0x%x\n", |
| 3514 | IPA_MEM_PART(v4_flt_hash_ofst), |
| 3515 | IPA_MEM_PART(v4_flt_hash_size), |
| 3516 | IPA_MEM_PART(v4_flt_hash_size_ddr)); |
| 3517 | |
| 3518 | if (IPA_MEM_PART(v4_flt_nhash_ofst) & 7) { |
| 3519 | IPAERR("V4 FLT NON-HASHABLE OFST 0x%x is unaligned\n", |
| 3520 | IPA_MEM_PART(v4_flt_nhash_ofst)); |
| 3521 | return -ENODEV; |
| 3522 | } |
| 3523 | |
| 3524 | IPADBG("V4 FLT NON-HASHABLE OFST 0x%x SIZE 0x%x DDR SIZE 0x%x\n", |
| 3525 | IPA_MEM_PART(v4_flt_nhash_ofst), |
| 3526 | IPA_MEM_PART(v4_flt_nhash_size), |
| 3527 | IPA_MEM_PART(v4_flt_nhash_size_ddr)); |
| 3528 | |
| 3529 | if (IPA_MEM_PART(v6_flt_hash_ofst) & 7) { |
| 3530 | IPAERR("V6 FLT HASHABLE OFST 0x%x is unaligned\n", |
| 3531 | IPA_MEM_PART(v6_flt_hash_ofst)); |
| 3532 | return -ENODEV; |
| 3533 | } |
| 3534 | |
| 3535 | IPADBG("V6 FLT HASHABLE OFST 0x%x SIZE 0x%x DDR SIZE 0x%x\n", |
| 3536 | IPA_MEM_PART(v6_flt_hash_ofst), IPA_MEM_PART(v6_flt_hash_size), |
| 3537 | IPA_MEM_PART(v6_flt_hash_size_ddr)); |
| 3538 | |
| 3539 | if (IPA_MEM_PART(v6_flt_nhash_ofst) & 7) { |
| 3540 | IPAERR("V6 FLT NON-HASHABLE OFST 0x%x is unaligned\n", |
| 3541 | IPA_MEM_PART(v6_flt_nhash_ofst)); |
| 3542 | return -ENODEV; |
| 3543 | } |
| 3544 | |
| 3545 | IPADBG("V6 FLT NON-HASHABLE OFST 0x%x SIZE 0x%x DDR SIZE 0x%x\n", |
| 3546 | IPA_MEM_PART(v6_flt_nhash_ofst), |
| 3547 | IPA_MEM_PART(v6_flt_nhash_size), |
| 3548 | IPA_MEM_PART(v6_flt_nhash_size_ddr)); |
| 3549 | |
| 3550 | IPADBG("V4 RT NUM INDEX 0x%x\n", IPA_MEM_PART(v4_rt_num_index)); |
| 3551 | |
| 3552 | IPADBG("V4 RT MODEM INDEXES 0x%x - 0x%x\n", |
| 3553 | IPA_MEM_PART(v4_modem_rt_index_lo), |
| 3554 | IPA_MEM_PART(v4_modem_rt_index_hi)); |
| 3555 | |
| 3556 | IPADBG("V4 RT APPS INDEXES 0x%x - 0x%x\n", |
| 3557 | IPA_MEM_PART(v4_apps_rt_index_lo), |
| 3558 | IPA_MEM_PART(v4_apps_rt_index_hi)); |
| 3559 | |
| 3560 | if (IPA_MEM_PART(v4_rt_hash_ofst) & 7) { |
| 3561 | IPAERR("V4 RT HASHABLE OFST 0x%x is unaligned\n", |
| 3562 | IPA_MEM_PART(v4_rt_hash_ofst)); |
| 3563 | return -ENODEV; |
| 3564 | } |
| 3565 | |
| 3566 | IPADBG("V4 RT HASHABLE OFST 0x%x\n", IPA_MEM_PART(v4_rt_hash_ofst)); |
| 3567 | |
| 3568 | IPADBG("V4 RT HASHABLE SIZE 0x%x DDR SIZE 0x%x\n", |
| 3569 | IPA_MEM_PART(v4_rt_hash_size), |
| 3570 | IPA_MEM_PART(v4_rt_hash_size_ddr)); |
| 3571 | |
| 3572 | if (IPA_MEM_PART(v4_rt_nhash_ofst) & 7) { |
| 3573 | IPAERR("V4 RT NON-HASHABLE OFST 0x%x is unaligned\n", |
| 3574 | IPA_MEM_PART(v4_rt_nhash_ofst)); |
| 3575 | return -ENODEV; |
| 3576 | } |
| 3577 | |
| 3578 | IPADBG("V4 RT NON-HASHABLE OFST 0x%x\n", |
| 3579 | IPA_MEM_PART(v4_rt_nhash_ofst)); |
| 3580 | |
| 3581 | IPADBG("V4 RT HASHABLE SIZE 0x%x DDR SIZE 0x%x\n", |
| 3582 | IPA_MEM_PART(v4_rt_nhash_size), |
| 3583 | IPA_MEM_PART(v4_rt_nhash_size_ddr)); |
| 3584 | |
| 3585 | IPADBG("V6 RT NUM INDEX 0x%x\n", IPA_MEM_PART(v6_rt_num_index)); |
| 3586 | |
| 3587 | IPADBG("V6 RT MODEM INDEXES 0x%x - 0x%x\n", |
| 3588 | IPA_MEM_PART(v6_modem_rt_index_lo), |
| 3589 | IPA_MEM_PART(v6_modem_rt_index_hi)); |
| 3590 | |
| 3591 | IPADBG("V6 RT APPS INDEXES 0x%x - 0x%x\n", |
| 3592 | IPA_MEM_PART(v6_apps_rt_index_lo), |
| 3593 | IPA_MEM_PART(v6_apps_rt_index_hi)); |
| 3594 | |
| 3595 | if (IPA_MEM_PART(v6_rt_hash_ofst) & 7) { |
| 3596 | IPAERR("V6 RT HASHABLE OFST 0x%x is unaligned\n", |
| 3597 | IPA_MEM_PART(v6_rt_hash_ofst)); |
| 3598 | return -ENODEV; |
| 3599 | } |
| 3600 | |
| 3601 | IPADBG("V6 RT HASHABLE OFST 0x%x\n", IPA_MEM_PART(v6_rt_hash_ofst)); |
| 3602 | |
| 3603 | IPADBG("V6 RT HASHABLE SIZE 0x%x DDR SIZE 0x%x\n", |
| 3604 | IPA_MEM_PART(v6_rt_hash_size), |
| 3605 | IPA_MEM_PART(v6_rt_hash_size_ddr)); |
| 3606 | |
| 3607 | if (IPA_MEM_PART(v6_rt_nhash_ofst) & 7) { |
| 3608 | IPAERR("V6 RT NON-HASHABLE OFST 0x%x is unaligned\n", |
| 3609 | IPA_MEM_PART(v6_rt_nhash_ofst)); |
| 3610 | return -ENODEV; |
| 3611 | } |
| 3612 | |
| 3613 | IPADBG("V6 RT NON-HASHABLE OFST 0x%x\n", |
| 3614 | IPA_MEM_PART(v6_rt_nhash_ofst)); |
| 3615 | |
| 3616 | IPADBG("V6 RT NON-HASHABLE SIZE 0x%x DDR SIZE 0x%x\n", |
| 3617 | IPA_MEM_PART(v6_rt_nhash_size), |
| 3618 | IPA_MEM_PART(v6_rt_nhash_size_ddr)); |
| 3619 | |
| 3620 | if (IPA_MEM_PART(modem_hdr_ofst) & 7) { |
| 3621 | IPAERR("MODEM HDR OFST 0x%x is unaligned\n", |
| 3622 | IPA_MEM_PART(modem_hdr_ofst)); |
| 3623 | return -ENODEV; |
| 3624 | } |
| 3625 | |
| 3626 | IPADBG("MODEM HDR OFST 0x%x SIZE 0x%x\n", |
| 3627 | IPA_MEM_PART(modem_hdr_ofst), IPA_MEM_PART(modem_hdr_size)); |
| 3628 | |
| 3629 | if (IPA_MEM_PART(apps_hdr_ofst) & 7) { |
| 3630 | IPAERR("APPS HDR OFST 0x%x is unaligned\n", |
| 3631 | IPA_MEM_PART(apps_hdr_ofst)); |
| 3632 | return -ENODEV; |
| 3633 | } |
| 3634 | |
| 3635 | IPADBG("APPS HDR OFST 0x%x SIZE 0x%x DDR SIZE 0x%x\n", |
| 3636 | IPA_MEM_PART(apps_hdr_ofst), IPA_MEM_PART(apps_hdr_size), |
| 3637 | IPA_MEM_PART(apps_hdr_size_ddr)); |
| 3638 | |
| 3639 | if (IPA_MEM_PART(modem_hdr_proc_ctx_ofst) & 7) { |
| 3640 | IPAERR("MODEM HDR PROC CTX OFST 0x%x is unaligned\n", |
| 3641 | IPA_MEM_PART(modem_hdr_proc_ctx_ofst)); |
| 3642 | return -ENODEV; |
| 3643 | } |
| 3644 | |
| 3645 | IPADBG("MODEM HDR PROC CTX OFST 0x%x SIZE 0x%x\n", |
| 3646 | IPA_MEM_PART(modem_hdr_proc_ctx_ofst), |
| 3647 | IPA_MEM_PART(modem_hdr_proc_ctx_size)); |
| 3648 | |
| 3649 | if (IPA_MEM_PART(apps_hdr_proc_ctx_ofst) & 7) { |
| 3650 | IPAERR("APPS HDR PROC CTX OFST 0x%x is unaligned\n", |
| 3651 | IPA_MEM_PART(apps_hdr_proc_ctx_ofst)); |
| 3652 | return -ENODEV; |
| 3653 | } |
| 3654 | |
| 3655 | IPADBG("APPS HDR PROC CTX OFST 0x%x SIZE 0x%x DDR SIZE 0x%x\n", |
| 3656 | IPA_MEM_PART(apps_hdr_proc_ctx_ofst), |
| 3657 | IPA_MEM_PART(apps_hdr_proc_ctx_size), |
| 3658 | IPA_MEM_PART(apps_hdr_proc_ctx_size_ddr)); |
| 3659 | |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 3660 | if (IPA_MEM_PART(pdn_config_ofst) & 7) { |
| 3661 | IPAERR("PDN CONFIG OFST 0x%x is unaligned\n", |
| 3662 | IPA_MEM_PART(pdn_config_ofst)); |
| 3663 | return -ENODEV; |
| 3664 | } |
| 3665 | |
| 3666 | IPADBG("PDN CONFIG OFST 0x%x SIZE 0x%x\n", |
| 3667 | IPA_MEM_PART(pdn_config_ofst), |
| 3668 | IPA_MEM_PART(pdn_config_size)); |
| 3669 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3670 | if (IPA_MEM_PART(modem_ofst) & 7) { |
| 3671 | IPAERR("MODEM OFST 0x%x is unaligned\n", |
| 3672 | IPA_MEM_PART(modem_ofst)); |
| 3673 | return -ENODEV; |
| 3674 | } |
| 3675 | |
| 3676 | IPADBG("MODEM OFST 0x%x SIZE 0x%x\n", IPA_MEM_PART(modem_ofst), |
| 3677 | IPA_MEM_PART(modem_size)); |
| 3678 | |
| 3679 | IPADBG("V4 APPS HASHABLE FLT OFST 0x%x SIZE 0x%x\n", |
| 3680 | IPA_MEM_PART(apps_v4_flt_hash_ofst), |
| 3681 | IPA_MEM_PART(apps_v4_flt_hash_size)); |
| 3682 | |
| 3683 | IPADBG("V4 APPS NON-HASHABLE FLT OFST 0x%x SIZE 0x%x\n", |
| 3684 | IPA_MEM_PART(apps_v4_flt_nhash_ofst), |
| 3685 | IPA_MEM_PART(apps_v4_flt_nhash_size)); |
| 3686 | |
| 3687 | IPADBG("V6 APPS HASHABLE FLT OFST 0x%x SIZE 0x%x\n", |
| 3688 | IPA_MEM_PART(apps_v6_flt_hash_ofst), |
| 3689 | IPA_MEM_PART(apps_v6_flt_hash_size)); |
| 3690 | |
| 3691 | IPADBG("V6 APPS NON-HASHABLE FLT OFST 0x%x SIZE 0x%x\n", |
| 3692 | IPA_MEM_PART(apps_v6_flt_nhash_ofst), |
| 3693 | IPA_MEM_PART(apps_v6_flt_nhash_size)); |
| 3694 | |
| 3695 | IPADBG("RAM END OFST 0x%x\n", |
| 3696 | IPA_MEM_PART(end_ofst)); |
| 3697 | |
| 3698 | IPADBG("V4 APPS HASHABLE RT OFST 0x%x SIZE 0x%x\n", |
| 3699 | IPA_MEM_PART(apps_v4_rt_hash_ofst), |
| 3700 | IPA_MEM_PART(apps_v4_rt_hash_size)); |
| 3701 | |
| 3702 | IPADBG("V4 APPS NON-HASHABLE RT OFST 0x%x SIZE 0x%x\n", |
| 3703 | IPA_MEM_PART(apps_v4_rt_nhash_ofst), |
| 3704 | IPA_MEM_PART(apps_v4_rt_nhash_size)); |
| 3705 | |
| 3706 | IPADBG("V6 APPS HASHABLE RT OFST 0x%x SIZE 0x%x\n", |
| 3707 | IPA_MEM_PART(apps_v6_rt_hash_ofst), |
| 3708 | IPA_MEM_PART(apps_v6_rt_hash_size)); |
| 3709 | |
| 3710 | IPADBG("V6 APPS NON-HASHABLE RT OFST 0x%x SIZE 0x%x\n", |
| 3711 | IPA_MEM_PART(apps_v6_rt_nhash_ofst), |
| 3712 | IPA_MEM_PART(apps_v6_rt_nhash_size)); |
| 3713 | |
| 3714 | return 0; |
| 3715 | } |
| 3716 | |
| 3717 | /** |
| 3718 | * ipa_ctrl_static_bind() - set the appropriate methods for |
| 3719 | * IPA Driver based on the HW version |
| 3720 | * |
| 3721 | * @ctrl: data structure which holds the function pointers |
| 3722 | * @hw_type: the HW type in use |
| 3723 | * |
| 3724 | * This function can avoid the runtime assignment by using C99 special |
| 3725 | * struct initialization - hard decision... time.vs.mem |
| 3726 | */ |
| 3727 | int ipa3_controller_static_bind(struct ipa3_controller *ctrl, |
| 3728 | enum ipa_hw_type hw_type) |
| 3729 | { |
Skylar Chang | f88124c | 2017-07-18 18:11:25 -0700 | [diff] [blame] | 3730 | if (hw_type >= IPA_HW_v4_0) { |
| 3731 | ctrl->ipa_clk_rate_turbo = IPA_V4_0_CLK_RATE_TURBO; |
| 3732 | ctrl->ipa_clk_rate_nominal = IPA_V4_0_CLK_RATE_NOMINAL; |
| 3733 | ctrl->ipa_clk_rate_svs = IPA_V4_0_CLK_RATE_SVS; |
Skylar Chang | 448d8b8 | 2017-08-08 17:30:32 -0700 | [diff] [blame] | 3734 | ctrl->ipa_clk_rate_svs2 = IPA_V4_0_CLK_RATE_SVS2; |
Skylar Chang | f88124c | 2017-07-18 18:11:25 -0700 | [diff] [blame] | 3735 | } else if (hw_type >= IPA_HW_v3_5) { |
| 3736 | ctrl->ipa_clk_rate_turbo = IPA_V3_5_CLK_RATE_TURBO; |
| 3737 | ctrl->ipa_clk_rate_nominal = IPA_V3_5_CLK_RATE_NOMINAL; |
| 3738 | ctrl->ipa_clk_rate_svs = IPA_V3_5_CLK_RATE_SVS; |
Skylar Chang | 448d8b8 | 2017-08-08 17:30:32 -0700 | [diff] [blame] | 3739 | ctrl->ipa_clk_rate_svs2 = IPA_V3_5_CLK_RATE_SVS2; |
Skylar Chang | f88124c | 2017-07-18 18:11:25 -0700 | [diff] [blame] | 3740 | } else { |
| 3741 | ctrl->ipa_clk_rate_turbo = IPA_V3_0_CLK_RATE_TURBO; |
| 3742 | ctrl->ipa_clk_rate_nominal = IPA_V3_0_CLK_RATE_NOMINAL; |
| 3743 | ctrl->ipa_clk_rate_svs = IPA_V3_0_CLK_RATE_SVS; |
Skylar Chang | 448d8b8 | 2017-08-08 17:30:32 -0700 | [diff] [blame] | 3744 | ctrl->ipa_clk_rate_svs2 = IPA_V3_0_CLK_RATE_SVS2; |
Skylar Chang | f88124c | 2017-07-18 18:11:25 -0700 | [diff] [blame] | 3745 | } |
| 3746 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3747 | ctrl->ipa_init_rt4 = _ipa_init_rt4_v3; |
| 3748 | ctrl->ipa_init_rt6 = _ipa_init_rt6_v3; |
| 3749 | ctrl->ipa_init_flt4 = _ipa_init_flt4_v3; |
| 3750 | ctrl->ipa_init_flt6 = _ipa_init_flt6_v3; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3751 | ctrl->ipa3_read_ep_reg = _ipa_read_ep_reg_v3_0; |
| 3752 | ctrl->ipa3_commit_flt = __ipa_commit_flt_v3; |
| 3753 | ctrl->ipa3_commit_rt = __ipa_commit_rt_v3; |
| 3754 | ctrl->ipa3_commit_hdr = __ipa_commit_hdr_v3_0; |
| 3755 | ctrl->ipa3_enable_clks = _ipa_enable_clks_v3_0; |
| 3756 | ctrl->ipa3_disable_clks = _ipa_disable_clks_v3_0; |
| 3757 | ctrl->msm_bus_data_ptr = &ipa_bus_client_pdata_v3_0; |
Skylar Chang | 448d8b8 | 2017-08-08 17:30:32 -0700 | [diff] [blame] | 3758 | ctrl->clock_scaling_bw_threshold_svs = |
| 3759 | IPA_V3_0_BW_THRESHOLD_SVS_MBPS; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3760 | ctrl->clock_scaling_bw_threshold_nominal = |
| 3761 | IPA_V3_0_BW_THRESHOLD_NOMINAL_MBPS; |
| 3762 | ctrl->clock_scaling_bw_threshold_turbo = |
| 3763 | IPA_V3_0_BW_THRESHOLD_TURBO_MBPS; |
| 3764 | ctrl->ipa_reg_base_ofst = ipahal_get_reg_base(); |
Amir Levy | 9fadeca | 2017-04-25 10:18:32 +0300 | [diff] [blame] | 3765 | ctrl->ipa_init_sram = _ipa_init_sram_v3; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3766 | ctrl->ipa_sram_read_settings = _ipa_sram_settings_read_v3_0; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3767 | ctrl->ipa_init_hdr = _ipa_init_hdr_v3_0; |
| 3768 | |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 3769 | if (ipa3_ctx->ipa_hw_type >= IPA_HW_v4_0) |
| 3770 | ctrl->ipa3_read_ep_reg = _ipa_read_ep_reg_v4_0; |
| 3771 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3772 | return 0; |
| 3773 | } |
| 3774 | |
| 3775 | void ipa3_skb_recycle(struct sk_buff *skb) |
| 3776 | { |
| 3777 | struct skb_shared_info *shinfo; |
| 3778 | |
| 3779 | shinfo = skb_shinfo(skb); |
| 3780 | memset(shinfo, 0, offsetof(struct skb_shared_info, dataref)); |
| 3781 | atomic_set(&shinfo->dataref, 1); |
| 3782 | |
| 3783 | memset(skb, 0, offsetof(struct sk_buff, tail)); |
| 3784 | skb->data = skb->head + NET_SKB_PAD; |
| 3785 | skb_reset_tail_pointer(skb); |
| 3786 | } |
| 3787 | |
| 3788 | int ipa3_alloc_rule_id(struct idr *rule_ids) |
| 3789 | { |
| 3790 | /* There is two groups of rule-Ids, Modem ones and Apps ones. |
| 3791 | * Distinction by high bit: Modem Ids are high bit asserted. |
| 3792 | */ |
| 3793 | return idr_alloc(rule_ids, NULL, |
| 3794 | ipahal_get_low_rule_id(), ipahal_get_rule_id_hi_bit(), |
| 3795 | GFP_KERNEL); |
| 3796 | } |
| 3797 | |
| 3798 | int ipa3_id_alloc(void *ptr) |
| 3799 | { |
| 3800 | int id; |
| 3801 | |
| 3802 | idr_preload(GFP_KERNEL); |
| 3803 | spin_lock(&ipa3_ctx->idr_lock); |
| 3804 | id = idr_alloc(&ipa3_ctx->ipa_idr, ptr, 0, 0, GFP_NOWAIT); |
| 3805 | spin_unlock(&ipa3_ctx->idr_lock); |
| 3806 | idr_preload_end(); |
| 3807 | |
| 3808 | return id; |
| 3809 | } |
| 3810 | |
| 3811 | void *ipa3_id_find(u32 id) |
| 3812 | { |
| 3813 | void *ptr; |
| 3814 | |
| 3815 | spin_lock(&ipa3_ctx->idr_lock); |
| 3816 | ptr = idr_find(&ipa3_ctx->ipa_idr, id); |
| 3817 | spin_unlock(&ipa3_ctx->idr_lock); |
| 3818 | |
| 3819 | return ptr; |
| 3820 | } |
| 3821 | |
| 3822 | void ipa3_id_remove(u32 id) |
| 3823 | { |
| 3824 | spin_lock(&ipa3_ctx->idr_lock); |
| 3825 | idr_remove(&ipa3_ctx->ipa_idr, id); |
| 3826 | spin_unlock(&ipa3_ctx->idr_lock); |
| 3827 | } |
| 3828 | |
| 3829 | void ipa3_tag_destroy_imm(void *user1, int user2) |
| 3830 | { |
| 3831 | ipahal_destroy_imm_cmd(user1); |
| 3832 | } |
| 3833 | |
| 3834 | static void ipa3_tag_free_skb(void *user1, int user2) |
| 3835 | { |
| 3836 | dev_kfree_skb_any((struct sk_buff *)user1); |
| 3837 | } |
| 3838 | |
| 3839 | #define REQUIRED_TAG_PROCESS_DESCRIPTORS 4 |
| 3840 | |
| 3841 | /* ipa3_tag_process() - Initiates a tag process. Incorporates the input |
| 3842 | * descriptors |
| 3843 | * |
| 3844 | * @desc: descriptors with commands for IC |
| 3845 | * @desc_size: amount of descriptors in the above variable |
| 3846 | * |
| 3847 | * Note: The descriptors are copied (if there's room), the client needs to |
| 3848 | * free his descriptors afterwards |
| 3849 | * |
| 3850 | * Return: 0 or negative in case of failure |
| 3851 | */ |
| 3852 | int ipa3_tag_process(struct ipa3_desc desc[], |
| 3853 | int descs_num, |
| 3854 | unsigned long timeout) |
| 3855 | { |
| 3856 | struct ipa3_sys_context *sys; |
| 3857 | struct ipa3_desc *tag_desc; |
| 3858 | int desc_idx = 0; |
| 3859 | struct ipahal_imm_cmd_ip_packet_init pktinit_cmd; |
| 3860 | struct ipahal_imm_cmd_pyld *cmd_pyld = NULL; |
| 3861 | struct ipahal_imm_cmd_ip_packet_tag_status status; |
| 3862 | int i; |
| 3863 | struct sk_buff *dummy_skb; |
| 3864 | int res; |
| 3865 | struct ipa3_tag_completion *comp; |
| 3866 | int ep_idx; |
| 3867 | |
| 3868 | /* Not enough room for the required descriptors for the tag process */ |
| 3869 | if (IPA_TAG_MAX_DESC - descs_num < REQUIRED_TAG_PROCESS_DESCRIPTORS) { |
| 3870 | IPAERR("up to %d descriptors are allowed (received %d)\n", |
| 3871 | IPA_TAG_MAX_DESC - REQUIRED_TAG_PROCESS_DESCRIPTORS, |
| 3872 | descs_num); |
| 3873 | return -ENOMEM; |
| 3874 | } |
| 3875 | |
| 3876 | ep_idx = ipa3_get_ep_mapping(IPA_CLIENT_APPS_CMD_PROD); |
| 3877 | if (-1 == ep_idx) { |
| 3878 | IPAERR("Client %u is not mapped\n", |
| 3879 | IPA_CLIENT_APPS_CMD_PROD); |
| 3880 | return -EFAULT; |
| 3881 | } |
| 3882 | sys = ipa3_ctx->ep[ep_idx].sys; |
| 3883 | |
| 3884 | tag_desc = kzalloc(sizeof(*tag_desc) * IPA_TAG_MAX_DESC, GFP_KERNEL); |
| 3885 | if (!tag_desc) { |
| 3886 | IPAERR("failed to allocate memory\n"); |
| 3887 | return -ENOMEM; |
| 3888 | } |
| 3889 | |
| 3890 | /* Copy the required descriptors from the client now */ |
| 3891 | if (desc) { |
| 3892 | memcpy(&(tag_desc[0]), desc, descs_num * |
| 3893 | sizeof(tag_desc[0])); |
| 3894 | desc_idx += descs_num; |
| 3895 | } |
| 3896 | |
| 3897 | /* NO-OP IC for ensuring that IPA pipeline is empty */ |
| 3898 | cmd_pyld = ipahal_construct_nop_imm_cmd( |
| 3899 | false, IPAHAL_FULL_PIPELINE_CLEAR, false); |
| 3900 | if (!cmd_pyld) { |
| 3901 | IPAERR("failed to construct NOP imm cmd\n"); |
| 3902 | res = -ENOMEM; |
| 3903 | goto fail_free_tag_desc; |
| 3904 | } |
Amir Levy | 479cfdd | 2017-10-26 12:23:14 +0300 | [diff] [blame] | 3905 | ipa3_init_imm_cmd_desc(&tag_desc[desc_idx], cmd_pyld); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3906 | tag_desc[desc_idx].callback = ipa3_tag_destroy_imm; |
| 3907 | tag_desc[desc_idx].user1 = cmd_pyld; |
Amir Levy | 479cfdd | 2017-10-26 12:23:14 +0300 | [diff] [blame] | 3908 | ++desc_idx; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3909 | |
| 3910 | /* IP_PACKET_INIT IC for tag status to be sent to apps */ |
| 3911 | pktinit_cmd.destination_pipe_index = |
| 3912 | ipa3_get_ep_mapping(IPA_CLIENT_APPS_LAN_CONS); |
| 3913 | cmd_pyld = ipahal_construct_imm_cmd( |
| 3914 | IPA_IMM_CMD_IP_PACKET_INIT, &pktinit_cmd, false); |
| 3915 | if (!cmd_pyld) { |
| 3916 | IPAERR("failed to construct ip_packet_init imm cmd\n"); |
| 3917 | res = -ENOMEM; |
| 3918 | goto fail_free_desc; |
| 3919 | } |
Amir Levy | 479cfdd | 2017-10-26 12:23:14 +0300 | [diff] [blame] | 3920 | ipa3_init_imm_cmd_desc(&tag_desc[desc_idx], cmd_pyld); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3921 | tag_desc[desc_idx].callback = ipa3_tag_destroy_imm; |
| 3922 | tag_desc[desc_idx].user1 = cmd_pyld; |
Amir Levy | 479cfdd | 2017-10-26 12:23:14 +0300 | [diff] [blame] | 3923 | ++desc_idx; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3924 | |
| 3925 | /* status IC */ |
| 3926 | status.tag = IPA_COOKIE; |
| 3927 | cmd_pyld = ipahal_construct_imm_cmd( |
| 3928 | IPA_IMM_CMD_IP_PACKET_TAG_STATUS, &status, false); |
| 3929 | if (!cmd_pyld) { |
| 3930 | IPAERR("failed to construct ip_packet_tag_status imm cmd\n"); |
| 3931 | res = -ENOMEM; |
| 3932 | goto fail_free_desc; |
| 3933 | } |
Amir Levy | 479cfdd | 2017-10-26 12:23:14 +0300 | [diff] [blame] | 3934 | ipa3_init_imm_cmd_desc(&tag_desc[desc_idx], cmd_pyld); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3935 | tag_desc[desc_idx].callback = ipa3_tag_destroy_imm; |
| 3936 | tag_desc[desc_idx].user1 = cmd_pyld; |
Amir Levy | 479cfdd | 2017-10-26 12:23:14 +0300 | [diff] [blame] | 3937 | ++desc_idx; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3938 | |
| 3939 | comp = kzalloc(sizeof(*comp), GFP_KERNEL); |
| 3940 | if (!comp) { |
| 3941 | IPAERR("no mem\n"); |
| 3942 | res = -ENOMEM; |
| 3943 | goto fail_free_desc; |
| 3944 | } |
| 3945 | init_completion(&comp->comp); |
| 3946 | |
| 3947 | /* completion needs to be released from both here and rx handler */ |
| 3948 | atomic_set(&comp->cnt, 2); |
| 3949 | |
| 3950 | /* dummy packet to send to IPA. packet payload is a completion object */ |
| 3951 | dummy_skb = alloc_skb(sizeof(comp), GFP_KERNEL); |
| 3952 | if (!dummy_skb) { |
| 3953 | IPAERR("failed to allocate memory\n"); |
| 3954 | res = -ENOMEM; |
| 3955 | goto fail_free_comp; |
| 3956 | } |
| 3957 | |
| 3958 | memcpy(skb_put(dummy_skb, sizeof(comp)), &comp, sizeof(comp)); |
| 3959 | |
Amir Levy | 479cfdd | 2017-10-26 12:23:14 +0300 | [diff] [blame] | 3960 | if (desc_idx >= IPA_TAG_MAX_DESC) { |
| 3961 | IPAERR("number of commands is out of range\n"); |
| 3962 | res = -ENOBUFS; |
| 3963 | goto fail_free_skb; |
| 3964 | } |
| 3965 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3966 | tag_desc[desc_idx].pyld = dummy_skb->data; |
| 3967 | tag_desc[desc_idx].len = dummy_skb->len; |
| 3968 | tag_desc[desc_idx].type = IPA_DATA_DESC_SKB; |
| 3969 | tag_desc[desc_idx].callback = ipa3_tag_free_skb; |
| 3970 | tag_desc[desc_idx].user1 = dummy_skb; |
| 3971 | desc_idx++; |
| 3972 | |
| 3973 | /* send all descriptors to IPA with single EOT */ |
| 3974 | res = ipa3_send(sys, desc_idx, tag_desc, true); |
| 3975 | if (res) { |
| 3976 | IPAERR("failed to send TAG packets %d\n", res); |
| 3977 | res = -ENOMEM; |
Amir Levy | 479cfdd | 2017-10-26 12:23:14 +0300 | [diff] [blame] | 3978 | goto fail_free_skb; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 3979 | } |
| 3980 | kfree(tag_desc); |
| 3981 | tag_desc = NULL; |
| 3982 | |
| 3983 | IPADBG("waiting for TAG response\n"); |
| 3984 | res = wait_for_completion_timeout(&comp->comp, timeout); |
| 3985 | if (res == 0) { |
| 3986 | IPAERR("timeout (%lu msec) on waiting for TAG response\n", |
| 3987 | timeout); |
| 3988 | WARN_ON(1); |
| 3989 | if (atomic_dec_return(&comp->cnt) == 0) |
| 3990 | kfree(comp); |
| 3991 | return -ETIME; |
| 3992 | } |
| 3993 | |
| 3994 | IPADBG("TAG response arrived!\n"); |
| 3995 | if (atomic_dec_return(&comp->cnt) == 0) |
| 3996 | kfree(comp); |
| 3997 | |
Amir Levy | a59ed3f | 2017-03-05 17:30:55 +0200 | [diff] [blame] | 3998 | /* |
| 3999 | * sleep for short period to ensure IPA wrote all packets to |
| 4000 | * the transport |
| 4001 | */ |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4002 | usleep_range(IPA_TAG_SLEEP_MIN_USEC, IPA_TAG_SLEEP_MAX_USEC); |
| 4003 | |
| 4004 | return 0; |
| 4005 | |
Amir Levy | 479cfdd | 2017-10-26 12:23:14 +0300 | [diff] [blame] | 4006 | fail_free_skb: |
| 4007 | kfree_skb(dummy_skb); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4008 | fail_free_comp: |
| 4009 | kfree(comp); |
| 4010 | fail_free_desc: |
| 4011 | /* |
| 4012 | * Free only the first descriptors allocated here. |
| 4013 | * [nop, pkt_init, status, dummy_skb] |
| 4014 | * The user is responsible to free his allocations |
| 4015 | * in case of failure. |
| 4016 | * The min is required because we may fail during |
| 4017 | * of the initial allocations above |
| 4018 | */ |
| 4019 | for (i = descs_num; |
| 4020 | i < min(REQUIRED_TAG_PROCESS_DESCRIPTORS, desc_idx); i++) |
| 4021 | if (tag_desc[i].callback) |
| 4022 | tag_desc[i].callback(tag_desc[i].user1, |
| 4023 | tag_desc[i].user2); |
| 4024 | fail_free_tag_desc: |
| 4025 | kfree(tag_desc); |
| 4026 | return res; |
| 4027 | } |
| 4028 | |
| 4029 | /** |
| 4030 | * ipa3_tag_generate_force_close_desc() - generate descriptors for force close |
| 4031 | * immediate command |
| 4032 | * |
| 4033 | * @desc: descriptors for IC |
| 4034 | * @desc_size: desc array size |
| 4035 | * @start_pipe: first pipe to close aggregation |
| 4036 | * @end_pipe: last (non-inclusive) pipe to close aggregation |
| 4037 | * |
| 4038 | * Return: number of descriptors written or negative in case of failure |
| 4039 | */ |
| 4040 | static int ipa3_tag_generate_force_close_desc(struct ipa3_desc desc[], |
| 4041 | int desc_size, int start_pipe, int end_pipe) |
| 4042 | { |
| 4043 | int i; |
| 4044 | struct ipa_ep_cfg_aggr ep_aggr; |
| 4045 | int desc_idx = 0; |
| 4046 | int res; |
| 4047 | struct ipahal_imm_cmd_register_write reg_write_agg_close; |
| 4048 | struct ipahal_imm_cmd_pyld *cmd_pyld; |
| 4049 | struct ipahal_reg_valmask valmask; |
| 4050 | |
| 4051 | for (i = start_pipe; i < end_pipe; i++) { |
| 4052 | ipahal_read_reg_n_fields(IPA_ENDP_INIT_AGGR_n, i, &ep_aggr); |
| 4053 | if (!ep_aggr.aggr_en) |
| 4054 | continue; |
| 4055 | IPADBG("Force close ep: %d\n", i); |
| 4056 | if (desc_idx + 1 > desc_size) { |
| 4057 | IPAERR("Internal error - no descriptors\n"); |
| 4058 | res = -EFAULT; |
| 4059 | goto fail_no_desc; |
| 4060 | } |
| 4061 | |
| 4062 | reg_write_agg_close.skip_pipeline_clear = false; |
| 4063 | reg_write_agg_close.pipeline_clear_options = |
| 4064 | IPAHAL_FULL_PIPELINE_CLEAR; |
| 4065 | reg_write_agg_close.offset = |
| 4066 | ipahal_get_reg_ofst(IPA_AGGR_FORCE_CLOSE); |
Ghanim Fodi | cff9c94 | 2017-08-07 11:40:58 +0300 | [diff] [blame] | 4067 | ipahal_get_aggr_force_close_valmask(i, &valmask); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4068 | reg_write_agg_close.value = valmask.val; |
| 4069 | reg_write_agg_close.value_mask = valmask.mask; |
| 4070 | cmd_pyld = ipahal_construct_imm_cmd(IPA_IMM_CMD_REGISTER_WRITE, |
| 4071 | ®_write_agg_close, false); |
| 4072 | if (!cmd_pyld) { |
| 4073 | IPAERR("failed to construct register_write imm cmd\n"); |
| 4074 | res = -ENOMEM; |
| 4075 | goto fail_alloc_reg_write_agg_close; |
| 4076 | } |
| 4077 | |
Amir Levy | 479cfdd | 2017-10-26 12:23:14 +0300 | [diff] [blame] | 4078 | ipa3_init_imm_cmd_desc(&desc[desc_idx], cmd_pyld); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4079 | desc[desc_idx].callback = ipa3_tag_destroy_imm; |
| 4080 | desc[desc_idx].user1 = cmd_pyld; |
Amir Levy | 479cfdd | 2017-10-26 12:23:14 +0300 | [diff] [blame] | 4081 | ++desc_idx; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4082 | } |
| 4083 | |
| 4084 | return desc_idx; |
| 4085 | |
| 4086 | fail_alloc_reg_write_agg_close: |
Amir Levy | 479cfdd | 2017-10-26 12:23:14 +0300 | [diff] [blame] | 4087 | for (i = 0; i < desc_idx; ++i) |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4088 | if (desc[desc_idx].callback) |
| 4089 | desc[desc_idx].callback(desc[desc_idx].user1, |
| 4090 | desc[desc_idx].user2); |
| 4091 | fail_no_desc: |
| 4092 | return res; |
| 4093 | } |
| 4094 | |
| 4095 | /** |
| 4096 | * ipa3_tag_aggr_force_close() - Force close aggregation |
| 4097 | * |
| 4098 | * @pipe_num: pipe number or -1 for all pipes |
| 4099 | */ |
| 4100 | int ipa3_tag_aggr_force_close(int pipe_num) |
| 4101 | { |
| 4102 | struct ipa3_desc *desc; |
| 4103 | int res = -1; |
| 4104 | int start_pipe; |
| 4105 | int end_pipe; |
| 4106 | int num_descs; |
| 4107 | int num_aggr_descs; |
| 4108 | |
| 4109 | if (pipe_num < -1 || pipe_num >= (int)ipa3_ctx->ipa_num_pipes) { |
| 4110 | IPAERR("Invalid pipe number %d\n", pipe_num); |
| 4111 | return -EINVAL; |
| 4112 | } |
| 4113 | |
| 4114 | if (pipe_num == -1) { |
| 4115 | start_pipe = 0; |
| 4116 | end_pipe = ipa3_ctx->ipa_num_pipes; |
| 4117 | } else { |
| 4118 | start_pipe = pipe_num; |
| 4119 | end_pipe = pipe_num + 1; |
| 4120 | } |
| 4121 | |
| 4122 | num_descs = end_pipe - start_pipe; |
| 4123 | |
| 4124 | desc = kcalloc(num_descs, sizeof(*desc), GFP_KERNEL); |
| 4125 | if (!desc) { |
| 4126 | IPAERR("no mem\n"); |
| 4127 | return -ENOMEM; |
| 4128 | } |
| 4129 | |
| 4130 | /* Force close aggregation on all valid pipes with aggregation */ |
| 4131 | num_aggr_descs = ipa3_tag_generate_force_close_desc(desc, num_descs, |
| 4132 | start_pipe, end_pipe); |
| 4133 | if (num_aggr_descs < 0) { |
| 4134 | IPAERR("ipa3_tag_generate_force_close_desc failed %d\n", |
| 4135 | num_aggr_descs); |
| 4136 | goto fail_free_desc; |
| 4137 | } |
| 4138 | |
| 4139 | res = ipa3_tag_process(desc, num_aggr_descs, |
| 4140 | IPA_FORCE_CLOSE_TAG_PROCESS_TIMEOUT); |
| 4141 | |
| 4142 | fail_free_desc: |
| 4143 | kfree(desc); |
| 4144 | |
| 4145 | return res; |
| 4146 | } |
| 4147 | |
| 4148 | /** |
| 4149 | * ipa3_is_ready() - check if IPA module was initialized |
| 4150 | * successfully |
| 4151 | * |
| 4152 | * Return value: true for yes; false for no |
| 4153 | */ |
| 4154 | bool ipa3_is_ready(void) |
| 4155 | { |
| 4156 | bool complete; |
| 4157 | |
| 4158 | if (ipa3_ctx == NULL) |
| 4159 | return false; |
| 4160 | mutex_lock(&ipa3_ctx->lock); |
| 4161 | complete = ipa3_ctx->ipa_initialization_complete; |
| 4162 | mutex_unlock(&ipa3_ctx->lock); |
| 4163 | return complete; |
| 4164 | } |
| 4165 | |
| 4166 | /** |
| 4167 | * ipa3_is_client_handle_valid() - check if IPA client handle is valid handle |
| 4168 | * |
| 4169 | * Return value: true for yes; false for no |
| 4170 | */ |
| 4171 | bool ipa3_is_client_handle_valid(u32 clnt_hdl) |
| 4172 | { |
| 4173 | if (clnt_hdl >= 0 && clnt_hdl < ipa3_ctx->ipa_num_pipes) |
| 4174 | return true; |
| 4175 | return false; |
| 4176 | } |
| 4177 | |
| 4178 | /** |
| 4179 | * ipa3_proxy_clk_unvote() - called to remove IPA clock proxy vote |
| 4180 | * |
| 4181 | * Return value: none |
| 4182 | */ |
| 4183 | void ipa3_proxy_clk_unvote(void) |
| 4184 | { |
Skylar Chang | fb792c6 | 2017-08-17 12:53:23 -0700 | [diff] [blame] | 4185 | if (!ipa3_is_ready()) |
| 4186 | return; |
| 4187 | |
| 4188 | mutex_lock(&ipa3_ctx->q6_proxy_clk_vote_mutex); |
| 4189 | if (ipa3_ctx->q6_proxy_clk_vote_valid) { |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4190 | IPA_ACTIVE_CLIENTS_DEC_SPECIAL("PROXY_CLK_VOTE"); |
Mohammed Javid | 05b05d0 | 2017-11-13 23:43:27 +0530 | [diff] [blame] | 4191 | ipa3_ctx->q6_proxy_clk_vote_cnt--; |
| 4192 | if (ipa3_ctx->q6_proxy_clk_vote_cnt == 0) |
| 4193 | ipa3_ctx->q6_proxy_clk_vote_valid = false; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4194 | } |
Skylar Chang | fb792c6 | 2017-08-17 12:53:23 -0700 | [diff] [blame] | 4195 | mutex_unlock(&ipa3_ctx->q6_proxy_clk_vote_mutex); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4196 | } |
| 4197 | |
| 4198 | /** |
| 4199 | * ipa3_proxy_clk_vote() - called to add IPA clock proxy vote |
| 4200 | * |
| 4201 | * Return value: none |
| 4202 | */ |
| 4203 | void ipa3_proxy_clk_vote(void) |
| 4204 | { |
Skylar Chang | fb792c6 | 2017-08-17 12:53:23 -0700 | [diff] [blame] | 4205 | if (!ipa3_is_ready()) |
| 4206 | return; |
| 4207 | |
| 4208 | mutex_lock(&ipa3_ctx->q6_proxy_clk_vote_mutex); |
Mohammed Javid | 05b05d0 | 2017-11-13 23:43:27 +0530 | [diff] [blame] | 4209 | if (!ipa3_ctx->q6_proxy_clk_vote_valid || |
| 4210 | (ipa3_ctx->q6_proxy_clk_vote_cnt > 0)) { |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4211 | IPA_ACTIVE_CLIENTS_INC_SPECIAL("PROXY_CLK_VOTE"); |
Mohammed Javid | 05b05d0 | 2017-11-13 23:43:27 +0530 | [diff] [blame] | 4212 | ipa3_ctx->q6_proxy_clk_vote_cnt++; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4213 | ipa3_ctx->q6_proxy_clk_vote_valid = true; |
| 4214 | } |
Skylar Chang | fb792c6 | 2017-08-17 12:53:23 -0700 | [diff] [blame] | 4215 | mutex_unlock(&ipa3_ctx->q6_proxy_clk_vote_mutex); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4216 | } |
| 4217 | |
| 4218 | /** |
| 4219 | * ipa3_get_smem_restr_bytes()- Return IPA smem restricted bytes |
| 4220 | * |
| 4221 | * Return value: u16 - number of IPA smem restricted bytes |
| 4222 | */ |
| 4223 | u16 ipa3_get_smem_restr_bytes(void) |
| 4224 | { |
| 4225 | if (ipa3_ctx) |
| 4226 | return ipa3_ctx->smem_restricted_bytes; |
| 4227 | |
| 4228 | IPAERR("IPA Driver not initialized\n"); |
| 4229 | |
| 4230 | return 0; |
| 4231 | } |
| 4232 | |
| 4233 | /** |
| 4234 | * ipa3_get_modem_cfg_emb_pipe_flt()- Return ipa3_ctx->modem_cfg_emb_pipe_flt |
| 4235 | * |
| 4236 | * Return value: true if modem configures embedded pipe flt, false otherwise |
| 4237 | */ |
| 4238 | bool ipa3_get_modem_cfg_emb_pipe_flt(void) |
| 4239 | { |
| 4240 | if (ipa3_ctx) |
| 4241 | return ipa3_ctx->modem_cfg_emb_pipe_flt; |
| 4242 | |
| 4243 | IPAERR("IPA driver has not been initialized\n"); |
| 4244 | |
| 4245 | return false; |
| 4246 | } |
| 4247 | |
| 4248 | /** |
Amir Levy | a59ed3f | 2017-03-05 17:30:55 +0200 | [diff] [blame] | 4249 | * ipa3_get_transport_type() |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4250 | * |
| 4251 | * Return value: enum ipa_transport_type |
| 4252 | */ |
| 4253 | enum ipa_transport_type ipa3_get_transport_type(void) |
| 4254 | { |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4255 | return IPA_TRANSPORT_TYPE_GSI; |
| 4256 | } |
| 4257 | |
| 4258 | u32 ipa3_get_num_pipes(void) |
| 4259 | { |
| 4260 | return ipahal_read_reg(IPA_ENABLED_PIPES); |
| 4261 | } |
| 4262 | |
| 4263 | /** |
| 4264 | * ipa3_disable_apps_wan_cons_deaggr()- |
| 4265 | * set ipa_ctx->ipa_client_apps_wan_cons_agg_gro |
| 4266 | * |
| 4267 | * Return value: 0 or negative in case of failure |
| 4268 | */ |
| 4269 | int ipa3_disable_apps_wan_cons_deaggr(uint32_t agg_size, uint32_t agg_count) |
| 4270 | { |
| 4271 | int res = -1; |
| 4272 | u32 limit; |
| 4273 | |
| 4274 | /* checking if IPA-HW can support */ |
| 4275 | limit = ipahal_aggr_get_max_byte_limit(); |
| 4276 | if ((agg_size >> 10) > limit) { |
| 4277 | IPAERR("IPA-AGG byte limit %d\n", limit); |
| 4278 | IPAERR("exceed aggr_byte_limit\n"); |
| 4279 | return res; |
| 4280 | } |
| 4281 | limit = ipahal_aggr_get_max_pkt_limit(); |
| 4282 | if (agg_count > limit) { |
| 4283 | IPAERR("IPA-AGG pkt limit %d\n", limit); |
| 4284 | IPAERR("exceed aggr_pkt_limit\n"); |
| 4285 | return res; |
| 4286 | } |
| 4287 | |
| 4288 | if (ipa3_ctx) { |
| 4289 | ipa3_ctx->ipa_client_apps_wan_cons_agg_gro = true; |
| 4290 | return 0; |
| 4291 | } |
| 4292 | return res; |
| 4293 | } |
| 4294 | |
| 4295 | static void *ipa3_get_ipc_logbuf(void) |
| 4296 | { |
| 4297 | if (ipa3_ctx) |
| 4298 | return ipa3_ctx->logbuf; |
| 4299 | |
| 4300 | return NULL; |
| 4301 | } |
| 4302 | |
| 4303 | static void *ipa3_get_ipc_logbuf_low(void) |
| 4304 | { |
| 4305 | if (ipa3_ctx) |
| 4306 | return ipa3_ctx->logbuf_low; |
| 4307 | |
| 4308 | return NULL; |
| 4309 | } |
| 4310 | |
| 4311 | static void ipa3_get_holb(int ep_idx, struct ipa_ep_cfg_holb *holb) |
| 4312 | { |
| 4313 | *holb = ipa3_ctx->ep[ep_idx].holb; |
| 4314 | } |
| 4315 | |
| 4316 | static void ipa3_set_tag_process_before_gating(bool val) |
| 4317 | { |
| 4318 | ipa3_ctx->tag_process_before_gating = val; |
| 4319 | } |
| 4320 | |
Amir Levy | 2da9d45 | 2017-12-12 10:09:46 +0200 | [diff] [blame] | 4321 | /** |
| 4322 | * ipa3_is_vlan_mode - check if a LAN driver should load in VLAN mode |
| 4323 | * @iface - type of vlan capable device |
| 4324 | * @res - query result: true for vlan mode, false for non vlan mode |
| 4325 | * |
| 4326 | * API must be called after ipa_is_ready() returns true, otherwise it will fail |
| 4327 | * |
| 4328 | * Returns: 0 on success, negative on failure |
| 4329 | */ |
| 4330 | static int ipa3_is_vlan_mode(enum ipa_vlan_ifaces iface, bool *res) |
| 4331 | { |
| 4332 | if (!res) { |
| 4333 | IPAERR("NULL out param\n"); |
| 4334 | return -EINVAL; |
| 4335 | } |
| 4336 | |
| 4337 | if (iface < 0 || iface > IPA_VLAN_IF_MAX) { |
| 4338 | IPAERR("invalid iface %d\n", iface); |
| 4339 | return -EINVAL; |
| 4340 | } |
| 4341 | |
| 4342 | if (!ipa3_is_ready()) { |
| 4343 | IPAERR("IPA is not ready yet\n"); |
| 4344 | return -ENODEV; |
| 4345 | } |
| 4346 | |
| 4347 | *res = ipa3_ctx->vlan_mode_iface[iface]; |
| 4348 | |
| 4349 | IPADBG("Driver %d vlan mode is %d\n", iface, *res); |
| 4350 | return 0; |
| 4351 | } |
| 4352 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4353 | int ipa3_bind_api_controller(enum ipa_hw_type ipa_hw_type, |
| 4354 | struct ipa_api_controller *api_ctrl) |
| 4355 | { |
| 4356 | if (ipa_hw_type < IPA_HW_v3_0) { |
| 4357 | IPAERR("Unsupported IPA HW version %d\n", ipa_hw_type); |
| 4358 | WARN_ON(1); |
| 4359 | return -EPERM; |
| 4360 | } |
| 4361 | |
Amir Levy | a59ed3f | 2017-03-05 17:30:55 +0200 | [diff] [blame] | 4362 | api_ctrl->ipa_connect = NULL; |
| 4363 | api_ctrl->ipa_disconnect = NULL; |
| 4364 | api_ctrl->ipa_reset_endpoint = NULL; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4365 | api_ctrl->ipa_clear_endpoint_delay = ipa3_clear_endpoint_delay; |
| 4366 | api_ctrl->ipa_disable_endpoint = NULL; |
| 4367 | api_ctrl->ipa_cfg_ep = ipa3_cfg_ep; |
| 4368 | api_ctrl->ipa_cfg_ep_nat = ipa3_cfg_ep_nat; |
Amir Levy | dc65f4c | 2017-07-06 09:49:50 +0300 | [diff] [blame] | 4369 | api_ctrl->ipa_cfg_ep_conn_track = ipa3_cfg_ep_conn_track; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4370 | api_ctrl->ipa_cfg_ep_hdr = ipa3_cfg_ep_hdr; |
| 4371 | api_ctrl->ipa_cfg_ep_hdr_ext = ipa3_cfg_ep_hdr_ext; |
| 4372 | api_ctrl->ipa_cfg_ep_mode = ipa3_cfg_ep_mode; |
| 4373 | api_ctrl->ipa_cfg_ep_aggr = ipa3_cfg_ep_aggr; |
| 4374 | api_ctrl->ipa_cfg_ep_deaggr = ipa3_cfg_ep_deaggr; |
| 4375 | api_ctrl->ipa_cfg_ep_route = ipa3_cfg_ep_route; |
| 4376 | api_ctrl->ipa_cfg_ep_holb = ipa3_cfg_ep_holb; |
| 4377 | api_ctrl->ipa_get_holb = ipa3_get_holb; |
| 4378 | api_ctrl->ipa_set_tag_process_before_gating = |
| 4379 | ipa3_set_tag_process_before_gating; |
| 4380 | api_ctrl->ipa_cfg_ep_cfg = ipa3_cfg_ep_cfg; |
| 4381 | api_ctrl->ipa_cfg_ep_metadata_mask = ipa3_cfg_ep_metadata_mask; |
| 4382 | api_ctrl->ipa_cfg_ep_holb_by_client = ipa3_cfg_ep_holb_by_client; |
| 4383 | api_ctrl->ipa_cfg_ep_ctrl = ipa3_cfg_ep_ctrl; |
| 4384 | api_ctrl->ipa_add_hdr = ipa3_add_hdr; |
| 4385 | api_ctrl->ipa_del_hdr = ipa3_del_hdr; |
| 4386 | api_ctrl->ipa_commit_hdr = ipa3_commit_hdr; |
| 4387 | api_ctrl->ipa_reset_hdr = ipa3_reset_hdr; |
| 4388 | api_ctrl->ipa_get_hdr = ipa3_get_hdr; |
| 4389 | api_ctrl->ipa_put_hdr = ipa3_put_hdr; |
| 4390 | api_ctrl->ipa_copy_hdr = ipa3_copy_hdr; |
| 4391 | api_ctrl->ipa_add_hdr_proc_ctx = ipa3_add_hdr_proc_ctx; |
| 4392 | api_ctrl->ipa_del_hdr_proc_ctx = ipa3_del_hdr_proc_ctx; |
| 4393 | api_ctrl->ipa_add_rt_rule = ipa3_add_rt_rule; |
| 4394 | api_ctrl->ipa_del_rt_rule = ipa3_del_rt_rule; |
| 4395 | api_ctrl->ipa_commit_rt = ipa3_commit_rt; |
| 4396 | api_ctrl->ipa_reset_rt = ipa3_reset_rt; |
| 4397 | api_ctrl->ipa_get_rt_tbl = ipa3_get_rt_tbl; |
| 4398 | api_ctrl->ipa_put_rt_tbl = ipa3_put_rt_tbl; |
| 4399 | api_ctrl->ipa_query_rt_index = ipa3_query_rt_index; |
| 4400 | api_ctrl->ipa_mdfy_rt_rule = ipa3_mdfy_rt_rule; |
| 4401 | api_ctrl->ipa_add_flt_rule = ipa3_add_flt_rule; |
| 4402 | api_ctrl->ipa_del_flt_rule = ipa3_del_flt_rule; |
| 4403 | api_ctrl->ipa_mdfy_flt_rule = ipa3_mdfy_flt_rule; |
| 4404 | api_ctrl->ipa_commit_flt = ipa3_commit_flt; |
| 4405 | api_ctrl->ipa_reset_flt = ipa3_reset_flt; |
Amir Levy | 479cfdd | 2017-10-26 12:23:14 +0300 | [diff] [blame] | 4406 | api_ctrl->ipa_allocate_nat_device = ipa3_allocate_nat_device; |
| 4407 | api_ctrl->ipa_allocate_nat_table = ipa3_allocate_nat_table; |
| 4408 | api_ctrl->ipa_allocate_ipv6ct_table = ipa3_allocate_ipv6ct_table; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4409 | api_ctrl->ipa_nat_init_cmd = ipa3_nat_init_cmd; |
Amir Levy | 479cfdd | 2017-10-26 12:23:14 +0300 | [diff] [blame] | 4410 | api_ctrl->ipa_ipv6ct_init_cmd = ipa3_ipv6ct_init_cmd; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4411 | api_ctrl->ipa_nat_dma_cmd = ipa3_nat_dma_cmd; |
Amir Levy | 479cfdd | 2017-10-26 12:23:14 +0300 | [diff] [blame] | 4412 | api_ctrl->ipa_table_dma_cmd = ipa3_table_dma_cmd; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4413 | api_ctrl->ipa_nat_del_cmd = ipa3_nat_del_cmd; |
Amir Levy | 479cfdd | 2017-10-26 12:23:14 +0300 | [diff] [blame] | 4414 | api_ctrl->ipa_del_nat_table = ipa3_del_nat_table; |
| 4415 | api_ctrl->ipa_del_ipv6ct_table = ipa3_del_ipv6ct_table; |
| 4416 | api_ctrl->ipa_nat_mdfy_pdn = ipa3_nat_mdfy_pdn; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4417 | api_ctrl->ipa_send_msg = ipa3_send_msg; |
| 4418 | api_ctrl->ipa_register_pull_msg = ipa3_register_pull_msg; |
| 4419 | api_ctrl->ipa_deregister_pull_msg = ipa3_deregister_pull_msg; |
| 4420 | api_ctrl->ipa_register_intf = ipa3_register_intf; |
| 4421 | api_ctrl->ipa_register_intf_ext = ipa3_register_intf_ext; |
| 4422 | api_ctrl->ipa_deregister_intf = ipa3_deregister_intf; |
| 4423 | api_ctrl->ipa_set_aggr_mode = ipa3_set_aggr_mode; |
| 4424 | api_ctrl->ipa_set_qcncm_ndp_sig = ipa3_set_qcncm_ndp_sig; |
| 4425 | api_ctrl->ipa_set_single_ndp_per_mbim = ipa3_set_single_ndp_per_mbim; |
| 4426 | api_ctrl->ipa_tx_dp = ipa3_tx_dp; |
| 4427 | api_ctrl->ipa_tx_dp_mul = ipa3_tx_dp_mul; |
| 4428 | api_ctrl->ipa_free_skb = ipa3_free_skb; |
| 4429 | api_ctrl->ipa_setup_sys_pipe = ipa3_setup_sys_pipe; |
| 4430 | api_ctrl->ipa_teardown_sys_pipe = ipa3_teardown_sys_pipe; |
| 4431 | api_ctrl->ipa_sys_setup = ipa3_sys_setup; |
| 4432 | api_ctrl->ipa_sys_teardown = ipa3_sys_teardown; |
| 4433 | api_ctrl->ipa_sys_update_gsi_hdls = ipa3_sys_update_gsi_hdls; |
| 4434 | api_ctrl->ipa_connect_wdi_pipe = ipa3_connect_wdi_pipe; |
| 4435 | api_ctrl->ipa_disconnect_wdi_pipe = ipa3_disconnect_wdi_pipe; |
| 4436 | api_ctrl->ipa_enable_wdi_pipe = ipa3_enable_wdi_pipe; |
| 4437 | api_ctrl->ipa_disable_wdi_pipe = ipa3_disable_wdi_pipe; |
| 4438 | api_ctrl->ipa_resume_wdi_pipe = ipa3_resume_wdi_pipe; |
| 4439 | api_ctrl->ipa_suspend_wdi_pipe = ipa3_suspend_wdi_pipe; |
| 4440 | api_ctrl->ipa_get_wdi_stats = ipa3_get_wdi_stats; |
| 4441 | api_ctrl->ipa_get_smem_restr_bytes = ipa3_get_smem_restr_bytes; |
Skylar Chang | 6b41f8d | 2016-11-01 12:50:11 -0700 | [diff] [blame] | 4442 | api_ctrl->ipa_broadcast_wdi_quota_reach_ind = |
| 4443 | ipa3_broadcast_wdi_quota_reach_ind; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4444 | api_ctrl->ipa_uc_wdi_get_dbpa = ipa3_uc_wdi_get_dbpa; |
| 4445 | api_ctrl->ipa_uc_reg_rdyCB = ipa3_uc_reg_rdyCB; |
| 4446 | api_ctrl->ipa_uc_dereg_rdyCB = ipa3_uc_dereg_rdyCB; |
| 4447 | api_ctrl->teth_bridge_init = ipa3_teth_bridge_init; |
| 4448 | api_ctrl->teth_bridge_disconnect = ipa3_teth_bridge_disconnect; |
| 4449 | api_ctrl->teth_bridge_connect = ipa3_teth_bridge_connect; |
| 4450 | api_ctrl->ipa_set_client = ipa3_set_client; |
| 4451 | api_ctrl->ipa_get_client = ipa3_get_client; |
| 4452 | api_ctrl->ipa_get_client_uplink = ipa3_get_client_uplink; |
| 4453 | api_ctrl->ipa_dma_init = ipa3_dma_init; |
| 4454 | api_ctrl->ipa_dma_enable = ipa3_dma_enable; |
| 4455 | api_ctrl->ipa_dma_disable = ipa3_dma_disable; |
| 4456 | api_ctrl->ipa_dma_sync_memcpy = ipa3_dma_sync_memcpy; |
| 4457 | api_ctrl->ipa_dma_async_memcpy = ipa3_dma_async_memcpy; |
| 4458 | api_ctrl->ipa_dma_uc_memcpy = ipa3_dma_uc_memcpy; |
| 4459 | api_ctrl->ipa_dma_destroy = ipa3_dma_destroy; |
| 4460 | api_ctrl->ipa_mhi_init_engine = ipa3_mhi_init_engine; |
| 4461 | api_ctrl->ipa_connect_mhi_pipe = ipa3_connect_mhi_pipe; |
| 4462 | api_ctrl->ipa_disconnect_mhi_pipe = ipa3_disconnect_mhi_pipe; |
| 4463 | api_ctrl->ipa_mhi_stop_gsi_channel = ipa3_mhi_stop_gsi_channel; |
| 4464 | api_ctrl->ipa_uc_mhi_reset_channel = ipa3_uc_mhi_reset_channel; |
| 4465 | api_ctrl->ipa_qmi_enable_force_clear_datapath_send = |
| 4466 | ipa3_qmi_enable_force_clear_datapath_send; |
| 4467 | api_ctrl->ipa_qmi_disable_force_clear_datapath_send = |
| 4468 | ipa3_qmi_disable_force_clear_datapath_send; |
| 4469 | api_ctrl->ipa_mhi_reset_channel_internal = |
| 4470 | ipa3_mhi_reset_channel_internal; |
| 4471 | api_ctrl->ipa_mhi_start_channel_internal = |
| 4472 | ipa3_mhi_start_channel_internal; |
| 4473 | api_ctrl->ipa_mhi_query_ch_info = ipa3_mhi_query_ch_info; |
| 4474 | api_ctrl->ipa_mhi_resume_channels_internal = |
| 4475 | ipa3_mhi_resume_channels_internal; |
| 4476 | api_ctrl->ipa_has_open_aggr_frame = ipa3_has_open_aggr_frame; |
| 4477 | api_ctrl->ipa_mhi_destroy_channel = ipa3_mhi_destroy_channel; |
| 4478 | api_ctrl->ipa_uc_mhi_send_dl_ul_sync_info = |
| 4479 | ipa3_uc_mhi_send_dl_ul_sync_info; |
| 4480 | api_ctrl->ipa_uc_mhi_init = ipa3_uc_mhi_init; |
| 4481 | api_ctrl->ipa_uc_mhi_suspend_channel = ipa3_uc_mhi_suspend_channel; |
| 4482 | api_ctrl->ipa_uc_mhi_stop_event_update_channel = |
| 4483 | ipa3_uc_mhi_stop_event_update_channel; |
| 4484 | api_ctrl->ipa_uc_mhi_cleanup = ipa3_uc_mhi_cleanup; |
| 4485 | api_ctrl->ipa_uc_state_check = ipa3_uc_state_check; |
| 4486 | api_ctrl->ipa_write_qmap_id = ipa3_write_qmap_id; |
| 4487 | api_ctrl->ipa_add_interrupt_handler = ipa3_add_interrupt_handler; |
| 4488 | api_ctrl->ipa_remove_interrupt_handler = ipa3_remove_interrupt_handler; |
| 4489 | api_ctrl->ipa_restore_suspend_handler = ipa3_restore_suspend_handler; |
Amir Levy | a59ed3f | 2017-03-05 17:30:55 +0200 | [diff] [blame] | 4490 | api_ctrl->ipa_bam_reg_dump = NULL; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4491 | api_ctrl->ipa_get_ep_mapping = ipa3_get_ep_mapping; |
| 4492 | api_ctrl->ipa_is_ready = ipa3_is_ready; |
| 4493 | api_ctrl->ipa_proxy_clk_vote = ipa3_proxy_clk_vote; |
| 4494 | api_ctrl->ipa_proxy_clk_unvote = ipa3_proxy_clk_unvote; |
| 4495 | api_ctrl->ipa_is_client_handle_valid = ipa3_is_client_handle_valid; |
| 4496 | api_ctrl->ipa_get_client_mapping = ipa3_get_client_mapping; |
| 4497 | api_ctrl->ipa_get_rm_resource_from_ep = ipa3_get_rm_resource_from_ep; |
| 4498 | api_ctrl->ipa_get_modem_cfg_emb_pipe_flt = |
| 4499 | ipa3_get_modem_cfg_emb_pipe_flt; |
| 4500 | api_ctrl->ipa_get_transport_type = ipa3_get_transport_type; |
| 4501 | api_ctrl->ipa_ap_suspend = ipa3_ap_suspend; |
| 4502 | api_ctrl->ipa_ap_resume = ipa3_ap_resume; |
| 4503 | api_ctrl->ipa_get_smmu_domain = ipa3_get_smmu_domain; |
| 4504 | api_ctrl->ipa_disable_apps_wan_cons_deaggr = |
| 4505 | ipa3_disable_apps_wan_cons_deaggr; |
| 4506 | api_ctrl->ipa_get_dma_dev = ipa3_get_dma_dev; |
| 4507 | api_ctrl->ipa_release_wdi_mapping = ipa3_release_wdi_mapping; |
| 4508 | api_ctrl->ipa_create_wdi_mapping = ipa3_create_wdi_mapping; |
| 4509 | api_ctrl->ipa_get_gsi_ep_info = ipa3_get_gsi_ep_info; |
| 4510 | api_ctrl->ipa_stop_gsi_channel = ipa3_stop_gsi_channel; |
Skylar Chang | 9fbce06 | 2017-07-25 16:20:42 -0700 | [diff] [blame] | 4511 | api_ctrl->ipa_start_gsi_channel = ipa3_start_gsi_channel; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4512 | api_ctrl->ipa_register_ipa_ready_cb = ipa3_register_ipa_ready_cb; |
| 4513 | api_ctrl->ipa_inc_client_enable_clks = ipa3_inc_client_enable_clks; |
| 4514 | api_ctrl->ipa_dec_client_disable_clks = ipa3_dec_client_disable_clks; |
| 4515 | api_ctrl->ipa_inc_client_enable_clks_no_block = |
| 4516 | ipa3_inc_client_enable_clks_no_block; |
| 4517 | api_ctrl->ipa_suspend_resource_no_block = |
| 4518 | ipa3_suspend_resource_no_block; |
| 4519 | api_ctrl->ipa_resume_resource = ipa3_resume_resource; |
| 4520 | api_ctrl->ipa_suspend_resource_sync = ipa3_suspend_resource_sync; |
| 4521 | api_ctrl->ipa_set_required_perf_profile = |
| 4522 | ipa3_set_required_perf_profile; |
| 4523 | api_ctrl->ipa_get_ipc_logbuf = ipa3_get_ipc_logbuf; |
| 4524 | api_ctrl->ipa_get_ipc_logbuf_low = ipa3_get_ipc_logbuf_low; |
| 4525 | api_ctrl->ipa_rx_poll = ipa3_rx_poll; |
| 4526 | api_ctrl->ipa_recycle_wan_skb = ipa3_recycle_wan_skb; |
| 4527 | api_ctrl->ipa_setup_uc_ntn_pipes = ipa3_setup_uc_ntn_pipes; |
| 4528 | api_ctrl->ipa_tear_down_uc_offload_pipes = |
| 4529 | ipa3_tear_down_uc_offload_pipes; |
Amir Levy | c4222c9 | 2016-11-07 16:14:54 +0200 | [diff] [blame] | 4530 | api_ctrl->ipa_get_pdev = ipa3_get_pdev; |
Sunil Paidimarri | fbbcd07 | 2017-04-04 17:43:50 -0700 | [diff] [blame] | 4531 | api_ctrl->ipa_ntn_uc_reg_rdyCB = ipa3_ntn_uc_reg_rdyCB; |
| 4532 | api_ctrl->ipa_ntn_uc_dereg_rdyCB = ipa3_ntn_uc_dereg_rdyCB; |
Skylar Chang | 852379b | 2016-12-13 14:00:19 -0800 | [diff] [blame] | 4533 | api_ctrl->ipa_conn_wdi3_pipes = ipa3_conn_wdi3_pipes; |
| 4534 | api_ctrl->ipa_disconn_wdi3_pipes = ipa3_disconn_wdi3_pipes; |
| 4535 | api_ctrl->ipa_enable_wdi3_pipes = ipa3_enable_wdi3_pipes; |
| 4536 | api_ctrl->ipa_disable_wdi3_pipes = ipa3_disable_wdi3_pipes; |
Skylar Chang | 48afa05 | 2017-10-25 09:32:57 -0700 | [diff] [blame] | 4537 | api_ctrl->ipa_tz_unlock_reg = ipa3_tz_unlock_reg; |
Michael Adisumarta | d04e6d6 | 2017-11-09 17:46:35 -0800 | [diff] [blame] | 4538 | api_ctrl->ipa_get_smmu_params = ipa3_get_smmu_params; |
Amir Levy | 2da9d45 | 2017-12-12 10:09:46 +0200 | [diff] [blame] | 4539 | api_ctrl->ipa_is_vlan_mode = ipa3_is_vlan_mode; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4540 | |
| 4541 | return 0; |
| 4542 | } |
| 4543 | |
| 4544 | /** |
| 4545 | * ipa_is_modem_pipe()- Checks if pipe is owned by the modem |
| 4546 | * |
| 4547 | * @pipe_idx: pipe number |
| 4548 | * Return value: true if owned by modem, false otherwize |
| 4549 | */ |
| 4550 | bool ipa_is_modem_pipe(int pipe_idx) |
| 4551 | { |
| 4552 | int client_idx; |
| 4553 | |
| 4554 | if (pipe_idx >= ipa3_ctx->ipa_num_pipes || pipe_idx < 0) { |
| 4555 | IPAERR("Bad pipe index!\n"); |
| 4556 | return false; |
| 4557 | } |
| 4558 | |
| 4559 | for (client_idx = 0; client_idx < IPA_CLIENT_MAX; client_idx++) { |
| 4560 | if (!IPA_CLIENT_IS_Q6_CONS(client_idx) && |
| 4561 | !IPA_CLIENT_IS_Q6_PROD(client_idx)) |
| 4562 | continue; |
| 4563 | if (ipa3_get_ep_mapping(client_idx) == pipe_idx) |
| 4564 | return true; |
| 4565 | } |
| 4566 | |
| 4567 | return false; |
| 4568 | } |
| 4569 | |
| 4570 | static void ipa3_write_rsrc_grp_type_reg(int group_index, |
| 4571 | enum ipa_rsrc_grp_type_src n, bool src, |
| 4572 | struct ipahal_reg_rsrc_grp_cfg *val) { |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4573 | u8 hw_type_idx; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4574 | |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4575 | hw_type_idx = ipa3_get_hw_type_index(); |
| 4576 | |
| 4577 | switch (hw_type_idx) { |
| 4578 | case IPA_3_0: |
| 4579 | if (src) { |
| 4580 | switch (group_index) { |
| 4581 | case IPA_v3_0_GROUP_UL: |
| 4582 | case IPA_v3_0_GROUP_DL: |
| 4583 | ipahal_write_reg_n_fields( |
| 4584 | IPA_SRC_RSRC_GRP_01_RSRC_TYPE_n, |
| 4585 | n, val); |
| 4586 | break; |
| 4587 | case IPA_v3_0_GROUP_DIAG: |
| 4588 | case IPA_v3_0_GROUP_DMA: |
| 4589 | ipahal_write_reg_n_fields( |
| 4590 | IPA_SRC_RSRC_GRP_23_RSRC_TYPE_n, |
| 4591 | n, val); |
| 4592 | break; |
| 4593 | case IPA_v3_0_GROUP_Q6ZIP: |
| 4594 | case IPA_v3_0_GROUP_UC_RX_Q: |
| 4595 | ipahal_write_reg_n_fields( |
| 4596 | IPA_SRC_RSRC_GRP_45_RSRC_TYPE_n, |
| 4597 | n, val); |
| 4598 | break; |
| 4599 | default: |
| 4600 | IPAERR( |
| 4601 | " Invalid source resource group,index #%d\n", |
| 4602 | group_index); |
| 4603 | break; |
| 4604 | } |
| 4605 | } else { |
| 4606 | switch (group_index) { |
| 4607 | case IPA_v3_0_GROUP_UL: |
| 4608 | case IPA_v3_0_GROUP_DL: |
| 4609 | ipahal_write_reg_n_fields( |
| 4610 | IPA_DST_RSRC_GRP_01_RSRC_TYPE_n, |
| 4611 | n, val); |
| 4612 | break; |
| 4613 | case IPA_v3_0_GROUP_DIAG: |
| 4614 | case IPA_v3_0_GROUP_DMA: |
| 4615 | ipahal_write_reg_n_fields( |
| 4616 | IPA_DST_RSRC_GRP_23_RSRC_TYPE_n, |
| 4617 | n, val); |
| 4618 | break; |
| 4619 | case IPA_v3_0_GROUP_Q6ZIP_GENERAL: |
| 4620 | case IPA_v3_0_GROUP_Q6ZIP_ENGINE: |
| 4621 | ipahal_write_reg_n_fields( |
| 4622 | IPA_DST_RSRC_GRP_45_RSRC_TYPE_n, |
| 4623 | n, val); |
| 4624 | break; |
| 4625 | default: |
| 4626 | IPAERR( |
| 4627 | " Invalid destination resource group,index #%d\n", |
| 4628 | group_index); |
| 4629 | break; |
| 4630 | } |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4631 | } |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4632 | break; |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 4633 | case IPA_3_5: |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 4634 | case IPA_3_5_MHI: |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4635 | case IPA_3_5_1: |
| 4636 | if (src) { |
| 4637 | switch (group_index) { |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 4638 | case IPA_v3_5_GROUP_LWA_DL: |
| 4639 | case IPA_v3_5_GROUP_UL_DL: |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4640 | ipahal_write_reg_n_fields( |
| 4641 | IPA_SRC_RSRC_GRP_01_RSRC_TYPE_n, |
| 4642 | n, val); |
| 4643 | break; |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 4644 | case IPA_v3_5_MHI_GROUP_DMA: |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 4645 | case IPA_v3_5_GROUP_UC_RX_Q: |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4646 | ipahal_write_reg_n_fields( |
| 4647 | IPA_SRC_RSRC_GRP_23_RSRC_TYPE_n, |
| 4648 | n, val); |
| 4649 | break; |
| 4650 | default: |
| 4651 | IPAERR( |
| 4652 | " Invalid source resource group,index #%d\n", |
| 4653 | group_index); |
| 4654 | break; |
| 4655 | } |
| 4656 | } else { |
| 4657 | switch (group_index) { |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 4658 | case IPA_v3_5_GROUP_LWA_DL: |
| 4659 | case IPA_v3_5_GROUP_UL_DL: |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4660 | ipahal_write_reg_n_fields( |
| 4661 | IPA_DST_RSRC_GRP_01_RSRC_TYPE_n, |
| 4662 | n, val); |
| 4663 | break; |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 4664 | case IPA_v3_5_MHI_GROUP_DMA: |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4665 | ipahal_write_reg_n_fields( |
| 4666 | IPA_DST_RSRC_GRP_23_RSRC_TYPE_n, |
| 4667 | n, val); |
| 4668 | break; |
| 4669 | default: |
| 4670 | IPAERR( |
| 4671 | " Invalid destination resource group,index #%d\n", |
| 4672 | group_index); |
| 4673 | break; |
| 4674 | } |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4675 | } |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4676 | break; |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 4677 | case IPA_4_0: |
| 4678 | case IPA_4_0_MHI: |
| 4679 | if (src) { |
| 4680 | switch (group_index) { |
| 4681 | case IPA_v4_0_GROUP_LWA_DL: |
| 4682 | case IPA_v4_0_GROUP_UL_DL: |
| 4683 | ipahal_write_reg_n_fields( |
| 4684 | IPA_SRC_RSRC_GRP_01_RSRC_TYPE_n, |
| 4685 | n, val); |
| 4686 | break; |
| 4687 | case IPA_v4_0_MHI_GROUP_DMA: |
| 4688 | case IPA_v4_0_GROUP_UC_RX_Q: |
| 4689 | ipahal_write_reg_n_fields( |
| 4690 | IPA_SRC_RSRC_GRP_23_RSRC_TYPE_n, |
| 4691 | n, val); |
| 4692 | break; |
| 4693 | default: |
| 4694 | IPAERR( |
| 4695 | " Invalid source resource group,index #%d\n", |
| 4696 | group_index); |
| 4697 | break; |
| 4698 | } |
| 4699 | } else { |
| 4700 | switch (group_index) { |
| 4701 | case IPA_v4_0_GROUP_LWA_DL: |
| 4702 | case IPA_v4_0_GROUP_UL_DL: |
| 4703 | ipahal_write_reg_n_fields( |
| 4704 | IPA_DST_RSRC_GRP_01_RSRC_TYPE_n, |
| 4705 | n, val); |
| 4706 | break; |
| 4707 | case IPA_v4_0_MHI_GROUP_DMA: |
| 4708 | ipahal_write_reg_n_fields( |
| 4709 | IPA_DST_RSRC_GRP_23_RSRC_TYPE_n, |
| 4710 | n, val); |
| 4711 | break; |
| 4712 | default: |
| 4713 | IPAERR( |
| 4714 | " Invalid destination resource group,index #%d\n", |
| 4715 | group_index); |
| 4716 | break; |
| 4717 | } |
| 4718 | } |
| 4719 | break; |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4720 | default: |
| 4721 | IPAERR("invalid hw type\n"); |
| 4722 | WARN_ON(1); |
| 4723 | return; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4724 | } |
| 4725 | } |
| 4726 | |
| 4727 | static void ipa3_configure_rx_hps_clients(int depth, bool min) |
| 4728 | { |
| 4729 | int i; |
| 4730 | struct ipahal_reg_rx_hps_clients val; |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4731 | u8 hw_type_idx; |
| 4732 | |
| 4733 | hw_type_idx = ipa3_get_hw_type_index(); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4734 | |
| 4735 | /* |
| 4736 | * depth 0 contains 4 first clients out of 6 |
| 4737 | * depth 1 contains 2 last clients out of 6 |
| 4738 | */ |
| 4739 | for (i = 0 ; i < (depth ? 2 : 4) ; i++) { |
| 4740 | if (min) |
| 4741 | val.client_minmax[i] = |
| 4742 | ipa3_rsrc_rx_grp_config |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4743 | [hw_type_idx] |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4744 | [IPA_RSRC_GRP_TYPE_RX_HPS_CMDQ] |
| 4745 | [!depth ? i : 4 + i].min; |
| 4746 | else |
| 4747 | val.client_minmax[i] = |
| 4748 | ipa3_rsrc_rx_grp_config |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4749 | [hw_type_idx] |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4750 | [IPA_RSRC_GRP_TYPE_RX_HPS_CMDQ] |
| 4751 | [!depth ? i : 4 + i].max; |
| 4752 | } |
| 4753 | if (depth) { |
| 4754 | ipahal_write_reg_fields(min ? IPA_RX_HPS_CLIENTS_MIN_DEPTH_1 : |
| 4755 | IPA_RX_HPS_CLIENTS_MAX_DEPTH_1, |
| 4756 | &val); |
| 4757 | } else { |
| 4758 | ipahal_write_reg_fields(min ? IPA_RX_HPS_CLIENTS_MIN_DEPTH_0 : |
| 4759 | IPA_RX_HPS_CLIENTS_MAX_DEPTH_0, |
| 4760 | &val); |
| 4761 | } |
| 4762 | } |
| 4763 | |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 4764 | static void ipa3_configure_rx_hps_weight(void) |
| 4765 | { |
| 4766 | struct ipahal_reg_rx_hps_weights val; |
| 4767 | u8 hw_type_idx; |
| 4768 | |
| 4769 | hw_type_idx = ipa3_get_hw_type_index(); |
| 4770 | |
| 4771 | val.hps_queue_weight_0 = |
| 4772 | ipa3_rsrc_rx_grp_hps_weight_config |
| 4773 | [hw_type_idx][IPA_RSRC_GRP_TYPE_RX_HPS_WEIGHT_CONFIG] |
| 4774 | [0]; |
| 4775 | val.hps_queue_weight_1 = |
| 4776 | ipa3_rsrc_rx_grp_hps_weight_config |
| 4777 | [hw_type_idx][IPA_RSRC_GRP_TYPE_RX_HPS_WEIGHT_CONFIG] |
| 4778 | [1]; |
| 4779 | val.hps_queue_weight_2 = |
| 4780 | ipa3_rsrc_rx_grp_hps_weight_config |
| 4781 | [hw_type_idx][IPA_RSRC_GRP_TYPE_RX_HPS_WEIGHT_CONFIG] |
| 4782 | [2]; |
| 4783 | val.hps_queue_weight_3 = |
| 4784 | ipa3_rsrc_rx_grp_hps_weight_config |
| 4785 | [hw_type_idx][IPA_RSRC_GRP_TYPE_RX_HPS_WEIGHT_CONFIG] |
| 4786 | [3]; |
| 4787 | |
| 4788 | ipahal_write_reg_fields(IPA_HPS_FTCH_ARB_QUEUE_WEIGHT, &val); |
| 4789 | } |
| 4790 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4791 | void ipa3_set_resorce_groups_min_max_limits(void) |
| 4792 | { |
| 4793 | int i; |
| 4794 | int j; |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4795 | int src_rsrc_type_max; |
| 4796 | int dst_rsrc_type_max; |
| 4797 | int src_grp_idx_max; |
| 4798 | int dst_grp_idx_max; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4799 | struct ipahal_reg_rsrc_grp_cfg val; |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4800 | u8 hw_type_idx; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4801 | |
| 4802 | IPADBG("ENTER\n"); |
| 4803 | IPADBG("Assign source rsrc groups min-max limits\n"); |
| 4804 | |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4805 | hw_type_idx = ipa3_get_hw_type_index(); |
| 4806 | switch (hw_type_idx) { |
| 4807 | case IPA_3_0: |
| 4808 | src_rsrc_type_max = IPA_v3_0_RSRC_GRP_TYPE_SRC_MAX; |
| 4809 | dst_rsrc_type_max = IPA_v3_0_RSRC_GRP_TYPE_DST_MAX; |
| 4810 | src_grp_idx_max = IPA_v3_0_GROUP_MAX; |
| 4811 | dst_grp_idx_max = IPA_v3_0_GROUP_MAX; |
| 4812 | break; |
Amir Levy | 3a59dbd | 2017-03-15 14:30:54 +0200 | [diff] [blame] | 4813 | case IPA_3_5: |
Amir Levy | 54fe4d3 | 2017-03-16 11:21:49 +0200 | [diff] [blame] | 4814 | case IPA_3_5_MHI: |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4815 | case IPA_3_5_1: |
Amir Levy | 3be373c | 2017-03-05 16:31:30 +0200 | [diff] [blame] | 4816 | src_rsrc_type_max = IPA_v3_5_RSRC_GRP_TYPE_SRC_MAX; |
| 4817 | dst_rsrc_type_max = IPA_v3_5_RSRC_GRP_TYPE_DST_MAX; |
| 4818 | src_grp_idx_max = IPA_v3_5_SRC_GROUP_MAX; |
| 4819 | dst_grp_idx_max = IPA_v3_5_DST_GROUP_MAX; |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4820 | break; |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 4821 | case IPA_4_0: |
| 4822 | case IPA_4_0_MHI: |
| 4823 | src_rsrc_type_max = IPA_v4_0_RSRC_GRP_TYPE_SRC_MAX; |
| 4824 | dst_rsrc_type_max = IPA_v4_0_RSRC_GRP_TYPE_DST_MAX; |
| 4825 | src_grp_idx_max = IPA_v4_0_SRC_GROUP_MAX; |
| 4826 | dst_grp_idx_max = IPA_v4_0_DST_GROUP_MAX; |
| 4827 | break; |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4828 | default: |
| 4829 | IPAERR("invalid hw type index\n"); |
| 4830 | WARN_ON(1); |
| 4831 | return; |
| 4832 | } |
| 4833 | |
| 4834 | for (i = 0; i < src_rsrc_type_max; i++) { |
| 4835 | for (j = 0; j < src_grp_idx_max; j = j + 2) { |
| 4836 | val.x_min = |
| 4837 | ipa3_rsrc_src_grp_config[hw_type_idx][i][j].min; |
| 4838 | val.x_max = |
| 4839 | ipa3_rsrc_src_grp_config[hw_type_idx][i][j].max; |
| 4840 | val.y_min = |
| 4841 | ipa3_rsrc_src_grp_config[hw_type_idx][i][j + 1].min; |
| 4842 | val.y_max = |
| 4843 | ipa3_rsrc_src_grp_config[hw_type_idx][i][j + 1].max; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4844 | ipa3_write_rsrc_grp_type_reg(j, i, true, &val); |
| 4845 | } |
| 4846 | } |
| 4847 | |
| 4848 | IPADBG("Assign destination rsrc groups min-max limits\n"); |
| 4849 | |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4850 | for (i = 0; i < dst_rsrc_type_max; i++) { |
| 4851 | for (j = 0; j < dst_grp_idx_max; j = j + 2) { |
| 4852 | val.x_min = |
| 4853 | ipa3_rsrc_dst_grp_config[hw_type_idx][i][j].min; |
| 4854 | val.x_max = |
| 4855 | ipa3_rsrc_dst_grp_config[hw_type_idx][i][j].max; |
| 4856 | val.y_min = |
| 4857 | ipa3_rsrc_dst_grp_config[hw_type_idx][i][j + 1].min; |
| 4858 | val.y_max = |
| 4859 | ipa3_rsrc_dst_grp_config[hw_type_idx][i][j + 1].max; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4860 | ipa3_write_rsrc_grp_type_reg(j, i, false, &val); |
| 4861 | } |
| 4862 | } |
| 4863 | |
| 4864 | /* move resource group configuration from HLOS to TZ */ |
| 4865 | if (ipa3_ctx->ipa_hw_type >= IPA_HW_v3_1) { |
| 4866 | IPAERR("skip configuring ipa_rx_hps_clients from HLOS\n"); |
| 4867 | return; |
| 4868 | } |
| 4869 | |
| 4870 | IPADBG("Assign RX_HPS CMDQ rsrc groups min-max limits\n"); |
| 4871 | |
| 4872 | ipa3_configure_rx_hps_clients(0, true); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4873 | ipa3_configure_rx_hps_clients(0, false); |
Amir Levy | 0f97a5c | 2016-11-22 11:13:37 +0200 | [diff] [blame] | 4874 | |
| 4875 | /* only hw_type v3_0\3_1 have 6 RX_HPS_CMDQ and needs depth 1*/ |
| 4876 | if (ipa3_ctx->ipa_hw_type <= IPA_HW_v3_1) { |
| 4877 | ipa3_configure_rx_hps_clients(1, true); |
| 4878 | ipa3_configure_rx_hps_clients(1, false); |
| 4879 | } |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4880 | |
Michael Adisumarta | 539339d | 2017-05-16 14:18:23 -0700 | [diff] [blame] | 4881 | if (ipa3_ctx->ipa_hw_type >= IPA_HW_v3_5) |
| 4882 | ipa3_configure_rx_hps_weight(); |
| 4883 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4884 | IPADBG("EXIT\n"); |
| 4885 | } |
| 4886 | |
| 4887 | static void ipa3_gsi_poll_after_suspend(struct ipa3_ep_context *ep) |
| 4888 | { |
| 4889 | bool empty; |
| 4890 | |
| 4891 | IPADBG("switch ch %ld to poll\n", ep->gsi_chan_hdl); |
| 4892 | gsi_config_channel_mode(ep->gsi_chan_hdl, GSI_CHAN_MODE_POLL); |
| 4893 | gsi_is_channel_empty(ep->gsi_chan_hdl, &empty); |
| 4894 | if (!empty) { |
| 4895 | IPADBG("ch %ld not empty\n", ep->gsi_chan_hdl); |
| 4896 | /* queue a work to start polling if don't have one */ |
| 4897 | atomic_set(&ipa3_ctx->transport_pm.eot_activity, 1); |
Michael Adisumarta | 3e35081 | 2017-09-18 14:54:36 -0700 | [diff] [blame] | 4898 | if (!atomic_read(&ep->sys->curr_polling_state)) |
| 4899 | __ipa_gsi_irq_rx_scedule_poll(ep->sys); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4900 | } |
| 4901 | } |
| 4902 | |
Michael Adisumarta | 181b7e5 | 2017-12-11 12:38:09 -0800 | [diff] [blame] | 4903 | static int __ipa3_stop_gsi_channel(u32 clnt_hdl) |
| 4904 | { |
| 4905 | struct ipa_mem_buffer mem; |
| 4906 | int res = 0; |
| 4907 | int i; |
| 4908 | struct ipa3_ep_context *ep; |
| 4909 | |
| 4910 | if (clnt_hdl >= ipa3_ctx->ipa_num_pipes || |
| 4911 | ipa3_ctx->ep[clnt_hdl].valid == 0) { |
| 4912 | IPAERR("bad parm.\n"); |
| 4913 | return -EINVAL; |
| 4914 | } |
| 4915 | |
| 4916 | ep = &ipa3_ctx->ep[clnt_hdl]; |
| 4917 | memset(&mem, 0, sizeof(mem)); |
| 4918 | |
| 4919 | if (IPA_CLIENT_IS_PROD(ep->client)) { |
| 4920 | IPADBG("Calling gsi_stop_channel ch:%lu\n", |
| 4921 | ep->gsi_chan_hdl); |
| 4922 | res = gsi_stop_channel(ep->gsi_chan_hdl); |
| 4923 | IPADBG("gsi_stop_channel ch: %lu returned %d\n", |
| 4924 | ep->gsi_chan_hdl, res); |
| 4925 | return res; |
| 4926 | } |
| 4927 | |
| 4928 | for (i = 0; i < IPA_GSI_CHANNEL_STOP_MAX_RETRY; i++) { |
| 4929 | IPADBG("Calling gsi_stop_channel ch:%lu\n", |
| 4930 | ep->gsi_chan_hdl); |
| 4931 | res = gsi_stop_channel(ep->gsi_chan_hdl); |
| 4932 | IPADBG("gsi_stop_channel ch: %lu returned %d\n", |
| 4933 | ep->gsi_chan_hdl, res); |
| 4934 | if (res != -GSI_STATUS_AGAIN && res != -GSI_STATUS_TIMED_OUT) |
| 4935 | return res; |
| 4936 | |
| 4937 | IPADBG("Inject a DMA_TASK with 1B packet to IPA\n"); |
| 4938 | /* Send a 1B packet DMA_TASK to IPA and try again */ |
| 4939 | res = ipa3_inject_dma_task_for_gsi(); |
| 4940 | if (res) { |
| 4941 | IPAERR("Failed to inject DMA TASk for GSI\n"); |
| 4942 | return res; |
| 4943 | } |
| 4944 | |
| 4945 | /* sleep for short period to flush IPA */ |
| 4946 | usleep_range(IPA_GSI_CHANNEL_STOP_SLEEP_MIN_USEC, |
| 4947 | IPA_GSI_CHANNEL_STOP_SLEEP_MAX_USEC); |
| 4948 | } |
| 4949 | |
| 4950 | IPAERR("Failed to stop GSI channel with retries\n"); |
| 4951 | return -EFAULT; |
| 4952 | } |
| 4953 | |
| 4954 | /** |
| 4955 | * ipa3_stop_gsi_channel()- Stops a GSI channel in IPA |
| 4956 | * @chan_hdl: GSI channel handle |
| 4957 | * |
| 4958 | * This function implements the sequence to stop a GSI channel |
| 4959 | * in IPA. This function returns when the channel is in STOP state. |
| 4960 | * |
| 4961 | * Return value: 0 on success, negative otherwise |
| 4962 | */ |
| 4963 | int ipa3_stop_gsi_channel(u32 clnt_hdl) |
| 4964 | { |
| 4965 | int res; |
| 4966 | |
| 4967 | IPA_ACTIVE_CLIENTS_INC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 4968 | res = __ipa3_stop_gsi_channel(clnt_hdl); |
| 4969 | IPA_ACTIVE_CLIENTS_DEC_EP(ipa3_get_client_mapping(clnt_hdl)); |
| 4970 | |
| 4971 | return res; |
| 4972 | } |
| 4973 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4974 | void ipa3_suspend_apps_pipes(bool suspend) |
| 4975 | { |
| 4976 | struct ipa_ep_cfg_ctrl cfg; |
| 4977 | int ipa_ep_idx; |
| 4978 | struct ipa3_ep_context *ep; |
Skylar Chang | a699afd | 2017-06-06 10:06:21 -0700 | [diff] [blame] | 4979 | int res; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4980 | |
| 4981 | memset(&cfg, 0, sizeof(cfg)); |
| 4982 | cfg.ipa_ep_suspend = suspend; |
| 4983 | |
| 4984 | ipa_ep_idx = ipa3_get_ep_mapping(IPA_CLIENT_APPS_LAN_CONS); |
Ghanim Fodi | 79ee8d8 | 2017-02-27 16:39:25 +0200 | [diff] [blame] | 4985 | if (ipa_ep_idx < 0) { |
| 4986 | IPAERR("IPA client mapping failed\n"); |
| 4987 | ipa_assert(); |
| 4988 | return; |
| 4989 | } |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 4990 | ep = &ipa3_ctx->ep[ipa_ep_idx]; |
| 4991 | if (ep->valid) { |
| 4992 | IPADBG("%s pipe %d\n", suspend ? "suspend" : "unsuspend", |
| 4993 | ipa_ep_idx); |
Skylar Chang | a699afd | 2017-06-06 10:06:21 -0700 | [diff] [blame] | 4994 | if (ipa3_ctx->ipa_hw_type >= IPA_HW_v4_0) { |
| 4995 | if (suspend) { |
Michael Adisumarta | 181b7e5 | 2017-12-11 12:38:09 -0800 | [diff] [blame] | 4996 | res = __ipa3_stop_gsi_channel(ipa_ep_idx); |
Skylar Chang | a699afd | 2017-06-06 10:06:21 -0700 | [diff] [blame] | 4997 | if (res) { |
| 4998 | IPAERR("failed to stop LAN channel\n"); |
| 4999 | ipa_assert(); |
| 5000 | } |
| 5001 | } else { |
| 5002 | res = gsi_start_channel(ep->gsi_chan_hdl); |
| 5003 | if (res) { |
| 5004 | IPAERR("failed to start LAN channel\n"); |
| 5005 | ipa_assert(); |
| 5006 | } |
| 5007 | } |
| 5008 | } else { |
| 5009 | ipa3_cfg_ep_ctrl(ipa_ep_idx, &cfg); |
| 5010 | } |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 5011 | if (suspend) |
| 5012 | ipa3_gsi_poll_after_suspend(ep); |
| 5013 | else if (!atomic_read(&ep->sys->curr_polling_state)) |
| 5014 | gsi_config_channel_mode(ep->gsi_chan_hdl, |
| 5015 | GSI_CHAN_MODE_CALLBACK); |
| 5016 | } |
| 5017 | |
| 5018 | ipa_ep_idx = ipa_get_ep_mapping(IPA_CLIENT_APPS_WAN_CONS); |
| 5019 | /* Considering the case for SSR. */ |
| 5020 | if (ipa_ep_idx == -1) { |
| 5021 | IPADBG("Invalid client.\n"); |
| 5022 | return; |
| 5023 | } |
| 5024 | ep = &ipa3_ctx->ep[ipa_ep_idx]; |
| 5025 | if (ep->valid) { |
| 5026 | IPADBG("%s pipe %d\n", suspend ? "suspend" : "unsuspend", |
| 5027 | ipa_ep_idx); |
Skylar Chang | a699afd | 2017-06-06 10:06:21 -0700 | [diff] [blame] | 5028 | if (ipa3_ctx->ipa_hw_type >= IPA_HW_v4_0) { |
| 5029 | if (suspend) { |
Michael Adisumarta | 181b7e5 | 2017-12-11 12:38:09 -0800 | [diff] [blame] | 5030 | res = __ipa3_stop_gsi_channel(ipa_ep_idx); |
Skylar Chang | a699afd | 2017-06-06 10:06:21 -0700 | [diff] [blame] | 5031 | if (res) { |
| 5032 | IPAERR("failed to stop WAN channel\n"); |
| 5033 | ipa_assert(); |
| 5034 | } |
| 5035 | } else { |
| 5036 | res = gsi_start_channel(ep->gsi_chan_hdl); |
| 5037 | if (res) { |
| 5038 | IPAERR("failed to start WAN channel\n"); |
| 5039 | ipa_assert(); |
| 5040 | } |
| 5041 | } |
| 5042 | } else { |
| 5043 | ipa3_cfg_ep_ctrl(ipa_ep_idx, &cfg); |
| 5044 | } |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 5045 | if (suspend) |
| 5046 | ipa3_gsi_poll_after_suspend(ep); |
| 5047 | else if (!atomic_read(&ep->sys->curr_polling_state)) |
| 5048 | gsi_config_channel_mode(ep->gsi_chan_hdl, |
| 5049 | GSI_CHAN_MODE_CALLBACK); |
| 5050 | } |
| 5051 | } |
| 5052 | |
Skylar Chang | 6c4bec9 | 2017-04-21 16:10:14 -0700 | [diff] [blame] | 5053 | int ipa3_allocate_dma_task_for_gsi(void) |
| 5054 | { |
| 5055 | struct ipahal_imm_cmd_dma_task_32b_addr cmd = { 0 }; |
| 5056 | |
| 5057 | IPADBG("Allocate mem\n"); |
| 5058 | ipa3_ctx->dma_task_info.mem.size = IPA_GSI_CHANNEL_STOP_PKT_SIZE; |
| 5059 | ipa3_ctx->dma_task_info.mem.base = dma_alloc_coherent(ipa3_ctx->pdev, |
| 5060 | ipa3_ctx->dma_task_info.mem.size, |
| 5061 | &ipa3_ctx->dma_task_info.mem.phys_base, |
| 5062 | GFP_KERNEL); |
| 5063 | if (!ipa3_ctx->dma_task_info.mem.base) { |
| 5064 | IPAERR("no mem\n"); |
| 5065 | return -EFAULT; |
| 5066 | } |
| 5067 | |
| 5068 | cmd.flsh = 1; |
| 5069 | cmd.size1 = ipa3_ctx->dma_task_info.mem.size; |
| 5070 | cmd.addr1 = ipa3_ctx->dma_task_info.mem.phys_base; |
| 5071 | cmd.packet_size = ipa3_ctx->dma_task_info.mem.size; |
| 5072 | ipa3_ctx->dma_task_info.cmd_pyld = ipahal_construct_imm_cmd( |
| 5073 | IPA_IMM_CMD_DMA_TASK_32B_ADDR, &cmd, false); |
| 5074 | if (!ipa3_ctx->dma_task_info.cmd_pyld) { |
| 5075 | IPAERR("failed to construct dma_task_32b_addr cmd\n"); |
| 5076 | dma_free_coherent(ipa3_ctx->pdev, |
| 5077 | ipa3_ctx->dma_task_info.mem.size, |
| 5078 | ipa3_ctx->dma_task_info.mem.base, |
| 5079 | ipa3_ctx->dma_task_info.mem.phys_base); |
| 5080 | memset(&ipa3_ctx->dma_task_info, 0, |
| 5081 | sizeof(ipa3_ctx->dma_task_info)); |
| 5082 | return -EFAULT; |
| 5083 | } |
| 5084 | |
| 5085 | return 0; |
| 5086 | } |
| 5087 | |
| 5088 | void ipa3_free_dma_task_for_gsi(void) |
| 5089 | { |
| 5090 | dma_free_coherent(ipa3_ctx->pdev, |
| 5091 | ipa3_ctx->dma_task_info.mem.size, |
| 5092 | ipa3_ctx->dma_task_info.mem.base, |
| 5093 | ipa3_ctx->dma_task_info.mem.phys_base); |
| 5094 | ipahal_destroy_imm_cmd(ipa3_ctx->dma_task_info.cmd_pyld); |
| 5095 | memset(&ipa3_ctx->dma_task_info, 0, sizeof(ipa3_ctx->dma_task_info)); |
| 5096 | } |
| 5097 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 5098 | /** |
| 5099 | * ipa3_inject_dma_task_for_gsi()- Send DMA_TASK to IPA for GSI stop channel |
| 5100 | * |
| 5101 | * Send a DMA_TASK of 1B to IPA to unblock GSI channel in STOP_IN_PROG. |
| 5102 | * Return value: 0 on success, negative otherwise |
| 5103 | */ |
| 5104 | int ipa3_inject_dma_task_for_gsi(void) |
| 5105 | { |
Amir Levy | 479cfdd | 2017-10-26 12:23:14 +0300 | [diff] [blame] | 5106 | struct ipa3_desc desc; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 5107 | |
Amir Levy | 479cfdd | 2017-10-26 12:23:14 +0300 | [diff] [blame] | 5108 | 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] | 5109 | |
| 5110 | IPADBG("sending 1B packet to IPA\n"); |
Gidon Studinski | 3021a6f | 2016-11-10 12:48:48 +0200 | [diff] [blame] | 5111 | if (ipa3_send_cmd_timeout(1, &desc, |
| 5112 | IPA_DMA_TASK_FOR_GSI_TIMEOUT_MSEC)) { |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 5113 | IPAERR("ipa3_send_cmd failed\n"); |
| 5114 | return -EFAULT; |
| 5115 | } |
| 5116 | |
| 5117 | return 0; |
| 5118 | } |
| 5119 | |
Ghanim Fodi | 37b6495 | 2017-01-24 15:42:30 +0200 | [diff] [blame] | 5120 | static int ipa3_load_single_fw(const struct firmware *firmware, |
| 5121 | const struct elf32_phdr *phdr) |
| 5122 | { |
| 5123 | uint32_t *fw_mem_base; |
| 5124 | int index; |
| 5125 | const uint32_t *elf_data_ptr; |
| 5126 | |
| 5127 | if (phdr->p_offset > firmware->size) { |
| 5128 | IPAERR("Invalid ELF: offset=%u is beyond elf_size=%zu\n", |
| 5129 | phdr->p_offset, firmware->size); |
| 5130 | return -EINVAL; |
| 5131 | } |
| 5132 | if ((firmware->size - phdr->p_offset) < phdr->p_filesz) { |
| 5133 | IPAERR("Invalid ELF: offset=%u filesz=%u elf_size=%zu\n", |
| 5134 | phdr->p_offset, phdr->p_filesz, firmware->size); |
| 5135 | return -EINVAL; |
| 5136 | } |
| 5137 | |
| 5138 | if (phdr->p_memsz % sizeof(uint32_t)) { |
| 5139 | IPAERR("FW mem size %u doesn't align to 32bit\n", |
| 5140 | phdr->p_memsz); |
| 5141 | return -EFAULT; |
| 5142 | } |
| 5143 | |
| 5144 | if (phdr->p_filesz > phdr->p_memsz) { |
| 5145 | IPAERR("FW image too big src_size=%u dst_size=%u\n", |
| 5146 | phdr->p_filesz, phdr->p_memsz); |
| 5147 | return -EFAULT; |
| 5148 | } |
| 5149 | |
| 5150 | fw_mem_base = ioremap(phdr->p_vaddr, phdr->p_memsz); |
| 5151 | if (!fw_mem_base) { |
| 5152 | IPAERR("Failed to map 0x%x for the size of %u\n", |
| 5153 | phdr->p_vaddr, phdr->p_memsz); |
| 5154 | return -ENOMEM; |
| 5155 | } |
| 5156 | |
| 5157 | /* Set the entire region to 0s */ |
| 5158 | memset(fw_mem_base, 0, phdr->p_memsz); |
| 5159 | |
| 5160 | elf_data_ptr = (uint32_t *)(firmware->data + phdr->p_offset); |
| 5161 | |
| 5162 | /* Write the FW */ |
| 5163 | for (index = 0; index < phdr->p_filesz/sizeof(uint32_t); index++) { |
| 5164 | writel_relaxed(*elf_data_ptr, &fw_mem_base[index]); |
| 5165 | elf_data_ptr++; |
| 5166 | } |
| 5167 | |
| 5168 | iounmap(fw_mem_base); |
| 5169 | |
| 5170 | return 0; |
| 5171 | } |
| 5172 | |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 5173 | /** |
| 5174 | * ipa3_load_fws() - Load the IPAv3 FWs into IPA&GSI SRAM. |
| 5175 | * |
| 5176 | * @firmware: Structure which contains the FW data from the user space. |
Ghanim Fodi | 37b6495 | 2017-01-24 15:42:30 +0200 | [diff] [blame] | 5177 | * @gsi_mem_base: GSI base address |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 5178 | * |
| 5179 | * Return value: 0 on success, negative otherwise |
| 5180 | * |
| 5181 | */ |
Ghanim Fodi | 37b6495 | 2017-01-24 15:42:30 +0200 | [diff] [blame] | 5182 | 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] | 5183 | { |
| 5184 | const struct elf32_hdr *ehdr; |
| 5185 | const struct elf32_phdr *phdr; |
Ghanim Fodi | 37b6495 | 2017-01-24 15:42:30 +0200 | [diff] [blame] | 5186 | unsigned long gsi_iram_ofst; |
| 5187 | unsigned long gsi_iram_size; |
| 5188 | phys_addr_t ipa_reg_mem_base; |
| 5189 | u32 ipa_reg_ofst; |
| 5190 | int rc; |
| 5191 | |
| 5192 | if (!gsi_mem_base) { |
| 5193 | IPAERR("Invalid GSI base address\n"); |
| 5194 | return -EINVAL; |
| 5195 | } |
| 5196 | |
| 5197 | ipa_assert_on(!firmware); |
| 5198 | /* One program header per FW image: GSI, DPS and HPS */ |
| 5199 | if (firmware->size < (sizeof(*ehdr) + 3 * sizeof(*phdr))) { |
| 5200 | IPAERR("Missing ELF and Program headers firmware size=%zu\n", |
| 5201 | firmware->size); |
| 5202 | return -EINVAL; |
| 5203 | } |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 5204 | |
| 5205 | ehdr = (struct elf32_hdr *) firmware->data; |
Ghanim Fodi | 37b6495 | 2017-01-24 15:42:30 +0200 | [diff] [blame] | 5206 | ipa_assert_on(!ehdr); |
| 5207 | if (ehdr->e_phnum != 3) { |
| 5208 | IPAERR("Unexpected number of ELF program headers\n"); |
| 5209 | return -EINVAL; |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 5210 | } |
Ghanim Fodi | 37b6495 | 2017-01-24 15:42:30 +0200 | [diff] [blame] | 5211 | phdr = (struct elf32_phdr *)(firmware->data + sizeof(*ehdr)); |
| 5212 | |
| 5213 | /* |
| 5214 | * Each ELF program header represents a FW image and contains: |
| 5215 | * p_vaddr : The starting address to which the FW needs to loaded. |
| 5216 | * p_memsz : The size of the IRAM (where the image loaded) |
| 5217 | * p_filesz: The size of the FW image embedded inside the ELF |
| 5218 | * p_offset: Absolute offset to the image from the head of the ELF |
| 5219 | */ |
| 5220 | |
| 5221 | /* Load GSI FW image */ |
| 5222 | gsi_get_inst_ram_offset_and_size(&gsi_iram_ofst, &gsi_iram_size); |
| 5223 | if (phdr->p_vaddr != (gsi_mem_base + gsi_iram_ofst)) { |
| 5224 | IPAERR( |
| 5225 | "Invalid GSI FW img load addr vaddr=0x%x gsi_mem_base=%pa gsi_iram_ofst=0x%lx\n" |
| 5226 | , phdr->p_vaddr, &gsi_mem_base, gsi_iram_ofst); |
| 5227 | return -EINVAL; |
| 5228 | } |
| 5229 | if (phdr->p_memsz > gsi_iram_size) { |
| 5230 | IPAERR("Invalid GSI FW img size memsz=%d gsi_iram_size=%lu\n", |
| 5231 | phdr->p_memsz, gsi_iram_size); |
| 5232 | return -EINVAL; |
| 5233 | } |
| 5234 | rc = ipa3_load_single_fw(firmware, phdr); |
| 5235 | if (rc) |
| 5236 | return rc; |
| 5237 | |
| 5238 | phdr++; |
| 5239 | ipa_reg_mem_base = ipa3_ctx->ipa_wrapper_base + ipahal_get_reg_base(); |
| 5240 | |
| 5241 | /* Load IPA DPS FW image */ |
| 5242 | ipa_reg_ofst = ipahal_get_reg_ofst(IPA_DPS_SEQUENCER_FIRST); |
| 5243 | if (phdr->p_vaddr != (ipa_reg_mem_base + ipa_reg_ofst)) { |
| 5244 | IPAERR( |
| 5245 | "Invalid IPA DPS img load addr vaddr=0x%x ipa_reg_mem_base=%pa ipa_reg_ofst=%u\n" |
| 5246 | , phdr->p_vaddr, &ipa_reg_mem_base, ipa_reg_ofst); |
| 5247 | return -EINVAL; |
| 5248 | } |
| 5249 | if (phdr->p_memsz > ipahal_get_dps_img_mem_size()) { |
| 5250 | IPAERR("Invalid IPA DPS img size memsz=%d dps_mem_size=%u\n", |
| 5251 | phdr->p_memsz, ipahal_get_dps_img_mem_size()); |
| 5252 | return -EINVAL; |
| 5253 | } |
| 5254 | rc = ipa3_load_single_fw(firmware, phdr); |
| 5255 | if (rc) |
| 5256 | return rc; |
| 5257 | |
| 5258 | phdr++; |
| 5259 | |
| 5260 | /* Load IPA HPS FW image */ |
| 5261 | ipa_reg_ofst = ipahal_get_reg_ofst(IPA_HPS_SEQUENCER_FIRST); |
| 5262 | if (phdr->p_vaddr != (ipa_reg_mem_base + ipa_reg_ofst)) { |
| 5263 | IPAERR( |
| 5264 | "Invalid IPA HPS img load addr vaddr=0x%x ipa_reg_mem_base=%pa ipa_reg_ofst=%u\n" |
| 5265 | , phdr->p_vaddr, &ipa_reg_mem_base, ipa_reg_ofst); |
| 5266 | return -EINVAL; |
| 5267 | } |
| 5268 | if (phdr->p_memsz > ipahal_get_hps_img_mem_size()) { |
| 5269 | IPAERR("Invalid IPA HPS img size memsz=%d dps_mem_size=%u\n", |
| 5270 | phdr->p_memsz, ipahal_get_hps_img_mem_size()); |
| 5271 | return -EINVAL; |
| 5272 | } |
| 5273 | rc = ipa3_load_single_fw(firmware, phdr); |
| 5274 | if (rc) |
| 5275 | return rc; |
| 5276 | |
| 5277 | IPADBG("IPA FWs (GSI FW, DPS and HPS) loaded successfully\n"); |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 5278 | return 0; |
| 5279 | } |
| 5280 | |
| 5281 | /** |
| 5282 | * ipa3_is_msm_device() - Is the running device a MSM or MDM? |
| 5283 | * Determine according to IPA version |
| 5284 | * |
| 5285 | * Return value: true if MSM, false if MDM |
| 5286 | * |
| 5287 | */ |
| 5288 | bool ipa3_is_msm_device(void) |
| 5289 | { |
| 5290 | switch (ipa3_ctx->ipa_hw_type) { |
| 5291 | case IPA_HW_v3_0: |
| 5292 | case IPA_HW_v3_5: |
Michael Adisumarta | 891a4ff | 2017-05-16 16:40:06 -0700 | [diff] [blame] | 5293 | case IPA_HW_v4_0: |
Amir Levy | 9659e59 | 2016-10-27 18:08:27 +0300 | [diff] [blame] | 5294 | return false; |
| 5295 | case IPA_HW_v3_1: |
| 5296 | case IPA_HW_v3_5_1: |
| 5297 | return true; |
| 5298 | default: |
| 5299 | IPAERR("unknown HW type %d\n", ipa3_ctx->ipa_hw_type); |
| 5300 | ipa_assert(); |
| 5301 | } |
| 5302 | |
| 5303 | return false; |
| 5304 | } |
Amir Levy | c4222c9 | 2016-11-07 16:14:54 +0200 | [diff] [blame] | 5305 | |
| 5306 | /** |
Amir Levy | 3afd94a | 2017-01-05 10:19:13 +0200 | [diff] [blame] | 5307 | * ipa3_disable_prefetch() - disable\enable tx prefetch |
| 5308 | * |
| 5309 | * @client: the client which is related to the TX where prefetch will be |
| 5310 | * disabled |
| 5311 | * |
| 5312 | * Return value: Non applicable |
| 5313 | * |
| 5314 | */ |
| 5315 | void ipa3_disable_prefetch(enum ipa_client_type client) |
| 5316 | { |
| 5317 | struct ipahal_reg_tx_cfg cfg; |
| 5318 | u8 qmb; |
| 5319 | |
| 5320 | qmb = ipa3_get_qmb_master_sel(client); |
| 5321 | |
| 5322 | IPADBG("disabling prefetch for qmb %d\n", (int)qmb); |
| 5323 | |
| 5324 | ipahal_read_reg_fields(IPA_TX_CFG, &cfg); |
| 5325 | /* QMB0 (DDR) correlates with TX0, QMB1(PCIE) correlates with TX1 */ |
| 5326 | if (qmb == QMB_MASTER_SELECT_DDR) |
| 5327 | cfg.tx0_prefetch_disable = true; |
| 5328 | else |
| 5329 | cfg.tx1_prefetch_disable = true; |
| 5330 | ipahal_write_reg_fields(IPA_TX_CFG, &cfg); |
| 5331 | } |
| 5332 | |
| 5333 | /** |
Amir Levy | c4222c9 | 2016-11-07 16:14:54 +0200 | [diff] [blame] | 5334 | * ipa3_get_pdev() - return a pointer to IPA dev struct |
| 5335 | * |
| 5336 | * Return value: a pointer to IPA dev struct |
| 5337 | * |
| 5338 | */ |
| 5339 | struct device *ipa3_get_pdev(void) |
| 5340 | { |
| 5341 | if (!ipa3_ctx) |
| 5342 | return NULL; |
| 5343 | |
| 5344 | return ipa3_ctx->pdev; |
| 5345 | } |
Amir Levy | 12ef091 | 2016-08-30 09:27:34 +0300 | [diff] [blame] | 5346 | |
| 5347 | /** |
| 5348 | * ipa3_enable_dcd() - enable dynamic clock division on IPA |
| 5349 | * |
| 5350 | * Return value: Non applicable |
| 5351 | * |
| 5352 | */ |
| 5353 | void ipa3_enable_dcd(void) |
| 5354 | { |
| 5355 | struct ipahal_reg_idle_indication_cfg idle_indication_cfg; |
| 5356 | |
| 5357 | /* recommended values for IPA 3.5 according to IPA HPG */ |
| 5358 | idle_indication_cfg.const_non_idle_enable = 0; |
| 5359 | idle_indication_cfg.enter_idle_debounce_thresh = 256; |
| 5360 | |
| 5361 | ipahal_write_reg_fields(IPA_IDLE_INDICATION_CFG, |
| 5362 | &idle_indication_cfg); |
| 5363 | } |
Amir Levy | 479cfdd | 2017-10-26 12:23:14 +0300 | [diff] [blame] | 5364 | |
| 5365 | void ipa3_init_imm_cmd_desc(struct ipa3_desc *desc, |
| 5366 | struct ipahal_imm_cmd_pyld *cmd_pyld) |
| 5367 | { |
| 5368 | memset(desc, 0, sizeof(*desc)); |
| 5369 | desc->opcode = cmd_pyld->opcode; |
| 5370 | desc->pyld = cmd_pyld->data; |
| 5371 | desc->len = cmd_pyld->len; |
| 5372 | desc->type = IPA_IMM_CMD_DESC; |
| 5373 | } |
| 5374 | |