| Message ID | 20240330160244.3214733-7-dario.binacchi@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-amarula+bncBCQ4XFG47UFRBMXPUCYAMGQEMOOWPUI@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 8FDBB3FAD6 for <linux-amarula@patchwork.amarulasolutions.com>; Sat, 30 Mar 2024 17:02:58 +0100 (CET) Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-56bf76d4282sf3138241a12.1 for <linux-amarula@patchwork.amarulasolutions.com>; Sat, 30 Mar 2024 09:02:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711814578; cv=pass; d=google.com; s=arc-20160816; b=tFvVj1Q0QHx//7h+PfFDFgm0SBx16+TXpG7Y+4GhGyDbpRyXj7p1mX1S2FKYUvl0VB ver74hSE+Lqa3bAwJAoxpEgrmbA8Z7JmN7DUGQJhqF2mYvhqNmCYhhUzXlL3L1wGCJ/Z IkNUaqi5BePil+xyz8UImPGgjEoJ/8mCyeBoGD22wA8axS/ETxvLhPV34fCtmE9NvbYI +QuU2FpzhbiZj8r3CJOmkye3BqkT9fvQ7116U2MpSTV6njv2mOkw1ObVtDtGSU4GLY2Q mjERabHpb7hOI2SeQAHyBqwk3IfqZ6Bl3qn157va2/ImTyH6IOSUaOibCNjscI0COSp+ hJVA== 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=rhBNZa8jmyfjEzY3cZNRC8GMy/liNeG80hAHtMsMIN4=; fh=t+7l5XKtRI0Ox7E7JEo+Ch43GSgsuRF5Mms/zheqM6c=; b=iLtF7xXM+eME5H+cXGXcEyalC9e980X9itmdstYjCuNX85W7WrIvbNDRqa1dbccOFT 0G5ZilqQdeZTlT9eTOVveEEByvcgA1ltmI7FezcZr9kFSMaavNkOFyfD6U5xbCvp35e7 fnk5EhC4ezCsVROn3Q5HH+cXTq4BRenYEvxWHYD1mm/9BDX1iYwqwEOUS14vQRUhmz3r tzsrGMjd8iI0wB7e8FTDaQlXpdqYJepwocnDQqfmSEpkkHjQMHADBZqRascVRc6SQyXZ kirMq428o5ox+vnIj3UlOLNPaWo/ThLhu4WQSYo/7+7NAjWjs763L8w1Kf9a7oQBcTTS 3hGA==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=VPYTTvfx; 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=1711814578; x=1712419378; 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=rhBNZa8jmyfjEzY3cZNRC8GMy/liNeG80hAHtMsMIN4=; b=YcrdAWhRpw4hkNOcKM0w5Loa+p9rS+TIgj+XTfuABkOkE9hdiYte7aM47EqCJe2NX6 ONX/B0TVORDa5gLABdJz9v3xQmW8oc0eKdAy1sKn6qbN3aUIbcL/4budM/iuQYxi+9RL f2/49/ILdMojMuuREq2qIHKqm8wuNdaVKcfT4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711814578; x=1712419378; 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=rhBNZa8jmyfjEzY3cZNRC8GMy/liNeG80hAHtMsMIN4=; b=WHITNy7Cwq1d8Lu7LnZUmJLYMABEYF3EeEy5sP5myWuXkPE/822aoXn6nYEYDH3e// ZmRXfbsew9xT2dd7n/dKfROCcjkQ0uVUXnRhap9npHKkNdIYzF/B7v+jrsC/oJHOD3mM gOQ7KbbaaR1ukU8I/I45uJ6ENLvZSdoHwdfIypaK9KpBExN1ekNck3S+0H0a/y8YNTiL fP/s/FKd700ZAuXtD9sQYdvm+vADLDlBMD0VejUKTbIPG5yESarrNGKdd/XSNHNXoSSc 2eB1aZh4ODwG3sQVfhvJL9suouMOJhHRp16/swTisQQcCTJhIaWReVIfw7EGkXAhcLRn QkYg== X-Forwarded-Encrypted: i=2; AJvYcCVSlnpTG/yK89yMH4ZAzdwYkrff2vJXfSSkh18mzbJY1cHJBiVZWCAVBo5zvHF3kqGA7YVFw8foH71rOYVZMtf3Nqwb1TPPbUbvTo+MBoYw3PD3l7EU7mPphTUmhA== X-Gm-Message-State: AOJu0YynfmPvL97mAfb3+Mvly/3CGQa/mB9o6McRZt6P/JaiZ2btLwXc C+D3L6rXlskTGSBmVwd8X9ouweLBww/9Mtfl5/LZSF2gCObqCIthyvetk9qHNKeurw== X-Google-Smtp-Source: AGHT+IEmj757O9U3ZbitFND+kfWiSeWkCRlFSnZwvE3IE4vSPJQLJSyIuWKeuxrxZxYh2XZB8STekg== X-Received: by 2002:a50:cd02:0:b0:56d:c757:9379 with SMTP id z2-20020a50cd02000000b0056dc7579379mr621604edi.15.1711814578327; Sat, 30 Mar 2024 09:02:58 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:268a:b0:56c:4cab:8b77 with SMTP id w10-20020a056402268a00b0056c4cab8b77ls483162edd.2.-pod-prod-00-eu; Sat, 30 Mar 2024 09:02:57 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVmMgOngQpbERa0rq5HL+DG34g2MEofl6I8avkFhiUaQfjpK2f85amqHQFnF6VBCH6NaLu39GzJgj5agUy8RmXvgWBmKqUmpMvUef9skUH5xXOq X-Received: by 2002:a50:d714:0:b0:566:624a:9e3f with SMTP id t20-20020a50d714000000b00566624a9e3fmr7838782edi.3.1711814576785; Sat, 30 Mar 2024 09:02:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711814576; cv=none; d=google.com; s=arc-20160816; b=MYS95wHjiJZgGQ3gU3x90cwveAfl5TEPlRzr6TUxBgtHe+/EWtTXjZhzK2t8U18Ic/ h4GFiJL2lSRmOsy33QnxEpGVXuF2Kv1tsCiXus+Pke2mXM8+EONWjbPPnPeQcl+LP1RX H9ZzOn+U14Tss5KNldNNEN7kPo65O9geOZCFwGhufirLYs1UsMQlY8Qcqob8GHFgF289 gVkDiRN0ytnxL+YRxnQE8BWiIYctg9q34SsUL6wULAVDGwoYn8EQvPWqKuegnONqb55m Oi1yhjw1AgHgJJFtDmFC5wbcb4QS42J30156SdVZv96X5OqPwlwiMca45rju04S3CIoA QMGg== 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=bprQybVcjJtafv+N+uoSsIglL497eIKFD5hLVUAwUew=; fh=v2Qbfxv8+WACo9kZxzFvVSGZ9mpEI/9YCXmirxswbCw=; b=sK3ayNmTWyJz2N1XGHlwSvWEC+qfJAEDxxlebJQu6hA9kukzD4WalvSGYQh0fGi7Cu YumsA6KD8sp6y1mUKnsvLwdnpj9VLT4YxWx8Z16lLAHm2ZHUYDBBsLRM8WT9k/y056in iJwTWRzIYy9A2sLqGqdJV5eNxe1xjETnCr0A9WC1z/Hd2bReeHCXFmQQJYwf0zD7nUrZ 12mnDvf8bRhlfVFfdJH3hlXzg+vnuCxbPDD+0cAExDS6cCzpbZz6ZXTICACgTmbkptit TEe8lvVcv4NvLp1xZlvQpaKH6LUU4jErN9vN5RnfaEg/LpIbpm+pUC5hmphk8H4Jw2K0 o6Sw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=VPYTTvfx; 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 b18-20020a056402351200b0056bc1116e06sor3565737edd.3.2024.03.30.09.02.56 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Sat, 30 Mar 2024 09:02:56 -0700 (PDT) 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; AJvYcCWhrJCcsuNDmteOCtGcqkuHxIKv5BfS4xNTcJkV0oDL0goBCtEkQlcMGH/3z2Dc2Y4OUWNnF8igI5kvtFI7T1wr1Ve8ACdsyBf9rpFeV3OGaIw8 X-Received: by 2002:a05:6402:3590:b0:56b:ddcb:bb67 with SMTP id y16-20020a056402359000b0056bddcbbb67mr5473973edc.2.1711814576559; Sat, 30 Mar 2024 09:02:56 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-87-8-99-67.retail.telecomitalia.it. [87.8.99.67]) by smtp.gmail.com with ESMTPSA id f13-20020a056402004d00b0056c633354c6sm2127107edu.45.2024.03.30.09.02.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Mar 2024 09:02:56 -0700 (PDT) From: Dario Binacchi <dario.binacchi@amarulasolutions.com> To: buildroot@buildroot.org Cc: Romain Naour <romain.naour@smile.fr>, Alexander Sverdlin <alexander.sverdlin@gmail.com>, Andreas Dannenberg <dannenberg@ti.com>, Yegor Yefremov <yegorslists@googlemail.com>, Xuanhao Shi <X15000177@gmail.com>, Anand Gadiyar <gadiyar@ti.com>, James Hilliard <james.hilliard1@gmail.com>, Thomas Petazzoni <thomas.petazzoni@bootlin.com>, Dario Binacchi <dario.binacchi@amarulasolutions.com>, michael@amarulasolutions.com, Asaf Kahlon <asafka7@gmail.com>, francois.perrad@gadz.org, linux-amarula@amarulasolutions.com, bryce@redpinelabs.com, "Yann E . Morin" <yann.morin.1998@free.fr> Subject: [PATCH v10 06/12] boot/ti-k3/ti-k3-r5-loader: install tiboot3.bin Date: Sat, 30 Mar 2024 17:02:38 +0100 Message-ID: <20240330160244.3214733-7-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240330160244.3214733-1-dario.binacchi@amarulasolutions.com> References: <20240330160244.3214733-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=VPYTTvfx; 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: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
| Series |
Add support for AM62x-SK HS-FS devices
|
|
Commit Message
Dario Binacchi
March 30, 2024, 4:02 p.m. UTC
Recent versions of U-Boot are capable of building tiboot3.bin using Binman. In this case, let's copy it to the binaries directory. The use of `find' command is justified by the need to use a regex expression to select the correct file. This is not possible with a simple `cp' command. Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> --- Changes in v8: - Use the `find' command in pipe with the `cp' command. Changes in v6: - Replace `find' command with `cp' one. Changes in v5: - Replace tiboot3-*-$(TI_K3_R5_LOADER_SECTYPE)-*.bin with tiboot3-$(TI_K3_R5_LOADER_SOC)-$(TI_K3_R5_LOADER_SECTYPE)-*.bin Added in v4 Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> --- boot/ti-k3-r5-loader/ti-k3-r5-loader.mk | 4 ++++ 1 file changed, 4 insertions(+)
Comments
Hi Dario, On Sat Mar 30, 2024 at 5:02 PM CET, Dario Binacchi wrote: > Recent versions of U-Boot are capable of building tiboot3.bin using > Binman. In this case, let's copy it to the binaries directory. > > The use of `find' command is justified by the need to use a regex > expression to select the correct file. This is not possible with a > simple `cp' command. > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > > --- > > Changes in v8: > - Use the `find' command in pipe with the `cp' command. > > Changes in v6: > - Replace `find' command with `cp' one. > > Changes in v5: > - Replace tiboot3-*-$(TI_K3_R5_LOADER_SECTYPE)-*.bin with > tiboot3-$(TI_K3_R5_LOADER_SOC)-$(TI_K3_R5_LOADER_SECTYPE)-*.bin > > Added in v4 > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > --- > boot/ti-k3-r5-loader/ti-k3-r5-loader.mk | 4 ++++ > 1 file changed, 4 insertions(+) > > 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 fdb058f3b72a..9a05d005067a 100644 > --- a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk > +++ b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk > @@ -70,8 +70,12 @@ define TI_K3_R5_LOADER_BUILD_CMDS > $(TARGET_CONFIGURE_OPTS) $(TI_K3_R5_LOADER_MAKE) -C $(@D) $(TI_K3_R5_LOADER_MAKE_OPTS) > endef > > +TI_K3_R5_LOADER_SECTYPE = $(call qstrip,$(BR2_PACKAGE_TI_K3_SECTYPE)) > +TI_K3_R5_LOADER_SOC = $(call qstrip,$(BR2_PACKAGE_TI_K3_SOC)) > + > define TI_K3_R5_LOADER_INSTALL_IMAGES_CMDS > cp $(@D)/spl/u-boot-spl.bin $(BINARIES_DIR)/r5-u-boot-spl.bin > + cd $(@D); find ./ -type f -regex "\.\/tiboot3-$(TI_K3_R5_LOADER_SOC)-$(TI_K3_R5_LOADER_SECTYPE)-[^-]*..bin" -exec cp {} $(BINARIES_DIR)/tiboot3.bin \; The filename should *not* be hardcoded to look like <soc>-<sectype>.bin. This is just an artifact how TI is naming their files in *their* u-boot binman files. Instead this should just be a Kconfig variable (maybe K3_R5_LOADER_FILENAME?) which can be set by the user/board config and which defaults to "tiboot3.bin". "tiboot3.bin" is the filename which is used by the ROM in filesystem boot mode and for which u-boot is already creating a symlink. So this will then just be another simple "cp". On a side node, we also found out that the "find . -regex" is rather fragile in the sense that it might not copy anything at all without generating an error. -michael
[resend because mail got bounced on the ML, sorry] Hi Dario, On Sat Mar 30, 2024 at 5:02 PM CET, Dario Binacchi wrote: > Recent versions of U-Boot are capable of building tiboot3.bin using > Binman. In this case, let's copy it to the binaries directory. > > The use of `find' command is justified by the need to use a regex > expression to select the correct file. This is not possible with a > simple `cp' command. > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > > --- > > Changes in v8: > - Use the `find' command in pipe with the `cp' command. > > Changes in v6: > - Replace `find' command with `cp' one. > > Changes in v5: > - Replace tiboot3-*-$(TI_K3_R5_LOADER_SECTYPE)-*.bin with > tiboot3-$(TI_K3_R5_LOADER_SOC)-$(TI_K3_R5_LOADER_SECTYPE)-*.bin > > Added in v4 > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > --- > boot/ti-k3-r5-loader/ti-k3-r5-loader.mk | 4 ++++ > 1 file changed, 4 insertions(+) > > 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 fdb058f3b72a..9a05d005067a 100644 > --- a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk > +++ b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk > @@ -70,8 +70,12 @@ define TI_K3_R5_LOADER_BUILD_CMDS > $(TARGET_CONFIGURE_OPTS) $(TI_K3_R5_LOADER_MAKE) -C $(@D) $(TI_K3_R5_LOADER_MAKE_OPTS) > endef > > +TI_K3_R5_LOADER_SECTYPE = $(call qstrip,$(BR2_PACKAGE_TI_K3_SECTYPE)) > +TI_K3_R5_LOADER_SOC = $(call qstrip,$(BR2_PACKAGE_TI_K3_SOC)) > + > define TI_K3_R5_LOADER_INSTALL_IMAGES_CMDS > cp $(@D)/spl/u-boot-spl.bin $(BINARIES_DIR)/r5-u-boot-spl.bin > + cd $(@D); find ./ -type f -regex "\.\/tiboot3-$(TI_K3_R5_LOADER_SOC)-$(TI_K3_R5_LOADER_SECTYPE)-[^-]*..bin" -exec cp {} $(BINARIES_DIR)/tiboot3.bin \; The filename should *not* be hardcoded to look like <soc>-<sectype>.bin. This is just an artifact how TI is naming their files in *their* u-boot binman files. Instead this should just be a Kconfig variable (maybe K3_R5_LOADER_FILENAME?) which can be set by the user/board config and which defaults to "tiboot3.bin". "tiboot3.bin" is the filename which is used by the ROM in filesystem boot mode and for which u-boot is already creating a symlink. So this will then just be another simple "cp". On a side node, we also found out that the "find . -regex" is rather fragile in the sense that it might not copy anything at all without generating an error. -michael
Hi Michael On Wed, Apr 3, 2024 at 3:05 PM Michael Walle <mwalle@kernel.org> wrote: > > [resend because mail got bounced on the ML, sorry] > > Hi Dario, > > On Sat Mar 30, 2024 at 5:02 PM CET, Dario Binacchi wrote: > > Recent versions of U-Boot are capable of building tiboot3.bin using > > Binman. In this case, let's copy it to the binaries directory. > > > > The use of `find' command is justified by the need to use a regex > > expression to select the correct file. This is not possible with a > > simple `cp' command. > > > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > > > > --- > > > > Changes in v8: > > - Use the `find' command in pipe with the `cp' command. > > > > Changes in v6: > > - Replace `find' command with `cp' one. > > > > Changes in v5: > > - Replace tiboot3-*-$(TI_K3_R5_LOADER_SECTYPE)-*.bin with > > tiboot3-$(TI_K3_R5_LOADER_SOC)-$(TI_K3_R5_LOADER_SECTYPE)-*.bin > > > > Added in v4 > > > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > > --- > > boot/ti-k3-r5-loader/ti-k3-r5-loader.mk | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > 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 fdb058f3b72a..9a05d005067a 100644 > > --- a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk > > +++ b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk > > @@ -70,8 +70,12 @@ define TI_K3_R5_LOADER_BUILD_CMDS > > $(TARGET_CONFIGURE_OPTS) $(TI_K3_R5_LOADER_MAKE) -C $(@D) $(TI_K3_R5_LOADER_MAKE_OPTS) > > endef > > > > +TI_K3_R5_LOADER_SECTYPE = $(call qstrip,$(BR2_PACKAGE_TI_K3_SECTYPE)) > > +TI_K3_R5_LOADER_SOC = $(call qstrip,$(BR2_PACKAGE_TI_K3_SOC)) > > + > > define TI_K3_R5_LOADER_INSTALL_IMAGES_CMDS > > cp $(@D)/spl/u-boot-spl.bin $(BINARIES_DIR)/r5-u-boot-spl.bin > > + cd $(@D); find ./ -type f -regex "\.\/tiboot3-$(TI_K3_R5_LOADER_SOC)-$(TI_K3_R5_LOADER_SECTYPE)-[^-]*..bin" -exec cp {} $(BINARIES_DIR)/tiboot3.bin \; > > The filename should *not* be hardcoded to look like > <soc>-<sectype>.bin. This is just an artifact how TI is naming their > files in *their* u-boot binman files. Instead this should just be a > Kconfig variable (maybe K3_R5_LOADER_FILENAME?) which can be set by > the user/board config and which defaults to "tiboot3.bin". > "tiboot3.bin" is the filename which is used by the ROM in filesystem > boot mode and for which u-boot is already creating a symlink. > So this will then just be another simple "cp". > > On a side node, we also found out that the "find . -regex" is rather > fragile in the sense that it might not copy anything at all without > generating an error. > The idea was to merge this series based on the series topic. I would like to remind you that the code in buildroot was not working and we sent a first series back in November that was suppose to fix something that was "merged" before and unfortunately broken. We like all the suggestions and we would of course love to improve the series but it would be nice to limit the series to the subject and not continue to add a more generalist approach. This is from you the first email and thank you for adding your contribution and welcome on board too. I think that we should now wait for V11 Michael > -michael
Hi Michael, > > > +TI_K3_R5_LOADER_SECTYPE = $(call qstrip,$(BR2_PACKAGE_TI_K3_SECTYPE)) > > > +TI_K3_R5_LOADER_SOC = $(call qstrip,$(BR2_PACKAGE_TI_K3_SOC)) > > > + > > > define TI_K3_R5_LOADER_INSTALL_IMAGES_CMDS > > > cp $(@D)/spl/u-boot-spl.bin $(BINARIES_DIR)/r5-u-boot-spl.bin > > > + cd $(@D); find ./ -type f -regex "\.\/tiboot3-$(TI_K3_R5_LOADER_SOC)-$(TI_K3_R5_LOADER_SECTYPE)-[^-]*..bin" -exec cp {} $(BINARIES_DIR)/tiboot3.bin \; > > > > The filename should *not* be hardcoded to look like > > <soc>-<sectype>.bin. This is just an artifact how TI is naming their > > files in *their* u-boot binman files. Instead this should just be a > > Kconfig variable (maybe K3_R5_LOADER_FILENAME?) which can be set by > > the user/board config and which defaults to "tiboot3.bin". > > "tiboot3.bin" is the filename which is used by the ROM in filesystem > > boot mode and for which u-boot is already creating a symlink. > > So this will then just be another simple "cp". > > > > On a side node, we also found out that the "find . -regex" is rather > > fragile in the sense that it might not copy anything at all without > > generating an error. > > > > The idea was to merge this series based on the series topic. I would > like to remind you that > the code in buildroot was not working and we sent a first series back > in November that was suppose > to fix something that was "merged" before and unfortunately broken. > We like all the suggestions and we would of course love > to improve the series but it would be nice to limit the series to the > subject and not continue to add a more generalist approach. > This is from you the first email and thank you for adding your > contribution and welcome on board too. > I think that we should now wait for V11 Sorry, for being that late, but I don't think it is the way to go to introduce something "broken" (for a lack of a better wording) and then fix it afterwards, Esp. because it means touching all the bits and defconfigs again. IOW, this is not an improvement but rather how to do it the correct way (in my opinion, others might disagree of course). Also, I'm not sure if the TI_K3_R5_LOADER_{SOC,SECTYPE} is used elsewhere or if it can be dropped altogether. -michael
Hi Michael On Wed, Apr 3, 2024 at 3:24 PM Michael Walle <mwalle@kernel.org> wrote: > > Hi Michael, > > > > > +TI_K3_R5_LOADER_SECTYPE = $(call qstrip,$(BR2_PACKAGE_TI_K3_SECTYPE)) > > > > +TI_K3_R5_LOADER_SOC = $(call qstrip,$(BR2_PACKAGE_TI_K3_SOC)) > > > > + > > > > define TI_K3_R5_LOADER_INSTALL_IMAGES_CMDS > > > > cp $(@D)/spl/u-boot-spl.bin $(BINARIES_DIR)/r5-u-boot-spl.bin > > > > + cd $(@D); find ./ -type f -regex "\.\/tiboot3-$(TI_K3_R5_LOADER_SOC)-$(TI_K3_R5_LOADER_SECTYPE)-[^-]*..bin" -exec cp {} $(BINARIES_DIR)/tiboot3.bin \; > > > > > > The filename should *not* be hardcoded to look like > > > <soc>-<sectype>.bin. This is just an artifact how TI is naming their > > > files in *their* u-boot binman files. Instead this should just be a > > > Kconfig variable (maybe K3_R5_LOADER_FILENAME?) which can be set by > > > the user/board config and which defaults to "tiboot3.bin". > > > "tiboot3.bin" is the filename which is used by the ROM in filesystem > > > boot mode and for which u-boot is already creating a symlink. > > > So this will then just be another simple "cp". > > > > > > On a side node, we also found out that the "find . -regex" is rather > > > fragile in the sense that it might not copy anything at all without > > > generating an error. > > > > > > > The idea was to merge this series based on the series topic. I would > > like to remind you that > > the code in buildroot was not working and we sent a first series back > > in November that was suppose > > to fix something that was "merged" before and unfortunately broken. > > We like all the suggestions and we would of course love > > to improve the series but it would be nice to limit the series to the > > subject and not continue to add a more generalist approach. > > This is from you the first email and thank you for adding your > > contribution and welcome on board too. > > I think that we should now wait for V11 > > Sorry, for being that late, but I don't think it is the way to go to > introduce something "broken" (for a lack of a better wording) and I just said that your suggestion is welcome but the code we have already has been broken for months. > then fix it afterwards, Esp. because it means touching all the bits > and defconfigs again. IOW, this is not an improvement but rather how > to do it the correct way (in my opinion, others might disagree of > course). The proposal is not broken but it's better to say not consistent with newer boards/soc. Am I wrong? > Also, I'm not sure if the TI_K3_R5_LOADER_{SOC,SECTYPE} is used > elsewhere or if it can be dropped altogether. Clear Michael > > -michael
Hi, On Wed Apr 3, 2024 at 3:49 PM CEST, Michael Nazzareno Trimarchi wrote: > > > > > +TI_K3_R5_LOADER_SECTYPE = $(call qstrip,$(BR2_PACKAGE_TI_K3_SECTYPE)) > > > > > +TI_K3_R5_LOADER_SOC = $(call qstrip,$(BR2_PACKAGE_TI_K3_SOC)) > > > > > + > > > > > define TI_K3_R5_LOADER_INSTALL_IMAGES_CMDS > > > > > cp $(@D)/spl/u-boot-spl.bin $(BINARIES_DIR)/r5-u-boot-spl.bin > > > > > + cd $(@D); find ./ -type f -regex "\.\/tiboot3-$(TI_K3_R5_LOADER_SOC)-$(TI_K3_R5_LOADER_SECTYPE)-[^-]*..bin" -exec cp {} $(BINARIES_DIR)/tiboot3.bin \; > > > > > > > > The filename should *not* be hardcoded to look like > > > > <soc>-<sectype>.bin. This is just an artifact how TI is naming their > > > > files in *their* u-boot binman files. Instead this should just be a > > > > Kconfig variable (maybe K3_R5_LOADER_FILENAME?) which can be set by > > > > the user/board config and which defaults to "tiboot3.bin". > > > > "tiboot3.bin" is the filename which is used by the ROM in filesystem > > > > boot mode and for which u-boot is already creating a symlink. > > > > So this will then just be another simple "cp". > > > > > > > > On a side node, we also found out that the "find . -regex" is rather > > > > fragile in the sense that it might not copy anything at all without > > > > generating an error. > > > > > > > > > > The idea was to merge this series based on the series topic. I would > > > like to remind you that > > > the code in buildroot was not working and we sent a first series back > > > in November that was suppose > > > to fix something that was "merged" before and unfortunately broken. > > > We like all the suggestions and we would of course love > > > to improve the series but it would be nice to limit the series to the > > > subject and not continue to add a more generalist approach. > > > This is from you the first email and thank you for adding your > > > contribution and welcome on board too. > > > I think that we should now wait for V11 > > > > Sorry, for being that late, but I don't think it is the way to go to > > introduce something "broken" (for a lack of a better wording) and > > I just said that your suggestion is welcome but the code we have > already has been broken for > months. > > > then fix it afterwards, Esp. because it means touching all the bits > > and defconfigs again. IOW, this is not an improvement but rather how > > to do it the correct way (in my opinion, others might disagree of > > course). > > The proposal is not broken but it's better to say not consistent with > newer boards/soc. Am I wrong? I'd argue it makes wrong assumptions. The filename buildroot is picking up here comes from the u-boot binman device tree artifact and the author of this binman dtsi file is free to choose whatever filename they like: filename = "tiboot3-am64x_sr2-hs-evm.bin"; Thus, buildroot should not assume that the filename has some kind of structure. And also, the binman already generates a link to the default tiboot3.bin. Anyway, you have my feedback and there should be enough information for everyone to form their own opinion on this topic. -michael
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 fdb058f3b72a..9a05d005067a 100644 --- a/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk +++ b/boot/ti-k3-r5-loader/ti-k3-r5-loader.mk @@ -70,8 +70,12 @@ define TI_K3_R5_LOADER_BUILD_CMDS $(TARGET_CONFIGURE_OPTS) $(TI_K3_R5_LOADER_MAKE) -C $(@D) $(TI_K3_R5_LOADER_MAKE_OPTS) endef +TI_K3_R5_LOADER_SECTYPE = $(call qstrip,$(BR2_PACKAGE_TI_K3_SECTYPE)) +TI_K3_R5_LOADER_SOC = $(call qstrip,$(BR2_PACKAGE_TI_K3_SOC)) + define TI_K3_R5_LOADER_INSTALL_IMAGES_CMDS cp $(@D)/spl/u-boot-spl.bin $(BINARIES_DIR)/r5-u-boot-spl.bin + cd $(@D); find ./ -type f -regex "\.\/tiboot3-$(TI_K3_R5_LOADER_SOC)-$(TI_K3_R5_LOADER_SECTYPE)-[^-]*..bin" -exec cp {} $(BINARIES_DIR)/tiboot3.bin \; endef $(eval $(kconfig-package))