From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Mon, 27 May 2024 18:13:33 +0200 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 1sBcyb-000iZ4-11 for lore@lore.pengutronix.de; Mon, 27 May 2024 18:13:33 +0200 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 1sBcya-0002QV-Ny; Mon, 27 May 2024 18:13:32 +0200 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 1sBcyY-0002Q2-W9; Mon, 27 May 2024 18:13:31 +0200 Received: from [2a0a:edc0:2:b01:1d::c5] (helo=pty.whiteo.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sBcyY-003DJL-JO; Mon, 27 May 2024 18:13:30 +0200 Received: from rsc by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1sBcyY-00HA9E-1e; Mon, 27 May 2024 18:13:30 +0200 Date: Mon, 27 May 2024 18:13:30 +0200 From: Robert Schwebel To: Alexander Dahl Message-ID: References: <20240425080303.171897-1-ada@thorsis.com> <20240425080303.171897-3-ada@thorsis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240425080303.171897-3-ada@thorsis.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain Subject: Re: [DistroKit] [PATCH 2/9] platform: v8a: firmware-imx: Rework extract, install, and targetinstall X-BeenThere: distrokit@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: DistroKit Mailinglist List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: distrokit@pengutronix.de Sender: "DistroKit" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: distrokit-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false applied to next On Thu, Apr 25, 2024 at 10:02:55AM +0200, Alexander Dahl wrote: > Usually in ptxdist stages work like this: in extract stage files are put > into BUILDDIR. From there `make install` or something similar in > install stage copies build artifacts to PKGDIR. The install.post stage > copies everything from PKDIR to SYSROOT_TARGET. Finally targetinstall > stage uses the files from PKGDIR to populate root. > > Here everything was extracted to PKGDIR. Some files where manually > copied from PKGDIR to $(SYSROOT_TARGET)/usr/lib/firmware, before > install.post copied those files again to $(SYSROOT_TARGET)/firmware … > > Now the usual cycle as described above is followed, hopefully leading to > much less confusion, and avoiding duplicate files in sysroot-target. > > This gives us predictable paths in SYSROOT_TARGET and allows to use > files in $(SYSROOT_TARGET) to be used by other packages like U-Boot by > directly pointing at them, or pointing to the folder they are in (most > likely '$(SYSROOT_TARGET)/usr/lib/firmware'). > > (barebox does not point at those files, but copies them to its own > sourcedir through the inject mechanism.) > > Signed-off-by: Alexander Dahl > --- > configs/platform-v8a/rules/firmware-imx.make | 81 +++++++++++++------- > 1 file changed, 52 insertions(+), 29 deletions(-) > > diff --git a/configs/platform-v8a/rules/firmware-imx.make b/configs/platform-v8a/rules/firmware-imx.make > index b640db6..57a10c3 100644 > --- a/configs/platform-v8a/rules/firmware-imx.make > +++ b/configs/platform-v8a/rules/firmware-imx.make > @@ -20,10 +20,11 @@ FIRMWARE_IMX_SKIP := 38918 > FIRMWARE_IMX := firmware-imx-$(FIRMWARE_IMX_VERSION) > FIRMWARE_IMX_SUFFIX := bin > FIRMWARE_IMX_URL := http://www.nxp.com/lgfiles/NMG/MAD/YOCTO/$(FIRMWARE_IMX).$(FIRMWARE_IMX_SUFFIX) > +FIRMWARE_IMX_SOURCE := $(SRCDIR)/$(FIRMWARE_IMX).$(FIRMWARE_IMX_SUFFIX) > +FIRMWARE_IMX_DIR := $(BUILDDIR)/$(FIRMWARE_IMX) > FIRMWARE_IMX_LICENSE := NXP-Software-License-Agreement > FIRMWARE_IMX_LICENSE_FILES := \ > - file://$(FIRMWARE_IMX_PKGDIR)/COPYING;md5=228c72f2a91452b8a03c4cab30f30ef9 > -FIRMWARE_IMX_SOURCE := $(SRCDIR)/$(FIRMWARE_IMX).$(FIRMWARE_IMX_SUFFIX) > + file://COPYING;md5=228c72f2a91452b8a03c4cab30f30ef9 > > # > # Firmware blobs for barebox > @@ -51,38 +52,31 @@ endif > > $(STATEDIR)/firmware-imx.extract: > @$(call targetinfo) > - @mkdir -p "$(PKGDIR)" > - @dd if=$(FIRMWARE_IMX_SOURCE) bs=$(FIRMWARE_IMX_SKIP) skip=1 | tar xj -C $(PKGDIR) > + @$(call clean, $(FIRMWARE_IMX_DIR)) > + @mkdir -p "$(FIRMWARE_IMX_DIR)" > + @dd if="$(FIRMWARE_IMX_SOURCE)" bs=$(FIRMWARE_IMX_SKIP) skip=1 \ > + | tar -xj --strip-components=2 -C "$(FIRMWARE_IMX_DIR)" > + @$(call patchin, FIRMWARE_IMX) > + @$(call touch) > + > +# ---------------------------------------------------------------------------- > +# Prepare > +# ---------------------------------------------------------------------------- > + > +FIRMWARE_IMX_CONF_TOOL := NO > + > +# ---------------------------------------------------------------------------- > +# Compile > +# ---------------------------------------------------------------------------- > + > +$(STATEDIR)/firmware-imx.compile: > + @$(call targetinfo) > @$(call touch) > > # ---------------------------------------------------------------------------- > # Install > # ---------------------------------------------------------------------------- > > -$(STATEDIR)/firmware-imx.install: > - @$(call targetinfo) > - > -ifdef PTXCONF_FIRMWARE_IMX_BOOTIMAGE_IMX8 > - @$(foreach f, lpddr4_pmu_train_1d_dmem.bin lpddr4_pmu_train_1d_imem.bin \ > - lpddr4_pmu_train_2d_dmem.bin lpddr4_pmu_train_2d_imem.bin, \ > - install -v -D -m644 $(FIRMWARE_IMX_PKGDIR)/firmware/ddr/synopsys/$(f) \ > - $(PTXCONF_SYSROOT_TARGET)/usr/lib/firmware/ddr/synopsys/$(f)$(ptx/nl)) > - > - @$(foreach f, ddr4_dmem_1d.bin ddr4_dmem_2d.bin \ > - ddr4_imem_1d.bin ddr4_imem_2d.bin, \ > - install -v -D -m644 $(FIRMWARE_IMX_PKGDIR)/firmware/ddr/synopsys/$(f) \ > - $(PTXCONF_SYSROOT_TARGET)/usr/lib/firmware/ddr/synopsys/$(f)$(ptx/nl)) > - > - @$(foreach f, signed_dp_imx8m.bin signed_hdmi_imx8m.bin, \ > - install -v -D -m644 $(FIRMWARE_IMX_PKGDIR)/firmware/hdmi/cadence/$(f) \ > - $(PTXCONF_SYSROOT_TARGET)/usr/lib/firmware/hdmi/cadence/$(f)$(ptx/nl)) > -endif > - > - @$(call touch) > -# ---------------------------------------------------------------------------- > -# Target-Install > -# ---------------------------------------------------------------------------- > - > FIRMWARE_IMX_INSTALL-y := > FIRMWARE_IMX_INSTALL-$(PTXCONF_FIRMWARE_IMX_VPU_IMX27) += vpu_fw_imx27_TO2.bin > FIRMWARE_IMX_INSTALL-$(PTXCONF_FIRMWARE_IMX_VPU_IMX6Q) += vpu_fw_imx6q.bin > @@ -90,6 +84,35 @@ FIRMWARE_IMX_INSTALL-$(PTXCONF_FIRMWARE_IMX_VPU_IMX6DL) += vpu_fw_imx6d.bin > FIRMWARE_IMX_INSTALL-$(PTXCONF_FIRMWARE_IMX_VPU_IMX53) += vpu_fw_imx53.bin > FIRMWARE_IMX_INSTALL-$(PTXCONF_FIRMWARE_IMX_VPU_IMX51) += vpu_fw_imx51.bin > > +$(STATEDIR)/firmware-imx.install: > + @$(call targetinfo) > + > + @$(foreach f,$(FIRMWARE_IMX_INSTALL-y), \ > + install -v -D -m644 $(FIRMWARE_IMX_DIR)/firmware/vpu/$(f) \ > + $(FIRMWARE_IMX_PKGDIR)/usr/lib/firmware/vpu/$(f)$(ptx/nl)) > + > +ifdef PTXCONF_FIRMWARE_IMX_BOOTIMAGE_IMX8 > + @$(foreach f, lpddr4_pmu_train_1d_dmem.bin lpddr4_pmu_train_1d_imem.bin \ > + lpddr4_pmu_train_2d_dmem.bin lpddr4_pmu_train_2d_imem.bin, \ > + install -v -D -m644 $(FIRMWARE_IMX_DIR)/firmware/ddr/synopsys/$(f) \ > + $(FIRMWARE_IMX_PKGDIR)/usr/lib/firmware/ddr/synopsys/$(f)$(ptx/nl)) > + > + @$(foreach f, ddr4_dmem_1d.bin ddr4_dmem_2d.bin \ > + ddr4_imem_1d.bin ddr4_imem_2d.bin, \ > + install -v -D -m644 $(FIRMWARE_IMX_DIR)/firmware/ddr/synopsys/$(f) \ > + $(FIRMWARE_IMX_PKGDIR)/usr/lib/firmware/ddr/synopsys/$(f)$(ptx/nl)) > + > + @$(foreach f, signed_dp_imx8m.bin signed_hdmi_imx8m.bin, \ > + install -v -D -m644 $(FIRMWARE_IMX_DIR)/firmware/hdmi/cadence/$(f) \ > + $(FIRMWARE_IMX_PKGDIR)/usr/lib/firmware/hdmi/cadence/$(f)$(ptx/nl)) > +endif > + > + @$(call touch) > + > +# ---------------------------------------------------------------------------- > +# Target-Install > +# ---------------------------------------------------------------------------- > + > $(STATEDIR)/firmware-imx.targetinstall: > @$(call targetinfo) > > @@ -100,7 +123,7 @@ $(STATEDIR)/firmware-imx.targetinstall: > @$(call install_fixup, firmware-imx,DESCRIPTION,missing) > @$(foreach f,$(FIRMWARE_IMX_INSTALL-y), \ > $(call install_copy, firmware-imx, 0, 0, 0644, \ > - $(FIRMWARE_IMX_PKGDIR)/firmware/vpu/$(f), \ > + $(FIRMWARE_IMX_PKGDIR)/usr/lib/firmware/vpu/$(f), \ > /usr/lib/firmware/$(f))$(ptx/nl)) > @$(call install_finish, firmware-imx) > > -- > 2.39.2 > > > -- Pengutronix e.K. | Dipl.-Ing. Robert Schwebel | Steuerwalder Str. 21 | https://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |