1
0
mirror of git://projects.qi-hardware.com/iris.git synced 2024-07-01 02:45:27 +03:00
iris/boot.S
Bas Wijnen 5d9d12b860 idle
2009-05-14 20:31:47 +02:00

46 lines
733 B
ArmAsm

// The kernel stack.
.lcomm kernel_stack, KERNEL_STACK_SIZE
.globl __start
.set noreorder
#define Status 12
#define Config 16
__start:
bal 1f
nop
.word _gp
// For some reason the disassembler considers everything
// after __start non-code until the next label. So I add a label.
start_hack_for_disassembler:
1: lw $gp, 0($ra)
la $sp, kernel_stack + KERNEL_STACK_SIZE
// Disable interrupts during bootstrap.
mtc0 $zero, $Status
// TODO: flush cache and optionally refill it.
// Set kseg0 cachable.
li $k0, 0x3
mtc0 $k0, $Config, 0
// Jump into cached code.
la $t9, 1f
jr $t9
nop
1:
// Clear .bss
la $a0, _edata
la $a1, _end
1: sw $zero, 0($a0)
bne $a1, $a0, 1b
addu $a0, 4
la $t9, init
jr $t9
nop