mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-10 09:44:13 +00:00
memory: Add mmu_init_secondary() to init MMU for secondaries
Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
parent
52f432f0f6
commit
d53b40da48
2 changed files with 22 additions and 0 deletions
21
src/memory.c
21
src/memory.c
|
@ -461,6 +461,27 @@ void mmu_init(void)
|
|||
printf("MMU: running with MMU and caches enabled!\n");
|
||||
}
|
||||
|
||||
static void mmu_secondary_setup(void)
|
||||
{
|
||||
mmu_configure();
|
||||
mmu_init_sprr();
|
||||
|
||||
// Enable EL0 memory access by EL1
|
||||
msr(PAN, 0);
|
||||
|
||||
// RES1 bits
|
||||
u64 sctlr = SCTLR_LSMAOE | SCTLR_nTLSMD | SCTLR_TSCXT | SCTLR_ITD;
|
||||
// Configure translation
|
||||
sctlr |= SCTLR_I | SCTLR_C | SCTLR_M | SCTLR_SPAN;
|
||||
write_sctlr(sctlr);
|
||||
}
|
||||
|
||||
void mmu_init_secondary(int cpu)
|
||||
{
|
||||
smp_call4(cpu, mmu_secondary_setup, 0, 0, 0, 0);
|
||||
smp_wait(cpu);
|
||||
}
|
||||
|
||||
void mmu_shutdown(void)
|
||||
{
|
||||
fb_console_reserve_lines(3);
|
||||
|
|
|
@ -24,6 +24,7 @@ void dc_civac_range(void *addr, size_t length);
|
|||
void dcsw_op_all(u64 op_type);
|
||||
|
||||
void mmu_init(void);
|
||||
void mmu_init_secondary(int cpu);
|
||||
void mmu_shutdown(void);
|
||||
|
||||
u64 mmu_disable(void);
|
||||
|
|
Loading…
Reference in a new issue