Commit 7a6e0537 authored by Varun Wadekar's avatar Varun Wadekar
Browse files

Tegra: memctrl: assert if dynamic memmap fails



This patch adds an assert in case the dynamic memmap routine fails.

Change-Id: Idd20debbb8944340f5928c6f2cfea973a63a7b1c
Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
parent db0d1070
...@@ -109,13 +109,16 @@ void tegra_memctrl_tzram_setup(uint64_t phys_base, uint32_t size_in_bytes) ...@@ -109,13 +109,16 @@ void tegra_memctrl_tzram_setup(uint64_t phys_base, uint32_t size_in_bytes)
static void tegra_clear_videomem(uintptr_t non_overlap_area_start, static void tegra_clear_videomem(uintptr_t non_overlap_area_start,
unsigned long long non_overlap_area_size) unsigned long long non_overlap_area_size)
{ {
int ret;
/* /*
* Map the NS memory first, clean it and then unmap it. * Map the NS memory first, clean it and then unmap it.
*/ */
mmap_add_dynamic_region(non_overlap_area_start, /* PA */ ret = mmap_add_dynamic_region(non_overlap_area_start, /* PA */
non_overlap_area_start, /* VA */ non_overlap_area_start, /* VA */
non_overlap_area_size, /* size */ non_overlap_area_size, /* size */
MT_NS | MT_RW | MT_EXECUTE_NEVER); /* attrs */ MT_NS | MT_RW | MT_EXECUTE_NEVER); /* attrs */
assert(ret == 0);
zeromem((void *)non_overlap_area_start, non_overlap_area_size); zeromem((void *)non_overlap_area_start, non_overlap_area_size);
flush_dcache_range(non_overlap_area_start, non_overlap_area_size); flush_dcache_range(non_overlap_area_start, non_overlap_area_size);
......
...@@ -600,13 +600,16 @@ static void tegra_unlock_videomem_nonoverlap(void) ...@@ -600,13 +600,16 @@ static void tegra_unlock_videomem_nonoverlap(void)
static void tegra_clear_videomem(uintptr_t non_overlap_area_start, static void tegra_clear_videomem(uintptr_t non_overlap_area_start,
unsigned long long non_overlap_area_size) unsigned long long non_overlap_area_size)
{ {
int ret;
/* /*
* Map the NS memory first, clean it and then unmap it. * Map the NS memory first, clean it and then unmap it.
*/ */
(void)mmap_add_dynamic_region(non_overlap_area_start, /* PA */ ret = mmap_add_dynamic_region(non_overlap_area_start, /* PA */
non_overlap_area_start, /* VA */ non_overlap_area_start, /* VA */
non_overlap_area_size, /* size */ non_overlap_area_size, /* size */
MT_NS | MT_RW | MT_EXECUTE_NEVER); /* attrs */ MT_NS | MT_RW | MT_EXECUTE_NEVER); /* attrs */
assert(ret == 0);
zero_normalmem((void *)non_overlap_area_start, non_overlap_area_size); zero_normalmem((void *)non_overlap_area_start, non_overlap_area_size);
flush_dcache_range(non_overlap_area_start, non_overlap_area_size); flush_dcache_range(non_overlap_area_start, non_overlap_area_size);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment