diff options
author | Dai Okamura <okamura.dai@socionext.com> | 2018-10-05 08:56:24 +0900 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-10-30 13:15:53 +0900 |
commit | e6a90288c39a5d3f145bc0b04cfd7b80a7305fe1 (patch) | |
tree | cb381e150a872bd69b05bed94dd26ded765808bf /plat/socionext | |
parent | 8be7850fd67b9eed258330155ce16ab13d02123c (diff) |
uniphier: revise SCP protocol handshake
When the SoC issues a command IRQ to SCP, SCP sets STMTOBEIRQ as ACK.
The SoC must wait for it before issuing the next command.
This commit makes sure to meet the requirement.
Signed-off-by: Dai Okamura <okamura.dai@socionext.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'plat/socionext')
-rw-r--r-- | plat/socionext/uniphier/uniphier_scp.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/plat/socionext/uniphier/uniphier_scp.c b/plat/socionext/uniphier/uniphier_scp.c index 9a921c4a..58eb72ef 100644 --- a/plat/socionext/uniphier/uniphier_scp.c +++ b/plat/socionext/uniphier/uniphier_scp.c @@ -12,7 +12,9 @@ #define UNIPHIER_ROM_RSV3 0x5980120c #define UNIPHIER_STMBE2COM 0x5f800030 +#define UNIPHIER_STMTOBEIRQ 0x5f800060 #define UNIPHIER_BETOSTMIRQ0PT 0x5f800070 +#define UNIPHIER_BEIRQCLRPT 0x5f800072 #define UNIPHIER_SCP_READY_MAGIC 0x0000b6a5 @@ -59,6 +61,10 @@ static void uniphier_scp_send_packet(const uint8_t *packet, int packet_len) } mmio_write_8(UNIPHIER_BETOSTMIRQ0PT, 0x55); + + while (!(mmio_read_32(UNIPHIER_STMTOBEIRQ) & BIT(1))) + ; + mmio_write_8(UNIPHIER_BEIRQCLRPT, BIT(1) | BIT(0)); } static void uniphier_scp_send_cmd(const uint8_t *cmd, int cmd_len) |