|
4 | 4 | AMD HSMP interface |
5 | 5 | ============================================ |
6 | 6 |
|
7 | | -Newer Fam19h EPYC server line of processors from AMD support system |
8 | | -management functionality via HSMP (Host System Management Port). |
| 7 | +Newer Fam19h(model 0x00-0x1f, 0x30-0x3f, 0x90-0x9f, 0xa0-0xaf), |
| 8 | +Fam1Ah(model 0x00-0x1f) EPYC server line of processors from AMD support |
| 9 | +system management functionality via HSMP (Host System Management Port). |
9 | 10 |
|
10 | 11 | The Host System Management Port (HSMP) is an interface to provide |
11 | 12 | OS-level software with access to system management functions via a |
12 | 13 | set of mailbox registers. |
13 | 14 |
|
14 | 15 | More details on the interface can be found in chapter |
15 | 16 | "7 Host System Management Port (HSMP)" of the family/model PPR |
16 | | -Eg: https://www.amd.com/system/files/TechDocs/55898_B1_pub_0.50.zip |
| 17 | +Eg: https://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/programmer-references/55898_B1_pub_0_50.zip |
17 | 18 |
|
18 | | -HSMP interface is supported on EPYC server CPU models only. |
| 19 | + |
| 20 | +HSMP interface is supported on EPYC line of server CPUs and MI300A (APU). |
19 | 21 |
|
20 | 22 |
|
21 | 23 | HSMP device |
22 | 24 | ============================================ |
23 | 25 |
|
24 | | -amd_hsmp driver under the drivers/platforms/x86/ creates miscdevice |
25 | | -/dev/hsmp to let user space programs run hsmp mailbox commands. |
| 26 | +amd_hsmp driver under drivers/platforms/x86/amd/hsmp/ has separate driver files |
| 27 | +for ACPI object based probing, platform device based probing and for the common |
| 28 | +code for these two drivers. |
| 29 | + |
| 30 | +Kconfig option CONFIG_AMD_HSMP_PLAT compiles plat.c and creates amd_hsmp.ko. |
| 31 | +Kconfig option CONFIG_AMD_HSMP_ACPI compiles acpi.c and creates hsmp_acpi.ko. |
| 32 | +Selecting any of these two configs automatically selects CONFIG_AMD_HSMP. This |
| 33 | +compiles common code hsmp.c and creates hsmp_common.ko module. |
| 34 | + |
| 35 | +Both the ACPI and plat drivers create the miscdevice /dev/hsmp to let |
| 36 | +user space programs run hsmp mailbox commands. |
| 37 | + |
| 38 | +The ACPI object format supported by the driver is defined below. |
26 | 39 |
|
27 | 40 | $ ls -al /dev/hsmp |
28 | 41 | crw-r--r-- 1 root root 10, 123 Jan 21 21:41 /dev/hsmp |
@@ -58,6 +71,81 @@ Note: lseek() is not supported as entire metrics table is read. |
58 | 71 | Metrics table definitions will be documented as part of Public PPR. |
59 | 72 | The same is defined in the amd_hsmp.h header. |
60 | 73 |
|
| 74 | +2. HSMP telemetry sysfs files |
| 75 | + |
| 76 | +Following sysfs files are available at /sys/devices/platform/AMDI0097:0X/. |
| 77 | + |
| 78 | +* c0_residency_input: Percentage of cores in C0 state. |
| 79 | +* prochot_status: Reports 1 if the processor is at thermal threshold value, |
| 80 | + 0 otherwise. |
| 81 | +* smu_fw_version: SMU firmware version. |
| 82 | +* protocol_version: HSMP interface version. |
| 83 | +* ddr_max_bw: Theoretical maximum DDR bandwidth in GB/s. |
| 84 | +* ddr_utilised_bw_input: Current utilized DDR bandwidth in GB/s. |
| 85 | +* ddr_utilised_bw_perc_input(%): Percentage of current utilized DDR bandwidth. |
| 86 | +* mclk_input: Memory clock in MHz. |
| 87 | +* fclk_input: Fabric clock in MHz. |
| 88 | +* clk_fmax: Maximum frequency of socket in MHz. |
| 89 | +* clk_fmin: Minimum frequency of socket in MHz. |
| 90 | +* cclk_freq_limit_input: Core clock frequency limit per socket in MHz. |
| 91 | +* pwr_current_active_freq_limit: Current active frequency limit of socket |
| 92 | + in MHz. |
| 93 | +* pwr_current_active_freq_limit_source: Source of current active frequency |
| 94 | + limit. |
| 95 | + |
| 96 | +ACPI device object format |
| 97 | +========================= |
| 98 | +The ACPI object format expected from the amd_hsmp driver |
| 99 | +for socket with ID00 is given below:: |
| 100 | + |
| 101 | + Device(HSMP) |
| 102 | + { |
| 103 | + Name(_HID, "AMDI0097") |
| 104 | + Name(_UID, "ID00") |
| 105 | + Name(HSE0, 0x00000001) |
| 106 | + Name(RBF0, ResourceTemplate() |
| 107 | + { |
| 108 | + Memory32Fixed(ReadWrite, 0xxxxxxx, 0x00100000) |
| 109 | + }) |
| 110 | + Method(_CRS, 0, NotSerialized) |
| 111 | + { |
| 112 | + Return(RBF0) |
| 113 | + } |
| 114 | + Method(_STA, 0, NotSerialized) |
| 115 | + { |
| 116 | + If(LEqual(HSE0, One)) |
| 117 | + { |
| 118 | + Return(0x0F) |
| 119 | + } |
| 120 | + Else |
| 121 | + { |
| 122 | + Return(Zero) |
| 123 | + } |
| 124 | + } |
| 125 | + Name(_DSD, Package(2) |
| 126 | + { |
| 127 | + Buffer(0x10) |
| 128 | + { |
| 129 | + 0x9D, 0x61, 0x4D, 0xB7, 0x07, 0x57, 0xBD, 0x48, |
| 130 | + 0xA6, 0x9F, 0x4E, 0xA2, 0x87, 0x1F, 0xC2, 0xF6 |
| 131 | + }, |
| 132 | + Package(3) |
| 133 | + { |
| 134 | + Package(2) {"MsgIdOffset", 0x00010934}, |
| 135 | + Package(2) {"MsgRspOffset", 0x00010980}, |
| 136 | + Package(2) {"MsgArgOffset", 0x000109E0} |
| 137 | + } |
| 138 | + }) |
| 139 | + } |
| 140 | + |
| 141 | +HSMP HWMON interface |
| 142 | +==================== |
| 143 | +HSMP power sensors are registered with the hwmon interface. A separate hwmon |
| 144 | +directory is created for each socket and the following files are generated |
| 145 | +within the hwmon directory. |
| 146 | +- power1_input (read only) |
| 147 | +- power1_cap_max (read only) |
| 148 | +- power1_cap (read, write) |
61 | 149 |
|
62 | 150 | An example |
63 | 151 | ========== |
@@ -97,8 +185,8 @@ what happened. The transaction returns 0 on success. |
97 | 185 |
|
98 | 186 | More details on the interface and message definitions can be found in chapter |
99 | 187 | "7 Host System Management Port (HSMP)" of the respective family/model PPR |
100 | | -eg: https://www.amd.com/system/files/TechDocs/55898_B1_pub_0.50.zip |
| 188 | +eg: https://www.amd.com/content/dam/amd/en/documents/epyc-technical-docs/programmer-references/55898_B1_pub_0_50.zip |
101 | 189 |
|
102 | 190 | User space C-APIs are made available by linking against the esmi library, |
103 | | -which is provided by the E-SMS project https://developer.amd.com/e-sms/. |
| 191 | +which is provided by the E-SMS project https://www.amd.com/en/developer/e-sms.html. |
104 | 192 | See: https://github.com/amd/esmi_ib_library |
0 commit comments