From: Andreas Dannenberg via buildroot <buildroot@buildroot.org>
To: <buildroot@buildroot.org>
Cc: Bryan Brattlof <bb@ti.com>, Andrew Davis <afd@ti.com>,
Julien Olivain <ju.o@free.fr>, Xuanhao Shi <x-shi@ti.com>,
Giulio Benetti <giulio.benetti@benettiengineering.com>,
Anand Gadiyar <gadiyar@ti.com>,
Romain Naour <romain.naour@gmail.com>,
Andreas Dannenberg <dannenberg@ti.com>
Subject: [Buildroot] [PATCH v8 02/10] boot/ti-k3-image-gen: new package
Date: Thu, 15 Jun 2023 19:23:51 -0500 [thread overview]
Message-ID: <20230616002359.4139814-3-dannenberg@ti.com> (raw)
In-Reply-To: <20230616002359.4139814-1-dannenberg@ti.com>
From: Xuanhao Shi <x-shi@ti.com>
This is the image generator that builds the initial boot binary,
tiboot3.bin, for the R5 core on TI's K3 family of devices.
This requires the R5 SPL output from the ti-k3-r5-loader package.
https://git.ti.com/cgit/k3-image-gen/k3-image-gen
Signed-off-by: Xuanhao Shi <x-shi@ti.com>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Reviewed-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Acked-by: Andrew Davis <afd@ti.com>
Tested-by: Bryan Brattlof <bb@ti.com>
Cc: Romain Naour <romain.naour@gmail.com>
Reviewed-by: Francois Perrad <francois.perrad@gadz.org>
Reviewed-by: Julien Olivain <ju.o@free.fr>
---
DEVELOPERS | 2 +
boot/Config.in | 1 +
boot/ti-k3-image-gen/Config.in | 55 ++++++++++++++++++
boot/ti-k3-image-gen/ti-k3-image-gen.hash | 23 ++++++++
boot/ti-k3-image-gen/ti-k3-image-gen.mk | 71 +++++++++++++++++++++++
5 files changed, 152 insertions(+)
create mode 100644 boot/ti-k3-image-gen/Config.in
create mode 100644 boot/ti-k3-image-gen/ti-k3-image-gen.hash
create mode 100644 boot/ti-k3-image-gen/ti-k3-image-gen.mk
diff --git a/DEVELOPERS b/DEVELOPERS
index 56316201af..4d3e3b156a 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -129,6 +129,7 @@ F: package/libxmlrpc/
F: package/python-docopt/
N: Anand Gadiyar <gadiyar@ti.com>
+F: boot/ti-k3-image-gen/
F: boot/ti-k3-r5-loader/
N: André Zwing <nerv@dawncrow.de>
@@ -3020,6 +3021,7 @@ N: Wojciech Niziński <niziak@spox.org>
F: package/fwup/
N: Xuanhao Shi <X15000177@gmail.com>
+F: boot/ti-k3-image-gen/
F: boot/ti-k3-r5-loader/
N: Yair Ben Avraham <yairba@protonmail.com>
diff --git a/boot/Config.in b/boot/Config.in
index 58366e035e..3c2b05438d 100644
--- a/boot/Config.in
+++ b/boot/Config.in
@@ -20,6 +20,7 @@ source "boot/opensbi/Config.in"
source "boot/s500-bootloader/Config.in"
source "boot/shim/Config.in"
source "boot/syslinux/Config.in"
+source "boot/ti-k3-image-gen/Config.in"
source "boot/ti-k3-r5-loader/Config.in"
source "boot/uboot/Config.in"
source "boot/vexpress-firmware/Config.in"
diff --git a/boot/ti-k3-image-gen/Config.in b/boot/ti-k3-image-gen/Config.in
new file mode 100644
index 0000000000..97cb470119
--- /dev/null
+++ b/boot/ti-k3-image-gen/Config.in
@@ -0,0 +1,55 @@
+config BR2_TARGET_TI_K3_IMAGE_GEN
+ bool "ti-k3-image-gen"
+ depends on BR2_TARGET_TI_K3_R5_LOADER
+ help
+ Use TI's k3-image-gen to build a separate bare metal
+ boot binary from a separate SPL that is running on
+ the R5 core. Currently supports version 08.06.00.007
+ as default.
+
+ https://git.ti.com/cgit/k3-image-gen/k3-image-gen/
+
+if BR2_TARGET_TI_K3_IMAGE_GEN
+choice
+ prompt "SoC firmware type for image gen"
+ default BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE_TIFS
+
+config BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE_TIFS
+ bool "Firmware type TIFS"
+ help
+ Use firmware type TIFS for SoCs like AM62x and
+ AM62Ax.
+
+config BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE_TISCI
+ bool "Firmware type TISCI"
+ help
+ Use firmware type TISCI for SoCs like AM64x and
+ AM65x.
+
+endchoice
+
+config BR2_TARGET_TI_K3_IMAGE_GEN_SOC
+ string "SoC"
+ help
+ The target SoC option for image gen.
+ For example, "am64x" for AM64x boards.
+
+config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_TYPE
+ string "security type"
+ help
+ The target SoC security type option for image gen.
+ Valid options are "gp" for General Purpose devices,
+ "hs-fs" for High Security - Field Securable devices, or
+ "hs" for High Security - Security Enforcing devices.
+ Note for all High Security device variants the
+ TI_SECURE_DEV_PKG environmental variable must be defined
+ at build time pointing to a valid core-secdev-k3 folder
+ location, otherwise the build will fail, see
+ https://git.ti.com/cgit/security-development-tools/core-secdev-k3
+
+config BR2_TARGET_TI_K3_IMAGE_GEN_CONFIG
+ string "config type"
+ help
+ The board config option for image gen.
+ Usually "sk" or "evm".
+endif
diff --git a/boot/ti-k3-image-gen/ti-k3-image-gen.hash b/boot/ti-k3-image-gen/ti-k3-image-gen.hash
new file mode 100644
index 0000000000..6fb8c4c1eb
--- /dev/null
+++ b/boot/ti-k3-image-gen/ti-k3-image-gen.hash
@@ -0,0 +1,23 @@
+# Locally calculated
+sha256 f89ea4b1f5c992455b1a682fde48359221b53f3294135df4bf20feea6aea90e4 k3-image-gen-08.06.00.007.tar.gz
+sha256 f012e8d000d711d0539e5b4c812fc1d3a59c10fc1e3d6ea155556f5b78286845 LICENSE
+
+sha256 eca3d0dca65ceabdf17c7efa6b0eb651d365c6056730aa1c67700b7fea2e8bd2 ti-fs-firmware-am62x-gp.bin
+sha256 9ed6089ca7d59e9e5919b0da92effe788138edef41682e0bf7eaea25a896a4f1 ti-fs-firmware-am62x-hs-cert.bin
+sha256 655b5ded62b63f26c17b3ae2f23ac3565ae91fbd7fba1b7b0a4cb7807467523b ti-fs-firmware-am62x-hs-enc.bin
+sha256 5efa229acd122685fa928170a3f2e39597cce0231fca10b03d9b4d519db2259f ti-fs-firmware-am62x-hs-fs-cert.bin
+sha256 0f49da5e616a95dc8573531799d20fa7697a000f88084d09f3f6f5a665d85680 ti-fs-firmware-am62x-hs-fs-enc.bin
+
+sha256 c5c91d005b228a926fdc518f1e4365d2f693248a63f2432fccfbde10e5717499 ti-fs-firmware-am62ax-gp.bin
+sha256 6de6d6a249217b15dd78dfb2b0ca99bda95aa15b7e4867a2cbe0d5a169422522 ti-fs-firmware-am62ax-hs-cert.bin
+sha256 b1b3b25409013174fa5969b5bfaa572c0a79eee9e8b7445b3ac7867646eaf402 ti-fs-firmware-am62ax-hs-enc.bin
+sha256 652b1369bed586cc294a65ee690056763a12034e4c9f0d05ea3838dd60ec8aba ti-fs-firmware-am62ax-hs-fs-cert.bin
+sha256 b37f82dad0998921672b36b6aeb1473197ab2720f612c2409292a81561ddc602 ti-fs-firmware-am62ax-hs-fs-enc.bin
+
+sha256 958fdb0613a1dc3a5cb90edf35b84981b94bd70de6255cdf5f220bce2a4b10ef ti-sci-firmware-am64x-gp.bin
+sha256 cfee8679183577392b513b317a4d9a6af47cde9a59ecbad758704e4bec38196c ti-sci-firmware-am64x-hs-cert.bin
+sha256 8760b70cc18cd5921d634ce226122aed5a28d64857d90f6ede40f2383dabd169 ti-sci-firmware-am64x-hs-enc.bin
+sha256 1e78b106a8c7acd1641863ef86946e0d7272ad9b2d0e7ce451936d36a14e70e7 ti-sci-firmware-am64x_sr2-hs-cert.bin
+sha256 c626bacd4abfbe4de1133b72568394a2e20dbe9a1623a3e77bae9f000e743bb4 ti-sci-firmware-am64x_sr2-hs-enc.bin
+sha256 1d48d758d9ed940fe4072bd5b024ec502c72782ce2ca1c085f043f104a62ca70 ti-sci-firmware-am64x_sr2-hs-fs-cert.bin
+sha256 1b22ba9ab5b94a9942e1f9c203b81733030c8bf4543a0aefffd200876a0c66eb ti-sci-firmware-am64x_sr2-hs-fs-enc.bin
diff --git a/boot/ti-k3-image-gen/ti-k3-image-gen.mk b/boot/ti-k3-image-gen/ti-k3-image-gen.mk
new file mode 100644
index 0000000000..cdeac13cfa
--- /dev/null
+++ b/boot/ti-k3-image-gen/ti-k3-image-gen.mk
@@ -0,0 +1,71 @@
+################################################################################
+#
+# ti-k3-image-gen
+#
+################################################################################
+
+TI_K3_IMAGE_GEN_VERSION = 08.06.00.007
+TI_K3_IMAGE_GEN_SITE = https://git.ti.com/cgit/k3-image-gen/k3-image-gen/snapshot
+TI_K3_IMAGE_GEN_SOURCE = k3-image-gen-$(TI_K3_IMAGE_GEN_VERSION).tar.gz
+TI_K3_IMAGE_GEN_LICENSE = BSD-3-Clause
+TI_K3_IMAGE_GEN_LICENSE_FILES = LICENSE
+TI_K3_IMAGE_GEN_INSTALL_IMAGES = YES
+
+# ti-k3-image-gen is used to build tiboot3.bin, using the r5-u-boot-spl.bin file
+# from the ti-k3-r5-loader package. Hence the dependency on ti-k3-r5-loader.
+TI_K3_IMAGE_GEN_DEPENDENCIES = host-arm-gnu-toolchain ti-k3-r5-loader
+
+ifeq ($(BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE_TIFS),y)
+TI_K3_IMAGE_GEN_FW_TYPE = $(call qstrip,"ti-fs")
+else ifeq ($(BR2_TARGET_TI_K3_IMAGE_GEN_FW_TYPE_TISCI),y)
+TI_K3_IMAGE_GEN_FW_TYPE = $(call qstrip,"ti-sci")
+else
+$(error No TI K3 Image Gen firmware type set)
+endif
+
+TI_K3_IMAGE_GEN_SOC = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SOC))
+TI_K3_IMAGE_GEN_SOC_TYPE = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_SOC_TYPE))
+TI_K3_IMAGE_GEN_CONFIG = $(call qstrip,$(BR2_TARGET_TI_K3_IMAGE_GEN_CONFIG))
+
+# This hash comes from the Makefile in ti-k3-image-gen and corresponds to
+# FW from Git tag 08.06.00.006
+TI_K3_SYSFW_VERSION = 340194800a581baf976360386dfc7b5acab8d948
+TI_K3_SYSFW_SITE = https://git.ti.com/processor-firmware/ti-linux-firmware/blobs/raw/$(TI_K3_SYSFW_VERSION)/ti-sysfw
+ifeq ($(TI_K3_IMAGE_GEN_SOC_TYPE),gp)
+TI_K3_SYSFW_SOURCE = \
+ $(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SOC_TYPE).bin
+else
+TI_K3_SYSFW_SOURCE = \
+ $(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SOC_TYPE)-cert.bin \
+ $(TI_K3_IMAGE_GEN_FW_TYPE)-firmware-$(TI_K3_IMAGE_GEN_SOC)-$(TI_K3_IMAGE_GEN_SOC_TYPE)-enc.bin
+endif
+TI_K3_IMAGE_GEN_EXTRA_DOWNLOADS = $(patsubst %,$(TI_K3_SYSFW_SITE)/%,$(TI_K3_SYSFW_SOURCE))
+
+define TI_K3_SYSFW_COPY
+ $(foreach f,$(TI_K3_SYSFW_SOURCE), \
+ cp $(TI_K3_IMAGE_GEN_DL_DIR)/$(f) $(@D)$(sep))
+endef
+TI_K3_IMAGE_GEN_POST_EXTRACT_HOOKS += TI_K3_SYSFW_COPY
+
+# The ti-k3-image-gen makefiles seem to need some feature from Make v4.0,
+# similar to u-boot. Explicitly use $(BR2_MAKE) here, as the build
+# otherwise fails with some misleading error message.
+TI_K3_IMAGE_GEN_MAKE = $(BR2_MAKE)
+TI_K3_IMAGE_GEN_MAKE_OPTS = \
+ SOC=$(TI_K3_IMAGE_GEN_SOC) \
+ SOC_TYPE=$(TI_K3_IMAGE_GEN_SOC_TYPE) \
+ CONFIG=$(TI_K3_IMAGE_GEN_CONFIG) \
+ CROSS_COMPILE=$(HOST_DIR)/bin/arm-none-eabi- \
+ SBL=$(BINARIES_DIR)/r5-u-boot-spl.bin \
+ O=$(@D)/tmp \
+ BIN_DIR=$(@D)
+
+define TI_K3_IMAGE_GEN_BUILD_CMDS
+ $(TI_K3_IMAGE_GEN_MAKE) -C $(@D) $(TI_K3_IMAGE_GEN_MAKE_OPTS)
+endef
+
+define TI_K3_IMAGE_GEN_INSTALL_IMAGES_CMDS
+ cp $(@D)/tiboot3.bin $(BINARIES_DIR)
+endef
+
+$(eval $(generic-package))
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2023-06-16 0:44 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-16 0:23 [Buildroot] [PATCH v8 00/10] add support for TI's AM64x and AM62x boards Andreas Dannenberg via buildroot
2023-06-16 0:23 ` [Buildroot] [PATCH v8 01/10] boot/ti-k3-r5-loader: allow for full build source customization Andreas Dannenberg via buildroot
2023-06-16 1:39 ` Patrick Oppenlander
2023-06-16 2:25 ` Andreas Dannenberg via buildroot
2023-06-21 15:42 ` Andreas Dannenberg via buildroot
2023-06-21 23:35 ` Patrick Oppenlander
2023-08-22 10:16 ` Thomas Petazzoni via buildroot
2023-06-16 0:23 ` Andreas Dannenberg via buildroot [this message]
2023-08-22 10:29 ` [Buildroot] [PATCH v8 02/10] boot/ti-k3-image-gen: new package Thomas Petazzoni via buildroot
2023-12-12 13:14 ` Romain Naour
2023-12-13 4:31 ` Bryan Brattlof via buildroot
2023-06-16 0:23 ` [Buildroot] [PATCH v8 03/10] boot/uboot: add support for building the TI K3 DM into U-Boot Andreas Dannenberg via buildroot
2023-08-22 10:31 ` Thomas Petazzoni via buildroot
2023-06-16 0:23 ` [Buildroot] [PATCH v8 04/10] board/ti/am64x_sk: add new board Andreas Dannenberg via buildroot
2023-08-22 10:32 ` Thomas Petazzoni via buildroot
2023-06-16 0:23 ` [Buildroot] [PATCH v8 05/10] board/ti/am62x_sk: " Andreas Dannenberg via buildroot
2023-08-22 10:32 ` Thomas Petazzoni via buildroot
2023-06-16 0:23 ` [Buildroot] [PATCH v8 06/10] board/ti/am62x_sk|am64x_sk: switch to TI SDK v8.6 sources Andreas Dannenberg via buildroot
2023-06-16 0:23 ` [Buildroot] [PATCH v8 07/10] board/ti/am62x_sk|am64x_sk: switch to HS-FS device variants Andreas Dannenberg via buildroot
2023-06-16 11:15 ` François Perrad
2023-06-16 12:02 ` Andreas Dannenberg via buildroot
2023-06-16 16:40 ` François Perrad
2023-06-16 22:13 ` Andreas Dannenberg via buildroot
2023-06-17 9:37 ` François Perrad
2023-06-18 12:37 ` Andreas Dannenberg via buildroot
2023-06-18 12:27 ` Arnout Vandecappelle via buildroot
2023-06-18 13:43 ` Andreas Dannenberg via buildroot
2023-06-19 17:39 ` Julien Olivain
2023-06-21 15:32 ` Andreas Dannenberg via buildroot
2023-06-16 0:23 ` [Buildroot] [PATCH v8 08/10] package/ti-rogue-km: new package Andreas Dannenberg via buildroot
2023-06-16 0:23 ` [Buildroot] [PATCH v8 09/10] package/ti-rogue-um: " Andreas Dannenberg via buildroot
2023-06-16 0:23 ` [Buildroot] [PATCH v8 10/10] configs/am62x_sk_defconfig: enable IMG Rogue graphics driver Andreas Dannenberg via buildroot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230616002359.4139814-3-dannenberg@ti.com \
--to=buildroot@buildroot.org \
--cc=afd@ti.com \
--cc=bb@ti.com \
--cc=dannenberg@ti.com \
--cc=gadiyar@ti.com \
--cc=giulio.benetti@benettiengineering.com \
--cc=ju.o@free.fr \
--cc=romain.naour@gmail.com \
--cc=x-shi@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox