|
32 | 32 |
|
33 | 33 | #include "pmc.h"
|
34 | 34 |
|
35 |
| -/* SMU communication registers */ |
36 |
| -#define AMD_PMC_REGISTER_RESPONSE 0x980 |
37 |
| -#define AMD_PMC_REGISTER_ARGUMENT 0x9BC |
38 |
| - |
39 |
| -/* PMC Scratch Registers */ |
40 |
| -#define AMD_PMC_SCRATCH_REG_CZN 0x94 |
41 |
| -#define AMD_PMC_SCRATCH_REG_YC 0xD14 |
42 |
| -#define AMD_PMC_SCRATCH_REG_1AH 0xF14 |
43 |
| - |
44 |
| -/* STB Registers */ |
45 |
| -#define AMD_PMC_STB_S2IDLE_PREPARE 0xC6000001 |
46 |
| -#define AMD_PMC_STB_S2IDLE_RESTORE 0xC6000002 |
47 |
| -#define AMD_PMC_STB_S2IDLE_CHECK 0xC6000003 |
48 |
| - |
49 |
| -/* Base address of SMU for mapping physical address to virtual address */ |
50 |
| -#define AMD_PMC_MAPPING_SIZE 0x01000 |
51 |
| -#define AMD_PMC_BASE_ADDR_OFFSET 0x10000 |
52 |
| -#define AMD_PMC_BASE_ADDR_LO 0x13B102E8 |
53 |
| -#define AMD_PMC_BASE_ADDR_HI 0x13B102EC |
54 |
| -#define AMD_PMC_BASE_ADDR_LO_MASK GENMASK(15, 0) |
55 |
| -#define AMD_PMC_BASE_ADDR_HI_MASK GENMASK(31, 20) |
56 |
| - |
57 |
| -/* SMU Response Codes */ |
58 |
| -#define AMD_PMC_RESULT_OK 0x01 |
59 |
| -#define AMD_PMC_RESULT_CMD_REJECT_BUSY 0xFC |
60 |
| -#define AMD_PMC_RESULT_CMD_REJECT_PREREQ 0xFD |
61 |
| -#define AMD_PMC_RESULT_CMD_UNKNOWN 0xFE |
62 |
| -#define AMD_PMC_RESULT_FAILED 0xFF |
63 |
| - |
64 |
| -/* FCH SSC Registers */ |
65 |
| -#define FCH_S0I3_ENTRY_TIME_L_OFFSET 0x30 |
66 |
| -#define FCH_S0I3_ENTRY_TIME_H_OFFSET 0x34 |
67 |
| -#define FCH_S0I3_EXIT_TIME_L_OFFSET 0x38 |
68 |
| -#define FCH_S0I3_EXIT_TIME_H_OFFSET 0x3C |
69 |
| -#define FCH_SSC_MAPPING_SIZE 0x800 |
70 |
| -#define FCH_BASE_PHY_ADDR_LOW 0xFED81100 |
71 |
| -#define FCH_BASE_PHY_ADDR_HIGH 0x00000000 |
72 |
| - |
73 |
| -/* SMU Message Definations */ |
74 |
| -#define SMU_MSG_GETSMUVERSION 0x02 |
75 |
| -#define SMU_MSG_LOG_GETDRAM_ADDR_HI 0x04 |
76 |
| -#define SMU_MSG_LOG_GETDRAM_ADDR_LO 0x05 |
77 |
| -#define SMU_MSG_LOG_START 0x06 |
78 |
| -#define SMU_MSG_LOG_RESET 0x07 |
79 |
| -#define SMU_MSG_LOG_DUMP_DATA 0x08 |
80 |
| -#define SMU_MSG_GET_SUP_CONSTRAINTS 0x09 |
81 |
| - |
82 |
| -#define PMC_MSG_DELAY_MIN_US 50 |
83 |
| -#define RESPONSE_REGISTER_LOOP_MAX 20000 |
84 |
| - |
85 |
| -#define DELAY_MIN_US 2000 |
86 |
| -#define DELAY_MAX_US 3000 |
87 |
| - |
88 |
| -enum amd_pmc_def { |
89 |
| - MSG_TEST = 0x01, |
90 |
| - MSG_OS_HINT_PCO, |
91 |
| - MSG_OS_HINT_RN, |
92 |
| -}; |
93 |
| - |
94 |
| -struct amd_pmc_bit_map { |
95 |
| - const char *name; |
96 |
| - u32 bit_mask; |
97 |
| -}; |
98 |
| - |
99 | 35 | static const struct amd_pmc_bit_map soc15_ip_blk_v2[] = {
|
100 | 36 | {"DISPLAY", BIT(0)},
|
101 | 37 | {"CPU", BIT(1)},
|
@@ -165,23 +101,6 @@ static inline void amd_pmc_reg_write(struct amd_pmc_dev *dev, int reg_offset, u3
|
165 | 101 | iowrite32(val, dev->regbase + reg_offset);
|
166 | 102 | }
|
167 | 103 |
|
168 |
| -struct smu_metrics { |
169 |
| - u32 table_version; |
170 |
| - u32 hint_count; |
171 |
| - u32 s0i3_last_entry_status; |
172 |
| - u32 timein_s0i2; |
173 |
| - u64 timeentering_s0i3_lastcapture; |
174 |
| - u64 timeentering_s0i3_totaltime; |
175 |
| - u64 timeto_resume_to_os_lastcapture; |
176 |
| - u64 timeto_resume_to_os_totaltime; |
177 |
| - u64 timein_s0i3_lastcapture; |
178 |
| - u64 timein_s0i3_totaltime; |
179 |
| - u64 timein_swdrips_lastcapture; |
180 |
| - u64 timein_swdrips_totaltime; |
181 |
| - u64 timecondition_notmet_lastcapture[32]; |
182 |
| - u64 timecondition_notmet_totaltime[32]; |
183 |
| -} __packed; |
184 |
| - |
185 | 104 | static void amd_pmc_get_ip_info(struct amd_pmc_dev *dev)
|
186 | 105 | {
|
187 | 106 | switch (dev->cpu_id) {
|
|
0 commit comments