From ed35f0a4042074463bf52ba04583fde680d1d389 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Thu, 9 Feb 2017 08:32:02 -0800 Subject: gpu: nvgpu: Add enable/disable shadow ROM HAL Add HAL for enabling and disabling shadow ROM. This removes XVE dependency from bios code. Change-Id: Icafec72dae71669376bbfb97077661b7165badb8 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1302223 --- drivers/gpu/nvgpu/gp106/xve_gp106.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'drivers/gpu/nvgpu/gp106/xve_gp106.c') diff --git a/drivers/gpu/nvgpu/gp106/xve_gp106.c b/drivers/gpu/nvgpu/gp106/xve_gp106.c index 83ae9306..ecc6de60 100644 --- a/drivers/gpu/nvgpu/gp106/xve_gp106.c +++ b/drivers/gpu/nvgpu/gp106/xve_gp106.c @@ -25,6 +25,8 @@ #include #include +#define NV_PCFG 0x88000 + /** * Init a timer and place the timeout data in @timeout. */ @@ -661,6 +663,18 @@ static void xve_rearm_msi_gp106(struct gk20a *g) } #endif +static void xve_enable_shadow_rom_gp106(struct gk20a *g) +{ + g->ops.xve.xve_writel(g, NV_PCFG + xve_rom_ctrl_r(), + xve_rom_ctrl_rom_shadow_enabled_f()); +} + +static void xve_disable_shadow_rom_gp106(struct gk20a *g) +{ + g->ops.xve.xve_writel(g, NV_PCFG + xve_rom_ctrl_r(), + xve_rom_ctrl_rom_shadow_disabled_f()); +} + /* * Init the HAL functions and what not. xve_sw_init_gp106() is for initializing * all the other stuff like debugfs nodes, etc. @@ -678,5 +692,8 @@ int gp106_init_xve_ops(struct gpu_ops *gops) #if defined(CONFIG_PCI_MSI) gops->xve.rearm_msi = xve_rearm_msi_gp106; #endif + gops->xve.enable_shadow_rom = xve_enable_shadow_rom_gp106; + gops->xve.disable_shadow_rom = xve_disable_shadow_rom_gp106; + return 0; } -- cgit v1.2.2