#ifdef CONFIG_DEBUG_LL ldr r1, SerBase ldr r0, STR_STACK bl rintWord ldr r0, DW_STACK_START bl rintHexWord #endif @ get read to call C functions ldr sp, DW_STACK_START @ setup stack pointer // STACK_BASE+STACK_SIZE-4 // STACK_BASE = (VIVI_PRIV_RAM_BASE - STACK_SIZE) //STACK从上往下用。 所以 STACK_START = STACK_BASE+STACK_SIZE-4 mov fp, #0 @ no previous frame, so fp=0 mov a2, #0 @ set argv to NULL bl main @ call main //如果正常,一去不复返的了 mov pc, #FLASH_BASE @ otherwise, reboot, //FLASH_BASE=ROM_BASE0 = 0x0 @ @ End VIVI head @ /* * subroutines */ @ @ Wake-up codes @ #ifdef CONFIG_PM WakeupStart: // power management 用 @ Clear sleep reset bit ldr r0, PMST_ADDR mov r1, #PMST_SMR str r1, [r0] @ Release the SDRAM signal protections ldr r0, PMCTL1_ADDR ldr r1, [r0] bic r1, r1, #(SCLKE | SCLK1 | SCLK0) str r1, [r0] @ Go... ldr r0, PMSR0_ADDR @ read a return address ldr r1, [r0] mov pc, r1 nop nop 1: b 1b @ infinite loop SleepRamProc: //power management用 @ SDRAM is in the self-refresh mode */ ldr r0, REFR_ADDR ldr r1, [r0] orr r1, r1, #SELF_REFRESH str r1, [r0] @ wait until SDRAM into self-refresh mov r1, #16 1: subs r1, r1, #1 bne 1b @ Set the SDRAM singal protections ldr r0, PMCTL1_ADDR ldr r1, [r0] orr r1, r1, #(SCLKE | SCLK1 | SCLK0) str r1, [r0] /* Sleep... Now */ ldr r0, PMCTL0_ADDR ldr r1, [r0] orr r1, r1, #SLEEP_ON str r1, [r0] 1: b 1b #ifdef CONFIG_TEST hmi: ldr r0, PMCTL0_ADDR // PMCTL0_ADDR: .long 0x4c00000c, Clock Gen Ctrl ldr r1, =0x7fff0 // reset clock gen ctrl str r1, [r0] @ All LED on //点灯? mov r1, #GPIO_CTL_BASE add r1, r1, #oGPIO_F ldr r2,=0x55aa str r2, [r1, #oGPIO_CON] mov r2, #0xff str r2, [r1, #oGPIO_UP] mov r2, #0xe0 str r2, [r1, #oGPIO_DAT] 1: b 1b #endif #endif ENTRY(memsetup) //memsetup子程序 @ initialise the static memory @ set memory control registers mov r1, #MEM_CTL_BASE //memory controller adrl r2, mem_cfg_val add r3, r1, #52 1: ldr r4, [r2], #4 str r4, [r1], #4 cmp r1, r3 bne 1b mov pc, lr //这里返回了么? 注意注意:这里memsetup已经返回了,下面是独立的子程序了呢 |