diff mbox series

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

Message ID 20190621022202.33996-2-chuanhua.han@nxp.com
State Changes Requested
Delegated to: Jagannadha Sutradharudu Teki
Headers show
Series dm: spi: Convert Freescale ESPI driver to driver | expand

Commit Message

Chuanhua Han June 21, 2019, 2:21 a.m. UTC
This patch solves the problem that spiboot cannot be performed in
non-DM SPL.

Signed-off-by: Pan Jiafei <Jiafei.Pan@freescale.com>
Signed-off-by: Chuanhua Han <chuanhua.han@nxp.com>
---
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(+)

Comments

Jagan Teki Aug. 14, 2019, 7:44 a.m. UTC | #1
On Fri, Jun 21, 2019 at 7:51 AM Chuanhua Han <chuanhua.han@nxp.com> wrote:
>
> This patch solves the problem that spiboot cannot be performed in
> non-DM SPL.
>
> Signed-off-by: Pan Jiafei <Jiafei.Pan@freescale.com>
> Signed-off-by: Chuanhua Han <chuanhua.han@nxp.com>
> ---
> 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 c2f9735ce7..da94b3d9df 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

Have you made any Travis-CI run?
Chuanhua Han Aug. 14, 2019, 8:32 a.m. UTC | #2
> -----Original Message-----
> From: Jagan Teki <jagan@amarulasolutions.com>
> Sent: 2019年8月14日 15:45
> To: Chuanhua Han <chuanhua.han@nxp.com>
> Cc: Wolfgang Denk <wd@denx.de>; Shengzhou Liu <shengzhou.liu@nxp.com>;
> Ruchika Gupta <ruchika.gupta@nxp.com>; Jagan Teki <jagan@openedev.com>;
> Simon Glass <sjg@chromium.org>; Prabhakar Kushwaha
> <prabhakar.kushwaha@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>; Pan
> Jiafei <Jiafei.Pan@freescale.com>
> Subject: [EXT] Re: [U-Boot] [PATCH v4 1/5] spl: dm: disable SPI DM flash for
> non-DM SPL
> 
> Caution: EXT Email
> 
> On Fri, Jun 21, 2019 at 7:51 AM Chuanhua Han <chuanhua.han@nxp.com>
> wrote:
> >
> > This patch solves the problem that spiboot cannot be performed in
> > non-DM SPL.
> >
> > Signed-off-by: Pan Jiafei <Jiafei.Pan@freescale.com>
> > Signed-off-by: Chuanhua Han <chuanhua.han@nxp.com>
> > ---
> > 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 c2f9735ce7..da94b3d9df 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
> 
> Have you made any Travis-CI run?
I tested it with a local board
Lukasz Majewski Aug. 14, 2019, 8:57 a.m. UTC | #3
Hi Chuanhua,

> > -----Original Message-----
> > From: Jagan Teki <jagan@amarulasolutions.com>
> > Sent: 2019年8月14日 15:45
> > To: Chuanhua Han <chuanhua.han@nxp.com>
> > Cc: Wolfgang Denk <wd@denx.de>; Shengzhou Liu
> > <shengzhou.liu@nxp.com>; Ruchika Gupta <ruchika.gupta@nxp.com>;
> > Jagan Teki <jagan@openedev.com>; Simon Glass <sjg@chromium.org>;
> > Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>; U-Boot-Denx
> > <u-boot@lists.denx.de>; Pan Jiafei <Jiafei.Pan@freescale.com>
> > Subject: [EXT] Re: [U-Boot] [PATCH v4 1/5] spl: dm: disable SPI DM
> > flash for non-DM SPL
> > 
> > Caution: EXT Email
> > 
> > On Fri, Jun 21, 2019 at 7:51 AM Chuanhua Han <chuanhua.han@nxp.com>
> > wrote:  
> > >
> > > This patch solves the problem that spiboot cannot be performed in
> > > non-DM SPL.
> > >
> > > Signed-off-by: Pan Jiafei <Jiafei.Pan@freescale.com>
> > > Signed-off-by: Chuanhua Han <chuanhua.han@nxp.com>
> > > ---
> > > 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 c2f9735ce7..da94b3d9df 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  
> > 
> > Have you made any Travis-CI run?  
> I tested it with a local board

Could you be so kind and also test following patchset (parts from
Layerscape also needs testing):
https://patchwork.ozlabs.org/cover/1146494/

Which allows removal of 
#undef CONFIG_DM_SPI
#undef CONFIG_DM_SPI_FLASH

and have the same configuration done via Kconfig ?

> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot



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@denx.de
Chuanhua Han Aug. 14, 2019, 9:01 a.m. UTC | #4
> -----Original Message-----
> From: Lukasz Majewski <lukma@denx.de>
> Sent: 2019年8月14日 16:57
> To: Chuanhua Han <chuanhua.han@nxp.com>
> Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> <xiaowei.bao@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>; Pan Jiafei
> <Jiafei.Pan@freescale.com>; Jagan Teki <jagan@openedev.com>; Ruchika
> Gupta <ruchika.gupta@nxp.com>
> Subject: Re: [U-Boot] [EXT] Re: [PATCH v4 1/5] spl: dm: disable SPI DM flash for
> non-DM SPL
> 
> Hi Chuanhua,
> 
> > > -----Original Message-----
> > > From: Jagan Teki <jagan@amarulasolutions.com>
> > > Sent: 2019年8月14日 15:45
> > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > Cc: Wolfgang Denk <wd@denx.de>; Shengzhou Liu
> > > <shengzhou.liu@nxp.com>; Ruchika Gupta <ruchika.gupta@nxp.com>;
> > > Jagan Teki <jagan@openedev.com>; Simon Glass <sjg@chromium.org>;
> > > Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>; U-Boot-Denx
> > > <u-boot@lists.denx.de>; Pan Jiafei <Jiafei.Pan@freescale.com>
> > > Subject: [EXT] Re: [U-Boot] [PATCH v4 1/5] spl: dm: disable SPI DM
> > > flash for non-DM SPL
> > >
> > > Caution: EXT Email
> > >
> > > On Fri, Jun 21, 2019 at 7:51 AM Chuanhua Han <chuanhua.han@nxp.com>
> > > wrote:
> > > >
> > > > This patch solves the problem that spiboot cannot be performed in
> > > > non-DM SPL.
> > > >
> > > > Signed-off-by: Pan Jiafei <Jiafei.Pan@freescale.com>
> > > > Signed-off-by: Chuanhua Han <chuanhua.han@nxp.com>
> > > > ---
> > > > 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 c2f9735ce7..da94b3d9df 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
> > >
> > > Have you made any Travis-CI run?
> > I tested it with a local board
> 
> Could you be so kind and also test following patchset (parts from Layerscape also
> needs testing):
> https://patchwork.ozlabs.org/cover/1146494/
> 
> Which allows removal of
> #undef CONFIG_DM_SPI
> #undef CONFIG_DM_SPI_FLASH
> 
> and have the same configuration done via Kconfig ?
OK I will test
> 
> > _______________________________________________
> > U-Boot mailing list
> > U-Boot@lists.denx.de
> > https://lists.denx.de/listinfo/u-boot
> 
> 
> 
> 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@denx.de
Chuanhua Han Aug. 14, 2019, 10:41 a.m. UTC | #5
> -----Original Message-----
> From: Lukasz Majewski <lukma@denx.de>
> Sent: 2019年8月14日 16:57
> To: Chuanhua Han <chuanhua.han@nxp.com>
> Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> <xiaowei.bao@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>; Pan Jiafei
> <Jiafei.Pan@freescale.com>; Jagan Teki <jagan@openedev.com>; Ruchika
> Gupta <ruchika.gupta@nxp.com>
> Subject: Re: [U-Boot] [EXT] Re: [PATCH v4 1/5] spl: dm: disable SPI DM flash for
> non-DM SPL
> 
> Hi Chuanhua,
> 
> > > -----Original Message-----
> > > From: Jagan Teki <jagan@amarulasolutions.com>
> > > Sent: 2019年8月14日 15:45
> > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > Cc: Wolfgang Denk <wd@denx.de>; Shengzhou Liu
> > > <shengzhou.liu@nxp.com>; Ruchika Gupta <ruchika.gupta@nxp.com>;
> > > Jagan Teki <jagan@openedev.com>; Simon Glass <sjg@chromium.org>;
> > > Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>; U-Boot-Denx
> > > <u-boot@lists.denx.de>; Pan Jiafei <Jiafei.Pan@freescale.com>
> > > Subject: [EXT] Re: [U-Boot] [PATCH v4 1/5] spl: dm: disable SPI DM
> > > flash for non-DM SPL
> > >
> > > Caution: EXT Email
> > >
> > > On Fri, Jun 21, 2019 at 7:51 AM Chuanhua Han <chuanhua.han@nxp.com>
> > > wrote:
> > > >
> > > > This patch solves the problem that spiboot cannot be performed in
> > > > non-DM SPL.
> > > >
> > > > Signed-off-by: Pan Jiafei <Jiafei.Pan@freescale.com>
> > > > Signed-off-by: Chuanhua Han <chuanhua.han@nxp.com>
> > > > ---
> > > > 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 c2f9735ce7..da94b3d9df 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
> > >
> > > Have you made any Travis-CI run?
> > I tested it with a local board
> 
> Could you be so kind and also test following patchset (parts from Layerscape
> also needs testing):
> https://patchwork.ozlabs.org/cover/1146494/
I don't quite understand this patch. How can I test it?
> 
> Which allows removal of
> #undef CONFIG_DM_SPI
> #undef CONFIG_DM_SPI_FLASH
> 
> and have the same configuration done via Kconfig ?

> 
> > _______________________________________________
> > U-Boot mailing list
> > U-Boot@lists.denx.de
> > https://lists.denx.de/listinfo/u-boot
> 
> 
> 
> 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@denx.de
Lukasz Majewski Aug. 14, 2019, 10:52 a.m. UTC | #6
On Wed, 14 Aug 2019 10:41:32 +0000
Chuanhua Han <chuanhua.han@nxp.com> wrote:

> > -----Original Message-----
> > From: Lukasz Majewski <lukma@denx.de>
> > Sent: 2019年8月14日 16:57
> > To: Chuanhua Han <chuanhua.han@nxp.com>
> > Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> > <xiaowei.bao@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>; Pan
> > Jiafei <Jiafei.Pan@freescale.com>; Jagan Teki <jagan@openedev.com>;
> > Ruchika Gupta <ruchika.gupta@nxp.com>
> > Subject: Re: [U-Boot] [EXT] Re: [PATCH v4 1/5] spl: dm: disable SPI
> > DM flash for non-DM SPL
> > 
> > Hi Chuanhua,
> >   
> > > > -----Original Message-----
> > > > From: Jagan Teki <jagan@amarulasolutions.com>
> > > > Sent: 2019年8月14日 15:45
> > > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > > Cc: Wolfgang Denk <wd@denx.de>; Shengzhou Liu
> > > > <shengzhou.liu@nxp.com>; Ruchika Gupta <ruchika.gupta@nxp.com>;
> > > > Jagan Teki <jagan@openedev.com>; Simon Glass <sjg@chromium.org>;
> > > > Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>; U-Boot-Denx
> > > > <u-boot@lists.denx.de>; Pan Jiafei <Jiafei.Pan@freescale.com>
> > > > Subject: [EXT] Re: [U-Boot] [PATCH v4 1/5] spl: dm: disable SPI
> > > > DM flash for non-DM SPL
> > > >
> > > > Caution: EXT Email
> > > >
> > > > On Fri, Jun 21, 2019 at 7:51 AM Chuanhua Han
> > > > <chuanhua.han@nxp.com> wrote:  
> > > > >
> > > > > This patch solves the problem that spiboot cannot be
> > > > > performed in non-DM SPL.
> > > > >
> > > > > Signed-off-by: Pan Jiafei <Jiafei.Pan@freescale.com>
> > > > > Signed-off-by: Chuanhua Han <chuanhua.han@nxp.com>
> > > > > ---
> > > > > 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 c2f9735ce7..da94b3d9df
> > > > > 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  
> > > >
> > > > Have you made any Travis-CI run?  
> > > I tested it with a local board  
> > 
> > Could you be so kind and also test following patchset (parts from
> > Layerscape also needs testing):
> > https://patchwork.ozlabs.org/cover/1146494/  
> I don't quite understand this patch. How can I test it?

You need to apply it first to -master branch.

