diff mbox series

[U-Boot,v2,8/9] spl: Introduce SPL_DM_GPIO Kconfig define

Message ID 20190818213603.28171-9-lukma@denx.de
State Superseded
Delegated to: Stefano Babic
Headers show
Series imx: mxs: Fixes and DM/DTS conversion code for several i.MX28 drivers | expand

Commit Message

Lukasz Majewski Aug. 18, 2019, 9:36 p.m. UTC
This define indicates if DM_GPIO shall be supported in SPL. This allows
proper operation of DM converted GPIO drivers in SPL, which use
#if !CONFIG_IS_ENABLED(DM_GPIO) to also support not yet DM/DTS converted
boards.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
---

Changes in v2:
- New patch

 common/spl/Kconfig | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Peng Fan Aug. 19, 2019, 1:30 a.m. UTC | #1
> Subject: [PATCH v2 8/9] spl: Introduce SPL_DM_GPIO Kconfig define
> 
> This define indicates if DM_GPIO shall be supported in SPL. This allows proper
> operation of DM converted GPIO drivers in SPL, which use
> #if !CONFIG_IS_ENABLED(DM_GPIO) to also support not yet DM/DTS
> converted boards.
> 
> Signed-off-by: Lukasz Majewski <lukma@denx.de>
> ---
> 
> Changes in v2:
> - New patch
> 
>  common/spl/Kconfig | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/common/spl/Kconfig b/common/spl/Kconfig index
> 44c5ab61ec..0a3877ec28 100644
> --- a/common/spl/Kconfig
> +++ b/common/spl/Kconfig
> @@ -430,6 +430,12 @@ config SPL_DMA_SUPPORT
>  	  the CPU moving the data. Enable this option to build the drivers
>  	  in drivers/dma as part of an SPL build.
> 
> +config SPL_DM_GPIO
> +	bool "Support Driver Model GPIO drivers"
> +	depends on SPL_GPIO_SUPPORT
> +	help
> +	  Enable support for Driver Model based GPIO drivers in SPL.
> +
>  config SPL_DRIVERS_MISC_SUPPORT
>  	bool "Support misc drivers"
>  	help

Reviewed-by: Peng Fan <peng.fan@nxp.com>

> --
> 2.11.0
Simon Glass Sept. 17, 2019, 5:47 a.m. UTC | #2
On Sun, 18 Aug 2019 at 19:30, Peng Fan <peng.fan@nxp.com> wrote:
>
> > Subject: [PATCH v2 8/9] spl: Introduce SPL_DM_GPIO Kconfig define
> >
> > This define indicates if DM_GPIO shall be supported in SPL. This allows proper
> > operation of DM converted GPIO drivers in SPL, which use
> > #if !CONFIG_IS_ENABLED(DM_GPIO) to also support not yet DM/DTS
> > converted boards.
> >
> > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > ---
> >
> > Changes in v2:
> > - New patch
> >
> >  common/spl/Kconfig | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >

Reviewed-by: Simon Glass <sjg@chromium.org>

But how about adding && DM_GPIO as well to that depends clause?

Regards,
Simon
Lukasz Majewski Sept. 17, 2019, 7:22 a.m. UTC | #3
Hi Simon,

> On Sun, 18 Aug 2019 at 19:30, Peng Fan <peng.fan@nxp.com> wrote:
> >  
> > > Subject: [PATCH v2 8/9] spl: Introduce SPL_DM_GPIO Kconfig define
> > >
> > > This define indicates if DM_GPIO shall be supported in SPL. This
> > > allows proper operation of DM converted GPIO drivers in SPL,
> > > which use #if !CONFIG_IS_ENABLED(DM_GPIO) to also support not yet
> > > DM/DTS converted boards.
> > >
> > > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > > ---
> > >
> > > Changes in v2:
> > > - New patch
> > >
> > >  common/spl/Kconfig | 6 ++++++
> > >  1 file changed, 6 insertions(+)
> > >  
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 
> But how about adding && DM_GPIO as well to that depends clause?

I think that they shall be a separate Kconfig options. Please imagine
that one have board with SPL GPIO support, but not in U-Boot proper.

