arch: arm: aarch64: export z_arm64_mmu_init for SMP
Export z_arm64_mmu_init for SMP usage Signed-off-by: Peng Fan <peng.fan@nxp.com>
This commit is contained in:
parent
6182330fc3
commit
251b1d39ac
3 changed files with 10 additions and 2 deletions
|
@ -532,8 +532,13 @@ void z_arm64_mmu_init(void)
|
||||||
/* Ensure that MMU is already not enabled */
|
/* Ensure that MMU is already not enabled */
|
||||||
__ASSERT((read_sctlr_el1() & SCTLR_M_BIT) == 0, "MMU is already enabled\n");
|
__ASSERT((read_sctlr_el1() & SCTLR_M_BIT) == 0, "MMU is already enabled\n");
|
||||||
|
|
||||||
kernel_ptables.base_xlat_table = new_table();
|
/*
|
||||||
setup_page_tables(&kernel_ptables);
|
* Only booting core setup up the page tables.
|
||||||
|
*/
|
||||||
|
if (IS_PRIMARY_CORE()) {
|
||||||
|
kernel_ptables.base_xlat_table = new_table();
|
||||||
|
setup_page_tables(&kernel_ptables);
|
||||||
|
}
|
||||||
|
|
||||||
/* currently only EL1 is supported */
|
/* currently only EL1 is supported */
|
||||||
enable_mmu_el1(&kernel_ptables, flags);
|
enable_mmu_el1(&kernel_ptables, flags);
|
||||||
|
|
|
@ -142,6 +142,7 @@
|
||||||
#define TCR_PS_BITS_256TB 0x5ULL
|
#define TCR_PS_BITS_256TB 0x5ULL
|
||||||
|
|
||||||
#ifndef _ASMLANGUAGE
|
#ifndef _ASMLANGUAGE
|
||||||
|
|
||||||
/* Region definition data structure */
|
/* Region definition data structure */
|
||||||
struct arm_mmu_region {
|
struct arm_mmu_region {
|
||||||
/* Region Base Physical Address */
|
/* Region Base Physical Address */
|
||||||
|
@ -193,6 +194,7 @@ struct arm_mmu_ptables {
|
||||||
*/
|
*/
|
||||||
extern const struct arm_mmu_config mmu_config;
|
extern const struct arm_mmu_config mmu_config;
|
||||||
|
|
||||||
|
void z_arm64_mmu_init(void);
|
||||||
#endif /* _ASMLANGUAGE */
|
#endif /* _ASMLANGUAGE */
|
||||||
|
|
||||||
#endif /* ZEPHYR_INCLUDE_ARCH_ARM64_MMU_ARM_MMU_H_ */
|
#endif /* ZEPHYR_INCLUDE_ARCH_ARM64_MMU_ARM_MMU_H_ */
|
||||||
|
|
|
@ -77,6 +77,7 @@
|
||||||
|
|
||||||
#define GET_MPIDR() read_sysreg(mpidr_el1)
|
#define GET_MPIDR() read_sysreg(mpidr_el1)
|
||||||
#define MPIDR_TO_CORE(mpidr) MPIDR_AFFLVL(mpidr, 0)
|
#define MPIDR_TO_CORE(mpidr) MPIDR_AFFLVL(mpidr, 0)
|
||||||
|
#define IS_PRIMARY_CORE() (!MPIDR_TO_CORE(GET_MPIDR()))
|
||||||
|
|
||||||
#define MODE_EL_SHIFT (0x2)
|
#define MODE_EL_SHIFT (0x2)
|
||||||
#define MODE_EL_MASK (0x3)
|
#define MODE_EL_MASK (0x3)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue