Take tiny4412 as an example:
Arch/arm/mach-exynos/mach-tiny4412.c
" TINY4412 " ) /**/ . Boot_params 0x100, . INIT_IRQ = Exynos4_init_irq, . map_io = smdk4x12_map_io, . init_machine = smdk4x12_machine_init, . Timer = &Exynos4_timer, . Reserve = &exynos4_reserve,machine_end
which
#define Machine_start (_type,_name) staticconststruct machine_desc __mach_desc_# #_type __used __attribute__ ((__section__ (". Arch.info.init")) = { . nr = mach_type_# #_type, . Name = _name,#define machine_end \};
At startup:
Start_kernel-----INIT/MAIN.C
----> Setup_arch----arch/arm/kernel/setup.c
----> Mdesc = setup_machine_tags (Machine_arch_type); Here, the structure is found on the basis of Machine_arch_type.
----> Machine_desc = MDESC;
Paging_init, ---(mdesc) (ARCH/ARM/MM/MMU.C)
----> Devicemaps_init (MDESC)
----> Mdesc->map_io () called the function Smdk4x12_map_io
Init_machine the process that is called in kernel