summaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/amd_hsmp.h
diff options
context:
space:
mode:
authorSuma Hegde <suma.hegde@amd.com>2022-02-22 06:05:00 +0100
committerHans de Goede <hdegoede@redhat.com>2022-03-02 11:42:36 +0100
commit91f410aa679a035e7abdff47daca4418c384c770 (patch)
treed579aec46c6be453e2b8a13ec51eea774fbc4c1d /arch/x86/include/asm/amd_hsmp.h
parentsurface: surface3_power: Fix battery readings on batteries without a serial n... (diff)
downloadlinux-91f410aa679a035e7abdff47daca4418c384c770.tar.xz
linux-91f410aa679a035e7abdff47daca4418c384c770.zip
platform/x86: Add AMD system management interface
Recent Fam19h EPYC server line of processors from AMD support system management functionality via HSMP (Host System Management Port) interface. The Host System Management Port (HSMP) is an interface to provide OS-level software with access to system management functions via a set of mailbox registers. More details on the interface can be found in chapter "7 Host System Management Port (HSMP)" of the following PPR https://www.amd.com/system/files/TechDocs/55898_B1_pub_0.50.zip This patch adds new amd_hsmp module under the drivers/platforms/x86/ which creates miscdevice with an IOCTL interface to the user space. /dev/hsmp is for running the hsmp mailbox commands. Signed-off-by: Suma Hegde <suma.hegde@amd.com> Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com> Reviewed-by: Carlos Bilbao <carlos.bilbao@amd.com> Acked-by: Song Liu <song@kernel.org> Reviewed-by: Nathan Fontenot <nathan.fontenot@amd.com> Link: https://lore.kernel.org/r/20220222050501.18789-1-nchatrad@amd.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'arch/x86/include/asm/amd_hsmp.h')
-rw-r--r--arch/x86/include/asm/amd_hsmp.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/x86/include/asm/amd_hsmp.h b/arch/x86/include/asm/amd_hsmp.h
new file mode 100644
index 000000000000..03c2ce3edaf5
--- /dev/null
+++ b/arch/x86/include/asm/amd_hsmp.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+
+#ifndef _ASM_X86_AMD_HSMP_H_
+#define _ASM_X86_AMD_HSMP_H_
+
+#include <uapi/asm/amd_hsmp.h>
+
+#if IS_ENABLED(CONFIG_AMD_HSMP)
+int hsmp_send_message(struct hsmp_message *msg);
+#else
+static inline int hsmp_send_message(struct hsmp_message *msg)
+{
+ return -ENODEV;
+}
+#endif
+#endif /*_ASM_X86_AMD_HSMP_H_*/