diff options
Diffstat (limited to 'drivers/gpu/nvgpu/volt/volt_rail.h')
-rw-r--r-- | drivers/gpu/nvgpu/volt/volt_rail.h | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/volt/volt_rail.h b/drivers/gpu/nvgpu/volt/volt_rail.h new file mode 100644 index 00000000..8b930010 --- /dev/null +++ b/drivers/gpu/nvgpu/volt/volt_rail.h | |||
@@ -0,0 +1,79 @@ | |||
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 | |||
15 | #ifndef _VOLT_RAIL_H_ | ||
16 | #define _VOLT_RAIL_H_ | ||
17 | |||
18 | #include "boardobj/boardobj.h" | ||
19 | #include "boardobj/boardobjgrp.h" | ||
20 | |||
21 | #define CTRL_VOLT_RAIL_VOLT_DELTA_MAX_ENTRIES 0x04 | ||
22 | #define CTRL_PMGR_PWR_EQUATION_INDEX_INVALID 0xFF | ||
23 | |||
24 | #define VOLT_GET_VOLT_RAIL(pvolt, rail_idx) \ | ||
25 | ((struct voltage_rail *)BOARDOBJGRP_OBJ_GET_BY_IDX( \ | ||
26 | &((pvolt)->volt_rail_metadata.volt_rails.super), (rail_idx))) | ||
27 | |||
28 | #define VOLT_RAIL_INDEX_IS_VALID(pvolt, rail_idx) \ | ||
29 | (boardobjgrp_idxisvalid( \ | ||
30 | &((pvolt)->volt_rail_metadata.volt_rails.super), (rail_idx))) | ||
31 | |||
32 | #define VOLT_RAIL_VOLT_3X_SUPPORTED(pvolt) \ | ||
33 | (!BOARDOBJGRP_IS_EMPTY(&((pvolt)->volt_rail_metadata.volt_rails.super))) | ||
34 | |||
35 | /*! | ||
36 | * extends boardobj providing attributes common to all voltage_rails. | ||
37 | */ | ||
38 | struct voltage_rail { | ||
39 | struct boardobj super; | ||
40 | u32 boot_voltage_uv; | ||
41 | u8 rel_limit_vfe_equ_idx; | ||
42 | u8 alt_rel_limit_vfe_equ_idx; | ||
43 | u8 ov_limit_vfe_equ_idx; | ||
44 | u8 pwr_equ_idx; | ||
45 | u8 volt_dev_idx_default; | ||
46 | u8 boot_volt_vfe_equ_idx; | ||
47 | u8 vmin_limit_vfe_equ_idx; | ||
48 | u8 volt_margin_limit_vfe_equ_idx; | ||
49 | u32 volt_margin_limit_vfe_equ_mon_handle; | ||
50 | u32 rel_limit_vfe_equ_mon_handle; | ||
51 | u32 alt_rel_limit_vfe_equ_mon_handle; | ||
52 | u32 ov_limit_vfe_equ_mon_handle; | ||
53 | struct boardobjgrpmask_e32 volt_dev_mask; | ||
54 | s32 volt_delta_uv[CTRL_VOLT_RAIL_VOLT_DELTA_MAX_ENTRIES]; | ||
55 | }; | ||
56 | |||
57 | /*! | ||
58 | * metadata of voltage rail functionality. | ||
59 | */ | ||
60 | struct voltage_rail_metadata { | ||
61 | u8 volt_domain_hal; | ||
62 | u8 pct_delta; | ||
63 | u32 ext_rel_delta_uv[CTRL_VOLT_RAIL_VOLT_DELTA_MAX_ENTRIES]; | ||
64 | u8 logic_rail_idx; | ||
65 | u8 sram_rail_idx; | ||
66 | struct boardobjgrp_e32 volt_rails; | ||
67 | }; | ||
68 | |||
69 | u8 volt_rail_vbios_volt_domain_convert_to_internal | ||
70 | (struct gk20a *g, u8 vbios_volt_domain); | ||
71 | |||
72 | u32 volt_rail_volt_dev_register(struct gk20a *g, struct voltage_rail | ||
73 | *pvolt_rail, u8 volt_dev_idx, u8 operation_type); | ||
74 | |||
75 | u8 volt_rail_volt_domain_convert_to_idx(struct gk20a *g, u8 volt_domain); | ||
76 | |||
77 | u32 volt_rail_sw_setup(struct gk20a *g); | ||
78 | u32 volt_rail_pmu_setup(struct gk20a *g); | ||
79 | #endif | ||