From f93565c51fb465aebc34dc52fd704ba038c917f7 Mon Sep 17 00:00:00 2001 From: Mahantesh Kumbar Date: Wed, 22 Aug 2018 16:44:59 +0530 Subject: gpu: nvgpu: add GSP falcon support - Defined FALCON_ID_GSPLITE for GSP falcon. - Created variable gsp_flcn of struct nvgpu_falcon for GSP falcon & registered to falcon module to access falcon functions. - Created HAL file gsp_gv100.c/h for GSP. - Modified Makefile & Makefile.sources files to include gsp_gv100 HAL file. - Enabled GSP falcon support for GV100 by registering to common falcon module. - Defined function gv100_gsp_reset() & assigned to falcon reset as GSP engine reset. - Updated falcon HAL init code not to return error if requested falcon is not supported, instead log the info and return non-error. JIRA NVGPU-1160 Change-Id: Ice032cf443ae87254375265628b3c022f41544cd Signed-off-by: Mahantesh Kumbar Reviewed-on: https://git-master.nvidia.com/r/1804551 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv100/flcn_gv100.c | 47 ++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 5 deletions(-) (limited to 'drivers/gpu/nvgpu/gv100/flcn_gv100.c') diff --git a/drivers/gpu/nvgpu/gv100/flcn_gv100.c b/drivers/gpu/nvgpu/gv100/flcn_gv100.c index 5167e3f0..900d9204 100644 --- a/drivers/gpu/nvgpu/gv100/flcn_gv100.c +++ b/drivers/gpu/nvgpu/gv100/flcn_gv100.c @@ -26,29 +26,66 @@ #include "gk20a/flcn_gk20a.h" #include "gp106/flcn_gp106.h" #include "gv100/flcn_gv100.h" +#include "gv100/gsp_gv100.h" #include +#include + +static void gv100_falcon_engine_dependency_ops(struct nvgpu_falcon *flcn) +{ + struct nvgpu_falcon_engine_dependency_ops *flcn_eng_dep_ops = + &flcn->flcn_engine_dep_ops; + + switch (flcn->flcn_id) { + case FALCON_ID_GSPLITE: + flcn_eng_dep_ops->reset_eng = gv100_gsp_reset; + break; + default: + flcn_eng_dep_ops->reset_eng = NULL; + break; + } +} + +static void gv100_falcon_ops(struct nvgpu_falcon *flcn) +{ + gk20a_falcon_ops(flcn); + gv100_falcon_engine_dependency_ops(flcn); +} int gv100_falcon_hal_sw_init(struct nvgpu_falcon *flcn) { struct gk20a *g = flcn->g; int err = 0; - if (flcn->flcn_id == FALCON_ID_MINION) { + switch (flcn->flcn_id) { + case FALCON_ID_MINION: flcn->flcn_base = g->nvlink.minion_base; flcn->is_falcon_supported = true; flcn->is_interrupt_enabled = true; + break; + case FALCON_ID_GSPLITE: + flcn->flcn_base = pgsp_falcon_irqsset_r(); + flcn->is_falcon_supported = true; + flcn->is_interrupt_enabled = false; + break; + default: + flcn->is_falcon_supported = false; + break; + } + if (flcn->is_falcon_supported) { err = nvgpu_mutex_init(&flcn->copy_lock); if (err != 0) { nvgpu_err(g, "Error in flcn.copy_lock mutex initialization"); - return err; + } else { + gv100_falcon_ops(flcn); } - - gk20a_falcon_ops(flcn); } else { /* - * Fall back + * Forward call to previous chips HAL + * to fetch info for requested + * falcon as no changes between + * current & previous chips. */ err = gp106_falcon_hal_sw_init(flcn); } -- cgit v1.2.2