Initial Commit
- initial default booting image
This commit is contained in:
154
boot/ti-k3-r5-loader/Config.in
Normal file
154
boot/ti-k3-r5-loader/Config.in
Normal file
@@ -0,0 +1,154 @@
|
||||
menuconfig BR2_TARGET_TI_K3_R5_LOADER
|
||||
bool "ti-k3-r5-loader"
|
||||
depends on BR2_aarch64
|
||||
depends on BR2_PACKAGE_HOST_ARM_GNU_TOOLCHAIN_SUPPORTS
|
||||
select BR2_TARGET_TI_K3_BOOT_FIRMWARE # binman
|
||||
help
|
||||
Separate U-Boot SPL build for R5 core on TI's K3 processors.
|
||||
Usually used to build tiboot3.bin with k3-image-gen.
|
||||
|
||||
if BR2_TARGET_TI_K3_R5_LOADER
|
||||
|
||||
choice
|
||||
prompt "U-Boot Version"
|
||||
help
|
||||
Select the specific U-Boot version you want to use to build
|
||||
the initial SPL running on the R5 core. Note that for most
|
||||
use cases you will want to use the exact same version/source
|
||||
here as it is used to build the main U-Boot package.
|
||||
|
||||
config BR2_TARGET_TI_K3_R5_LOADER_LATEST_VERSION
|
||||
bool "2024.10"
|
||||
|
||||
config BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION
|
||||
bool "Custom version"
|
||||
help
|
||||
This option allows to use a specific official versions
|
||||
|
||||
config BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_TARBALL
|
||||
bool "Custom tarball"
|
||||
|
||||
config BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_GIT
|
||||
bool "Custom Git repository"
|
||||
|
||||
config BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_HG
|
||||
bool "Custom Mercurial repository"
|
||||
|
||||
config BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_SVN
|
||||
bool "Custom Subversion repository"
|
||||
|
||||
endchoice
|
||||
|
||||
config BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE
|
||||
string "U-Boot version"
|
||||
depends on BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION
|
||||
|
||||
config BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_TARBALL_LOCATION
|
||||
string "URL of custom U-Boot tarball"
|
||||
depends on BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_TARBALL
|
||||
|
||||
if BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_GIT || BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_HG || BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_SVN
|
||||
|
||||
config BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_REPO_URL
|
||||
string "URL of custom repository"
|
||||
|
||||
config BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_REPO_VERSION
|
||||
string "Custom repository version"
|
||||
help
|
||||
Revision to use in the typical format used by
|
||||
Git/Mercurial/Subversion E.G. a sha id, a tag, branch, ..
|
||||
|
||||
endif
|
||||
|
||||
config BR2_TARGET_TI_K3_R5_LOADER_VERSION
|
||||
string
|
||||
default "2024.10" if BR2_TARGET_TI_K3_R5_LOADER_LATEST_VERSION
|
||||
default BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION_VALUE \
|
||||
if BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_VERSION
|
||||
default "custom" if BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_TARBALL
|
||||
default BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_REPO_VERSION \
|
||||
if BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_GIT || \
|
||||
BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_HG || \
|
||||
BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_SVN
|
||||
choice
|
||||
prompt "U-Boot Configuration"
|
||||
default BR2_TARGET_TI_K3_R5_LOADER_USE_DEFCONFIG
|
||||
|
||||
config BR2_TARGET_TI_K3_R5_LOADER_USE_DEFCONFIG
|
||||
bool "Using an in-tree board defconfig file"
|
||||
|
||||
config BR2_TARGET_TI_K3_R5_LOADER_USE_CUSTOM_CONFIG
|
||||
bool "Using a custom board (def)config file"
|
||||
|
||||
endchoice
|
||||
|
||||
config BR2_TARGET_TI_K3_R5_LOADER_BOARD_DEFCONFIG
|
||||
string "Board defconfig"
|
||||
depends on BR2_TARGET_TI_K3_R5_LOADER_USE_DEFCONFIG
|
||||
help
|
||||
Name of the board for which TI K3 R5 Loader should be
|
||||
built, without the _defconfig suffix.
|
||||
|
||||
config BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_CONFIG_FILE
|
||||
string "Configuration file path"
|
||||
depends on BR2_TARGET_TI_K3_R5_LOADER_USE_CUSTOM_CONFIG
|
||||
help
|
||||
Path to the TI K3 R5 Loader configuration file.
|
||||
|
||||
config BR2_TARGET_TI_K3_R5_LOADER_CONFIG_FRAGMENT_FILES
|
||||
string "Additional configuration fragment files"
|
||||
help
|
||||
A space-separated list of configuration fragment files,
|
||||
that will be merged to the tiboot3.bin configuration file.
|
||||
|
||||
config BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_DTS_PATH
|
||||
string "Device Tree Source file paths"
|
||||
help
|
||||
Space-separated list of paths to device tree source files
|
||||
that will be copied to arch/arm/dts/ before starting the
|
||||
build.
|
||||
|
||||
To use this device tree source file, the U-Boot configuration
|
||||
file must refer to it.
|
||||
|
||||
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
|
||||
3
boot/ti-k3-r5-loader/ti-k3-r5-loader.hash
Normal file
3
boot/ti-k3-r5-loader/ti-k3-r5-loader.hash
Normal file
@@ -0,0 +1,3 @@
|
||||
# Locally computed:
|
||||
sha256 b28daf4ac17e43156363078bf510297584137f6df50fced9b12df34f61a92fb0 u-boot-2024.10.tar.bz2
|
||||
sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 Licenses/gpl-2.0.txt
|
||||
126
boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
Normal file
126
boot/ti-k3-r5-loader/ti-k3-r5-loader.mk
Normal file
@@ -0,0 +1,126 @@
|
||||
################################################################################
|
||||
#
|
||||
# ti-k3-r5-loader
|
||||
#
|
||||
################################################################################
|
||||
|
||||
TI_K3_R5_LOADER_VERSION = $(call qstrip,$(BR2_TARGET_TI_K3_R5_LOADER_VERSION))
|
||||
TI_K3_R5_LOADER_DL_SUBDIR = uboot
|
||||
|
||||
ifeq ($(BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_TARBALL),y)
|
||||
# Handle custom U-Boot tarballs as specified by the configuration
|
||||
TI_K3_R5_LOADER_TARBALL = $(call qstrip,$(BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_TARBALL_LOCATION))
|
||||
TI_K3_R5_LOADER_SITE = $(patsubst %/,%,$(dir $(TI_K3_R5_LOADER_TARBALL)))
|
||||
TI_K3_R5_LOADER_SOURCE = $(notdir $(TI_K3_R5_LOADER_TARBALL))
|
||||
else ifeq ($(BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_GIT),y)
|
||||
TI_K3_R5_LOADER_SITE = $(call qstrip,$(BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_REPO_URL))
|
||||
TI_K3_R5_LOADER_SITE_METHOD = git
|
||||
TI_K3_R5_LOADER_SOURCE = u-boot-$(TI_K3_R5_LOADER_VERSION).tar.gz
|
||||
else ifeq ($(BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_HG),y)
|
||||
TI_K3_R5_LOADER_SITE = $(call qstrip,$(BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_REPO_URL))
|
||||
TI_K3_R5_LOADER_SITE_METHOD = hg
|
||||
TI_K3_R5_LOADER_SOURCE = u-boot-$(TI_K3_R5_LOADER_VERSION).tar.gz
|
||||
else ifeq ($(BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_SVN),y)
|
||||
TI_K3_R5_LOADER_SITE = $(call qstrip,$(BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_REPO_URL))
|
||||
TI_K3_R5_LOADER_SITE_METHOD = svn
|
||||
TI_K3_R5_LOADER_SOURCE = u-boot-$(TI_K3_R5_LOADER_VERSION).tar.gz
|
||||
else
|
||||
# Handle stable official U-Boot versions
|
||||
TI_K3_R5_LOADER_SITE = https://ftp.denx.de/pub/u-boot
|
||||
TI_K3_R5_LOADER_SOURCE = u-boot-$(TI_K3_R5_LOADER_VERSION).tar.bz2
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_TI_K3_R5_LOADER)$(BR2_TARGET_TI_K3_R5_LOADER_LATEST_VERSION),y)
|
||||
BR_NO_CHECK_HASH_FOR += $(TI_K3_R5_LOADER_SOURCE)
|
||||
endif
|
||||
|
||||
TI_K3_R5_LOADER_LICENSE = GPL-2.0+
|
||||
TI_K3_R5_LOADER_LICENSE_FILES = Licenses/gpl-2.0.txt
|
||||
TI_K3_R5_LOADER_CPE_ID_VENDOR = denx
|
||||
TI_K3_R5_LOADER_CPE_ID_PRODUCT = u-boot
|
||||
TI_K3_R5_LOADER_INSTALL_IMAGES = YES
|
||||
# https://source.denx.de/u-boot/u-boot/-/blob/v2024.04/tools/binman/binman.rst?plain=1#L377
|
||||
# https://source.denx.de/u-boot/u-boot/-/blob/v2024.04/tools/buildman/requirements.txt
|
||||
# Make sure that all binman requirements are built before ti-k3-r5-loader.
|
||||
TI_K3_R5_LOADER_DEPENDENCIES = \
|
||||
host-pkgconf \
|
||||
$(BR2_MAKE_HOST_DEPENDENCY) \
|
||||
host-arm-gnu-toolchain \
|
||||
host-gnutls \
|
||||
host-openssl \
|
||||
host-python3 \
|
||||
host-python-jsonschema \
|
||||
host-python-pyelftools \
|
||||
host-python-pylibfdt \
|
||||
host-python-pyyaml \
|
||||
host-python-setuptools \
|
||||
host-python-yamllint \
|
||||
ti-k3-boot-firmware
|
||||
|
||||
TI_K3_R5_LOADER_MAKE = $(BR2_MAKE)
|
||||
TI_K3_R5_LOADER_MAKE_ENV = $(TARGET_MAKE_ENV)
|
||||
TI_K3_R5_LOADER_KCONFIG_DEPENDENCIES = \
|
||||
host-arm-gnu-toolchain \
|
||||
$(BR2_MAKE_HOST_DEPENDENCY) \
|
||||
$(BR2_BISON_HOST_DEPENDENCY) \
|
||||
$(BR2_FLEX_HOST_DEPENDENCY)
|
||||
|
||||
ifeq ($(BR2_TARGET_TI_K3_R5_LOADER_USE_DEFCONFIG),y)
|
||||
TI_K3_R5_LOADER_KCONFIG_DEFCONFIG = $(call qstrip,$(BR2_TARGET_TI_K3_R5_LOADER_BOARD_DEFCONFIG))_defconfig
|
||||
else ifeq ($(BR2_TARGET_TI_K3_R5_LOADER_USE_CUSTOM_CONFIG),y)
|
||||
TI_K3_R5_LOADER_KCONFIG_FILE = $(call qstrip,$(BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_CONFIG_FILE))
|
||||
endif # BR2_TARGET_TI_K3_R5_LOADER_USE_DEFCONFIG
|
||||
TI_K3_R5_LOADER_MAKE_OPTS = \
|
||||
CROSS_COMPILE=$(HOST_DIR)/bin/arm-none-eabi- \
|
||||
ARCH=arm \
|
||||
HOSTCC="$(HOSTCC) $(subst -I/,-isystem /,$(subst -I /,-isystem /,$(HOST_CFLAGS)))" \
|
||||
HOSTLDFLAGS="$(HOST_LDFLAGS)" \
|
||||
BINMAN_INDIRS=$(BINARIES_DIR)
|
||||
|
||||
TI_K3_R5_LOADER_KCONFIG_FRAGMENT_FILES = $(call qstrip,$(BR2_TARGET_TI_K3_R5_LOADER_CONFIG_FRAGMENT_FILES))
|
||||
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
|
||||
|
||||
TI_K3_R5_LOADER_CUSTOM_DTS_PATH = $(call qstrip,$(BR2_TARGET_TI_K3_R5_LOADER_CUSTOM_DTS_PATH))
|
||||
|
||||
define TI_K3_R5_LOADER_BUILD_CMDS
|
||||
$(if $(TI_K3_R5_LOADER_CUSTOM_DTS_PATH),
|
||||
cp -f $(TI_K3_R5_LOADER_CUSTOM_DTS_PATH) $(@D)/arch/arm/dts/
|
||||
)
|
||||
$(TARGET_CONFIGURE_OPTS) $(TI_K3_R5_LOADER_MAKE) -C $(@D) $(TI_K3_R5_LOADER_MAKE_OPTS)
|
||||
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))
|
||||
Reference in New Issue
Block a user