Ignore:
File:
1 edited

Legend:

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

    rab63b04e re93bb24  
    5656jump_to_kernel:
    5757        #
    58         # TODO
    5958        # Make sure that the I-cache, D-cache and memory are mutually coherent
    6059        # before passing control to the copied code.
    6160        #
     61
     62        #
     63        # r0 is kernel entry point
     64        # r1 is pointer to the bootinfo structure
     65
     66#define CP15_C1_IC              12
     67#define CP15_C1_BP              11
     68#define CP15_C1_DC              2
     69
     70
     71#ifndef PROCESSOR_ARCH_armv7_a
     72        mrc     p15, 0, r4, c1, c0, 0
     73       
     74        # D-cache before the kernel is started.
     75        bic     r4, r4, #(1 << CP15_C1_DC)
     76
     77        # Disable I-cache and Branche predictors.
     78        bic     r4, r4, #(1 << CP15_C1_IC)
     79        bic     r4, r4, #(1 << CP15_C1_BP)
     80       
     81        mcr     p15, 0, r4, c1, c0, 0
     82#endif
     83
     84
     85       
     86        #Wait for the operations to complete
     87#ifdef PROCESSOR_ARCH_armv7_a
     88        dsb
     89#else
     90        #cp15 dsb, r4 is ignored (should be zero)
     91        mov r4, #0
     92        mcr p15, 0, r4, c7, c10, 4
     93#endif
     94       
     95        # Clean ICache and BPredictors, r4 ignored (SBZ)
     96        mov r4, #0
     97        mcr p15, 0, r4, c7, c5, 0
     98        nop
     99
     100        #Wait for the operations to complete
     101#ifdef PROCESSOR_ARCH_armv7_a
     102        isb
     103        nop
     104#else
     105        # cp15 isb
     106        mcr p15, 0, r4, c7, c5, 4
     107        nop
     108#endif
    62109        mov pc, r0
Note: See TracChangeset for help on using the changeset viewer.