OpenCores
URL https://opencores.org/ocsvn/c0or1k/c0or1k/trunk

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [src/] [arch/] [arm/] [head.S.ARM] - Blame information for rev 6

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
/*
2
 * ARM Kernel entry point
3
 *
4
 * Copyright (C) 2007 Bahadir Balban
5
 */
6
 
7
#include INC_ARCH(asm.h)
8
 
9
#define C15_C0_M                0x0001  /* MMU */
10
#define C15_C0_A                0x0002  /* Alignment */
11
#define C15_C0_C                0x0004  /* (D) Cache */
12
#define C15_C0_W                0x0008  /* Write buffer */
13
#define C15_C0_B                0x0080  /* Endianness */
14
#define C15_C0_S                0x0100  /* System */
15
#define C15_C0_R                0x0200  /* ROM */
16
#define C15_C0_Z                0x0800  /* Branch Prediction */
17
#define C15_C0_I                0x1000  /* I cache */
18
#define C15_C0_V                0x2000  /* High vectors */
19
 
20
 
21
/*
22
 * This is the entry point of the L4 ARM architecture.
23
 * The boot loader must call _start with the processor in privileged
24
 * mode and mmu disabled.
25
 */
26
        .section .text.head
27
BEGIN_PROC(_start)
28
        /* Setup status register for supervisor mode, interrupts disabled */
29
        msr     cpsr_fcxs, #ARM_MODE_SVC
30
 
31
        /* Disable mmu if it is enabled */
32
        mrc     p15, 0, r0, c1, c0, 0
33
        bic     r0, r0, #C15_C0_M       @ Disable MMU
34
        bic     r0, r0, #C15_C0_C       @ Disable (D) Cache
35
        bic     r0, r0, #C15_C0_I       @ Disable I cache
36
        bic     r0, r0, #C15_C0_W       @ Disable Write buffer
37
        bic     r0, r0, #C15_C0_Z       @ Disable Branch prediction
38
        mcr     p15, 0, r0, c1, c0, 0
39
 
40
        /* Setup boot stack (physical address) */
41
        ldr     sp,     _kernel_init_stack
42
 
43
        /* Exception stacks are defined in vector page */
44
        msr     cpsr_fc, #ARM_NOIRQ_ABT
45
        ldr     sp,     _kernel_abt_stack
46
        msr     cpsr_fc, #ARM_NOIRQ_IRQ
47
        ldr     sp,     _kernel_irq_stack
48
        msr     cpsr_fc, #ARM_NOIRQ_FIQ
49
        ldr     sp,     _kernel_fiq_stack
50
        msr     cpsr_fc, #ARM_NOIRQ_UND
51
        ldr     sp,     _kernel_und_stack
52
        msr     cpsr_fc, #ARM_NOIRQ_SVC
53
 
54
        /* Jump to start_kernel */
55
        bl      start_kernel
56
 
57
        /* Never reached */
58
1:
59
        b       1b
60
 
61
_kernel_init_stack:
62
        .word   _bootstack_physical
63
 
64
/* Exception stacks are defined in vector page */
65
_kernel_abt_stack:
66
        .word   __abt_stack_high
67
_kernel_irq_stack:
68
        .word   __irq_stack_high
69
_kernel_fiq_stack:
70
        .word   __fiq_stack_high
71
_kernel_und_stack:
72
        .word   __und_stack_high

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.