1. vendor/mediatek/proprietary/bootable/bootloader/lk/arch/arm/srt0.S
1 bl kmain
2. vendor/mediatek/proprietary/bootable/bootloader/lk/kernel/main.c
1 void kmain(void) 2 { 3 #if !defined(MACH_FPGA) && !defined(SB_LK_BRINGUP) 4 boot_time = get_timer(0); 5 #endif 6 7 // get us into some sort of thread context 8 thread_init_early(); 9 10 // early arch stuff 11 arch_early_init(); 12 13 // do any super early platform initialization 14 platform_early_init(); 15 16 #if defined(MACH_FPGA) || defined(SB_LK_BRINGUP) 17 boot_time = get_timer(0); 18 #endif 19 20 // do any super early target initialization 21 target_early_init(); 22 23 dprintf(INFO, "welcome to lk\n\n"); 24 25 // deal with any static constructors 26 dprintf(SPEW, "calling constructors\n"); 27 call_constructors(); 28 29 // bring up the kernel heap 30 dprintf(SPEW, "initializing heap\n"); 31 heap_init(); 32 33 // initialize the threading system 34 dprintf(SPEW, "initializing threads\n"); 35 thread_init(); 36 37 // initialize the dpc system 38 dprintf(SPEW, "initializing dpc\n"); 39 dpc_init(); 40 41 // initialize kernel timers 42 dprintf(SPEW, "initializing timers\n"); 43 timer_init(); 44 45 #ifdef MTK_LK_IRRX_SUPPORT 46 mtk_ir_init(0); 47 #endif 48 49 50 #if (!ENABLE_NANDWRITE) 51 // create a thread to complete system initialization 52 dprintf(SPEW, "creating bootstrap completion thread\n"); 53 thread_resume(thread_create("bootstrap2", &bootstrap2, NULL, DEFAULT_PRIORITY, DEFAULT_STACK_SIZE)); 54 55 // enable interrupts 56 exit_critical_section(); 57 58 // become the idle thread 59 thread_become_idle(); 60 #else 61 bootstrap_nandwrite(); 62 #endif 63 }