Jordan Demeulenaere | 2d50582 | 2022-08-11 17:20:14 +0200 | [diff] [blame] | 1 | /**************************************************************************** |
| 2 | **************************************************************************** |
| 3 | *** |
| 4 | *** This header was automatically generated from a Linux kernel header |
| 5 | *** of the same name, to make information necessary for userspace to |
| 6 | *** call into the kernel available to libc. It contains only constants, |
| 7 | *** structures, and macros generated from the original header, and thus, |
| 8 | *** contains no copyrightable information. |
| 9 | *** |
| 10 | *** To edit the content of this header, modify the corresponding |
| 11 | *** source file (e.g. under external/kernel-headers/original/) then |
| 12 | *** run bionic/libc/kernel/tools/update_all.py |
| 13 | *** |
| 14 | *** Any manual change here will be lost the next time this script will |
| 15 | *** be run. You've been warned! |
| 16 | *** |
| 17 | **************************************************************************** |
| 18 | ****************************************************************************/ |
| 19 | #ifndef _UAPI_ASM_X86_AMD_HSMP_H_ |
| 20 | #define _UAPI_ASM_X86_AMD_HSMP_H_ |
| 21 | #include <linux/types.h> |
| 22 | #pragma pack(4) |
| 23 | #define HSMP_MAX_MSG_LEN 8 |
| 24 | enum hsmp_message_ids { |
| 25 | HSMP_TEST = 1, |
| 26 | HSMP_GET_SMU_VER, |
| 27 | HSMP_GET_PROTO_VER, |
| 28 | HSMP_GET_SOCKET_POWER, |
| 29 | HSMP_SET_SOCKET_POWER_LIMIT, |
| 30 | HSMP_GET_SOCKET_POWER_LIMIT, |
| 31 | HSMP_GET_SOCKET_POWER_LIMIT_MAX, |
| 32 | HSMP_SET_BOOST_LIMIT, |
| 33 | HSMP_SET_BOOST_LIMIT_SOCKET, |
| 34 | HSMP_GET_BOOST_LIMIT, |
| 35 | HSMP_GET_PROC_HOT, |
| 36 | HSMP_SET_XGMI_LINK_WIDTH, |
| 37 | HSMP_SET_DF_PSTATE, |
| 38 | HSMP_SET_AUTO_DF_PSTATE, |
| 39 | HSMP_GET_FCLK_MCLK, |
| 40 | HSMP_GET_CCLK_THROTTLE_LIMIT, |
| 41 | HSMP_GET_C0_PERCENT, |
| 42 | HSMP_SET_NBIO_DPM_LEVEL, |
| 43 | HSMP_GET_DDR_BANDWIDTH = 0x14, |
| 44 | HSMP_GET_TEMP_MONITOR, |
| 45 | HSMP_MSG_ID_MAX, |
| 46 | }; |
| 47 | struct hsmp_message { |
| 48 | __u32 msg_id; |
| 49 | __u16 num_args; |
| 50 | __u16 response_sz; |
| 51 | __u32 args[HSMP_MAX_MSG_LEN]; |
| 52 | __u16 sock_ind; |
| 53 | }; |
| 54 | enum hsmp_msg_type { |
| 55 | HSMP_RSVD = - 1, |
| 56 | HSMP_SET = 0, |
| 57 | HSMP_GET = 1, |
| 58 | }; |
| 59 | struct hsmp_msg_desc { |
| 60 | int num_args; |
| 61 | int response_sz; |
| 62 | enum hsmp_msg_type type; |
| 63 | }; |
| 64 | static const struct hsmp_msg_desc hsmp_msg_desc_table[] = { |
| 65 | { |
| 66 | 0, 0, HSMP_RSVD |
| 67 | } |
| 68 | , { |
| 69 | 1, 1, HSMP_GET |
| 70 | } |
| 71 | , { |
| 72 | 0, 1, HSMP_GET |
| 73 | } |
| 74 | , { |
| 75 | 0, 1, HSMP_GET |
| 76 | } |
| 77 | , { |
| 78 | 0, 1, HSMP_GET |
| 79 | } |
| 80 | , { |
| 81 | 1, 0, HSMP_SET |
| 82 | } |
| 83 | , { |
| 84 | 0, 1, HSMP_GET |
| 85 | } |
| 86 | , { |
| 87 | 0, 1, HSMP_GET |
| 88 | } |
| 89 | , { |
| 90 | 1, 0, HSMP_SET |
| 91 | } |
| 92 | , { |
| 93 | 1, 0, HSMP_SET |
| 94 | } |
| 95 | , { |
| 96 | 1, 1, HSMP_GET |
| 97 | } |
| 98 | , { |
| 99 | 0, 1, HSMP_GET |
| 100 | } |
| 101 | , { |
| 102 | 1, 0, HSMP_SET |
| 103 | } |
| 104 | , { |
| 105 | 1, 0, HSMP_SET |
| 106 | } |
| 107 | , { |
| 108 | 0, 0, HSMP_SET |
| 109 | } |
| 110 | , { |
| 111 | 0, 2, HSMP_GET |
| 112 | } |
| 113 | , { |
| 114 | 0, 1, HSMP_GET |
| 115 | } |
| 116 | , { |
| 117 | 0, 1, HSMP_GET |
| 118 | } |
| 119 | , { |
| 120 | 1, 0, HSMP_SET |
| 121 | } |
| 122 | , { |
| 123 | 0, 0, HSMP_RSVD |
| 124 | } |
| 125 | , { |
| 126 | 0, 1, HSMP_GET |
| 127 | } |
| 128 | , { |
| 129 | 0, 1, HSMP_GET |
| 130 | } |
| 131 | , |
| 132 | }; |
| 133 | #pragma pack() |
| 134 | #define HSMP_BASE_IOCTL_NR 0xF8 |
| 135 | #define HSMP_IOCTL_CMD _IOWR(HSMP_BASE_IOCTL_NR, 0, struct hsmp_message) |
| 136 | #endif |