summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/boardobj/boardobjgrp_e255.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_e255.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_e255.c')
-rw-r--r--drivers/gpu/nvgpu/boardobj/boardobjgrp_e255.c92
1 files changed, 92 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/boardobj/boardobjgrp_e255.c b/drivers/gpu/nvgpu/boardobj/boardobjgrp_e255.c
new file mode 100644
index 00000000..a56dca9b
--- /dev/null
+++ b/drivers/gpu/nvgpu/boardobj/boardobjgrp_e255.c
@@ -0,0 +1,92 @@
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_e255.h"
17#include "ctrl/ctrlboardobj.h"
18#include "pmuif/gpmuifboardobj.h"
19#include "boardobjgrp.h"
20#include "boardobjgrpmask.h"
21
22u32 boardobjgrpconstruct_e255(struct boardobjgrp_e255 *pboardobjgrp_e255)
23{
24 u32 status = 0;
25 u8 objslots;
26
27 gk20a_dbg_info("");
28
29 objslots = 255;
30 status = boardobjgrpmask_e255_init(&pboardobjgrp_e255->mask, NULL);
31 if (status)
32 goto boardobjgrpconstruct_e255_exit;
33
34 pboardobjgrp_e255->super.type = CTRL_BOARDOBJGRP_TYPE_E255;
35 pboardobjgrp_e255->super.ppobjects = pboardobjgrp_e255->objects;
36 pboardobjgrp_e255->super.objslots = objslots;
37 pboardobjgrp_e255->super.mask = &(pboardobjgrp_e255->mask.super);
38
39 status = boardobjgrp_construct_super(&pboardobjgrp_e255->super);
40 if (status)
41 goto boardobjgrpconstruct_e255_exit;
42
43 pboardobjgrp_e255->super.destruct = boardobjgrpdestruct_e255;
44
45 pboardobjgrp_e255->super.pmuhdrdatainit =
46 boardobjgrp_pmuhdrdatainit_e255;
47
48boardobjgrpconstruct_e255_exit:
49 return status;
50}
51
52u32 boardobjgrpdestruct_e255(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_e255(struct gk20a *g,
66 struct boardobjgrp *pboardobjgrp,
67 struct nv_pmu_boardobjgrp_super *pboardobjgrppmu,
68 struct boardobjgrpmask *mask)
69{
70 struct nv_pmu_boardobjgrp_e255 *pgrpe255 =
71 (struct nv_pmu_boardobjgrp_e255 *)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
82 status = boardobjgrpmask_export(mask,
83 mask->bitcount,
84 &pgrpe255->obj_mask.super);
85 if (status) {
86 gk20a_err(dev_from_gk20a(g), "e255 init:failed export grpmask");
87 return status;
88 }
89
90 return boardobjgrp_pmuhdrdatainit_super(g,
91 pboardobjgrp, pboardobjgrppmu, mask);
92}