2 * Copyright 2019 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 __SMU_V11_0_H__
24 #define __SMU_V11_0_H__
26 #include "amdgpu_smu.h"
29 #define MP0_Public 0x03800000
30 #define MP0_SRAM 0x03900000
31 #define MP1_Public 0x03b00000
32 #define MP1_SRAM 0x03c00004
33 #define MP1_SMC_SIZE 0x40000
36 #define smnMP1_FIRMWARE_FLAGS 0x3010024
37 #define smnMP0_FW_INTF 0x30101c0
38 #define smnMP1_PUB_CTRL 0x3010b14
40 #define TEMP_RANGE_MIN (0)
41 #define TEMP_RANGE_MAX (80 * 1000)
43 #define SMU11_TOOL_SIZE 0x19000
45 #define CLK_MAP(clk, index) \
48 #define FEA_MAP(fea) \
49 [SMU_FEATURE_##fea##_BIT] = FEATURE_##fea##_BIT
51 #define TAB_MAP(tab) \
52 [SMU_TABLE_##tab] = TABLE_##tab
54 #define PWR_MAP(tab) \
55 [SMU_POWER_SOURCE_##tab] = POWER_SOURCE_##tab
57 #define WORKLOAD_MAP(profile, workload) \
60 struct smu_11_0_max_sustainable_clocks {
61 uint32_t display_clock;
69 struct smu_11_0_dpm_table {
70 uint32_t min; /* MHz */
71 uint32_t max; /* MHz */
74 struct smu_11_0_dpm_tables {
75 struct smu_11_0_dpm_table soc_table;
76 struct smu_11_0_dpm_table gfx_table;
77 struct smu_11_0_dpm_table uclk_table;
78 struct smu_11_0_dpm_table eclk_table;
79 struct smu_11_0_dpm_table vclk_table;
80 struct smu_11_0_dpm_table dclk_table;
81 struct smu_11_0_dpm_table dcef_table;
82 struct smu_11_0_dpm_table pixel_table;
83 struct smu_11_0_dpm_table display_table;
84 struct smu_11_0_dpm_table phy_table;
85 struct smu_11_0_dpm_table fclk_table;
88 struct smu_11_0_dpm_context {
89 struct smu_11_0_dpm_tables dpm_tables;
90 uint32_t workload_policy_mask;
91 uint32_t dcef_min_ds_clk;
94 enum smu_11_0_power_state {
95 SMU_11_0_POWER_STATE__D0 = 0,
96 SMU_11_0_POWER_STATE__D1,
97 SMU_11_0_POWER_STATE__D3, /* Sleep*/
98 SMU_11_0_POWER_STATE__D4, /* Hibernate*/
99 SMU_11_0_POWER_STATE__D5, /* Power off*/
102 struct smu_11_0_power_context {
103 uint32_t power_source;
104 uint8_t in_power_limit_boost_mode;
105 enum smu_11_0_power_state power_state;
108 enum smu_v11_0_baco_seq {
116 void smu_v11_0_set_smu_funcs(struct smu_context *smu);