Skip to content

Commit 6699e14

Browse files
superm1herbertx
authored andcommitted
crypto: ccp - Use lower 8 bytes to communicate with doorbell command register
Unlike other command registers used by the PSP, only the lower 8 bytes are used for communication for both command and status of the command. Suggested-by: Mark Hasemeyer <[email protected]> Signed-off-by: Mario Limonciello <[email protected]> Reviewed-by: Mark Hasemeyer <[email protected]> Tested-by: Mark Hasemeyer <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent a19c61b commit 6699e14

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/crypto/ccp/platform-access.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "platform-access.h"
2020

2121
#define PSP_CMD_TIMEOUT_US (500 * USEC_PER_MSEC)
22+
#define DOORBELL_CMDRESP_STS GENMASK(7, 0)
2223

2324
/* Recovery field should be equal 0 to start sending commands */
2425
static int check_recovery(u32 __iomem *cmd)
@@ -154,15 +155,15 @@ int psp_ring_platform_doorbell(int msg, u32 *result)
154155
goto unlock;
155156
}
156157

157-
iowrite32(FIELD_PREP(PSP_DRBL_MSG, msg), cmd);
158+
iowrite32(FIELD_PREP(DOORBELL_CMDRESP_STS, msg), cmd);
158159
iowrite32(PSP_DRBL_RING, button);
159160

160161
if (wait_cmd(cmd)) {
161162
ret = -ETIMEDOUT;
162163
goto unlock;
163164
}
164165

165-
val = FIELD_GET(PSP_CMDRESP_STS, ioread32(cmd));
166+
val = FIELD_GET(DOORBELL_CMDRESP_STS, ioread32(cmd));
166167
if (val) {
167168
if (result)
168169
*result = val;

0 commit comments

Comments
 (0)