[U-Boot] [PATCH v5 1/5] spl: dm: disable SPI DM flash for non-DM SPL

Xiaowei Bao xiaowei.bao at nxp.com
Thu Aug 22 01:56:48 UTC 2019



> -----Original Message-----
> From: Lukasz Majewski <lukma at denx.de>
> Sent: 2019年8月20日 17:50
> To: Xiaowei Bao <xiaowei.bao at nxp.com>
> Cc: wd at denx.de; Ruchika Gupta <ruchika.gupta at nxp.com>; Shengzhou Liu
> <shengzhou.liu at nxp.com>; jagan at amarulasolutions.com; Prabhakar
> Kushwaha <prabhakar.kushwaha at nxp.com>; u-boot at lists.denx.de; Jiafei
> Pan <jiafei.pan at nxp.com>; Chuanhua Han <chuanhua.han at nxp.com>
> Subject: Re: [U-Boot] [PATCH v5 1/5] spl: dm: disable SPI DM flash for
> non-DM SPL
> 
> On Tue, 20 Aug 2019 09:00:40 +0000
> Xiaowei Bao <xiaowei.bao at nxp.com> wrote:
> 
> > > -----Original Message-----
> > > From: Lukasz Majewski <lukma at denx.de>
> > > Sent: 2019年8月20日 16:20
> > > To: Xiaowei Bao <xiaowei.bao at nxp.com>
> > > Cc: wd at denx.de; Ruchika Gupta <ruchika.gupta at nxp.com>; Shengzhou
> Liu
> > > <shengzhou.liu at nxp.com>; jagan at amarulasolutions.com; Prabhakar
> > > Kushwaha <prabhakar.kushwaha at nxp.com>; u-boot at lists.denx.de; Jiafei
> > > Pan <jiafei.pan at nxp.com>; Chuanhua Han <chuanhua.han at nxp.com>
> > > Subject: Re: [U-Boot] [PATCH v5 1/5] spl: dm: disable SPI DM flash
> > > for non-DM SPL
> > >
> > > On Tue, 20 Aug 2019 07:51:18 +0000
> > > Xiaowei Bao <xiaowei.bao at nxp.com> wrote:
> > >
> > > > > -----Original Message-----
> > > > > From: Lukasz Majewski <lukma at denx.de>
> > > > > Sent: 2019年8月20日 15:43
> > > > > To: Xiaowei Bao <xiaowei.bao at nxp.com>
> > > > > Cc: wd at denx.de; Ruchika Gupta <ruchika.gupta at nxp.com>;
> Shengzhou
> > > Liu
> > > > > <shengzhou.liu at nxp.com>; jagan at amarulasolutions.com; Prabhakar
> > > > > Kushwaha <prabhakar.kushwaha at nxp.com>; u-boot at lists.denx.de;
> > > > > Jiafei Pan <jiafei.pan at nxp.com>; Pan Jiafei
> > > > > <Jiafei.Pan at freescale.com>; Chuanhua Han
> <chuanhua.han at nxp.com>
> > > > > Subject: Re: [U-Boot] [PATCH v5 1/5] spl: dm: disable SPI DM
> > > > > flash for non-DM SPL
> > > > >
> > > > > On Tue, 20 Aug 2019 07:27:39 +0000 Xiaowei Bao
> > > > > <xiaowei.bao at nxp.com> wrote:
> > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Lukasz Majewski <lukma at denx.de>
> > > > > > > Sent: 2019年8月20日 15:14
> > > > > > > To: Xiaowei Bao <xiaowei.bao at nxp.com>
> > > > > > > Cc: wd at denx.de; Ruchika Gupta <ruchika.gupta at nxp.com>;
> > > Shengzhou
> > > > > Liu
> > > > > > > <shengzhou.liu at nxp.com>; jagan at amarulasolutions.com;
> > > > > > > Prabhakar Kushwaha <prabhakar.kushwaha at nxp.com>;
> > > > > > > u-boot at lists.denx.de; Jiafei Pan <jiafei.pan at nxp.com>; Pan
> > > > > > > Jiafei <Jiafei.Pan at freescale.com>; Chuanhua Han
> > > <chuanhua.han at nxp.com>
> > > > > > > Subject: Re: [U-Boot] [PATCH v5 1/5] spl: dm: disable SPI DM
> > > > > > > flash for non-DM SPL
> > > > > > >
> > > > > > > Hi Xiaowei,
> > > > > > >
> > > > > > > > From: Chuanhua Han <chuanhua.han at nxp.com>
> > > > > > > >
> > > > > > > > This patch solves the problem that spiboot cannot be
> > > > > > > > performed in non-DM SPL.
> > > > > > >
> > > > > > > I've posted recently a set of patches to move setting of
> > > > > > > DM_SPI_FLASH to Kconfig:
> > > > > > > https://patchwork.ozlabs.org/cover/1146494/
> > > > > > >
> > > > > > > Please rebase your work on top of it.
> > > > > > Did this set of patches merge to the u-boot mainline?
> > > > >
> > > > > Those patches were not yet accepted to mainline.
> > > > >
> > > > > > Do I need to
> > > > > > depend on your patches?
> > > > >
> > > > > It would be best to avoid duplicating the effort.
> > > > >
> > > > > > If yes, please provide the full patches link, I can't see the
> > > > > > contents of this set of patches.
> > > > >
> > > > > When you open the link:
> > > > > https://patchwork.ozlabs.org/cover/1146494/
> > > > >
> > > > > On top left you have:
> > > > > "Related" -> "show"
> > > > >
> > > > > After clicking on it you will see the list of patches.
> > > > >
> > > > > You may also want to use "Series" on top right and download the
> > > > > whole patch series.
> > > > I have check these set of patches, it don't impact my patches, my
> > > > patches implemented the ESPI DM driver of POWERPC.
> > >
> > > But you add:
> > >
> > > +#undef CONFIG_DM_SPI_FLASH
> > >
> > > for SPL, Which is problematic as explained in the patch set.
> > Can I modify the patches like this?
> > diff --git a/include/config_uncmd_spl.h b/include/config_uncmd_spl.h
> > index da94b3d..c2f9735 100644
> > --- a/include/config_uncmd_spl.h
> > +++ b/include/config_uncmd_spl.h
> > @@ -15,7 +15,6 @@
> >  #undef CONFIG_DM_GPIO
> >  #undef CONFIG_DM_I2C
> >  #undef CONFIG_DM_SPI
> > -#undef CONFIG_DM_SPI_FLASH
> >  #endif
> >
> >  #undef CONFIG_DM_WARN
> > diff --git a/include/configs/T208xQDS.h b/include/configs/T208xQDS.h
> > index 98bb334..b45ec4a 100644
> > --- a/include/configs/T208xQDS.h
> > +++ b/include/configs/T208xQDS.h
> > @@ -10,6 +10,13 @@
> >  #ifndef __T208xQDS_H
> >  #define __T208xQDS_H
> >
> > +/* SPI Flash Configs */
> > +#if defined(CONFIG_SPL_BUILD)
> > +#undef CONFIG_DM_SPI
> > +#undef CONFIG_DM_SPI_FLASH
> > +#undef CONFIG_SPI_FLASH_MTD
> > +#endif
> 
> The whole point is to avoid adding the above code.
> 
> The rationale for this can be found in the commit message:
> https://patchwork.ozlabs.org/patch/1146375/
Hi Lukasz, thanks for your comments, ask a question, I modify my driver like this:
diff --git a/drivers/spi/fsl_espi.c b/drivers/spi/fsl_espi.c
index fd5ac97..54be036 100644
--- a/drivers/spi/fsl_espi.c
+++ b/drivers/spi/fsl_espi.c
@@ -367,6 +367,7 @@ void espi_setup_slave(struct fsl_spi_slave *fsl)
                                * 10), spi_freq);/* Set eSPI BRG clock source */
 }

 #ifndef CONFIG_DM_SPI
