* [PATCH v2 1/6] platform/x86/amd/pmc: Send OS_HINT command for AMDI000A platform
2023-12-28 10:20 [PATCH v2 0/6] platform/x86/amd/pmc: Updates to amd-pmc driver Shyam Sundar S K
@ 2023-12-28 10:20 ` Shyam Sundar S K
2023-12-28 10:21 ` [PATCH v2 2/6] platform/x86/amd/pmc: Add VPE information " Shyam Sundar S K
` (5 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Shyam Sundar S K @ 2023-12-28 10:20 UTC (permalink / raw)
To: hdegoede, ilpo.jarvinen, markgross
Cc: Sanket.Goswami, mario.limonciello, platform-driver-x86,
Shyam Sundar S K
To initiate the HW deep state transistion the OS_HINT command has to be
sent the PMFW. Add this support to the platforms that has AMDI000A
support.
Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com>
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
---
drivers/platform/x86/amd/pmc/pmc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c
index c3104714b480..bad95d3ce2a1 100644
--- a/drivers/platform/x86/amd/pmc/pmc.c
+++ b/drivers/platform/x86/amd/pmc/pmc.c
@@ -761,6 +761,7 @@ static int amd_pmc_get_os_hint(struct amd_pmc_dev *dev)
case AMD_CPU_ID_YC:
case AMD_CPU_ID_CB:
case AMD_CPU_ID_PS:
+ case PCI_DEVICE_ID_AMD_1AH_M20H_ROOT:
return MSG_OS_HINT_RN;
}
return -EINVAL;
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v2 2/6] platform/x86/amd/pmc: Add VPE information for AMDI000A platform
2023-12-28 10:20 [PATCH v2 0/6] platform/x86/amd/pmc: Updates to amd-pmc driver Shyam Sundar S K
2023-12-28 10:20 ` [PATCH v2 1/6] platform/x86/amd/pmc: Send OS_HINT command for AMDI000A platform Shyam Sundar S K
@ 2023-12-28 10:21 ` Shyam Sundar S K
2023-12-28 10:21 ` [PATCH v2 3/6] platform/x86/amd/pmc: call amd_pmc_get_ip_info() during driver probe Shyam Sundar S K
` (4 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Shyam Sundar S K @ 2023-12-28 10:21 UTC (permalink / raw)
To: hdegoede, ilpo.jarvinen, markgross
Cc: Sanket.Goswami, mario.limonciello, platform-driver-x86,
Shyam Sundar S K
Latest AMD SoCs has VPE (Video Processing Engine) IP block and the
statistics related to this IP can be obtained as a part of metrics table
information that the PMFW propogates. Add this support for 1Ah family
series.
Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com>
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
---
drivers/platform/x86/amd/pmc/pmc.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c
index bad95d3ce2a1..0511b7f3c2b7 100644
--- a/drivers/platform/x86/amd/pmc/pmc.c
+++ b/drivers/platform/x86/amd/pmc/pmc.c
@@ -155,6 +155,7 @@ static const struct amd_pmc_bit_map soc15_ip_blk[] = {
{"JPEG", BIT(18)},
{"IPU", BIT(19)},
{"UMSCH", BIT(20)},
+ {"VPE", BIT(21)},
{}
};
@@ -365,6 +366,10 @@ static void amd_pmc_get_ip_info(struct amd_pmc_dev *dev)
dev->num_ips = 21;
dev->s2d_msg_id = 0x85;
break;
+ case PCI_DEVICE_ID_AMD_1AH_M20H_ROOT:
+ dev->num_ips = 22;
+ dev->s2d_msg_id = 0xDE;
+ break;
}
}
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v2 3/6] platform/x86/amd/pmc: call amd_pmc_get_ip_info() during driver probe
2023-12-28 10:20 [PATCH v2 0/6] platform/x86/amd/pmc: Updates to amd-pmc driver Shyam Sundar S K
2023-12-28 10:20 ` [PATCH v2 1/6] platform/x86/amd/pmc: Send OS_HINT command for AMDI000A platform Shyam Sundar S K
2023-12-28 10:21 ` [PATCH v2 2/6] platform/x86/amd/pmc: Add VPE information " Shyam Sundar S K
@ 2023-12-28 10:21 ` Shyam Sundar S K
2023-12-28 10:21 ` [PATCH v2 4/6] platform/x86/amd/pmc: Add idlemask support for 1Ah family Shyam Sundar S K
` (3 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Shyam Sundar S K @ 2023-12-28 10:21 UTC (permalink / raw)
To: hdegoede, ilpo.jarvinen, markgross
Cc: Sanket.Goswami, mario.limonciello, platform-driver-x86,
Shyam Sundar S K
In the current code, amd_pmc_get_ip_info() is being called from
amd_pmc_s2d_init() and that code block gets enabled only when the STB is
being enabled.
But the information from amd_pmc_get_ip_info() will be required outside of
STB usecase. Hence move this call into driver probe sequence.
Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com>
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
---
drivers/platform/x86/amd/pmc/pmc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c
index 0511b7f3c2b7..6d6e5b9e56d8 100644
--- a/drivers/platform/x86/amd/pmc/pmc.c
+++ b/drivers/platform/x86/amd/pmc/pmc.c
@@ -980,9 +980,6 @@ static int amd_pmc_s2d_init(struct amd_pmc_dev *dev)
/* Spill to DRAM feature uses separate SMU message port */
dev->msg_port = 1;
- /* Get num of IP blocks within the SoC */
- amd_pmc_get_ip_info(dev);
-
amd_pmc_send_cmd(dev, S2D_TELEMETRY_SIZE, &size, dev->s2d_msg_id, true);
if (size != S2D_TELEMETRY_BYTES_MAX)
return -EIO;
@@ -1090,6 +1087,9 @@ static int amd_pmc_probe(struct platform_device *pdev)
mutex_init(&dev->lock);
+ /* Get num of IP blocks within the SoC */
+ amd_pmc_get_ip_info(dev);
+
if (enable_stb && amd_pmc_is_stb_supported(dev)) {
err = amd_pmc_s2d_init(dev);
if (err)
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v2 4/6] platform/x86/amd/pmc: Add idlemask support for 1Ah family
2023-12-28 10:20 [PATCH v2 0/6] platform/x86/amd/pmc: Updates to amd-pmc driver Shyam Sundar S K
` (2 preceding siblings ...)
2023-12-28 10:21 ` [PATCH v2 3/6] platform/x86/amd/pmc: call amd_pmc_get_ip_info() during driver probe Shyam Sundar S K
@ 2023-12-28 10:21 ` Shyam Sundar S K
2023-12-28 10:21 ` [PATCH v2 5/6] platform/x86/amd/pmc: Add 1Ah family series to STB support list Shyam Sundar S K
` (2 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Shyam Sundar S K @ 2023-12-28 10:21 UTC (permalink / raw)
To: hdegoede, ilpo.jarvinen, markgross
Cc: Sanket.Goswami, mario.limonciello, platform-driver-x86,
Shyam Sundar S K
Idlemask is an indication of each IP block current state (i.e. whether it
is running or idle) during s2idle transistion. The newer 1Ah family
supports this feature, add it to the support list.
Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com>
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
---
drivers/platform/x86/amd/pmc/pmc.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c
index 6d6e5b9e56d8..60c95ba5a831 100644
--- a/drivers/platform/x86/amd/pmc/pmc.c
+++ b/drivers/platform/x86/amd/pmc/pmc.c
@@ -38,6 +38,7 @@
/* PMC Scratch Registers */
#define AMD_PMC_SCRATCH_REG_CZN 0x94
#define AMD_PMC_SCRATCH_REG_YC 0xD14
+#define AMD_PMC_SCRATCH_REG_1AH 0xF14
/* STB Registers */
#define AMD_PMC_STB_PMI_0 0x03E30600
@@ -603,6 +604,9 @@ static int amd_pmc_idlemask_read(struct amd_pmc_dev *pdev, struct device *dev,
case AMD_CPU_ID_PS:
val = amd_pmc_reg_read(pdev, AMD_PMC_SCRATCH_REG_YC);
break;
+ case PCI_DEVICE_ID_AMD_1AH_M20H_ROOT:
+ val = amd_pmc_reg_read(pdev, AMD_PMC_SCRATCH_REG_1AH);
+ break;
default:
return -EINVAL;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v2 5/6] platform/x86/amd/pmc: Add 1Ah family series to STB support list
2023-12-28 10:20 [PATCH v2 0/6] platform/x86/amd/pmc: Updates to amd-pmc driver Shyam Sundar S K
` (3 preceding siblings ...)
2023-12-28 10:21 ` [PATCH v2 4/6] platform/x86/amd/pmc: Add idlemask support for 1Ah family Shyam Sundar S K
@ 2023-12-28 10:21 ` Shyam Sundar S K
2023-12-28 10:21 ` [PATCH v2 6/6] platform/x86/amd/pmc: Modify SMU message port for latest AMD platform Shyam Sundar S K
2023-12-29 13:47 ` [PATCH v2 0/6] platform/x86/amd/pmc: Updates to amd-pmc driver Ilpo Järvinen
6 siblings, 0 replies; 9+ messages in thread
From: Shyam Sundar S K @ 2023-12-28 10:21 UTC (permalink / raw)
To: hdegoede, ilpo.jarvinen, markgross
Cc: Sanket.Goswami, mario.limonciello, platform-driver-x86,
Shyam Sundar S K
AMD newer platforms, (AMDI000A or family 1Ah series) also supports the STB
functionality. Add this to amd_pmc_is_stb_supported().
Signed-off-by: Sanket Goswami <Sanket.Goswami@amd.com>
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
---
drivers/platform/x86/amd/pmc/pmc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c
index 60c95ba5a831..c8d86dd392ce 100644
--- a/drivers/platform/x86/amd/pmc/pmc.c
+++ b/drivers/platform/x86/amd/pmc/pmc.c
@@ -637,6 +637,7 @@ static bool amd_pmc_is_stb_supported(struct amd_pmc_dev *dev)
case AMD_CPU_ID_YC:
case AMD_CPU_ID_CB:
case AMD_CPU_ID_PS:
+ case PCI_DEVICE_ID_AMD_1AH_M20H_ROOT:
return true;
default:
return false;
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v2 6/6] platform/x86/amd/pmc: Modify SMU message port for latest AMD platform
2023-12-28 10:20 [PATCH v2 0/6] platform/x86/amd/pmc: Updates to amd-pmc driver Shyam Sundar S K
` (4 preceding siblings ...)
2023-12-28 10:21 ` [PATCH v2 5/6] platform/x86/amd/pmc: Add 1Ah family series to STB support list Shyam Sundar S K
@ 2023-12-28 10:21 ` Shyam Sundar S K
2023-12-29 13:47 ` [PATCH v2 0/6] platform/x86/amd/pmc: Updates to amd-pmc driver Ilpo Järvinen
6 siblings, 0 replies; 9+ messages in thread
From: Shyam Sundar S K @ 2023-12-28 10:21 UTC (permalink / raw)
To: hdegoede, ilpo.jarvinen, markgross
Cc: Sanket.Goswami, mario.limonciello, platform-driver-x86,
Shyam Sundar S K
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>
---
drivers/platform/x86/amd/pmc/pmc.c | 8 +++++---
drivers/platform/x86/amd/pmc/pmc.h | 1 +
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c
index c8d86dd392ce..acac2a4194d4 100644
--- a/drivers/platform/x86/amd/pmc/pmc.c
+++ b/drivers/platform/x86/amd/pmc/pmc.c
@@ -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
@@ -362,14 +361,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;
}
}
@@ -673,7 +675,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;
}
@@ -700,7 +702,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;
}
diff --git a/drivers/platform/x86/amd/pmc/pmc.h b/drivers/platform/x86/amd/pmc/pmc.h
index c27bd6a5642f..e5b25d27ad78 100644
--- a/drivers/platform/x86/amd/pmc/pmc.h
+++ b/drivers/platform/x86/amd/pmc/pmc.h
@@ -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;
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH v2 0/6] platform/x86/amd/pmc: Updates to amd-pmc driver
2023-12-28 10:20 [PATCH v2 0/6] platform/x86/amd/pmc: Updates to amd-pmc driver Shyam Sundar S K
` (5 preceding siblings ...)
2023-12-28 10:21 ` [PATCH v2 6/6] platform/x86/amd/pmc: Modify SMU message port for latest AMD platform Shyam Sundar S K
@ 2023-12-29 13:47 ` Ilpo Järvinen
2024-01-02 12:42 ` Hans de Goede
6 siblings, 1 reply; 9+ messages in thread
From: Ilpo Järvinen @ 2023-12-29 13:47 UTC (permalink / raw)
To: Shyam Sundar S K
Cc: Hans de Goede, markgross, Sanket.Goswami, mario.limonciello,
platform-driver-x86
[-- Attachment #1: Type: text/plain, Size: 1103 bytes --]
On Thu, 28 Dec 2023, Shyam Sundar S K wrote:
> This series is focused on adding support for AMD family 1Ah series (or
> with platforms that support AMDI000A) that adds support for s2idle, VPE
> IP block information, STB and idlemask.
>
> (Series based on 'review-hans' branch with "4fd8b09f5bc1" as the tip.)
>
> v1->v2:
> -------
> - Add missing smu_msg variable to amd_pmc_dev struct
>
> Shyam Sundar S K (6):
> platform/x86/amd/pmc: Send OS_HINT command for AMDI000A platform
> platform/x86/amd/pmc: Add VPE information for AMDI000A platform
> platform/x86/amd/pmc: call amd_pmc_get_ip_info() during driver probe
> platform/x86/amd/pmc: Add idlemask support for 1Ah family
> platform/x86/amd/pmc: Add 1Ah family series to STB support list
> platform/x86/amd/pmc: Modify SMU message port for latest AMD platform
>
> drivers/platform/x86/amd/pmc/pmc.c | 25 +++++++++++++++++++------
> drivers/platform/x86/amd/pmc/pmc.h | 1 +
> 2 files changed, 20 insertions(+), 6 deletions(-)
For all patches in this series:
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
--
i.
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH v2 0/6] platform/x86/amd/pmc: Updates to amd-pmc driver
2023-12-29 13:47 ` [PATCH v2 0/6] platform/x86/amd/pmc: Updates to amd-pmc driver Ilpo Järvinen
@ 2024-01-02 12:42 ` Hans de Goede
0 siblings, 0 replies; 9+ messages in thread
From: Hans de Goede @ 2024-01-02 12:42 UTC (permalink / raw)
To: Ilpo Järvinen, Shyam Sundar S K
Cc: markgross, Sanket.Goswami, mario.limonciello, platform-driver-x86
Hi,
On 12/29/23 14:47, Ilpo Järvinen wrote:
> On Thu, 28 Dec 2023, Shyam Sundar S K wrote:
>
>> This series is focused on adding support for AMD family 1Ah series (or
>> with platforms that support AMDI000A) that adds support for s2idle, VPE
>> IP block information, STB and idlemask.
>>
>> (Series based on 'review-hans' branch with "4fd8b09f5bc1" as the tip.)
>>
>> v1->v2:
>> -------
>> - Add missing smu_msg variable to amd_pmc_dev struct
>>
>> Shyam Sundar S K (6):
>> platform/x86/amd/pmc: Send OS_HINT command for AMDI000A platform
>> platform/x86/amd/pmc: Add VPE information for AMDI000A platform
>> platform/x86/amd/pmc: call amd_pmc_get_ip_info() during driver probe
>> platform/x86/amd/pmc: Add idlemask support for 1Ah family
>> platform/x86/amd/pmc: Add 1Ah family series to STB support list
>> platform/x86/amd/pmc: Modify SMU message port for latest AMD platform
>>
>> drivers/platform/x86/amd/pmc/pmc.c | 25 +++++++++++++++++++------
>> drivers/platform/x86/amd/pmc/pmc.h | 1 +
>> 2 files changed, 20 insertions(+), 6 deletions(-)
>
> For all patches in this series:
>
> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Shyam, thank you for the patches. Ilpo, thank you for the review.
I've applied the series to my review-hans branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.
Regards,
Hans
^ permalink raw reply [flat|nested] 9+ messages in thread