Skip to content

Commit 49534a1

Browse files
sumachidanandnchatrad
authored andcommitted
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 <[email protected]> Signed-off-by: Naveen Krishna Chatradhi <[email protected]> Reviewed-by: Hans de Goede <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ilpo Järvinen <[email protected]> Change-Id: I165a3b3661a8d20aff9bb9e6ad2e4346d51be293
1 parent f69ac88 commit 49534a1

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

amd_hsmp.c

+19-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
*/
4545
#define SMN_HSMP_BASE 0x3B00000
4646
#define SMN_HSMP_MSG_ID 0x0010534
47+
#define SMN_HSMP_MSG_ID_F1A_M0H 0x0010934
4748
#define SMN_HSMP_MSG_RESP 0x0010980
4849
#define SMN_HSMP_MSG_DATA 0x00109E0
4950

@@ -734,6 +735,14 @@ static int hsmp_cache_proto_ver(u16 sock_ind)
734735
return ret;
735736
}
736737

738+
static inline bool is_f1a_m0h(void)
739+
{
740+
if (boot_cpu_data.x86 == 0x1A && boot_cpu_data.x86_model <= 0x0F)
741+
return true;
742+
743+
return false;
744+
}
745+
737746
static int init_platform_device(struct device *dev)
738747
{
739748
struct hsmp_socket *sock;
@@ -747,7 +756,16 @@ static int init_platform_device(struct device *dev)
747756
sock->sock_ind = i;
748757
sock->dev = dev;
749758
sock->mbinfo.base_addr = SMN_HSMP_BASE;
750-
sock->mbinfo.msg_id_off = SMN_HSMP_MSG_ID;
759+
760+
/*
761+
* This is a transitional change from non-ACPI to ACPI, only
762+
* family 0x1A, model 0x00 platform is supported for both ACPI and non-ACPI.
763+
*/
764+
if (is_f1a_m0h())
765+
sock->mbinfo.msg_id_off = SMN_HSMP_MSG_ID_F1A_M0H;
766+
else
767+
sock->mbinfo.msg_id_off = SMN_HSMP_MSG_ID;
768+
751769
sock->mbinfo.msg_resp_off = SMN_HSMP_MSG_RESP;
752770
sock->mbinfo.msg_arg_off = SMN_HSMP_MSG_DATA;
753771
sema_init(&sock->hsmp_sem, 1);

0 commit comments

Comments
 (0)