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 90716C433F5 for ; Wed, 27 Apr 2022 00:42:32 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 93BCB83AE1; Wed, 27 Apr 2022 02:42:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=163.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=163.com header.i=@163.com header.b="ZVdz+JTi"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 03550839FD; Wed, 27 Apr 2022 02:42:28 +0200 (CEST) Received: from m12-11.163.com (m12-11.163.com [220.181.12.11]) by phobos.denx.de (Postfix) with ESMTP id CA9FD83BDB for ; Wed, 27 Apr 2022 02:42:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=qianfanguijin@163.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Message-ID:Date:MIME-Version:Subject:From; bh=5sfWt LGaBq59N/y/8vVG4jyS8LavjdqnMx23LmYdJ5M=; b=ZVdz+JTi38gj5zgCF76Yx /1t9a9ithK0w8+rcpPme1mXCTS4PFblKg4N/oIX7osEtbe4EtxvtTANpxXIE/0+Q Yjsn3Z9aDtJ4NXGRhMZzrdo4Q1dBVX+uZVjOT6RqzjY7hddn4ZvmH8mOOmwvbabF HXiUTvirCiMOEbPRr7M3Vw= Received: from [192.168.3.102] (unknown [218.201.129.19]) by smtp7 (Coremail) with SMTP id C8CowABXTdJgkWhixoUdDQ--.23609S2; Wed, 27 Apr 2022 08:42:08 +0800 (CST) Message-ID: <66f5e91f-3b42-b4c7-4ad5-3636adcb6f34@163.com> Date: Wed, 27 Apr 2022 08:42:09 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH v1] sunxi: Make SYS_VENDOR, SYS_BOARD, SYS_CONFIG_NAME configurable Content-Language: en-US To: Andre Przywara Cc: u-boot@lists.denx.de, Jagan Teki References: <20220421033211.22469-1-qianfanguijin@163.com> <20220426134941.742af5ed@donnerap.cambridge.arm.com> From: qianfan In-Reply-To: <20220426134941.742af5ed@donnerap.cambridge.arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID: C8CowABXTdJgkWhixoUdDQ--.23609S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxJF4ftFy7ArykKr4fAr43KFg_yoWrJFyrpF Z2yw15KFs2gF13Gw429wn2grWFya1kGFy5CF17G34jvFZ8Cw109rZ5Kw15CFyDWr1kGw4Y vFn5u3Wagw1vq37anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UOJ5wUUUUU= X-Originating-IP: [218.201.129.19] X-CM-SenderInfo: htld0w5dqj3xxmlqqiywtou0bp/1tbiQgHv7VaEB6Z+HwAAsT 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 在 2022/4/26 20:49, Andre Przywara 写道: > 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 Yes, this is the problem I want to slove. All sunxi based board use board/sunxi by default, I don't think it's a good way to adding other custom code to board/sunxi.c, so I want create another board and select it in Kconfig. > 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 It's better if the dependence can convert to dt, but not all of them. On my board there has an gpio watchdog and spi lcd. I need add somethings to toggle watchdog, prepare spi lcd and draw splash. So I want create a board dir and select it in Kconfig. > 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"