summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVarun Wadekar <vwadekar@nvidia.com>2017-01-25 13:35:27 -0800
committerVarun Wadekar <vwadekar@nvidia.com>2017-05-01 15:33:44 -0700
commit14a1c0edf06bfe832ab7ca2d07bcc0547ddf40d5 (patch)
treecc3cafb7acb0ec1dbfb0659ce0efafb5855d6b33
parent9d42d23a2cb1394d0c9cf396dda7a362908da020 (diff)
Tegra: fix the NS DRAM address calculation logic
This patch fixes the logic used to calculate the end of NS memory aperture. The functions allows zero sized NS apertures as that is a valid requirement for some use cases. e.g. VPR resize. Change-Id: Ie966e0ea2f9c6888d21c38e734003704094b3720 Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
-rw-r--r--plat/nvidia/tegra/common/tegra_bl31_setup.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/plat/nvidia/tegra/common/tegra_bl31_setup.c b/plat/nvidia/tegra/common/tegra_bl31_setup.c
index ffaa0ba3..1dc80663 100644
--- a/plat/nvidia/tegra/common/tegra_bl31_setup.c
+++ b/plat/nvidia/tegra/common/tegra_bl31_setup.c
@@ -381,13 +381,12 @@ void bl31_plat_arch_setup(void)
******************************************************************************/
int bl31_check_ns_address(uint64_t base, uint64_t size_in_bytes)
{
- uint64_t end = base + size_in_bytes - 1;
+ uint64_t end = base + size_in_bytes;
/*
* Check if the NS DRAM address is valid
*/
- if ((base < TEGRA_DRAM_BASE) || (end > TEGRA_DRAM_END) ||
- (base >= end)) {
+ if ((base < TEGRA_DRAM_BASE) || (end > TEGRA_DRAM_END)) {
ERROR("NS address is out-of-bounds!\n");
return -EFAULT;
}