From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/7] spl: nand: rename the SYS_NAND_U_BOOT_OFFS Kconfig option
Date: Sat, 4 Jun 2016 13:06:10 +0200 [thread overview]
Message-ID: <20160604130610.1fce6857@bbrezillon> (raw)
In-Reply-To: <1465024449.22191.73.camel@buserror.net>
On Sat, 04 Jun 2016 02:14:09 -0500
Scott Wood <oss@buserror.net> wrote:
> On Sat, 2016-06-04 at 08:06 +0200, Boris Brezillon wrote:
> > On Fri, 03 Jun 2016 20:08:49 -0500
> > Scott Wood <oss@buserror.net> wrote:
> >
> > > This doesn't work. CONFIG_SPL_NAND_U_BOOT_OFFS will always be defined
> > > when SPL is defined, and the user will be forced to enter a value before
> > > kconfig will continue (or kconfig will error out in an automated build).
> >
> > Yes, CONFIG_SPL_NAND_U_BOOT_OFFS will always be defined, but won't be
> > used if CONFIG_SYS_NAND_U_BOOT_OFFS is defined in the config header
> > file.
> > And for the "user will forced to enter a value before Kconfig
> > continue" comment, we could just have
> >
> > config SPL_NAND_U_BOOT_OFFS
> > hex "Location in NAND to read U-Boot from"
> > default 0x8000 if NAND_SUNXI
> > default 0x0
> > ...
>
> If you do that, then that zero will override CONFIG_SYS_NAND_U_BOOT_OFFS from
> the header.
Nope, because the condition is
#ifndef CONFIG_SYS_NAND_U_BOOT_OFFS
#define CONFIG_SYS_NAND_U_BOOT_OFFS CONFIG_SPL_NAND_U_BOOT_OFFS
#endif
and not
#ifdef CONFIG_SPL_NAND_U_BOOT_OFFS
#define CONFIG_SYS_NAND_U_BOOT_OFFS CONFIG_SPL_NAND_U_BOOT_OFFS
#endif
So CONFIG_SYS_NAND_U_BOOT_OFFS is always preferred over
CONFIG_SPL_NAND_U_BOOT_OFFS if it's defined.
>
> > > If you want to do this there needs to be a separate bool config that
> > > controls whether the hex config exists.
> >
> > I can add an extra Kconfig option, but is it really necessary:
> > if people are relying on it they will choose a valid value, and leave
> > it to 0 otherwise.
> > It's just a detail, so I'm fine adding this extra option if you think
> > it's really useful.
>
> Zero *is* a valid value. Several boards already have that value for this
> symbol. Even if that weren't the case, we want a mechanism for migrating
> from header value to kconfig value that works for more than just this one
> specific symbol.
Sure, 0 is a perfectly valid value. The "default 0" is just here to
prevent make from blocking because of a missing definition in the
_defconfig.
>
> >
> > > And there'd be no need to rename hex symbol.
> >
> > Well, functionally there's no problem keeping the existing SYS_ prefix
> > if we add this extra option to activate the U_OFFS config in Kconfig,
> > but I'm not sure this is a good idea to reuse config header names in
> > Kconfig.
> >
> > And what happens if the user enabled this option (some like to enable
> > everything :-)) and CONFIG_SYS_NAND_U_BOOT_OFFS is also defined in the
> > board config header?
>
> Then the build fails with a redefined symbol, and the user learns their
> lesson. :-)
Fair enough.
>
> The "SYS" in CONFIG_SYS means it's not a user-tunable knob. From README:
>
> > There are two classes of configuration variables:
> >
> > * Configuration _OPTIONS_:
> > These are selectable by the user and have names beginning with
> > "CONFIG_".
> >
> > * 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_".
Okay. I'll switch back to SYS_NAND_U_BOOT_OFFS, add an intermediate
option to unlock this one in the config menu and rename
CONFIG_SPL_NAND_U_BOOT_OFFS_REDUND into
CONFIG_SYS_NAND_U_BOOT_OFFS_REDUND.
--
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
next prev parent reply other threads:[~2016-06-04 11:06 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-01 11:23 [U-Boot] [PATCH v2 0/7] spl: nand: sunxi: implement auto-detection Boris Brezillon
2016-06-01 11:23 ` [U-Boot] [PATCH v2 1/7] spl: nand: sunxi: remove support for so-called 'syndrome' mode Boris Brezillon
2016-06-01 11:23 ` [U-Boot] [PATCH v2 2/7] spl: nand: rename the SYS_NAND_U_BOOT_OFFS Kconfig option Boris Brezillon
2016-06-04 1:08 ` Scott Wood
2016-06-04 6:06 ` Boris Brezillon
2016-06-04 7:14 ` Scott Wood
2016-06-04 11:06 ` Boris Brezillon [this message]
2016-06-06 17:16 ` Scott Wood
2016-06-06 18:40 ` Boris Brezillon
2016-06-01 11:23 ` [U-Boot] [PATCH v2 3/7] spl: nand: support redundant u-boot image Boris Brezillon
2016-06-04 1:15 ` Scott Wood
2016-06-04 6:15 ` Boris Brezillon
2016-06-04 7:17 ` Scott Wood
2016-06-01 11:23 ` [U-Boot] [PATCH v2 4/7] spl: nand: sunxi: stop guessing the redundant u-boot offset Boris Brezillon
2016-06-01 11:23 ` [U-Boot] [PATCH v2 5/7] spl: nand: sunxi: rework status polling loop Boris Brezillon
2016-06-01 11:23 ` [U-Boot] [PATCH v2 6/7] spl: nand: sunxi: split 'load page' and 'read page' logic Boris Brezillon
2016-06-01 11:23 ` [U-Boot] [PATCH v2 7/7] spl: nand: sunxi: add support for NAND config auto-detection Boris Brezillon
2016-06-01 12:35 ` [U-Boot] [linux-sunxi] " Siarhei Siamashka
2016-06-01 13:22 ` Boris Brezillon
2016-06-01 13:22 ` Maxime Ripard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160604130610.1fce6857@bbrezillon \
--to=boris.brezillon@free-electrons.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox