From patchwork Mon Mar 4 15:32:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3049 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 6D9EA42754 for ; Mon, 4 Mar 2024 16:34:25 +0100 (CET) Received: by mail-lj1-f197.google.com with SMTP id 38308e7fff4ca-2d33e6f838dsf32073641fa.0 for ; Mon, 04 Mar 2024 07:34:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709566464; cv=pass; d=google.com; s=arc-20160816; b=Y/Hb/niofnEi+fPzs6JqpRB9y9KpFvnvxmfz/YbYlNFaIfUZthhLI+X1Iv7/VcaLKq c1raAiVCjOWUOUV6n4rKcylac4oiP6kam4DHzbt/Yzn9m+qAndzVZofakHbLv5x4oare zLqxUzev42VzZvWkjEQur7JyaSeNluM5yj0Nu2ZdRTVjVlO8ggn5uwQD1iWyY9NYS6yo 9woMEf3XBSSST5fGByXrYvP/zW/J1LtfTuA0/q8E92Nu+0fmkrF+13c4WG/6hWNkmQjc oLNoz6FekqiVmHcnvr3NjGCvprJxsv/NBI8y4IG4FuBF3+FPyGpnH1ezlPoWzyY9VoJ/ lQyQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=Bf1i71y+bV8d6IJkx4wgB21K08Ltt13gtD7PNdOrFGY=; fh=M7RzRnOnK1iyGjfW4yCn7MEgr+adL6OUpxF+OzPx8pE=; b=lmIELNaWDtRMhRv9e2Kp9zsh1FvPKekhELheVokcySCBfTZ6Od963bQPtWVRVTqSTK D7YF2CAyDk0KkybSdOqq/RuhVKG3hYUnjrnydIbYZIbrm/BVyxh+ki8DBRdRknINMN8m hAG8U0Du70pNyQIWTl55kXK5dsEyuGVtTzTlATsla9YU/hs/Lak0XNt8MrEtzUvOL/7V l3SxI2nQnnnUoMZlGjW1qrouCZuxgVzCDAMs74+SMNKxw3FJpeuHypS0j+4n3QHHeCsa K6kGtyM3mP3sHj6m9hbOqwQV0AYCBkIB/ONtZhxmYpGKhv2Npibg+cVGwbkqBkRrdS7R 2cyg==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JJEE0zwL; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1709566464; x=1710171264; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=Bf1i71y+bV8d6IJkx4wgB21K08Ltt13gtD7PNdOrFGY=; b=eJw28AER8Qa7tZNujoAGft106ThTVanF51RYtfxz5O2hYo2EZRc7opwZyCWLk2adn4 8yt9WwHXvk7lG+/T/77G65DwlFlFOFyWyBr1fzKNRgzP8GJ3K06ac7aXMR5tfSH6PAoo 4Ff4erf+Y/KrMqf4oexfa/iahX2b9IvJLAHtM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709566464; x=1710171264; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Bf1i71y+bV8d6IJkx4wgB21K08Ltt13gtD7PNdOrFGY=; b=AiHvMIz7GL9w3QbEQFhVAUQmFyGSNTA6SJCFElGuaVEyfUSHoBJtSkCNbeQZMsCQs6 goHwF/qvwyna+0QyXrRA6YC50YiKq9bLjwdT+Jq7/Es9dvOj9oD4fOXf9/Uu0n2JeDRw tiyXF/fHA/sjSxT48PLA7sUWxDQsIrZ4Vs455QECL76ByA5JU2vh8vK/fyTN9pAgqWVe 3cRsYvV/rDN0PSLRbxGXV+k20rKacwNVTCd0PmojIzVjm14BNoDRfMawW8IgZ3Y2bkmj vpH7BtqWrPT0HLzwypDgCKnLAXof89j1lV2qdhMCY8p2toRCjgRMWtqADNSJq9YEYhdC eU0w== X-Forwarded-Encrypted: i=2; AJvYcCXnwq7AWifh0W13amS0s+FY7wOm0d3i2Gblo7Gcqnh59/G8jl9dpXpYaK5ZHLwGwnPcEp10r4vY8VWb5K7FB2UfAxxGFiOOayZRjgdEn18qnLl81GHEDY0oDn3Reg== X-Gm-Message-State: AOJu0YzDKhrPcCzEFHdf5DAlx1i/tuXooHXLQC/1BA4kLa4X5nhHYvKp Jlax1Wx2wM0vlTDLVGkIRDFf8+A9bGWyuIfYgGv7IsUDfeST6cKgoGmn57X6FAH59w== X-Google-Smtp-Source: AGHT+IH7JvVzf/YwEOkyv77fcevXTDPP4PsLfV51Is6fl1VNHl9Y3bE8nGWwBEXaxIsip5LojZgH7Q== X-Received: by 2002:a05:6512:7c:b0:512:f31c:f0c0 with SMTP id i28-20020a056512007c00b00512f31cf0c0mr6278054lfo.37.1709566464723; Mon, 04 Mar 2024 07:34:24 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6512:3d26:b0:512:ed5d:5da6 with SMTP id d38-20020a0565123d2600b00512ed5d5da6ls198901lfv.0.-pod-prod-01-eu; Mon, 04 Mar 2024 07:34:23 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUPlml16LJ6wr2WdgxBTRnFv6Yn2UYutqlYsODouxm5285zASrYmayxhMiaHRWoyYQGVLI/G+pWeTzsrwKUufY9tbed6Nf6UuyHjPHdEcCoshDw X-Received: by 2002:a05:6512:12ca:b0:512:f68b:69e7 with SMTP id p10-20020a05651212ca00b00512f68b69e7mr7943959lfg.16.1709566462933; Mon, 04 Mar 2024 07:34:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709566462; cv=none; d=google.com; s=arc-20160816; b=USBxJW+lYzysjM6pK0RelULAWrNDlcK3ZHoTyqf95UxW/6I/FtPAZZ2CdhpE+v++FI SDOglyAS8HQ8c+ubNfxliTXJ0YqTW7kAUeHPU6McBaIySHGOp3R/AKoVVW05V0oRRSIC 2UudLbvlTG9X6oAyCpkp1KeUMUZP0F/nYkZNQVTJbqWrL27pFYHYmjXMKk1AmSKUi51G Kmn+W71ZyZ0bs/l6lG/LfdMTKyXivKa6yi3+h7Fo8Buw9zMYDBV/kKRHKmxmyh62hzGd ShP7tBR1ad5MVW4+ZawBHPd+1w2krn5jdfGfokv9yAf5y88vDnuSbzFJhwam+XYR6WW4 7hZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=22LoPDWYEr8qpw9klGDqezi6sNR382c/bQpgL0iGnXU=; fh=bCZ+jyoSaCdnpQoPn/OTCd+ZpSGsIkts1xB8dSndxpE=; b=VeltTlbpDiMtIM3rxIsrTOA/vcMLJTvefN2Wlq9ylUC9AejsQ9IvhlEUpWOfU1YZQd q1gxjvhg6p8JiEYkhGFMcJCGZJ7iWQ3wfs0n91fjHKJh2KL4jImR61jPUmkYhVQS7x+G sGbXhSzciuGPPOfS+aMM0/YUdKqNWovMiLKm407h1CUk9oRgjyLOpDMEdY3Kqe5EMYuF hZKN7OLbInX6d8ig01S6CsFirHCnEH358wehqNVokiuQMDewo1swIxBXn46aWScR+BjR jwym7ybiOBARvyDiyv5PSMc/sIuBI3zgXA3eW3riYXhzYpyU7rMSBaztHlIuy+GHWZLW Dq1w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JJEE0zwL; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id rs26-20020a170907037a00b00a3e50af21cbsor3364824ejb.12.2024.03.04.07.34.22 for (Google Transport Security); Mon, 04 Mar 2024 07:34:22 -0800 (PST) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Forwarded-Encrypted: i=1; AJvYcCXHhEz5pkMy40XB+katH7vdxpyeV6CZcHPCuzwHnZe01/WRCYywzuJ8aGj8DXjk9INPPbehOW8QBTQY87ExHeU8g8wZ6Ega+bnc9BNUKNLK6/WA X-Received: by 2002:a17:906:394c:b0:a44:e3d:68a8 with SMTP id g12-20020a170906394c00b00a440e3d68a8mr6772866eje.45.1709566462640; Mon, 04 Mar 2024 07:34:22 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2001:b07:6474:ebbf:72fe:558f:d55e:d423]) by smtp.gmail.com with ESMTPSA id sa20-20020a1709076d1400b00a4432543b21sm4936082ejc.198.2024.03.04.07.34.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 07:34:22 -0800 (PST) From: Dario Binacchi To: buildroot@buildroot.org Cc: Romain Naour , Alexander Sverdlin , Andreas Dannenberg , Yegor Yefremov , Xuanhao Shi , Anand Gadiyar , James Hilliard , Thomas Petazzoni , Dario Binacchi , michael@amarulasolutions.com, Asaf Kahlon , francois.perrad@gadz.org, linux-amarula@amarulasolutions.com, bryce@redpinelabs.com Subject: [PATCH v9 12/22] boot/uboot: add BR2_TARGET_UBOOT_USE_BINMAN option Date: Mon, 4 Mar 2024 16:32:43 +0100 Message-ID: <20240304153253.732708-13-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240304153253.732708-1-dario.binacchi@amarulasolutions.com> References: <20240304153253.732708-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=JJEE0zwL; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Recent version of U-Boot use binman to provide a mechanism for building images, from simple SPL + U-Boot combinations, to more complex arrangements with many parts. This tool uses additional host python modules that must be provided by Buildroot. So introduce a new option BR2_TARGET_UBOOT_USE_BINMAN to add additional host packages in U-Boot build dependency to use binman. The binman requirement is directly included in buildman dependency (tools/buildman/requirements.txt) since within U-Boot, binman is invoked by the build system, here buildman [1]. Furthermore, the use of Binman no longer makes it necessary to set `UBOOT_MAKE_OPTS += DM=...'. We had the explanation from [2]: BINMAN_INDIRS is used to fetch the DM binary from /ti-dm/ and SYSFW binaries from /ti-sysfw/. [1] https://docs.u-boot.org/en/v2024.01/develop/package/binman.html#invoking-binman-within-u-boot [2] https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/09_01_00_08/exports/docs/linux/Foundational_Components/U-Boot/UG-General-Info.html Co-developed-by: Romain Naour Signed-off-by: Romain Naour Signed-off-by: Dario Binacchi --- Changes in v7: - Replace ifneq ($(BR2_TARGET_UBOOT_USE_BINMAN),y) with ifeq ($(BR2_TARGET_UBOOT_USE_BINMAN),). - Update the commit message Changes in v6: - BR2_TARGET_UBOOT_USE_BINMAN - Binman tool is not specific to TI K3 platform, so add an option to specify the use of Binman in U-Boot. - Add runtime dependencies - Update commit message - Add SOB and COB tags of Romain Naour Changes in v5: - Drop "DM=$(BINARIES_DIR)/ti-dm/$(UBOOT_TI_K3_DM_SOCNAME)/ipc_echo_testb_mcu1_0_release_strip.xer5f" from UBOOT_MAKE_OPTS. no changes since v1: boot/uboot/Config.in | 11 +++++++++++ boot/uboot/uboot.mk | 12 +++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in index beafb38930db..e6e7956adccb 100644 --- a/boot/uboot/Config.in +++ b/boot/uboot/Config.in @@ -290,6 +290,17 @@ config BR2_TARGET_UBOOT_NEEDS_ROCKCHIP_RKBIN This option makes sure that the needed binary blobs are copied into the U-Boot source directory. +config BR2_TARGET_UBOOT_USE_BINMAN + bool "U-Boot use binman" + depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS # python-rpds-py -> python-jsonschema + select BR2_TARGET_UBOOT_NEEDS_PYTHON3 + select BR2_TARGET_UBOOT_NEEDS_PYELFTOOLS + select BR2_TARGET_UBOOT_NEEDS_PYLIBFDT + help + Use binman tool for generation and signing of boot images. + + https://docs.u-boot.org/en/v2024.01/develop/package/binman.html + menu "U-Boot binary format" config BR2_TARGET_UBOOT_FORMAT_AIS diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk index dda606a88059..35a41d96a12d 100644 --- a/boot/uboot/uboot.mk +++ b/boot/uboot/uboot.mk @@ -187,10 +187,12 @@ UBOOT_MAKE_OPTS += TEE=$(BINARIES_DIR)/tee.elf endif ifeq ($(BR2_TARGET_UBOOT_NEEDS_TI_K3_DM),y) -UBOOT_TI_K3_DM_SOCNAME = $(call qstrip,$(BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME)) UBOOT_DEPENDENCIES += ti-k3-boot-firmware +ifeq ($(BR2_TARGET_UBOOT_USE_BINMAN),) +UBOOT_TI_K3_DM_SOCNAME = $(call qstrip,$(BR2_TARGET_UBOOT_TI_K3_DM_SOCNAME)) UBOOT_MAKE_OPTS += DM=$(BINARIES_DIR)/ti-dm/$(UBOOT_TI_K3_DM_SOCNAME)/ipc_echo_testb_mcu1_0_release_strip.xer5f endif +endif ifeq ($(BR2_TARGET_UBOOT_NEEDS_OPENSBI),y) UBOOT_DEPENDENCIES += opensbi @@ -269,6 +271,14 @@ ifeq ($(BR2_TARGET_UBOOT_NEEDS_XXD),y) UBOOT_DEPENDENCIES += host-vim endif +ifeq ($(BR2_TARGET_UBOOT_USE_BINMAN),y) +# https://source.denx.de/u-boot/u-boot/-/blob/v2024.01/tools/buildman/requirements.txt +UBOOT_DEPENDENCIES += \ + host-python-jsonschema \ + host-python-pyyaml +UBOOT_MAKE_OPTS += BINMAN_INDIRS=$(BINARIES_DIR) +endif + # prior to u-boot 2013.10 the license info was in COPYING. Copy it so # legal-info finds it define UBOOT_COPY_OLD_LICENSE_FILE