您的位置:首页 > 其它

高通平台启动流程

2015-10-20 17:24 239 查看


Startup Sequence

arch/arm/crt0.S: _start (defined in arch/arm/system-onesegment.ld)

Setup CPU
Calls __cpu_early_init if necessary
Relocate if necessary
Setup stack
Calls kmain()

platform/<platform>/(arch_init.S): __cpu_early_init

Platform-specific initialization sequence, e.g. for 8K targets

kernel/main.c: kmain()

arch_early_init()
platform_early_init()
target_early_init()
call constructors defined by __ctor_list (which is nothing)
init: heap, thread, dpc, timer
create init thread: bootstrap2(), main thread goes to sleep

kernel/main.c: bootstrap2()

arch_init()
platform_init()
target_init()
apps_init()

arch/arm/arch.c: arch_early_init()

disable cache
set IRQ vector base
init MMU
MMU mapping
enable cache
init Neon

platform/<platform>/(platform.c): platform_early_init()

init UART
init interrupts
init timer

target/init.c: target_early_init()

Stub (weak references, can be overridden)

arch/arm/arch.c: arch_init()

Stub

platform/<platform>/(platform.c): platform__init()

init Apps CPU clock
init MDDI/LCDC
setup frame buffer

target/<target>/(init.c): target_init()

init keypad
init flash partition table
init flash

app/init.c: apps_init()

init apps that are defined using APP_START & APP_END macros, aboot_init() is
called during this step
run the app in a separate thread if it has .entry section

app/aboot/aboot.c: aboot_init()

fastboot (boot from USB) if key pressed
boot from flash if key not pressed

Notes on file & directory names

<...> match to the corresponding platform or target, e.g. msm7k, surf-qsd8250
(...) are preferred name but not necessary enforced


[edit]Makefile
include order

/makefile includes /project/$PRJECTNAME.mk
/project/$PRJECTNAME.mk includes /target/$TARGET/rules.mk
/target/$TARGET/rules.mk includes /platform/$PLATFORM/rules.mk

/project/$PRJECTNAME.mk specifies

$TARGET
modules to include (under /app)

/target/$TARGET/rules.mk specifies

$PLATFORM
board-level settings: membase, memsize, linux_machinetype, gpio keypad

/platform/$PLATFORM/rules.mk specifies

CPU-level settings: ARCH, ARM_CPU, CPU
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: