Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/arm32/src/asm.S

    r73b3ecd r24bead17  
    2727#
    2828
    29 #include <abi/asmtool.h>
    3029#include <arch/arch.h>
    3130
    3231.section BOOTSTRAP
    3332
    34 SYMBOL(start)
     33.global start
     34.global boot_pt
     35.global boot_stack
     36.global halt
     37.global jump_to_kernel
     38
     39start:
    3540        ldr sp, =boot_stack
    3641        b bootstrap
    3742
    3843.section BOOTPT
    39 SYMBOL(boot_pt)
     44boot_pt:
    4045        .space PTL0_ENTRIES * PTL0_ENTRY_SIZE
    4146
    4247.section BOOTSTACK
    4348        .space 4096
    44 SYMBOL(boot_stack)
     49boot_stack:
    4550
    4651.text
    4752
    48 FUNCTION_BEGIN(halt)
     53halt:
    4954        b halt
    50 FUNCTION_END(halt)
    5155
    52 FUNCTION_BEGIN(jump_to_kernel)
     56jump_to_kernel:
    5357        #
     58        # TODO
    5459        # Make sure that the I-cache, D-cache and memory are mutually coherent
    5560        # before passing control to the copied code.
     
    6368#define CP15_C1_BP              11
    6469#define CP15_C1_DC              2
     70        # Disable I-cache and D-cache before the kernel is started.
     71        mrc     p15, 0, r4, c1, c0, 0
     72        bic     r4, r4, #(1 << CP15_C1_DC)
     73        bic     r4, r4, #(1 << CP15_C1_IC)
     74        bic     r4, r4, #(1 << CP15_C1_BP)
     75        mcr     p15, 0, r4, c1, c0, 0
    6576
    66 
    67 #ifndef PROCESSOR_ARCH_armv7_a
    68         mrc     p15, 0, r4, c1, c0, 0
    6977       
    70         # D-cache before the kernel is started.
    71         bic     r4, r4, #(1 << CP15_C1_DC)
    72 
    73         # Disable I-cache and Branch predictors.
    74         bic     r4, r4, #(1 << CP15_C1_IC)
    75 #ifdef PROCESSOR_ARCH_armv6
    76         bic     r4, r4, #(1 << CP15_C1_BP)
    77 #endif
    78        
    79         mcr     p15, 0, r4, c1, c0, 0
    80 #endif
    81        
    82         # Wait for the operations to complete
     78        #Wait for the operations to complete
    8379#ifdef PROCESSOR_ARCH_armv7_a
    8480        dsb
    8581#else
    86         # cp15 dsb, r4 is ignored (should be zero)
    87         mov r4, #0
     82        #cp15 dsb, r4 is ignored (should be zero)
    8883        mcr p15, 0, r4, c7, c10, 4
    8984#endif
    9085       
    9186        # Clean ICache and BPredictors, r4 ignored (SBZ)
    92         mov r4, #0
    9387        mcr p15, 0, r4, c7, c5, 0
    9488        nop
    9589
    96         # Wait for the operations to complete
     90        #Wait for the operations to complete
    9791#ifdef PROCESSOR_ARCH_armv7_a
    9892        isb
    9993        nop
    100 #elif defined(PROCESSOR_ARCH_armv6)
     94#else
    10195        # cp15 isb
    10296        mcr p15, 0, r4, c7, c5, 4
     
    10498#endif
    10599        mov pc, r0
    106 FUNCTION_END(jump_to_kernel)
    107 
Note: See TracChangeset for help on using the changeset viewer.