1. text//specifies that subsequent compiled content is placed in the code snippet "executable" 2.Global //tells the compiler to follow a globally visible name "either a variable or a function name" 3_start/*the real address of the function is also the starting address of the program that compiles and links enough. Since the program is loaded by the loader, the function of the _start name must be found, so the _start must be defined as global so that it exists in the compiled global compliance table for other programs such as the loader to find. */ 4_start:5 /*1. Off-Guard Dog*/ 6LDR r0,=53000000 7 /*2. Setting the clock*/ 8 9 /*3. Initialization of SDRAM*/TenLDR r0,=Mem_ctl_base OneADR R1,sdram_config//Get current Address ALDR r2,[r1],#4 -Add r3,r0,# ( -*4) - the 1: -LDR r2,[r1],#4 -Ltr r2,[r0],#4 -CMP R0,R3 +BNE 1b//Unequal , recall the previous 1 marking - /*4. Reposition*/ +LDR sp,=34000000 //set the function stack to perform the highest memory ABL Copy_code_to_sdram at - /*5. Execute the main function*/ -LDR Lr,=halt//main function return address -LDR pc,=Main -Halt: -B Halt inSdram_config: -.Long 0x22011110 //Bwscon to.Long 0x00000700 //BANKCON0 +.Long 0x00000700 //BANKCON1 -.Long 0x00000700 //BANKCON2 the.Long 0x00000700 //BANKCON3 *.Long 0x00000700 //BANKCON4 $.Long 0x00000700 //BANKCON5Panax Notoginseng.Long 0x00018005 //BANKCON6 -.Long 0x00018005 //BANKCON7 the.Long 0x008c04f4 //REFRESH +.Long 0x000000b1 //banksize A.Long 0x00000030 //MRSRB6 the.Long 0x00000030 //MRSRB7 + -
ARM Linux bootloader Notes