From mboxrd@z Thu Jan 1 00:00:00 1970 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 E4AE6C433F5 for ; Tue, 26 Apr 2022 12:49:56 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DBBFE83C01; Tue, 26 Apr 2022 14:49:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id DD16A83DAC; Tue, 26 Apr 2022 14:49:52 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 0638783BAC for ; Tue, 26 Apr 2022 14:49:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andre.przywara@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4D02523A; Tue, 26 Apr 2022 05:49:44 -0700 (PDT) Received: from donnerap.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B46D73F774; Tue, 26 Apr 2022 05:49:43 -0700 (PDT) Date: Tue, 26 Apr 2022 13:49:41 +0100 From: Andre Przywara To: qianfanguijin@163.com Cc: u-boot@lists.denx.de, Jagan Teki Subject: Re: [PATCH v1] sunxi: Make SYS_VENDOR, SYS_BOARD, SYS_CONFIG_NAME configurable Message-ID: <20220426134941.742af5ed@donnerap.cambridge.arm.com> In-Reply-To: <20220421033211.22469-1-qianfanguijin@163.com> References: <20220421033211.22469-1-qianfanguijin@163.com> Organization: ARM X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; aarch64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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.5 at phobos.denx.de X-Virus-Status: Clean On Thu, 21 Apr 2022 11:32:11 +0800 qianfanguijin@163.com wrote: Hi, > From: qianfan Zhao > > 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 > --- > 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/.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// will > + be used. > + > +config SYS_VENDOR > + string "Vendor name" > + help > + This option contains information about board name. > + Based on this option board// will > + be used. > > config SYS_SOC > default "sunxi"