From: Alex Deucher <alexander.deucher@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Alex Deucher <alexander.deucher@amd.com>,
Tim Huang <Tim.Huang@amd.com>, Huang Rui <ray.huang@amd.com>
Subject: [PATCH 1/3] drm/amdgpu/pm: update MP v13_0_4 smu message register marco
Date: Thu, 26 May 2022 14:00:25 -0400 [thread overview]
Message-ID: <20220526180027.3044740-1-alexander.deucher@amd.com> (raw)
From: Huang Rui <ray.huang@amd.com>
Update MP v13_0_4 register macro for SMU message
v2: squash in missed case (Alex)
Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Tim Huang <Tim.Huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c b/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
index 5de7da75d14a..5215ead4978f 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
@@ -51,6 +51,15 @@
#define mmMP1_SMN_C2PMSG_90 0x029a
#define mmMP1_SMN_C2PMSG_90_BASE_IDX 0
+#define mmMP1_SMN_C2PMSG_66_V13_0_4 0x0282
+#define mmMP1_SMN_C2PMSG_66_V13_0_4_BASE_IDX 1
+
+#define mmMP1_SMN_C2PMSG_82_V13_0_4 0x0292
+#define mmMP1_SMN_C2PMSG_82_V13_0_4_BASE_IDX 1
+
+#define mmMP1_SMN_C2PMSG_90_V13_0_4 0x029a
+#define mmMP1_SMN_C2PMSG_90_V13_0_4_BASE_IDX 1
+
/* SMU 13.0.5 has its specific mailbox messaging registers */
#define mmMP1_C2PMSG_2 (0xbee142 + 0xb00000 / 4)
@@ -92,6 +101,8 @@ static void smu_cmn_read_arg(struct smu_context *smu,
if (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 5))
*arg = RREG32_SOC15(MP1, 0, mmMP1_C2PMSG_34);
+ else if (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 4))
+ *arg = RREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_82_V13_0_4);
else
*arg = RREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_82);
}
@@ -141,6 +152,8 @@ static u32 __smu_cmn_poll_stat(struct smu_context *smu)
for ( ; timeout > 0; timeout--) {
if (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 5))
reg = RREG32_SOC15(MP1, 0, mmMP1_C2PMSG_33);
+ else if (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 4))
+ reg = RREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_90_V13_0_4);
else
reg = RREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_90);
if ((reg & MP1_C2PMSG_90__CONTENT_MASK) != 0)
@@ -167,6 +180,9 @@ static void __smu_cmn_reg_print_error(struct smu_context *smu,
if (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 5)) {
msg_idx = RREG32_SOC15(MP1, 0, mmMP1_C2PMSG_2);
prm = RREG32_SOC15(MP1, 0, mmMP1_C2PMSG_34);
+ } else if (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 4)) {
+ msg_idx = RREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_66_V13_0_4);
+ prm = RREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_82_V13_0_4);
} else {
msg_idx = RREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_66);
prm = RREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_82);
@@ -268,6 +284,10 @@ static void __smu_cmn_send_msg(struct smu_context *smu,
WREG32_SOC15(MP1, 0, mmMP1_C2PMSG_33, 0);
WREG32_SOC15(MP1, 0, mmMP1_C2PMSG_34, param);
WREG32_SOC15(MP1, 0, mmMP1_C2PMSG_2, msg);
+ } else if (adev->ip_versions[MP1_HWIP][0] == IP_VERSION(13, 0, 4)) {
+ WREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_90_V13_0_4, 0);
+ WREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_82_V13_0_4, param);
+ WREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_66_V13_0_4, msg);
} else {
WREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_90, 0);
WREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_82, param);
--
2.35.3
next reply other threads:[~2022-05-26 18:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-26 18:00 Alex Deucher [this message]
2022-05-26 18:00 ` [PATCH 2/3] drm/amdgpu/swsmu: add SMU mailbox registers in SMU context Alex Deucher
2022-05-31 21:15 ` Alex Deucher
2022-06-01 0:49 ` Wang, Yang(Kevin)
2022-05-26 18:00 ` [PATCH 3/3] drm/amdgpu/swsmu: use new register offsets for smu_cmn.c Alex Deucher
2022-05-31 21:15 ` Alex Deucher
2022-06-01 14:57 ` Luben Tuikov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220526180027.3044740-1-alexander.deucher@amd.com \
--to=alexander.deucher@amd.com \
--cc=Tim.Huang@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=ray.huang@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox