ZHCAG72 September   2026

 

  1.   1
  2.   摘要
  3.   商标
  4. 1简介
  5. 2启动流程
    1. 2.1 SPL启动流程
      1. 2.1.1 R5 SPL
      2. 2.1.2 TF-A+OPTEE+A53 SPL
      3. 2.1.3 U-Boot
      4. 2.1.4 Linux以及用户态
    2. 2.2 SPL Falcon模式
      1. 2.2.1 实现步骤
        1. 2.2.1.1 安装Linux SDK
        2. 2.2.1.2 添加falcon脚本
        3. 2.2.1.3 编译Linux设备树
        4. 2.2.1.4 制作tispl.bin
        5. 2.2.1.5 制卡启动
    3. 2.3 从SPL替换为SBL
      1. 2.3.1 在SBL中进行Falcon启动
  6. 3启动介质
  7. 4操作系统启动优化
    1. 4.1 裁剪操作系统
      1. 4.1.1 使用预设的裁剪
      2. 4.1.2 自定义裁剪
    2. 4.2 减少log输出
  8. 5用户空间优化
    1. 5.1 使用systemd自定义启动服务
  9. 6使用init脚本最小化启动服务
  10. 7总结
  11. 8参考文献

TF-A+OPTEE+A53 SPL

TF-A+OPTEE+A53 SPL 以下简称A53 SPL。如名称所示,这个流程会加载运行ARM Trusted Firmware, OPTEE 和A53 SPL。这部分镜像都打包在tislp.bin中,包中镜像的加载位置等配置描述位于设备树文件k3-binman.dtsi中,tispl.bin的结构如下图所示,包括了ATF,OPTEE,DM镜像,SPL镜像以及一些设备树文件。

 tispl镜像打包 图 2-5 tispl镜像打包

以下是对应的打包log,打包的过程中会将U-Boot.img一起进行打包。

Pack completed after 1 pass(es)
Writing image to './custMpk.pem'
Wrote 0xcab bytes
Pack completed after 1 pass(es)
Writing image to './ti-degenerate-key.pem'
Wrote 0x21a bytes
Pack completed after 1 pass(es)
Writing image to './ti-dm.bin'
Wrote 0x8edf0 bytes
Pack completed after 1 pass(es)
Writing image to './tifsstub.bin_hs'
Wrote 0x6d1 bytes
Pack completed after 1 pass(es)
Writing image to './tifsstub.bin_fs'
Wrote 0x0 bytes
Pack completed after 1 pass(es)
Writing image to './tifsstub.bin_gp'
Wrote 0x3ca bytes
Pack completed after 1 pass(es)
Writing image to './tispl.bin'
Wrote 0x165bab bytes
Pack completed after 1 pass(es)
Writing image to './u-boot.img'
Wrote 0x11ff63 bytes
Pack completed after 1 pass(es)
Writing image to './tispl.bin_unsigned'
Wrote 0x163a77 bytes
Pack completed after 1 pass(es)
Writing image to './u-boot.img_unsigned'
Wrote 0x11f21b bytes

A53 SPL对应的启动log如下,这部分的启动耗时约1.4s,主要的耗时仍然在于搬运加载对应的镜像文件,与启动介质息息相关。

 [2025-08-05 19:53:27.425] 
[2025-08-05 19:53:27.425] NOTICE: BL31: v2.11.0(release):v2.11.0-906-g58b25570c9-dirty
[2025-08-05 19:53:27.425] NOTICE: BL31: Built : 04:20:32, Nov 1 2024
[2025-08-05 19:53:27.681]
[2025-08-05 19:53:27.681] U-Boot SPL 2024.04-ti-g29d0c23d67ee (Nov 29 2024 - 11:41:54 +0000)
[2025-08-05 19:53:27.681] SYSFW ABI: 4.0 (firmware rev 0x000a '10.1.8--v10.01.08 (Fiery Fox)')
[2025-08-05 19:53:27.696] Trying to boot from MMC2
 [2025-08-05 19:53:28.193] Authentication passed 

 [2025-08-05 19:53:28.833] Authentication passed 

在这部分的启动过程中,还会进行两个镜像的验签,对应启动log中"Authentication passed",对应代码ti_secure_image_post_process(),验签只针对DM镜像和设备树文件,ATF和OPTEE并不验签,验签耗时较短,对整体启动速度影响不大。