> 
> Regards,
> Simon



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
Simon Glass Sept. 17, 2019, 6:34 p.m. UTC | #4
Hi Lukasz,

On Tue, 17 Sep 2019 at 00:22, Lukasz Majewski <lukma@denx.de> wrote:
>
> Hi Simon,
>
> > On Sun, 18 Aug 2019 at 19:30, Peng Fan <peng.fan@nxp.com> wrote:
> > >
> > > > Subject: [PATCH v2 8/9] spl: Introduce SPL_DM_GPIO Kconfig define
> > > >
> > > > This define indicates if DM_GPIO shall be supported in SPL. This
> > > > allows proper operation of DM converted GPIO drivers in SPL,
> > > > which use #if !CONFIG_IS_ENABLED(DM_GPIO) to also support not yet
> > > > DM/DTS converted boards.
> > > >
> > > > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > > > ---
> > > >
> > > > Changes in v2:
> > > > - New patch
> > > >
> > > >  common/spl/Kconfig | 6 ++++++
> > > >  1 file changed, 6 insertions(+)
> > > >
> >
> > Reviewed-by: Simon Glass <sjg@chromium.org>
> >
> > But how about adding && DM_GPIO as well to that depends clause?
>
> I think that they shall be a separate Kconfig options. Please imagine
> that one have board with SPL GPIO support, but not in U-Boot proper.

Do we really want to support that? It seems a bit odd to me.

Most of the DM SPL configs assume/requiree you have U-Boot proper enabled.

Regards,
Simon
Adam Ford Sept. 17, 2019, 7:19 p.m. UTC | #5
On Tue, Sep 17, 2019 at 1:34 PM Simon Glass <sjg@chromium.org> wrote:
>
> Hi Lukasz,
>
> On Tue, 17 Sep 2019 at 00:22, Lukasz Majewski <lukma@denx.de> wrote:
> >
> > Hi Simon,
> >
> > > On Sun, 18 Aug 2019 at 19:30, Peng Fan <peng.fan@nxp.com> wrote:
> > > >
> > > > > Subject: [PATCH v2 8/9] spl: Introduce SPL_DM_GPIO Kconfig define
> > > > >
> > > > > This define indicates if DM_GPIO shall be supported in SPL. This
> > > > > allows proper operation of DM converted GPIO drivers in SPL,
> > > > > which use #if !CONFIG_IS_ENABLED(DM_GPIO) to also support not yet
> > > > > DM/DTS converted boards.
> > > > >

Many of the drivers list the SPL_DM options under their respective
heading.  For example, SPL_DM_USB is under the USB menu right next to
the option to select CONFIG_DM_USB.
If we're going to add the option to separate DM_GPIO from SPL_DM_GPIO,
I would suggest following that pattern and place it in the GPIO menu
so they are next to each other and make the dependency obvious.

adam

> > > > > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > > > > ---
> > > > >
> > > > > Changes in v2:
> > > > > - New patch
> > > > >
> > > > >  common/spl/Kconfig | 6 ++++++
> > > > >  1 file changed, 6 insertions(+)
> > > > >
> > >
> > > Reviewed-by: Simon Glass <sjg@chromium.org>
> > >
> > > But how about adding && DM_GPIO as well to that depends clause?
> >
> > I think that they shall be a separate Kconfig options. Please imagine
> > that one have board with SPL GPIO support, but not in U-Boot proper.
>
> Do we really want to support that? It seems a bit odd to me.
>
> Most of the DM SPL configs assume/requiree you have U-Boot proper enabled.
>
> Regards,
> Simon
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot
Lukasz Majewski Sept. 17, 2019, 9:04 p.m. UTC | #6
Hi Simon,