+#if !CONFIG_IS_ENABLED(DM_SPI)
 int spi_cs_is_valid(unsigned int bus, unsigned int cs)
 {

diff --git a/configs/T2080QDS_SPIFLASH_defconfig b/configs/T2080QDS_SPIFLASH_defconfig
index 7a1c580..cf53e54 100644
--- a/configs/T2080QDS_SPIFLASH_defconfig
+++ b/configs/T2080QDS_SPIFLASH_defconfig
@@ -80,3 +80,5 @@ CONFIG_DM_SPI=y
 CONFIG_DM_SPI_FLASH=y
+CONFIG_SPL_DM_SPI=y
+CONFIG_SPL_DM_SPI_FLASH=y

When I compile the driver with SPL mode, the DM or non DM mode cod will be compiled
together, I think CONFIG_IS_ENABLED(DM_SPI) is 0 or 1, so the DM code or non DM code
will be compiled, but not both, this make me confused, do I miss something, could you tell
me the reason? Thanks a lot.

> 
> > +
> > >
> > > > >
> > > > > > >
> > > > > > > >
> > > > > > > > Signed-off-by: Pan Jiafei <Jiafei.Pan at freescale.com>
> > > > > > > > Signed-off-by: Chuanhua Han <chuanhua.han at nxp.com>
> > > > > > > > ---
> > > > > > > > Changes in v5:
> > > > > > > > 	- No change.
> > > > > > > > Changes in v4:
> > > > > > > > 	- No change.
> > > > > > > > Changes in v3:
> > > > > > > > 	- Add a cover-letter for this patch set.
> > > > > > > > Changes in v2:
> > > > > > > > 	- No change.
> > > > > > > >
> > > > > > > >  include/config_uncmd_spl.h | 1 +
> > > > > > > >  1 file changed, 1 insertion(+)
> > > > > > > >
> > > > > > > > diff --git a/include/config_uncmd_spl.h
> > > > > > > > b/include/config_uncmd_spl.h index c2f9735..da94b3d 100644
> > > > > > > > --- a/include/config_uncmd_spl.h
> > > > > > > > +++ b/include/config_uncmd_spl.h
> > > > > > > > @@ -15,6 +15,7 @@
> > > > > > > >  #undef CONFIG_DM_GPIO
> > > > > > > >  #undef CONFIG_DM_I2C
> > > > > > > >  #undef CONFIG_DM_SPI
> > > > > > > > +#undef CONFIG_DM_SPI_FLASH
> > > > > > > >  #endif
> > > > > > > >
> > > > > > > >  #undef CONFIG_DM_WARN
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Best regards,
> > > > > > >
> > > > > > > Lukasz Majewski
> > > > > > >
> > > > > > > --
> > > > > > >
> > > > > > > DENX Software Engineering GmbH,      Managing Director:
> > > Wolfgang
> > > > > > > Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194
> > > > > > > Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax:
> > > > > > > (+49)-8142-66989-80 Email: lukma at denx.de
> > > > >
> > > > >
> > > > >
> > > > > Best regards,
> > > > >
> > > > > Lukasz Majewski
> > > > >
> > > > > --
> > > > >
> > > > > DENX Software Engineering GmbH,      Managing Director:
> Wolfgang
> > > > > Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194
> > > > > Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax:
> > > > > (+49)-8142-66989-80 Email: lukma at denx.de
> > >
> > >
> > >
> > > Best regards,
> > >
> > > Lukasz Majewski
> > >
> > > --
> > >
> > > DENX Software Engineering GmbH,      Managing Director: Wolfgang
> > > Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell,
> > > Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
> > > lukma at denx.de
> 
> 
> 
> Best regards,
> 
> Lukasz Majewski
> 
> --
> 
> DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email:
> lukma at denx.de


More information about the U-Boot mailing list