summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/boardobj/boardobjgrp_e32.c
diff options
context:
space:
mode:
authorVijayakumar Subbu <vsubbu@nvidia.com>2016-07-28 01:29:15 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2016-09-29 16:17:46 -0400
commitb17d9708c9e9930778de43de1edf1385acb13ebd (patch)
treefc485e96cc19575d463c61c8b80a09dd89745f3f /drivers/gpu/nvgpu/boardobj/boardobjgrp_e32.c
parent27b47b1969d7d9cdd3de9fd6f0131ad357f4b0fa (diff)
gpu: nvgpu: Add dGPU clocks support
JIRA DNVGPU-45 Change-Id: I237ce81e31b036c05c82d46eea8694ffe1c2e3df Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com> Signed-off-by: Vijayakumar Subbu <vsubbu@nvidia.com> Reviewed-on: http://git-master/r/1205849 (cherry picked from commit 9a4006f76b75a8ad525e7aa5ad1f609aaae49126) Reviewed-on: http://git-master/r/1227256 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/boardobj/boardobjgrp_e32.c')
-rw-r--r--drivers/gpu/nvgpu/boardobj/boardobjgrp_e32.c91
1 files changed, 91 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/boardobj/boardobjgrp_e32.c b/drivers/gpu/nvgpu/boardobj/boardobjgrp_e32.c
new file mode 100644
index 00000000..95610aba
--- /dev/null
+++ b/drivers/gpu/nvgpu/boardobj/boardobjgrp_e32.c
@@ -0,0 +1,91 @@
1/*
2* Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
3*
4* This program is free software; you can redistribute it and/or modify it
5* under the terms and conditions of the GNU General Public License,
6* version 2, as published by the Free Software Foundation.
7*
8* This program is distributed in the hope it will be useful, but WITHOUT
9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11* more details.
12*/
13
14#include "gk20a/gk20a.h"
15#include "boardobj.h"
16#include "boardobjgrp.h"
17#include "boardobjgrp_e32.h"
18#include "ctrl/ctrlboardobj.h"
19#include "pmuif/gpmuifboardobj.h"
20#include "boardobjgrpmask.h"
21
22
23u32 boardobjgrpconstruct_e32(struct boardobjgrp_e32 *pboardobjgrp_e32)
24{
25 u32 status;
26 u8 objslots;
27
28 gk20a_dbg_info("");
29 objslots = 32;
30
31 status = boardobjgrpmask_e32_init(&pboardobjgrp_e32->mask, NULL);
32 if (status)
33 goto boardobjgrpconstruct_e32_exit;
34
35 pboardobjgrp_e32->super.type = CTRL_BOARDOBJGRP_TYPE_E32;
36 pboardobjgrp_e32->super.ppobjects = pboardobjgrp_e32->objects;
37 pboardobjgrp_e32->super.objslots = objslots;
38 pboardobjgrp_e32->super.mask = &(pboardobjgrp_e32->mask.super);
39
40 status = boardobjgrp_construct_super(&pboardobjgrp_e32->super);
41 if (status)
42 goto boardobjgrpconstruct_e32_exit;
43
44 pboardobjgrp_e32->super.destruct = boardobjgrpdestruct_e32;
45
46 pboardobjgrp_e32->super.pmuhdrdatainit = boardobjgrp_pmuhdrdatainit_e32;
47
48boardobjgrpconstruct_e32_exit:
49 return status;
50}
51
52u32 boardobjgrpdestruct_e32(struct boardobjgrp *pboardobjgrp)
53{
54 u32 status = 0;
55
56 gk20a_dbg_info("");
57
58 pboardobjgrp->mask = NULL;
59 pboardobjgrp->objslots = 0;
60 pboardobjgrp->ppobjects = NULL;
61
62 return status;
63}
64
65u32 boardobjgrp_pmuhdrdatainit_e32(struct gk20a *g,
66 struct boardobjgrp *pboardobjgrp,
67 struct nv_pmu_boardobjgrp_super *pboardobjgrppmu,
68 struct boardobjgrpmask *mask)
69{
70 struct nv_pmu_boardobjgrp_e32 *pgrpe32 =
71 (struct nv_pmu_boardobjgrp_e32 *)pboardobjgrppmu;
72 u32 status;
73
74 gk20a_dbg_info("");
75
76 if (pboardobjgrp == NULL)
77 return -EINVAL;
78
79 if (pboardobjgrppmu == NULL)
80 return -EINVAL;
81 status = boardobjgrpmask_export(mask,
82 mask->bitcount,
83 &pgrpe32->obj_mask.super);
84 if (status) {
85 gk20a_err(dev_from_gk20a(g), "e32 init:failed export grpmask");
86 return status;
87 }
88
89 return boardobjgrp_pmuhdrdatainit_super(g,
90 pboardobjgrp, pboardobjgrppmu, mask);
91}