On Sat, 20 Jul 2024, Suma Hegde wrote: > Separate the probes for ACPI and platform device drivers. > Provide a Kconfig option to select either the > ACPI or the platform device based driver. > > Signed-off-by: Suma Hegde <suma.hegde@xxxxxxx> > Reviewed-by: Naveen Krishna Chatradhi <naveenkrishna.chatradhi@xxxxxxx> > --- > Changes since v2: > Following files are modified to add new symbol > - drivers/platform/x86/amd/hsmp/Kconfig, > - drivers/platform/x86/amd/hsmp/Makefile > - drivers/platform/x86/amd/Makefile > AMD_HSMP is used as common symbol and new AMD_HSMP_PLAT symbol is added > > Changes since v1: > Rename "plat_dev" to "hsmp_pdev" > > arch/x86/include/asm/amd_hsmp.h | 2 +- > drivers/platform/x86/amd/Makefile | 2 +- > drivers/platform/x86/amd/hsmp/Kconfig | 33 ++++++- > drivers/platform/x86/amd/hsmp/Makefile | 6 +- > drivers/platform/x86/amd/hsmp/acpi.c | 119 ++++++++++++++++++++++-- > drivers/platform/x86/amd/hsmp/hsmp.c | 25 ++--- > drivers/platform/x86/amd/hsmp/hsmp.h | 8 +- > drivers/platform/x86/amd/hsmp/plat.c | 122 +++++++------------------ > 8 files changed, 188 insertions(+), 129 deletions(-) > > diff --git a/arch/x86/include/asm/amd_hsmp.h b/arch/x86/include/asm/amd_hsmp.h > index 03c2ce3edaf5..ada14e55f9f4 100644 > --- a/arch/x86/include/asm/amd_hsmp.h > +++ b/arch/x86/include/asm/amd_hsmp.h > @@ -5,7 +5,7 @@ > > #include <uapi/asm/amd_hsmp.h> > > -#if IS_ENABLED(CONFIG_AMD_HSMP) > +#if IS_ENABLED(CONFIG_AMD_HSMP) || IS_ENABLED(CONFIG_AMD_HSMP_ACPI) > int hsmp_send_message(struct hsmp_message *msg); > #else > static inline int hsmp_send_message(struct hsmp_message *msg) > diff --git a/drivers/platform/x86/amd/Makefile b/drivers/platform/x86/amd/Makefile > index 96ec24c8701b..f0b2fe81c685 100644 > --- a/drivers/platform/x86/amd/Makefile > +++ b/drivers/platform/x86/amd/Makefile > @@ -5,6 +5,6 @@ > # > > obj-$(CONFIG_AMD_PMC) += pmc/ > -obj-y += hsmp/ > +obj-$(CONFIG_AMD_HSMP) += hsmp/ > obj-$(CONFIG_AMD_PMF) += pmf/ > obj-$(CONFIG_AMD_WBRF) += wbrf.o > diff --git a/drivers/platform/x86/amd/hsmp/Kconfig b/drivers/platform/x86/amd/hsmp/Kconfig > index b55d4ed9bceb..23fb98066225 100644 > --- a/drivers/platform/x86/amd/hsmp/Kconfig > +++ b/drivers/platform/x86/amd/hsmp/Kconfig > @@ -4,14 +4,39 @@ > # > > config AMD_HSMP > - tristate "AMD HSMP Driver" > - depends on AMD_NB && X86_64 && ACPI > + tristate "AMD Host System Management Port driver" > + depends on AMD_NB > help > + Host System Management Port (HSMP) interface is a mailbox interface > + between the x86 core and the System Management Unit (SMU) firmware. > The driver provides a way for user space tools to monitor and manage > system management functionality on EPYC server CPUs from AMD. > > - Host System Management Port (HSMP) interface is a mailbox interface > - between the x86 core and the System Management Unit (SMU) firmware. > +menu "AMD HSMP Probe" > + depends on AMD_HSMP > + > +config AMD_HSMP_ACPI > + tristate "ACPI based probe" > + depends on ACPI > + help > + This driver supports ACPI based probing. > + > + You may enable this, if your platform bios provides an ACPI object > + as described in the documentation. > > If you choose to compile this driver as a module the module will be > called amd_hsmp. > + > +config AMD_HSMP_PLAT > + tristate "Platform device based probe" > + depends on AMD_HSMP_ACPI=n > + help > + This driver supports platform device based probing. > + > + You may enable this, if your platform bios does not provide > + HSMP ACPI object. > + > + If you choose to compile this driver as a module the module will be > + called amd_hsmp. > + One additional point, please also make sure it gets compiled if COMPILE_TEST is set regardless of e.g. AMD_NB to get better compile coverage. -- i.