]> www.infradead.org Git - users/hch/configfs.git/commitdiff
platform/x86/amd/pmc: Modify SMU message port for latest AMD platform
authorShyam Sundar S K <Shyam-sundar.S-k@amd.com>
Thu, 28 Dec 2023 10:21:04 +0000 (15:51 +0530)
committerHans de Goede <hdegoede@redhat.com>
Tue, 2 Jan 2024 12:40:31 +0000 (13:40 +0100)
The latest platforms use a different SMU message port(0x938) from the one
currently being used (0x538). Make code changes to adapt to this new
information.

Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com>
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20231228102104.1785383-7-Shyam-sundar.S-k@amd.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/amd/pmc/pmc.c
drivers/platform/x86/amd/pmc/pmc.h

index 3845cbd17f714557b05f2b1ca3acb2ecfcaa46b7..108e12fd580f7f6d1dbebd0ad7d7b2ce73dbc939 100644 (file)
@@ -31,7 +31,6 @@
 #include "pmc.h"
 
 /* SMU communication registers */
-#define AMD_PMC_REGISTER_MESSAGE       0x538
 #define AMD_PMC_REGISTER_RESPONSE      0x980
 #define AMD_PMC_REGISTER_ARGUMENT      0x9BC
 
@@ -352,14 +351,17 @@ static void amd_pmc_get_ip_info(struct amd_pmc_dev *dev)
        case AMD_CPU_ID_CB:
                dev->num_ips = 12;
                dev->s2d_msg_id = 0xBE;
+               dev->smu_msg = 0x538;
                break;
        case AMD_CPU_ID_PS:
                dev->num_ips = 21;
                dev->s2d_msg_id = 0x85;
+               dev->smu_msg = 0x538;
                break;
        case PCI_DEVICE_ID_AMD_1AH_M20H_ROOT:
                dev->num_ips = 22;
                dev->s2d_msg_id = 0xDE;
+               dev->smu_msg = 0x938;
                break;
        }
 }
@@ -663,7 +665,7 @@ static void amd_pmc_dump_registers(struct amd_pmc_dev *dev)
                argument = AMD_S2D_REGISTER_ARGUMENT;
                response = AMD_S2D_REGISTER_RESPONSE;
        } else {
-               message = AMD_PMC_REGISTER_MESSAGE;
+               message = dev->smu_msg;
                argument = AMD_PMC_REGISTER_ARGUMENT;
                response = AMD_PMC_REGISTER_RESPONSE;
        }
@@ -690,7 +692,7 @@ static int amd_pmc_send_cmd(struct amd_pmc_dev *dev, u32 arg, u32 *data, u8 msg,
                argument = AMD_S2D_REGISTER_ARGUMENT;
                response = AMD_S2D_REGISTER_RESPONSE;
        } else {
-               message = AMD_PMC_REGISTER_MESSAGE;
+               message = dev->smu_msg;
                argument = AMD_PMC_REGISTER_ARGUMENT;
                response = AMD_PMC_REGISTER_RESPONSE;
        }
index b4794f118739f6622ad1a0c111ca11bb85bffa7b..827eef65e13347f86c9bb0d0a2e8d17aa3a275d6 100644 (file)
@@ -26,6 +26,7 @@ struct amd_pmc_dev {
        u32 dram_size;
        u32 num_ips;
        u32 s2d_msg_id;
+       u32 smu_msg;
 /* SMU version information */
        u8 smu_program;
        u8 major;