高通平台启动流程


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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

嘉兴老杨

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值