u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: qianfanguijin@163.com
Cc: u-boot@lists.denx.de, Jagan Teki <jagan@amarulasolutions.com>
Subject: Re: [PATCH v1] sunxi: Make SYS_VENDOR, SYS_BOARD, SYS_CONFIG_NAME configurable
Date: Tue, 26 Apr 2022 13:49:41 +0100	[thread overview]
Message-ID: <20220426134941.742af5ed@donnerap.cambridge.arm.com> (raw)
In-Reply-To: <20220421033211.22469-1-qianfanguijin@163.com>

On Thu, 21 Apr 2022 11:32:11 +0800
qianfanguijin@163.com wrote:

Hi,

> From: qianfan Zhao <qianfanguijin@163.com>
> 
> The board is not configurable if use sunxi soc. Add Kconfig items and
> make custom board available.

What problem does that solve?
And apart from that, I am afraid this is broken in several ways:
- The actual definition of those symbols is in arch/Kconfig. Having those
"config SYS_*" lines here is just to provide the various default values.
And changes to the definition should go there (and will be NAKed there).
- Those options are NOT meant to be user changeable, that's why their
original definition doesn't provide a prompt. The value of those options
have implications to the build system, so by just putting *something* in
here you will break the build. So any changes to those values would
require code and build system changes as well.
- The mainline Allwinner port is a bit special (and not in the worst
way!), in that it really doesn't use the generic U-Boot notion of "board
vendor code", for instance. So every board uses board/sunxi, despite the
actual board manufacturer. And this makes a lot of sense, since the vast
majority of the code is really just SoC dependent, and the differences
between boards should be covered by the DT. There are some board specific
hacks, which we cover by config options, like CONFIG_PINE64_DT_SELECTION.

So I am afraid this is not going anywhere.
If this is solving some problem for you, please describe the problem here,
and I am sure we will find a much better solution.
Adding support for a new board (with the SoC already supported) would just
require a defconfig and the .dts file.

Cheers,
Andre

> Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
> ---
>  arch/arm/mach-sunxi/Kconfig | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
> index 2c18cf02d1..03460870db 100644
> --- a/arch/arm/mach-sunxi/Kconfig
> +++ b/arch/arm/mach-sunxi/Kconfig
> @@ -598,6 +598,7 @@ config SYS_CLK_FREQ
>  	default 1008000000 if MACH_SUN50I_H616
>  
>  config SYS_CONFIG_NAME
> +	string "Board configuration name"
>  	default "sun4i" if MACH_SUN4I
>  	default "sun5i" if MACH_SUN5I
>  	default "sun6i" if MACH_SUN6I
> @@ -607,9 +608,25 @@ config SYS_CONFIG_NAME
>  	default "sun50i" if MACH_SUN50I
>  	default "sun50i" if MACH_SUN50I_H6
>  	default "sun50i" if MACH_SUN50I_H616
> +	help
> +	  This option contains information about board configuration name.
> +	  Based on this option include/configs/<CONFIG_SYS_CONFIG_NAME>.h header
> +	  will be used for board configuration.
>  
>  config SYS_BOARD
> +	string "Board name"
>  	default "sunxi"
> +	help
> +	  This option contains information about board name.
> +	  Based on this option board/<CONFIG_SYS_VENDOR>/<CONFIG_SYS_BOARD> will
> +	  be used.
> +
> +config SYS_VENDOR
> +	string "Vendor name"
> +	help
> +	  This option contains information about board name.
> +	  Based on this option board/<CONFIG_SYS_VENDOR>/<CONFIG_SYS_BOARD> will
> +	  be used.
>  
>  config SYS_SOC
>  	default "sunxi"


  reply	other threads:[~2022-04-26 12:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21  3:32 [PATCH v1] sunxi: Make SYS_VENDOR, SYS_BOARD, SYS_CONFIG_NAME configurable qianfanguijin
2022-04-26 12:49 ` Andre Przywara [this message]
2022-04-27  0:42   ` qianfan
2022-04-28  0:16     ` Andre Przywara
2022-04-28  1:41       ` qianfan

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=20220426134941.742af5ed@donnerap.cambridge.arm.com \
    --to=andre.przywara@arm.com \
    --cc=jagan@amarulasolutions.com \
    --cc=qianfanguijin@163.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;
as well as URLs for NNTP newsgroup(s).