Then apply your board code (or if it is already in mainline just remove
the #undef(s) from include/config_uncmd_spl.h)

As a last step - run make menuconfig and enable SPL_DM_SPI* flags.

> > 
> > Which allows removal of
> > #undef CONFIG_DM_SPI
> > #undef CONFIG_DM_SPI_FLASH
> > 
> > and have the same configuration done via Kconfig ?  
> 
> >   
> > > _______________________________________________
> > > U-Boot mailing list
> > > U-Boot@lists.denx.de
> > > https://lists.denx.de/listinfo/u-boot  
> > 
> > 
> > 
> > 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@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@denx.de
Chuanhua Han Aug. 14, 2019, 11:10 a.m. UTC | #7
> -----Original Message-----
> From: Lukasz Majewski <lukma@denx.de>
> Sent: 2019年8月14日 18:53
> To: Chuanhua Han <chuanhua.han@nxp.com>
> Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> <xiaowei.bao@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>; Pan Jiafei
> <Jiafei.Pan@freescale.com>; Jagan Teki <jagan@openedev.com>; Ruchika
> Gupta <ruchika.gupta@nxp.com>
> Subject: Re: [U-Boot] [EXT] Re: [PATCH v4 1/5] spl: dm: disable SPI DM flash for
> non-DM SPL
> 
> On Wed, 14 Aug 2019 10:41:32 +0000
> Chuanhua Han <chuanhua.han@nxp.com> wrote:
> 
> > > -----Original Message-----
> > > From: Lukasz Majewski <lukma@denx.de>
> > > Sent: 2019年8月14日 16:57
> > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> > > <xiaowei.bao@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>; Pan
> > > Jiafei <Jiafei.Pan@freescale.com>; Jagan Teki <jagan@openedev.com>;
> > > Ruchika Gupta <ruchika.gupta@nxp.com>
> > > Subject: Re: [U-Boot] [EXT] Re: [PATCH v4 1/5] spl: dm: disable SPI
> > > DM flash for non-DM SPL
> > >
> > > Hi Chuanhua,
> > >
> > > > > -----Original Message-----
> > > > > From: Jagan Teki <jagan@amarulasolutions.com>
> > > > > Sent: 2019年8月14日 15:45
> > > > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > > > Cc: Wolfgang Denk <wd@denx.de>; Shengzhou Liu
> > > > > <shengzhou.liu@nxp.com>; Ruchika Gupta <ruchika.gupta@nxp.com>;
> > > > > Jagan Teki <jagan@openedev.com>; Simon Glass <sjg@chromium.org>;
> > > > > Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>; U-Boot-Denx
> > > > > <u-boot@lists.denx.de>; Pan Jiafei <Jiafei.Pan@freescale.com>
> > > > > Subject: [EXT] Re: [U-Boot] [PATCH v4 1/5] spl: dm: disable SPI
> > > > > DM flash for non-DM SPL
> > > > >
> > > > > Caution: EXT Email
> > > > >
> > > > > On Fri, Jun 21, 2019 at 7:51 AM Chuanhua Han
> > > > > <chuanhua.han@nxp.com> wrote:
> > > > > >
> > > > > > This patch solves the problem that spiboot cannot be performed
> > > > > > in non-DM SPL.
> > > > > >
> > > > > > Signed-off-by: Pan Jiafei <Jiafei.Pan@freescale.com>
> > > > > > Signed-off-by: Chuanhua Han <chuanhua.han@nxp.com>
> > > > > > ---
> > > > > > 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 c2f9735ce7..da94b3d9df
> > > > > > 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
> > > > >
> > > > > Have you made any Travis-CI run?
> > > > I tested it with a local board
> > >
> > > Could you be so kind and also test following patchset (parts from
> > > Layerscape also needs testing):
> > > https://patchwork.ozlabs.org/cover/1146494/
> > I don't quite understand this patch. How can I test it?
> 
> You need to apply it first to -master branch.
> 
> Then apply your board code (or if it is already in mainline just remove
> the #undef(s) from include/config_uncmd_spl.h)
> 
> As a last step - run make menuconfig and enable SPL_DM_SPI* flags.
Currently, it is in the master, and SPI* in the #undef(s) from include/ uncmd_spl.h has been deleted, but an error was reported:
CC      spl/lib/display_options.o
drivers/spi/spi.c: In function 'spi_do_alloc_slave':
drivers/spi/spi.c:34:8: error: 'struct spi_slave' has no member named 'bus'
   slave->bus = bus;
        ^~
drivers/spi/spi.c:35:8: error: 'struct spi_slave' has no member named 'cs'
   slave->cs = cs;
        ^~
make[3]: *** [spl/drivers/spi/spi.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [spl/drivers/spi] Error 2
make[1]: *** [spl/drivers] Error 2
make[1]: *** Waiting for unfinished jobs....
  LD      spl/lib/built-in.o
make: *** [spl/u-boot-spl] Error 2

Do I need to modify a lot of files?
> 
> > >
> > > Which allows removal of
> > > #undef CONFIG_DM_SPI
> > > #undef CONFIG_DM_SPI_FLASH
> > >
> > > and have the same configuration done via Kconfig ?
> >
> > >
> > > > _______________________________________________
> > > > U-Boot mailing list
> > > > U-Boot@lists.denx.de
> > > > https://lists.denx.de/listinfo/u-boot
> > >
> > >
> > >
> > > 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@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@denx.de
Lukasz Majewski Aug. 14, 2019, 11:38 a.m. UTC | #8
On Wed, 14 Aug 2019 11:10:46 +0000
Chuanhua Han <chuanhua.han@nxp.com> wrote:

> > -----Original Message-----
> > From: Lukasz Majewski <lukma@denx.de>
> > Sent: 2019年8月14日 18:53
> > To: Chuanhua Han <chuanhua.han@nxp.com>
> > Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> > <xiaowei.bao@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>; Pan
> > Jiafei <Jiafei.Pan@freescale.com>; Jagan Teki <jagan@openedev.com>;
> > Ruchika Gupta <ruchika.gupta@nxp.com>
> > Subject: Re: [U-Boot] [EXT] Re: [PATCH v4 1/5] spl: dm: disable SPI
> > DM flash for non-DM SPL
> > 
> > On Wed, 14 Aug 2019 10:41:32 +0000
> > Chuanhua Han <chuanhua.han@nxp.com> wrote:
> >   
> > > > -----Original Message-----
> > > > From: Lukasz Majewski <lukma@denx.de>
> > > > Sent: 2019年8月14日 16:57
> > > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > > Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> > > > <xiaowei.bao@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>; Pan
> > > > Jiafei <Jiafei.Pan@freescale.com>; Jagan Teki
> > > > <jagan@openedev.com>; Ruchika Gupta <ruchika.gupta@nxp.com>
> > > > Subject: Re: [U-Boot] [EXT] Re: [PATCH v4 1/5] spl: dm: disable
> > > > SPI DM flash for non-DM SPL
> > > >
> > > > Hi Chuanhua,
> > > >  
> > > > > > -----Original Message-----
> > > > > > From: Jagan Teki <jagan@amarulasolutions.com>
> > > > > > Sent: 2019年8月14日 15:45
> > > > > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > > > > Cc: Wolfgang Denk <wd@denx.de>; Shengzhou Liu
> > > > > > <shengzhou.liu@nxp.com>; Ruchika Gupta
> > > > > > <ruchika.gupta@nxp.com>; Jagan Teki <jagan@openedev.com>;
> > > > > > Simon Glass <sjg@chromium.org>; Prabhakar Kushwaha
> > > > > > <prabhakar.kushwaha@nxp.com>; U-Boot-Denx
> > > > > > <u-boot@lists.denx.de>; Pan Jiafei
> > > > > > <Jiafei.Pan@freescale.com> Subject: [EXT] Re: [U-Boot]
> > > > > > [PATCH v4 1/5] spl: dm: disable SPI DM flash for non-DM SPL
> > > > > >
> > > > > > Caution: EXT Email
> > > > > >
> > > > > > On Fri, Jun 21, 2019 at 7:51 AM Chuanhua Han
> > > > > > <chuanhua.han@nxp.com> wrote:  
> > > > > > >
> > > > > > > This patch solves the problem that spiboot cannot be
> > > > > > > performed in non-DM SPL.
> > > > > > >
> > > > > > > Signed-off-by: Pan Jiafei <Jiafei.Pan@freescale.com>
> > > > > > > Signed-off-by: Chuanhua Han <chuanhua.han@nxp.com>
> > > > > > > ---
> > > > > > > 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 c2f9735ce7..da94b3d9df
> > > > > > > 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  
> > > > > >
> > > > > > Have you made any Travis-CI run?  
> > > > > I tested it with a local board  
> > > >
> > > > Could you be so kind and also test following patchset (parts
> > > > from Layerscape also needs testing):
> > > > https://patchwork.ozlabs.org/cover/1146494/  
> > > I don't quite understand this patch. How can I test it?  
> > 
> > You need to apply it first to -master branch.
> > 
> > Then apply your board code (or if it is already in mainline just
> > remove the #undef(s) from include/config_uncmd_spl.h)
> > 
> > As a last step - run make menuconfig and enable SPL_DM_SPI* flags.  
> Currently, it is in the master, and SPI* in the #undef(s) from
> include/ uncmd_spl.h has been deleted, but an error was reported: CC
>     spl/lib/display_options.o drivers/spi/spi.c: In function
> 'spi_do_alloc_slave': drivers/spi/spi.c:34:8: error: 'struct
> spi_slave' has no member named 'bus' slave->bus = bus;
>         ^~
> drivers/spi/spi.c:35:8: error: 'struct spi_slave' has no member named
> 'cs' slave->cs = cs;
>         ^~
> make[3]: *** [spl/drivers/spi/spi.o] Error 1
> make[3]: *** Waiting for unfinished jobs....
> make[2]: *** [spl/drivers/spi] Error 2
> make[1]: *** [spl/drivers] Error 2
> make[1]: *** Waiting for unfinished jobs....
>   LD      spl/lib/built-in.o
> make: *** [spl/u-boot-spl] Error 2

If your board is in mainline (master branch) it shall build without
issues:

Applied on top of -master branch:
'commit feb5a02f869d ("Merge branch 'master' of
git://git.denx.de/u-boot-sh")' Travis-CI (clean build):
https://travis-ci.org/lmajewski/u-boot-dfu/builds/570594278


The patch itself:
https://patchwork.ozlabs.org/patch/1146377/

> 
> Do I need to modify a lot of files?
> >   
> > > >
> > > > Which allows removal of
> > > > #undef CONFIG_DM_SPI
> > > > #undef CONFIG_DM_SPI_FLASH
> > > >
> > > > and have the same configuration done via Kconfig ?  
> > >  
> > > >  
> > > > > _______________________________________________
> > > > > U-Boot mailing list
> > > > > U-Boot@lists.denx.de
> > > > > https://lists.denx.de/listinfo/u-boot  
> > > >
> > > >
> > > >
> > > > 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@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@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@denx.de
Chuanhua Han Aug. 15, 2019, 3:35 a.m. UTC | #9
> -----Original Message-----
> From: Lukasz Majewski <lukma@denx.de>
> Sent: 2019年8月14日 19:39
> To: Chuanhua Han <chuanhua.han@nxp.com>
> Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> <xiaowei.bao@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>; Pan Jiafei
> <Jiafei.Pan@freescale.com>; Jagan Teki <jagan@openedev.com>; Ruchika
> Gupta <ruchika.gupta@nxp.com>
> Subject: Re: [U-Boot] [EXT] Re: [PATCH v4 1/5] spl: dm: disable SPI DM flash for
> non-DM SPL
> 
> On Wed, 14 Aug 2019 11:10:46 +0000
> Chuanhua Han <chuanhua.han@nxp.com> wrote:
> 
> > > -----Original Message-----
> > > From: Lukasz Majewski <lukma@denx.de>
> > > Sent: 2019年8月14日 18:53
> > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> > > <xiaowei.bao@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>; Pan
> > > Jiafei <Jiafei.Pan@freescale.com>; Jagan Teki <jagan@openedev.com>;
> > > Ruchika Gupta <ruchika.gupta@nxp.com>
> > > Subject: Re: [U-Boot] [EXT] Re: [PATCH v4 1/5] spl: dm: disable SPI
> > > DM flash for non-DM SPL
> > >
> > > On Wed, 14 Aug 2019 10:41:32 +0000
> > > Chuanhua Han <chuanhua.han@nxp.com> wrote:
> > >
> > > > > -----Original Message-----
> > > > > From: Lukasz Majewski <lukma@denx.de>
> > > > > Sent: 2019年8月14日 16:57
> > > > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > > > Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> > > > > <xiaowei.bao@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>; Pan
> > > > > Jiafei <Jiafei.Pan@freescale.com>; Jagan Teki
> > > > > <jagan@openedev.com>; Ruchika Gupta <ruchika.gupta@nxp.com>
> > > > > Subject: Re: [U-Boot] [EXT] Re: [PATCH v4 1/5] spl: dm: disable
> > > > > SPI DM flash for non-DM SPL
> > > > >
> > > > > Hi Chuanhua,
> > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Jagan Teki <jagan@amarulasolutions.com>
> > > > > > > Sent: 2019年8月14日 15:45
> > > > > > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > > > > > Cc: Wolfgang Denk <wd@denx.de>; Shengzhou Liu
> > > > > > > <shengzhou.liu@nxp.com>; Ruchika Gupta
> > > > > > > <ruchika.gupta@nxp.com>; Jagan Teki <jagan@openedev.com>;
> > > > > > > Simon Glass <sjg@chromium.org>; Prabhakar Kushwaha
> > > > > > > <prabhakar.kushwaha@nxp.com>; U-Boot-Denx
> > > > > > > <u-boot@lists.denx.de>; Pan Jiafei
> > > > > > > <Jiafei.Pan@freescale.com> Subject: [EXT] Re: [U-Boot]
> > > > > > > [PATCH v4 1/5] spl: dm: disable SPI DM flash for non-DM SPL
> > > > > > >
> > > > > > > Caution: EXT Email
> > > > > > >
> > > > > > > On Fri, Jun 21, 2019 at 7:51 AM Chuanhua Han
> > > > > > > <chuanhua.han@nxp.com> wrote:
> > > > > > > >
> > > > > > > > This patch solves the problem that spiboot cannot be
> > > > > > > > performed in non-DM SPL.
> > > > > > > >
> > > > > > > > Signed-off-by: Pan Jiafei <Jiafei.Pan@freescale.com>
> > > > > > > > Signed-off-by: Chuanhua Han <chuanhua.han@nxp.com>
> > > > > > > > ---
> > > > > > > > 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 c2f9735ce7..da94b3d9df
> > > > > > > > 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
> > > > > > >
> > > > > > > Have you made any Travis-CI run?
> > > > > > I tested it with a local board
> > > > >
> > > > > Could you be so kind and also test following patchset (parts
> > > > > from Layerscape also needs testing):
> > > > > https://patchwork.ozlabs.org/cover/1146494/
> > > > I don't quite understand this patch. How can I test it?
> > >
> > > You need to apply it first to -master branch.
> > >
> > > Then apply your board code (or if it is already in mainline just
> > > remove the #undef(s) from include/config_uncmd_spl.h)
> > >
> > > As a last step - run make menuconfig and enable SPL_DM_SPI* flags.
> > Currently, it is in the master, and SPI* in the #undef(s) from
> > include/ uncmd_spl.h has been deleted, but an error was reported: CC
> >     spl/lib/display_options.o drivers/spi/spi.c: In function
> > 'spi_do_alloc_slave': drivers/spi/spi.c:34:8: error: 'struct
> > spi_slave' has no member named 'bus' slave->bus = bus;
> >         ^~
> > drivers/spi/spi.c:35:8: error: 'struct spi_slave' has no member named
> > 'cs' slave->cs = cs;
> >         ^~
> > make[3]: *** [spl/drivers/spi/spi.o] Error 1
> > make[3]: *** Waiting for unfinished jobs....
> > make[2]: *** [spl/drivers/spi] Error 2
> > make[1]: *** [spl/drivers] Error 2
> > make[1]: *** Waiting for unfinished jobs....
> >   LD      spl/lib/built-in.o
> > make: *** [spl/u-boot-spl] Error 2
> 
> If your board is in mainline (master branch) it shall build without
> issues:
> 
> Applied on top of -master branch:
> 'commit feb5a02f869d ("Merge branch 'master' of
> git://git.denx.de/u-boot-sh")' Travis-CI (clean build):
> https://travis-ci.org/lmajewski/u-boot-dfu/builds/570594278
> 
> 
> The patch itself:
> https://patchwork.ozlabs.org/patch/1146377/
1. I git reset to this commit: feb5a02f869d
2. Your patch has been applied(https://patchwork.ozlabs.org/patch/1146377/)
3. Apply my current patch set
4. Include/uncmd_uncmd_spl.h file is deleted as follows:
- # undef CONFIG_DM_SPI
- # undef CONFIG_DM_SPI_FLASH
5. In include/configs/T208xQDS.h  file:
+/* SPI Flash Configs */
+ # if defined (CONFIG_SPL_BUILD)
+ # undef CONFIG_DM_SPI
+ # undef CONFIG_DM_SPI_FLASH
+ # undef CONFIG_SPI_FLASH_MTD
+ # endif
6. Make menuconfig:
Configuration 
CONFIG_SPL_DM_SPI = y
CONFIG_SPL_DM_SPI_FLASH = y
7. Compilation errors still occur:
LD      spl/lib/built-in.o
  LD      spl/u-boot-spl
drivers/built-in.o: In function `ofnode_read_u32':
/home/hanch/uboot/uboot-upstream/u-boot/drivers/core/ofnode.c:29: undefined reference to `fdt_getprop'
drivers/built-in.o: In function `ofnode_get_property':
/home/hanch/uboot/uboot-upstream/u-boot/drivers/core/ofnode.c:528: undefined reference to `fdt_getprop'
drivers/built-in.o: In function `blk_post_probe':
/home/hanch/uboot/uboot-upstream/u-boot/drivers/block/blk-uclass.c:655: undefined reference to `part_init'
drivers/built-in.o:(.u_boot_list_2_uclass_2_spi+0x8): undefined reference to `dm_scan_fdt_dev'
make[1]: *** [spl/u-boot-spl] Error 1
make: *** [spl/u-boot-spl] Error 2
> 
> >
> > Do I need to modify a lot of files?
> > >
> > > > >
> > > > > Which allows removal of
> > > > > #undef CONFIG_DM_SPI
> > > > > #undef CONFIG_DM_SPI_FLASH
> > > > >
> > > > > and have the same configuration done via Kconfig ?
> > > >
> > > > >
> > > > > > _______________________________________________
> > > > > > U-Boot mailing list
> > > > > > U-Boot@lists.denx.de
> > > > > > https://lists.denx.de/listinfo/u-boot
> > > > >
> > > > >
> > > > >
> > > > > 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@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@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@denx.de
Lukasz Majewski Aug. 15, 2019, 7:14 a.m. UTC | #10
On Thu, 15 Aug 2019 03:35:28 +0000
Chuanhua Han <chuanhua.han@nxp.com> wrote:

> > -----Original Message-----
> > From: Lukasz Majewski <lukma@denx.de>
> > Sent: 2019年8月14日 19:39
> > To: Chuanhua Han <chuanhua.han@nxp.com>
> > Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> > <xiaowei.bao@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>; Pan
> > Jiafei <Jiafei.Pan@freescale.com>; Jagan Teki <jagan@openedev.com>;
> > Ruchika Gupta <ruchika.gupta@nxp.com>
> > Subject: Re: [U-Boot] [EXT] Re: [PATCH v4 1/5] spl: dm: disable SPI
> > DM flash for non-DM SPL
> > 
> > On Wed, 14 Aug 2019 11:10:46 +0000
> > Chuanhua Han <chuanhua.han@nxp.com> wrote:
> >   
> > > > -----Original Message-----
> > > > From: Lukasz Majewski <lukma@denx.de>
> > > > Sent: 2019年8月14日 18:53
> > > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > > Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> > > > <xiaowei.bao@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>; Pan
> > > > Jiafei <Jiafei.Pan@freescale.com>; Jagan Teki
> > > > <jagan@openedev.com>; Ruchika Gupta <ruchika.gupta@nxp.com>
> > > > Subject: Re: [U-Boot] [EXT] Re: [PATCH v4 1/5] spl: dm: disable
> > > > SPI DM flash for non-DM SPL
> > > >
> > > > On Wed, 14 Aug 2019 10:41:32 +0000
> > > > Chuanhua Han <chuanhua.han@nxp.com> wrote:
> > > >  
> > > > > > -----Original Message-----
> > > > > > From: Lukasz Majewski <lukma@denx.de>
> > > > > > Sent: 2019年8月14日 16:57
> > > > > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > > > > Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> > > > > > <xiaowei.bao@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>;
> > > > > > Pan Jiafei <Jiafei.Pan@freescale.com>; Jagan Teki
> > > > > > <jagan@openedev.com>; Ruchika Gupta <ruchika.gupta@nxp.com>
> > > > > > Subject: Re: [U-Boot] [EXT] Re: [PATCH v4 1/5] spl: dm:
> > > > > > disable SPI DM flash for non-DM SPL
> > > > > >
> > > > > > Hi Chuanhua,
> > > > > >  
> > > > > > > > -----Original Message-----
> > > > > > > > From: Jagan Teki <jagan@amarulasolutions.com>
> > > > > > > > Sent: 2019年8月14日 15:45
> > > > > > > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > > > > > > Cc: Wolfgang Denk <wd@denx.de>; Shengzhou Liu
> > > > > > > > <shengzhou.liu@nxp.com>; Ruchika Gupta
> > > > > > > > <ruchika.gupta@nxp.com>; Jagan Teki
> > > > > > > > <jagan@openedev.com>; Simon Glass <sjg@chromium.org>;
> > > > > > > > Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>;
> > > > > > > > U-Boot-Denx <u-boot@lists.denx.de>; Pan Jiafei
> > > > > > > > <Jiafei.Pan@freescale.com> Subject: [EXT] Re: [U-Boot]
> > > > > > > > [PATCH v4 1/5] spl: dm: disable SPI DM flash for non-DM
> > > > > > > > SPL
> > > > > > > >
> > > > > > > > Caution: EXT Email
> > > > > > > >
> > > > > > > > On Fri, Jun 21, 2019 at 7:51 AM Chuanhua Han
> > > > > > > > <chuanhua.han@nxp.com> wrote:  
> > > > > > > > >
> > > > > > > > > This patch solves the problem that spiboot cannot be
> > > > > > > > > performed in non-DM SPL.
> > > > > > > > >
> > > > > > > > > Signed-off-by: Pan Jiafei <Jiafei.Pan@freescale.com>
> > > > > > > > > Signed-off-by: Chuanhua Han <chuanhua.han@nxp.com>
> > > > > > > > > ---
> > > > > > > > > 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
> > > > > > > > > c2f9735ce7..da94b3d9df 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  
> > > > > > > >
> > > > > > > > Have you made any Travis-CI run?  
> > > > > > > I tested it with a local board  
> > > > > >
> > > > > > Could you be so kind and also test following patchset (parts
> > > > > > from Layerscape also needs testing):
> > > > > > https://patchwork.ozlabs.org/cover/1146494/  
> > > > > I don't quite understand this patch. How can I test it?  
> > > >
> > > > You need to apply it first to -master branch.
> > > >
> > > > Then apply your board code (or if it is already in mainline just
> > > > remove the #undef(s) from include/config_uncmd_spl.h)
> > > >
> > > > As a last step - run make menuconfig and enable SPL_DM_SPI*
> > > > flags.  
> > > Currently, it is in the master, and SPI* in the #undef(s) from
> > > include/ uncmd_spl.h has been deleted, but an error was reported:
> > > CC spl/lib/display_options.o drivers/spi/spi.c: In function
> > > 'spi_do_alloc_slave': drivers/spi/spi.c:34:8: error: 'struct
> > > spi_slave' has no member named 'bus' slave->bus = bus;
> > >         ^~
> > > drivers/spi/spi.c:35:8: error: 'struct spi_slave' has no member
> > > named 'cs' slave->cs = cs;
> > >         ^~
> > > make[3]: *** [spl/drivers/spi/spi.o] Error 1
> > > make[3]: *** Waiting for unfinished jobs....
> > > make[2]: *** [spl/drivers/spi] Error 2
> > > make[1]: *** [spl/drivers] Error 2
> > > make[1]: *** Waiting for unfinished jobs....
> > >   LD      spl/lib/built-in.o
> > > make: *** [spl/u-boot-spl] Error 2  
> > 
> > If your board is in mainline (master branch) it shall build without
> > issues:
> > 
> > Applied on top of -master branch:
> > 'commit feb5a02f869d ("Merge branch 'master' of
> > git://git.denx.de/u-boot-sh")' Travis-CI (clean build):
> > https://travis-ci.org/lmajewski/u-boot-dfu/builds/570594278
> > 
> > 
> > The patch itself:
> > https://patchwork.ozlabs.org/patch/1146377/  
> 1. I git reset to this commit: feb5a02f869d
> 2. Your patch has been
> applied(https://patchwork.ozlabs.org/patch/1146377/) 

Could you check if your board (the code which is now in mainline)
compiles without issues at this step?

>3. Apply my
> current patch set 4. Include/uncmd_uncmd_spl.h file is deleted as
> follows:
> - # undef CONFIG_DM_SPI
> - # undef CONFIG_DM_SPI_FLASH
> 5. In include/configs/T208xQDS.h  file:
> +/* SPI Flash Configs */
> + # if defined (CONFIG_SPL_BUILD)
> + # undef CONFIG_DM_SPI
> + # undef CONFIG_DM_SPI_FLASH
> + # undef CONFIG_SPI_FLASH_MTD
> + # endif
> 6. Make menuconfig:
> Configuration 
> CONFIG_SPL_DM_SPI = y
> CONFIG_SPL_DM_SPI_FLASH = y
> 7. Compilation errors still occur:
> LD      spl/lib/built-in.o
>   LD      spl/u-boot-spl
> drivers/built-in.o: In function `ofnode_read_u32':
> /home/hanch/uboot/uboot-upstream/u-boot/drivers/core/ofnode.c:29:
> undefined reference to `fdt_getprop' drivers/built-in.o: In function
> `ofnode_get_property':
> /home/hanch/uboot/uboot-upstream/u-boot/drivers/core/ofnode.c:528:
> undefined reference to `fdt_getprop' drivers/built-in.o: In function
> `blk_post_probe':
> /home/hanch/uboot/uboot-upstream/u-boot/drivers/block/blk-uclass.c:655:
> undefined reference to `part_init'
> drivers/built-in.o:(.u_boot_list_2_uclass_2_spi+0x8): undefined
> reference to `dm_scan_fdt_dev' make[1]: *** [spl/u-boot-spl] Error 1
> make: *** [spl/u-boot-spl] Error 2
> >   
> > >
> > > Do I need to modify a lot of files?  
> > > >  
> > > > > >
> > > > > > Which allows removal of
> > > > > > #undef CONFIG_DM_SPI
> > > > > > #undef CONFIG_DM_SPI_FLASH
> > > > > >
> > > > > > and have the same configuration done via Kconfig ?  
> > > > >  
> > > > > >  
> > > > > > > _______________________________________________
> > > > > > > U-Boot mailing list
> > > > > > > U-Boot@lists.denx.de
> > > > > > > https://lists.denx.de/listinfo/u-boot  
> > > > > >
> > > > > >
> > > > > >
> > > > > > 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@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@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@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@denx.de
Chuanhua Han Aug. 15, 2019, 7:39 a.m. UTC | #11
> -----Original Message-----
> From: Lukasz Majewski <lukma@denx.de>
> Sent: 2019年8月15日 15:15
> To: Chuanhua Han <chuanhua.han@nxp.com>
> Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> <xiaowei.bao@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>; Pan Jiafei
> <Jiafei.Pan@freescale.com>; Jagan Teki <jagan@openedev.com>; Ruchika
> Gupta <ruchika.gupta@nxp.com>
> Subject: Re: [U-Boot] [EXT] Re: [PATCH v4 1/5] spl: dm: disable SPI DM flash for
> non-DM SPL
> 
> On Thu, 15 Aug 2019 03:35:28 +0000
> Chuanhua Han <chuanhua.han@nxp.com> wrote:
> 
> > > -----Original Message-----
> > > From: Lukasz Majewski <lukma@denx.de>
> > > Sent: 2019年8月14日 19:39
> > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> > > <xiaowei.bao@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>; Pan
> > > Jiafei <Jiafei.Pan@freescale.com>; Jagan Teki <jagan@openedev.com>;
> > > Ruchika Gupta <ruchika.gupta@nxp.com>
> > > Subject: Re: [U-Boot] [EXT] Re: [PATCH v4 1/5] spl: dm: disable SPI
> > > DM flash for non-DM SPL
> > >
> > > On Wed, 14 Aug 2019 11:10:46 +0000
> > > Chuanhua Han <chuanhua.han@nxp.com> wrote:
> > >
> > > > > -----Original Message-----
> > > > > From: Lukasz Majewski <lukma@denx.de>
> > > > > Sent: 2019年8月14日 18:53
> > > > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > > > Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> > > > > <xiaowei.bao@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>; Pan
> > > > > Jiafei <Jiafei.Pan@freescale.com>; Jagan Teki
> > > > > <jagan@openedev.com>; Ruchika Gupta <ruchika.gupta@nxp.com>
> > > > > Subject: Re: [U-Boot] [EXT] Re: [PATCH v4 1/5] spl: dm: disable
> > > > > SPI DM flash for non-DM SPL
> > > > >
> > > > > On Wed, 14 Aug 2019 10:41:32 +0000 Chuanhua Han
> > > > > <chuanhua.han@nxp.com> wrote:
> > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Lukasz Majewski <lukma@denx.de>
> > > > > > > Sent: 2019年8月14日 16:57
> > > > > > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > > > > > Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> > > > > > > <xiaowei.bao@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>;
> > > > > > > Pan Jiafei <Jiafei.Pan@freescale.com>; Jagan Teki
> > > > > > > <jagan@openedev.com>; Ruchika Gupta <ruchika.gupta@nxp.com>
> > > > > > > Subject: Re: [U-Boot] [EXT] Re: [PATCH v4 1/5] spl: dm:
> > > > > > > disable SPI DM flash for non-DM SPL
> > > > > > >
> > > > > > > Hi Chuanhua,
> > > > > > >
> > > > > > > > > -----Original Message-----
> > > > > > > > > From: Jagan Teki <jagan@amarulasolutions.com>
> > > > > > > > > Sent: 2019年8月14日 15:45
> > > > > > > > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > > > > > > > Cc: Wolfgang Denk <wd@denx.de>; Shengzhou Liu
> > > > > > > > > <shengzhou.liu@nxp.com>; Ruchika Gupta
> > > > > > > > > <ruchika.gupta@nxp.com>; Jagan Teki
> > > > > > > > > <jagan@openedev.com>; Simon Glass <sjg@chromium.org>;
> > > > > > > > > Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>;
> > > > > > > > > U-Boot-Denx <u-boot@lists.denx.de>; Pan Jiafei
> > > > > > > > > <Jiafei.Pan@freescale.com> Subject: [EXT] Re: [U-Boot]
> > > > > > > > > [PATCH v4 1/5] spl: dm: disable SPI DM flash for non-DM
> > > > > > > > > SPL
> > > > > > > > >
> > > > > > > > > Caution: EXT Email
> > > > > > > > >
> > > > > > > > > On Fri, Jun 21, 2019 at 7:51 AM Chuanhua Han
> > > > > > > > > <chuanhua.han@nxp.com> wrote:
> > > > > > > > > >
> > > > > > > > > > This patch solves the problem that spiboot cannot be
> > > > > > > > > > performed in non-DM SPL.
> > > > > > > > > >
> > > > > > > > > > Signed-off-by: Pan Jiafei <Jiafei.Pan@freescale.com>
> > > > > > > > > > Signed-off-by: Chuanhua Han <chuanhua.han@nxp.com>
> > > > > > > > > > ---
> > > > > > > > > > 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
> > > > > > > > > > c2f9735ce7..da94b3d9df 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
> > > > > > > > >
> > > > > > > > > Have you made any Travis-CI run?
> > > > > > > > I tested it with a local board
> > > > > > >
> > > > > > > Could you be so kind and also test following patchset (parts
> > > > > > > from Layerscape also needs testing):
> > > > > > > https://patchwork.ozlabs.org/cover/1146494/
> > > > > > I don't quite understand this patch. How can I test it?
> > > > >
> > > > > You need to apply it first to -master branch.
> > > > >
> > > > > Then apply your board code (or if it is already in mainline just
> > > > > remove the #undef(s) from include/config_uncmd_spl.h)
> > > > >
> > > > > As a last step - run make menuconfig and enable SPL_DM_SPI*
> > > > > flags.
> > > > Currently, it is in the master, and SPI* in the #undef(s) from
> > > > include/ uncmd_spl.h has been deleted, but an error was reported:
> > > > CC spl/lib/display_options.o drivers/spi/spi.c: In function
> > > > 'spi_do_alloc_slave': drivers/spi/spi.c:34:8: error: 'struct
> > > > spi_slave' has no member named 'bus' slave->bus = bus;
> > > >         ^~
> > > > drivers/spi/spi.c:35:8: error: 'struct spi_slave' has no member
> > > > named 'cs' slave->cs = cs;
> > > >         ^~
> > > > make[3]: *** [spl/drivers/spi/spi.o] Error 1
> > > > make[3]: *** Waiting for unfinished jobs....
> > > > make[2]: *** [spl/drivers/spi] Error 2
> > > > make[1]: *** [spl/drivers] Error 2
> > > > make[1]: *** Waiting for unfinished jobs....
> > > >   LD      spl/lib/built-in.o
> > > > make: *** [spl/u-boot-spl] Error 2
> > >
> > > If your board is in mainline (master branch) it shall build without
> > > issues:
> > >
> > > Applied on top of -master branch:
> > > 'commit feb5a02f869d ("Merge branch 'master' of
> > > git://git.denx.de/u-boot-sh")' Travis-CI (clean build):
> > > https://travis-ci.org/lmajewski/u-boot-dfu/builds/570594278
> > >
> > >
> > > The patch itself:
> > > https://patchwork.ozlabs.org/patch/1146377/
> > 1. I git reset to this commit: feb5a02f869d 2. Your patch has been
> > applied(https://patchwork.ozlabs.org/patch/1146377/)
> 
> Could you check if your board (the code which is now in mainline) compiles
> without issues at this step?
Yes,.no issue!(because this commit not support espi dm mode)
> 
> >3. Apply my
> > current patch set 4. Include/uncmd_uncmd_spl.h file is deleted as
> > follows:
> > - # undef CONFIG_DM_SPI
> > - # undef CONFIG_DM_SPI_FLASH
> > 5. In include/configs/T208xQDS.h  file:
> > +/* SPI Flash Configs */
> > + # if defined (CONFIG_SPL_BUILD)
> > + # undef CONFIG_DM_SPI
> > + # undef CONFIG_DM_SPI_FLASH
> > + # undef CONFIG_SPI_FLASH_MTD
> > + # endif
> > 6. Make menuconfig:
> > Configuration
> > CONFIG_SPL_DM_SPI = y
> > CONFIG_SPL_DM_SPI_FLASH = y
> > 7. Compilation errors still occur:
> > LD      spl/lib/built-in.o
> >   LD      spl/u-boot-spl
> > drivers/built-in.o: In function `ofnode_read_u32':
> > /home/hanch/uboot/uboot-upstream/u-boot/drivers/core/ofnode.c:29:
> > undefined reference to `fdt_getprop' drivers/built-in.o: In function
> > `ofnode_get_property':
> > /home/hanch/uboot/uboot-upstream/u-boot/drivers/core/ofnode.c:528:
> > undefined reference to `fdt_getprop' drivers/built-in.o: In function
> > `blk_post_probe':
> > /home/hanch/uboot/uboot-upstream/u-boot/drivers/block/blk-uclass.c:655:
> > undefined reference to `part_init'
> > drivers/built-in.o:(.u_boot_list_2_uclass_2_spi+0x8): undefined
> > reference to `dm_scan_fdt_dev' make[1]: *** [spl/u-boot-spl] Error 1
> > make: *** [spl/u-boot-spl] Error 2
> > >
> > > >
> > > > Do I need to modify a lot of files?
> > > > >
> > > > > > >
> > > > > > > Which allows removal of
> > > > > > > #undef CONFIG_DM_SPI
> > > > > > > #undef CONFIG_DM_SPI_FLASH
> > > > > > >
> > > > > > > and have the same configuration done via Kconfig ?
> > > > > >
> > > > > > >
> > > > > > > > _______________________________________________
> > > > > > > > U-Boot mailing list
> > > > > > > > U-Boot@lists.denx.de
> > > > > > > > https://lists.denx.de/listinfo/u-boot
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > 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@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@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@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@denx.de
Lukasz Majewski Aug. 15, 2019, 7:53 a.m. UTC | #12
On Thu, 15 Aug 2019 07:39:45 +0000
Chuanhua Han <chuanhua.han@nxp.com> wrote:

> > -----Original Message-----
> > From: Lukasz Majewski <lukma@denx.de>
> > Sent: 2019年8月15日 15:15
> > To: Chuanhua Han <chuanhua.han@nxp.com>
> > Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> > <xiaowei.bao@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>; Pan
> > Jiafei <Jiafei.Pan@freescale.com>; Jagan Teki <jagan@openedev.com>;
> > Ruchika Gupta <ruchika.gupta@nxp.com>
> > Subject: Re: [U-Boot] [EXT] Re: [PATCH v4 1/5] spl: dm: disable SPI
> > DM flash for non-DM SPL
> > 
> > On Thu, 15 Aug 2019 03:35:28 +0000
> > Chuanhua Han <chuanhua.han@nxp.com> wrote:
> >   
> > > > -----Original Message-----
> > > > From: Lukasz Majewski <lukma@denx.de>
> > > > Sent: 2019年8月14日 19:39
> > > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > > Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> > > > <xiaowei.bao@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>; Pan
> > > > Jiafei <Jiafei.Pan@freescale.com>; Jagan Teki
> > > > <jagan@openedev.com>; Ruchika Gupta <ruchika.gupta@nxp.com>
> > > > Subject: Re: [U-Boot] [EXT] Re: [PATCH v4 1/5] spl: dm: disable
> > > > SPI DM flash for non-DM SPL
> > > >
> > > > On Wed, 14 Aug 2019 11:10:46 +0000
> > > > Chuanhua Han <chuanhua.han@nxp.com> wrote:
> > > >  
> > > > > > -----Original Message-----
> > > > > > From: Lukasz Majewski <lukma@denx.de>
> > > > > > Sent: 2019年8月14日 18:53
> > > > > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > > > > Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> > > > > > <xiaowei.bao@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>;
> > > > > > Pan Jiafei <Jiafei.Pan@freescale.com>; Jagan Teki
> > > > > > <jagan@openedev.com>; Ruchika Gupta <ruchika.gupta@nxp.com>
> > > > > > Subject: Re: [U-Boot] [EXT] Re: [PATCH v4 1/5] spl: dm:
> > > > > > disable SPI DM flash for non-DM SPL
> > > > > >
> > > > > > On Wed, 14 Aug 2019 10:41:32 +0000 Chuanhua Han
> > > > > > <chuanhua.han@nxp.com> wrote:
> > > > > >  
> > > > > > > > -----Original Message-----
> > > > > > > > From: Lukasz Majewski <lukma@denx.de>
> > > > > > > > Sent: 2019年8月14日 16:57
> > > > > > > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > > > > > > Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> > > > > > > > <xiaowei.bao@nxp.com>; U-Boot-Denx
> > > > > > > > <u-boot@lists.denx.de>; Pan Jiafei
> > > > > > > > <Jiafei.Pan@freescale.com>; Jagan Teki
> > > > > > > > <jagan@openedev.com>; Ruchika Gupta
> > > > > > > > <ruchika.gupta@nxp.com> Subject: Re: [U-Boot] [EXT] Re:
> > > > > > > > [PATCH v4 1/5] spl: dm: disable SPI DM flash for non-DM
> > > > > > > > SPL
> > > > > > > >
> > > > > > > > Hi Chuanhua,
> > > > > > > >  
> > > > > > > > > > -----Original Message-----
> > > > > > > > > > From: Jagan Teki <jagan@amarulasolutions.com>
> > > > > > > > > > Sent: 2019年8月14日 15:45
> > > > > > > > > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > > > > > > > > Cc: Wolfgang Denk <wd@denx.de>; Shengzhou Liu
> > > > > > > > > > <shengzhou.liu@nxp.com>; Ruchika Gupta
> > > > > > > > > > <ruchika.gupta@nxp.com>; Jagan Teki
> > > > > > > > > > <jagan@openedev.com>; Simon Glass
> > > > > > > > > > <sjg@chromium.org>; Prabhakar Kushwaha
> > > > > > > > > > <prabhakar.kushwaha@nxp.com>; U-Boot-Denx
> > > > > > > > > > <u-boot@lists.denx.de>; Pan Jiafei
> > > > > > > > > > <Jiafei.Pan@freescale.com> Subject: [EXT] Re:
> > > > > > > > > > [U-Boot] [PATCH v4 1/5] spl: dm: disable SPI DM
> > > > > > > > > > flash for non-DM SPL
> > > > > > > > > >
> > > > > > > > > > Caution: EXT Email
> > > > > > > > > >
> > > > > > > > > > On Fri, Jun 21, 2019 at 7:51 AM Chuanhua Han
> > > > > > > > > > <chuanhua.han@nxp.com> wrote:  
> > > > > > > > > > >
> > > > > > > > > > > This patch solves the problem that spiboot cannot
> > > > > > > > > > > be performed in non-DM SPL.
> > > > > > > > > > >
> > > > > > > > > > > Signed-off-by: Pan Jiafei
> > > > > > > > > > > <Jiafei.Pan@freescale.com> Signed-off-by:
> > > > > > > > > > > Chuanhua Han <chuanhua.han@nxp.com> ---
> > > > > > > > > > > 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
> > > > > > > > > > > c2f9735ce7..da94b3d9df 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  
> > > > > > > > > >
> > > > > > > > > > Have you made any Travis-CI run?  
> > > > > > > > > I tested it with a local board  
> > > > > > > >
> > > > > > > > Could you be so kind and also test following patchset
> > > > > > > > (parts from Layerscape also needs testing):
> > > > > > > > https://patchwork.ozlabs.org/cover/1146494/  
> > > > > > > I don't quite understand this patch. How can I test it?  
> > > > > >
> > > > > > You need to apply it first to -master branch.
> > > > > >
> > > > > > Then apply your board code (or if it is already in mainline
> > > > > > just remove the #undef(s) from include/config_uncmd_spl.h)
> > > > > >
> > > > > > As a last step - run make menuconfig and enable SPL_DM_SPI*
> > > > > > flags.  
> > > > > Currently, it is in the master, and SPI* in the #undef(s) from
> > > > > include/ uncmd_spl.h has been deleted, but an error was
> > > > > reported: CC spl/lib/display_options.o drivers/spi/spi.c: In
> > > > > function 'spi_do_alloc_slave': drivers/spi/spi.c:34:8: error:
> > > > > 'struct spi_slave' has no member named 'bus' slave->bus = bus;
> > > > >         ^~
> > > > > drivers/spi/spi.c:35:8: error: 'struct spi_slave' has no
> > > > > member named 'cs' slave->cs = cs;
> > > > >         ^~
> > > > > make[3]: *** [spl/drivers/spi/spi.o] Error 1
> > > > > make[3]: *** Waiting for unfinished jobs....
> > > > > make[2]: *** [spl/drivers/spi] Error 2
> > > > > make[1]: *** [spl/drivers] Error 2
> > > > > make[1]: *** Waiting for unfinished jobs....
> > > > >   LD      spl/lib/built-in.o
> > > > > make: *** [spl/u-boot-spl] Error 2  
> > > >
> > > > If your board is in mainline (master branch) it shall build
> > > > without issues:
> > > >
> > > > Applied on top of -master branch:
> > > > 'commit feb5a02f869d ("Merge branch 'master' of
> > > > git://git.denx.de/u-boot-sh")' Travis-CI (clean build):
> > > > https://travis-ci.org/lmajewski/u-boot-dfu/builds/570594278
> > > >
> > > >
> > > > The patch itself:
> > > > https://patchwork.ozlabs.org/patch/1146377/  
> > > 1. I git reset to this commit: feb5a02f869d 2. Your patch has been
> > > applied(https://patchwork.ozlabs.org/patch/1146377/)  
> > 
> > Could you check if your board (the code which is now in mainline)
> > compiles without issues at this step?  
> Yes,.no issue!(because this commit not support espi dm mode)

Ok.

> >   
> > >3. Apply my
> > > current patch set 4. Include/uncmd_uncmd_spl.h file is deleted as
> > > follows:
> > > - # undef CONFIG_DM_SPI
> > > - # undef CONFIG_DM_SPI_FLASH
> > > 5. In include/configs/T208xQDS.h  file:
> > > +/* SPI Flash Configs */
> > > + # if defined (CONFIG_SPL_BUILD)
> > > + # undef CONFIG_DM_SPI
> > > + # undef CONFIG_DM_SPI_FLASH
> > > + # undef CONFIG_SPI_FLASH_MTD

Setting #undef in config file causes !CONFIG_IS_ENABLED(FOO), to
malfunction as the FOO is not set in .config.

> > > + # endif
> > > 6. Make menuconfig:
> > > Configuration
> > > CONFIG_SPL_DM_SPI = y
> > > CONFIG_SPL_DM_SPI_FLASH = y
> > > 7. Compilation errors still occur:
> > > LD      spl/lib/built-in.o
> > >   LD      spl/u-boot-spl
> > > drivers/built-in.o: In function `ofnode_read_u32':
> > > /home/hanch/uboot/uboot-upstream/u-boot/drivers/core/ofnode.c:29:
> > > undefined reference to `fdt_getprop' drivers/built-in.o: In
> > > function `ofnode_get_property':
> > > /home/hanch/uboot/uboot-upstream/u-boot/drivers/core/ofnode.c:528:
> > > undefined reference to `fdt_getprop' drivers/built-in.o: In
> > > function `blk_post_probe':
> > > /home/hanch/uboot/uboot-upstream/u-boot/drivers/block/blk-uclass.c:655:
> > > undefined reference to `part_init'
> > > drivers/built-in.o:(.u_boot_list_2_uclass_2_spi+0x8): undefined
> > > reference to `dm_scan_fdt_dev' make[1]: *** [spl/u-boot-spl]
> > > Error 1 make: *** [spl/u-boot-spl] Error 2  
> > > >  
> > > > >
> > > > > Do I need to modify a lot of files?  
> > > > > >  
> > > > > > > >
> > > > > > > > Which allows removal of
> > > > > > > > #undef CONFIG_DM_SPI
> > > > > > > > #undef CONFIG_DM_SPI_FLASH
> > > > > > > >
> > > > > > > > and have the same configuration done via Kconfig ?  
> > > > > > >  
> > > > > > > >  
> > > > > > > > > _______________________________________________
> > > > > > > > > U-Boot mailing list
> > > > > > > > > U-Boot@lists.denx.de
> > > > > > > > > https://lists.denx.de/listinfo/u-boot  
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > 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@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@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@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@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@denx.de
Chuanhua Han Aug. 15, 2019, 7:57 a.m. UTC | #13
> -----Original Message-----
> From: Lukasz Majewski <lukma@denx.de>
> Sent: 2019年8月15日 15:54
> To: Chuanhua Han <chuanhua.han@nxp.com>
> Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> <xiaowei.bao@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>; Pan Jiafei
> <Jiafei.Pan@freescale.com>; Jagan Teki <jagan@openedev.com>; Ruchika
> Gupta <ruchika.gupta@nxp.com>
> Subject: Re: [U-Boot] [EXT] Re: [PATCH v4 1/5] spl: dm: disable SPI DM flash for
> non-DM SPL
> 
> On Thu, 15 Aug 2019 07:39:45 +0000
> Chuanhua Han <chuanhua.han@nxp.com> wrote:
> 
> > > -----Original Message-----
> > > From: Lukasz Majewski <lukma@denx.de>
> > > Sent: 2019年8月15日 15:15
> > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> > > <xiaowei.bao@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>; Pan
> > > Jiafei <Jiafei.Pan@freescale.com>; Jagan Teki <jagan@openedev.com>;
> > > Ruchika Gupta <ruchika.gupta@nxp.com>
> > > Subject: Re: [U-Boot] [EXT] Re: [PATCH v4 1/5] spl: dm: disable SPI
> > > DM flash for non-DM SPL
> > >
> > > On Thu, 15 Aug 2019 03:35:28 +0000
> > > Chuanhua Han <chuanhua.han@nxp.com> wrote:
> > >
> > > > > -----Original Message-----
> > > > > From: Lukasz Majewski <lukma@denx.de>
> > > > > Sent: 2019年8月14日 19:39
> > > > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > > > Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> > > > > <xiaowei.bao@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>; Pan
> > > > > Jiafei <Jiafei.Pan@freescale.com>; Jagan Teki
> > > > > <jagan@openedev.com>; Ruchika Gupta <ruchika.gupta@nxp.com>
> > > > > Subject: Re: [U-Boot] [EXT] Re: [PATCH v4 1/5] spl: dm: disable
> > > > > SPI DM flash for non-DM SPL
> > > > >
> > > > > On Wed, 14 Aug 2019 11:10:46 +0000 Chuanhua Han
> > > > > <chuanhua.han@nxp.com> wrote:
> > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Lukasz Majewski <lukma@denx.de>
> > > > > > > Sent: 2019年8月14日 18:53
> > > > > > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > > > > > Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> > > > > > > <xiaowei.bao@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>;
> > > > > > > Pan Jiafei <Jiafei.Pan@freescale.com>; Jagan Teki
> > > > > > > <jagan@openedev.com>; Ruchika Gupta <ruchika.gupta@nxp.com>
> > > > > > > Subject: Re: [U-Boot] [EXT] Re: [PATCH v4 1/5] spl: dm:
> > > > > > > disable SPI DM flash for non-DM SPL
> > > > > > >
> > > > > > > On Wed, 14 Aug 2019 10:41:32 +0000 Chuanhua Han
> > > > > > > <chuanhua.han@nxp.com> wrote:
> > > > > > >
> > > > > > > > > -----Original Message-----
> > > > > > > > > From: Lukasz Majewski <lukma@denx.de>
> > > > > > > > > Sent: 2019年8月14日 16:57
> > > > > > > > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > > > > > > > Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> > > > > > > > > <xiaowei.bao@nxp.com>; U-Boot-Denx
> > > > > > > > > <u-boot@lists.denx.de>; Pan Jiafei
> > > > > > > > > <Jiafei.Pan@freescale.com>; Jagan Teki
> > > > > > > > > <jagan@openedev.com>; Ruchika Gupta
> > > > > > > > > <ruchika.gupta@nxp.com> Subject: Re: [U-Boot] [EXT] Re:
> > > > > > > > > [PATCH v4 1/5] spl: dm: disable SPI DM flash for non-DM
> > > > > > > > > SPL
> > > > > > > > >
> > > > > > > > > Hi Chuanhua,
> > > > > > > > >
> > > > > > > > > > > -----Original Message-----
> > > > > > > > > > > From: Jagan Teki <jagan@amarulasolutions.com>
> > > > > > > > > > > Sent: 2019年8月14日 15:45
> > > > > > > > > > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > > > > > > > > > Cc: Wolfgang Denk <wd@denx.de>; Shengzhou Liu
> > > > > > > > > > > <shengzhou.liu@nxp.com>; Ruchika Gupta
> > > > > > > > > > > <ruchika.gupta@nxp.com>; Jagan Teki
> > > > > > > > > > > <jagan@openedev.com>; Simon Glass
> > > > > > > > > > > <sjg@chromium.org>; Prabhakar Kushwaha
> > > > > > > > > > > <prabhakar.kushwaha@nxp.com>; U-Boot-Denx
> > > > > > > > > > > <u-boot@lists.denx.de>; Pan Jiafei
> > > > > > > > > > > <Jiafei.Pan@freescale.com> Subject: [EXT] Re:
> > > > > > > > > > > [U-Boot] [PATCH v4 1/5] spl: dm: disable SPI DM
> > > > > > > > > > > flash for non-DM SPL
> > > > > > > > > > >
> > > > > > > > > > > Caution: EXT Email
> > > > > > > > > > >
> > > > > > > > > > > On Fri, Jun 21, 2019 at 7:51 AM Chuanhua Han
> > > > > > > > > > > <chuanhua.han@nxp.com> wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > This patch solves the problem that spiboot cannot
> > > > > > > > > > > > be performed in non-DM SPL.
> > > > > > > > > > > >
> > > > > > > > > > > > Signed-off-by: Pan Jiafei
> > > > > > > > > > > > <Jiafei.Pan@freescale.com> Signed-off-by:
> > > > > > > > > > > > Chuanhua Han <chuanhua.han@nxp.com> --- 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
> > > > > > > > > > > > c2f9735ce7..da94b3d9df 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
> > > > > > > > > > >
> > > > > > > > > > > Have you made any Travis-CI run?
> > > > > > > > > > I tested it with a local board
> > > > > > > > >
> > > > > > > > > Could you be so kind and also test following patchset
> > > > > > > > > (parts from Layerscape also needs testing):
> > > > > > > > > https://patchwork.ozlabs.org/cover/1146494/
> > > > > > > > I don't quite understand this patch. How can I test it?
> > > > > > >
> > > > > > > You need to apply it first to -master branch.
> > > > > > >
> > > > > > > Then apply your board code (or if it is already in mainline
> > > > > > > just remove the #undef(s) from include/config_uncmd_spl.h)
> > > > > > >
> > > > > > > As a last step - run make menuconfig and enable SPL_DM_SPI*
> > > > > > > flags.
> > > > > > Currently, it is in the master, and SPI* in the #undef(s) from
> > > > > > include/ uncmd_spl.h has been deleted, but an error was
> > > > > > reported: CC spl/lib/display_options.o drivers/spi/spi.c: In
> > > > > > function 'spi_do_alloc_slave': drivers/spi/spi.c:34:8: error:
> > > > > > 'struct spi_slave' has no member named 'bus' slave->bus = bus;
> > > > > >         ^~
> > > > > > drivers/spi/spi.c:35:8: error: 'struct spi_slave' has no
> > > > > > member named 'cs' slave->cs = cs;
> > > > > >         ^~
> > > > > > make[3]: *** [spl/drivers/spi/spi.o] Error 1
> > > > > > make[3]: *** Waiting for unfinished jobs....
> > > > > > make[2]: *** [spl/drivers/spi] Error 2
> > > > > > make[1]: *** [spl/drivers] Error 2
> > > > > > make[1]: *** Waiting for unfinished jobs....
> > > > > >   LD      spl/lib/built-in.o
> > > > > > make: *** [spl/u-boot-spl] Error 2
> > > > >
> > > > > If your board is in mainline (master branch) it shall build
> > > > > without issues:
> > > > >
> > > > > Applied on top of -master branch:
> > > > > 'commit feb5a02f869d ("Merge branch 'master' of
> > > > > git://git.denx.de/u-boot-sh")' Travis-CI (clean build):
> > > > > https://travis-ci.org/lmajewski/u-boot-dfu/builds/570594278
> > > > >
> > > > >
> > > > > The patch itself:
> > > > > https://patchwork.ozlabs.org/patch/1146377/
> > > > 1. I git reset to this commit: feb5a02f869d 2. Your patch has been
> > > > applied(https://patchwork.ozlabs.org/patch/1146377/)
> > >
> > > Could you check if your board (the code which is now in mainline)
> > > compiles without issues at this step?
> > Yes,.no issue!(because this commit not support espi dm mode)
> 
> Ok.
> 
> > >
> > > >3. Apply my
> > > > current patch set 4. Include/uncmd_uncmd_spl.h file is deleted as
> > > > follows:
> > > > - # undef CONFIG_DM_SPI
> > > > - # undef CONFIG_DM_SPI_FLASH
> > > > 5. In include/configs/T208xQDS.h  file:
> > > > +/* SPI Flash Configs */
> > > > + # if defined (CONFIG_SPL_BUILD)
> > > > + # undef CONFIG_DM_SPI
> > > > + # undef CONFIG_DM_SPI_FLASH
> > > > + # undef CONFIG_SPI_FLASH_MTD
> 
> Setting #undef in config file causes !CONFIG_IS_ENABLED(FOO), to
> malfunction as the FOO is not set in .config.
So I need to put these #undef's in a Kconfig file, right?
> 
> > > > + # endif
> > > > 6. Make menuconfig:
> > > > Configuration
> > > > CONFIG_SPL_DM_SPI = y
> > > > CONFIG_SPL_DM_SPI_FLASH = y
> > > > 7. Compilation errors still occur:
> > > > LD      spl/lib/built-in.o
> > > >   LD      spl/u-boot-spl
> > > > drivers/built-in.o: In function `ofnode_read_u32':
> > > > /home/hanch/uboot/uboot-upstream/u-boot/drivers/core/ofnode.c:29:
> > > > undefined reference to `fdt_getprop' drivers/built-in.o: In
> > > > function `ofnode_get_property':
> > > > /home/hanch/uboot/uboot-upstream/u-boot/drivers/core/ofnode.c:528:
> > > > undefined reference to `fdt_getprop' drivers/built-in.o: In
> > > > function `blk_post_probe':
> > > >
> /home/hanch/uboot/uboot-upstream/u-boot/drivers/block/blk-uclass.c:655:
> > > > undefined reference to `part_init'
> > > > drivers/built-in.o:(.u_boot_list_2_uclass_2_spi+0x8): undefined
> > > > reference to `dm_scan_fdt_dev' make[1]: *** [spl/u-boot-spl]
> > > > Error 1 make: *** [spl/u-boot-spl] Error 2
> > > > >
> > > > > >
> > > > > > Do I need to modify a lot of files?
> > > > > > >
> > > > > > > > >
> > > > > > > > > Which allows removal of
> > > > > > > > > #undef CONFIG_DM_SPI
> > > > > > > > > #undef CONFIG_DM_SPI_FLASH
> > > > > > > > >
> > > > > > > > > and have the same configuration done via Kconfig ?
> > > > > > > >
> > > > > > > > >
> > > > > > > > > > _______________________________________________
> > > > > > > > > > U-Boot mailing list
> > > > > > > > > > U-Boot@lists.denx.de
> > > > > > > > > > https://lists.denx.de/listinfo/u-boot
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > 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@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@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@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@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@denx.de
Lukasz Majewski Aug. 15, 2019, 8:12 a.m. UTC | #14
On Thu, 15 Aug 2019 07:57:00 +0000
Chuanhua Han <chuanhua.han@nxp.com> wrote:

> > -----Original Message-----
> > From: Lukasz Majewski <lukma@denx.de>
> > Sent: 2019年8月15日 15:54
> > To: Chuanhua Han <chuanhua.han@nxp.com>
> > Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> > <xiaowei.bao@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>; Pan
> > Jiafei <Jiafei.Pan@freescale.com>; Jagan Teki <jagan@openedev.com>;
> > Ruchika Gupta <ruchika.gupta@nxp.com>
> > Subject: Re: [U-Boot] [EXT] Re: [PATCH v4 1/5] spl: dm: disable SPI
> > DM flash for non-DM SPL
> > 
> > On Thu, 15 Aug 2019 07:39:45 +0000
> > Chuanhua Han <chuanhua.han@nxp.com> wrote:
> >   
> > > > -----Original Message-----
> > > > From: Lukasz Majewski <lukma@denx.de>
> > > > Sent: 2019年8月15日 15:15
> > > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > > Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> > > > <xiaowei.bao@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>; Pan
> > > > Jiafei <Jiafei.Pan@freescale.com>; Jagan Teki
> > > > <jagan@openedev.com>; Ruchika Gupta <ruchika.gupta@nxp.com>
> > > > Subject: Re: [U-Boot] [EXT] Re: [PATCH v4 1/5] spl: dm: disable
> > > > SPI DM flash for non-DM SPL
> > > >
> > > > On Thu, 15 Aug 2019 03:35:28 +0000
> > > > Chuanhua Han <chuanhua.han@nxp.com> wrote:
> > > >  
> > > > > > -----Original Message-----
> > > > > > From: Lukasz Majewski <lukma@denx.de>
> > > > > > Sent: 2019年8月14日 19:39
> > > > > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > > > > Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> > > > > > <xiaowei.bao@nxp.com>; U-Boot-Denx <u-boot@lists.denx.de>;
> > > > > > Pan Jiafei <Jiafei.Pan@freescale.com>; Jagan Teki
> > > > > > <jagan@openedev.com>; Ruchika Gupta <ruchika.gupta@nxp.com>
> > > > > > Subject: Re: [U-Boot] [EXT] Re: [PATCH v4 1/5] spl: dm:
> > > > > > disable SPI DM flash for non-DM SPL
> > > > > >
> > > > > > On Wed, 14 Aug 2019 11:10:46 +0000 Chuanhua Han
> > > > > > <chuanhua.han@nxp.com> wrote:
> > > > > >  
> > > > > > > > -----Original Message-----
> > > > > > > > From: Lukasz Majewski <lukma@denx.de>
> > > > > > > > Sent: 2019年8月14日 18:53
> > > > > > > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > > > > > > Cc: Jagan Teki <jagan@amarulasolutions.com>; Xiaowei Bao
> > > > > > > > <xiaowei.bao@nxp.com>; U-Boot-Denx
> > > > > > > > <u-boot@lists.denx.de>; Pan Jiafei
> > > > > > > > <Jiafei.Pan@freescale.com>; Jagan Teki
> > > > > > > > <jagan@openedev.com>; Ruchika Gupta
> > > > > > > > <ruchika.gupta@nxp.com> Subject: Re: [U-Boot] [EXT] Re:
> > > > > > > > [PATCH v4 1/5] spl: dm: disable SPI DM flash for non-DM
> > > > > > > > SPL
> > > > > > > >
> > > > > > > > On Wed, 14 Aug 2019 10:41:32 +0000 Chuanhua Han
> > > > > > > > <chuanhua.han@nxp.com> wrote:
> > > > > > > >  
> > > > > > > > > > -----Original Message-----
> > > > > > > > > > From: Lukasz Majewski <lukma@denx.de>
> > > > > > > > > > Sent: 2019年8月14日 16:57
> > > > > > > > > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > > > > > > > > Cc: Jagan Teki <jagan@amarulasolutions.com>;
> > > > > > > > > > Xiaowei Bao <xiaowei.bao@nxp.com>; U-Boot-Denx
> > > > > > > > > > <u-boot@lists.denx.de>; Pan Jiafei
> > > > > > > > > > <Jiafei.Pan@freescale.com>; Jagan Teki
> > > > > > > > > > <jagan@openedev.com>; Ruchika Gupta
> > > > > > > > > > <ruchika.gupta@nxp.com> Subject: Re: [U-Boot] [EXT]
> > > > > > > > > > Re: [PATCH v4 1/5] spl: dm: disable SPI DM flash
> > > > > > > > > > for non-DM SPL
> > > > > > > > > >
> > > > > > > > > > Hi Chuanhua,
> > > > > > > > > >  
> > > > > > > > > > > > -----Original Message-----
> > > > > > > > > > > > From: Jagan Teki <jagan@amarulasolutions.com>
> > > > > > > > > > > > Sent: 2019年8月14日 15:45
> > > > > > > > > > > > To: Chuanhua Han <chuanhua.han@nxp.com>
> > > > > > > > > > > > Cc: Wolfgang Denk <wd@denx.de>; Shengzhou Liu
> > > > > > > > > > > > <shengzhou.liu@nxp.com>; Ruchika Gupta
> > > > > > > > > > > > <ruchika.gupta@nxp.com>; Jagan Teki
> > > > > > > > > > > > <jagan@openedev.com>; Simon Glass
> > > > > > > > > > > > <sjg@chromium.org>; Prabhakar Kushwaha
> > > > > > > > > > > > <prabhakar.kushwaha@nxp.com>; U-Boot-Denx
> > > > > > > > > > > > <u-boot@lists.denx.de>; Pan Jiafei
> > > > > > > > > > > > <Jiafei.Pan@freescale.com> Subject: [EXT] Re:
> > > > > > > > > > > > [U-Boot] [PATCH v4 1/5] spl: dm: disable SPI DM
> > > > > > > > > > > > flash for non-DM SPL
> > > > > > > > > > > >
> > > > > > > > > > > > Caution: EXT Email
> > > > > > > > > > > >
> > > > > > > > > > > > On Fri, Jun 21, 2019 at 7:51 AM Chuanhua Han
> > > > > > > > > > > > <chuanhua.han@nxp.com> wrote:  
> > > > > > > > > > > > >
> > > > > > > > > > > > > This patch solves the problem that spiboot
> > > > > > > > > > > > > cannot be performed in non-DM SPL.
> > > > > > > > > > > > >
> > > > > > > > > > > > > Signed-off-by: Pan Jiafei
> > > > > > > > > > > > > <Jiafei.Pan@freescale.com> Signed-off-by:
> > > > > > > > > > > > > Chuanhua Han <chuanhua.han@nxp.com> ---
> > > > > > > > > > > > > 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
> > > > > > > > > > > > > c2f9735ce7..da94b3d9df 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  
> > > > > > > > > > > >
> > > > > > > > > > > > Have you made any Travis-CI run?  
> > > > > > > > > > > I tested it with a local board  
> > > > > > > > > >
> > > > > > > > > > Could you be so kind and also test following
> > > > > > > > > > patchset (parts from Layerscape also needs testing):
> > > > > > > > > > https://patchwork.ozlabs.org/cover/1146494/  
> > > > > > > > > I don't quite understand this patch. How can I test
> > > > > > > > > it?  
> > > > > > > >
> > > > > > > > You need to apply it first to -master branch.
> > > > > > > >
> > > > > > > > Then apply your board code (or if it is already in
> > > > > > > > mainline just remove the #undef(s) from
> > > > > > > > include/config_uncmd_spl.h)
> > > > > > > >
> > > > > > > > As a last step - run make menuconfig and enable
> > > > > > > > SPL_DM_SPI* flags.  
> > > > > > > Currently, it is in the master, and SPI* in the #undef(s)
> > > > > > > from include/ uncmd_spl.h has been deleted, but an error
> > > > > > > was reported: CC spl/lib/display_options.o
> > > > > > > drivers/spi/spi.c: In function 'spi_do_alloc_slave':
> > > > > > > drivers/spi/spi.c:34:8: error: 'struct spi_slave' has no
> > > > > > > member named 'bus' slave->bus = bus; ^~
> > > > > > > drivers/spi/spi.c:35:8: error: 'struct spi_slave' has no
> > > > > > > member named 'cs' slave->cs = cs;
> > > > > > >         ^~
> > > > > > > make[3]: *** [spl/drivers/spi/spi.o] Error 1
> > > > > > > make[3]: *** Waiting for unfinished jobs....
> > > > > > > make[2]: *** [spl/drivers/spi] Error 2
> > > > > > > make[1]: *** [spl/drivers] Error 2
> > > > > > > make[1]: *** Waiting for unfinished jobs....
> > > > > > >   LD      spl/lib/built-in.o
> > > > > > > make: *** [spl/u-boot-spl] Error 2  
> > > > > >
> > > > > > If your board is in mainline (master branch) it shall build
> > > > > > without issues:
> > > > > >
> > > > > > Applied on top of -master branch:
> > > > > > 'commit feb5a02f869d ("Merge branch 'master' of
> > > > > > git://git.denx.de/u-boot-sh")' Travis-CI (clean build):
> > > > > > https://travis-ci.org/lmajewski/u-boot-dfu/builds/570594278
> > > > > >
> > > > > >
> > > > > > The patch itself:
> > > > > > https://patchwork.ozlabs.org/patch/1146377/  
> > > > > 1. I git reset to this commit: feb5a02f869d 2. Your patch has
> > > > > been applied(https://patchwork.ozlabs.org/patch/1146377/)  
> > > >
> > > > Could you check if your board (the code which is now in
> > > > mainline) compiles without issues at this step?  
> > > Yes,.no issue!(because this commit not support espi dm mode)  
> > 
> > Ok.
> >   
> > > >  
> > > > >3. Apply my
> > > > > current patch set 4. Include/uncmd_uncmd_spl.h file is
> > > > > deleted as follows:
> > > > > - # undef CONFIG_DM_SPI
> > > > > - # undef CONFIG_DM_SPI_FLASH
> > > > > 5. In include/configs/T208xQDS.h  file:
> > > > > +/* SPI Flash Configs */
> > > > > + # if defined (CONFIG_SPL_BUILD)
> > > > > + # undef CONFIG_DM_SPI
> > > > > + # undef CONFIG_DM_SPI_FLASH
> > > > > + # undef CONFIG_SPI_FLASH_MTD  
> > 
> > Setting #undef in config file causes !CONFIG_IS_ENABLED(FOO), to
> > malfunction as the FOO is not set in .config.  
> So I need to put these #undef's in a Kconfig file, right?

The patchset which I've posted does exactly that. Just try to adjust
your code on top of it.

> >   
> > > > > + # endif
> > > > > 6. Make menuconfig:
> > > > > Configuration
> > > > > CONFIG_SPL_DM_SPI = y
> > > > > CONFIG_SPL_DM_SPI_FLASH = y
> > > > > 7. Compilation errors still occur:
> > > > > LD      spl/lib/built-in.o
> > > > >   LD      spl/u-boot-spl
> > > > > drivers/built-in.o: In function `ofnode_read_u32':
> > > > > /home/hanch/uboot/uboot-upstream/u-boot/drivers/core/ofnode.c:29:
> > > > > undefined reference to `fdt_getprop' drivers/built-in.o: In
> > > > > function `ofnode_get_property':
> > > > > /home/hanch/uboot/uboot-upstream/u-boot/drivers/core/ofnode.c:528:
> > > > > undefined reference to `fdt_getprop' drivers/built-in.o: In
> > > > > function `blk_post_probe':
> > > > >  
> > /home/hanch/uboot/uboot-upstream/u-boot/drivers/block/blk-uclass.c:655:
> >  
> > > > > undefined reference to `part_init'
> > > > > drivers/built-in.o:(.u_boot_list_2_uclass_2_spi+0x8):
> > > > > undefined reference to `dm_scan_fdt_dev' make[1]: ***
> > > > > [spl/u-boot-spl] Error 1 make: *** [spl/u-boot-spl] Error 2  
> > > > > >  
> > > > > > >
> > > > > > > Do I need to modify a lot of files?  
> > > > > > > >  
> > > > > > > > > >
> > > > > > > > > > Which allows removal of
> > > > > > > > > > #undef CONFIG_DM_SPI
> > > > > > > > > > #undef CONFIG_DM_SPI_FLASH
> > > > > > > > > >
> > > > > > > > > > and have the same configuration done via Kconfig ?  
> > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > > > > _______________________________________________
> > > > > > > > > > > U-Boot mailing list
> > > > > > > > > > > U-Boot@lists.denx.de
> > > > > > > > > > > https://lists.denx.de/listinfo/u-boot  
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > 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@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@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@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@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@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@denx.de
diff mbox series

Patch

diff --git a/include/config_uncmd_spl.h b/include/config_uncmd_spl.h
index c2f9735ce7..da94b3d9df 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