uboot进入suspend模式:
static int do_suspend (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
#ifndef CONFIG_M6TV
run_command("video dev bl_off",1);
run_command("video dev disable",1);
#endif
meson_pm_suspend();
return 0;
}
U_BOOT_CMD(
suspend, 1, 0, do_suspend,
"suspend",
"/N\n"
"This command will into suspend\n"
);
##################################################################
void meson_pm_suspend(void)
{
writel(0x87654321, P_AO_RTI_STATUS_REG2);//set flag for u-boot suspend cmd
meson_power_suspend();------------------->下面
printf("Elvis ~.~!\n");
elvis_array[3] = get_adc_sample(4);
}
meson_power_suspend()
{
....
addr = 0x9FF04400;
pwrtest_entry = (void (*)(unsigned,unsigned,unsigned,unsigned))addr;//这个地址是把start_arc.S 链接在这里么?
if(test_flag != 1234){
test_flag = 1234;
printf("initial appf\n");
pwrtest_entry(APPF_INITIALIZE,0,0,0);
}
printf("power down cpu --\n");
pwrtest_entry(APPF_POWER_DOWN_CPU,0,0,APPF_SAVE_PMU|APPF_SAVE_VFP|APPF_SAVE_L2);
} ----->调用start_arc.s
.global _start
;; -- start of program section --------------------------
.text
;; -- auto-vector space, jump to start of code ----------
_start:
j boot_start
; reserved for arm reboot code. (0x220 bytes)
.....
boot_start:
; Disable Instruction Cache
; Disable Data Cache
; Release power on pins except test_n, which always need pull_up
; Initialize stack pointer registers
mov sp, 0x8000;_STACK_END
;mov sp , 0xE000
; Initialise small data pointer registers
; mov gp, 0xc1001e00
; Direct to main entry
;disable caches
; lr r0,[0x47]
; or r0,r0,1
; sr r0,[0x47]
; lr r0,[0x11]
; or r0,r0,1
; sr r0,[0x11]
;clear bss segment
mov r0,0
mov r1, __bss_start
clear_loop:
st r0,[r1]
add r1,r1,4
cmp r1,_end
bne clear_loop
bl main===================>跳到power_arc.c 中的main
nop
; Jump to memory location where boot_loader is moved in
b .
nop
./bin2code arc_code $(obj)code_elf.bin $(SRCTREE)/build/include2/arc_code.dat
阅读(2754) | 评论(0) | 转发(0) |