From 01ba69cd9b833047653186858a6929e6c9379989 Mon Sep 17 00:00:00 2001 From: Stephan Gerhold Date: Sat, 17 Sep 2022 18:21:20 +0200 Subject: [PATCH] fix(msm8916): flush dcache after writing msm8916_entry_point msm8916_entry_point is read with caches off (and even from two different physical addresses when read through the "boot remapper"), so it should be flushed to RAM after writing it. Change-Id: I5c8193954bb28043b0a46fb2038f629bd8796c74 Signed-off-by: Stephan Gerhold --- plat/qti/msm8916/msm8916_pm.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plat/qti/msm8916/msm8916_pm.c b/plat/qti/msm8916/msm8916_pm.c index 6891e3800..792a09688 100644 --- a/plat/qti/msm8916/msm8916_pm.c +++ b/plat/qti/msm8916/msm8916_pm.c @@ -1,10 +1,11 @@ /* - * Copyright (c) 2021, Stephan Gerhold + * Copyright (c) 2021-2022, Stephan Gerhold * * SPDX-License-Identifier: BSD-3-Clause */ #include +#include #include #include #include @@ -53,7 +54,14 @@ extern uintptr_t msm8916_entry_point; int plat_setup_psci_ops(uintptr_t sec_entrypoint, const plat_psci_ops_t **psci_ops) { + /* + * The entry point is read with caches off (and even from two different + * physical addresses when read through the "boot remapper"), so make + * sure it is flushed to memory. + */ msm8916_entry_point = sec_entrypoint; + flush_dcache_range((uintptr_t)&msm8916_entry_point, sizeof(uintptr_t)); + *psci_ops = &msm8916_psci_ops; return 0; } -- 2.39.5