All of lore.kernel.org
 help / color / mirror / Atom feed
From: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
To: Simon Glass <sjg@chromium.org>
Cc: nd@arm.com, u-boot@lists.denx.de, trini@konsulko.com
Subject: Re: [PATCH v1 3/6] sandbox64: add support for NVMXIP QSPI
Date: Mon, 17 Apr 2023 10:25:32 +0100	[thread overview]
Message-ID: <20230417092532.GA44072@e130802.arm.com> (raw)
In-Reply-To: <CAPnjgZ0XWoxVLsc6b-rYAmi2c5w35hxP9rtpWMz3QmxsQVJVbQ@mail.gmail.com>

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 <trini@konsulko.com> wrote:
> >
> > On Mon, Feb 06, 2023 at 09:02:38PM -0700, Simon Glass wrote:
> > > On Mon, 16 Jan 2023 at 10:28, <abdellatif.elkhlifi@arm.com> wrote:
> > > >
> > > > From: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
> > > >
> > > > enable NVMXIP QSPI for sandbox 64-bit
> > > >
> > > > Adding two NVM XIP QSPI storage devices.
> > > >
> > > > Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
> > > > ---
> > > >  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 <sjg@chromium.org>
> > >
> > > 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 <asm/test.h> 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 <asm/test.h>
      |          ^~~~~~~~~~~~
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 <asm/state.h>
#include <asm/test.h>
#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

  reply	other threads:[~2023-04-17  9:25 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-16 17:28 [PATCH v1 0/6] introduce NVM XIP block storage emulation abdellatif.elkhlifi
2023-01-16 17:28 ` [PATCH v1 1/6] drivers/nvmxip: " abdellatif.elkhlifi
2023-02-07 18:38   ` Simon Glass
2023-04-17  9:19     ` Abdellatif El Khlifi
2023-01-16 17:28 ` [PATCH v1 2/6] sandbox64: fix: return unsigned long in readq() abdellatif.elkhlifi
2023-01-16 17:28 ` [PATCH v1 3/6] sandbox64: add support for NVMXIP QSPI abdellatif.elkhlifi
2023-02-07  4:02   ` Simon Glass
2023-02-07 16:30     ` Tom Rini
2023-02-07 18:38       ` Simon Glass
2023-04-17  9:25         ` Abdellatif El Khlifi [this message]
2023-01-16 17:28 ` [PATCH v1 4/6] corstone1000: add NVM XIP QSPI device tree node abdellatif.elkhlifi
2023-01-16 17:28 ` [PATCH v1 5/6] corstone1000: enable NVM XIP QSPI flash abdellatif.elkhlifi
2023-01-16 17:28 ` [PATCH v1 6/6] sandbox64: add a test case for UCLASS_NVMXIP abdellatif.elkhlifi
2023-02-07  4:02   ` Simon Glass
2023-04-17  9:21     ` Abdellatif El Khlifi
2023-02-06 14:17 ` [PATCH v1 0/6] introduce NVM XIP block storage emulation Abdellatif El Khlifi
2023-02-07  4:02   ` Simon Glass
2023-04-17  9:11 ` [PATCH v2 0/7] " Abdellatif El Khlifi
2023-04-17  9:11   ` [PATCH v2 1/7] drivers/mtd/nvmxip: " Abdellatif El Khlifi
2023-04-17  9:11   ` [PATCH v2 2/7] drivers/mtd/nvmxip: introduce QSPI XIP driver Abdellatif El Khlifi
2023-04-17  9:11   ` [PATCH v2 3/7] sandbox64: fix: return unsigned long in readq() Abdellatif El Khlifi
2023-04-19  1:49     ` Simon Glass
2023-04-17  9:11   ` [PATCH v2 4/7] sandbox64: add support for NVMXIP QSPI Abdellatif El Khlifi
2023-04-17  9:11   ` [PATCH v2 5/7] corstone1000: add NVM XIP QSPI device tree node Abdellatif El Khlifi
2023-04-17  9:11   ` [PATCH v2 6/7] corstone1000: enable NVM XIP QSPI flash Abdellatif El Khlifi
2023-04-17  9:11   ` [PATCH v2 7/7] sandbox64: add a test case for UCLASS_NVMXIP Abdellatif El Khlifi
2023-04-27 23:23   ` [PATCH v2 0/7] introduce NVM XIP block storage emulation Tom Rini

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=20230417092532.GA44072@e130802.arm.com \
    --to=abdellatif.elkhlifi@arm.com \
    --cc=nd@arm.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.