From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0B72CC433F5 for ; Thu, 6 Jan 2022 16:10:15 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 500328361E; Thu, 6 Jan 2022 17:10:13 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nic.cz Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=nic.cz header.i=@nic.cz header.b="MZbvUuDF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 795DE83693; Thu, 6 Jan 2022 17:10:11 +0100 (CET) Received: from mail.nic.cz (mail.nic.cz [IPv6:2001:1488:800:400::400]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 934CF830CA for ; Thu, 6 Jan 2022 17:10:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nic.cz Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=marek.behun@nic.cz Received: from thinkpad (unknown [172.20.6.87]) by mail.nic.cz (Postfix) with ESMTPSA id 20932140B9F; Thu, 6 Jan 2022 17:10:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1641485408; bh=kxuDCXOBpBc5axNoyp4GqQ1+pF1b9giy7zJpZ8PlgWQ=; h=Date:From:To; b=MZbvUuDFUKG38Xg9nh/XHFA0mR79uaw3dLmTVZaLOJs2p4WmARdFpLEPvwf119l1+ Y8Ez6IVvfP0QlG0nckl0WDiN46ZujS6DQLq4GRdwYV6zDEB6Xan+o36BozKJ/XuFqa Tz+BjyE/Sa7m4VPWLC/ZhmDTIGwGc5piBm0I2bNE= Date: Thu, 6 Jan 2022 17:10:07 +0100 From: Marek =?UTF-8?B?QmVow7pu?= To: Simon Glass Cc: U-Boot Mailing List Subject: Re: difference between fdtdec and fdt_support ? Message-ID: <20220106171007.7f39094c@thinkpad> In-Reply-To: References: <20220106132100.56f55e02@thinkpad> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On Thu, 6 Jan 2022 08:48:48 -0700 Simon Glass wrote: > Hi Marek, >=20 > On Thu, 6 Jan 2022 at 05:21, Marek Beh=C3=BAn wrote: > > > > Hi Simon, > > > > I am a little confused. > > > > We have > > common/fdt_support.c > > and > > lib/fdtdec.c > > > > The second one implements for example fdtdec_get_is_enabled(), which I > > would rather expect in fdt_support by name fdt_node_is_available(), or > > something like that. =20 >=20 > Should be moved to ofnode ?? But this function is needed for example when fixing device tree for Linux. > > > > Also fdtdec does a strange thing with compatible strings: it declares > > an enum for compatible strings and then a map which maps this enum > > values to compatible strings... Why not just use the compatible strings= ? =20 >=20 > Did you see the comment? >=20 > * NOTE: This list is basically a TODO list for things that need to be > * converted to driver model. So don't add new things here unless there i= s a > * good reason why driver-model conversion is infeasible. Examples include > * things which are used before driver model is available. >=20 > This is effectively a list of things that should be converted to > driver model. The list should then go away. Hmm. But can't that be simply made into a list in a comment? Because currently this is compiled in for every board that uses any such function from fdtdec, even if they don't use any string from those compatible strings. > > > > What is the purpose of having two files implementing fdt stuff? =20 >=20 > fdtdec - for reading from the DT. Should go away and be replaced with > the ofnode API, and fdtaddr.c > fdt_support - for updating the DT, e.g. for fixups before booting an OS Thanks! Okay that makes sense. This means that we should also have fdt_node_is_available() in fdt_support.c which does the same thing. (For now this can be made a static inline function that calls fdtdec_get_is_enabled().) Marek