From 4cd59404a2d4ab1c31605d96cff848dd4e93c3b4 Mon Sep 17 00:00:00 2001 From: Mahantesh Kumbar Date: Thu, 21 Jun 2018 00:12:01 +0530 Subject: gpu: nvgpu: falcon code cleanup -Created common falcon function nvgpu_flcn_bl_bootstrap() to bootstrap falcon bootloader -Created HAL gk20a_falcon_bl_bootstrap() which does actual bootloader bootstrap by fetching parameters and loading code/parameters as needed. -Created HAL ops bl_bootstrap under nvgpu_falcon_ops. -Created struct nvgpu_falcon_bl_info to hold info required for bootloader to pass to common function -Removed falcons bootstrap code in multiple file & made changes to fill struct nvgpu_falcon_bl_info & call nvgpu_flcn_bl_bootstrap(). Change-Id: Iee275233915ff11f9afb5207ac0c3338ca9dacc1 Signed-off-by: Mahantesh Kumbar Reviewed-on: https://git-master.nvidia.com/r/1756104 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-misra-checker GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/falcon/falcon.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'drivers/gpu/nvgpu/common/falcon/falcon.c') diff --git a/drivers/gpu/nvgpu/common/falcon/falcon.c b/drivers/gpu/nvgpu/common/falcon/falcon.c index 41e394f9..8e37a709 100644 --- a/drivers/gpu/nvgpu/common/falcon/falcon.c +++ b/drivers/gpu/nvgpu/common/falcon/falcon.c @@ -357,6 +357,24 @@ void nvgpu_flcn_dump_stats(struct nvgpu_falcon *flcn) flcn->flcn_id); } +int nvgpu_flcn_bl_bootstrap(struct nvgpu_falcon *flcn, + struct nvgpu_falcon_bl_info *bl_info) +{ + struct nvgpu_falcon_ops *flcn_ops = &flcn->flcn_ops; + int status = 0; + + if (flcn_ops->bl_bootstrap != NULL) { + status = flcn_ops->bl_bootstrap(flcn, bl_info); + } + else { + nvgpu_warn(flcn->g, "Invalid op on falcon 0x%x ", + flcn->flcn_id); + status = -EINVAL; + } + + return status; +} + void nvgpu_flcn_sw_init(struct gk20a *g, u32 flcn_id) { struct nvgpu_falcon *flcn = NULL; -- cgit v1.2.2