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 09C56C00140 for ; Sun, 31 Jul 2022 11:46:14 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4202B844A8; Sun, 31 Jul 2022 13:46:12 +0200 (CEST) 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="llq5Gzp7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8EBAE844B4; Sun, 31 Jul 2022 13:46:10 +0200 (CEST) Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) (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 06B3784488 for ; Sun, 31 Jul 2022 13:46:07 +0200 (CEST) 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-qt1-x834.google.com with SMTP id h22so6206499qta.3 for ; Sun, 31 Jul 2022 04:46:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=KNpRg4dx0j4pY3KBAyF1goCSUe+0TPG/we9Wd2P75U4=; b=llq5Gzp7JWg9W52e4DGICwDrcCdq362fPf5VMNjlBH2EXXrGGvvWuMhhNyNA4Ac1+j VLTqZXauZKoIptTf9ZzUTwuOthZ1ZAkixcwDrH8YZeI0X1o0eRo8RrpIa2A5Slne/jAw iH/ulXbGxIUkm2hp6dyDNWnMY+yw1fhAwcLMg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=KNpRg4dx0j4pY3KBAyF1goCSUe+0TPG/we9Wd2P75U4=; b=F7eeokwlGCW/q8VweOmnO1dlj4dHmt46brw3GAAxzegUbZZYhSHJjCcIxO4Q5+ytfb UsRl6zFymNuBO8Z0U3QbXuG1Qqn8XSuvmHy7qdo7l5q5mHnDn471HnbKOLRr0H9wYO+E bDGZpR9BXgr8o0z7T5x0LXr3MalwfYtwyka9qkuBAw23SpNBKlM5yNigUlc0zIUNPVmj N4iz+PlGew9GaewYOFXmZKWjwdg5Do34e8joVozk72l/s0Ba6cneQ/+g9pBOqIuxftXM 21cN1RN0ooDX9Syer2S38kmcijaMHGmlN7Ex4gdYaBnQV48qU0biFYWkKWocJSZXapYh j94g== X-Gm-Message-State: AJIora+nRsCheSPBzlsigm1GYUuUIUfxakojZReyNkM79mElpPVtMpsr HUh7uvrqrSFwS8h6nQnqVIRytw== X-Google-Smtp-Source: AGRyM1s9eY+h4OxthO3giPHO0K5c7rBpUFn9SkP6TIafHji8TapC/hCIni747CwjMHKs5A0Kk6sGAg== X-Received: by 2002:a05:622a:d:b0:31f:3fc:c5c7 with SMTP id x13-20020a05622a000d00b0031f03fcc5c7mr10091327qtw.411.1659267966709; Sun, 31 Jul 2022 04:46:06 -0700 (PDT) Received: from bill-the-cat (cpe-65-184-195-139.ec.res.rr.com. [65.184.195.139]) by smtp.gmail.com with ESMTPSA id g21-20020ae9e115000000b006b62c252d07sm6366604qkm.76.2022.07.31.04.46.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Jul 2022 04:46:04 -0700 (PDT) Date: Sun, 31 Jul 2022 07:46:02 -0400 From: Tom Rini To: Simon Glass Cc: U-Boot Mailing List , Pali =?iso-8859-1?Q?Roh=E1r?= , Heinrich Schuchardt Subject: Re: [RFCv1] doc: develop: Describe using CONFIG vs CFG for values Message-ID: <20220731114602.GV1146598@bill-the-cat> References: <20220728132046.2000282-1-trini@konsulko.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="xbx2T7YCWp4cR4sY" 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 --xbx2T7YCWp4cR4sY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jul 30, 2022 at 07:27:31PM -0600, Simon Glass wrote: > Hi Tom, >=20 > On Thu, 28 Jul 2022 at 07:20, Tom Rini wrote: > > > > Document how and when to use CONFIG or CFG namespace for options. There > > are times where Kconfig is not a great fit for our needs, so we want to > > use the CFG namespace instead. > > > > Signed-off-by: Tom Rini > > --- > > RFCv1: > > - This is essentially my idea on how to better handle the problem of > > CONFIG values that just don't fit in Kconfig because it makes much > > more sense to define them statically for a given SoC or calculate them > > from other values, and so on. One example here would be to revert > > c7fad78ec0ee ("Convert CONFIG_SYS_BR0_PRELIM et al to Kconfig") and > > re-name these to CFG_SYS_.. instead. Another big example here would be > > a global search-and-replace of 's/CONFIG_HPS_/CFG_HPS_/g' as that's > > all tool-generated. Not all CONFIG_SYS_ options would get this as > > boolean choices are well handled in Kconfig, and that may not be clear > > enough in what I wrote here? > > --- > > doc/develop/build_configuration.rst | 36 +++++++++++++++++++++++++++++ > > doc/develop/index.rst | 1 + > > 2 files changed, 37 insertions(+) > > create mode 100644 doc/develop/build_configuration.rst >=20 > I worry that CFG is confusing as it is too similar to CONFIG. Could we > have an entirely different prefix, e.g. SYS_? Also, why is a prefix > needed? We need a prefix here for consistency. I don't want to use just SYS_ here as that's not always used for some of the values to be converted. > I have certainly seen things that are named CONFIG_... but are really > just SoC values. If they are addresses they should be in the > devicetree, but perhaps for early code in SPL that is not practical. I tried to elaborate on this more in the later revs of the document. But yes, we have some legacy code that's just not going to get a massive rewrite to use device tree more, but also has an active enough user base that we aren't just going to drop it. So long as it's not going to make life harder in the rest of the code base, this feels like a good enough compromise. > Re the revert, why? Are you worried that we are bloating Kconfig too > much with all these internal SoC settings? As Pali explained in other threads, there was a problem with the values in that commit, prior to conversion. But turning the series of ORs and shifts into a single magic value made it much harder to see and address. Yes, if it was written to pull from the device tree, it would have been easier to read and fix there. But no one is going to rewrite all of the core PowerPC code. > What is the policy on using such things for a board? I would very much > like to avoid board-specific #defines like this. The policy is better laid out in later revs of the document I think. > Is your hope to drop all remaining ad-hoc CONFIGs in this way? A large chunk, yes. I'm auditing CONFIG_SYS_* still, but there's probably going a few hundred symbols that just get resolved this way. --=20 Tom --xbx2T7YCWp4cR4sY Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmLma3AACgkQFHw5/5Y0 tywK2gv/bm26N+4/Kw4h/rai9an856fJTZAEmb52PYS/w/2DmFtJlNmqisVhbjFh d387XTzBBGIXZKq4L1uHGGFhbJU8CiPiGGng0kqQ0GXiBeUM2Xzi/jdZqPi15cQZ i+5dpmUZEbLGu9mZvu74txn+9HHeG/cJ3ZWwTOjssS2PYxtnnRowzyCx05/n85OO X+llwCZ2OGGJdJnjt3kFc7H3MRXbPnnJEAzvdVFO7baWV9tppwv6sQ+lD1aDjKnY bnfZAcCLpb2cIdLaVdQ2mOxR7cw4dguwW7UZ1NXLYo3nKybM8r+WtzfPPooFOBTd KrMOWMz3gkStZNrfNTZeR/829MdTX+YqwUxCa8kktwd2MFFp6nRFX+zNkI8AcBF+ fUtlgAbI/jAOn6jIsv/JTmQ5bhXkH+Wzv0gtCQjLlzSUbe7+cuAsi3n5eJp0hDnV 93dDwia+QCKpq9pGmd1H2wQmmNldtq5QLxuPKmEh0KsAiXD62tK7kncHiQcj3bbd ZGi/DAeX =K2+T -----END PGP SIGNATURE----- --xbx2T7YCWp4cR4sY--