高通平台lk的启动流程

1.lk/ arch/ arm/ crt0.S                    

bl      kmain

2.lk/ kernel/ main.c                           

/* 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;
}

3.lk/ app/ app.c

void apps_init(void)

---------------------------------------------------------------------------------------------------------------------

4.lk/app/aboot/aboot.c

void aboot_init(const struct app_descriptor *app)

{target_display_init(device.display_panel);}

5.lk/target/msm8937_64_a8001/target_display.c

void target_display_init(const char *panel_name)

6.lk/dev/gcdb/display/gcdb_display.c

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);     //调用电源函数和背光函数

}

7.lk/platform/msm_shared/display.c

int msm_display_init(struct msm_fb_panel_data *pdata)

{

ret = msm_display_config();

}

int msm_display_config()

{

ret = mdss_dsi_config(panel);

}

8.lk/platform/msm_shared/mipi_dsi.c

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函数


---------------------------------------------------------------------------------------------------------------------------------

lk传参到kernel

1.lk/dev/gcdb/display/gcdb_display_param.c


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


kernel获取LK保存的pbuf

2.kernel/msm-3.18/init/main.c

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

解析出所用的LCD并初始化

3.kernel/msm-3.18/drivers/video/msm/mdss/mdss_dsi.c

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





阅读更多
文章标签: lcm
个人分类:
下一篇高通LCD kernel层代码跟踪分析
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