总目录:高通821平台LCD调试
一、LK部分启动流程框图
二、LK引导流程
2.1 crt0.S
crt0.s中的_start函数为入口函数,crt0.s主要初始化CPU,然后长跳转(bl)到lk/kernel/main.c中kmain函数
bl kmain
2.2 kmain
/lk/kernel/main.c
进入kmain后,kmain唤醒并创建了一个bootstrap2的进程,来完成系统的初始化工作
thread_resume(thread_create("bootstrap2", &bootstrap2, NULL, DEFAULT_PRIORITY, DEFAULT_STACK_SIZE));
2.3 bootstrap2
/lk/kernel/main.c
bootstrap2会调用apps_init来进行应用组件的初始化
apps_init();
2.4 apps_init
/lk/app/app.c
apps_init会依次扫描各个需要初始化和启动的应用组件,其中就包括aboot
void apps_init(void)
{
const struct app_descriptor *app;
/* call all the init routines */
for (app = &__apps_start; app != &__apps_end; app++) {
if (app->init)
app->init(app);
}
/* start any that want to start on boot */
for (app = &__apps_start; app != &__apps_end; app++) {
if (app->entry && (app->flags & APP_FLAG_DONT_START_ON_BOOT) == 0) {
start_app(app);
}
}
}
APP_START(aboot)
.init = aboot_init,
APP_END
可以看到当启动aboot时,直接进入了aboot_init这个接口
2.5 aboot_init
./app/aboot/aboot.c
关于aboot阶段,完成许多的工作包括:flash的烧写,如果是正常启动判断启动模式是normal模式,否则会根据按键等参数判断是进入fastboot还是recovery,本文主要缕清LCD相关的流程,只讨论LCD相关的部分。aboot_init中会调用target_display_init这个接口进入LCD的配置
扫描二维码关注公众号,回复:
2148993 查看本文章
target_display_init(device.display_panel);
形参传入的参数定义为:
#define DISPLAY_PANEL_TIANMA "tianma_fhd_video"
strlcpy(device.display_panel, DISPLAY_PANEL_TIANMA, sizeof(device.display_panel));
2.5 target_display_init
./target/msm8996/target_display.c
在target_display_init.c中直接调用gcdb_display_init来完成初始化,
GCDB (GCDB:Global Component Database全局组件数据库 )
if (gcdb_display_init(oem.panel, MDP_REV_50, (void *)MIPI_FB_ADDR)) {
target_force_cont_splash_disable(true);
msm_display_off();
}