From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Thu, 04 Jan 2024 10:12:26 +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 1rLJm5-003Kw9-21 for lore@lore.pengutronix.de; Thu, 04 Jan 2024 10:12:26 +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 1rLJm4-0000le-TU; Thu, 04 Jan 2024 10:12:24 +0100 Received: from h2.cmg2.smtp.forpsi.com ([81.2.195.189]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rLJlj-0000lO-Ck for ptxdist@pengutronix.de; Thu, 04 Jan 2024 10:12:04 +0100 Received: from lenoch ([91.218.190.200]) by cmgsmtp with ESMTPSA id LJlhrp7z7SqGRLJlir3xkl; Thu, 04 Jan 2024 10:12:02 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=triops.cz; s=f2019; t=1704359522; bh=gKrmeubxAogBH6tTRIaS/GYWr/zOjmn95wY874zzNvc=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type; b=jS53hE2EBCnM0woCwq3HPRltgH0yRLUVm9ak0+QwsqLvNiShOvOqzngZYCeWoBnAp wnz8tI3Q4OI4fhJb0a7DLkNikYdoH5uAzMewl3T+Oo+YafGQZz3aY4s7cTdfHEGAyz lzeWFxlvh08R9TUi7SkxrS5CuuIaAd+n1oF0ZvuUBx3NKOCGDYs2vQCzEoxMgVE4Tz 10z6h3o+RAgHn70KfOgcvqEIiVHZbOA9mN/2fjrP3nSI3YtFStmtwZKPNlCx76uzEI LbSIM4yDqhRe5g1tQzJRWQfOSGL0jAjzjkYI2lhq8L85Im98AHAGViQ2QEVjgqDYuS +JrkcHr1VmoPw== Date: Thu, 4 Jan 2024 10:12:01 +0100 From: Ladislav Michl To: ptxdist@pengutronix.de Message-ID: References: <20240103192352.3447044-1-christian.melki@t2data.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240103192352.3447044-1-christian.melki@t2data.com> X-CMAE-Envelope: MS4wfPGYEFcEnSEJvJuXGqZLANEamZI3lFmSev2cu0xuZvdolPY80uicaJtqAR7RDlYz98Kugf6ud8geoSrhdISApxJQ6MwlgdytR5XLu/NLah4Sd5y0Elms UPWsvHJsgwUTUU5XFpLtrJpfo9crMGMuICc2O2xA2lUrw6g4V/jXQvXL X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.whiteo.stw.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-2.4 required=4.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [ptxdist] [PATCH] libfdt: New package. 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 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 Hi, On Wed, Jan 03, 2024 at 08:23:52PM +0100, Christian Melki wrote: > Add the device-tree-compiler source as libfdt. > I guess the package could have been named dtc as a target > variant with libfdt, but I don't know of any uses of the > dtc on target environments. Appended my version created about two years ago... Those DTC tools were used to patch devicetree during on field board upgrade when moving from ancient kernel. Flash repartioning was part of that upgrade as well as use of RAUC. Basically all userspace was moved to ramdisk, detached from flash, new image was prepared and flashed at once - single point of failure, board was dead when this failed, but as far as I know, it never happened. So yes, dtc on target environment is very usefull :) > So the only use I can think of is libfdt. I think the name is more > accurate towards usage, but it isn't as symmetrical as the > typical host-* and normal variants. In case you reconsider, I'll merge your and my variant (I didn't bother with licenses as it was part of local BSP). > The use of libfdt is separate from the host-dtc usage too, > so whatever version you'd use for external device trees are probably > not the same as target lifdt. There you'd typically want the latest > version. > > This work is prepping for qemu 8.2.0+, as it requires libfdt > as a separate library. It has stopped providing one internally. > > Signed-off-by: Christian Melki > --- > rules/libfdt.in | 9 +++++++ > rules/libfdt.make | 69 +++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 78 insertions(+) > create mode 100644 rules/libfdt.in > create mode 100644 rules/libfdt.make > > diff --git a/rules/libfdt.in b/rules/libfdt.in > new file mode 100644 > index 000000000..3e30062e9 > --- /dev/null > +++ b/rules/libfdt.in > @@ -0,0 +1,9 @@ > +## SECTION=system_libraries > + > +menuconfig LIBFDT > + tristate > + prompt "libfdt " > + help > + libfdt is the flattend device tree library. > + It's technically a part of the device tree compiler code, > + but for target uses, libfdt is sometimes required. > \ No newline at end of file > diff --git a/rules/libfdt.make b/rules/libfdt.make > new file mode 100644 > index 000000000..a7f5cc566 > --- /dev/null > +++ b/rules/libfdt.make > @@ -0,0 +1,69 @@ > +# -*-makefile-*- > +# > +# Copyright (C) 2023 Christian Melki > +# > +# For further information about the PTXdist project and license conditions > +# see the README file. > +# > + > +# > +# We provide this package > +# > +PACKAGES-$(PTXCONF_LIBFDT) += libfdt > + > +# > +# Paths and names > +# > +LIBFDT_VERSION := 1.7.0 > +LIBFDT_MD5 := f8b4469ad89f4b882091895ec60dde6b > +LIBFDT := dtc-$(LIBFDT_VERSION) > +LIBFDT_SUFFIX := tar.gz > +LIBFDT_URL := https://git.kernel.org/pub/scm/utils/dtc/dtc.git/snapshot/$(LIBFDT).$(LIBFDT_SUFFIX) > +LIBFDT_SOURCE := $(SRCDIR)/$(LIBFDT).$(LIBFDT_SUFFIX) > +LIBFDT_DIR := $(BUILDDIR)/$(LIBFDT) > +LIBFDT_LICENSE := BSD-2-Clause OR GPL-2.0 > +LIBFDT_LICENSE_FILES := \ > + file://README.license;md5=a1eb22e37f09df5b5511b8a278992d0e \ > + file://GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ > + file://BSD-2-Clause;md5=5d6306d1b08f8df623178dfd81880927 > + > +# ---------------------------------------------------------------------------- > +# Prepare > +# ---------------------------------------------------------------------------- > + > +LIBFDT_CONF_TOOL := NO > + > +LIBFDT_MAKE_ENV := \ > + $(CROSS_ENV) > + > +LIBFDT_MAKE_OPT := \ > + PREFIX=/usr \ > + NO_PYTHON=1 \ > + NO_VALGRIND=1 \ > + NO_YAML=1 > + > +LIBFDT_INSTALL_OPT := \ > + $(LIBFDT_MAKE_OPT) \ > + install-includes \ > + install-lib > + > +# ---------------------------------------------------------------------------- > +# Target-Install > +# ---------------------------------------------------------------------------- > + > +$(STATEDIR)/libfdt.targetinstall: > + @$(call targetinfo) > + > + @$(call install_init, libfdt) > + @$(call install_fixup, libfdt,PRIORITY,optional) > + @$(call install_fixup, libfdt,SECTION,base) > + @$(call install_fixup, libfdt,AUTHOR,"Christian Melki ") > + @$(call install_fixup, libfdt,DESCRIPTION,missing) > + > + @$(call install_lib, libfdt, 0, 0, 0644, libfdt-$(LIBFDT_VERSION)) > + > + @$(call install_finish, libfdt) > + > + @$(call touch) > + > +# vim: syntax=make > -- > 2.34.1 > PACKAGES-$(PTXCONF_DTC) += dtc # # Paths and names # DTC_VERSION := 1.6.0 DTC_MD5 := cd36ac756290597f3cf1c5b6cfe12e77 DTC := dtc-v$(DTC_VERSION) DTC_SUFFIX := tar.gz DTC_URL := https://git.kernel.org/pub/scm/utils/dtc/dtc.git/snapshot/$(DTC).$(DTC_SUFFIX) DTC_SOURCE := $(SRCDIR)/$(DTC).$(DTC_SUFFIX) DTC_DIR := $(BUILDDIR)/$(DTC) DTC_LICENSE := GPL-2.0-only # ---------------------------------------------------------------------------- # Prepare # ---------------------------------------------------------------------------- DTC_CONF_TOOL := NO DTC_MAKE_OPT := \ PREFIX=/usr \ NO_PYTHON=1 \ NO_VALGRIND=1 \ NO_YAML=1 \ $(CROSS_ENV_CC) DTC_INSTALL_OPT := \ $(DTC_MAKE_OPT) \ install-bin \ install-lib # ---------------------------------------------------------------------------- # Target-Install # ---------------------------------------------------------------------------- DTC_BIN-y := DTC_BIN-$(PTXCONF_DTC_DTC) += dtc DTC_BIN-$(PTXCONF_DTC_DTDIFF) += dtdiff DTC_BIN-$(PTXCONF_DTC_FDTDUMP) += fdtdump DTC_BIN-$(PTXCONF_DTC_FDTGET) += fdtget DTC_BIN-$(PTXCONF_DTC_FDTOVERLAY) += fdtoverlay DTC_BIN-$(PTXCONF_DTC_FDTPUT) += fdtput $(STATEDIR)/dtc.targetinstall: @$(call targetinfo) @$(call install_init, dtc) @$(call install_fixup, dtc,PRIORITY,optional) @$(call install_fixup, dtc,SECTION,base) @$(call install_fixup, dtc,AUTHOR,"Ladislav Michl ") @$(call install_fixup, dtc,DESCRIPTION,missing) @$(call install_lib, dtc, 0, 0, 0644, libfdt-$(DTC_VERSION)) @$(foreach tool, $(DTC_BIN-y), \ $(call install_copy, dtc, 0, 0, 0755, -, \ /usr/bin/$(tool));) @$(call install_finish, dtc) @$(call touch) # vim: syntax=make