diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gp106')
-rw-r--r-- | drivers/gpu/nvgpu/gp106/flcn_gp106.c | 20 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp106/flcn_gp106.h | 4 |
2 files changed, 16 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/gp106/flcn_gp106.c b/drivers/gpu/nvgpu/gp106/flcn_gp106.c index 5959086d..168d94d3 100644 --- a/drivers/gpu/nvgpu/gp106/flcn_gp106.c +++ b/drivers/gpu/nvgpu/gp106/flcn_gp106.c | |||
@@ -53,9 +53,10 @@ static void gp106_falcon_ops(struct nvgpu_falcon *flcn) | |||
53 | gp106_falcon_engine_dependency_ops(flcn); | 53 | gp106_falcon_engine_dependency_ops(flcn); |
54 | } | 54 | } |
55 | 55 | ||
56 | void gp106_falcon_hal_sw_init(struct nvgpu_falcon *flcn) | 56 | int gp106_falcon_hal_sw_init(struct nvgpu_falcon *flcn) |
57 | { | 57 | { |
58 | struct gk20a *g = flcn->g; | 58 | struct gk20a *g = flcn->g; |
59 | int err = 0; | ||
59 | 60 | ||
60 | switch (flcn->flcn_id) { | 61 | switch (flcn->flcn_id) { |
61 | case FALCON_ID_PMU: | 62 | case FALCON_ID_PMU: |
@@ -72,28 +73,35 @@ void gp106_falcon_hal_sw_init(struct nvgpu_falcon *flcn) | |||
72 | flcn->flcn_base = FALCON_FECS_BASE; | 73 | flcn->flcn_base = FALCON_FECS_BASE; |
73 | flcn->is_falcon_supported = true; | 74 | flcn->is_falcon_supported = true; |
74 | flcn->is_interrupt_enabled = false; | 75 | flcn->is_interrupt_enabled = false; |
75 | break; | 76 | break; |
76 | case FALCON_ID_GPCCS: | 77 | case FALCON_ID_GPCCS: |
77 | flcn->flcn_base = FALCON_GPCCS_BASE; | 78 | flcn->flcn_base = FALCON_GPCCS_BASE; |
78 | flcn->is_falcon_supported = true; | 79 | flcn->is_falcon_supported = true; |
79 | flcn->is_interrupt_enabled = false; | 80 | flcn->is_interrupt_enabled = false; |
80 | break; | 81 | break; |
81 | case FALCON_ID_NVDEC: | 82 | case FALCON_ID_NVDEC: |
82 | flcn->flcn_base = FALCON_NVDEC_BASE; | 83 | flcn->flcn_base = FALCON_NVDEC_BASE; |
83 | flcn->is_falcon_supported = true; | 84 | flcn->is_falcon_supported = true; |
84 | flcn->is_interrupt_enabled = true; | 85 | flcn->is_interrupt_enabled = true; |
85 | break; | 86 | break; |
86 | default: | 87 | default: |
87 | flcn->is_falcon_supported = false; | 88 | flcn->is_falcon_supported = false; |
88 | nvgpu_err(g, "Invalid flcn request"); | 89 | nvgpu_err(g, "Invalid flcn request"); |
90 | err = -ENODEV; | ||
89 | break; | 91 | break; |
90 | } | 92 | } |
91 | 93 | ||
92 | if (flcn->is_falcon_supported) { | 94 | if (flcn->is_falcon_supported) { |
93 | nvgpu_mutex_init(&flcn->copy_lock); | 95 | err = nvgpu_mutex_init(&flcn->copy_lock); |
94 | gp106_falcon_ops(flcn); | 96 | if (err != 0) { |
97 | nvgpu_err(g, "Error in copy_lock mutex initialization"); | ||
98 | } else { | ||
99 | gp106_falcon_ops(flcn); | ||
100 | } | ||
95 | } else { | 101 | } else { |
96 | nvgpu_info(g, "falcon 0x%x not supported on %s", | 102 | nvgpu_info(g, "falcon 0x%x not supported on %s", |
97 | flcn->flcn_id, g->name); | 103 | flcn->flcn_id, g->name); |
98 | } | 104 | } |
105 | |||
106 | return err; | ||
99 | } | 107 | } |
diff --git a/drivers/gpu/nvgpu/gp106/flcn_gp106.h b/drivers/gpu/nvgpu/gp106/flcn_gp106.h index a558e4ef..49275234 100644 --- a/drivers/gpu/nvgpu/gp106/flcn_gp106.h +++ b/drivers/gpu/nvgpu/gp106/flcn_gp106.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. |
3 | * | 3 | * |
4 | * Permission is hereby granted, free of charge, to any person obtaining a | 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
5 | * copy of this software and associated documentation files (the "Software"), | 5 | * copy of this software and associated documentation files (the "Software"), |
@@ -22,6 +22,6 @@ | |||
22 | #ifndef __FLCN_GP106_H__ | 22 | #ifndef __FLCN_GP106_H__ |
23 | #define __FLCN_GP106_H__ | 23 | #define __FLCN_GP106_H__ |
24 | 24 | ||
25 | void gp106_falcon_hal_sw_init(struct nvgpu_falcon *flcn); | 25 | int gp106_falcon_hal_sw_init(struct nvgpu_falcon *flcn); |
26 | 26 | ||
27 | #endif /* __FLCN_GP106_H__ */ | 27 | #endif /* __FLCN_GP106_H__ */ |