summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/amd
diff options
context:
space:
mode:
authorSuma Hegde <suma.hegde@amd.com>2024-01-06 05:25:29 +0300
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2024-01-31 11:30:59 +0300
commitd2bf115115d556a5a50cec9dd63cb5f64f10de87 (patch)
treeb92a33d07556cbc3f778b3be74d27529f1c7d2a3 /drivers/platform/x86/amd
parentba8dcff0e9c4f8fa6a46315126fb837acb0f98fc (diff)
downloadlinux-d2bf115115d556a5a50cec9dd63cb5f64f10de87.tar.xz
platform/x86/amd/hsmp: Non-ACPI support for AMD F1A_M00~0Fh
AMD EPYC family 0x1A and Model 0x0-0xF are having different mailbox message ID offset compared to previous platforms. In case of ACPI based BIOS, this information will be read from ACPI table, for non-ACPI BIOS, this needs to be #defined. Signed-off-by: Suma Hegde <suma.hegde@amd.com> Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20240106022532.1746932-8-suma.hegde@amd.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Diffstat (limited to 'drivers/platform/x86/amd')
-rw-r--r--drivers/platform/x86/amd/hsmp.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/platform/x86/amd/hsmp.c b/drivers/platform/x86/amd/hsmp.c
index 9dc8e036ed72..aecc64a72d20 100644
--- a/drivers/platform/x86/amd/hsmp.c
+++ b/drivers/platform/x86/amd/hsmp.c
@@ -44,6 +44,7 @@
*/
#define SMN_HSMP_BASE 0x3B00000
#define SMN_HSMP_MSG_ID 0x0010534
+#define SMN_HSMP_MSG_ID_F1A_M0H 0x0010934
#define SMN_HSMP_MSG_RESP 0x0010980
#define SMN_HSMP_MSG_DATA 0x00109E0
@@ -734,6 +735,14 @@ static int hsmp_cache_proto_ver(u16 sock_ind)
return ret;
}
+static inline bool is_f1a_m0h(void)
+{
+ if (boot_cpu_data.x86 == 0x1A && boot_cpu_data.x86_model <= 0x0F)
+ return true;
+
+ return false;
+}
+
static int init_platform_device(struct device *dev)
{
struct hsmp_socket *sock;
@@ -747,7 +756,16 @@ static int init_platform_device(struct device *dev)
sock->sock_ind = i;
sock->dev = dev;
sock->mbinfo.base_addr = SMN_HSMP_BASE;
- sock->mbinfo.msg_id_off = SMN_HSMP_MSG_ID;
+
+ /*
+ * This is a transitional change from non-ACPI to ACPI, only
+ * family 0x1A, model 0x00 platform is supported for both ACPI and non-ACPI.
+ */
+ if (is_f1a_m0h())
+ sock->mbinfo.msg_id_off = SMN_HSMP_MSG_ID_F1A_M0H;
+ else
+ sock->mbinfo.msg_id_off = SMN_HSMP_MSG_ID;
+
sock->mbinfo.msg_resp_off = SMN_HSMP_MSG_RESP;
sock->mbinfo.msg_arg_off = SMN_HSMP_MSG_DATA;
sema_init(&sock->hsmp_sem, 1);