> Hi Lukasz,
> 
> On Tue, 17 Sep 2019 at 00:22, Lukasz Majewski <lukma@denx.de> wrote:
> >
> > Hi Simon,
> >  
> > > On Sun, 18 Aug 2019 at 19:30, Peng Fan <peng.fan@nxp.com> wrote:  
> > > >  
> > > > > Subject: [PATCH v2 8/9] spl: Introduce SPL_DM_GPIO Kconfig
> > > > > define
> > > > >
> > > > > This define indicates if DM_GPIO shall be supported in SPL.
> > > > > This allows proper operation of DM converted GPIO drivers in
> > > > > SPL, which use #if !CONFIG_IS_ENABLED(DM_GPIO) to also
> > > > > support not yet DM/DTS converted boards.
> > > > >
> > > > > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > > > > ---
> > > > >
> > > > > Changes in v2:
> > > > > - New patch
> > > > >
> > > > >  common/spl/Kconfig | 6 ++++++
> > > > >  1 file changed, 6 insertions(+)
> > > > >  
> > >
> > > Reviewed-by: Simon Glass <sjg@chromium.org>
> > >
> > > But how about adding && DM_GPIO as well to that depends clause?  
> >
> > I think that they shall be a separate Kconfig options. Please
> > imagine that one have board with SPL GPIO support, but not in
> > U-Boot proper.  
> 
> Do we really want to support that? It seems a bit odd to me.
> 
> Most of the DM SPL configs assume/requiree you have U-Boot proper
> enabled.

After some thoughts - I think that we shall add the dependency on 
DM_GPIO (the SPL_DM_GPIO shall be only visible when DM_GPIO is defined).

> 
> Regards,
> Simon



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 Sept. 17, 2019, 9:06 p.m. UTC | #7
On Tue, 17 Sep 2019 14:19:33 -0500
Adam Ford <aford173@gmail.com> wrote:

> On Tue, Sep 17, 2019 at 1:34 PM Simon Glass <sjg@chromium.org> wrote:
> >
> > Hi Lukasz,
> >
> > On Tue, 17 Sep 2019 at 00:22, Lukasz Majewski <lukma@denx.de>
> > wrote:  
> > >
> > > Hi Simon,
> > >  
> > > > On Sun, 18 Aug 2019 at 19:30, Peng Fan <peng.fan@nxp.com>
> > > > wrote:  
> > > > >  
> > > > > > Subject: [PATCH v2 8/9] spl: Introduce SPL_DM_GPIO Kconfig
> > > > > > define
> > > > > >
> > > > > > This define indicates if DM_GPIO shall be supported in SPL.
> > > > > > This allows proper operation of DM converted GPIO drivers
> > > > > > in SPL, which use #if !CONFIG_IS_ENABLED(DM_GPIO) to also
> > > > > > support not yet DM/DTS converted boards.
> > > > > >  
> 
> Many of the drivers list the SPL_DM options under their respective
> heading.  For example, SPL_DM_USB is under the USB menu right next to
> the option to select CONFIG_DM_USB.
> If we're going to add the option to separate DM_GPIO from SPL_DM_GPIO,
> I would suggest following that pattern and place it in the GPIO menu
> so they are next to each other and make the dependency obvious.

For the current patch I've followed the pattern and added SPL_DM_GPIO
to the "spl" submenu of menuconfig.

And as I've written in the other mail - I think that SPL_DM_GPIO shall
depend on DM_GPIO.

Considering the above - shall I place SPL_DM_GPIO next to DM_GPIO
section or to the "spl" submenu?

> 
> adam
> 
> > > > > > Signed-off-by: Lukasz Majewski <lukma@denx.de>
> > > > > > ---
> > > > > >
> > > > > > Changes in v2:
> > > > > > - New patch
> > > > > >
> > > > > >  common/spl/Kconfig | 6 ++++++
> > > > > >  1 file changed, 6 insertions(+)
> > > > > >  
> > > >
> > > > Reviewed-by: Simon Glass <sjg@chromium.org>
> > > >
> > > > But how about adding && DM_GPIO as well to that depends clause?
> > > >  
> > >
> > > I think that they shall be a separate Kconfig options. Please
> > > imagine that one have board with SPL GPIO support, but not in
> > > U-Boot proper.  
> >
> > Do we really want to support that? It seems a bit odd to me.
> >
> > Most of the DM SPL configs assume/requiree you have U-Boot proper
> > enabled.
> >
> > Regards,
> > Simon
> > _______________________________________________
> > 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
Simon Glass Sept. 25, 2019, 8:42 p.m. UTC | #8
Hi Lukasz,

