#include "regdef.h" #include "csrdef.h" #include "tools-asm.h" #include "start.h" /* start address for the initialization values of the .data section. defined in ld.script */ .word _sidata /* start address for the .data section. defined in ld.script */ .word _sdata /* end address for the .data section. defined in ld.script */ .word _edata /* start address for the .bss section. defined in ld.script */ .word _sbss /* end address for the .bss section. defined in ld.script */ .word _ebss .globl _RAM_BSS _RAM_BSS = BSS_BASE .globl _RAM_DATA _RAM_DATA = DATA_BASE .section .text._start # begin code segment .weak _start .type _start, %function .globl _start #All Exception Entries _start: move t1 , zero b LoopCopyDataInit CopyDataInit: la.abs t3, _sidata add.w t4, t3, t1 ld.w t3, t4, 0x0 add.w t4, t0, t1 st.w t3, t4, 0x0 addi.w t1, t1, 0x4 LoopCopyDataInit: la.abs t0, _sdata la.abs t3, _edata add.w t2, t0, t1 bne t2, t3, CopyDataInit /* clear bss */ la.abs t0, _sbss la.abs t1, _ebss beq t1, t0, cpu_init_start LoopFillZerobss: st.w zero, t0, 0 addi.w t0, t0, 4 bne t1, t0, LoopFillZerobss #set up basic system function /* cpu init*/ cpu_init_start: ### reset normal exception base and Ex config li.w t0, 0x1c001000 csrwr t0, CSR_EBase li.w t0, (0<