diff --git a/boot/ti-k3-r5-loader/Config.in b/boot/ti-k3-r5-loader/Config.in index 5f4f33b220..707f22ab4e 100644 --- a/boot/ti-k3-r5-loader/Config.in +++ b/boot/ti-k3-r5-loader/Config.in @@ -102,4 +102,44 @@ config BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN https://docs.u-boot.org/en/v2024.01/develop/package/binman.html +config BR2_TARGET_TI_K3_R5_LOADER_TIBOOT3_BIN + string "tiboot3.bin binary name" + default "tiboot3.bin" + help + Name of the TI K3 tiboot3.bin binary to use. + + The tiboot3 binary name must match with the TI K3 SoC boot + ROM: + + - General Purpose devices (gp) + - High Security - Field Securable devices (hs-fs) + - High Security - Security Enforcing devices (hs) + + Or if the tiboot3 binary generated use a custom name. + + If unsure, use the default tiboot3.bin (symlink) generated by + binman. + +config BR2_TARGET_TI_K3_R5_LOADER_SYSFW_ITB + string "sysfw.itb binary name" + default "sysfw.itb" + help + Name of the TI K3 sysfw.itb binary to use (if any required). + + sysfw*.itb are only generated for Split binary based Boot + Flow (eg: am65, j721e). This option is not used on other + TI K3 devices. + + The sysfw binary name must match with the TI K3 SoC boot + ROM: + + - General Purpose devices (gp) + - High Security - Field Securable devices (hs-fs) + - High Security - Security Enforcing devices (hs) + + Or if the sysfw binary generated use a custom name. + + If unsure, use the default sysfw.itb (symlink) generated by + binman. + endif diff --git a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk index cf18b43871..36f87e577e 100644 --- a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk +++ b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk @@ -73,7 +73,24 @@ TI_K3_R5_LOADER_DEPENDENCIES += \ host-python-pylibfdt \ host-python-setuptools TI_K3_R5_LOADER_MAKE_OPTS += BINMAN_INDIRS=$(BINARIES_DIR) -endif + +TI_K3_R5_LOADER_TIBOOT3_BIN = $(call qstrip,$(BR2_TARGET_TI_K3_R5_LOADER_TIBOOT3_BIN)) + +define TI_K3_R5_LOADER_INSTALL_TIBOOT3_BIN + cp $(@D)/$(TI_K3_R5_LOADER_TIBOOT3_BIN) $(BINARIES_DIR)/tiboot3.bin +endef + +TI_K3_R5_LOADER_SYSFW_ITB = $(call qstrip,$(BR2_TARGET_TI_K3_R5_LOADER_SYSFW_ITB)) + +# sysfw*.itb are only generated for Split binary based Boot Flow (eg: am65, j721e). +# So, if sysfw.itb symlink exist we must copy it or the custom sysfw.itb. +define TI_K3_R5_LOADER_INSTALL_SWSFW_ITB + if test -e $(@D)/sysfw.itb ; then \ + cp $(@D)/$(TI_K3_R5_LOADER_SYSFW_ITB) $(BINARIES_DIR)/sysfw.itb ; \ + fi +endef + +endif # BR2_TARGET_TI_K3_R5_LOADER_USE_BINMAN define TI_K3_R5_LOADER_BUILD_CMDS $(TARGET_CONFIGURE_OPTS) $(TI_K3_R5_LOADER_MAKE) -C $(@D) $(TI_K3_R5_LOADER_MAKE_OPTS) @@ -81,6 +98,22 @@ endef define TI_K3_R5_LOADER_INSTALL_IMAGES_CMDS cp $(@D)/spl/u-boot-spl.bin $(BINARIES_DIR)/r5-u-boot-spl.bin + $(TI_K3_R5_LOADER_INSTALL_TIBOOT3_BIN) + $(TI_K3_R5_LOADER_INSTALL_SWSFW_ITB) endef +# Checks to give errors that the user can understand +# Must be before we call to kconfig-package +ifeq ($(BR2_TARGET_TI_K3_R5_LOADER)$(BR_BUILDING),yy) + +ifeq ($(TI_K3_R5_LOADER_TIBOOT3_BIN),) +$(error No custom tiboot3 name specified, check your BR2_TARGET_TI_K3_R5_LOADER_TIBOOT3_BIN setting) +endif + +ifeq ($(TI_K3_R5_LOADER_SYSFW_ITB),) +$(error No custom sysfw name specified, check your BR2_TARGET_TI_K3_R5_LOADER_SYSFW_ITB setting) +endif + +endif # BR_BUILDING + $(eval $(kconfig-package))