阅读:2875回复:0
执行开机命令的最佳位置
1. GPIO初始化:
timing.c的__bl2_reg数组定义,如: /* Enable VCCK GPIOAO_2*/ {AO_GPIO_O_EN_N, (0 << 2), (1 << 2), 0, BL2_INIT_STAGE_1, 0}, {AO_GPIO_O, (1 << 2), (1 << 2), 0, BL2_INIT_STAGE_1, 0}, 2. 功能函数执行: 放在int board_late_init(void)中 如果是要power键开机后执行,加上判断条件: char *s_reboot_mode = getenv("reboot_mode"); if (!(!strcmp(s_reboot_mode, "cold_boot"))) { run_command("your Commands",1); } 就算在这里修改,mmc、flash、irq、clk等初始化仍然需要2s左右时间,不知有没有办法优化 |
|