# 启动架构

引导架构在引导的每个阶段使用 boot loader 和板级支持包 (BSP) 镜像。boot loader 管理每个启动阶段，直到 Linux 内核和应用程序准备好运行。

## Boot loader

系统在加电时运行 boot loader 软件，作为加载操作系统和其他所需应用的接口。

Qualcomm 芯片组（包括 Qualcomm Linux 支持的芯片组）采用以下多阶段启动过程：

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by Microsoft Visio, SVG Export boot-loader.svg Layer_1 -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="11.4583in" height="1.71496in" viewbox="0 0 825 123.477" xml:space="preserve" color-interpolation-filters="sRGB" class="st13" aria-label="../../_images/boot-loader.svg"><v:documentproperties v:langid="1033" v:viewmarkup="false"></v:documentproperties>
<style>.svg-1 .st1 { fill: #fafafa; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st2 { fill: #d2d7e1; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st3 { fill: #6280cc; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st4 { fill: #ffffff; font-family: SimHei; font-size: 1.00001em; font-weight: bold }
.svg-1 .st5 { font-family: Calibri; font-size: 1em }
.svg-1 .st6 { font-size: 1em; font-weight: normal }
.svg-1 .st7 { font-family: Roboto; font-size: 1em; font-weight: normal }
.svg-1 .st8 { fill: #ffffff; font-family: Calibri; font-size: 1.00001em; font-weight: bold }
.svg-1 .st9 { font-size: 1em }
.svg-1 .st10 { font-family: SimHei; font-size: 1em; font-weight: normal }
.svg-1 .st11 { stroke: #000000; stroke-linecap: butt; stroke-width: 0.756033 }
.svg-1 .st12 { fill: #000000; stroke: none; stroke-linecap: butt; stroke-width: 0.75 }
.svg-1 .st13 { fill: none; fill-rule: evenodd; font-size: 12px; overflow: visible; stroke-linecap: square; stroke-miterlimit: 3 }</style>
<g v:mid="0" v:index="1" v:groupcontext="foregroundPage">	<title>Layer_1</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<v:layer v:name="Connector" v:index="0"></v:layer>	<g id="group1-1" v:mid="1" v:groupcontext="group">		<title>Sheet.1</title>		<g id="shape2-2" v:mid="2" v:groupcontext="shape" transform="translate(0.378067,-0.378101)">			<title>Sheet.2</title>			<path d="M-0 117.81 A5.67054 5.67054 -180 0 0 5.67 123.48 L818.57 123.48 A5.67054 5.67054 -180 0 0 824.24 117.81						 L824.24 6.43 A5.67054 5.67054 -180 0 0 818.57 0.76 L5.67 0.76 A5.67054 5.67054 -180 0 0 0 6.43 L0 117.81						 Z" class="st1"></path>		</g>		<g id="shape3-4" v:mid="3" v:groupcontext="shape">			<title>Sheet.3</title>			<path d="M818.95 0.76 C821.87 0.76 824.24 3.13 824.24 6.05 L824.24 117.43 C824.24 120.35 821.87 122.72 818.95 122.72						 L6.05 122.72 C3.13 122.72 0.76 120.35 0.76 117.43 L0.76 6.05 C0.76 3.13 3.13 0.76 6.05 0.76 L818.95						 0.76 ZM818.95 0 L6.05 0 C2.71 0 0 2.71 0 6.05 L0 117.43 C0 120.77 2.71 123.48 6.05 123.48 L818.95 123.48						 C822.29 123.48 825 120.77 825 117.43 L825 6.05 C825 2.71 822.29 0 818.95 0 Z" class="st2"></path>		</g>	</g>	<g id="shape4-6" v:mid="4" v:groupcontext="shape" transform="translate(429.511,-9)">		<title>Sheet.4</title>		<desc>统一可扩展固件接口 (UEFI) 定义 Linux 操作系统和平 台固件的软件接口</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="87.5318" cy="73.0792" width="175.07" height="100.796"></v:textrect>		<path d="M0 120.45 A3.0242 3.0242 -180 0 0 3.02 123.48 L172.04 123.48 A3.0242 3.0242 -180 0 0 175.06 120.45 L175.06 25.71					 A3.0242 3.0242 -180 0 0 172.04 22.68 L3.02 22.68 A3.0242 3.0242 -180 0 0 0 25.71 L0 120.45 Z" class="st3"></path>		<text x="33.32" y="46.3" class="st4" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>统一可扩展固件接口<v:lf></v:lf><tspan x="72.6" dy="1.2em" class="st5">(UEFI)<v:newlinechar></v:newlinechar><v:newlinechar></v:newlinechar></tspan><tspan x="22.28" dy="2.498em" class="st6">定义</tspan><tspan class="st7"> </tspan><tspan class="st7">Linux </tspan><tspan class="st6">操作系统和平<v:lf></v:lf></tspan><tspan x="39.53" dy="1.331em" class="st6">台固件的软件接口</tspan></text>		</g>	<g id="shape5-15" v:mid="5" v:groupcontext="shape" transform="translate(638.596,-9)">		<title>Sheet.5</title>		<desc>systemd-boot manager 运行配置的 EFI 图像</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="87.5318" cy="73.0792" width="175.07" height="100.796"></v:textrect>		<path d="M0 120.45 A3.0242 3.0242 -180 0 0 3.02 123.48 L172.04 123.48 A3.0242 3.0242 -180 0 0 175.06 120.45 L175.06 25.71					 A3.0242 3.0242 -180 0 0 172.04 22.68 L3.02 22.68 A3.0242 3.0242 -180 0 0 -0 25.71 L0 120.45 Z" class="st3"></path>		<text x="53.11" y="47.09" class="st8" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>systemd-boot<v:lf></v:lf><tspan x="65.51" dy="1.2em" class="st9">manager<v:newlinechar></v:newlinechar><v:newlinechar></v:newlinechar></tspan><tspan x="57.53" dy="2.4em" class="st10">运行配置的<v:lf></v:lf></tspan><tspan x="65.69" dy="1.298em" class="st7">EFI </tspan><tspan class="st10">图像</tspan></text>		</g>	<g id="shape6-22" v:mid="6" v:groupcontext="shape" transform="translate(11.4682,-9)">		<title>Sheet.6</title>		<desc>Primary Boot Loader (PBL) 建立安全的 RoT 和安全启动过程</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="87.5318" cy="73.0792" width="175.07" height="100.796"></v:textrect>		<path d="M0 120.45 A3.0242 3.0242 -180 0 0 3.02 123.48 L172.04 123.48 A3.0242 3.0242 -180 0 0 175.06 120.45 L175.06 25.71					 A3.0242 3.0242 -180 0 0 172.04 22.68 L3.02 22.68 A3.0242 3.0242 -180 0 0 -0 25.71 L0 120.45 Z" class="st3"></path>		<text x="36.21" y="46.3" class="st8" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Primary Boot Loader<v:lf></v:lf><tspan x="74.7" dy="1.2em" class="st9">(PBL)<v:newlinechar></v:newlinechar><v:newlinechar></v:newlinechar></tspan><tspan x="45.35" dy="2.498em" class="st10">建立安全的</tspan><tspan class="st7"> </tspan><tspan class="st7">RoT<v:lf></v:lf></tspan><tspan x="45.53" dy="1.331em" class="st10">和安全启动过程</tspan></text>		</g>	<g id="shape7-30" v:mid="7" v:groupcontext="shape" transform="translate(220.426,-9)">		<title>Sheet.7</title>		<desc>eXtensible Boot Loader (XBL) 初始化内存 子系统</desc>		<v:textblock v:margins="rect(0,0,0,0)"></v:textblock>		<v:textrect cx="87.5318" cy="73.0792" width="175.07" height="100.796"></v:textrect>		<path d="M0 120.45 A3.0242 3.0242 -180 0 0 3.02 123.48 L172.04 123.48 A3.0242 3.0242 -180 0 0 175.06 120.45 L175.06 25.71					 A3.0242 3.0242 -180 0 0 172.04 22.68 L3.02 22.68 A3.0242 3.0242 -180 0 0 0 25.71 L0 120.45 Z" class="st3"></path>		<text x="29.6" y="47.09" class="st8" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>eXtensible Boot Loader<v:lf></v:lf><tspan x="74.59" dy="1.2em" class="st9">(XBL)<v:newlinechar></v:newlinechar><v:newlinechar></v:newlinechar></tspan><tspan x="57.53" dy="2.4em" class="st10">初始化内存<v:lf></v:lf></tspan><tspan x="69.53" dy="1.298em" class="st10">子系统</tspan></text>		</g>	<g id="group20-36" transform="translate(186.404,-56.3823)" v:mid="20" v:groupcontext="group">		<title>Sheet.20</title>		<g id="shape21-37" v:mid="21" v:groupcontext="shape" transform="translate(0,-3.01586)">			<title>Sheet.21</title>			<path d="M0 123.48 L29.68 123.48" class="st11"></path>		</g>		<g id="shape22-40" v:mid="22" v:groupcontext="shape" transform="translate(28.7987,0)">			<title>Sheet.22</title>			<path d="M0 123.48 L5.22 120.46 L0 117.45 L0 123.48 Z" class="st12"></path>		</g>	</g>	<g id="group23-42" transform="translate(395.489,-56.3823)" v:mid="23" v:groupcontext="group">		<title>Sheet.23</title>		<g id="shape24-43" v:mid="24" v:groupcontext="shape" transform="translate(0,-3.01586)">			<title>Sheet.24</title>			<path d="M0 123.48 L29.68 123.48" class="st11"></path>		</g>		<g id="shape25-46" v:mid="25" v:groupcontext="shape" transform="translate(28.7987,0)">			<title>Sheet.25</title>			<path d="M0 123.48 L5.22 120.46 L0 117.45 L0 123.48 Z" class="st12"></path>		</g>	</g>	<g id="group26-48" transform="translate(604.574,-56.3823)" v:mid="26" v:groupcontext="group">		<title>Sheet.26</title>		<g id="shape27-49" v:mid="27" v:groupcontext="shape" transform="translate(0,-3.01586)">			<title>Sheet.27</title>			<path d="M0 123.48 L29.68 123.48" class="st11"></path>		</g>		<g id="shape28-52" v:mid="28" v:groupcontext="shape" transform="translate(28.7987,0)">			<title>Sheet.28</title>			<path d="M0 123.48 L5.22 120.46 L0 117.45 L0 123.48 Z" class="st12"></path>		</g>	</g></g>
</svg>

### Primary boot loader (PBL)

- 为应用程序建立安全的 root-of-trust (RoT) 和安全启动过程。如需了解更多详细信息，请参阅[安全启动](https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-11/features.html#secure-boot)。
- 识别主存储设备并加载称为 eXtensible Boot Loader (XBL) 的二级 boot loader。

    如果系统在加载 XBL 镜像时遇到任何可恢复错误，PBL 将进入紧急下载 (EDL) 模式。如需了解更多如何检测 EDL 模式的详细信息，请参阅 [枚举 EDL 设备管理器](https://docs.qualcomm.com/doc/80-70022-4SC/topic/edl-device-manager-enumeration.html#edl-device-manager-enumeration)。
- 将 XBL 段加载到启动 SoC 内部存储器中。如需了解更多 PBL 如何加载 XBL 段的详细信息，请参阅 [APSS 冷启动流程](https://docs.qualcomm.com/doc/80-70022-4SC/topic/bootloader-architecture.html#bootloader-architecture)。

### eXtensible Boot Loader (XBL)

- 初始化硬件、固件镜像、CPU 缓存、MMU、启动设备、PMIC 和 DDR
- 设置 RAM dump USB 驱动程序、USB 充电、温度检测、电源管理集成电路 ([PMIC](https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-4/pmic-developer-touchpoints.html)) 和低功耗双倍数据速率 (LPDDR) 时钟功能。
- 通过 USB 将 RAM dump 收集到主 PC 上。
- 加载并验证 Qualcomm^®^ 受信任执行环境 (Qualcomm TEE)、Qualcomm Hypervisor 和 UEFI 镜像。
- 提供 XBL 配置 (`XBL_CFG`)，这是冷启动流程的一个组件，包括 PMIC 和其他驱动程序设置。
- 为 XBL 提供 Qualcomm 签名的 ELF 段，以初始化外部保护单元（xPU）。
- XBL\_CFG 是一个独立的二进制文件，具有特定于平台的配置和设置。XBL 使用 XBL\_CFG 驱动程序加载和配置所需的设置。驱动程序使用二进制文件提供对 XBL\_CFG 的每个配置的读取权限。

### 统一可扩展固件接口 (UEFI)

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewbox="0 0 640 400" width="640" height="400" style="cursor:auto !important" aria-label="../../_images/Boot_QLI_videos_html.svg" class="align-center">
    <defs>
      <style>@import url("https://fonts.googleapis.com/css2?family=Roboto+Flex:opsz,wght@8..144,100..1000&amp;display=swap");
.svg-2 .bg-fill { fill: var(--color-background) }
.svg-2 .fill-text { color: var(--color-content); fill: var(--color-content) }
.svg-2 .video-hoverbox { transition: opacity 0.15s ease-in-out }
.svg-2 .video-hoverbox:hover { opacity: 0.9 }</style>
  </defs>

  <foreignobject x="0" y="0" width="640" height="400">
    <body xmlns="http://www.w3.org/1999/xhtml">
        <iframe width="640" height="400" src="https://players.brightcove.net/1414329538001/4JiZQnWhg_default/index.html?videoId=6362756918112" allowfullscreen="" allow="encrypted-media"></iframe>.
    <div class='topic-detail'><div class='topic-updated-date'><span> Last Published: </span>Dec 07, 2025</div><div class='prev-and-next-links'><span class='previous-topic-link'><span aria-hidden='true' class='disabled' data-tip='' data-effect='solid'></span></span></div></div></body>
    </foreignobject>
</svg>

UEFI 是操作系统 (OS) 和平台固件之间的软件接口。

它包括带有平台信息的数据表，以及操作系统及其加载程序可以使用的引导和 runtime 服务调用。它们共同创建了用于启动操作系统和运行 UEFI 应用程序的标准环境。

Qualcomm 使用 Tianocore EDK-II，这是 [http://www.tianocore.org/edk2/](https://github.com/tianocore/tianocore.github.io/wiki/EDK-II/) 上提供的开源实现，它遵循 [UEFI 规范](https://uefi.org/specs/UEFI/2.10/)。

该系统提供以下编译选项：

- Retail build：由于具有最少的调试功能和最佳的内存占用，使其成为生产环境的理想选择。
- Debug build：适用于开发环境，启用所有调试功能。

如需了解开发 UEFI 应用程序的信息，请参阅[统一可扩展固件接口 (UEFI)](https://docs.qualcomm.com/doc/80-70022-4SC/topic/develop-boot-public.html#develop-boot-public)。

### systemd-boot 操作系统管理器

systemd-boot 是一个 UEFI 启动管理器，用于执行配置的 EFI 镜像。它仅支持具有 UEFI 固件的系统，并执行以下操作：

- 从 EFI 系统分区（ESP，在 Linux 操作系统 runtime 期间挂载于 `/efi`、`/boot` 或 `/boot/efi`）和扩展 boot loader 分区（XBOOTLDR，挂载于 `/boot`）加载启动项信息。

    您必须在 ESP 或 XBOOTLDR 中找到配置文件段、内核、初始 RAM 磁盘 (initrd) 和其他 EFI 镜像。
- 读取简单且通用的引导加载程序配置文件，并为每个引导加载程序条目选择一个文件。所有文件均在 ESP 分区中。

为了确保 Qualcomm Linux 内核可作为 EFI 镜像运行，请使用 `CONFIG_EFI_STUB` 编译选项。

## 后续步骤

- EFI 启动存根，请参阅 [https://docs.kernel.org/admin-guide/efi-stub.html](https://docs.kernel.org/admin-guide/efi-stub.html)。
- 有关 EFI 分区的示例结构，请参见 [Qualcomm Linux Yocto 指南的 Systemd-boot](https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-27/configure_and_secure_boot_with_systemd_boot_and_uki.html#efi-image)。

Last Published: Dec 07, 2025

[Previous Topic
启动概述](https://docs.qualcomm.com/bundle/publicresource/80-70022-4SC/topics/overview.md) [Next Topic
APSS 冷启动流程](https://docs.qualcomm.com/bundle/publicresource/80-70022-4SC/topics/bootloader-architecture.md)