Source Tree Structure

SBL source code is organized into common and platform specific folders:

|-- BootloaderCommonPkg/
|-- BootloaderCorePkg/
|   |-- Stage1A/
|   |-- Stage1B/
|   |-- Stage2/
|   `-- Tools/
|-- PayloadPkg/
|   |-- OsLoader/
|   `-- FirmwareUpdate/
|-- Platform/
`-- Silicon/

Here’s a brief descripton of each of these folders:
Top-level build script. Performs tool chain setup, pre-build, configuration, compilation and post-build steps.
Common libraries for all stages of boot flow

Stage1A code initializes platform from reset vector till Cache-As-RAM (CAR) is setup. It then transfers control to Stage1B.

It invokes FSP-T.


Stage1B code initializes platform from CAR to the point system memory is fully initialized. It then transfers control to Stage2.

It invokes FSP-M.


Stage2 code performs additional platform initialization and transfers control to payload.

It invokes FSP-S.

Contains helper and common scripts for build and configuration during build process
Contains files that implement OS boot logic from boot media.
Contains files that implement platform-independent logic to perform firmware update flow instead of booting OS.
Board specific code for a supported platform.
Silicon specific code for a supported SoC.

Package Dependency

SBL source tree contains multiple packages (subdirectories) that are organized in a manner to provide modularity and ease of use when extending new features or porting for a new board. The following rules shall be followed when one makes code changes:

  • BootloaderCorePkg and PayloadPkg are mutually exclusive. They should not have code dependency to one or the other.
  • PayloadPkg should not have dependency to code under Platform or Silicon directories. PayloadPkg should only depends on libraries in BootloaderCommonPkg.

The source tree is organized as core, silicon and platform. A typical platform porting requires code change only in the platform directories.