29,6 → 29,7 |
|
#include <arch/arch.h> |
#include <arch/stack.h> |
#include <arch/context_offset.h> |
#include <arch/sun4v/regdef.h> |
#include <arch/sun4v/hypercall.h> |
#include <arch/sun4v/arch.h> |
142,6 → 143,15 |
sethi %hi(trap_table), %g1 |
wrpr %g1, %lo(trap_table), %tba |
|
/* Explicitly switch to hypervisor API 1.1. */ |
mov 1, %o0 |
mov 1, %o1 |
mov 1, %o2 |
mov 0, %o3 |
mov 0, %o4 |
mov 0, %o5 |
ta 0xff |
nop |
|
/* |
* Take over the MMU. |
184,13 → 194,6 |
set 1, %o2 ! context |
set MMU_FLAG_DTLB | MMU_FLAG_ITLB, %o3 ! MMU flags |
__HYPERCALL_FAST(MMU_DEMAP_CTX) |
|
/* |
* Save physmem_base for use by the mm subsystem. |
* %l6 contains starting physical address |
*/ |
sethi %hi(physmem_base), %l4 |
stx %l6, [%l4 + %lo(physmem_base)] |
|
/* |
* Set CPUID. |
209,8 → 212,20 |
mov SCRATCHPAD_MMU_FSA, %g1 |
stxa %o0, [%g1] ASI_SCRATCHPAD ! remember MMU fault status area to speed up miss handler |
__HYPERCALL_FAST(MMU_FAULT_AREA_CONF) |
|
|
! on APs skip executing the following code |
cmp %l7, 0 |
be 1f |
nop |
|
/* |
* Save physmem_base for use by the mm subsystem. |
* %l6 contains starting physical address |
*/ |
sethi %hi(physmem_base), %l4 |
stx %l6, [%l4 + %lo(physmem_base)] |
|
/* |
* Store a template of a TTE Data entry for kernel mappings. |
* This template will be used from the kernel MMU miss handler. |
*/ |
246,6 → 261,41 |
ba 0b |
nop |
|
1: |
|
#ifdef CONFIG_SMP |
|
/* |
* Configure stack for the AP. |
* The AP is expected to use the stack saved |
* in the ctx global variable. |
*/ |
|
mov 1, %o0 ! MMU enable flag |
set mmu_enabled, %o1 |
mov MMU_ENABLE, %o5 ! MMU enable HV call |
ta 0x80 ! call HV |
|
mmu_enabled: |
|
/* |
* Configure stack for the AP. |
* The AP is expected to use the stack saved |
* in the ctx global variable. |
*/ |
set ctx, %g1 |
add %g1, OFFSET_SP, %g1 |
ldx [%g1], %o6 |
|
call main_ap |
nop |
#endif |
|
/* Not reached. */ |
0: |
ba 0b |
nop |
|
.section K_DATA_START, "aw", @progbits |
|
#define INITIAL_STACK_SIZE 1024 |