On Thu, 21 Dec 2023, Suma Hegde wrote: > 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@xxxxxxx> > Signed-off-by: Naveen Krishna Chatradhi <nchatrad@xxxxxxx> > Reviewed-by: Hans de Goede <hdegoede@xxxxxxxxxx> > Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx> > > --- > Changes since v1: > Add "Reviewed-by: Hans de Goede <hdegoede@xxxxxxxxxx>" > Changes since v2: > 1. Change "non ACPI" to "non-ACPI" > 2. Add "Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>" > > drivers/platform/x86/amd/hsmp.c | 23 +++++++++++++++++++++-- > 1 file changed, 21 insertions(+), 2 deletions(-) > > diff --git a/drivers/platform/x86/amd/hsmp.c b/drivers/platform/x86/amd/hsmp.c > index 46924c572055..cc5e5e8124c9 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 > > @@ -712,6 +713,15 @@ 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 >= 0x00 && boot_cpu_data.x86_model <= 0x0F)) > + return true; > + > + return false; > +} > + > static int init_socket_objects(struct device *dev) > { > struct hsmp_socket *sock; > @@ -725,10 +735,19 @@ static int init_socket_objects(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; > + sema_init(&sock->hsmp_sem, 1); > + > + /* > + * This is a tranisitional change from non-ACPI to ACPI, only transitional ? -- i.