[PATCH 1/2] soc: qcom: rpmh-rsc: Update CMD_MSGID_LEN to 4 bytes for read request
From: Maulik Shah
Date: Thu Sep 10 2026 - 05:01:29 EST
Newer SoC like hawi with RSC version v4.5 support 4 byte message read
request instead of default 8 byte on older SoCs. The write request
continues to be 8 bytes.
Update the read request message accordingly on RSC v4.5 and higher.
Signed-off-by: Maulik Shah <maulik.shah@xxxxxxxxxxxxxxxx>
---
drivers/soc/qcom/rpmh-rsc.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c
index c4542318eac4..f84a399fa5dc 100644
--- a/drivers/soc/qcom/rpmh-rsc.c
+++ b/drivers/soc/qcom/rpmh-rsc.c
@@ -86,6 +86,7 @@ enum {
#define TCS_AMC_MODE_TRIGGER BIT(24)
/* TCS CMD register bit mask */
+#define CMD_MSGID_LEN_READ_v4_5 4
#define CMD_MSGID_LEN 8
#define CMD_MSGID_RESP_REQ BIT(8)
#define CMD_MSGID_WRITE BIT(16)
@@ -499,15 +500,21 @@ static void __tcs_buffer_write(struct rsc_drv *drv, int tcs_id, int cmd_id,
const struct tcs_request *msg)
{
u32 msgid;
- u32 cmd_msgid = CMD_MSGID_LEN;
+ u32 cmd_msgid = 0;
u32 cmd_enable = 0;
struct tcs_cmd *cmd;
int i, j;
/* Convert all commands to RR when the request has wait_for_compl set */
cmd_msgid |= msg->wait_for_compl ? CMD_MSGID_RESP_REQ : 0;
- if (!msg->is_read)
- cmd_msgid |= CMD_MSGID_WRITE;
+ if (!msg->is_read) {
+ cmd_msgid = CMD_MSGID_LEN | CMD_MSGID_WRITE;
+ } else {
+ if (drv->ver.major >= 4 && drv->ver.minor >= 5)
+ cmd_msgid = CMD_MSGID_LEN_READ_v4_5;
+ else
+ cmd_msgid = CMD_MSGID_LEN;
+ }
for (i = 0, j = cmd_id; i < msg->num_cmds; i++, j++) {
cmd = &msg->cmds[i];
--
2.43.0