summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/arm/shared/include/arm-a9mpcore-start.h
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/lib/libbsp/arm/shared/include/arm-a9mpcore-start.h')
-rw-r--r--c/src/lib/libbsp/arm/shared/include/arm-a9mpcore-start.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/arm/shared/include/arm-a9mpcore-start.h b/c/src/lib/libbsp/arm/shared/include/arm-a9mpcore-start.h
index b42c549c91..36b76f5e49 100644
--- a/c/src/lib/libbsp/arm/shared/include/arm-a9mpcore-start.h
+++ b/c/src/lib/libbsp/arm/shared/include/arm-a9mpcore-start.h
@@ -28,11 +28,20 @@ extern "C" {
#endif /* __cplusplus */
BSP_START_TEXT_SECTION static inline uint32_t
+arm_cp15_get_control(void);
+
+BSP_START_TEXT_SECTION static inline void
+arm_cp15_set_control(uint32_t val);
+
+BSP_START_TEXT_SECTION static inline uint32_t
arm_cp15_get_auxiliary_control(void);
BSP_START_TEXT_SECTION static inline void
arm_cp15_set_auxiliary_control(uint32_t val);
+BSP_START_TEXT_SECTION static inline void
+arm_cp15_set_vector_base_address(void *base);
+
BSP_START_TEXT_SECTION static inline arm_a9mpcore_start_hook_0(void)
{
#ifdef RTEMS_SMP
@@ -81,6 +90,26 @@ BSP_START_TEXT_SECTION static inline arm_a9mpcore_start_hook_0(void)
#endif
}
+BSP_START_TEXT_SECTION static inline arm_a9mpcore_start_hook_1(void)
+{
+ /*
+ * Do not use bsp_vector_table_begin == 0, since this will get optimized away.
+ */
+ if (bsp_vector_table_end != bsp_vector_table_size) {
+ uint32_t ctrl;
+
+ /*
+ * For now we assume that every Cortex-A9 MPCore has the Security Extensions.
+ * Later it might be necessary to evaluate the ID_PFR1 register.
+ */
+ arm_cp15_set_vector_base_address(bsp_vector_table_begin);
+
+ ctrl = arm_cp15_get_control();
+ ctrl &= ~ARM_CP15_CTRL_V;
+ arm_cp15_set_control(ctrl);
+ }
+}
+
#ifdef __cplusplus
}
#endif /* __cplusplus */