blob: 0567aa9aff5cc0da61508e7675d200cd5f32d3dd [file] [log] [blame]
Varun Wadekarcd5a2f52015-09-20 15:08:22 +05301/*
Harvey Hsiehb9b374f2016-11-15 22:04:51 +08002 * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved.
Varun Wadekarcd5a2f52015-09-20 15:08:22 +05303 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Varun Wadekarcd5a2f52015-09-20 15:08:22 +05305 */
6
Varun Wadekarcd5a2f52015-09-20 15:08:22 +05307#include <assert.h>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +00008#include <string.h>
9
10#include <arch_helpers.h>
11#include <common/bl_common.h>
12#include <common/debug.h>
13#include <lib/mmio.h>
14#include <lib/utils.h>
15#include <lib/xlat_tables/xlat_tables_v2.h>
16
Varun Wadekarcd5a2f52015-09-20 15:08:22 +053017#include <mce.h>
18#include <memctrl.h>
19#include <memctrl_v2.h>
Varun Wadekar87e44ff2016-03-03 13:22:39 -080020#include <smmu.h>
Varun Wadekarcd5a2f52015-09-20 15:08:22 +053021#include <tegra_def.h>
Varun Wadekare81177d2016-07-18 17:43:41 -070022#include <tegra_platform.h>
Varun Wadekarcd5a2f52015-09-20 15:08:22 +053023
24/* Video Memory base and size (live values) */
25static uint64_t video_mem_base;
Varun Wadekar7058aee2016-04-25 09:01:46 -070026static uint64_t video_mem_size_mb;
Varun Wadekarcd5a2f52015-09-20 15:08:22 +053027
Varun Wadekarcd5a2f52015-09-20 15:08:22 +053028/*
Varun Wadekarf3cd5092017-10-30 14:35:17 -070029 * The following platform setup functions are weakly defined. They
30 * provide typical implementations that will be overridden by a SoC.
31 */
32#pragma weak plat_memctrl_tzdram_setup
33void plat_memctrl_tzdram_setup(uint64_t phys_base, uint64_t size_in_bytes)
34{
35 ; /* do nothing */
36}
37
38/*
Varun Wadekar87e44ff2016-03-03 13:22:39 -080039 * Init Memory controller during boot.
Varun Wadekarcd5a2f52015-09-20 15:08:22 +053040 */
41void tegra_memctrl_setup(void)
42{
43 uint32_t val;
Pritesh Raithatha9eb5db52017-01-02 19:42:31 +053044 const uint32_t *mc_streamid_override_regs;
45 uint32_t num_streamid_override_regs;
46 const mc_streamid_security_cfg_t *mc_streamid_sec_cfgs;
47 uint32_t num_streamid_sec_cfgs;
Anthony Zhou0844b972017-06-28 16:35:54 +080048 const tegra_mc_settings_t *plat_mc_settings = tegra_get_mc_settings();
Varun Wadekarad45ef72017-04-03 13:44:57 -070049 uint32_t i;
Varun Wadekarcd5a2f52015-09-20 15:08:22 +053050
51 INFO("Tegra Memory Controller (v2)\n");
52
Varun Wadekar6cb25f92016-12-19 11:17:54 -080053#if ENABLE_SMMU_DEVICE
Varun Wadekarcd5a2f52015-09-20 15:08:22 +053054 /* Program the SMMU pagesize */
Varun Wadekar87e44ff2016-03-03 13:22:39 -080055 tegra_smmu_init();
Varun Wadekar6cb25f92016-12-19 11:17:54 -080056#endif
Pritesh Raithatha9eb5db52017-01-02 19:42:31 +053057 /* Get the settings from the platform */
Anthony Zhou4408e882017-07-07 14:29:51 +080058 assert(plat_mc_settings != NULL);
Pritesh Raithatha9eb5db52017-01-02 19:42:31 +053059 mc_streamid_override_regs = plat_mc_settings->streamid_override_cfg;
60 num_streamid_override_regs = plat_mc_settings->num_streamid_override_cfgs;
61 mc_streamid_sec_cfgs = plat_mc_settings->streamid_security_cfg;
62 num_streamid_sec_cfgs = plat_mc_settings->num_streamid_security_cfgs;
Varun Wadekarcd5a2f52015-09-20 15:08:22 +053063
64 /* Program all the Stream ID overrides */
Pritesh Raithatha9eb5db52017-01-02 19:42:31 +053065 for (i = 0; i < num_streamid_override_regs; i++)
66 tegra_mc_streamid_write_32(mc_streamid_override_regs[i],
Varun Wadekarcd5a2f52015-09-20 15:08:22 +053067 MC_STREAM_ID_MAX);
68
69 /* Program the security config settings for all Stream IDs */
Pritesh Raithatha9eb5db52017-01-02 19:42:31 +053070 for (i = 0; i < num_streamid_sec_cfgs; i++) {
71 val = mc_streamid_sec_cfgs[i].override_enable << 16 |
72 mc_streamid_sec_cfgs[i].override_client_inputs << 8 |
73 mc_streamid_sec_cfgs[i].override_client_ns_flag << 0;
74 tegra_mc_streamid_write_32(mc_streamid_sec_cfgs[i].offset, val);
Varun Wadekarcd5a2f52015-09-20 15:08:22 +053075 }
76
77 /*
78 * All requests at boot time, and certain requests during
79 * normal run time, are physically addressed and must bypass
80 * the SMMU. The client hub logic implements a hardware bypass
81 * path around the Translation Buffer Units (TBU). During
82 * boot-time, the SMMU_BYPASS_CTRL register (which defaults to
83 * TBU_BYPASS mode) will be used to steer all requests around
84 * the uninitialized TBUs. During normal operation, this register
85 * is locked into TBU_BYPASS_SID config, which routes requests
86 * with special StreamID 0x7f on the bypass path and all others
87 * through the selected TBU. This is done to disable SMMU Bypass
88 * mode, as it could be used to circumvent SMMU security checks.
89 */
90 tegra_mc_write_32(MC_SMMU_BYPASS_CONFIG,
Pritesh Raithatha9eb5db52017-01-02 19:42:31 +053091 MC_SMMU_BYPASS_CONFIG_SETTINGS);
Varun Wadekarcd5a2f52015-09-20 15:08:22 +053092
Varun Wadekarc9ac3e42016-02-17 15:07:49 -080093 /*
Varun Wadekara0f26972016-03-11 17:18:51 -080094 * Re-configure MSS to allow ROC to deal with ordering of the
95 * Memory Controller traffic. This is needed as the Memory Controller
96 * boots with MSS having all control, but ROC provides a performance
97 * boost as compared to MSS.
98 */
Puneet Saxenacf8c0e22017-08-04 17:19:55 +053099 if (plat_mc_settings->reconfig_mss_clients != NULL) {
100 plat_mc_settings->reconfig_mss_clients();
101 }
Varun Wadekara0f26972016-03-11 17:18:51 -0800102
Varun Wadekarad45ef72017-04-03 13:44:57 -0700103 /* Program overrides for MC transactions */
Puneet Saxenacf8c0e22017-08-04 17:19:55 +0530104 if (plat_mc_settings->set_txn_overrides != NULL) {
105 plat_mc_settings->set_txn_overrides();
106 }
Varun Wadekar87e44ff2016-03-03 13:22:39 -0800107}
Varun Wadekarc9ac3e42016-02-17 15:07:49 -0800108
Varun Wadekar87e44ff2016-03-03 13:22:39 -0800109/*
110 * Restore Memory Controller settings after "System Suspend"
111 */
112void tegra_memctrl_restore_settings(void)
113{
Puneet Saxenacf8c0e22017-08-04 17:19:55 +0530114 const tegra_mc_settings_t *plat_mc_settings = tegra_get_mc_settings();
115
116 assert(plat_mc_settings != NULL);
117
Varun Wadekara0f26972016-03-11 17:18:51 -0800118 /*
119 * Re-configure MSS to allow ROC to deal with ordering of the
120 * Memory Controller traffic. This is needed as the Memory Controller
121 * resets during System Suspend with MSS having all control, but ROC
122 * provides a performance boost as compared to MSS.
123 */
Puneet Saxenacf8c0e22017-08-04 17:19:55 +0530124 if (plat_mc_settings->reconfig_mss_clients != NULL) {
125 plat_mc_settings->reconfig_mss_clients();
126 }
Varun Wadekara0f26972016-03-11 17:18:51 -0800127
Varun Wadekarad45ef72017-04-03 13:44:57 -0700128 /* Program overrides for MC transactions */
Puneet Saxenacf8c0e22017-08-04 17:19:55 +0530129 if (plat_mc_settings->set_txn_overrides != NULL) {
130 plat_mc_settings->set_txn_overrides();
131 }
Varun Wadekarad45ef72017-04-03 13:44:57 -0700132
Varun Wadekarcd5a2f52015-09-20 15:08:22 +0530133 /* video memory carveout region */
Anthony Zhou0e07e452017-07-26 17:16:54 +0800134 if (video_mem_base != 0ULL) {
Varun Wadekarcd5a2f52015-09-20 15:08:22 +0530135 tegra_mc_write_32(MC_VIDEO_PROTECT_BASE_LO,
136 (uint32_t)video_mem_base);
137 tegra_mc_write_32(MC_VIDEO_PROTECT_BASE_HI,
138 (uint32_t)(video_mem_base >> 32));
Varun Wadekar7058aee2016-04-25 09:01:46 -0700139 tegra_mc_write_32(MC_VIDEO_PROTECT_SIZE_MB, video_mem_size_mb);
Varun Wadekarcd5a2f52015-09-20 15:08:22 +0530140
141 /*
Varun Wadekar153982c2016-12-21 14:50:18 -0800142 * MCE propagates the VideoMem configuration values across the
Varun Wadekarcd5a2f52015-09-20 15:08:22 +0530143 * CCPLEX.
144 */
145 mce_update_gsc_videomem();
146 }
147}
148
149/*
150 * Secure the BL31 DRAM aperture.
151 *
152 * phys_base = physical base of TZDRAM aperture
153 * size_in_bytes = size of aperture in bytes
154 */
155void tegra_memctrl_tzdram_setup(uint64_t phys_base, uint32_t size_in_bytes)
156{
157 /*
158 * Setup the Memory controller to allow only secure accesses to
159 * the TZDRAM carveout
160 */
161 INFO("Configuring TrustZone DRAM Memory Carveout\n");
162
163 tegra_mc_write_32(MC_SECURITY_CFG0_0, (uint32_t)phys_base);
164 tegra_mc_write_32(MC_SECURITY_CFG3_0, (uint32_t)(phys_base >> 32));
165 tegra_mc_write_32(MC_SECURITY_CFG1_0, size_in_bytes >> 20);
166
167 /*
Varun Wadekarf3cd5092017-10-30 14:35:17 -0700168 * Perform platform specific steps.
Harvey Hsiehc95802d2016-07-29 20:10:59 +0800169 */
Varun Wadekarf3cd5092017-10-30 14:35:17 -0700170 plat_memctrl_tzdram_setup(phys_base, size_in_bytes);
Harvey Hsiehc95802d2016-07-29 20:10:59 +0800171
172 /*
Varun Wadekar153982c2016-12-21 14:50:18 -0800173 * MCE propagates the security configuration values across the
Varun Wadekarcd5a2f52015-09-20 15:08:22 +0530174 * CCPLEX.
175 */
176 mce_update_gsc_tzdram();
177}
178
179/*
Varun Wadekar13e7dc42015-12-30 15:15:08 -0800180 * Secure the BL31 TZRAM aperture.
181 *
182 * phys_base = physical base of TZRAM aperture
183 * size_in_bytes = size of aperture in bytes
184 */
185void tegra_memctrl_tzram_setup(uint64_t phys_base, uint32_t size_in_bytes)
186{
Varun Wadekare6d43222016-05-25 16:35:04 -0700187 uint32_t index;
188 uint32_t total_128kb_blocks = size_in_bytes >> 17;
Varun Wadekar153982c2016-12-21 14:50:18 -0800189 uint32_t residual_4kb_blocks = (size_in_bytes & (uint32_t)0x1FFFF) >> 12;
Varun Wadekar13e7dc42015-12-30 15:15:08 -0800190 uint32_t val;
191
Varun Wadekar153982c2016-12-21 14:50:18 -0800192 INFO("Configuring TrustZone SRAM Memory Carveout\n");
193
Varun Wadekar13e7dc42015-12-30 15:15:08 -0800194 /*
Varun Wadekare6d43222016-05-25 16:35:04 -0700195 * Reset the access configuration registers to restrict access
196 * to the TZRAM aperture
Varun Wadekar13e7dc42015-12-30 15:15:08 -0800197 */
Steven Kaob688d382017-09-06 13:32:21 +0800198 for (index = MC_TZRAM_CLIENT_ACCESS0_CFG0;
Varun Wadekar153982c2016-12-21 14:50:18 -0800199 index < ((uint32_t)MC_TZRAM_CARVEOUT_CFG + (uint32_t)MC_GSC_CONFIG_REGS_SIZE);
200 index += 4U) {
Varun Wadekare6d43222016-05-25 16:35:04 -0700201 tegra_mc_write_32(index, 0);
Varun Wadekar153982c2016-12-21 14:50:18 -0800202 }
Varun Wadekar13e7dc42015-12-30 15:15:08 -0800203
204 /*
Steven Kaob688d382017-09-06 13:32:21 +0800205 * Enable CPU access configuration registers to access the TZRAM aperture
206 */
207 if (!tegra_chipid_is_t186()) {
208 val = tegra_mc_read_32(MC_TZRAM_CLIENT_ACCESS1_CFG0);
209 val |= TZRAM_ALLOW_MPCORER | TZRAM_ALLOW_MPCOREW;
210 tegra_mc_write_32(MC_TZRAM_CLIENT_ACCESS1_CFG0, val);
211 }
212
213 /*
Varun Wadekare6d43222016-05-25 16:35:04 -0700214 * Set the TZRAM base. TZRAM base must be 4k aligned, at least.
215 */
Varun Wadekar153982c2016-12-21 14:50:18 -0800216 assert((phys_base & (uint64_t)0xFFF) == 0U);
Varun Wadekare6d43222016-05-25 16:35:04 -0700217 tegra_mc_write_32(MC_TZRAM_BASE_LO, (uint32_t)phys_base);
218 tegra_mc_write_32(MC_TZRAM_BASE_HI,
Varun Wadekar153982c2016-12-21 14:50:18 -0800219 (uint32_t)(phys_base >> 32) & MC_GSC_BASE_HI_MASK);
Varun Wadekar13e7dc42015-12-30 15:15:08 -0800220
Varun Wadekare6d43222016-05-25 16:35:04 -0700221 /*
222 * Set the TZRAM size
223 *
224 * total size = (number of 128KB blocks) + (number of remaining 4KB
225 * blocks)
226 *
227 */
Varun Wadekar153982c2016-12-21 14:50:18 -0800228 val = (residual_4kb_blocks << MC_GSC_SIZE_RANGE_4KB_SHIFT) |
Varun Wadekare6d43222016-05-25 16:35:04 -0700229 total_128kb_blocks;
230 tegra_mc_write_32(MC_TZRAM_SIZE, val);
Varun Wadekar13e7dc42015-12-30 15:15:08 -0800231
Varun Wadekare6d43222016-05-25 16:35:04 -0700232 /*
233 * Lock the configuration settings by disabling TZ-only lock
234 * and locking the configuration against any future changes
235 * at all.
236 */
237 val = tegra_mc_read_32(MC_TZRAM_CARVEOUT_CFG);
Anthony Zhou0844b972017-06-28 16:35:54 +0800238 val &= (uint32_t)~MC_GSC_ENABLE_TZ_LOCK_BIT;
Varun Wadekar153982c2016-12-21 14:50:18 -0800239 val |= MC_GSC_LOCK_CFG_SETTINGS_BIT;
Steven Kaob688d382017-09-06 13:32:21 +0800240 if (!tegra_chipid_is_t186()) {
241 val |= MC_GSC_ENABLE_CPU_SECURE_BIT;
242 }
Varun Wadekare6d43222016-05-25 16:35:04 -0700243 tegra_mc_write_32(MC_TZRAM_CARVEOUT_CFG, val);
Varun Wadekar13e7dc42015-12-30 15:15:08 -0800244
245 /*
Varun Wadekar153982c2016-12-21 14:50:18 -0800246 * MCE propagates the security configuration values across the
Varun Wadekar13e7dc42015-12-30 15:15:08 -0800247 * CCPLEX.
248 */
249 mce_update_gsc_tzram();
250}
251
Varun Wadekar153982c2016-12-21 14:50:18 -0800252static void tegra_lock_videomem_nonoverlap(uint64_t phys_base,
253 uint64_t size_in_bytes)
254{
255 uint32_t index;
256 uint64_t total_128kb_blocks = size_in_bytes >> 17;
257 uint64_t residual_4kb_blocks = (size_in_bytes & (uint32_t)0x1FFFF) >> 12;
258 uint64_t val;
259
260 /*
261 * Reset the access configuration registers to restrict access to
262 * old Videomem aperture
263 */
264 for (index = MC_VIDEO_PROTECT_CLEAR_ACCESS_CFG0;
265 index < ((uint32_t)MC_VIDEO_PROTECT_CLEAR_ACCESS_CFG0 + (uint32_t)MC_GSC_CONFIG_REGS_SIZE);
266 index += 4U) {
267 tegra_mc_write_32(index, 0);
268 }
269
270 /*
271 * Set the base. It must be 4k aligned, at least.
272 */
273 assert((phys_base & (uint64_t)0xFFF) == 0U);
274 tegra_mc_write_32(MC_VIDEO_PROTECT_CLEAR_BASE_LO, (uint32_t)phys_base);
275 tegra_mc_write_32(MC_VIDEO_PROTECT_CLEAR_BASE_HI,
276 (uint32_t)(phys_base >> 32) & (uint32_t)MC_GSC_BASE_HI_MASK);
277
278 /*
279 * Set the aperture size
280 *
281 * total size = (number of 128KB blocks) + (number of remaining 4KB
282 * blocks)
283 *
284 */
285 val = (uint32_t)((residual_4kb_blocks << MC_GSC_SIZE_RANGE_4KB_SHIFT) |
286 total_128kb_blocks);
287 tegra_mc_write_32(MC_VIDEO_PROTECT_CLEAR_SIZE, (uint32_t)val);
288
289 /*
290 * Lock the configuration settings by enabling TZ-only lock and
291 * locking the configuration against any future changes from NS
292 * world.
293 */
294 tegra_mc_write_32(MC_VIDEO_PROTECT_CLEAR_CFG,
295 (uint32_t)MC_GSC_ENABLE_TZ_LOCK_BIT);
296
297 /*
298 * MCE propagates the GSC configuration values across the
299 * CCPLEX.
300 */
301}
302
303static void tegra_unlock_videomem_nonoverlap(void)
304{
305 /* Clear the base */
306 tegra_mc_write_32(MC_VIDEO_PROTECT_CLEAR_BASE_LO, 0);
307 tegra_mc_write_32(MC_VIDEO_PROTECT_CLEAR_BASE_HI, 0);
308
309 /* Clear the size */
310 tegra_mc_write_32(MC_VIDEO_PROTECT_CLEAR_SIZE, 0);
311}
312
313static void tegra_clear_videomem(uintptr_t non_overlap_area_start,
314 unsigned long long non_overlap_area_size)
315{
Varun Wadekar117a2e02017-08-03 11:40:34 -0700316 int ret;
317
Varun Wadekar153982c2016-12-21 14:50:18 -0800318 /*
319 * Map the NS memory first, clean it and then unmap it.
320 */
Varun Wadekar117a2e02017-08-03 11:40:34 -0700321 ret = mmap_add_dynamic_region(non_overlap_area_start, /* PA */
Varun Wadekar153982c2016-12-21 14:50:18 -0800322 non_overlap_area_start, /* VA */
323 non_overlap_area_size, /* size */
324 MT_NS | MT_RW | MT_EXECUTE_NEVER); /* attrs */
Varun Wadekar117a2e02017-08-03 11:40:34 -0700325 assert(ret == 0);
Varun Wadekar153982c2016-12-21 14:50:18 -0800326
327 zero_normalmem((void *)non_overlap_area_start, non_overlap_area_size);
328 flush_dcache_range(non_overlap_area_start, non_overlap_area_size);
329
Anthony Zhou0844b972017-06-28 16:35:54 +0800330 (void)mmap_remove_dynamic_region(non_overlap_area_start,
Varun Wadekar153982c2016-12-21 14:50:18 -0800331 non_overlap_area_size);
332}
333
Varun Wadekar13e7dc42015-12-30 15:15:08 -0800334/*
Varun Wadekarcd5a2f52015-09-20 15:08:22 +0530335 * Program the Video Memory carveout region
336 *
337 * phys_base = physical base of aperture
338 * size_in_bytes = size of aperture in bytes
339 */
340void tegra_memctrl_videomem_setup(uint64_t phys_base, uint32_t size_in_bytes)
341{
Varun Wadekar153982c2016-12-21 14:50:18 -0800342 uintptr_t vmem_end_old = video_mem_base + (video_mem_size_mb << 20);
343 uintptr_t vmem_end_new = phys_base + size_in_bytes;
Varun Wadekar153982c2016-12-21 14:50:18 -0800344 unsigned long long non_overlap_area_size;
Varun Wadekare60f1bf2016-02-17 10:10:50 -0800345
346 /*
Varun Wadekarcd5a2f52015-09-20 15:08:22 +0530347 * Setup the Memory controller to restrict CPU accesses to the Video
348 * Memory region
349 */
350 INFO("Configuring Video Memory Carveout\n");
351
Varun Wadekar153982c2016-12-21 14:50:18 -0800352 /*
353 * Configure Memory Controller directly for the first time.
354 */
355 if (video_mem_base == 0U)
356 goto done;
357
358 /*
359 * Lock the non overlapping memory being cleared so that other masters
360 * do not accidently write to it. The memory would be unlocked once
361 * the non overlapping region is cleared and the new memory
362 * settings take effect.
363 */
364 tegra_lock_videomem_nonoverlap(video_mem_base,
365 video_mem_size_mb << 20);
366
367 /*
368 * Clear the old regions now being exposed. The following cases
369 * can occur -
370 *
371 * 1. clear whole old region (no overlap with new region)
372 * 2. clear old sub-region below new base
373 * 3. clear old sub-region above new end
374 */
375 INFO("Cleaning previous Video Memory Carveout\n");
376
Anthony Zhou0844b972017-06-28 16:35:54 +0800377 if ((phys_base > vmem_end_old) || (video_mem_base > vmem_end_new)) {
Varun Wadekar153982c2016-12-21 14:50:18 -0800378 tegra_clear_videomem(video_mem_base,
Anthony Zhou0844b972017-06-28 16:35:54 +0800379 (uint32_t)video_mem_size_mb << 20U);
Varun Wadekar153982c2016-12-21 14:50:18 -0800380 } else {
381 if (video_mem_base < phys_base) {
382 non_overlap_area_size = phys_base - video_mem_base;
Anthony Zhou0844b972017-06-28 16:35:54 +0800383 tegra_clear_videomem(video_mem_base,
384 (uint32_t)non_overlap_area_size);
Varun Wadekar153982c2016-12-21 14:50:18 -0800385 }
386 if (vmem_end_old > vmem_end_new) {
387 non_overlap_area_size = vmem_end_old - vmem_end_new;
Anthony Zhou0844b972017-06-28 16:35:54 +0800388 tegra_clear_videomem(vmem_end_new,
389 (uint32_t)non_overlap_area_size);
Varun Wadekar153982c2016-12-21 14:50:18 -0800390 }
391 }
392
393done:
394 /* program the Videomem aperture */
Varun Wadekarcd5a2f52015-09-20 15:08:22 +0530395 tegra_mc_write_32(MC_VIDEO_PROTECT_BASE_LO, (uint32_t)phys_base);
396 tegra_mc_write_32(MC_VIDEO_PROTECT_BASE_HI,
397 (uint32_t)(phys_base >> 32));
Varun Wadekar7058aee2016-04-25 09:01:46 -0700398 tegra_mc_write_32(MC_VIDEO_PROTECT_SIZE_MB, size_in_bytes >> 20);
Varun Wadekarcd5a2f52015-09-20 15:08:22 +0530399
Varun Wadekar153982c2016-12-21 14:50:18 -0800400 /* unlock the previous locked nonoverlapping aperture */
401 tegra_unlock_videomem_nonoverlap();
402
Varun Wadekarcd5a2f52015-09-20 15:08:22 +0530403 /* store new values */
404 video_mem_base = phys_base;
Varun Wadekar7058aee2016-04-25 09:01:46 -0700405 video_mem_size_mb = size_in_bytes >> 20;
Varun Wadekarcd5a2f52015-09-20 15:08:22 +0530406
407 /*
Varun Wadekar153982c2016-12-21 14:50:18 -0800408 * MCE propagates the VideoMem configuration values across the
Varun Wadekarcd5a2f52015-09-20 15:08:22 +0530409 * CCPLEX.
410 */
411 mce_update_gsc_videomem();
412}
Varun Wadekarc92050b2017-03-29 14:57:29 -0700413
414/*
415 * This feature exists only for v1 of the Tegra Memory Controller.
416 */
417void tegra_memctrl_disable_ahb_redirection(void)
418{
419 ; /* do nothing */
420}
Harvey Hsieh359be952017-08-21 15:01:53 +0800421
422void tegra_memctrl_clear_pending_interrupts(void)
423{
424 ; /* do nothing */
425}