MACHINE_START之分析

MACHINE_START(XXX, "xxx")
    .phys_io     = PA_UART0,
    .io_pg_offst = (((u32)VA_UART0) >> 18) & 0xfffc,
    .boot_params = SDRAM_PA + 0x100,
     .fixup     = xxx_fixup,
    .init_irq   = xxxx_init_irq,
    .map_io     = xxx_map_io,
    .init_machine   = xxxmachine_init,

    .timer      = &xxx_timer,

MACHINE_END


start_kernel里setup_arch:

mdesc = setup_machine(machine_arch_type);

init_arch_irq = mdesc->init_irq;
system_timer = mdesc->timer;
init_machine = mdesc->init_machine;

mdesc 即是我们定义的machine type,这个结构体里我们定义的借口调用顺序如下:

mdesc->fixup();           //setup_arch调用

mdesc->map_io();     //setup_arch-》paging_init-》devicemaps_init

init_arch_irq;               //start_kernel-》init_IRQ

system_timer->init();    //start_kernel-》time_init

init_machine;                //arch_initcall

你可能感兴趣的:(MACHINE_START之分析)