本文转载自:http://blog.csdn.net/kris_fei/article/details/53464461
latform: ROCKCHIP
OS: Android 6.0
Kernel: 3.10.92
描述:
当系统全部download开机后,会默认进入Recovery模式,这个其实是misc分区里的内容在作怪.
misc分区:
misc.img是RK原始就提供而不是自己编译生成的,其实misc里内容就两行,用UE可查看:
Uboot log:
#Boot ver: 2016-11-29#2.30
empty serial no.
normal boot.
checkKey
vbus = 1
read logo on state from dts [1]
pll_src = 0, dclk_hz = 138700000, dclk_div = 2
edp pll locked
Aux Transaction fail!
link training success.
unable to config video
got recovery cmd from misc. //从它入手!
load fdt from resouce.
Secure Boot state: 0
Uboot 流程:
board_late_init -> rk32xx.c
board_fbt_preboot -> fastboot.c
rkloader_run_misc_cmd ->
get_disk_partition -> //获取misc分区的ptn, MISC_NAME是"misc"
StorageReadLba -> //这里正是读取misc分区有内容的地方
do_bootrk //如果有boot-recovery的命令,那么开机进入recovery模式. 第一此会成立,开机进入recovery后misc cmd会被清掉.
Recovery流程:
main -> recovery.cpp
get_args ->
get_bootloader_message -> bootloader.cpp
volume_for_path //获取misc分区
get_bootloader_message_block_rk29 //和uboot一样读取misc里的内容
//不过这里主要获取的是--wipe_all 这条命令,接着就会做wipe data/cache的动作.
finish_recovery -> //等全部正常完成后,会去清除misc分区里的内容,否则会一直进入recovery模式.
set_bootloader_message //清除动作.
这样的设计使得每次download后就不用再去清data/cache了,比较方便.