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 76BCBC77B72 for ; Mon, 17 Apr 2023 09:25:47 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4CA94856FA; Mon, 17 Apr 2023 11:25:45 +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 28CC485D46; Mon, 17 Apr 2023 11:25:43 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 664E180B9E for ; Mon, 17 Apr 2023 11:25:40 +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=abdellatif.elkhlifi@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 77A394B3; Mon, 17 Apr 2023 02:26:24 -0700 (PDT) Received: from e130802.arm.com (unknown [10.57.22.150]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id ACBF63F6C4; Mon, 17 Apr 2023 02:25:38 -0700 (PDT) Date: Mon, 17 Apr 2023 10:25:32 +0100 From: Abdellatif El Khlifi To: Simon Glass Cc: nd@arm.com, u-boot@lists.denx.de, trini@konsulko.com Subject: Re: [PATCH v1 3/6] sandbox64: add support for NVMXIP QSPI Message-ID: <20230417092532.GA44072@e130802.arm.com> References: <20230116172832.1946-1-abdellatif.elkhlifi@arm.com> <20230116172832.1946-4-abdellatif.elkhlifi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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.8 at phobos.denx.de X-Virus-Status: Clean On Tue, Feb 07, 2023 at 11:38:45AM -0700, Simon Glass wrote: Hi Simon, > Hi, > > On Tue, 7 Feb 2023 at 09:30, Tom Rini wrote: > > > > On Mon, Feb 06, 2023 at 09:02:38PM -0700, Simon Glass wrote: > > > On Mon, 16 Jan 2023 at 10:28, wrote: > > > > > > > > From: Abdellatif El Khlifi > > > > > > > > enable NVMXIP QSPI for sandbox 64-bit > > > > > > > > Adding two NVM XIP QSPI storage devices. > > > > > > > > Signed-off-by: Abdellatif El Khlifi > > > > --- > > > > arch/sandbox/dts/sandbox64.dts | 13 +++++++++++++ > > > > arch/sandbox/dts/test.dts | 14 ++++++++++++++ > > > > configs/sandbox64_defconfig | 1 + > > > > drivers/nvmxip/nvmxip.c | 4 ++++ > > > > drivers/nvmxip/nvmxip.h | 3 +++ > > > > 5 files changed, 35 insertions(+) > > > > > > Reviewed-by: Simon Glass > > > > > > Nit below > > > > > > > > > > > diff --git a/arch/sandbox/dts/sandbox64.dts b/arch/sandbox/dts/sandbox64.dts > > > > index a9cd7908f8..aed3801af8 100644 > > > > --- a/arch/sandbox/dts/sandbox64.dts > > > > +++ b/arch/sandbox/dts/sandbox64.dts > > > > @@ -89,6 +89,19 @@ > > > > cs-gpios = <0>, <&gpio_a 0>; > > > > }; > > > > > > > > + nvmxip-qspi1@08000000 { > > > > + compatible = "nvmxip,qspi"; > > > > + reg = <0x0 0x08000000 0x0 0x00200000>; > > > > + lba_shift = <9>; > > > > + lba = <4096>; > > > > + }; > > > > + > > > > + nvmxip-qspi2@08200000 { > > > > + compatible = "nvmxip,qspi"; > > > > + reg = <0x0 0x08200000 0x0 0x00100000>; > > > > + lba_shift = <9>; > > > > + lba = <2048>; > > > > + }; > > > > }; > > > > > > > > #include "sandbox.dtsi" > > > > diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts > > > > index dffe10adbf..c3ba0a225e 100644 > > > > --- a/arch/sandbox/dts/test.dts > > > > +++ b/arch/sandbox/dts/test.dts > > > > @@ -1745,6 +1745,20 @@ > > > > compatible = "u-boot,fwu-mdata-gpt"; > > > > fwu-mdata-store = <&mmc0>; > > > > }; > > > > + > > > > + nvmxip-qspi1@08000000 { > > > > + compatible = "nvmxip,qspi"; > > > > + reg = <0x08000000 0x00200000>; > > > > + lba_shift = <9>; > > > > + lba = <4096>; > > > > + }; > > > > + > > > > + nvmxip-qspi2@08200000 { > > > > + compatible = "nvmxip,qspi"; > > > > + reg = <0x08200000 0x00100000>; > > > > + lba_shift = <9>; > > > > + lba = <2048>; > > > > + }; > > > > }; > > > > > > > > #include "sandbox_pmic.dtsi" > > > > diff --git a/configs/sandbox64_defconfig b/configs/sandbox64_defconfig > > > > index ba45ac0b71..cd4dadb190 100644 > > > > --- a/configs/sandbox64_defconfig > > > > +++ b/configs/sandbox64_defconfig > > > > @@ -259,3 +259,4 @@ CONFIG_FWU_MULTI_BANK_UPDATE=y > > > > CONFIG_UNIT_TEST=y > > > > CONFIG_UT_TIME=y > > > > CONFIG_UT_DM=y > > > > +CONFIG_NVMXIP_QSPI=y > > > > \ No newline at end of file > > > > diff --git a/drivers/nvmxip/nvmxip.c b/drivers/nvmxip/nvmxip.c > > > > index c276fb147e..ea9b9bfa48 100644 > > > > --- a/drivers/nvmxip/nvmxip.c > > > > +++ b/drivers/nvmxip/nvmxip.c > > > > @@ -87,6 +87,10 @@ int nvmxip_init(struct udevice *udev) > > > > priv_data->udev = udev; > > > > priv_data->plat_data = plat_data; > > > > > > > > +#if CONFIG_IS_ENABLED(SANDBOX64) > > > > > > if (IS_ENABLED(CONFIG_SANDBOX64)) > > > > > > > > > > + sandbox_set_enable_memio(true); > > > > +#endif > > > > Isn't that just going to introduce a warning about undeclared function > > on non-sandbox64? > > Well, the header file should always be included, so it shouldn't! I tried what you suggested by including #include without #ifdef. When compiling for Arm, the compilation fails: drivers/mtd/nvmxip/nvmxip-uclass.c:12:10: fatal error: asm/test.h: No such file or directory 12 | #include | ^~~~~~~~~~~~ compilation terminated. Reason of failure: sandbox_set_enable_memio() prototype is declared in sandbox/include/asm/test.h, which doesn't work for platforms other than sandbox. Even when including include/test/test.h instead of sandbox/include/asm/test.h, it will fail because there is an #ifdef CONFIG_SANDBOX in include/test/test.h: #ifdef CONFIG_SANDBOX #include #include #endif I think better to keep the #if CONFIG_IS_ENABLED(SANDBOX64) in nvmxip-uclass.c. Cheers, Abdellatif > > Please also add a newline to the defconfig. > > Regards, > Simon