www.pudn.com > uCOS+GUI.rar > Reset.s


;/* 
;********************************************************************************************************* 
;* 文件: Reset.s 
;* 描述: 完成上电时的部分必要设置. 
;* 编写: 深思 (001-12345@sohu.com). 
;********************************************************************************************************* 
;*/ 
        IMPORT  __main 
        IMPORT  InitStack 
        IMPORT  InitClock 
        IMPORT  InitMemory 
        IMPORT  InitCPU 
        IMPORT  InitPort 
        IMPORT  InitInt 
 
WTCON       EQU 0x01d30000 
INTMSK      EQU 0x01e0000c 
BDIDES0     EQU 0x01f80008                              ; BDMA destination register. 
BDIDES1     EQU 0x01f80028 
 
        EXPORT  HandlerReset 
 
        AREA    Resetfun,CODE,READONLY 
        CODE32 
HandlerReset 
        LDR     R0,     =WTCON                          ; Disable Watchdog. 
        LDR     R1,     =0x00 
        STR     R1,     [R0] 
 
        LDR     R0,     =INTMSK 
        LDR     R1,     =0x07ffffff                     ; 屏蔽所有中断源. 
        STR     R1,     [R0] 
 
        BL      InitMemory                              ; 初始化 Memory Controller. 
        BL      InitStack                               ; 初始化堆栈. 
        BL      InitPort                                ; 初始化所有引脚,保证SDRAM接口正确. 
        BL      InitClock                               ; 设置系统时钟.PLL 等. 
        BL      InitCPU                                 ; 初始化 CPU Wrapper. 
        BL      InitInt                                 ; 初始化中断控制器. 
 
        LDR     R0,     =BDIDES0                        ; 文档中规定必须. 
        LDR     R1,     =0x40000000                     ; BDIDESn reset value should be 0x40000000 
        STR     R1,     [R0] 
        LDR     R0,     =BDIDES1 
        LDR     R1,     =0x40000000                     ; BDIDESn reset value should be 0x40000000	  
        STR     R1,     [R0] 
 
        B       __main 
;/* 
;********************************************************************************************************* 
        END 
;********************************************************************************************************* 
;*/