Files
linux-nvgpu/drivers/gpu/nvgpu/include/nvgpu/pmu/pmuif/ctrlboardobj.h
Sagar Kamble bcbc87dc2e gpu: nvgpu: move pmu interface headers to include/nvgpu/pmu
Interface header files for PMU features are now moved under PMU header
files directory include/nvgpu/pmu. And fix bulk of coding style issues.
Update header file names and guards.

JIRA NVGPU-1971

Change-Id: Idf53fc09d8928d1b0a1cd16eef886de010dae06b
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2093006
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-13 12:33:52 -07:00

92 lines
2.8 KiB
C

/*
* Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef NVGPU_PMUIF_CTRLBOARDOBJ_H
#define NVGPU_PMUIF_CTRLBOARDOBJ_H
#include <nvgpu/types.h>
struct ctrl_boardobj {
u8 type;
};
#define CTRL_BOARDOBJGRP_TYPE_INVALID 0x00U
#define CTRL_BOARDOBJGRP_TYPE_E32 0x01U
#define CTRL_BOARDOBJGRP_TYPE_E255 0x02U
#define CTRL_BOARDOBJGRP_E32_MAX_OBJECTS 32U
#define CTRL_BOARDOBJGRP_E255_MAX_OBJECTS 255U
#define CTRL_BOARDOBJ_MAX_BOARD_OBJECTS \
CTRL_BOARDOBJGRP_E32_MAX_OBJECTS
#define CTRL_BOARDOBJ_IDX_INVALID 255U
#define CTRL_BOARDOBJGRP_MASK_MASK_ELEMENT_BIT_SIZE 32U
#define CTRL_BOARDOBJGRP_MASK_MASK_ELEMENT_INDEX(_bit) \
((_bit) / CTRL_BOARDOBJGRP_MASK_MASK_ELEMENT_BIT_SIZE)
#define CTRL_BOARDOBJGRP_MASK_MASK_ELEMENT_OFFSET(_bit) \
((_bit) % CTRL_BOARDOBJGRP_MASK_MASK_ELEMENT_BIT_SIZE)
#define CTRL_BOARDOBJGRP_MASK_DATA_SIZE(_bits) \
(CTRL_BOARDOBJGRP_MASK_MASK_ELEMENT_INDEX((_bits) - 1U) + 1U)
#define CTRL_BOARDOBJGRP_MASK_ARRAY_START_SIZE 1U
#define CTRL_BOARDOBJGRP_MASK_ARRAY_EXTENSION_SIZE(_bits) \
(CTRL_BOARDOBJGRP_MASK_DATA_SIZE(_bits) - \
CTRL_BOARDOBJGRP_MASK_ARRAY_START_SIZE)
struct ctrl_boardobjgrp_mask {
u32 data[1];
};
struct ctrl_boardobjgrp_mask_e32 {
struct ctrl_boardobjgrp_mask super;
};
struct ctrl_boardobjgrp_mask_e255 {
struct ctrl_boardobjgrp_mask super;
u32 data_e255[7];
};
struct ctrl_boardobjgrp_super {
struct ctrl_boardobjgrp_mask obj_mask;
};
struct ctrl_boardobjgrp_e32 {
struct ctrl_boardobjgrp_mask_e32 obj_mask;
};
struct CTRL_boardobjgrp_e255 {
struct ctrl_boardobjgrp_mask_e255 obj_mask;
};
struct ctrl_boardobjgrp {
u32 obj_mask;
};
#endif /* NVGPU_PMUIF_CTRLBOARDOBJ_H */