From bfc12d25a41c2b5a4d06f233f16331e43c489d8e Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Tue, 25 Oct 2016 10:05:46 -0700 Subject: gpu: nvgpu: Use bootstrap base for WPR address Use the bootstrap base address for calculating the address of WPR. The bootstrap base is dynamic and depends on amount of memory, so we should not hard code any address. Bug 200244445 Change-Id: Ia700d24c8d572a25946f7b1847faec72c40c6796 Signed-off-by: David Martinez Nieto Reviewed-on: http://git-master/r/1242252 Reviewed-by: David Martinez Nieto Reviewed-by: Alex Waterman GVS: Gerrit_Virtual_Submit Reviewed-on: http://git-master/r/1267125 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- drivers/gpu/nvgpu/gp106/acr_gp106.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu') diff --git a/drivers/gpu/nvgpu/gp106/acr_gp106.c b/drivers/gpu/nvgpu/gp106/acr_gp106.c index 3bd79bcd..b883ad83 100644 --- a/drivers/gpu/nvgpu/gp106/acr_gp106.c +++ b/drivers/gpu/nvgpu/gp106/acr_gp106.c @@ -40,7 +40,7 @@ typedef int (*get_ucode_details)(struct gk20a *g, /* Both size and address of WPR need to be 128K-aligned */ #define WPR_ALIGNMENT 0x20000 #define GP106_DGPU_NONWPR NVGPU_VIDMEM_BOOTSTRAP_ALLOCATOR_BASE -#define GP106_DGPU_WPR (GP106_DGPU_NONWPR + 0x400000) +#define GP106_DGPU_WPR_OFFSET 0x400000 #define DGPU_WPR_SIZE 0x100000 /*Externs*/ @@ -79,8 +79,8 @@ static get_ucode_details pmu_acr_supp_ucode_list[] = { static void gp106_wpr_info(struct gk20a *g, struct wpr_carveout_info *inf) { - inf->wpr_base = GP106_DGPU_WPR; - inf->nonwpr_base = GP106_DGPU_NONWPR; + inf->nonwpr_base = g->mm.vidmem.bootstrap_base; + inf->wpr_base = inf->nonwpr_base + GP106_DGPU_WPR_OFFSET; inf->size = DGPU_WPR_SIZE; } -- cgit v1.2.2