From patchwork Thu Nov 17 00:15:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anand Gadiyar X-Patchwork-Id: 1704869 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NCL6k59bhz23mR for ; Thu, 17 Nov 2022 11:15:58 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 9AC1260C0B; Thu, 17 Nov 2022 00:15:56 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 9AC1260C0B X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0fRebY8SmPK8; Thu, 17 Nov 2022 00:15:55 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id A137760BE3; Thu, 17 Nov 2022 00:15:54 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org A137760BE3 X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 2B6D81BF954 for ; Thu, 17 Nov 2022 00:15:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 12EBC41883 for ; Thu, 17 Nov 2022 00:15:18 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 12EBC41883 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7Uj_ewa63QJs for ; Thu, 17 Nov 2022 00:15:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 038014188F Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by smtp4.osuosl.org (Postfix) with ESMTPS id 038014188F for ; Thu, 17 Nov 2022 00:15:15 +0000 (UTC) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 2AH0FBN4071557; Wed, 16 Nov 2022 18:15:11 -0600 Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 2AH0FBiP082257 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 16 Nov 2022 18:15:11 -0600 Received: from DLEE110.ent.ti.com (157.170.170.21) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6; Wed, 16 Nov 2022 18:15:11 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE110.ent.ti.com (157.170.170.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.6 via Frontend Transport; Wed, 16 Nov 2022 18:15:11 -0600 Received: from uda0393673 (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 2AH0FBbE034884; Wed, 16 Nov 2022 18:15:11 -0600 Received: from a0393673 by uda0393673 with local (Exim 4.95) (envelope-from ) id 1ovSYh-007MC7-GH; Wed, 16 Nov 2022 18:15:11 -0600 To: Date: Wed, 16 Nov 2022 18:15:10 -0600 Message-ID: <20221117001511.1753592-3-gadiyar@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221117001511.1753592-1-gadiyar@ti.com> References: <20221117001511.1753592-1-gadiyar@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1668644111; bh=tealhssAp/5xCPgLf6tR3cFrg/LIaHYqY+Bd/JBwZIE=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=kGPGPJnNpRWi4gRuW6Y0/Wy66cQUFvRmLrOo2u8EuKAEmJ6cBAwNQgBjEcpONKzLP N6fcm1G0tdg1C6uEpNAWST8V7BBegDPk9I0xXxnQ8SPu71HlVDCFqlgbvJWlTUqmVX XcuB8h/ZHr/osJGawf4gC32paKK7l0rHEIl7VhHk= X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.a=rsa-sha256 header.s=ti-com-17Q1 header.b=kGPGPJnN Subject: [Buildroot] [PATCH v6 2/3] boot/ti-k3-image-gen: add new package X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Anand Gadiyar via buildroot From: Anand Gadiyar Reply-To: Anand Gadiyar Cc: Bryan Brattlof , Xuanhao Shi , Giulio Benetti , Romain Naour , Andrew Davis Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" From: Xuanhao Shi This is the image generator that builds the full boot binary, tiboot3.bin, for the R5 core on TI's k3 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 Signed-off-by: Anand Gadiyar Reviewed-by: Giulio Benetti Acked-by: Andrew Davis Cc: Romain Naour Cc: Bryan Brattlof --- DEVELOPERS | 2 ++ boot/Config.in | 1 + boot/ti-k3-image-gen/Config.in | 30 ++++++++++++++++ boot/ti-k3-image-gen/ti-k3-image-gen.hash | 2 ++ boot/ti-k3-image-gen/ti-k3-image-gen.mk | 42 +++++++++++++++++++++++ 5 files changed, 77 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 cf1cb8808b..e699b6ec81 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -129,6 +129,7 @@ F: package/libxmlrpc/ F: package/python-docopt/ N: Anand Gadiyar +F: boot/ti-k3-image-gen/ F: boot/ti-k3-r5-loader/ N: André Zwing @@ -3049,6 +3050,7 @@ N: Wojciech Niziński F: package/fwup/ N: Xuanhao Shi +F: boot/ti-k3-image-gen/ F: boot/ti-k3-r5-loader/ N: Yair Ben Avraham diff --git a/boot/Config.in b/boot/Config.in index ce17b2df6b..1b25bacfee 100644 --- a/boot/Config.in +++ b/boot/Config.in @@ -22,6 +22,7 @@ source "boot/s500-bootloader/Config.in" source "boot/shim/Config.in" source "boot/sun20i-d1-spl/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..02018f2f78 --- /dev/null +++ b/boot/ti-k3-image-gen/Config.in @@ -0,0 +1,30 @@ +config BR2_TARGET_TI_K3_IMAGE_GEN + bool "ti-k3-image-gen" + select 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. Currently supports + version 08.05.00.004 as default. + + https://git.ti.com/cgit/k3-image-gen/k3-image-gen/ + +if BR2_TARGET_TI_K3_IMAGE_GEN +config BR2_TARGET_TI_K3_IMAGE_GEN_SOC + string "SOC type for image gen" + help + The target SoC option for image gen. + For example, "am64x" for AM64X boards. + +config BR2_TARGET_TI_K3_IMAGE_GEN_SOC_TYPE + string "SOC security type for image gen" + help + The security type option for image gen. + Options are "gp", "hs-fs", or "hs-se". + +config BR2_TARGET_TI_K3_IMAGE_GEN_CONFIG + string "CONFIG type for image gen" + 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..82c5b17060 --- /dev/null +++ b/boot/ti-k3-image-gen/ti-k3-image-gen.hash @@ -0,0 +1,2 @@ +# Locally calculated +sha256 d13e9556bfba32d14071e172589683e48f6fea705a0b05ddd7fe984002089888 k3-image-gen-08.05.00.004.tar.gz 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..7239b94425 --- /dev/null +++ b/boot/ti-k3-image-gen/ti-k3-image-gen.mk @@ -0,0 +1,42 @@ +################################################################################ +# +# ti-k3-image-gen +# +################################################################################ + +TI_K3_IMAGE_GEN_VERSION = 08.05.00.004 +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 + +# 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_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)) +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=$(BINARIES_DIR) \ + BIN_DIR=$(BINARIES_DIR) + +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))