]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
fix(msm8916): flush dcache after writing msm8916_entry_point
authorStephan Gerhold <stephan@gerhold.net>
Sat, 17 Sep 2022 16:21:20 +0000 (18:21 +0200)
committerManish V Badarkhe <manish.badarkhe@arm.com>
Tue, 9 May 2023 19:44:37 +0000 (21:44 +0200)
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 <stephan@gerhold.net>
plat/qti/msm8916/msm8916_pm.c

index 6891e3800b3db1a4574a54f3ce60eb8dd898255b..792a0968813995683253d4ccd4bdad16997f55d9 100644 (file)
@@ -1,10 +1,11 @@
 /*
- * Copyright (c) 2021, Stephan Gerhold <stephan@gerhold.net>
+ * Copyright (c) 2021-2022, Stephan Gerhold <stephan@gerhold.net>
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
 #include <arch.h>
+#include <arch_helpers.h>
 #include <common/debug.h>
 #include <drivers/arm/gicv2.h>
 #include <drivers/delay_timer.h>
@@ -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;
 }