我的硬件平台是S3C2410,NAND FLASH 64M,SDRAM 64M。研究UBOOT的start.S时发现他本身有一段代码用来复制自身到SDRAM中去的,如下: relocate: /* relocate U-Boot to RAM */ adr r0, _start /* r0 <- current position of code */ ldr r1, _TEXT_BASE /* defined position of code =0x33f8'0000*/ /* test if we run from flash or RAM */ cmp r0, r1 /* don't reloc during debug */ beq stack_setup ldr r2, _armboot_start ldr r3, _bss_start sub r2, r3, r2 add r2, r0, r2 copy_loop: ldmia r0!, {r3-r10} stmia r1!, {r3-r10} cmp r0, r2 ble copy_loop 为什么资料上还要移植vivi中的一大段代码(如下),用来做为复制uboot代码到SDRAM?两个功能有区别吗? #ifdef CONFIG_S3C2410_NAND_BOOT copy_myself: mov r10, lr @ reset NAND mov r1, #NAND_CTL_BASE ldr r2, =0xf830 @ initial value str r2, [r1, #oNFCONF] @ #define oNFCONF 0x00 ldr r2, [r1, #oNFCONF] bic r2, r2, #0x800 @ enable chip str r2, [r1, #oNFCONF] mov r2, #0xff @ RESET command strb r2, [r1, #oNFCMD] @ #define oNFCMD 0x04 mov r3, #0 @ wait ... ... |