Ease of platform and board customization is one of the most important design goal of creating SBL. It has many benefits from both system perspective and business use cases. For example,
- By using a centralized configuration infrasture code, it is easier to manage all configuration related data in all boot stages in the same way
- Because configuration data is packed into a central region in SBL image, it is easier to customize these changes, or add security protection, or optimize its footprint.
- By defining a standardized human readable configuration format, it is easier to create tools to provide user interface to manage many platform configurations.
After all, SBL is designed for embedded systems where a vast diversity of platform settings exists for the same generation of silicon.
SBL has two sets of configuration data in the image:
- Internal configuration data
- Software default values. It is unchangeable once SBL is built. In case of external configuration data is not available or corrupted, internal data is loaded instead.
- External configuration data
- Platform specific data which is configurable by tools. It can be protected with user provided key.
Platform ID and board ID are used interchangeablely in this section
SBL uses platform ID to select the associated configuration data. The platform ID can be specified at build time or dynamically detected from GPIO pins at runtime. At the beginning of Stage 1B (
GetBoardIdFromGpioPins()), SBL attempts to load GPIO platform ID by tag
CDATA_PID_GPIO_TAG. If the tag is found, the actual platform ID value is read from the GPIO pins. Otherwise, SBL uses static platform ID.
SBL supports up to 32 platform IDs with 16 allocated for static IDs and 16 for dynamic IDs.
Platform ID 0 is reserved value so cannot be used for real board.
Platform Configuration Files¶
Static Platform ID Configuration¶
- Provide platform ID (1-15) value in board configuration file (
PLATFORMID_CFG_DATA.PlatformId | 0x7
- Build SBL and stitch IFWI image
Dynamic Platform ID Detection¶
- Configure designated 4 GPIO pins in board configuration file using Configuration Editor.
- Provide platform ID value (0-15) in board configuration file (
PLATFORMID_CFG_DATA.PlatformId | 0x9
Internally, SBL adds 16 to dynamic Platform ID in order not to conflict with static IDs.
- Build SBL and stitch IFWI image
Common Configuration Categories¶
SBL comes with commonly used configurable options for a given platform . One can add new configurations (
Platform/<platform_foo>/CfgData/*.dsc) and Stage 1B board specific code (
Configuration data are grouped by categories:
- Memory and eMMC tuning
- Graphics related
- Device related (USB, eMMC etc)
- Boot options
- Feature related (e.g., log level)
Configuration data is loaded and verified in Stage1B. Once loaded, SBL groups related configuration item by tags and the data can be retrieved by calling function
FindConfigDataByTag(). For example,
Example Console Outputs¶
External configuration data for board (platform 1) is loaded:
============= Intel Slim Bootloader STAGE1B ============= ... BoardID: 0001 Load External Cfg data...BIOS Load EXT CFG Data @ 0xFEF05FF8:0x0080 ... Success HASH Verification Success! Component Type (4) RSA Verification Success! ... Load Security Cfg Data ... Load Memory Cfg Data ... Load Graphics Cfg Data ...
|||Apollo Lake platform code includes various validated configuration options supporting UP2 board.|