diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-04-14 15:06:39 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-04-19 15:16:02 -0400 |
commit | a9c66768db400a82575a82ecddec71f1d3fd4aba (patch) | |
tree | 3b83db70149515fc21c9d700f68bbcf0fb4e58b4 /drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | |
parent | 7eb59ff8d334e9980e21bac50b4680855bd8237f (diff) |
gpu: nvgpu: Add abstraction for firmware loading
Add nvgpu_firmware data structure, and return it instead of Linux
struct firmare from nvgpu_request_firmware. Also add abstraction
for releasing firmware: nvgpu_release_firmware.
JIRA NVGPU-16
Change-Id: I6dae8262957c0d4506f710289e3a43a6c1729fc7
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1463538
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/pmu_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c index 49b9e78d..0ca8851f 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | |||
@@ -16,7 +16,6 @@ | |||
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <linux/firmware.h> | ||
20 | #include <linux/module.h> | 19 | #include <linux/module.h> |
21 | #include <linux/debugfs.h> | 20 | #include <linux/debugfs.h> |
22 | #include <linux/uaccess.h> | 21 | #include <linux/uaccess.h> |
@@ -27,6 +26,7 @@ | |||
27 | #include <nvgpu/dma.h> | 26 | #include <nvgpu/dma.h> |
28 | #include <nvgpu/log.h> | 27 | #include <nvgpu/log.h> |
29 | #include <nvgpu/bug.h> | 28 | #include <nvgpu/bug.h> |
29 | #include <nvgpu/firmware.h> | ||
30 | 30 | ||
31 | #include "gk20a.h" | 31 | #include "gk20a.h" |
32 | #include "gr_gk20a.h" | 32 | #include "gr_gk20a.h" |
@@ -3099,12 +3099,14 @@ static int pmu_queue_close(struct pmu_gk20a *pmu, | |||
3099 | 3099 | ||
3100 | void gk20a_remove_pmu_support(struct pmu_gk20a *pmu) | 3100 | void gk20a_remove_pmu_support(struct pmu_gk20a *pmu) |
3101 | { | 3101 | { |
3102 | struct gk20a *g = gk20a_from_pmu(pmu); | ||
3103 | |||
3102 | gk20a_dbg_fn(""); | 3104 | gk20a_dbg_fn(""); |
3103 | 3105 | ||
3104 | if (nvgpu_alloc_initialized(&pmu->dmem)) | 3106 | if (nvgpu_alloc_initialized(&pmu->dmem)) |
3105 | nvgpu_alloc_destroy(&pmu->dmem); | 3107 | nvgpu_alloc_destroy(&pmu->dmem); |
3106 | 3108 | ||
3107 | release_firmware(pmu->fw); | 3109 | nvgpu_release_firmware(g, pmu->fw); |
3108 | 3110 | ||
3109 | nvgpu_mutex_destroy(&pmu->elpg_mutex); | 3111 | nvgpu_mutex_destroy(&pmu->elpg_mutex); |
3110 | nvgpu_mutex_destroy(&pmu->pg_mutex); | 3112 | nvgpu_mutex_destroy(&pmu->pg_mutex); |
@@ -3157,7 +3159,7 @@ static int gk20a_prepare_ucode(struct gk20a *g) | |||
3157 | return gk20a_init_pmu(pmu); | 3159 | return gk20a_init_pmu(pmu); |
3158 | 3160 | ||
3159 | err_release_fw: | 3161 | err_release_fw: |
3160 | release_firmware(pmu->fw); | 3162 | nvgpu_release_firmware(g, pmu->fw); |
3161 | pmu->fw = NULL; | 3163 | pmu->fw = NULL; |
3162 | 3164 | ||
3163 | return err; | 3165 | return err; |