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 84AF2C05027 for ; Tue, 14 Feb 2023 17:39:47 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 79E38859E0; Tue, 14 Feb 2023 18:38:45 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com 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; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="LWyAnEoz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 089FF859E0; Tue, 14 Feb 2023 18:38:44 +0100 (CET) Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8D1DB85977 for ; Tue, 14 Feb 2023 18:38:40 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qv1-xf35.google.com with SMTP id mg2so3770341qvb.9 for ; Tue, 14 Feb 2023 09:38:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=d0cTNyuJ8SrLv9alZDLBE3/z8WXadyLs+HBCCTFmfh4=; b=LWyAnEozRXgBWnMG9vhWpVtpnUBVAq4+03ErmdugTJqf5BlThSC4YN7svbzaDHUdp9 1Dqanc3h4JjkpY8Y/15w8B8eop1Ci7P/A/UzW2ICM9fvcE9KcYomAA4IIBW5jm4uM0YP 7TTvFOoxkyt3BfoMwVmDsGte+8skV8Y/dbEOk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=d0cTNyuJ8SrLv9alZDLBE3/z8WXadyLs+HBCCTFmfh4=; b=YoomHeunLgxIW4G3b/umP3MXHOpdXvxsIKuMzl29crd4MzufFwY0SLU43Zwlq2K863 RoP6caaeNAXGGiOt0K2CKkp2JTVrPQxqS863eg8JfPs6LDyc6gfVlo3cT7vCUq+kKDfz ZVowRnkDOdO1hTLaoJTJFAtgthSzUCWiHOpVVVHKQIaxNBxzFLV1tylzzC7KMNwlGpcL Fi661IGkbtAim2jABJ64kZg7kw0Dw2oo7IO+0FbaxGg6ZKhwfBxLmEBymC+LvUnm8NZc bk7JKy7EkzePER+ACMBkVrpq5ed/0UQ8AWBkVASN9WJJORPk+2ZG1gdGW1+xRagSPVtB 5WZw== X-Gm-Message-State: AO0yUKVXXph8etzMzQvV/mTX2/8A0cDbdqrKp/QAMOwpcKOwqX1fl434 IenpB9assSkO6So+hyTEmZTAHxG75ZdfiErM5rs= X-Google-Smtp-Source: AK7set+D9yjICGRSh3tfSLNHDOTRaT2lkcGpYsGobMLYrjunP9nVZBVPF6fo6PChd9ancRwDpD7Muw== X-Received: by 2002:a05:6214:d82:b0:56e:a756:911 with SMTP id e2-20020a0562140d8200b0056ea7560911mr6408448qve.41.1676396319198; Tue, 14 Feb 2023 09:38:39 -0800 (PST) Received: from bill-the-cat (2603-6081-7b00-6400-c7c0-e2dd-6c89-7c7c.res6.spectrum.com. [2603:6081:7b00:6400:c7c0:e2dd:6c89:7c7c]) by smtp.gmail.com with ESMTPSA id l67-20020a37bb46000000b0071d0f1d01easm12147673qkf.57.2023.02.14.09.38.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 09:38:38 -0800 (PST) Date: Tue, 14 Feb 2023 12:38:36 -0500 From: Tom Rini To: Simon Glass Cc: U-Boot Mailing List , Masahiro Yamada Subject: Re: [PATCH v3 61/95] kconfig: Support writing separate SPL files Message-ID: References: <20230212231638.1134219-1-sjg@chromium.org> <20230212231638.1134219-62-sjg@chromium.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="0ccMHFqM50792ce/" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean --0ccMHFqM50792ce/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 14, 2023 at 09:58:59AM -0700, Simon Glass wrote: > Hi Tom, >=20 > On Tue, 14 Feb 2023 at 09:31, Tom Rini wrote: > > > > On Sun, Feb 12, 2023 at 04:16:04PM -0700, Simon Glass wrote: > > > > > At present kconfig writes out several files, including: > > > > > > auto.conf - CONFIG settings used by make > > > autoconf.h - header file used by C code > > > > > > This works well but is a bit ugly in places, for example requiring th= e use > > > of a SPL_TPL_ macro in Makefiles to distinguish between options inten= ded > > > for SPL and U-Boot proper. > > > > > > Update the kconfig tool to also output separate files for each phase:= e.g. > > > auto_spl.conf and autoconf_spl.h > > > > > > These are similar to the existing files, but drop the SPL_ prefix so = that > > > SPL_TPL_ is not needed. It also allows the CONFIG_IS_ENABLED() macro = to be > > > simplified, in a later patch, eventually replacing it with IS_ENABLED= (). > > > > > > When CONFIG_FOO is used within SPL, it means that FOO is enabled in t= hat > > > SPL phase. For example if CONFIG_SPL_FOO is enabled in the Kconfig, t= hat > > > means that CONFIG_FOO will be enabled in the SPL phase. So the SPL bu= ilds > > > can just use CONFIG_FOO to check it. There is no need to use > > > CONFIG_SPL_FOO or CONFIG_IS_ENABLED() anymore. > > > > > > This of course means that if there is a need to access a PPL symbol f= rom > > > an SPL build, there is no way to do it. To copy with that, we need a > > > CONFIG_PPL_FOO to be visibilty to all SPL builds. > > > > > > So this change also adds new PPL_ output for U-Boot proper (Primary > > > Program Loader). So every CONFIG_FOO that is enabled in PPL also has a > > > CONFIG_PPL_FOO > > > > > > This allows SPL to access the TEXT_BASE for U-Boot proper, for exampl= e, so > > > it knows where to load it. There are about 30 places where this is ne= eded, > > > in addition to TEXT_BASE. The environment has the same problem, adding > > > another dozen or so caes in include/config_distro_bootcmd.h but it has > > > been decided to ignore that for now. > > > > > > The feature is controlled by an environment variable, since it seems = to be > > > bad form to add flags to the conf tool. > > > > > > Rebuild the autoconf files if the split config is not present. This a= llows > > > building this commit as part of a chain, without generating build err= ors. > > > > > > These changes may benefit from some reworking to send upstream, e.g. = to > > > use a struct for the 'arg' parameter. > > > > > > Signed-off-by: Simon Glass > > > > This patch, I think, is where my largest problem is. We go from being > > able to say "if CONFIG_SPL_FOO is undefined, it is false" to "we must > > define CONFIG_SPL_FOO to false". There's around 150 cases of this, with > > the series. Why can we not extend the PPL logic (which I'm not super > > happy with, but, I understand and I think an audit of everything > > not-TEXT_BASE should be fairly straight forward), to say that if > > CONFIG_FOO exists and CONFIG_SPL_FOO does not exist, say CONFIG_SPL_FOO > > is now false. >=20 > Well it is all about choices. >=20 > We don't have to add a CONFIG_SPL_xxx to tell Kconfig that the PPL > symbol controls all phases. We can use the conf_nospl file instead. > But then the entire description is not in Kconfig. Of course, we might > expect that some of those things in conf_nospl might end up needing to > be controlled in SPL, so perhaps that file would shrink? Not sure > about that, though. >=20 > It isn't just SPL , BTW. We might have any xPL symbol defined. >=20 > I suppose you are thinking of something like: >=20 > #define CONFIG_IS_ENABLED(x) IS_ENABLED(CONFIG_ ## xpl_prefix ## x) || > ( IS_ENABLED(CONFIG_ ## x) && !IS_ENABLED(CONFIG_ SPL_ ## x) && > !IS_ENABLED(CONFIG_TPL_ ##x) ..) >=20 > But how do we deal with Makefiles? We still end up with the SPL_TPL_ stuf= f. I see it as a very useful feature that today if we don't set CONFIG_xPL_FOO, it evaluates to false, anywhere we need it to. In all of the prep work for split config, I think we've seen one case where we got things wrong (in that it lead to failure). Split config build is doing a whole bunch of things to then remove this feature. And the series intentionally ignores the Makefile design issue / feature of wrapping large chunks with a check for being/not-being in an xPL_BUILD phase. > Yes, adding PPL moves a step forward and reduces the audit to only > uses of PPL, instead of the whole Kconfig. >=20 > This series does get us closer to separate configs (it is really easy > to see what is enabled in each build just by looking at the > auto_xpl.conf files) and I think those 150 exceptions are not a big > price to pay. >=20 > Ultimately I am coming to the view that we should extend the Kconfig > language to support multiple build phases, using a 'phase' property. > Zephyr is going to need it too, fairly soon[1]. >=20 > Regards, > Simon >=20 > [1] https://github.com/zephyrproject-rtos/zephyr/issues/54534 Yes, if the Kconfig language moves in a new direction, it would be good to follow and use that. --=20 Tom --0ccMHFqM50792ce/ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmPrxxkACgkQFHw5/5Y0 tywwngv/c5pfABeoGim9iVlLa9e8/biF6jehY8f5K/7HM3Ivgc1GdRb8ooaajKlr EzCC2uqWN5SLBTu4Ntl1cil8l45lVHxILNRJn489+FWLRGyXctpSrxW1/CkoN4o1 YMAPLlgUS4ozgIhuQdkm6/x2g2ADXlTALlWf4vJ4FDtKKvfQegeKYCde6XcWRyUx rL6I1mhdh7YvxUxQhrDMrwdf4+CajHq1cvA1IU2Wy+swjMsCz1HN/9tZ/EPVOuEg KzrQevM1lfL8KEwmuOPwnNfdd73mjFM9IP1GG/H1Lq7M98p1vasg1Y1FlkSwl3m6 Tu0hbVyUjAImR0kwzYHTuye4so3RTzDICje/OUCFXht7OwhRb7koglEDlSED05Tn Ef52I78t/cbrDX2taZ5moyKiBBFAJzHu/HW76Ro1nUyK3twfOoXKeHOFJSKlJZxp 5uoJXhTaDBHg60rAdK6OjoqkN55ETyG+csB+v3OqP5XfRznVx5qSTm58zyrmBSLA 8g5VtgqM =Tz00 -----END PGP SIGNATURE----- --0ccMHFqM50792ce/--