sbl1是平台相关的启动程序,除了执行必要的初始化操作,还负责加载PMIC,QSEE(TZ),RPM等Firmware,然后跳转到APPSBL执行(XBL跳转到XBL Core,也就是UEFI入口执行);
1. sbl1_config_table
所有在sbl1加载的image,都保存在sbl1_config_table[]数组中,这是一个配置表,记录Image加载前后的行为,boot_configuration_table_entry结构体定义如下:
@auth和@load的值为TRUE,表示加载并校验Image;
@boot_load_cancel函数检查是否要加载Image;
@target_img_partition_id表示Image所在分区的GUID值;
如果要立即执行Image,设置@exec值及@exec_func执行函数;
如果要跳转到Image执行,设置@jump值及@jump_func跳转函数,如APPSBL跳转函数;
FW加载前可能需要一些准备工作,可以放在@pre_procs函数列表,FW加载后会执行@post_procs函数列表;
typedef struct
{
image_type host_img_id; /**< Image ID of the host */
config_image_type host_img_type; /**< Image type of the host */
image_type target_img_id; /**< Image ID of the target */
config_image_type target_img_type; /**< Image type of the target */
secboot_sw_type target_img_sec_type; /**< Secure Software ID of the target */
boot_boolean load; /**< Target will be loaded */
boot_boolean auth; /**< Target will be authenticated */
boot_boolean exec; /**< Target will execute immediately after
loading/authentication */
boot_boolean jump; /**< Target will be jumped to after
post procedures are complete */
boot_boolean recovery; /**< Target image partiton will be restored from
backup image partition once loading primary
image fails */
boot_procedure_func_type exec_func; /**< Function pointer to execute function.
Must be defined if exec is TRUE */
boot_procedure_func_type jump_func; /**< Function pointer to jump function.
Must be defined if jump is TRUE */
boot_procedure_func_type *pre_procs; /**< Function pointer array to pre-procedures *