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 BD5DBC433FE for ; Wed, 26 Oct 2022 10:41:30 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C882B84FAC; Wed, 26 Oct 2022 12:41:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="CLZzxk3h"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 96EC784FC0; Wed, 26 Oct 2022 12:41:25 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 69B6B84F9E for ; Wed, 26 Oct 2022 12:41:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rogerq@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BA99261DFD; Wed, 26 Oct 2022 10:41:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 828A1C433D6; Wed, 26 Oct 2022 10:41:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666780877; bh=XJR0gVBd0kastpCNKtg5KPbzPBNQKrgYVBFtJHRv3uI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=CLZzxk3h67b+HZbBwjgH8TP13WJFsqLuohHsuyOYZMw0N9ykGtCx8YhZefDCEpGGy M/EDs8zcJcgCJuky+Uw1hr1a1cn8+7C0uY7oEIL0wFpeoWedHzsVcpDRer2LjDRWLC 1QUzvZBxmeP+VMdq0ngwe2g7CFgT5sPKIYssbPOyQ1+KvtZJhS6Nb5JWVBQDj1JFwc uXiItdXyuv3kgI1oNRKMM00dCt9unXwJ/K1kUjoqVjUwsJujuUFy37ZGVv2lwrQZ7D rfUo21rM9XPIuHSo0rVBk3Ue8AJECbw0PzQXNJwwRvAGYVN7rD3JAvpNA1jGLD90Ku eGd3yxJ0++2bQ== Message-ID: <6fc5dd24-6ac7-b7e0-faab-d9fd30a1e413@kernel.org> Date: Wed, 26 Oct 2022 13:41:12 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [u-boot][PATCH v2 2/4] scripts: Makefile.spl: Enable memory drivers to be built for SPL Content-Language: en-US To: Simon Glass , Tom Rini Cc: u-boot@lists.denx.de, praneeth@ti.com, kishon@ti.com, Patrick Delaunay , Patrice Chotard References: <20221006132400.5628-1-rogerq@kernel.org> <20221006132400.5628-3-rogerq@kernel.org> <20221018174025.GA2412547@bill-the-cat> <2a378fe3-d8f6-3b60-eeb9-f511921fb831@kernel.org> <20221019125425.GH2020586@bill-the-cat> <6ac9e035-93ce-3272-13af-01fa77824d31@kernel.org> <20221020122950.GN2020586@bill-the-cat> From: Roger Quadros In-Reply-To: Content-Type: text/plain; charset=UTF-8 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.6 at phobos.denx.de X-Virus-Status: Clean Tom, On 26/10/2022 02:35, Simon Glass wrote: > Hi Tom, > > On Thu, 20 Oct 2022 at 06:29, Tom Rini wrote: >> >> On Thu, Oct 20, 2022 at 03:23:42PM +0300, Roger Quadros wrote: >>> Hi Tom, >>> >>> On 19/10/2022 15:54, Tom Rini wrote: >>>> On Wed, Oct 19, 2022 at 11:17:35AM +0300, Roger Quadros wrote: >>>>> >>>>> >>>>> On 18/10/2022 20:40, Tom Rini wrote: >>>>>> On Thu, Oct 06, 2022 at 04:23:58PM +0300, Roger Quadros wrote: >>>>>>> We will need ti-gpmc driver for SPL. Allow memory drivers >>>>>>> do be built for SPL. >>>>>>> >>>>>>> Signed-off-by: Roger Quadros >>>>>>> --- >>>>>>> scripts/Makefile.spl | 1 + >>>>>>> 1 file changed, 1 insertion(+) >>>>>>> >>>>>>> diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl >>>>>>> index 3bafeb4fe9..110076b22f 100644 >>>>>>> --- a/scripts/Makefile.spl >>>>>>> +++ b/scripts/Makefile.spl >>>>>>> @@ -114,6 +114,7 @@ libs-$(CONFIG_PARTITIONS) += disk/ >>>>>>> endif >>>>>>> >>>>>>> libs-y += drivers/ >>>>>>> +libs-y += drivers/memory/ >>>>>>> libs-$(CONFIG_SPL_USB_GADGET) += drivers/usb/dwc3/ >>>>>>> libs-$(CONFIG_SPL_USB_GADGET) += drivers/usb/cdns3/ >>>>>>> libs-y += dts/ >>>>>> >>>>>> This ends up being the wrong approach as it then pulls in >>>>>> drivers/memory/stm32-fmc2-ebi.o on all of those platforms, in SPL, which >>>>>> is not what's intended. We need an SPL_MEMORY symbol and then gate the >>>>>> directory on that. >>>>>> >>> >>> I have a question about how CONFIG_SPL_MEMORY works together with CONFIG_MEMORY. >>> >>> Do we use CONFIG_SPL_MEMORY only to gate the drivers/memory directory inclusion? >>> Then continue to use CONFIG_MEMORY and others to enable/disable driver >>> build for both non-SPL and SPL case? >>> >>> So drivers/memory/Makefile remains as it is? >> >> Well, for consistency code should use IS_ENABLED(MEMORY) which will be >> true for CONFIG_MEMORY or CONFIG_SPL_MEMORY. > > nit: CONFIG_IS_ENABLED(MEMORY) CONFIG_IS_ENABLED* is used in code but not by any Makefile. My question was on what basis do we gate drivers/memory inclusion in build from Makefile. Can CONFIG_MEMORY and CONFIG_SPL_MEMORY co-exist or that should never happen? > > Perhaps we can look at my Kconfig series so it can become > CONFIG(MEMORY) and we can drop all the SPL_TPL_ stuff in Makefiles? > > Regards, > SImon cheers, -roger