summaryrefslogtreecommitdiff
path: root/plat/nvidia
diff options
context:
space:
mode:
authorVarun Wadekar <vwadekar@nvidia.com>2016-04-25 09:01:46 -0700
committerVarun Wadekar <vwadekar@nvidia.com>2017-03-23 15:23:30 -0700
commit3b52fc1f829442322d15dbd3dad4a42a5371e661 (patch)
treeb2036acfcb467bcc6bf7e0520556c624de8b02da /plat/nvidia
parent99ef4a5cbc92af7d73798ef0e98dce01756f73c2 (diff)
Tegra: memctrl_v2: program Video Memory carveout size in MBs
This patch fixes the programming logic for the Video memory carveout's size. The Memory Controller expects the size in terms of MBs instead of bytes. Change-Id: Ia8261b737448bae9a435fe21ab336126785d4279 Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Diffstat (limited to 'plat/nvidia')
-rw-r--r--plat/nvidia/tegra/common/drivers/memctrl/memctrl_v2.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/plat/nvidia/tegra/common/drivers/memctrl/memctrl_v2.c b/plat/nvidia/tegra/common/drivers/memctrl/memctrl_v2.c
index f41e49d9..2d22a586 100644
--- a/plat/nvidia/tegra/common/drivers/memctrl/memctrl_v2.c
+++ b/plat/nvidia/tegra/common/drivers/memctrl/memctrl_v2.c
@@ -45,7 +45,7 @@
/* Video Memory base and size (live values) */
static uint64_t video_mem_base;
-static uint64_t video_mem_size;
+static uint64_t video_mem_size_mb;
/* array to hold stream_id override config register offsets */
const static uint32_t streamid_overrides[] = {
@@ -598,7 +598,7 @@ void tegra_memctrl_restore_settings(void)
(uint32_t)video_mem_base);
tegra_mc_write_32(MC_VIDEO_PROTECT_BASE_HI,
(uint32_t)(video_mem_base >> 32));
- tegra_mc_write_32(MC_VIDEO_PROTECT_SIZE_MB, video_mem_size);
+ tegra_mc_write_32(MC_VIDEO_PROTECT_SIZE_MB, video_mem_size_mb);
/*
* MCE propogates the VideoMem configuration values across the
@@ -706,11 +706,11 @@ void tegra_memctrl_videomem_setup(uint64_t phys_base, uint32_t size_in_bytes)
tegra_mc_write_32(MC_VIDEO_PROTECT_BASE_LO, (uint32_t)phys_base);
tegra_mc_write_32(MC_VIDEO_PROTECT_BASE_HI,
(uint32_t)(phys_base >> 32));
- tegra_mc_write_32(MC_VIDEO_PROTECT_SIZE_MB, size_in_bytes);
+ tegra_mc_write_32(MC_VIDEO_PROTECT_SIZE_MB, size_in_bytes >> 20);
/* store new values */
video_mem_base = phys_base;
- video_mem_size = size_in_bytes >> 20;
+ video_mem_size_mb = size_in_bytes >> 20;
/*
* MCE propogates the VideoMem configuration values across the