On Tue, 17 Sep 2019 at 15:06, Lukasz Majewski <lukma@denx.de> wrote:
>
> On Tue, 17 Sep 2019 14:19:33 -0500
> Adam Ford <aford173@gmail.com> wrote:
>
> > On Tue, Sep 17, 2019 at 1:34 PM Simon Glass <sjg@chromium.org> wrote:
> > >
> > > Hi Lukasz,
> > >
> > > On Tue, 17 Sep 2019 at 00:22, Lukasz Majewski <lukma@denx.de>
> > > wrote:
> > > >
> > > > Hi Simon,
> > > >
> > > > > On Sun, 18 Aug 2019 at 19:30, Peng Fan <peng.fan@nxp.com>
> > > > > wrote:
> > > > > >
> > > > > > > Subject: [PATCH v2 8/9] spl: Introduce SPL_DM_GPIO Kconfig
> > > > > > > define
> > > > > > >
> > > > > > > This define indicates if DM_GPIO shall be supported in SPL.
> > > > > > > This allows proper operation of DM converted GPIO drivers
> > > > > > > in SPL, which use #if !CONFIG_IS_ENABLED(DM_GPIO) to also
> > > > > > > support not yet DM/DTS converted boards.
> > > > > > >
> >
> > Many of the drivers list the SPL_DM options under their respective
> > heading.  For example, SPL_DM_USB is under the USB menu right next to
> > the option to select CONFIG_DM_USB.
> > If we're going to add the option to separate DM_GPIO from SPL_DM_GPIO,
> > I would suggest following that pattern and place it in the GPIO menu
> > so they are next to each other and make the dependency obvious.
>
> For the current patch I've followed the pattern and added SPL_DM_GPIO
> to the "spl" submenu of menuconfig.
>
> And as I've written in the other mail - I think that SPL_DM_GPIO shall
> depend on DM_GPIO.
>
> Considering the above - shall I place SPL_DM_GPIO next to DM_GPIO
> section or to the "spl" submenu?

That makes sense to me. At some point we should change them all.

+Tom Rini for comment too

Regards,
Simon
Tom Rini Sept. 25, 2019, 9:21 p.m. UTC | #9
On Wed, Sep 25, 2019 at 02:42:03PM -0600, Simon Glass wrote:
> Hi Lukasz,
> 
> On Tue, 17 Sep 2019 at 15:06, Lukasz Majewski <lukma@denx.de> wrote:
> >
> > On Tue, 17 Sep 2019 14:19:33 -0500
> > Adam Ford <aford173@gmail.com> wrote:
> >
> > > On Tue, Sep 17, 2019 at 1:34 PM Simon Glass <sjg@chromium.org> wrote:
> > > >
> > > > Hi Lukasz,
> > > >
> > > > On Tue, 17 Sep 2019 at 00:22, Lukasz Majewski <lukma@denx.de>
> > > > wrote:
> > > > >
> > > > > Hi Simon,
> > > > >
> > > > > > On Sun, 18 Aug 2019 at 19:30, Peng Fan <peng.fan@nxp.com>
> > > > > > wrote:
> > > > > > >
> > > > > > > > Subject: [PATCH v2 8/9] spl: Introduce SPL_DM_GPIO Kconfig
> > > > > > > > define
> > > > > > > >
> > > > > > > > This define indicates if DM_GPIO shall be supported in SPL.
> > > > > > > > This allows proper operation of DM converted GPIO drivers
> > > > > > > > in SPL, which use #if !CONFIG_IS_ENABLED(DM_GPIO) to also
> > > > > > > > support not yet DM/DTS converted boards.
> > > > > > > >
> > >
> > > Many of the drivers list the SPL_DM options under their respective
> > > heading.  For example, SPL_DM_USB is under the USB menu right next to
> > > the option to select CONFIG_DM_USB.
> > > If we're going to add the option to separate DM_GPIO from SPL_DM_GPIO,
> > > I would suggest following that pattern and place it in the GPIO menu
> > > so they are next to each other and make the dependency obvious.
> >
> > For the current patch I've followed the pattern and added SPL_DM_GPIO
> > to the "spl" submenu of menuconfig.
> >
> > And as I've written in the other mail - I think that SPL_DM_GPIO shall
> > depend on DM_GPIO.
> >
> > Considering the above - shall I place SPL_DM_GPIO next to DM_GPIO
> > section or to the "spl" submenu?
> 
> That makes sense to me. At some point we should change them all.
> 
> +Tom Rini for comment too

