summaryrefslogtreecommitdiffstats
path: root/bsps/arm
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-12-21 07:29:41 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-12-23 09:19:28 +0100
commit76a1a5378031e56d29d16c713aee73c6747c3e61 (patch)
tree8918ba94751b80d57d5dd07807d571f2580908bb /bsps/arm
parentbsps/arm: Set VBAR in start.S (diff)
downloadrtems-76a1a5378031e56d29d16c713aee73c6747c3e61.tar.bz2
bsps/arm: Invalidate branch predictors earlier
Make sure the branch predictors are invalidated before the first branch is executed. Update #4202.
Diffstat (limited to 'bsps/arm')
-rw-r--r--bsps/arm/include/bsp/arm-a9mpcore-start.h2
-rw-r--r--bsps/arm/raspberrypi/start/bspstarthooks.c1
-rw-r--r--bsps/arm/shared/start/start.S11
-rw-r--r--bsps/arm/xilinx-zynq/start/bspstarthooks.c1
-rw-r--r--bsps/arm/xilinx-zynqmp/start/bspstarthooks.c1
5 files changed, 11 insertions, 5 deletions
diff --git a/bsps/arm/include/bsp/arm-a9mpcore-start.h b/bsps/arm/include/bsp/arm-a9mpcore-start.h
index f377745c56..38ddb03d16 100644
--- a/bsps/arm/include/bsp/arm-a9mpcore-start.h
+++ b/bsps/arm/include/bsp/arm-a9mpcore-start.h
@@ -141,8 +141,6 @@ BSP_START_TEXT_SECTION static inline void arm_a9mpcore_start_hook_0(void)
(volatile a9mpcore_scu *) BSP_ARM_A9MPCORE_SCU_BASE;
uint32_t cpu_id = arm_cortex_a9_get_multiprocessor_cpu_id();
- arm_cp15_branch_predictor_invalidate_all();
-
if (cpu_id == 0) {
arm_a9mpcore_start_scu_enable(scu);
}
diff --git a/bsps/arm/raspberrypi/start/bspstarthooks.c b/bsps/arm/raspberrypi/start/bspstarthooks.c
index c46c4f5cbf..b050cb695e 100644
--- a/bsps/arm/raspberrypi/start/bspstarthooks.c
+++ b/bsps/arm/raspberrypi/start/bspstarthooks.c
@@ -110,7 +110,6 @@ void BSP_START_TEXT_SECTION bsp_start_hook_0(void)
rtems_cache_invalidate_entire_data();
}
rtems_cache_invalidate_entire_instruction();
- arm_cp15_branch_predictor_invalidate_all();
arm_cp15_tlb_invalidate();
arm_cp15_flush_prefetch_buffer();
diff --git a/bsps/arm/shared/start/start.S b/bsps/arm/shared/start/start.S
index 9ebc2818e5..f4880dfcf0 100644
--- a/bsps/arm/shared/start/start.S
+++ b/bsps/arm/shared/start/start.S
@@ -181,6 +181,17 @@ _start:
mov r13, #0
#endif
+#if __ARM_ARCH >= 7
+ /*
+ * Write to BPIALL (Branch Predictor Invalidate All) to invalidate all
+ * branch predictors. There is no need to use BPIALLIS (Branch
+ * Predictor Invalidate All, Inner Shareable) since this code is
+ * executed on all processors used by RTEMS.
+ */
+ mov r0, #0
+ mcr p15, 0, r0, c7, c5, 6
+#endif
+
#ifdef RTEMS_SMP
/* Read MPIDR and get current processor index */
mrc p15, 0, r7, c0, c0, 5
diff --git a/bsps/arm/xilinx-zynq/start/bspstarthooks.c b/bsps/arm/xilinx-zynq/start/bspstarthooks.c
index a0f0fbacf6..0fc2a2590d 100644
--- a/bsps/arm/xilinx-zynq/start/bspstarthooks.c
+++ b/bsps/arm/xilinx-zynq/start/bspstarthooks.c
@@ -66,7 +66,6 @@ BSP_START_TEXT_SECTION void bsp_start_hook_0(void)
* are required there.
*/
arm_cp15_data_cache_invalidate_all_levels();
- arm_cp15_branch_predictor_invalidate_all();
arm_cp15_tlb_invalidate();
arm_cp15_flush_prefetch_buffer();
arm_a9mpcore_start_hook_0();
diff --git a/bsps/arm/xilinx-zynqmp/start/bspstarthooks.c b/bsps/arm/xilinx-zynqmp/start/bspstarthooks.c
index 9ab8d965f3..bc3f0fbe5e 100644
--- a/bsps/arm/xilinx-zynqmp/start/bspstarthooks.c
+++ b/bsps/arm/xilinx-zynqmp/start/bspstarthooks.c
@@ -72,7 +72,6 @@ BSP_START_TEXT_SECTION void bsp_start_hook_0(void)
* are required there.
*/
arm_cp15_data_cache_invalidate_all_levels();
- arm_cp15_branch_predictor_invalidate_all();
arm_cp15_tlb_invalidate();
arm_cp15_flush_prefetch_buffer();
}