[rtems commit] bsps/arm: Invalidate TLB in start.S

Sebastian Huber sebh at rtems.org
Wed Dec 23 09:26:45 UTC 2020


Module:    rtems
Branch:    master
Commit:    23d9223ad3b67156b99d828457d0ebd74687cf71
Changeset: http://git.rtems.org/rtems/commit/?id=23d9223ad3b67156b99d828457d0ebd74687cf71

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Dec 21 10:08:30 2020 +0100

bsps/arm: Invalidate TLB in start.S

Update #4202.

---

 bsps/arm/raspberrypi/start/bspsmp_init.c     | 2 --
 bsps/arm/raspberrypi/start/bspstarthooks.c   | 3 ---
 bsps/arm/shared/start/start.S                | 9 +++++++++
 bsps/arm/xilinx-zynq/start/bspstarthooks.c   | 4 ----
 bsps/arm/xilinx-zynqmp/start/bspstarthooks.c | 7 +------
 5 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/bsps/arm/raspberrypi/start/bspsmp_init.c b/bsps/arm/raspberrypi/start/bspsmp_init.c
index a4dd470..eed5b44 100644
--- a/bsps/arm/raspberrypi/start/bspsmp_init.c
+++ b/bsps/arm/raspberrypi/start/bspsmp_init.c
@@ -74,8 +74,6 @@ void rpi_start_rtems_on_secondary_processor(void)
     (uint32_t *) bsp_translation_table_base
   );
 
-  arm_cp15_tlb_invalidate();
-
   ctrl |= ARM_CP15_CTRL_I | ARM_CP15_CTRL_C | ARM_CP15_CTRL_M;
   ctrl &= ~ARM_CP15_CTRL_V;
   arm_cp15_set_control(ctrl);
diff --git a/bsps/arm/raspberrypi/start/bspstarthooks.c b/bsps/arm/raspberrypi/start/bspstarthooks.c
index 60ff098..c6f76f2 100644
--- a/bsps/arm/raspberrypi/start/bspstarthooks.c
+++ b/bsps/arm/raspberrypi/start/bspstarthooks.c
@@ -67,9 +67,6 @@ raspberrypi_mmu_config_table[] = {
 
 void BSP_START_TEXT_SECTION bsp_start_hook_0(void)
 {
-  arm_cp15_tlb_invalidate();
-  _ARM_Instruction_synchronization_barrier();
-
   /* Clear Translation Table Base Control Register */
   arm_cp15_set_translation_table_base_control_register(0);
 
diff --git a/bsps/arm/shared/start/start.S b/bsps/arm/shared/start/start.S
index 0a3d428..50bf1d4 100644
--- a/bsps/arm/shared/start/start.S
+++ b/bsps/arm/shared/start/start.S
@@ -432,7 +432,16 @@ _start:
 	 */
 	mov	r0, #0
 	mcr	p15, 0, r0, c7, c5, 0
+
+#if __ARM_ARCH_PROFILE == 'A'
+	/*
+	 * Invalidate the TLB using ITLBIALL (Instruction TLB Invalidate All).
+	 */
+	mov	r0, #0
+	mcr	p15, 0, r0, c8, c7, 0
+	isb
 #endif
+#endif /* (__ARM_ARCH >= 7 && __ARM_ARCH_PROFILE == 'A') || __ARM_ARCH >= 8 */
 
 	/*
 	 * Invoke the start hook 0.
diff --git a/bsps/arm/xilinx-zynq/start/bspstarthooks.c b/bsps/arm/xilinx-zynq/start/bspstarthooks.c
index 25cf96a..c67ed4f 100644
--- a/bsps/arm/xilinx-zynq/start/bspstarthooks.c
+++ b/bsps/arm/xilinx-zynq/start/bspstarthooks.c
@@ -31,12 +31,8 @@
 #include <bsp/start.h>
 #include <bsp/arm-a9mpcore-start.h>
 
-#include <libcpu/arm-cp15.h>
-
 BSP_START_TEXT_SECTION void bsp_start_hook_0(void)
 {
-  arm_cp15_tlb_invalidate();
-  _ARM_Instruction_synchronization_barrier()
   arm_a9mpcore_start_hook_0();
 }
 
diff --git a/bsps/arm/xilinx-zynqmp/start/bspstarthooks.c b/bsps/arm/xilinx-zynqmp/start/bspstarthooks.c
index 0e844bc..ef76563 100644
--- a/bsps/arm/xilinx-zynqmp/start/bspstarthooks.c
+++ b/bsps/arm/xilinx-zynqmp/start/bspstarthooks.c
@@ -30,17 +30,12 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#define ARM_CP15_TEXT_SECTION BSP_START_TEXT_SECTION
-
 #include <bsp.h>
 #include <bsp/start.h>
 
-#include <libcpu/arm-cp15.h>
-
 BSP_START_TEXT_SECTION void bsp_start_hook_0(void)
 {
-  arm_cp15_tlb_invalidate();
-  _ARM_Instruction_synchronization_barrier();
+  /* Nothing to do */
 }
 
 BSP_START_TEXT_SECTION void bsp_start_hook_1(void)



More information about the vc mailing list