bl kmain
/* called from crt0.S */
void kmain(void) __NO_RETURN __EXTERNALLY_VISIBLE;
void kmain(void)
{
// get us into some sort of thread context
thread_init_early();
// early arch stuff
arch_early_init();
// do any super early platform initialization
platform_early_init();
// do any super early target initialization
target_early_init();
dprintf(INFO, "welcome to lk\n\n");
// create a thread to complete system initialization
dprintf(SPEW, "creating bootstrap completion thread\n");
thr = thread_create("bootstrap2", &bootstrap2, NULL, DEFAULT_PRIORITY, DEFAULT_STACK_SIZE);
}
static int bootstrap2(void *arg)
{
// initialize the rest of the platform
dprintf(SPEW, "initializing platform\n");
platform_init();
// initialize the target
dprintf(SPEW, "initializing target\n");
target_init(); // target/msm8937_64_a8001/init.c -->> target_keystatus();初始化音量键
dprintf(SPEW, "calling apps_init()\n");
apps_init();
return 0;
}
void apps_init(void)
---------------------------------------------------------------------------------------------------------------------
void aboot_init(const struct app_descriptor *app)
{target_display_init(device.display_panel);}
void target_display_init(const char *panel_name)
int gcdb_display_init(const char *panel_name, uint32_t rev, void *base)
{
pan_type = oem_panel_select(panel_name, &panelstruct, &(panel.panel_info),
&dsi_video_mode_phy_db);
target/msm8937_64_a8001/oem_panel.c lcd读取ID
int oem_panel_select(const char *panel_name, struct panel_struct *panelstruct,
struct msm_panel_info *pinfo,
struct mdss_dsi_phy_ctrl *phy_db)
panel.power_func = mdss_dsi_panel_power; //初始化电源函数
panel.bl_func = mdss_dsi_bl_enable; //初始化背光函数
ret = msm_display_init(&panel); //调用电源函数和背光函数
}
int msm_display_init(struct msm_fb_panel_data *pdata)
{
ret = msm_display_config();
}
int msm_display_config()
{
ret = mdss_dsi_config(panel);
}
int mdss_dsi_config(struct msm_fb_panel_data *panel)
{
ret = mdss_dsi_panel_initialize(mipi, mipi->broadcast);
}
int mdss_dsi_panel_initialize(struct mipi_panel_info *mipi, uint32_t broadcast)
{
status = mdss_dsi_read_panel_signature(mipi);
}
static uint32_t mdss_dsi_read_panel_signature(struct mipi_panel_info *mipi) //读取屏ID函数
---------------------------------------------------------------------------------------------------------------------------------
bool gcdb_display_cmdline_arg(char *pbuf, uint16_t buf_size)
{
char *display_cmd_line = pbuf;
rc = mdss_dsi_set_panel_node(oem_data.panel, &dsi_id, &panel_node,&slave_panel_node, &panel_mode);
dprintf(INFO, "display kernel cmdline:%s\n",display_cmd_line);
}
[1640] display kernel cmdline: mdss_mdp.panel=1:dsi:0:qcom,mdss_dsi_ota7291a_wxga_video:1:none:cfg:single_dsi
asmlinkage __visible void __init start_kernel(void)
{
setup_arch(&command_line);
setup_command_line(command_line);
pr_notice("Kernel command line: %s\n", boot_command_line);
}
【0.000000】 Kernel command line: sched_enable_hmp=1 sched_enable_power_aware=1 console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3
static struct device_node *mdss_dsi_config_panel(struct platform_device *pdev,int ndx)
{
/* find panel device node */
dsi_pan_node = mdss_dsi_find_panel_of_node(pdev, panel_cfg);
rc = mdss_dsi_panel_init(dsi_pan_node, ctrl_pdata, ndx);
}
[ 4.538709] mdss_dsi_find_panel_of_node: cmdline:0:qcom,mdss_dsi_ota7291a_wxga_video:1:none:cfg:single_dsi panel_name:qcom,mdss_dsi_ota7291a_wxga_video
[ 4.551592] mdss_dsi_panel_init: Panel Name = ota7291a wxga video mode dsi panel