2 * Copyright 2017 Advanced Micro Devices, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
23 #ifndef _VEGA12_SMUMANAGER_H_
24 #define _VEGA12_SMUMANAGER_H_
27 #include "vega12/smu9_driver_if.h"
28 #include "vega12_hwmgr.h"
30 struct smu_table_entry
{
35 struct amdgpu_bo
*handle
;
38 struct smu_table_array
{
39 struct smu_table_entry entry
[TABLE_COUNT
];
42 struct vega12_smumgr
{
43 struct smu_table_array smu_tables
;
46 #define SMU_FEATURES_LOW_MASK 0x00000000FFFFFFFF
47 #define SMU_FEATURES_LOW_SHIFT 0
48 #define SMU_FEATURES_HIGH_MASK 0xFFFFFFFF00000000
49 #define SMU_FEATURES_HIGH_SHIFT 32
51 int vega12_copy_table_from_smc(struct pp_hwmgr
*hwmgr
,
52 uint8_t *table
, int16_t table_id
);
53 int vega12_copy_table_to_smc(struct pp_hwmgr
*hwmgr
,
54 uint8_t *table
, int16_t table_id
);
55 int vega12_enable_smc_features(struct pp_hwmgr
*hwmgr
,
56 bool enable
, uint64_t feature_mask
);
57 int vega12_get_enabled_smc_features(struct pp_hwmgr
*hwmgr
,
58 uint64_t *features_enabled
);