From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 05 Jan 2024 10:01:57 +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 1rLg5V-004Ypr-1i for lore@lore.pengutronix.de; Fri, 05 Jan 2024 10:01:57 +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 1rLg5V-00054H-9U; Fri, 05 Jan 2024 10:01:57 +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 1rLg5N-00053S-Kr; Fri, 05 Jan 2024 10:01:49 +0100 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 1rLg5N-000Y0T-5f; Fri, 05 Jan 2024 10:01:49 +0100 Received: from mol by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rLg5N-002Rn3-0I; Fri, 05 Jan 2024 10:01:49 +0100 Date: Fri, 5 Jan 2024 10:01:49 +0100 From: Michael Olbrich To: Christian Melki Message-ID: Mail-Followup-To: Christian Melki , ptxdist@pengutronix.de, oss-lists@triops.cz References: 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 Subject: Re: [ptxdist] [EXT] Re: [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 Cc: oss-lists@triops.cz, 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 Fri, Jan 05, 2024 at 09:53:31AM +0100, Christian Melki wrote: > On 1/5/24 8:46 AM, Michael Olbrich wrote: > > On Thu, Jan 04, 2024 at 01:51:12PM +0100, Denis OSTERLAND-HEIM wrote: > > > Hi, > > > > > > great work. > > > There is also rules/host-dtc.make which maybe can be simplified. > > > > > > -----Original Message----- > > > From: ptxdist On Behalf Of Ladislav Michl > > > Sent: Thursday, January 4, 2024 12:16 PM > > > To: ptxdist@pengutronix.de > > > Subject: [EXT] Re: [ptxdist] [PATCH] libfdt: New package. > > > > > > [EXTERNAL EMAIL] > > > > > > Hi Christian! > > > > > > On Thu, Jan 04, 2024 at 10:26:42AM +0100, Christian Melki wrote: > > > > Hi Ladis, > > > > > > > > On 1/4/24 10:12 AM, Ladislav Michl wrote: > > > > > 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 :) > > > > > > > > > > > > > Oh. Didn't know you already had a version. > > > > > > > > I would probably have written my own tool using libfdt, integrated > > > > into something else. :) But that isn't saying there is no need for > > > > anyone. > > > > > > > > > > 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). > > > > > > > > I'll gladly reconsider. It's perfectly fine if there are usecases. > > > > Please go ahead and do a merge if you like. > > > > But keep binaries as optional. I prefer it that way. > > > > > > > > Either way, libfdt needs to happen on target because of qemu afaict. > > > > > > Yes. I expect qemu select DTC once someone (hint, hint) updates qemu :) > > > Here's updated version, please give it a try. > > > > > > -- >8 -- > > > > > > Subject: [PATCH] dtc: new package > > > > > > From: Ladislav Michl > > > > > > Please note this package is not as symmetrical as the typical > > > host-* and normal variants. Here the latest version is usually needed. > > > > Right. It may be time to remove the special version handling in host-dtc > > but that's a different discussion. > > > > > 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 > > > Signed-off-by: Ladislav Michl > > > --- > > > rules/dtc.in | 36 +++++++++++++++++++++++ > > > rules/dtc.make | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++ > > > 2 files changed, 116 insertions(+) > > > create mode 100644 rules/dtc.in > > > create mode 100644 rules/dtc.make > > > > > > diff --git a/rules/dtc.in b/rules/dtc.in new file mode 100644 index > > > 000000000..2edb6f925 > > > --- /dev/null > > > +++ b/rules/dtc.in > > > @@ -0,0 +1,36 @@ > > > +## SECTION=system_libraries > > > +menuconfig DTC > > > + tristate > > > + prompt "dtc " > > > + help > > > + Device Tree Compiler (dtc) toolchain. While dtc itself is > > > + occasionally needed for device tree manipulaton on the > > > + target, libfdt may be required. > > > + > > > +if DTC > > > + > > > +config DTC_DTC > > > + bool > > > + prompt "dtc" > > > + > > > +config DTC_DTDIFF > > > + bool > > > + prompt "dtdiff" > > > + > > > +config DTC_FDTDUMP > > > + bool > > > + prompt "fdtdump" > > > + > > > +config DTC_FDTGET > > > + bool > > > + prompt "fdtget" > > > + > > > +config DTC_FDTOVERLAY > > > + bool > > > + prompt "fdtoverlay" > > > + > > > +config DTC_FDTPUT > > > + bool > > > + prompt "fdtput" > > > + > > > +endif > > > diff --git a/rules/dtc.make b/rules/dtc.make new file mode 100644 index > > > 000000000..d0e6a7617 > > > --- /dev/null > > > +++ b/rules/dtc.make > > > @@ -0,0 +1,80 @@ > > > +# -*-makefile-*- > > > +# > > > +# Copyright (C) 2022 Ladislav Michl # 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_DTC) += dtc > > > + > > > +# > > > +# Paths and names > > > +# > > > +DTC_VERSION := 1.7.0 > > > +DTC_MD5 := 58f007905843f6ed6cecf820eeada0ef > > > +DTC := dtc-v$(DTC_VERSION) > > > +DTC_SUFFIX := tar.gz > > > +DTC_URL := > > > https://git.kernel.org/pub/scm/utils/dtc/dtc.git/snapshot/$(DTC).$(DTC_SUFFI > > > X) > > > +DTC_SOURCE := $(SRCDIR)/$(DTC).$(DTC_SUFFIX) > > > +DTC_DIR := $(BUILDDIR)/$(DTC) > > > +DTC_LICENSE := BSD-2-Clause OR GPL-2.0 > > > +DTC_LICENSE_FILES := \ > > > + file://README.license;md5=a1eb22e37f09df5b5511b8a278992d0e \ > > > + file://GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ > > > + file://BSD-2-Clause;md5=5d6306d1b08f8df623178dfd81880927 > > > + > > > +# > > > +----------------------------------------------------------------------- > > > +----- > > > +# Prepare > > > +# > > > +----------------------------------------------------------------------- > > > +----- > > > + > > > +DTC_CONF_TOOL := NO > > > +DTC_MAKE_OPT := \ > > > + PREFIX=/usr \ > > > + NO_PYTHON=1 \ > > > + NO_VALGRIND=1 \ > > > + NO_YAML=1 \ > > > + $(CROSS_ENV_CC) > > Is it fine to do like this or should it be split into MAKE_ENV > with $(CROSS_ENV) and MAKE_OPT be free from CROSS things? If the Makefile does not overwrite CC then you should just set DTC_MAKE_ENV to $(CROSS_ENV). Only set stuff like this on _MAKE_OPT if you explicitly need to overwrite definitions in the Makefile. Michael > > > + > > > +DTC_INSTALL_OPT := \ > > > + $(DTC_MAKE_OPT) \ > > > + install-bin \ > > > + install-includes \ > > > + install-lib > > > + > > > +# > > > +----------------------------------------------------------------------- > > > +----- > > > +# Target-Install > > > +# > > > +----------------------------------------------------------------------- > > > +----- > > > + > > > +DTC_BIN-y := > > > DTC_BIN- is not defined > > > > > > AFAIK it is okay to append to a not yet defined symbol > > > > > > I would suggest to either define both or none. > > > > Agreed. > > > > > Regards Denis > > > +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));) > > > > /usr/bin/$(tool))$(ptx/nl)) > > > > Michael > > > > > + > > > + @$(call install_finish, dtc) > > > + > > > + @$(call touch) > > > + > > > +# vim: syntax=make > > > -- > > > 2.39.2 > > > > > > > > > > -- 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 |