美文网首页
start.s 学习

start.s 学习

作者: beasu | 来源:发表于2020-01-04 00:12 被阅读0次

uboot Start.s 学习 在arm cortexa9 下

文件: uboot\cpu\arm_cortexa9\start.S

    #if 0
    /*
     * set the cpu to SVC32 mode and IRQ & FIQ disable
     */
    mrs r0, cpsr
    bic r0, r0, #0x3fr//
    orr r0, r0, #0xd3
    msr cpsr, r0
#else//*****ly
    mrs r0, cpsr
    bic r0, r0, #0x1f//000 11111
    orr r0, r0, #0xd3//110 10011
    msr cpsr,r0

195,194 行 为切换到 管理模式和禁止 中断和快速中断模式
cpsr 寄存器和运行模式


CPSR寄存器

运行模式

    bl  lowlevel_init

293行 lowlevel_init 在 board 文件夹下各个厂商目录下比如我的板子在 下uboot\board\samsung\smdk2410

代码内容

.globl lowlevel_init
lowlevel_init:
    /* memory control configuration */
    /* make r0 relative the current location so that it */
    /* reads SMRDATA out of FLASH rather than memory ! */
    ldr     r0, =SMRDATA
    ldr r1, _TEXT_BASE
    sub r0, r0, r1
    ldr r1, =BWSCON /* Bus Width Status Controller */
    add     r2, r0, #13*4
0:
    ldr     r3, [r0], #4
    str     r3, [r1], #4
    cmp     r2, r0
    bne     0b

    /* everything is fine now */
    mov pc, lr

相关文章

网友评论

      本文标题:start.s 学习

      本文链接:https://www.haomeiwen.com/subject/avbtactx.html