Commit 6699e143 authored by Mario Limonciello's avatar Mario Limonciello Committed by Herbert Xu

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: default avatarMark Hasemeyer <markhas@chromium.org>
Signed-off-by: default avatarMario Limonciello <mario.limonciello@amd.com>
Reviewed-by: default avatarMark Hasemeyer <markhas@chromium.org>
Tested-by: default avatarMark Hasemeyer <markhas@chromium.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent a19c61b0
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "platform-access.h" #include "platform-access.h"
#define PSP_CMD_TIMEOUT_US (500 * USEC_PER_MSEC) #define PSP_CMD_TIMEOUT_US (500 * USEC_PER_MSEC)
#define DOORBELL_CMDRESP_STS GENMASK(7, 0)
/* Recovery field should be equal 0 to start sending commands */ /* Recovery field should be equal 0 to start sending commands */
static int check_recovery(u32 __iomem *cmd) static int check_recovery(u32 __iomem *cmd)
...@@ -154,7 +155,7 @@ int psp_ring_platform_doorbell(int msg, u32 *result) ...@@ -154,7 +155,7 @@ int psp_ring_platform_doorbell(int msg, u32 *result)
goto unlock; goto unlock;
} }
iowrite32(FIELD_PREP(PSP_DRBL_MSG, msg), cmd); iowrite32(FIELD_PREP(DOORBELL_CMDRESP_STS, msg), cmd);
iowrite32(PSP_DRBL_RING, button); iowrite32(PSP_DRBL_RING, button);
if (wait_cmd(cmd)) { if (wait_cmd(cmd)) {
...@@ -162,7 +163,7 @@ int psp_ring_platform_doorbell(int msg, u32 *result) ...@@ -162,7 +163,7 @@ int psp_ring_platform_doorbell(int msg, u32 *result)
goto unlock; goto unlock;
} }
val = FIELD_GET(PSP_CMDRESP_STS, ioread32(cmd)); val = FIELD_GET(DOORBELL_CMDRESP_STS, ioread32(cmd));
if (val) { if (val) {
if (result) if (result)
*result = val; *result = val;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment