summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authorTzung-Bi Shih <tzungbi@chromium.org>2021-03-19 17:03:05 +0800
committerCommit Bot <commit-bot@chromium.org>2021-03-22 03:19:11 +0000
commit740b80bc5286e133fa2ff12e7b08c2ef8f6688fb (patch)
tree9c37d5f258df77579c4b159581b9cb8ef50b6029 /chip
parent00ff5771a702bad79d6d1e1f4592dc9312e4fe69 (diff)
downloadchrome-ec-740b80bc5286e133fa2ff12e7b08c2ef8f6688fb.tar.gz
chip/mt8192_scp: flush memory cache before notifying AP
Flushes memory cache before notifying AP when sending IPI message. BRANCH=none BUG=b:167466842 TEST=make BOARD=asurada_scp Signed-off-by: Tzung-Bi Shih <tzungbi@chromium.org> Change-Id: I91807e8957e8ea341c4ad8e5b904ac3be68b5cba Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2772413 Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r--chip/mt8192_scp/ipi.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/chip/mt8192_scp/ipi.c b/chip/mt8192_scp/ipi.c
index 39fcc09809..76af0af838 100644
--- a/chip/mt8192_scp/ipi.c
+++ b/chip/mt8192_scp/ipi.c
@@ -4,6 +4,7 @@
*/
#include "atomic.h"
+#include "cache.h"
#include "common.h"
#include "console.h"
#include "hooks.h"
@@ -97,6 +98,10 @@ int ipi_send(int32_t id, const void *buf, uint32_t len, int wait)
ipi_send_buf->len = len;
memcpy(ipi_send_buf->buffer, buf, len);
+ /* flush memory cache (if any) */
+ cache_flush_dcache_range((uintptr_t)ipi_send_buf,
+ sizeof(*ipi_send_buf));
+
/* interrupt AP to handle the message */
ipi_wake_ap(id);
SCP_SCP2APMCU_IPC_SET = IPC_SCP2HOST;