mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 01:50:07 +03:00
gpu: nvgpu: MISRA 14.4 err/ret/status as boolean
MISRA rule 14.4 doesn't allow the usage of integer types as booleans in the controlling expression of an if statement or an iteration statement. Fix violations where the integer variables err, ret, status are used as booleans in the controlling expression of if and loop statements. JIRA NVGPU-1019 Change-Id: I9e18ffc961d485225732c34d3ca561e84d182d07 Signed-off-by: Amurthyreddy <amurthyreddy@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1921370 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
30aeb71693
commit
a39c48e3e2
@@ -281,14 +281,14 @@ int boardobjgrp_pmuinithandle_impl(struct gk20a *g,
|
|||||||
|
|
||||||
status = boardobjgrp_pmucmd_pmuinithandle_impl(g, pboardobjgrp,
|
status = boardobjgrp_pmucmd_pmuinithandle_impl(g, pboardobjgrp,
|
||||||
&pboardobjgrp->pmu.set);
|
&pboardobjgrp->pmu.set);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g, "failed to init pmu set cmd");
|
nvgpu_err(g, "failed to init pmu set cmd");
|
||||||
goto boardobjgrp_pmuinithandle_exit;
|
goto boardobjgrp_pmuinithandle_exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = boardobjgrp_pmucmd_pmuinithandle_impl(g, pboardobjgrp,
|
status = boardobjgrp_pmucmd_pmuinithandle_impl(g, pboardobjgrp,
|
||||||
&pboardobjgrp->pmu.getstatus);
|
&pboardobjgrp->pmu.getstatus);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g, "failed to init get status command");
|
nvgpu_err(g, "failed to init get status command");
|
||||||
goto boardobjgrp_pmuinithandle_exit;
|
goto boardobjgrp_pmuinithandle_exit;
|
||||||
}
|
}
|
||||||
@@ -302,7 +302,7 @@ int boardobjgrp_pmuinithandle_impl(struct gk20a *g,
|
|||||||
|
|
||||||
/* Send the BOARDOBJGRP to the pmu via RM_PMU_BOARDOBJ_CMD_GRP. */
|
/* Send the BOARDOBJGRP to the pmu via RM_PMU_BOARDOBJ_CMD_GRP. */
|
||||||
status = pboardobjgrp->pmuset(g, pboardobjgrp);
|
status = pboardobjgrp->pmuset(g, pboardobjgrp);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g, "failed to send boardobg grp to PMU");
|
nvgpu_err(g, "failed to send boardobg grp to PMU");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -382,14 +382,14 @@ int boardobjgrp_pmudatainit_legacy(struct gk20a *g,
|
|||||||
status = pboardobjgrp->pmudatainstget(g,
|
status = pboardobjgrp->pmudatainstget(g,
|
||||||
(struct nv_pmu_boardobjgrp *)pboardobjgrppmu,
|
(struct nv_pmu_boardobjgrp *)pboardobjgrppmu,
|
||||||
&ppmudata, index);
|
&ppmudata, index);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g, "could not get object instance");
|
nvgpu_err(g, "could not get object instance");
|
||||||
goto boardobjgrppmudatainit_legacy_done;
|
goto boardobjgrppmudatainit_legacy_done;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize the PMU Data */
|
/* Initialize the PMU Data */
|
||||||
status = pboardobj->pmudatainit(g, pboardobj, ppmudata);
|
status = pboardobj->pmudatainit(g, pboardobj, ppmudata);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"could not parse pmu for device %d", index);
|
"could not parse pmu for device %d", index);
|
||||||
goto boardobjgrppmudatainit_legacy_done;
|
goto boardobjgrppmudatainit_legacy_done;
|
||||||
@@ -422,7 +422,7 @@ int boardobjgrp_pmudatainit_super(struct gk20a *g, struct boardobjgrp
|
|||||||
/* Initialize the PMU HDR data.*/
|
/* Initialize the PMU HDR data.*/
|
||||||
status = pboardobjgrp->pmuhdrdatainit(g, pboardobjgrp, pboardobjgrppmu,
|
status = pboardobjgrp->pmuhdrdatainit(g, pboardobjgrp, pboardobjgrppmu,
|
||||||
pboardobjgrp->mask);
|
pboardobjgrp->mask);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g, "unable to init boardobjgrp pmuhdr data");
|
nvgpu_err(g, "unable to init boardobjgrp pmuhdr data");
|
||||||
goto boardobjgrppmudatainit_super_done;
|
goto boardobjgrppmudatainit_super_done;
|
||||||
}
|
}
|
||||||
@@ -431,14 +431,14 @@ int boardobjgrp_pmudatainit_super(struct gk20a *g, struct boardobjgrp
|
|||||||
status = pboardobjgrp->pmudatainstget(g,
|
status = pboardobjgrp->pmudatainstget(g,
|
||||||
(struct nv_pmu_boardobjgrp *)pboardobjgrppmu,
|
(struct nv_pmu_boardobjgrp *)pboardobjgrppmu,
|
||||||
&ppmudata, index);
|
&ppmudata, index);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g, "could not get object instance");
|
nvgpu_err(g, "could not get object instance");
|
||||||
goto boardobjgrppmudatainit_super_done;
|
goto boardobjgrppmudatainit_super_done;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize the PMU Data and send to PMU */
|
/* Initialize the PMU Data and send to PMU */
|
||||||
status = pboardobj->pmudatainit(g, pboardobj, ppmudata);
|
status = pboardobj->pmudatainit(g, pboardobj, ppmudata);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"could not parse pmu for device %d", index);
|
"could not parse pmu for device %d", index);
|
||||||
goto boardobjgrppmudatainit_super_done;
|
goto boardobjgrppmudatainit_super_done;
|
||||||
@@ -503,7 +503,7 @@ int boardobjgrp_pmuset_impl(struct gk20a *g, struct boardobjgrp *pboardobjgrp)
|
|||||||
memset(pcmd->buf, 0x0, pcmd->fbsize);
|
memset(pcmd->buf, 0x0, pcmd->fbsize);
|
||||||
status = pboardobjgrp->pmudatainit(g, pboardobjgrp,
|
status = pboardobjgrp->pmudatainit(g, pboardobjgrp,
|
||||||
pcmd->buf);
|
pcmd->buf);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g, "could not parse pmu data");
|
nvgpu_err(g, "could not parse pmu data");
|
||||||
goto boardobjgrp_pmuset_exit;
|
goto boardobjgrp_pmuset_exit;
|
||||||
}
|
}
|
||||||
@@ -527,7 +527,7 @@ int boardobjgrp_pmuset_impl(struct gk20a *g, struct boardobjgrp *pboardobjgrp)
|
|||||||
/* Send the SET PMU CMD to the PMU */
|
/* Send the SET PMU CMD to the PMU */
|
||||||
status = boardobjgrp_pmucmdsend(g, pboardobjgrp,
|
status = boardobjgrp_pmucmdsend(g, pboardobjgrp,
|
||||||
pcmd);
|
pcmd);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g, "could not send SET CMD to PMU");
|
nvgpu_err(g, "could not send SET CMD to PMU");
|
||||||
goto boardobjgrp_pmuset_exit;
|
goto boardobjgrp_pmuset_exit;
|
||||||
}
|
}
|
||||||
@@ -562,7 +562,7 @@ int boardobjgrp_pmuset_impl_v1(struct gk20a *g,
|
|||||||
memset(pcmd->buf, 0x0, pcmd->fbsize);
|
memset(pcmd->buf, 0x0, pcmd->fbsize);
|
||||||
status = pboardobjgrp->pmudatainit(g, pboardobjgrp,
|
status = pboardobjgrp->pmudatainit(g, pboardobjgrp,
|
||||||
pcmd->buf);
|
pcmd->buf);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g, "could not parse pmu data");
|
nvgpu_err(g, "could not parse pmu data");
|
||||||
goto boardobjgrp_pmuset_exit;
|
goto boardobjgrp_pmuset_exit;
|
||||||
}
|
}
|
||||||
@@ -584,7 +584,7 @@ int boardobjgrp_pmuset_impl_v1(struct gk20a *g,
|
|||||||
/* Send the SET PMU CMD to the PMU using RPC*/
|
/* Send the SET PMU CMD to the PMU using RPC*/
|
||||||
status = boardobjgrp_pmucmdsend_rpc(g, pboardobjgrp,
|
status = boardobjgrp_pmucmdsend_rpc(g, pboardobjgrp,
|
||||||
pcmd, false);
|
pcmd, false);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g, "could not send SET CMD to PMU");
|
nvgpu_err(g, "could not send SET CMD to PMU");
|
||||||
goto boardobjgrp_pmuset_exit;
|
goto boardobjgrp_pmuset_exit;
|
||||||
}
|
}
|
||||||
@@ -646,7 +646,7 @@ boardobjgrp_pmugetstatus_impl(struct gk20a *g, struct boardobjgrp *pboardobjgrp,
|
|||||||
memset(pcmd->buf, 0x0, pcmd->fbsize);
|
memset(pcmd->buf, 0x0, pcmd->fbsize);
|
||||||
status = pboardobjgrp->pmuhdrdatainit(g, pboardobjgrp,
|
status = pboardobjgrp->pmuhdrdatainit(g, pboardobjgrp,
|
||||||
pcmd->buf, mask);
|
pcmd->buf, mask);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g, "could not init PMU HDR data");
|
nvgpu_err(g, "could not init PMU HDR data");
|
||||||
goto boardobjgrp_pmugetstatus_exit;
|
goto boardobjgrp_pmugetstatus_exit;
|
||||||
}
|
}
|
||||||
@@ -655,7 +655,7 @@ boardobjgrp_pmugetstatus_impl(struct gk20a *g, struct boardobjgrp *pboardobjgrp,
|
|||||||
/* Send the GET_STATUS PMU CMD to the PMU */
|
/* Send the GET_STATUS PMU CMD to the PMU */
|
||||||
status = boardobjgrp_pmucmdsend(g, pboardobjgrp,
|
status = boardobjgrp_pmucmdsend(g, pboardobjgrp,
|
||||||
&pboardobjgrp->pmu.getstatus);
|
&pboardobjgrp->pmu.getstatus);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g, "could not send GET_STATUS cmd to PMU");
|
nvgpu_err(g, "could not send GET_STATUS cmd to PMU");
|
||||||
goto boardobjgrp_pmugetstatus_exit;
|
goto boardobjgrp_pmugetstatus_exit;
|
||||||
}
|
}
|
||||||
@@ -703,7 +703,7 @@ boardobjgrp_pmugetstatus_impl_v1(struct gk20a *g, struct boardobjgrp *pboardobjg
|
|||||||
memset(pcmd->buf, 0x0, pcmd->fbsize);
|
memset(pcmd->buf, 0x0, pcmd->fbsize);
|
||||||
status = pboardobjgrp->pmuhdrdatainit(g, pboardobjgrp,
|
status = pboardobjgrp->pmuhdrdatainit(g, pboardobjgrp,
|
||||||
pcmd->buf, mask);
|
pcmd->buf, mask);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g, "could not init PMU HDR data");
|
nvgpu_err(g, "could not init PMU HDR data");
|
||||||
goto boardobjgrp_pmugetstatus_exit;
|
goto boardobjgrp_pmugetstatus_exit;
|
||||||
}
|
}
|
||||||
@@ -717,7 +717,7 @@ boardobjgrp_pmugetstatus_impl_v1(struct gk20a *g, struct boardobjgrp *pboardobjg
|
|||||||
/* Send the GET_STATUS PMU CMD to the PMU */
|
/* Send the GET_STATUS PMU CMD to the PMU */
|
||||||
status = boardobjgrp_pmucmdsend_rpc(g, pboardobjgrp,
|
status = boardobjgrp_pmucmdsend_rpc(g, pboardobjgrp,
|
||||||
pcmd, true);
|
pcmd, true);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g, "could not send GET_STATUS cmd to PMU");
|
nvgpu_err(g, "could not send GET_STATUS cmd to PMU");
|
||||||
goto boardobjgrp_pmugetstatus_exit;
|
goto boardobjgrp_pmugetstatus_exit;
|
||||||
}
|
}
|
||||||
@@ -992,7 +992,7 @@ static int boardobjgrp_pmucmdsend(struct gk20a *g,
|
|||||||
boardobjgrp_pmucmdhandler,
|
boardobjgrp_pmucmdhandler,
|
||||||
(void *)&handlerparams,
|
(void *)&handlerparams,
|
||||||
&seqdesc, ~0);
|
&seqdesc, ~0);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"unable to post boardobj grp cmd for unit %x cmd id %x",
|
"unable to post boardobj grp cmd for unit %x cmd id %x",
|
||||||
cmd.hdr.unit_id, pcmd->id);
|
cmd.hdr.unit_id, pcmd->id);
|
||||||
@@ -1038,7 +1038,7 @@ static int boardobjgrp_pmucmdsend_rpc(struct gk20a *g,
|
|||||||
pcmd->dmem_buffer_size,
|
pcmd->dmem_buffer_size,
|
||||||
NULL, NULL, copy_out);
|
NULL, NULL, copy_out);
|
||||||
|
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g, "Failed to execute RPC, status=0x%x", status);
|
nvgpu_err(g, "Failed to execute RPC, status=0x%x", status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ int boardobjgrpconstruct_e255(struct gk20a *g,
|
|||||||
|
|
||||||
objslots = 255;
|
objslots = 255;
|
||||||
status = boardobjgrpmask_e255_init(&pboardobjgrp_e255->mask, NULL);
|
status = boardobjgrpmask_e255_init(&pboardobjgrp_e255->mask, NULL);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
goto boardobjgrpconstruct_e255_exit;
|
goto boardobjgrpconstruct_e255_exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ int boardobjgrpconstruct_e255(struct gk20a *g,
|
|||||||
pboardobjgrp_e255->super.mask = &(pboardobjgrp_e255->mask.super);
|
pboardobjgrp_e255->super.mask = &(pboardobjgrp_e255->mask.super);
|
||||||
|
|
||||||
status = boardobjgrp_construct_super(g, &pboardobjgrp_e255->super);
|
status = boardobjgrp_construct_super(g, &pboardobjgrp_e255->super);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
goto boardobjgrpconstruct_e255_exit;
|
goto boardobjgrpconstruct_e255_exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ int boardobjgrp_pmuhdrdatainit_e255(struct gk20a *g,
|
|||||||
status = boardobjgrpmask_export(mask,
|
status = boardobjgrpmask_export(mask,
|
||||||
mask->bitcount,
|
mask->bitcount,
|
||||||
&pgrpe255->obj_mask.super);
|
&pgrpe255->obj_mask.super);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g, "e255 init:failed export grpmask");
|
nvgpu_err(g, "e255 init:failed export grpmask");
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
#include "ctrl/ctrlboardobj.h"
|
#include "ctrl/ctrlboardobj.h"
|
||||||
|
|
||||||
|
|
||||||
int boardobjgrpconstruct_e32(struct gk20a *g,
|
int boardobjgrpconstruct_e32(struct gk20a *g,
|
||||||
struct boardobjgrp_e32 *pboardobjgrp_e32)
|
struct boardobjgrp_e32 *pboardobjgrp_e32)
|
||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
@@ -38,7 +38,7 @@ int boardobjgrpconstruct_e32(struct gk20a *g,
|
|||||||
objslots = 32;
|
objslots = 32;
|
||||||
|
|
||||||
status = boardobjgrpmask_e32_init(&pboardobjgrp_e32->mask, NULL);
|
status = boardobjgrpmask_e32_init(&pboardobjgrp_e32->mask, NULL);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
goto boardobjgrpconstruct_e32_exit;
|
goto boardobjgrpconstruct_e32_exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ int boardobjgrpconstruct_e32(struct gk20a *g,
|
|||||||
pboardobjgrp_e32->super.mask = &(pboardobjgrp_e32->mask.super);
|
pboardobjgrp_e32->super.mask = &(pboardobjgrp_e32->mask.super);
|
||||||
|
|
||||||
status = boardobjgrp_construct_super(g, &pboardobjgrp_e32->super);
|
status = boardobjgrp_construct_super(g, &pboardobjgrp_e32->super);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
goto boardobjgrpconstruct_e32_exit;
|
goto boardobjgrpconstruct_e32_exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ int boardobjgrp_pmuhdrdatainit_e32(struct gk20a *g,
|
|||||||
status = boardobjgrpmask_export(mask,
|
status = boardobjgrpmask_export(mask,
|
||||||
mask->bitcount,
|
mask->bitcount,
|
||||||
&pgrpe32->obj_mask.super);
|
&pgrpe32->obj_mask.super);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g, "e32 init:failed export grpmask");
|
nvgpu_err(g, "e32 init:failed export grpmask");
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
#define BOARDOBJGRPMASK_NORMALIZE(_pmask) \
|
#define BOARDOBJGRPMASK_NORMALIZE(_pmask) \
|
||||||
((_pmask)->data[(_pmask)->maskdatacount-1U] &= (_pmask)->lastmaskfilter)
|
((_pmask)->data[(_pmask)->maskdatacount-1U] &= (_pmask)->lastmaskfilter)
|
||||||
|
|
||||||
u32 boardobjgrpmask_init(struct boardobjgrpmask *mask, u8 bitsize,
|
int boardobjgrpmask_init(struct boardobjgrpmask *mask, u8 bitsize,
|
||||||
struct ctrl_boardobjgrp_mask *extmask)
|
struct ctrl_boardobjgrp_mask *extmask)
|
||||||
{
|
{
|
||||||
if (mask == NULL) {
|
if (mask == NULL) {
|
||||||
@@ -54,7 +54,7 @@ u32 boardobjgrpmask_init(struct boardobjgrpmask *mask, u8 bitsize,
|
|||||||
boardobjgrpmask_import(mask, bitsize, extmask);
|
boardobjgrpmask_import(mask, bitsize, extmask);
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 boardobjgrpmask_import(struct boardobjgrpmask *mask, u8 bitsize,
|
int boardobjgrpmask_import(struct boardobjgrpmask *mask, u8 bitsize,
|
||||||
struct ctrl_boardobjgrp_mask *extmask)
|
struct ctrl_boardobjgrp_mask *extmask)
|
||||||
{
|
{
|
||||||
u8 index;
|
u8 index;
|
||||||
@@ -100,7 +100,7 @@ u32 boardobjgrpmask_export(struct boardobjgrpmask *mask, u8 bitsize,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 boardobjgrpmask_clr(struct boardobjgrpmask *mask)
|
int boardobjgrpmask_clr(struct boardobjgrpmask *mask)
|
||||||
{
|
{
|
||||||
u8 index;
|
u8 index;
|
||||||
|
|
||||||
|
|||||||
@@ -303,7 +303,7 @@ static void nvgpu_flcn_print_mem(struct nvgpu_falcon *flcn, u32 src,
|
|||||||
u32 total_block_read = 0;
|
u32 total_block_read = 0;
|
||||||
u32 byte_read_count = 0;
|
u32 byte_read_count = 0;
|
||||||
u32 i = 0;
|
u32 i = 0;
|
||||||
u32 status = 0;
|
int status = 0;
|
||||||
|
|
||||||
nvgpu_info(flcn->g, " offset 0x%x size %d bytes", src, size);
|
nvgpu_info(flcn->g, " offset 0x%x size %d bytes", src, size);
|
||||||
|
|
||||||
@@ -324,7 +324,7 @@ static void nvgpu_flcn_print_mem(struct nvgpu_falcon *flcn, u32 src,
|
|||||||
(u8 *)buff, byte_read_count, 0);
|
(u8 *)buff, byte_read_count, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(flcn->g, "MEM print failed");
|
nvgpu_err(flcn->g, "MEM print failed");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,9 +99,9 @@ int gp106_elcg_init_idle_filters(struct gk20a *g)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 gp106_configure_therm_alert(struct gk20a *g, s32 curr_warn_temp)
|
int gp106_configure_therm_alert(struct gk20a *g, s32 curr_warn_temp)
|
||||||
{
|
{
|
||||||
u32 err = 0;
|
int err = 0;
|
||||||
|
|
||||||
if (g->curr_warn_temp != curr_warn_temp) {
|
if (g->curr_warn_temp != curr_warn_temp) {
|
||||||
g->curr_warn_temp = curr_warn_temp;
|
g->curr_warn_temp = curr_warn_temp;
|
||||||
|
|||||||
@@ -32,6 +32,6 @@ struct gk20a;
|
|||||||
void gp106_get_internal_sensor_limits(s32 *max_24_8, s32 *min_24_8);
|
void gp106_get_internal_sensor_limits(s32 *max_24_8, s32 *min_24_8);
|
||||||
int gp106_get_internal_sensor_curr_temp(struct gk20a *g, u32 *temp_f24_8);
|
int gp106_get_internal_sensor_curr_temp(struct gk20a *g, u32 *temp_f24_8);
|
||||||
int gp106_elcg_init_idle_filters(struct gk20a *g);
|
int gp106_elcg_init_idle_filters(struct gk20a *g);
|
||||||
u32 gp106_configure_therm_alert(struct gk20a *g, s32 curr_warn_temp);
|
int gp106_configure_therm_alert(struct gk20a *g, s32 curr_warn_temp);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -68,15 +68,15 @@ struct boardobjgrpmask_e255 {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Init and I/O operations.*/
|
/* Init and I/O operations.*/
|
||||||
u32 boardobjgrpmask_init(struct boardobjgrpmask *mask, u8 bitsize,
|
int boardobjgrpmask_init(struct boardobjgrpmask *mask, u8 bitsize,
|
||||||
struct ctrl_boardobjgrp_mask *extmask);
|
struct ctrl_boardobjgrp_mask *extmask);
|
||||||
u32 boardobjgrpmask_import(struct boardobjgrpmask *mask, u8 bitsize,
|
int boardobjgrpmask_import(struct boardobjgrpmask *mask, u8 bitsize,
|
||||||
struct ctrl_boardobjgrp_mask *extmask);
|
struct ctrl_boardobjgrp_mask *extmask);
|
||||||
u32 boardobjgrpmask_export(struct boardobjgrpmask *mask, u8 bitsize,
|
u32 boardobjgrpmask_export(struct boardobjgrpmask *mask, u8 bitsize,
|
||||||
struct ctrl_boardobjgrp_mask *extmask);
|
struct ctrl_boardobjgrp_mask *extmask);
|
||||||
|
|
||||||
/* Operations on all bits of a single mask.*/
|
/* Operations on all bits of a single mask.*/
|
||||||
u32 boardobjgrpmask_clr(struct boardobjgrpmask *mask);
|
int boardobjgrpmask_clr(struct boardobjgrpmask *mask);
|
||||||
u32 boardobjgrpmask_set(struct boardobjgrpmask *mask);
|
u32 boardobjgrpmask_set(struct boardobjgrpmask *mask);
|
||||||
u32 boardobjgrpmask_inv(struct boardobjgrpmask *mask);
|
u32 boardobjgrpmask_inv(struct boardobjgrpmask *mask);
|
||||||
bool boardobjgrpmask_iszero(struct boardobjgrpmask *mask);
|
bool boardobjgrpmask_iszero(struct boardobjgrpmask *mask);
|
||||||
|
|||||||
@@ -889,11 +889,11 @@ struct gpu_ops {
|
|||||||
struct boardobjgrp_pmu_cmd *cmd);
|
struct boardobjgrp_pmu_cmd *cmd);
|
||||||
} boardobj;
|
} boardobj;
|
||||||
struct {
|
struct {
|
||||||
u32 (*volt_set_voltage)(struct gk20a *g,
|
int (*volt_set_voltage)(struct gk20a *g,
|
||||||
u32 logic_voltage_uv, u32 sram_voltage_uv);
|
u32 logic_voltage_uv, u32 sram_voltage_uv);
|
||||||
u32 (*volt_get_voltage)(struct gk20a *g,
|
int (*volt_get_voltage)(struct gk20a *g,
|
||||||
u8 volt_domain, u32 *pvoltage_uv);
|
u8 volt_domain, u32 *pvoltage_uv);
|
||||||
u32 (*volt_send_load_cmd_to_pmu)(struct gk20a *g);
|
int (*volt_send_load_cmd_to_pmu)(struct gk20a *g);
|
||||||
} volt;
|
} volt;
|
||||||
struct {
|
struct {
|
||||||
u32 (*get_vbios_clk_domain)(u32 vbios_domain);
|
u32 (*get_vbios_clk_domain)(u32 vbios_domain);
|
||||||
@@ -1022,7 +1022,7 @@ struct gpu_ops {
|
|||||||
int (*get_internal_sensor_curr_temp)(struct gk20a *g, u32 *temp_f24_8);
|
int (*get_internal_sensor_curr_temp)(struct gk20a *g, u32 *temp_f24_8);
|
||||||
void (*get_internal_sensor_limits)(s32 *max_24_8,
|
void (*get_internal_sensor_limits)(s32 *max_24_8,
|
||||||
s32 *min_24_8);
|
s32 *min_24_8);
|
||||||
u32 (*configure_therm_alert)(struct gk20a *g, s32 curr_warn_temp);
|
int (*configure_therm_alert)(struct gk20a *g, s32 curr_warn_temp);
|
||||||
} therm;
|
} therm;
|
||||||
struct {
|
struct {
|
||||||
bool (*is_pmu_supported)(struct gk20a *g);
|
bool (*is_pmu_supported)(struct gk20a *g);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
|
* Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
* copy of this software and associated documentation files (the "Software"),
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
@@ -25,12 +25,12 @@
|
|||||||
#include "thrm.h"
|
#include "thrm.h"
|
||||||
#include "thrmpmu.h"
|
#include "thrmpmu.h"
|
||||||
|
|
||||||
u32 therm_domain_sw_setup(struct gk20a *g)
|
int therm_domain_sw_setup(struct gk20a *g)
|
||||||
{
|
{
|
||||||
u32 status;
|
int status;
|
||||||
|
|
||||||
status = therm_device_sw_setup(g);
|
status = therm_device_sw_setup(g);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"error creating boardobjgrp for therm devices, status - 0x%x",
|
"error creating boardobjgrp for therm devices, status - 0x%x",
|
||||||
status);
|
status);
|
||||||
@@ -38,7 +38,7 @@ u32 therm_domain_sw_setup(struct gk20a *g)
|
|||||||
}
|
}
|
||||||
|
|
||||||
status = therm_channel_sw_setup(g);
|
status = therm_channel_sw_setup(g);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"error creating boardobjgrp for therm channel, status - 0x%x",
|
"error creating boardobjgrp for therm channel, status - 0x%x",
|
||||||
status);
|
status);
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ struct therm_pmupstate {
|
|||||||
struct therm_channels therm_channelobjs;
|
struct therm_channels therm_channelobjs;
|
||||||
};
|
};
|
||||||
|
|
||||||
u32 therm_domain_sw_setup(struct gk20a *g);
|
int therm_domain_sw_setup(struct gk20a *g);
|
||||||
u32 therm_domain_pmu_setup(struct gk20a *g);
|
u32 therm_domain_pmu_setup(struct gk20a *g);
|
||||||
|
|
||||||
#endif /* NVGPU_THERM_THRM_H */
|
#endif /* NVGPU_THERM_THRM_H */
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ static int _therm_channel_pmudatainit_device(struct gk20a *g,
|
|||||||
struct nv_pmu_therm_therm_channel_device_boardobj_set *pset;
|
struct nv_pmu_therm_therm_channel_device_boardobj_set *pset;
|
||||||
|
|
||||||
status = boardobj_pmudatainit_super(g, board_obj_ptr, ppmudata);
|
status = boardobj_pmudatainit_super(g, board_obj_ptr, ppmudata);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"error updating pmu boardobjgrp for therm channel 0x%x",
|
"error updating pmu boardobjgrp for therm channel 0x%x",
|
||||||
status);
|
status);
|
||||||
@@ -74,7 +74,7 @@ static struct boardobj *construct_channel_device(struct gk20a *g,
|
|||||||
|
|
||||||
status = boardobj_construct_super(g, &board_obj_ptr,
|
status = boardobj_construct_super(g, &board_obj_ptr,
|
||||||
pargs_size, pargs);
|
pargs_size, pargs);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -198,7 +198,7 @@ static int devinit_get_therm_channel_table(struct gk20a *g,
|
|||||||
status = boardobjgrp_objinsert(&pthermchannelobjs->super.super,
|
status = boardobjgrp_objinsert(&pthermchannelobjs->super.super,
|
||||||
boardobj, obj_index);
|
boardobj, obj_index);
|
||||||
|
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"unable to insert thermal device boardobj for %d", index);
|
"unable to insert thermal device boardobj for %d", index);
|
||||||
status = -EINVAL;
|
status = -EINVAL;
|
||||||
@@ -222,7 +222,7 @@ int therm_channel_sw_setup(struct gk20a *g)
|
|||||||
/* Construct the Super Class and override the Interfaces */
|
/* Construct the Super Class and override the Interfaces */
|
||||||
status = boardobjgrpconstruct_e32(g,
|
status = boardobjgrpconstruct_e32(g,
|
||||||
&g->therm_pmu.therm_channelobjs.super);
|
&g->therm_pmu.therm_channelobjs.super);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"error creating boardobjgrp for therm devices, status - 0x%x",
|
"error creating boardobjgrp for therm devices, status - 0x%x",
|
||||||
status);
|
status);
|
||||||
@@ -236,7 +236,7 @@ int therm_channel_sw_setup(struct gk20a *g)
|
|||||||
pboardobjgrp->pmudatainstget = _therm_channel_pmudata_instget;
|
pboardobjgrp->pmudatainstget = _therm_channel_pmudata_instget;
|
||||||
|
|
||||||
status = devinit_get_therm_channel_table(g, pthermchannelobjs);
|
status = devinit_get_therm_channel_table(g, pthermchannelobjs);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,7 +244,7 @@ int therm_channel_sw_setup(struct gk20a *g)
|
|||||||
|
|
||||||
status = BOARDOBJGRP_PMU_CMD_GRP_SET_CONSTRUCT(g, pboardobjgrp,
|
status = BOARDOBJGRP_PMU_CMD_GRP_SET_CONSTRUCT(g, pboardobjgrp,
|
||||||
therm, THERM, therm_channel, THERM_CHANNEL);
|
therm, THERM, therm_channel, THERM_CHANNEL);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"error constructing PMU_BOARDOBJ_CMD_GRP_SET interface - 0x%x",
|
"error constructing PMU_BOARDOBJ_CMD_GRP_SET interface - 0x%x",
|
||||||
status);
|
status);
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ static struct boardobj *therm_device_construct(struct gk20a *g,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(status) {
|
if(status != 0) {
|
||||||
board_obj_ptr = NULL;
|
board_obj_ptr = NULL;
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"could not allocate memory for therm_device");
|
"could not allocate memory for therm_device");
|
||||||
@@ -312,7 +312,7 @@ static int devinit_get_therm_device_table(struct gk20a *g,
|
|||||||
status = boardobjgrp_objinsert(&pthermdeviceobjs->super.super,
|
status = boardobjgrp_objinsert(&pthermdeviceobjs->super.super,
|
||||||
boardobj, obj_index);
|
boardobj, obj_index);
|
||||||
|
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"unable to insert thermal device boardobj for %d", index);
|
"unable to insert thermal device boardobj for %d", index);
|
||||||
status = -EINVAL;
|
status = -EINVAL;
|
||||||
@@ -336,7 +336,7 @@ int therm_device_sw_setup(struct gk20a *g)
|
|||||||
/* Construct the Super Class and override the Interfaces */
|
/* Construct the Super Class and override the Interfaces */
|
||||||
status = boardobjgrpconstruct_e32(g,
|
status = boardobjgrpconstruct_e32(g,
|
||||||
&g->therm_pmu.therm_deviceobjs.super);
|
&g->therm_pmu.therm_deviceobjs.super);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"error creating boardobjgrp for therm devices, status - 0x%x",
|
"error creating boardobjgrp for therm devices, status - 0x%x",
|
||||||
status);
|
status);
|
||||||
@@ -350,7 +350,7 @@ int therm_device_sw_setup(struct gk20a *g)
|
|||||||
pboardobjgrp->pmudatainstget = _therm_device_pmudata_instget;
|
pboardobjgrp->pmudatainstget = _therm_device_pmudata_instget;
|
||||||
|
|
||||||
status = devinit_get_therm_device_table(g, pthermdeviceobjs);
|
status = devinit_get_therm_device_table(g, pthermdeviceobjs);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -358,7 +358,7 @@ int therm_device_sw_setup(struct gk20a *g)
|
|||||||
|
|
||||||
status = BOARDOBJGRP_PMU_CMD_GRP_SET_CONSTRUCT(g, pboardobjgrp,
|
status = BOARDOBJGRP_PMU_CMD_GRP_SET_CONSTRUCT(g, pboardobjgrp,
|
||||||
therm, THERM, therm_device, THERM_DEVICE);
|
therm, THERM, therm_device, THERM_DEVICE);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"error constructing PMU_BOARDOBJ_CMD_GRP_SET interface - 0x%x",
|
"error constructing PMU_BOARDOBJ_CMD_GRP_SET interface - 0x%x",
|
||||||
status);
|
status);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ int therm_send_pmgr_tables_to_pmu(struct gk20a *g)
|
|||||||
if (!BOARDOBJGRP_IS_EMPTY(&g->therm_pmu.therm_deviceobjs.super.super)) {
|
if (!BOARDOBJGRP_IS_EMPTY(&g->therm_pmu.therm_deviceobjs.super.super)) {
|
||||||
pboardobjgrp = &g->therm_pmu.therm_deviceobjs.super.super;
|
pboardobjgrp = &g->therm_pmu.therm_deviceobjs.super.super;
|
||||||
status = pboardobjgrp->pmuinithandle(g, pboardobjgrp);
|
status = pboardobjgrp->pmuinithandle(g, pboardobjgrp);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"therm_send_pmgr_tables_to_pmu - therm_device failed %x",
|
"therm_send_pmgr_tables_to_pmu - therm_device failed %x",
|
||||||
status);
|
status);
|
||||||
@@ -71,7 +71,7 @@ int therm_send_pmgr_tables_to_pmu(struct gk20a *g)
|
|||||||
&g->therm_pmu.therm_channelobjs.super.super)) {
|
&g->therm_pmu.therm_channelobjs.super.super)) {
|
||||||
pboardobjgrp = &g->therm_pmu.therm_channelobjs.super.super;
|
pboardobjgrp = &g->therm_pmu.therm_channelobjs.super.super;
|
||||||
status = pboardobjgrp->pmuinithandle(g, pboardobjgrp);
|
status = pboardobjgrp->pmuinithandle(g, pboardobjgrp);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"therm_send_pmgr_tables_to_pmu - therm_channel failed %x",
|
"therm_send_pmgr_tables_to_pmu - therm_channel failed %x",
|
||||||
status);
|
status);
|
||||||
@@ -83,12 +83,12 @@ exit:
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u32 therm_pmu_cmd_post(struct gk20a *g, struct pmu_cmd *cmd,
|
static int therm_pmu_cmd_post(struct gk20a *g, struct pmu_cmd *cmd,
|
||||||
struct pmu_msg *msg, struct pmu_payload *payload,
|
struct pmu_msg *msg, struct pmu_payload *payload,
|
||||||
u32 queue_id, pmu_callback callback, void* cb_param,
|
u32 queue_id, pmu_callback callback, void* cb_param,
|
||||||
u32 *seq_desc, unsigned long timeout)
|
u32 *seq_desc, unsigned long timeout)
|
||||||
{
|
{
|
||||||
u32 status;
|
int status;
|
||||||
struct therm_pmucmdhandler_params *handlerparams = NULL;
|
struct therm_pmucmdhandler_params *handlerparams = NULL;
|
||||||
|
|
||||||
status = nvgpu_pmu_cmd_post(g, cmd, msg, payload,
|
status = nvgpu_pmu_cmd_post(g, cmd, msg, payload,
|
||||||
@@ -97,7 +97,7 @@ static u32 therm_pmu_cmd_post(struct gk20a *g, struct pmu_cmd *cmd,
|
|||||||
cb_param,
|
cb_param,
|
||||||
seq_desc,
|
seq_desc,
|
||||||
timeout);
|
timeout);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"unable to post therm cmd for unit %x cmd id %x size %x",
|
"unable to post therm cmd for unit %x cmd id %x size %x",
|
||||||
cmd->hdr.unit_id, cmd->cmd.therm.cmd_type, cmd->hdr.size);
|
cmd->hdr.unit_id, cmd->cmd.therm.cmd_type, cmd->hdr.size);
|
||||||
@@ -122,7 +122,7 @@ exit:
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u32 therm_set_warn_temp_limit(struct gk20a *g)
|
static int therm_set_warn_temp_limit(struct gk20a *g)
|
||||||
{
|
{
|
||||||
u32 seqdesc = 0;
|
u32 seqdesc = 0;
|
||||||
struct pmu_cmd cmd;
|
struct pmu_cmd cmd;
|
||||||
@@ -172,7 +172,7 @@ static u32 therm_set_warn_temp_limit(struct gk20a *g)
|
|||||||
&seqdesc, ~0);
|
&seqdesc, ~0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static u32 therm_enable_slct_notification_request(struct gk20a *g)
|
static int therm_enable_slct_notification_request(struct gk20a *g)
|
||||||
{
|
{
|
||||||
u32 seqdesc = 0;
|
u32 seqdesc = 0;
|
||||||
struct pmu_cmd cmd = { {0} };
|
struct pmu_cmd cmd = { {0} };
|
||||||
@@ -192,7 +192,7 @@ static u32 therm_enable_slct_notification_request(struct gk20a *g)
|
|||||||
&seqdesc, ~0);
|
&seqdesc, ~0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static u32 therm_send_slct_configuration_to_pmu(struct gk20a *g)
|
static int therm_send_slct_configuration_to_pmu(struct gk20a *g)
|
||||||
{
|
{
|
||||||
u32 seqdesc = 0;
|
u32 seqdesc = 0;
|
||||||
struct pmu_cmd cmd;
|
struct pmu_cmd cmd;
|
||||||
@@ -241,12 +241,12 @@ static u32 therm_send_slct_configuration_to_pmu(struct gk20a *g)
|
|||||||
&seqdesc, ~0);
|
&seqdesc, ~0);
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 therm_configure_therm_alert(struct gk20a *g)
|
int therm_configure_therm_alert(struct gk20a *g)
|
||||||
{
|
{
|
||||||
u32 status;
|
int status;
|
||||||
|
|
||||||
status = therm_enable_slct_notification_request(g);
|
status = therm_enable_slct_notification_request(g);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"therm_enable_slct_notification_request-failed %d",
|
"therm_enable_slct_notification_request-failed %d",
|
||||||
status);
|
status);
|
||||||
@@ -254,7 +254,7 @@ u32 therm_configure_therm_alert(struct gk20a *g)
|
|||||||
}
|
}
|
||||||
|
|
||||||
status = therm_send_slct_configuration_to_pmu(g);
|
status = therm_send_slct_configuration_to_pmu(g);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"therm_send_slct_configuration_to_pmu-failed %d",
|
"therm_send_slct_configuration_to_pmu-failed %d",
|
||||||
status);
|
status);
|
||||||
@@ -262,7 +262,7 @@ u32 therm_configure_therm_alert(struct gk20a *g)
|
|||||||
}
|
}
|
||||||
|
|
||||||
status = therm_set_warn_temp_limit(g);
|
status = therm_set_warn_temp_limit(g);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"therm_set_warn_temp_limit-failed %d",
|
"therm_set_warn_temp_limit-failed %d",
|
||||||
status);
|
status);
|
||||||
|
|||||||
@@ -26,6 +26,6 @@
|
|||||||
|
|
||||||
int therm_send_pmgr_tables_to_pmu(struct gk20a *g);
|
int therm_send_pmgr_tables_to_pmu(struct gk20a *g);
|
||||||
|
|
||||||
u32 therm_configure_therm_alert(struct gk20a *g);
|
int therm_configure_therm_alert(struct gk20a *g);
|
||||||
|
|
||||||
#endif /* NVGPU_THERM_THRMPMU_H */
|
#endif /* NVGPU_THERM_THRMPMU_H */
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ static int volt_device_pmu_data_init_super(struct gk20a *g,
|
|||||||
struct nv_pmu_volt_volt_device_boardobj_set *pset;
|
struct nv_pmu_volt_volt_device_boardobj_set *pset;
|
||||||
|
|
||||||
status = boardobj_pmudatainit_super(g, pboard_obj, ppmudata);
|
status = boardobj_pmudatainit_super(g, pboard_obj, ppmudata);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ static int volt_device_pmu_data_init_pwm(struct gk20a *g,
|
|||||||
struct nv_pmu_volt_volt_device_pwm_boardobj_set *pset;
|
struct nv_pmu_volt_volt_device_pwm_boardobj_set *pset;
|
||||||
|
|
||||||
status = volt_device_pmu_data_init_super(g, pboard_obj, ppmudata);
|
status = volt_device_pmu_data_init_super(g, pboard_obj, ppmudata);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ static int construct_volt_device(struct gk20a *g,
|
|||||||
int status = 0;
|
int status = 0;
|
||||||
|
|
||||||
status = boardobj_construct_super(g, ppboardobj, size, pargs);
|
status = boardobj_construct_super(g, ppboardobj, size, pargs);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ static int construct_pwm_volt_device(struct gk20a *g,
|
|||||||
int status = 0;
|
int status = 0;
|
||||||
|
|
||||||
status = construct_volt_device(g, ppboardobj, size, pargs);
|
status = construct_volt_device(g, ppboardobj, size, pargs);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,7 +191,7 @@ static struct voltage_device *volt_volt_device_construct(struct gk20a *g,
|
|||||||
if (BOARDOBJ_GET_TYPE(pargs) == CTRL_VOLT_DEVICE_TYPE_PWM) {
|
if (BOARDOBJ_GET_TYPE(pargs) == CTRL_VOLT_DEVICE_TYPE_PWM) {
|
||||||
int status = construct_pwm_volt_device(g, &pboard_obj,
|
int status = construct_pwm_volt_device(g, &pboard_obj,
|
||||||
sizeof(struct voltage_device_pwm), pargs);
|
sizeof(struct voltage_device_pwm), pargs);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
" Could not allocate memory for VOLTAGE_DEVICE type (%x).",
|
" Could not allocate memory for VOLTAGE_DEVICE type (%x).",
|
||||||
BOARDOBJ_GET_TYPE(pargs));
|
BOARDOBJ_GET_TYPE(pargs));
|
||||||
@@ -329,7 +329,7 @@ static int volt_get_voltage_device_table_1x_psv(struct gk20a *g,
|
|||||||
status = boardobjgrp_objinsert(
|
status = boardobjgrp_objinsert(
|
||||||
&p_Volt_Device_Meta_Data->volt_devices.super,
|
&p_Volt_Device_Meta_Data->volt_devices.super,
|
||||||
(struct boardobj *)pvolt_dev, entry_Idx);
|
(struct boardobj *)pvolt_dev, entry_Idx);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"could not add VOLTAGE_DEVICE for entry %d into boardobjgrp ",
|
"could not add VOLTAGE_DEVICE for entry %d into boardobjgrp ",
|
||||||
entry_Idx);
|
entry_Idx);
|
||||||
@@ -394,10 +394,10 @@ done:
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u32 volt_get_volt_devices_table(struct gk20a *g,
|
static int volt_get_volt_devices_table(struct gk20a *g,
|
||||||
struct voltage_device_metadata *pvolt_device_metadata)
|
struct voltage_device_metadata *pvolt_device_metadata)
|
||||||
{
|
{
|
||||||
u32 status = 0;
|
int status = 0;
|
||||||
u8 *volt_device_table_ptr = NULL;
|
u8 *volt_device_table_ptr = NULL;
|
||||||
struct vbios_voltage_device_table_1x_header header = { 0 };
|
struct vbios_voltage_device_table_1x_header header = { 0 };
|
||||||
struct vbios_voltage_device_table_1x_entry entry = { 0 };
|
struct vbios_voltage_device_table_1x_entry entry = { 0 };
|
||||||
@@ -482,10 +482,10 @@ static int volt_device_volt_cmp(const void *a, const void *b)
|
|||||||
return (int)a_entry->voltage_uv - (int)b_entry->voltage_uv;
|
return (int)a_entry->voltage_uv - (int)b_entry->voltage_uv;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u32 volt_device_state_init(struct gk20a *g,
|
static int volt_device_state_init(struct gk20a *g,
|
||||||
struct voltage_device *pvolt_dev)
|
struct voltage_device *pvolt_dev)
|
||||||
{
|
{
|
||||||
u32 status = 0;
|
int status = 0;
|
||||||
struct voltage_rail *pRail = NULL;
|
struct voltage_rail *pRail = NULL;
|
||||||
u8 rail_idx = 0;
|
u8 rail_idx = 0;
|
||||||
|
|
||||||
@@ -523,7 +523,7 @@ static u32 volt_device_state_init(struct gk20a *g,
|
|||||||
|
|
||||||
status = volt_rail_volt_dev_register(g, pRail,
|
status = volt_rail_volt_dev_register(g, pRail,
|
||||||
BOARDOBJ_GET_IDX(pvolt_dev), pvolt_dev->operation_type);
|
BOARDOBJ_GET_IDX(pvolt_dev), pvolt_dev->operation_type);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"Failed to register the device with rail obj");
|
"Failed to register the device with rail obj");
|
||||||
goto done;
|
goto done;
|
||||||
@@ -531,7 +531,7 @@ static u32 volt_device_state_init(struct gk20a *g,
|
|||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g, "Error in building rail sw state device sw");
|
nvgpu_err(g, "Error in building rail sw state device sw");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -557,9 +557,9 @@ int volt_dev_pmu_setup(struct gk20a *g)
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 volt_dev_sw_setup(struct gk20a *g)
|
int volt_dev_sw_setup(struct gk20a *g)
|
||||||
{
|
{
|
||||||
u32 status = 0;
|
int status = 0;
|
||||||
struct boardobjgrp *pboardobjgrp = NULL;
|
struct boardobjgrp *pboardobjgrp = NULL;
|
||||||
struct voltage_device *pvolt_device;
|
struct voltage_device *pvolt_device;
|
||||||
u8 i;
|
u8 i;
|
||||||
@@ -568,7 +568,7 @@ u32 volt_dev_sw_setup(struct gk20a *g)
|
|||||||
|
|
||||||
status = boardobjgrpconstruct_e32(g,
|
status = boardobjgrpconstruct_e32(g,
|
||||||
&g->perf_pmu.volt.volt_dev_metadata.volt_devices);
|
&g->perf_pmu.volt.volt_dev_metadata.volt_devices);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"error creating boardobjgrp for volt rail, status - 0x%x",
|
"error creating boardobjgrp for volt rail, status - 0x%x",
|
||||||
status);
|
status);
|
||||||
@@ -583,7 +583,7 @@ u32 volt_dev_sw_setup(struct gk20a *g)
|
|||||||
/* Obtain Voltage Rail Table from VBIOS */
|
/* Obtain Voltage Rail Table from VBIOS */
|
||||||
status = volt_get_volt_devices_table(g, &g->perf_pmu.volt.
|
status = volt_get_volt_devices_table(g, &g->perf_pmu.volt.
|
||||||
volt_dev_metadata);
|
volt_dev_metadata);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -592,7 +592,7 @@ u32 volt_dev_sw_setup(struct gk20a *g)
|
|||||||
|
|
||||||
status = BOARDOBJGRP_PMU_CMD_GRP_SET_CONSTRUCT(g, pboardobjgrp,
|
status = BOARDOBJGRP_PMU_CMD_GRP_SET_CONSTRUCT(g, pboardobjgrp,
|
||||||
volt, VOLT, volt_device, VOLT_DEVICE);
|
volt, VOLT, volt_device, VOLT_DEVICE);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"error constructing PMU_BOARDOBJ_CMD_GRP_SET interface - 0x%x",
|
"error constructing PMU_BOARDOBJ_CMD_GRP_SET interface - 0x%x",
|
||||||
status);
|
status);
|
||||||
@@ -602,7 +602,7 @@ u32 volt_dev_sw_setup(struct gk20a *g)
|
|||||||
status = BOARDOBJGRP_PMU_CMD_GRP_GET_STATUS_CONSTRUCT(g,
|
status = BOARDOBJGRP_PMU_CMD_GRP_GET_STATUS_CONSTRUCT(g,
|
||||||
&g->perf_pmu.volt.volt_dev_metadata.volt_devices.super,
|
&g->perf_pmu.volt.volt_dev_metadata.volt_devices.super,
|
||||||
volt, VOLT, volt_device, VOLT_DEVICE);
|
volt, VOLT, volt_device, VOLT_DEVICE);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"error constructing PMU_BOARDOBJ_CMD_GRP_SET interface - 0x%x",
|
"error constructing PMU_BOARDOBJ_CMD_GRP_SET interface - 0x%x",
|
||||||
status);
|
status);
|
||||||
@@ -614,7 +614,7 @@ u32 volt_dev_sw_setup(struct gk20a *g)
|
|||||||
super),
|
super),
|
||||||
struct voltage_device *, pvolt_device, i) {
|
struct voltage_device *, pvolt_device, i) {
|
||||||
status = volt_device_state_init(g, pvolt_device);
|
status = volt_device_state_init(g, pvolt_device);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"failure while executing devices's state init interface");
|
"failure while executing devices's state init interface");
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ struct voltage_device_pwm_entry {
|
|||||||
};
|
};
|
||||||
/* PWM end */
|
/* PWM end */
|
||||||
|
|
||||||
u32 volt_dev_sw_setup(struct gk20a *g);
|
int volt_dev_sw_setup(struct gk20a *g);
|
||||||
int volt_dev_pmu_setup(struct gk20a *g);
|
int volt_dev_pmu_setup(struct gk20a *g);
|
||||||
|
|
||||||
#endif /* NVGPU_VOLT_DEV_H */
|
#endif /* NVGPU_VOLT_DEV_H */
|
||||||
|
|||||||
@@ -60,13 +60,13 @@ static void volt_rpc_pmucmdhandler(struct gk20a *g, struct pmu_msg *msg,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static u32 volt_pmu_rpc_execute(struct gk20a *g,
|
static int volt_pmu_rpc_execute(struct gk20a *g,
|
||||||
struct nv_pmu_volt_rpc *prpc_call)
|
struct nv_pmu_volt_rpc *prpc_call)
|
||||||
{
|
{
|
||||||
struct pmu_cmd cmd;
|
struct pmu_cmd cmd;
|
||||||
struct pmu_msg msg;
|
struct pmu_msg msg;
|
||||||
struct pmu_payload payload;
|
struct pmu_payload payload;
|
||||||
u32 status = 0;
|
int status = 0;
|
||||||
u32 seqdesc;
|
u32 seqdesc;
|
||||||
struct volt_rpc_pmucmdhandler_params handler;
|
struct volt_rpc_pmucmdhandler_params handler;
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ static u32 volt_pmu_rpc_execute(struct gk20a *g,
|
|||||||
PMU_COMMAND_QUEUE_LPQ,
|
PMU_COMMAND_QUEUE_LPQ,
|
||||||
volt_rpc_pmucmdhandler, (void *)&handler,
|
volt_rpc_pmucmdhandler, (void *)&handler,
|
||||||
&seqdesc, ~0);
|
&seqdesc, ~0);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g, "unable to post volt RPC cmd %x",
|
nvgpu_err(g, "unable to post volt RPC cmd %x",
|
||||||
cmd.cmd.volt.cmd_type);
|
cmd.cmd.volt.cmd_type);
|
||||||
goto volt_pmu_rpc_execute;
|
goto volt_pmu_rpc_execute;
|
||||||
@@ -117,15 +117,15 @@ volt_pmu_rpc_execute:
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 nvgpu_volt_send_load_cmd_to_pmu_gp10x(struct gk20a *g)
|
int nvgpu_volt_send_load_cmd_to_pmu_gp10x(struct gk20a *g)
|
||||||
{
|
{
|
||||||
struct nv_pmu_volt_rpc rpc_call = { 0 };
|
struct nv_pmu_volt_rpc rpc_call = { 0 };
|
||||||
u32 status = 0;
|
int status = 0;
|
||||||
|
|
||||||
rpc_call.function = NV_PMU_VOLT_RPC_ID_LOAD;
|
rpc_call.function = NV_PMU_VOLT_RPC_ID_LOAD;
|
||||||
|
|
||||||
status = volt_pmu_rpc_execute(g, &rpc_call);
|
status = volt_pmu_rpc_execute(g, &rpc_call);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"Error while executing LOAD RPC: status = 0x%08x.",
|
"Error while executing LOAD RPC: status = 0x%08x.",
|
||||||
status);
|
status);
|
||||||
@@ -134,15 +134,15 @@ u32 nvgpu_volt_send_load_cmd_to_pmu_gp10x(struct gk20a *g)
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 nvgpu_volt_send_load_cmd_to_pmu_gv10x(struct gk20a *g)
|
int nvgpu_volt_send_load_cmd_to_pmu_gv10x(struct gk20a *g)
|
||||||
{
|
{
|
||||||
struct nvgpu_pmu *pmu = &g->pmu;
|
struct nvgpu_pmu *pmu = &g->pmu;
|
||||||
struct nv_pmu_rpc_struct_volt_load rpc;
|
struct nv_pmu_rpc_struct_volt_load rpc;
|
||||||
u32 status = 0;
|
int status = 0;
|
||||||
|
|
||||||
memset(&rpc, 0, sizeof(struct nv_pmu_rpc_struct_volt_load));
|
memset(&rpc, 0, sizeof(struct nv_pmu_rpc_struct_volt_load));
|
||||||
PMU_RPC_EXECUTE(status, pmu, VOLT, LOAD, &rpc, 0);
|
PMU_RPC_EXECUTE(status, pmu, VOLT, LOAD, &rpc, 0);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g, "Failed to execute RPC status=0x%x",
|
nvgpu_err(g, "Failed to execute RPC status=0x%x",
|
||||||
status);
|
status);
|
||||||
}
|
}
|
||||||
@@ -150,11 +150,11 @@ u32 nvgpu_volt_send_load_cmd_to_pmu_gv10x(struct gk20a *g)
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 nvgpu_volt_rail_get_voltage_gp10x(struct gk20a *g,
|
int nvgpu_volt_rail_get_voltage_gp10x(struct gk20a *g,
|
||||||
u8 volt_domain, u32 *pvoltage_uv)
|
u8 volt_domain, u32 *pvoltage_uv)
|
||||||
{
|
{
|
||||||
struct nv_pmu_volt_rpc rpc_call = { 0 };
|
struct nv_pmu_volt_rpc rpc_call = { 0 };
|
||||||
u32 status = 0;
|
int status = 0;
|
||||||
u8 rail_idx;
|
u8 rail_idx;
|
||||||
|
|
||||||
rail_idx = volt_rail_volt_domain_convert_to_idx(g, volt_domain);
|
rail_idx = volt_rail_volt_domain_convert_to_idx(g, volt_domain);
|
||||||
@@ -172,7 +172,7 @@ u32 nvgpu_volt_rail_get_voltage_gp10x(struct gk20a *g,
|
|||||||
|
|
||||||
/* Execute the voltage get request via PMU RPC. */
|
/* Execute the voltage get request via PMU RPC. */
|
||||||
status = volt_pmu_rpc_execute(g, &rpc_call);
|
status = volt_pmu_rpc_execute(g, &rpc_call);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"Error while executing volt_rail_get_voltage rpc");
|
"Error while executing volt_rail_get_voltage rpc");
|
||||||
return status;
|
return status;
|
||||||
@@ -184,12 +184,12 @@ u32 nvgpu_volt_rail_get_voltage_gp10x(struct gk20a *g,
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 nvgpu_volt_rail_get_voltage_gv10x(struct gk20a *g,
|
int nvgpu_volt_rail_get_voltage_gv10x(struct gk20a *g,
|
||||||
u8 volt_domain, u32 *pvoltage_uv)
|
u8 volt_domain, u32 *pvoltage_uv)
|
||||||
{
|
{
|
||||||
struct nvgpu_pmu *pmu = &g->pmu;
|
struct nvgpu_pmu *pmu = &g->pmu;
|
||||||
struct nv_pmu_rpc_struct_volt_volt_rail_get_voltage rpc;
|
struct nv_pmu_rpc_struct_volt_volt_rail_get_voltage rpc;
|
||||||
u32 status = 0;
|
int status = 0;
|
||||||
u8 rail_idx;
|
u8 rail_idx;
|
||||||
|
|
||||||
rail_idx = volt_rail_volt_domain_convert_to_idx(g, volt_domain);
|
rail_idx = volt_rail_volt_domain_convert_to_idx(g, volt_domain);
|
||||||
@@ -206,7 +206,7 @@ u32 nvgpu_volt_rail_get_voltage_gv10x(struct gk20a *g,
|
|||||||
rpc.rail_idx = rail_idx;
|
rpc.rail_idx = rail_idx;
|
||||||
|
|
||||||
PMU_RPC_EXECUTE_CPB(status, pmu, VOLT, VOLT_RAIL_GET_VOLTAGE, &rpc, 0);
|
PMU_RPC_EXECUTE_CPB(status, pmu, VOLT, VOLT_RAIL_GET_VOLTAGE, &rpc, 0);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g, "Failed to execute RPC status=0x%x",
|
nvgpu_err(g, "Failed to execute RPC status=0x%x",
|
||||||
status);
|
status);
|
||||||
}
|
}
|
||||||
@@ -216,12 +216,12 @@ u32 nvgpu_volt_rail_get_voltage_gv10x(struct gk20a *g,
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u32 volt_policy_set_voltage(struct gk20a *g, u8 client_id,
|
static int volt_policy_set_voltage(struct gk20a *g, u8 client_id,
|
||||||
struct ctrl_perf_volt_rail_list *prail_list)
|
struct ctrl_perf_volt_rail_list *prail_list)
|
||||||
{
|
{
|
||||||
struct nv_pmu_volt_rpc rpc_call = { 0 };
|
struct nv_pmu_volt_rpc rpc_call = { 0 };
|
||||||
struct obj_volt *pvolt = &g->perf_pmu.volt;
|
struct obj_volt *pvolt = &g->perf_pmu.volt;
|
||||||
u32 status = 0;
|
int status = 0;
|
||||||
u8 policy_idx = CTRL_VOLT_POLICY_INDEX_INVALID;
|
u8 policy_idx = CTRL_VOLT_POLICY_INDEX_INVALID;
|
||||||
u8 i = 0;
|
u8 i = 0;
|
||||||
|
|
||||||
@@ -260,7 +260,7 @@ static u32 volt_policy_set_voltage(struct gk20a *g, u8 client_id,
|
|||||||
|
|
||||||
/* Execute the voltage change request via PMU RPC. */
|
/* Execute the voltage change request via PMU RPC. */
|
||||||
status = volt_pmu_rpc_execute(g, &rpc_call);
|
status = volt_pmu_rpc_execute(g, &rpc_call);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"Error while executing VOLT_POLICY_SET_VOLTAGE RPC");
|
"Error while executing VOLT_POLICY_SET_VOLTAGE RPC");
|
||||||
}
|
}
|
||||||
@@ -269,7 +269,7 @@ exit:
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u32 volt_set_voltage_gv10x_rpc(struct gk20a *g, u8 client_id,
|
static int volt_set_voltage_gv10x_rpc(struct gk20a *g, u8 client_id,
|
||||||
struct ctrl_volt_volt_rail_list_v1 *prail_list)
|
struct ctrl_volt_volt_rail_list_v1 *prail_list)
|
||||||
{
|
{
|
||||||
struct nvgpu_pmu *pmu = &g->pmu;
|
struct nvgpu_pmu *pmu = &g->pmu;
|
||||||
@@ -281,7 +281,7 @@ static u32 volt_set_voltage_gv10x_rpc(struct gk20a *g, u8 client_id,
|
|||||||
rpc.rail_list = *prail_list;
|
rpc.rail_list = *prail_list;
|
||||||
|
|
||||||
PMU_RPC_EXECUTE_CPB(status, pmu, VOLT, VOLT_SET_VOLTAGE, &rpc, 0);
|
PMU_RPC_EXECUTE_CPB(status, pmu, VOLT, VOLT_SET_VOLTAGE, &rpc, 0);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g, "Failed to execute RPC status=0x%x",
|
nvgpu_err(g, "Failed to execute RPC status=0x%x",
|
||||||
status);
|
status);
|
||||||
}
|
}
|
||||||
@@ -289,7 +289,7 @@ static u32 volt_set_voltage_gv10x_rpc(struct gk20a *g, u8 client_id,
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 nvgpu_volt_set_voltage_gv10x(struct gk20a *g, u32 logic_voltage_uv,
|
int nvgpu_volt_set_voltage_gv10x(struct gk20a *g, u32 logic_voltage_uv,
|
||||||
u32 sram_voltage_uv)
|
u32 sram_voltage_uv)
|
||||||
{
|
{
|
||||||
int status = 0;
|
int status = 0;
|
||||||
@@ -308,7 +308,7 @@ u32 nvgpu_volt_set_voltage_gv10x(struct gk20a *g, u32 logic_voltage_uv,
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 nvgpu_volt_set_voltage_gp10x(struct gk20a *g, u32 logic_voltage_uv,
|
int nvgpu_volt_set_voltage_gp10x(struct gk20a *g, u32 logic_voltage_uv,
|
||||||
u32 sram_voltage_uv)
|
u32 sram_voltage_uv)
|
||||||
{
|
{
|
||||||
int status = 0;
|
int status = 0;
|
||||||
@@ -328,13 +328,13 @@ u32 nvgpu_volt_set_voltage_gp10x(struct gk20a *g, u32 logic_voltage_uv,
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 volt_set_voltage(struct gk20a *g, u32 logic_voltage_uv, u32 sram_voltage_uv)
|
int volt_set_voltage(struct gk20a *g, u32 logic_voltage_uv, u32 sram_voltage_uv)
|
||||||
{
|
{
|
||||||
return g->ops.pmu_ver.volt.volt_set_voltage(g,
|
return g->ops.pmu_ver.volt.volt_set_voltage(g,
|
||||||
logic_voltage_uv, sram_voltage_uv);
|
logic_voltage_uv, sram_voltage_uv);
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 volt_get_voltage(struct gk20a *g, u32 volt_domain, u32 *voltage_uv)
|
int volt_get_voltage(struct gk20a *g, u32 volt_domain, u32 *voltage_uv)
|
||||||
{
|
{
|
||||||
return g->ops.pmu_ver.volt.volt_get_voltage(g,
|
return g->ops.pmu_ver.volt.volt_get_voltage(g,
|
||||||
volt_domain, voltage_uv);
|
volt_domain, voltage_uv);
|
||||||
@@ -344,7 +344,7 @@ static int volt_policy_set_noiseaware_vmin(struct gk20a *g,
|
|||||||
struct ctrl_volt_volt_rail_list *prail_list)
|
struct ctrl_volt_volt_rail_list *prail_list)
|
||||||
{
|
{
|
||||||
struct nv_pmu_volt_rpc rpc_call = { 0 };
|
struct nv_pmu_volt_rpc rpc_call = { 0 };
|
||||||
u32 status = 0;
|
int status = 0;
|
||||||
|
|
||||||
/* Set RPC parameters. */
|
/* Set RPC parameters. */
|
||||||
rpc_call.function = NV_PMU_VOLT_RPC_ID_VOLT_RAIL_SET_NOISE_UNAWARE_VMIN;
|
rpc_call.function = NV_PMU_VOLT_RPC_ID_VOLT_RAIL_SET_NOISE_UNAWARE_VMIN;
|
||||||
@@ -355,7 +355,7 @@ static int volt_policy_set_noiseaware_vmin(struct gk20a *g,
|
|||||||
|
|
||||||
/* Execute the voltage change request via PMU RPC. */
|
/* Execute the voltage change request via PMU RPC. */
|
||||||
status = volt_pmu_rpc_execute(g, &rpc_call);
|
status = volt_pmu_rpc_execute(g, &rpc_call);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"Error while executing VOLT_POLICY_SET_VOLTAGE RPC");
|
"Error while executing VOLT_POLICY_SET_VOLTAGE RPC");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|||||||
@@ -24,23 +24,23 @@
|
|||||||
#define NVGPU_VOLT_PMU_H
|
#define NVGPU_VOLT_PMU_H
|
||||||
|
|
||||||
u32 volt_pmu_send_load_cmd_to_pmu(struct gk20a *g);
|
u32 volt_pmu_send_load_cmd_to_pmu(struct gk20a *g);
|
||||||
u32 volt_set_voltage(struct gk20a *g, u32 logic_voltage_uv,
|
int volt_set_voltage(struct gk20a *g, u32 logic_voltage_uv,
|
||||||
u32 sram_voltage_uv);
|
u32 sram_voltage_uv);
|
||||||
u32 volt_get_voltage(struct gk20a *g, u32 volt_domain, u32 *voltage_uv);
|
int volt_get_voltage(struct gk20a *g, u32 volt_domain, u32 *voltage_uv);
|
||||||
int volt_set_noiseaware_vmin(struct gk20a *g, u32 logic_voltage_uv,
|
int volt_set_noiseaware_vmin(struct gk20a *g, u32 logic_voltage_uv,
|
||||||
u32 sram_voltage_uv);
|
u32 sram_voltage_uv);
|
||||||
|
|
||||||
u32 nvgpu_volt_set_voltage_gp10x(struct gk20a *g, u32 logic_voltage_uv,
|
int nvgpu_volt_set_voltage_gp10x(struct gk20a *g, u32 logic_voltage_uv,
|
||||||
u32 sram_voltage_uv);
|
u32 sram_voltage_uv);
|
||||||
u32 nvgpu_volt_rail_get_voltage_gp10x(struct gk20a *g,
|
int nvgpu_volt_rail_get_voltage_gp10x(struct gk20a *g,
|
||||||
u8 volt_domain, u32 *pvoltage_uv);
|
u8 volt_domain, u32 *pvoltage_uv);
|
||||||
u32 nvgpu_volt_send_load_cmd_to_pmu_gp10x(struct gk20a *g);
|
int nvgpu_volt_send_load_cmd_to_pmu_gp10x(struct gk20a *g);
|
||||||
|
|
||||||
u32 nvgpu_volt_set_voltage_gv10x(struct gk20a *g, u32 logic_voltage_uv,
|
int nvgpu_volt_set_voltage_gv10x(struct gk20a *g, u32 logic_voltage_uv,
|
||||||
u32 sram_voltage_uv);
|
u32 sram_voltage_uv);
|
||||||
u32 nvgpu_volt_rail_get_voltage_gv10x(struct gk20a *g,
|
int nvgpu_volt_rail_get_voltage_gv10x(struct gk20a *g,
|
||||||
u8 volt_domain, u32 *pvoltage_uv);
|
u8 volt_domain, u32 *pvoltage_uv);
|
||||||
u32 nvgpu_volt_send_load_cmd_to_pmu_gv10x(struct gk20a *g);
|
int nvgpu_volt_send_load_cmd_to_pmu_gv10x(struct gk20a *g);
|
||||||
|
|
||||||
|
|
||||||
#endif /* NVGPU_VOLT_PMU_H */
|
#endif /* NVGPU_VOLT_PMU_H */
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ static int construct_volt_policy(struct gk20a *g,
|
|||||||
int status = 0;
|
int status = 0;
|
||||||
|
|
||||||
status = boardobj_construct_super(g, ppboardobj, size, pArgs);
|
status = boardobj_construct_super(g, ppboardobj, size, pArgs);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ static int construct_volt_policy_split_rail(struct gk20a *g,
|
|||||||
int status = 0;
|
int status = 0;
|
||||||
|
|
||||||
status = construct_volt_policy(g, ppboardobj, size, pArgs);
|
status = construct_volt_policy(g, ppboardobj, size, pArgs);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ static int construct_volt_policy_single_rail(struct gk20a *g,
|
|||||||
int status = 0;
|
int status = 0;
|
||||||
|
|
||||||
status = construct_volt_policy(g, ppboardobj, size, pArgs);
|
status = construct_volt_policy(g, ppboardobj, size, pArgs);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ static int volt_policy_pmu_data_init_single_rail(struct gk20a *g,
|
|||||||
struct nv_pmu_volt_volt_policy_sr_boardobj_set *pset;
|
struct nv_pmu_volt_volt_policy_sr_boardobj_set *pset;
|
||||||
|
|
||||||
status = volt_policy_pmu_data_init_super(g, pboardobj, ppmudata);
|
status = volt_policy_pmu_data_init_super(g, pboardobj, ppmudata);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,7 +146,7 @@ static int volt_policy_pmu_data_init_sr_multi_step(struct gk20a *g,
|
|||||||
struct nv_pmu_volt_volt_policy_sr_multi_step_boardobj_set *pset;
|
struct nv_pmu_volt_volt_policy_sr_multi_step_boardobj_set *pset;
|
||||||
|
|
||||||
status = volt_policy_pmu_data_init_single_rail(g, pboardobj, ppmudata);
|
status = volt_policy_pmu_data_init_single_rail(g, pboardobj, ppmudata);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,7 +172,7 @@ static int volt_construct_volt_policy_single_rail_multi_step(struct gk20a *g,
|
|||||||
int status = 0;
|
int status = 0;
|
||||||
|
|
||||||
status = construct_volt_policy_single_rail(g, ppboardobj, size, pargs);
|
status = construct_volt_policy_single_rail(g, ppboardobj, size, pargs);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,7 +200,7 @@ static int volt_policy_pmu_data_init_split_rail(struct gk20a *g,
|
|||||||
struct nv_pmu_volt_volt_policy_splt_r_boardobj_set *pset;
|
struct nv_pmu_volt_volt_policy_splt_r_boardobj_set *pset;
|
||||||
|
|
||||||
status = volt_policy_pmu_data_init_super(g, pboardobj, ppmudata);
|
status = volt_policy_pmu_data_init_super(g, pboardobj, ppmudata);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -226,7 +226,7 @@ static int volt_construct_volt_policy_split_rail_single_step(struct gk20a *g,
|
|||||||
int status = 0;
|
int status = 0;
|
||||||
|
|
||||||
status = construct_volt_policy_split_rail(g, ppboardobj, size, pargs);
|
status = construct_volt_policy_split_rail(g, ppboardobj, size, pargs);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,7 +247,7 @@ static struct voltage_policy *volt_volt_policy_construct(struct gk20a *g, void *
|
|||||||
&pboard_obj,
|
&pboard_obj,
|
||||||
sizeof(struct voltage_policy_split_rail_single_step),
|
sizeof(struct voltage_policy_split_rail_single_step),
|
||||||
pargs);
|
pargs);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"Could not allocate memory for voltage_policy");
|
"Could not allocate memory for voltage_policy");
|
||||||
pboard_obj = NULL;
|
pboard_obj = NULL;
|
||||||
@@ -258,7 +258,7 @@ static struct voltage_policy *volt_volt_policy_construct(struct gk20a *g, void *
|
|||||||
&pboard_obj,
|
&pboard_obj,
|
||||||
sizeof(struct voltage_policy_single_rail_multi_step),
|
sizeof(struct voltage_policy_single_rail_multi_step),
|
||||||
pargs);
|
pargs);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"Could not allocate memory for voltage_policy");
|
"Could not allocate memory for voltage_policy");
|
||||||
pboard_obj = NULL;
|
pboard_obj = NULL;
|
||||||
@@ -394,7 +394,7 @@ static int volt_get_volt_policy_table(struct gk20a *g,
|
|||||||
status = boardobjgrp_objinsert(
|
status = boardobjgrp_objinsert(
|
||||||
&pvolt_policy_metadata->volt_policies.super,
|
&pvolt_policy_metadata->volt_policies.super,
|
||||||
(struct boardobj *)ppolicy, i);
|
(struct boardobj *)ppolicy, i);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"could not add volt_policy for entry %d into boardobjgrp ",
|
"could not add volt_policy for entry %d into boardobjgrp ",
|
||||||
i);
|
i);
|
||||||
@@ -457,7 +457,7 @@ static int _volt_policy_grp_pmudatainit_super(struct gk20a *g,
|
|||||||
int status = 0;
|
int status = 0;
|
||||||
|
|
||||||
status = boardobjgrp_pmudatainit_e32(g, pboardobjgrp, pboardobjgrppmu);
|
status = boardobjgrp_pmudatainit_e32(g, pboardobjgrp, pboardobjgrppmu);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"error updating pmu boardobjgrp for volt policy 0x%x",
|
"error updating pmu boardobjgrp for volt policy 0x%x",
|
||||||
status);
|
status);
|
||||||
@@ -499,7 +499,7 @@ int volt_policy_sw_setup(struct gk20a *g)
|
|||||||
|
|
||||||
status = boardobjgrpconstruct_e32(g,
|
status = boardobjgrpconstruct_e32(g,
|
||||||
&g->perf_pmu.volt.volt_policy_metadata.volt_policies);
|
&g->perf_pmu.volt.volt_policy_metadata.volt_policies);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"error creating boardobjgrp for volt rail, status - 0x%x",
|
"error creating boardobjgrp for volt rail, status - 0x%x",
|
||||||
status);
|
status);
|
||||||
@@ -516,7 +516,7 @@ int volt_policy_sw_setup(struct gk20a *g)
|
|||||||
/* Obtain Voltage Rail Table from VBIOS */
|
/* Obtain Voltage Rail Table from VBIOS */
|
||||||
status = volt_get_volt_policy_table(g, &g->perf_pmu.volt.
|
status = volt_get_volt_policy_table(g, &g->perf_pmu.volt.
|
||||||
volt_policy_metadata);
|
volt_policy_metadata);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -525,7 +525,7 @@ int volt_policy_sw_setup(struct gk20a *g)
|
|||||||
|
|
||||||
status = BOARDOBJGRP_PMU_CMD_GRP_SET_CONSTRUCT(g, pboardobjgrp,
|
status = BOARDOBJGRP_PMU_CMD_GRP_SET_CONSTRUCT(g, pboardobjgrp,
|
||||||
volt, VOLT, volt_policy, VOLT_POLICY);
|
volt, VOLT, volt_policy, VOLT_POLICY);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"error constructing PMU_BOARDOBJ_CMD_GRP_SET interface - 0x%x",
|
"error constructing PMU_BOARDOBJ_CMD_GRP_SET interface - 0x%x",
|
||||||
status);
|
status);
|
||||||
@@ -535,7 +535,7 @@ int volt_policy_sw_setup(struct gk20a *g)
|
|||||||
status = BOARDOBJGRP_PMU_CMD_GRP_GET_STATUS_CONSTRUCT(g,
|
status = BOARDOBJGRP_PMU_CMD_GRP_GET_STATUS_CONSTRUCT(g,
|
||||||
&g->perf_pmu.volt.volt_policy_metadata.volt_policies.super,
|
&g->perf_pmu.volt.volt_policy_metadata.volt_policies.super,
|
||||||
volt, VOLT, volt_policy, VOLT_POLICY);
|
volt, VOLT, volt_policy, VOLT_POLICY);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"error constructing PMU_BOARDOBJ_CMD_GRP_SET interface - 0x%x",
|
"error constructing PMU_BOARDOBJ_CMD_GRP_SET interface - 0x%x",
|
||||||
status);
|
status);
|
||||||
|
|||||||
@@ -53,10 +53,10 @@ u8 volt_rail_volt_domain_convert_to_idx(struct gk20a *g, u8 volt_domain)
|
|||||||
return CTRL_BOARDOBJ_IDX_INVALID;
|
return CTRL_BOARDOBJ_IDX_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 volt_rail_volt_dev_register(struct gk20a *g, struct voltage_rail
|
int volt_rail_volt_dev_register(struct gk20a *g, struct voltage_rail
|
||||||
*pvolt_rail, u8 volt_dev_idx, u8 operation_type)
|
*pvolt_rail, u8 volt_dev_idx, u8 operation_type)
|
||||||
{
|
{
|
||||||
u32 status = 0;
|
int status = 0;
|
||||||
|
|
||||||
if (operation_type == CTRL_VOLT_DEVICE_OPERATION_TYPE_DEFAULT) {
|
if (operation_type == CTRL_VOLT_DEVICE_OPERATION_TYPE_DEFAULT) {
|
||||||
if (pvolt_rail->volt_dev_idx_default ==
|
if (pvolt_rail->volt_dev_idx_default ==
|
||||||
@@ -90,17 +90,17 @@ u32 volt_rail_volt_dev_register(struct gk20a *g, struct voltage_rail
|
|||||||
volt_dev_idx);
|
volt_dev_idx);
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g, "Failed to register VOLTAGE_DEVICE");
|
nvgpu_err(g, "Failed to register VOLTAGE_DEVICE");
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
static u32 volt_rail_state_init(struct gk20a *g,
|
static int volt_rail_state_init(struct gk20a *g,
|
||||||
struct voltage_rail *pvolt_rail)
|
struct voltage_rail *pvolt_rail)
|
||||||
{
|
{
|
||||||
u32 status = 0;
|
int status = 0;
|
||||||
u32 i;
|
u32 i;
|
||||||
|
|
||||||
pvolt_rail->volt_dev_idx_default = CTRL_BOARDOBJ_IDX_INVALID;
|
pvolt_rail->volt_dev_idx_default = CTRL_BOARDOBJ_IDX_INVALID;
|
||||||
@@ -122,7 +122,7 @@ static u32 volt_rail_state_init(struct gk20a *g,
|
|||||||
NV_PMU_PERF_RPC_VFE_EQU_MONITOR_COUNT_MAX;
|
NV_PMU_PERF_RPC_VFE_EQU_MONITOR_COUNT_MAX;
|
||||||
|
|
||||||
status = boardobjgrpmask_e32_init(&pvolt_rail->volt_dev_mask, NULL);
|
status = boardobjgrpmask_e32_init(&pvolt_rail->volt_dev_mask, NULL);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"Failed to initialize BOARDOBJGRPMASK of VOLTAGE_DEVICEs");
|
"Failed to initialize BOARDOBJGRPMASK of VOLTAGE_DEVICEs");
|
||||||
}
|
}
|
||||||
@@ -141,7 +141,7 @@ static int volt_rail_init_pmudata_super(struct gk20a *g,
|
|||||||
nvgpu_log_info(g, " ");
|
nvgpu_log_info(g, " ");
|
||||||
|
|
||||||
status = boardobj_pmudatainit_super(g, board_obj_ptr, ppmudata);
|
status = boardobj_pmudatainit_super(g, board_obj_ptr, ppmudata);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,7 +170,7 @@ static int volt_rail_init_pmudata_super(struct gk20a *g,
|
|||||||
status = boardobjgrpmask_export(&prail->volt_dev_mask.super,
|
status = boardobjgrpmask_export(&prail->volt_dev_mask.super,
|
||||||
prail->volt_dev_mask.super.bitcount,
|
prail->volt_dev_mask.super.bitcount,
|
||||||
&rail_pmu_data->volt_dev_mask.super);
|
&rail_pmu_data->volt_dev_mask.super);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"Failed to export BOARDOBJGRPMASK of VOLTAGE_DEVICEs");
|
"Failed to export BOARDOBJGRPMASK of VOLTAGE_DEVICEs");
|
||||||
}
|
}
|
||||||
@@ -190,7 +190,7 @@ static struct voltage_rail *construct_volt_rail(struct gk20a *g, void *pargs)
|
|||||||
nvgpu_log_info(g, " ");
|
nvgpu_log_info(g, " ");
|
||||||
status = boardobj_construct_super(g, &board_obj_ptr,
|
status = boardobj_construct_super(g, &board_obj_ptr,
|
||||||
sizeof(struct voltage_rail), pargs);
|
sizeof(struct voltage_rail), pargs);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -424,7 +424,7 @@ int volt_rail_sw_setup(struct gk20a *g)
|
|||||||
|
|
||||||
status = boardobjgrpconstruct_e32(g,
|
status = boardobjgrpconstruct_e32(g,
|
||||||
&g->perf_pmu.volt.volt_rail_metadata.volt_rails);
|
&g->perf_pmu.volt.volt_rail_metadata.volt_rails);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"error creating boardobjgrp for volt rail, status - 0x%x",
|
"error creating boardobjgrp for volt rail, status - 0x%x",
|
||||||
status);
|
status);
|
||||||
@@ -442,7 +442,7 @@ int volt_rail_sw_setup(struct gk20a *g)
|
|||||||
/* Obtain Voltage Rail Table from VBIOS */
|
/* Obtain Voltage Rail Table from VBIOS */
|
||||||
status = volt_get_volt_rail_table(g, &g->perf_pmu.volt.
|
status = volt_get_volt_rail_table(g, &g->perf_pmu.volt.
|
||||||
volt_rail_metadata);
|
volt_rail_metadata);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -451,7 +451,7 @@ int volt_rail_sw_setup(struct gk20a *g)
|
|||||||
|
|
||||||
status = BOARDOBJGRP_PMU_CMD_GRP_SET_CONSTRUCT(g, pboardobjgrp,
|
status = BOARDOBJGRP_PMU_CMD_GRP_SET_CONSTRUCT(g, pboardobjgrp,
|
||||||
volt, VOLT, volt_rail, VOLT_RAIL);
|
volt, VOLT, volt_rail, VOLT_RAIL);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"error constructing PMU_BOARDOBJ_CMD_GRP_SET interface - 0x%x",
|
"error constructing PMU_BOARDOBJ_CMD_GRP_SET interface - 0x%x",
|
||||||
status);
|
status);
|
||||||
@@ -461,7 +461,7 @@ int volt_rail_sw_setup(struct gk20a *g)
|
|||||||
status = BOARDOBJGRP_PMU_CMD_GRP_GET_STATUS_CONSTRUCT(g,
|
status = BOARDOBJGRP_PMU_CMD_GRP_GET_STATUS_CONSTRUCT(g,
|
||||||
&g->perf_pmu.volt.volt_rail_metadata.volt_rails.super,
|
&g->perf_pmu.volt.volt_rail_metadata.volt_rails.super,
|
||||||
volt, VOLT, volt_rail, VOLT_RAIL);
|
volt, VOLT, volt_rail, VOLT_RAIL);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"error constructing PMU_BOARDOBJ_CMD_GRP_SET interface - 0x%x",
|
"error constructing PMU_BOARDOBJ_CMD_GRP_SET interface - 0x%x",
|
||||||
status);
|
status);
|
||||||
@@ -473,7 +473,7 @@ int volt_rail_sw_setup(struct gk20a *g)
|
|||||||
volt_rails.super),
|
volt_rails.super),
|
||||||
struct voltage_rail *, pvolt_rail, i) {
|
struct voltage_rail *, pvolt_rail, i) {
|
||||||
status = volt_rail_state_init(g, pvolt_rail);
|
status = volt_rail_state_init(g, pvolt_rail);
|
||||||
if (status) {
|
if (status != 0) {
|
||||||
nvgpu_err(g,
|
nvgpu_err(g,
|
||||||
"Failure while executing RAIL's state init railIdx = %d",
|
"Failure while executing RAIL's state init railIdx = %d",
|
||||||
i);
|
i);
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ struct voltage_rail_metadata {
|
|||||||
u8 volt_rail_vbios_volt_domain_convert_to_internal
|
u8 volt_rail_vbios_volt_domain_convert_to_internal
|
||||||
(struct gk20a *g, u8 vbios_volt_domain);
|
(struct gk20a *g, u8 vbios_volt_domain);
|
||||||
|
|
||||||
u32 volt_rail_volt_dev_register(struct gk20a *g, struct voltage_rail
|
int volt_rail_volt_dev_register(struct gk20a *g, struct voltage_rail
|
||||||
*pvolt_rail, u8 volt_dev_idx, u8 operation_type);
|
*pvolt_rail, u8 volt_dev_idx, u8 operation_type);
|
||||||
|
|
||||||
u8 volt_rail_volt_domain_convert_to_idx(struct gk20a *g, u8 volt_domain);
|
u8 volt_rail_volt_domain_convert_to_idx(struct gk20a *g, u8 volt_domain);
|
||||||
|
|||||||
Reference in New Issue
Block a user