Umang Agrawal | 3f4cc32 | 2019-05-27 14:28:59 +0530 | [diff] [blame] | 1 | /* Copyright (c) 2015-2016, 2018-2019, The Linux Foundation. All rights reserved. |
Aparna Mallavarapu | ca67688 | 2015-01-19 20:39:06 +0530 | [diff] [blame] | 2 | * |
| 3 | * Redistribution and use in source and binary forms, with or without |
| 4 | * modification, are permitted provided that the following conditions are |
| 5 | * met: |
| 6 | * * Redistributions of source code must retain the above copyright |
| 7 | * notice, this list of conditions and the following disclaimer. |
| 8 | * * Redistributions in binary form must reproduce the above |
| 9 | * copyright notice, this list of conditions and the following |
| 10 | * disclaimer in the documentation and/or other materials provided |
| 11 | * with the distribution. |
| 12 | * * Neither the name of The Linux Foundation nor the names of its |
| 13 | * contributors may be used to endorse or promote products derived |
| 14 | * from this software without specific prior written permission. |
| 15 | * |
| 16 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED |
| 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT |
| 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS |
| 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
| 23 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 24 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
| 25 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN |
| 26 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | */ |
| 28 | |
| 29 | #include <debug.h> |
| 30 | #include <reg.h> |
| 31 | #include <platform/iomap.h> |
Aparna Mallavarapu | 7b638e6 | 2015-03-26 05:51:57 +0530 | [diff] [blame] | 32 | #include <platform/irqs.h> |
| 33 | #include <platform/clock.h> |
Aparna Mallavarapu | ca67688 | 2015-01-19 20:39:06 +0530 | [diff] [blame] | 34 | #include <qgic.h> |
| 35 | #include <qtimer.h> |
| 36 | #include <mmu.h> |
| 37 | #include <arch/arm/mmu.h> |
| 38 | #include <smem.h> |
Aparna Mallavarapu | e9bdacd | 2015-03-15 14:24:21 +0530 | [diff] [blame] | 39 | #include <board.h> |
Aparna Mallavarapu | 7b638e6 | 2015-03-26 05:51:57 +0530 | [diff] [blame] | 40 | #include <boot_stats.h> |
| 41 | #include <platform.h> |
Unnati Gandhi | c74a57e | 2015-06-04 14:34:12 +0530 | [diff] [blame] | 42 | #include <target/display.h> |
Aparna Mallavarapu | e9bdacd | 2015-03-15 14:24:21 +0530 | [diff] [blame] | 43 | |
vijay kumar | a0a7472 | 2015-09-04 15:45:49 +0530 | [diff] [blame] | 44 | #define MSM8976_SOC_V11 0x10001 |
Aparna Mallavarapu | e9bdacd | 2015-03-15 14:24:21 +0530 | [diff] [blame] | 45 | #define MSM_IOMAP_SIZE ((MSM_IOMAP_END - MSM_IOMAP_BASE)/MB) |
| 46 | #define APPS_SS_SIZE ((APPS_SS_END - APPS_SS_BASE)/MB) |
| 47 | |
| 48 | /* LK memory - cacheable, write through */ |
| 49 | #define LK_MEMORY (MMU_MEMORY_TYPE_NORMAL_WRITE_BACK_ALLOCATE | \ |
| 50 | MMU_MEMORY_AP_READ_WRITE) |
| 51 | |
| 52 | /* Peripherals - non-shared device */ |
| 53 | #define IOMAP_MEMORY (MMU_MEMORY_TYPE_DEVICE_SHARED | \ |
| 54 | MMU_MEMORY_AP_READ_WRITE | MMU_MEMORY_XN) |
| 55 | |
| 56 | /* IMEM memory - cacheable, write through */ |
| 57 | #define COMMON_MEMORY (MMU_MEMORY_TYPE_NORMAL_WRITE_THROUGH | \ |
| 58 | MMU_MEMORY_AP_READ_WRITE | MMU_MEMORY_XN) |
| 59 | |
| 60 | #define SCRATCH_MEMORY (MMU_MEMORY_TYPE_NORMAL_WRITE_BACK_ALLOCATE | \ |
| 61 | MMU_MEMORY_AP_READ_WRITE | MMU_MEMORY_XN) |
| 62 | |
| 63 | static mmu_section_t mmu_section_table[] = { |
| 64 | /* Physical addr, Virtual addr, Size (in MB), Flags */ |
Parth Dixit | 23d2344 | 2015-07-30 18:47:38 +0530 | [diff] [blame] | 65 | { MEMBASE, MEMBASE, (MEMSIZE / MB), LK_MEMORY}, |
| 66 | { MSM_IOMAP_BASE, MSM_IOMAP_BASE, MSM_IOMAP_SIZE, IOMAP_MEMORY}, |
| 67 | { APPS_SS_BASE, APPS_SS_BASE, APPS_SS_SIZE, IOMAP_MEMORY}, |
| 68 | { MSM_SHARED_IMEM_BASE, MSM_SHARED_IMEM_BASE, 1, COMMON_MEMORY}, |
Parth Dixit | 7062320 | 2016-12-21 15:45:27 +0530 | [diff] [blame] | 69 | { SCRATCH_ADDR, SCRATCH_ADDR, SCRATCH_SIZE, SCRATCH_MEMORY}, |
Vishnuvardhan Prodduturi | b67e494 | 2015-12-03 22:41:45 +0530 | [diff] [blame] | 70 | { MIPI_FB_ADDR, MIPI_FB_ADDR, 20, COMMON_MEMORY}, |
Mayank Grover | e73aafb | 2017-11-02 12:52:33 +0530 | [diff] [blame] | 71 | { RPMB_SND_RCV_BUF_STRT, RPMB_SND_RCV_BUF_STRT, RPMB_SND_RCV_BUF_SZ, IOMAP_MEMORY}, |
Aparna Mallavarapu | e9bdacd | 2015-03-15 14:24:21 +0530 | [diff] [blame] | 72 | }; |
Aparna Mallavarapu | ca67688 | 2015-01-19 20:39:06 +0530 | [diff] [blame] | 73 | |
Parth Dixit | 7062320 | 2016-12-21 15:45:27 +0530 | [diff] [blame] | 74 | static mmu_section_t mmu_section_table_512[] = { |
| 75 | /* Physical addr, Virtual addr, Size (in MB), Flags */ |
| 76 | { MEMBASE, MEMBASE, (MEMSIZE / MB), LK_MEMORY}, |
| 77 | { MSM_IOMAP_BASE, MSM_IOMAP_BASE, MSM_IOMAP_SIZE, IOMAP_MEMORY}, |
| 78 | { APPS_SS_BASE, APPS_SS_BASE, APPS_SS_SIZE, IOMAP_MEMORY}, |
| 79 | { MSM_SHARED_IMEM_BASE, MSM_SHARED_IMEM_BASE, 1, COMMON_MEMORY}, |
| 80 | { SCRATCH_ADDR_512, SCRATCH_ADDR_512, SCRATCH_SIZE_512, SCRATCH_MEMORY}, |
| 81 | { MIPI_FB_ADDR, MIPI_FB_ADDR, 20, COMMON_MEMORY}, |
| 82 | { RPMB_SND_RCV_BUF_512, RPMB_SND_RCV_BUF_512, RPMB_SND_RCV_BUF_SZ, IOMAP_MEMORY}, |
| 83 | }; |
| 84 | |
Aparna Mallavarapu | ca67688 | 2015-01-19 20:39:06 +0530 | [diff] [blame] | 85 | void platform_early_init(void) |
| 86 | { |
Aparna Mallavarapu | e9bdacd | 2015-03-15 14:24:21 +0530 | [diff] [blame] | 87 | board_init(); |
Aparna Mallavarapu | 7b638e6 | 2015-03-26 05:51:57 +0530 | [diff] [blame] | 88 | platform_clock_init(); |
Aparna Mallavarapu | ca67688 | 2015-01-19 20:39:06 +0530 | [diff] [blame] | 89 | qgic_init(); |
| 90 | qtimer_init(); |
| 91 | scm_init(); |
| 92 | } |
| 93 | |
| 94 | void platform_init(void) |
| 95 | { |
| 96 | dprintf(INFO, "platform_init()\n"); |
| 97 | } |
| 98 | |
| 99 | void platform_uninit(void) |
| 100 | { |
| 101 | qtimer_uninit(); |
| 102 | } |
| 103 | |
| 104 | uint32_t platform_get_sclk_count(void) |
| 105 | { |
| 106 | return readl(MPM2_MPM_SLEEP_TIMETICK_COUNT_VAL); |
| 107 | } |
| 108 | |
| 109 | addr_t get_bs_info_addr() |
| 110 | { |
| 111 | return ((addr_t)BS_INFO_ADDR); |
| 112 | } |
| 113 | |
| 114 | int platform_use_identity_mmu_mappings(void) |
| 115 | { |
| 116 | /* Use only the mappings specified in this file. */ |
Aparna Mallavarapu | e9bdacd | 2015-03-15 14:24:21 +0530 | [diff] [blame] | 117 | return 0; |
| 118 | } |
| 119 | |
| 120 | /* Setup MMU mapping for this platform */ |
| 121 | void platform_init_mmu_mappings(void) |
| 122 | { |
| 123 | uint32_t i; |
| 124 | uint32_t sections; |
Parth Dixit | 7062320 | 2016-12-21 15:45:27 +0530 | [diff] [blame] | 125 | uint32_t table_size; |
Aparna Mallavarapu | e9bdacd | 2015-03-15 14:24:21 +0530 | [diff] [blame] | 126 | uint32_t ddr_start = get_ddr_start(); |
| 127 | uint32_t smem_addr = platform_get_smem_base_addr(); |
Parth Dixit | 7062320 | 2016-12-21 15:45:27 +0530 | [diff] [blame] | 128 | mmu_section_t *table_addr; |
Aparna Mallavarapu | e9bdacd | 2015-03-15 14:24:21 +0530 | [diff] [blame] | 129 | |
| 130 | /*Mapping the ddr start address for loading the kernel about 90 MB*/ |
| 131 | sections = 90; |
| 132 | while(sections--) |
| 133 | { |
Maria Yu | abef1f8 | 2015-08-05 16:13:44 +0800 | [diff] [blame] | 134 | arm_mmu_map_section(ddr_start + sections * MB, ddr_start + sections* MB, SCRATCH_MEMORY); |
Aparna Mallavarapu | e9bdacd | 2015-03-15 14:24:21 +0530 | [diff] [blame] | 135 | } |
| 136 | |
| 137 | |
| 138 | /* Mapping the SMEM addr */ |
| 139 | arm_mmu_map_section(smem_addr, smem_addr, COMMON_MEMORY); |
| 140 | |
| 141 | /* Configure the MMU page entries for memory read from the |
| 142 | mmu_section_table */ |
Parth Dixit | 7062320 | 2016-12-21 15:45:27 +0530 | [diff] [blame] | 143 | if(smem_get_ddr_size() > 0x20000000) |
| 144 | { |
| 145 | table_addr = mmu_section_table; |
| 146 | table_size = ARRAY_SIZE(mmu_section_table); |
| 147 | } |
| 148 | else |
| 149 | { |
| 150 | table_addr = mmu_section_table_512; |
| 151 | table_size = ARRAY_SIZE(mmu_section_table_512); |
| 152 | } |
| 153 | |
Aparna Mallavarapu | e9bdacd | 2015-03-15 14:24:21 +0530 | [diff] [blame] | 154 | for (i = 0; i < table_size; i++) |
| 155 | { |
Parth Dixit | 7062320 | 2016-12-21 15:45:27 +0530 | [diff] [blame] | 156 | sections = table_addr->num_of_sections; |
Aparna Mallavarapu | e9bdacd | 2015-03-15 14:24:21 +0530 | [diff] [blame] | 157 | |
| 158 | while (sections--) |
| 159 | { |
Parth Dixit | 7062320 | 2016-12-21 15:45:27 +0530 | [diff] [blame] | 160 | arm_mmu_map_section(table_addr->paddress + |
Aparna Mallavarapu | e9bdacd | 2015-03-15 14:24:21 +0530 | [diff] [blame] | 161 | sections * MB, |
Parth Dixit | 7062320 | 2016-12-21 15:45:27 +0530 | [diff] [blame] | 162 | table_addr->vaddress + |
Aparna Mallavarapu | e9bdacd | 2015-03-15 14:24:21 +0530 | [diff] [blame] | 163 | sections * MB, |
Parth Dixit | 7062320 | 2016-12-21 15:45:27 +0530 | [diff] [blame] | 164 | table_addr->flags); |
Aparna Mallavarapu | e9bdacd | 2015-03-15 14:24:21 +0530 | [diff] [blame] | 165 | } |
Parth Dixit | 7062320 | 2016-12-21 15:45:27 +0530 | [diff] [blame] | 166 | table_addr++; |
Aparna Mallavarapu | e9bdacd | 2015-03-15 14:24:21 +0530 | [diff] [blame] | 167 | } |
Parth Dixit | 7062320 | 2016-12-21 15:45:27 +0530 | [diff] [blame] | 168 | |
Aparna Mallavarapu | e9bdacd | 2015-03-15 14:24:21 +0530 | [diff] [blame] | 169 | } |
| 170 | |
| 171 | addr_t platform_get_virt_to_phys_mapping(addr_t virt_addr) |
| 172 | { |
| 173 | /* Using 1-1 mapping on this platform. */ |
| 174 | return virt_addr; |
| 175 | } |
| 176 | |
| 177 | addr_t platform_get_phys_to_virt_mapping(addr_t phys_addr) |
| 178 | { |
| 179 | /* Using 1-1 mapping on this platform. */ |
| 180 | return phys_addr; |
| 181 | } |
| 182 | |
| 183 | /* DYNAMIC SMEM REGION feature enables LK to dynamically |
| 184 | * read the SMEM addr info from TCSR_TZ_WONCE register. |
| 185 | * The first word read, if indicates a MAGIC number, then |
| 186 | * Dynamic SMEM is assumed to be enabled. Read the remaining |
| 187 | * SMEM info for SMEM Size and Phy_addr from the other bytes. |
| 188 | */ |
| 189 | uint32_t platform_get_smem_base_addr() |
| 190 | { |
| 191 | struct smem_addr_info *smem_info = NULL; |
| 192 | |
| 193 | smem_info = (struct smem_addr_info *)readl(TCSR_TZ_WONCE); |
| 194 | if(smem_info && (smem_info->identifier == SMEM_TARGET_INFO_IDENTIFIER)) |
| 195 | return smem_info->phy_addr; |
| 196 | else |
| 197 | return MSM_SHARED_BASE; |
Aparna Mallavarapu | ca67688 | 2015-01-19 20:39:06 +0530 | [diff] [blame] | 198 | } |
Aparna Mallavarapu | fa5f8a7 | 2015-03-31 06:21:36 +0530 | [diff] [blame] | 199 | |
| 200 | uint32_t platform_get_max_periph() |
| 201 | { |
| 202 | return 256; |
| 203 | } |
Unnati Gandhi | 81b7706 | 2015-05-28 14:23:39 +0530 | [diff] [blame] | 204 | |
Parth Dixit | 05f3c9f | 2016-03-18 17:14:57 +0530 | [diff] [blame] | 205 | int platform_is_msm8917() |
Parth Dixit | 88a8ee1 | 2016-01-08 15:14:37 +0530 | [diff] [blame] | 206 | { |
| 207 | uint32_t platform = board_platform_id(); |
| 208 | uint32_t ret = 0; |
| 209 | |
| 210 | switch(platform) |
| 211 | { |
Parth Dixit | 05f3c9f | 2016-03-18 17:14:57 +0530 | [diff] [blame] | 212 | case MSM8917: |
Mayank Grover | cd5f0ff | 2016-10-03 18:08:52 +0530 | [diff] [blame] | 213 | case MSM8920: |
Parth Dixit | 05f3c9f | 2016-03-18 17:14:57 +0530 | [diff] [blame] | 214 | case MSM8217: |
| 215 | case MSM8617: |
| 216 | case APQ8017: |
lijuang | 412d4f0 | 2018-10-16 18:27:48 +0800 | [diff] [blame] | 217 | ret = 1; |
| 218 | break; |
| 219 | default: |
| 220 | ret = 0; |
| 221 | }; |
| 222 | |
| 223 | return ret; |
| 224 | } |
| 225 | |
| 226 | int platform_is_qm215() |
| 227 | { |
| 228 | uint32_t platform = board_platform_id(); |
| 229 | uint32_t ret = 0; |
| 230 | |
| 231 | switch(platform) |
| 232 | { |
lijuang | 80ac118 | 2018-09-07 13:39:58 +0800 | [diff] [blame] | 233 | case QM215: |
Parth Dixit | 88a8ee1 | 2016-01-08 15:14:37 +0530 | [diff] [blame] | 234 | ret = 1; |
| 235 | break; |
| 236 | default: |
| 237 | ret = 0; |
| 238 | }; |
| 239 | |
| 240 | return ret; |
| 241 | } |
| 242 | |
Parth Dixit | 4552cba | 2015-10-20 01:18:59 +0530 | [diff] [blame] | 243 | int platform_is_msm8937() |
| 244 | { |
| 245 | uint32_t platform = board_platform_id(); |
| 246 | uint32_t ret = 0; |
| 247 | |
| 248 | switch(platform) |
| 249 | { |
| 250 | case MSM8937: |
Parth Dixit | 660369e | 2016-05-12 09:53:15 +0530 | [diff] [blame] | 251 | case MSM8940: |
Parth Dixit | 4552cba | 2015-10-20 01:18:59 +0530 | [diff] [blame] | 252 | case APQ8037: |
| 253 | ret = 1; |
| 254 | break; |
| 255 | default: |
| 256 | ret = 0; |
| 257 | }; |
| 258 | |
| 259 | return ret; |
| 260 | } |
| 261 | |
Parth Dixit | deecdcd | 2016-01-12 15:12:56 +0530 | [diff] [blame] | 262 | int platform_is_msm8952() |
| 263 | { |
| 264 | uint32_t platform = board_platform_id(); |
| 265 | uint32_t ret = 0; |
| 266 | |
| 267 | switch(platform) |
| 268 | { |
| 269 | case MSM8952: |
| 270 | case APQ8052: |
| 271 | ret = 1; |
| 272 | break; |
| 273 | default: |
| 274 | ret = 0; |
| 275 | }; |
| 276 | |
| 277 | return ret; |
| 278 | } |
| 279 | |
lijuang | d18524e | 2018-04-04 20:22:19 +0800 | [diff] [blame] | 280 | int platform_is_sdm429() |
| 281 | { |
| 282 | uint32_t platform = board_platform_id(); |
| 283 | uint32_t ret = 0; |
| 284 | |
| 285 | switch(platform) |
| 286 | { |
| 287 | case SDM429: |
lijuang | 08f1492 | 2018-04-23 19:02:57 +0800 | [diff] [blame] | 288 | case SDA429: |
lijuang | d18524e | 2018-04-04 20:22:19 +0800 | [diff] [blame] | 289 | ret = 1; |
| 290 | break; |
| 291 | default: |
| 292 | ret = 0; |
| 293 | }; |
| 294 | |
| 295 | return ret; |
| 296 | } |
| 297 | |
| 298 | int platform_is_sdm439() |
| 299 | { |
| 300 | uint32_t platform = board_platform_id(); |
| 301 | uint32_t ret = 0; |
| 302 | |
| 303 | switch(platform) |
| 304 | { |
| 305 | case SDM439: |
lijuang | 08f1492 | 2018-04-23 19:02:57 +0800 | [diff] [blame] | 306 | case SDA439: |
lijuang | d18524e | 2018-04-04 20:22:19 +0800 | [diff] [blame] | 307 | ret = 1; |
| 308 | break; |
| 309 | default: |
| 310 | ret = 0; |
| 311 | }; |
| 312 | |
| 313 | return ret; |
| 314 | } |
| 315 | |
Umang Agrawal | 3f4cc32 | 2019-05-27 14:28:59 +0530 | [diff] [blame] | 316 | int platform_is_sdm429w() |
| 317 | { |
| 318 | uint32_t platform = board_platform_id(); |
| 319 | uint32_t ret = 0; |
| 320 | |
| 321 | switch(platform) |
| 322 | { |
| 323 | case SDM429W: |
| 324 | ret = 1; |
| 325 | break; |
| 326 | default: |
| 327 | ret = 0; |
| 328 | }; |
| 329 | |
| 330 | return ret; |
| 331 | } |
lijuang | d18524e | 2018-04-04 20:22:19 +0800 | [diff] [blame] | 332 | |
Unnati Gandhi | 81b7706 | 2015-05-28 14:23:39 +0530 | [diff] [blame] | 333 | int platform_is_msm8956() |
| 334 | { |
| 335 | uint32_t platform = board_platform_id(); |
| 336 | uint32_t ret = 0; |
| 337 | |
| 338 | switch(platform) |
| 339 | { |
| 340 | case MSM8956: |
| 341 | case APQ8056: |
| 342 | case APQ8076: |
| 343 | case MSM8976: |
| 344 | ret = 1; |
| 345 | break; |
| 346 | default: |
| 347 | ret = 0; |
| 348 | }; |
| 349 | |
| 350 | return ret; |
| 351 | } |
vijay kumar | a0a7472 | 2015-09-04 15:45:49 +0530 | [diff] [blame] | 352 | |
Parth Dixit | 4734bd6 | 2016-01-13 11:06:28 +0530 | [diff] [blame] | 353 | uint32_t platform_get_tz_app_add() |
| 354 | { |
lijuang | d18524e | 2018-04-04 20:22:19 +0800 | [diff] [blame] | 355 | if(platform_is_msm8937() || platform_is_msm8917() || |
lijuang | 412d4f0 | 2018-10-16 18:27:48 +0800 | [diff] [blame] | 356 | platform_is_sdm429() || platform_is_sdm439() || |
| 357 | platform_is_qm215()) |
Parth Dixit | 4734bd6 | 2016-01-13 11:06:28 +0530 | [diff] [blame] | 358 | return APP_REGION_ADDR_8937; |
| 359 | else |
| 360 | return APP_REGION_ADDR_8952; |
| 361 | } |
| 362 | |
| 363 | uint32_t platform_get_tz_app_size() |
| 364 | { |
lijuang | d18524e | 2018-04-04 20:22:19 +0800 | [diff] [blame] | 365 | if(platform_is_msm8937() || platform_is_msm8917() || |
lijuang | 412d4f0 | 2018-10-16 18:27:48 +0800 | [diff] [blame] | 366 | platform_is_sdm429() || platform_is_sdm439() || |
| 367 | platform_is_qm215()) |
Parth Dixit | 4734bd6 | 2016-01-13 11:06:28 +0530 | [diff] [blame] | 368 | return APP_REGION_SIZE_8937; |
| 369 | else |
| 370 | return APP_REGION_SIZE_8952; |
| 371 | } |
| 372 | |
Parth Dixit | 75dc129 | 2016-01-12 14:44:40 +0530 | [diff] [blame] | 373 | uint32_t platform_get_apcs_ipc_base() |
| 374 | { |
lijuang | 412d4f0 | 2018-10-16 18:27:48 +0800 | [diff] [blame] | 375 | if(platform_is_msm8917() || platform_is_sdm429() || platform_is_qm215()) |
Parth Dixit | 75dc129 | 2016-01-12 14:44:40 +0530 | [diff] [blame] | 376 | return APCS_ALIAS1_IPC_INTERRUPT_1; |
| 377 | else |
| 378 | return APCS_ALIAS0_IPC_INTERRUPT_2; |
| 379 | } |
| 380 | |
vijay kumar | a0a7472 | 2015-09-04 15:45:49 +0530 | [diff] [blame] | 381 | uint32_t platform_is_msm8976_v_1_1() |
| 382 | { |
| 383 | uint32_t soc_ver = board_soc_version(); |
| 384 | uint32_t ret = 0; |
| 385 | |
| 386 | if(soc_ver == MSM8976_SOC_V11) |
| 387 | ret = 1; |
| 388 | |
| 389 | return ret; |
| 390 | } |
Mayank Grover | e73aafb | 2017-11-02 12:52:33 +0530 | [diff] [blame] | 391 | |
| 392 | void *get_rpmb_snd_rcv_buff() |
| 393 | { |
| 394 | if(smem_get_ddr_size() > 0x20000000) |
| 395 | return (void *)RPMB_SND_RCV_BUF_STRT; |
| 396 | else |
| 397 | return (void *)RPMB_SND_RCV_BUF_512; |
| 398 | } |