From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Thu, 13 Mar 2025 15:47:31 +0100 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tsjqO-00Dbdq-0z for lore@lore.pengutronix.de; Thu, 13 Mar 2025 15:47:31 +0100 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1tsjqN-0007j5-GP; Thu, 13 Mar 2025 15:47:31 +0100 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tsjqD-0007hi-O7; Thu, 13 Mar 2025 15:47:21 +0100 Received: from pty.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::c5]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tsjqD-005YGz-1j; Thu, 13 Mar 2025 15:47:21 +0100 Received: from mol by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1tsjqD-00BNbS-1L; Thu, 13 Mar 2025 15:47:21 +0100 Date: Thu, 13 Mar 2025 15:47:21 +0100 From: Michael Olbrich To: Michael Tretter Message-ID: Mail-Followup-To: Michael Tretter , ptxdist@pengutronix.de, Benjamin Gaignard References: <20250313122150.11021-1-benjamin.gaignard@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-IRC: #ptxdist @freenode Subject: Re: [ptxdist] [PATCH] barebox: Copy TF-A binaries in to barebox firmware directory X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: Benjamin Gaignard , ptxdist@pengutronix.de Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false On Thu, Mar 13, 2025 at 03:28:33PM +0100, Michael Tretter wrote: > On Thu, 13 Mar 2025 13:21:50 +0100, Benjamin Gaignard wrote: > > If ARM trusted firmware option has been selected copy the > > generated bl32 binaries to barebox firmware directory so they > > can be included in barebox build process. > > > > Signed-off-by: Benjamin Gaignard > > --- > > rules/barebox.make | 10 ++++++++++ > > 1 file changed, 10 insertions(+) > > > > diff --git a/rules/barebox.make b/rules/barebox.make > > index c0d9c5744..15c06d685 100644 > > --- a/rules/barebox.make > > +++ b/rules/barebox.make > > @@ -119,6 +119,16 @@ ifdef PTXCONF_BAREBOX_EXTRA_ENV > > $(BAREBOX_BUILD_DIR)/.config; \ > > fi > > endif > > + > > +ifdef PTXCONF_TF_A > > + mkdir -p $(BAREBOX_BUILD_DIR)/firmware/ > > + @for i in `find $(PTXCONF_SYSROOT_TARGET)/usr/lib/firmware/ -maxdepth 1 \ > > + -type f -name *-bl31.bin -printf "%f\n"`; do \ > > + cp $(PTXCONF_SYSROOT_TARGET)/usr/lib/firmware/$$i $(BAREBOX_BUILD_DIR)/firmware/; \ > > + cp $(PTXCONF_SYSROOT_TARGET)/usr/lib/firmware/$$i $(BAREBOX_DIR)/firmware/; \ > > + done > > +endif > > + > > There is already a (underdocumented) mechanism to copy binaries to the > barebox firmware directory: The PTXCONF_BAREBOX_FIRMWARE option and the > world/inject call. > > Enable PTXCONF_BAREBOX_FIRMWARE and add the filenames of the binaries > that you want to install and their target location to the > BAREBOX_INJECT_FILES variable. The inject mechanism copies the files > from /usr/lib/firmware (BAREBOX_INJECT_PATH) to a specified location in > the barebox build directory. The patches[1] that introduced this feature also contained integration for rockchip firmware. I did not apply those patches, but they are a good place to look at if you need to do your own integration in your BSP. Michael [1] https://lore.ptxdist.org/ptxdist/20220129070330.2601433-1-michael.riesch@wolfvision.net/ -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |