diff options
author | Mahantesh Kumbar <mkumbar@nvidia.com> | 2018-08-22 07:14:59 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-09-25 00:17:29 -0400 |
commit | f93565c51fb465aebc34dc52fd704ba038c917f7 (patch) | |
tree | d809b8da6418674502ed228074361fb6b9bbc8db /drivers/gpu/nvgpu/gv100/flcn_gv100.c | |
parent | bf99dfdaf2dd974723dfce23d815b2f5ee83673d (diff) |
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 <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1804551
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gv100/flcn_gv100.c')
-rw-r--r-- | drivers/gpu/nvgpu/gv100/flcn_gv100.c | 47 |
1 files changed, 42 insertions, 5 deletions
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 @@ | |||
26 | #include "gk20a/flcn_gk20a.h" | 26 | #include "gk20a/flcn_gk20a.h" |
27 | #include "gp106/flcn_gp106.h" | 27 | #include "gp106/flcn_gp106.h" |
28 | #include "gv100/flcn_gv100.h" | 28 | #include "gv100/flcn_gv100.h" |
29 | #include "gv100/gsp_gv100.h" | ||
29 | 30 | ||
30 | #include <nvgpu/hw/gv100/hw_falcon_gv100.h> | 31 | #include <nvgpu/hw/gv100/hw_falcon_gv100.h> |
32 | #include <nvgpu/hw/gv100/hw_pgsp_gv100.h> | ||
33 | |||
34 | static void gv100_falcon_engine_dependency_ops(struct nvgpu_falcon *flcn) | ||
35 | { | ||
36 | struct nvgpu_falcon_engine_dependency_ops *flcn_eng_dep_ops = | ||
37 | &flcn->flcn_engine_dep_ops; | ||
38 | |||
39 | switch (flcn->flcn_id) { | ||
40 | case FALCON_ID_GSPLITE: | ||
41 | flcn_eng_dep_ops->reset_eng = gv100_gsp_reset; | ||
42 | break; | ||
43 | default: | ||
44 | flcn_eng_dep_ops->reset_eng = NULL; | ||
45 | break; | ||
46 | } | ||
47 | } | ||
48 | |||
49 | static void gv100_falcon_ops(struct nvgpu_falcon *flcn) | ||
50 | { | ||
51 | gk20a_falcon_ops(flcn); | ||
52 | gv100_falcon_engine_dependency_ops(flcn); | ||
53 | } | ||
31 | 54 | ||
32 | int gv100_falcon_hal_sw_init(struct nvgpu_falcon *flcn) | 55 | int gv100_falcon_hal_sw_init(struct nvgpu_falcon *flcn) |
33 | { | 56 | { |
34 | struct gk20a *g = flcn->g; | 57 | struct gk20a *g = flcn->g; |
35 | int err = 0; | 58 | int err = 0; |
36 | 59 | ||
37 | if (flcn->flcn_id == FALCON_ID_MINION) { | 60 | switch (flcn->flcn_id) { |
61 | case FALCON_ID_MINION: | ||
38 | flcn->flcn_base = g->nvlink.minion_base; | 62 | flcn->flcn_base = g->nvlink.minion_base; |
39 | flcn->is_falcon_supported = true; | 63 | flcn->is_falcon_supported = true; |
40 | flcn->is_interrupt_enabled = true; | 64 | flcn->is_interrupt_enabled = true; |
65 | break; | ||
66 | case FALCON_ID_GSPLITE: | ||
67 | flcn->flcn_base = pgsp_falcon_irqsset_r(); | ||
68 | flcn->is_falcon_supported = true; | ||
69 | flcn->is_interrupt_enabled = false; | ||
70 | break; | ||
71 | default: | ||
72 | flcn->is_falcon_supported = false; | ||
73 | break; | ||
74 | } | ||
41 | 75 | ||
76 | if (flcn->is_falcon_supported) { | ||
42 | err = nvgpu_mutex_init(&flcn->copy_lock); | 77 | err = nvgpu_mutex_init(&flcn->copy_lock); |
43 | if (err != 0) { | 78 | if (err != 0) { |
44 | nvgpu_err(g, "Error in flcn.copy_lock mutex initialization"); | 79 | nvgpu_err(g, "Error in flcn.copy_lock mutex initialization"); |
45 | return err; | 80 | } else { |
81 | gv100_falcon_ops(flcn); | ||
46 | } | 82 | } |
47 | |||
48 | gk20a_falcon_ops(flcn); | ||
49 | } else { | 83 | } else { |
50 | /* | 84 | /* |
51 | * Fall back | 85 | * Forward call to previous chips HAL |
86 | * to fetch info for requested | ||
87 | * falcon as no changes between | ||
88 | * current & previous chips. | ||
52 | */ | 89 | */ |
53 | err = gp106_falcon_hal_sw_init(flcn); | 90 | err = gp106_falcon_hal_sw_init(flcn); |
54 | } | 91 | } |