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 F0C5BC04A68 for ; Thu, 28 Jul 2022 14:12:20 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 62E3883F36; Thu, 28 Jul 2022 16:12:18 +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="o6jEJsOR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8E03583F88; Thu, 28 Jul 2022 16:12:17 +0200 (CEST) Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) (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 DC56883564 for ; Thu, 28 Jul 2022 16:12:14 +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-qv1-xf34.google.com with SMTP id j11so1469329qvt.10 for ; Thu, 28 Jul 2022 07:12:14 -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=ycsn8z2WJtq9ATimzLNvLo2xQZhytlmTLNV7pnqhqO8=; b=o6jEJsORqUDi8wel1RXe2onrUsVOF8+BmMrRP2YAGa3mvHoK2MkZfKyyOvcI9Jkh9e 6i7vCGr/bxiIW9Uvqm3BmjSepRzlWiE5JQdG2iv931r4COCg/Yk74gEsoK0u3RYuxjWc khKDEjkHhTyFowCf3Hu/TJKu6a9MCSo0U85x0= 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=ycsn8z2WJtq9ATimzLNvLo2xQZhytlmTLNV7pnqhqO8=; b=EKSf8LeAU10dgc2STHl5DAkAvr5MfBkJIai9tS7o9BhhpYZoFc7AxOl/CsujV8uLeb ldE7lxxAhKyreGSNb+JbP5bUC7pevbmHR3VTESz7IhMZi/KNC45vZe+vY/pVM5AkubF4 3axre/7PnRpuJxRagmC+pXhuZ5jcFBuGtpkUHxnXcALMNro7XLwdJmJRG/ORmv/11/T5 BbT2D3ShgJBTi3/Fho8KVo/c09tnFpuicIG3avsuxaXXYp+OZ9wH3/L0FXcaGjnTwtYL XHPBRnKUQUQGx1n4eajTmP8fcXaRYxn3XSILONrh7IAZ7Dge5tkFlXkUBOFmHsjeVVoI jMjg== X-Gm-Message-State: AJIora8Lyt2IGAVySTnnN5MPiLK8riS6CjUZwSbNCKXKaosYj4BapGGK BNb5La6M0AD98J5YvOC5ChHfdw== X-Google-Smtp-Source: AGRyM1tTmsJ+baZ6D+Py1BBqbnZfbwep5GClw87tfC3te9/bqy76aDZ0WG+vYyh2vtWzHmTBkJ66qQ== X-Received: by 2002:ad4:5dc7:0:b0:473:8603:6da5 with SMTP id m7-20020ad45dc7000000b0047386036da5mr24487227qvh.121.1659017533506; Thu, 28 Jul 2022 07:12:13 -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 e22-20020ac85996000000b0031ee9afafccsm537956qte.14.2022.07.28.07.12.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jul 2022 07:12:12 -0700 (PDT) Date: Thu, 28 Jul 2022 10:12:10 -0400 From: Tom Rini To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: u-boot@lists.denx.de, Simon Glass , Heinrich Schuchardt Subject: Re: [RFCv1] doc: develop: Describe using CONFIG vs CFG for values Message-ID: <20220728141210.GI1146598@bill-the-cat> References: <20220728132046.2000282-1-trini@konsulko.com> <20220728133443.u7uingk3v2qprprz@pali> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="8oHs42QovMEclDUe" Content-Disposition: inline In-Reply-To: <20220728133443.u7uingk3v2qprprz@pali> 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 --8oHs42QovMEclDUe Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 28, 2022 at 03:34:43PM +0200, Pali Roh=E1r wrote: > On Thursday 28 July 2022 09:20:46 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. > >=20 > > 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? >=20 > In README is also written: Ah yes, I forgot to see if the README had anything here. I'll remove and incorporate in RFCv2. > * Configuration _OPTIONS_: > These are selectable by the user and have names beginning with > "CONFIG_". >=20 > * Configuration _SETTINGS_: > These depend on the hardware etc. and should not be meddled with if > you don't know what you're doing; they have names beginning with > "CONFIG_SYS_". >=20 > So based on this statement, proposed CFG_* options should be of second > category - not selectable by user - right? Right. > And this reminds me, that CONFIG_SYS_* option in Kconfig should also not > be possible to select / change by user or in user's defconfig. This can > be achieved in Kconfig by _not_ specifying short description (after > "bool" or "hex" keyword). So maybe this should be also fixed? Or at > least do not introduce new Kconfig options with SYS_* which can be > changed? There is a lot of possible follow-up cleanup work to do, yes. I gave one example of an unmigration that should be done, but there's certainly more. I'll try and make it clearer in RFCv2 about when it is appropriate to add CONFIG settings but that aren't configurable. [snip] > This change looks good. But I'm not sure how to correctly do it. It > would be nice to see example, e.g. how to handle it for revert of > c7fad78ec0ee ("Convert CONFIG_SYS_BR0_PRELIM et al to Kconfig"). > Those are board specific options which are exported and required by both > u-boot drivers and u-boot arch/cpu code. I'll probably just start with a revert + sed, and leave further clean-up to whomever has more time and interest on the legacy platforms, for that specific example. For all of the SYS_INIT_SP_ADDR as another example, I'll probably go with renaming to CFG_SYS_INIT_SP_ADDR and CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR being select'd and CONFIG_CUSTOM_SYS_INIT_SP_ADDR becoming CFG_SYS_INIT_SP_ADDR directly, and in board.h until someone has the time and desire to further rectify something that really shouldn't be board, but rather SoC (and adjusted based on further options) specific. --=20 Tom --8oHs42QovMEclDUe Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmLimTAACgkQFHw5/5Y0 tyyVJgv/WizAf48ltI3so4qjxbMenhsoBnh6GkWvd6Koui56wUEBJkUBqmZNV0Mt 82XNSm2Yy6M27gRL2rSAD6ZOJ9+A9bkB52rfvV55NsxbS6AX8tHhJWxwp0uMk+s3 /TUUt6sdhVMY4N+4UsA4KtbJAGz0ZWci2BEBAe9GMuttuUcJ+9+WAT2rlgTm2z54 72tdfADiQWM3GPUBKGCB3kYCR0fbdneqNixky1IvnFOJ017l4ufFMr8V0i6um92W FpZikA5t2XA0SAK6r8I7MRSBO9rNcP1uL3BNQY53k8n601Int3lkmKxPL7P3affI Dce90CoVSTzqmKeQb7g1q5XZuDwmVVcaUnIps+hqBWpNPuMoN92uMpB2Z1JGMJFy lal/5p7tht/gdQHG1BuXnFfosvO6iTGjMMYhn0cv0dgCkG/E8+0b4xtYG+rJjurT KEK7x6pjuilDv5RA3/yBsbdw0gvPze2evZbKeZQr42xjpo8wefX9a1yaMx5zmaTV FTQp8j/E =Ki3z -----END PGP SIGNATURE----- --8oHs42QovMEclDUe--