23 #ifndef LIBBSP_ARM_SHARED_ARM_A9MPCORE_START_H 24 #define LIBBSP_ARM_SHARED_ARM_A9MPCORE_START_H 31 #include <bsp/start.h> 40 BSP_START_TEXT_SECTION
static inline void 41 arm_a9mpcore_start_set_vector_base(
void)
46 if (bsp_vector_table_end != bsp_vector_table_size) {
53 arm_cp15_set_vector_base_address(bsp_vector_table_begin);
55 ctrl = arm_cp15_get_control();
56 ctrl &= ~ARM_CP15_CTRL_V;
57 arm_cp15_set_control(ctrl);
61 BSP_START_TEXT_SECTION
static inline void arm_a9mpcore_start_scu_invalidate(
67 scu->invss = (ways & 0xf) << ((cpu_id & 0x3) * 4);
70 BSP_START_TEXT_SECTION
static inline void 71 arm_a9mpcore_start_errata_764369_handler(
volatile a9mpcore_scu *scu)
73 if (arm_errata_is_applicable_processor_errata_764369()) {
74 scu->diagn_ctrl |= A9MPCORE_SCU_DIAGN_CTRL_MIGRATORY_BIT_DISABLE;
78 BSP_START_TEXT_SECTION
static inline void 79 arm_a9mpcore_start_scu_enable(
volatile a9mpcore_scu *scu)
81 scu->ctrl |= A9MPCORE_SCU_CTRL_SCU_EN;
82 arm_a9mpcore_start_errata_764369_handler(scu);
86 BSP_START_TEXT_SECTION
static inline void 87 arm_a9mpcore_start_on_secondary_processor(
void)
91 arm_a9mpcore_start_set_vector_base();
93 arm_gic_irq_initialize_secondary_cpu();
95 ctrl = arm_cp15_start_setup_mmu_and_cache(
97 ARM_CP15_CTRL_AFE | ARM_CP15_CTRL_Z
100 arm_cp15_set_domain_access_control(
101 ARM_CP15_DAC_DOMAIN(ARM_MMU_DEFAULT_CLIENT_DOMAIN, ARM_CP15_DAC_CLIENT)
105 arm_cp15_set_translation_table_base(
106 (uint32_t *) bsp_translation_table_base
109 ctrl |= ARM_CP15_CTRL_I | ARM_CP15_CTRL_C | ARM_CP15_CTRL_M;
110 arm_cp15_set_control(ctrl);
112 _SMP_Start_multitasking_on_secondary_processor(_Per_CPU_Get());
115 BSP_START_TEXT_SECTION
static inline void 116 arm_a9mpcore_start_enable_smp_in_auxiliary_control(
void)
122 uint32_t actlr = arm_cp15_get_auxiliary_control();
123 actlr |= ARM_CORTEX_A9_ACTL_SMP | ARM_CORTEX_A9_ACTL_FW;
124 arm_cp15_set_auxiliary_control(actlr);
128 BSP_START_TEXT_SECTION
static inline void arm_a9mpcore_start_hook_0(
void)
132 uint32_t cpu_id = arm_cortex_a9_get_multiprocessor_cpu_id();
134 arm_cp15_branch_predictor_invalidate_all();
137 arm_a9mpcore_start_scu_enable(scu);
141 arm_a9mpcore_start_enable_smp_in_auxiliary_control();
144 arm_a9mpcore_start_scu_invalidate(scu, cpu_id, 0xf);
148 arm_a9mpcore_start_on_secondary_processor();
153 BSP_START_TEXT_SECTION
static inline void arm_a9mpcore_start_global_timer(
void)
160 gt->ctrl = A9MPCORE_GT_CTRL_TMR_EN;
163 BSP_START_TEXT_SECTION
static inline void arm_a9mpcore_start_hook_1(
void)
165 arm_a9mpcore_start_global_timer();
166 arm_a9mpcore_start_set_vector_base();
ARM co-processor 15 (CP15) API.
Definition: arm-a9mpcore-regs.h:75
Create #defines which state which erratas shall get applied.
ARM_A9MPCORE_REGS Support.
Definition: arm-a9mpcore-regs.h:28
SuperCore SMP Implementation.