Should we get consistent? Yes.  One of our not yet solved well enough
problems is what are we going to do about SPL/TPL, image size and
conflicting requirements.  For now I think having these options be in
the spl menu makes some future shuffling easier to do.
Lukasz Majewski Sept. 26, 2019, 7:52 a.m. UTC | #10
Hi Tom, Simon,

> On Wed, Sep 25, 2019 at 02:42:03PM -0600, Simon Glass wrote:
> > Hi Lukasz,
> > 
> > On Tue, 17 Sep 2019 at 15:06, Lukasz Majewski <lukma@denx.de>
> > wrote:  
> > >
> > > On Tue, 17 Sep 2019 14:19:33 -0500
> > > Adam Ford <aford173@gmail.com> wrote:
> > >  
> > > > On Tue, Sep 17, 2019 at 1:34 PM Simon Glass <sjg@chromium.org>
> > > > wrote:  
> > > > >
> > > > > Hi Lukasz,
> > > > >
> > > > > On Tue, 17 Sep 2019 at 00:22, Lukasz Majewski <lukma@denx.de>
> > > > > wrote:  
> > > > > >
> > > > > > Hi Simon,
> > > > > >  
> > > > > > > On Sun, 18 Aug 2019 at 19:30, Peng Fan <peng.fan@nxp.com>
> > > > > > > wrote:  
> > > > > > > >  
> > > > > > > > > Subject: [PATCH v2 8/9] spl: Introduce SPL_DM_GPIO
> > > > > > > > > Kconfig define
> > > > > > > > >
> > > > > > > > > This define indicates if DM_GPIO shall be supported
> > > > > > > > > in SPL. This allows proper operation of DM converted
> > > > > > > > > GPIO drivers in SPL, which use #if
> > > > > > > > > !CONFIG_IS_ENABLED(DM_GPIO) to also support not yet
> > > > > > > > > DM/DTS converted boards. 
> > > >
> > > > Many of the drivers list the SPL_DM options under their
> > > > respective heading.  For example, SPL_DM_USB is under the USB
> > > > menu right next to the option to select CONFIG_DM_USB.
> > > > If we're going to add the option to separate DM_GPIO from
> > > > SPL_DM_GPIO, I would suggest following that pattern and place
> > > > it in the GPIO menu so they are next to each other and make the
> > > > dependency obvious.  
> > >
> > > For the current patch I've followed the pattern and added
> > > SPL_DM_GPIO to the "spl" submenu of menuconfig.
> > >
> > > And as I've written in the other mail - I think that SPL_DM_GPIO
> > > shall depend on DM_GPIO.
> > >
> > > Considering the above - shall I place SPL_DM_GPIO next to DM_GPIO
> > > section or to the "spl" submenu?  
> > 
> > That makes sense to me. At some point we should change them all.
> > 
> > +Tom Rini for comment too  
> 
> Should we get consistent? Yes.  One of our not yet solved well enough
> problems is what are we going to do about SPL/TPL, image size and
> conflicting requirements.  For now I think having these options be in
> the spl menu makes some future shuffling easier to do.
> 

Ok. So I will add SPL_DM_GPIO to spl menu and make it dependent on
DM_GPIO.


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/common/spl/Kconfig b/common/spl/Kconfig
index 44c5ab61ec..0a3877ec28 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -430,6 +430,12 @@  config SPL_DMA_SUPPORT
 	  the CPU moving the data. Enable this option to build the drivers
 	  in drivers/dma as part of an SPL build.
 
+config SPL_DM_GPIO
+	bool "Support Driver Model GPIO drivers"
+	depends on SPL_GPIO_SUPPORT
+	help
+	  Enable support for Driver Model based GPIO drivers in SPL.
+
 config SPL_DRIVERS_MISC_SUPPORT
 	bool "Support misc drivers"
 	help