public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] gpio: mxc_gpio: enable DM gpio before relocation
@ 2015-06-16  7:08 Markus Niebel
  2015-06-16 21:44 ` Simon Glass
  0 siblings, 1 reply; 6+ messages in thread
From: Markus Niebel @ 2015-06-16  7:08 UTC (permalink / raw)
  To: u-boot

From: Markus Niebel <Markus.Niebel@tq-group.com>

gpio often are needed to detect revision and variants.
Therefore gpio should be available ASAP.

Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com>
---
 drivers/gpio/mxc_gpio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c
index 2012f99..925758a 100644
--- a/drivers/gpio/mxc_gpio.c
+++ b/drivers/gpio/mxc_gpio.c
@@ -330,6 +330,7 @@ U_BOOT_DRIVER(gpio_mxc) = {
 	.priv_auto_alloc_size = sizeof(struct mxc_bank_info),
 	.of_match = mxc_gpio_ids,
 	.bind	= mxc_gpio_bind,
+	.flags  = DM_FLAG_PRE_RELOC,
 };
 
 #ifndef CONFIG_OF_CONTROL
-- 
2.3.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] gpio: mxc_gpio: enable DM gpio before relocation
  2015-06-16  7:08 [U-Boot] [PATCH] gpio: mxc_gpio: enable DM gpio before relocation Markus Niebel
@ 2015-06-16 21:44 ` Simon Glass
  2015-06-17  6:18   ` Markus Niebel
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Glass @ 2015-06-16 21:44 UTC (permalink / raw)
  To: u-boot

Hi Markus,

On 16 June 2015 at 01:08, Markus Niebel <list-09_u-boot@tqsc.de> wrote:
> From: Markus Niebel <Markus.Niebel@tq-group.com>
>
> gpio often are needed to detect revision and variants.
> Therefore gpio should be available ASAP.
>
> Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com>
> ---
>  drivers/gpio/mxc_gpio.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c
> index 2012f99..925758a 100644
> --- a/drivers/gpio/mxc_gpio.c
> +++ b/drivers/gpio/mxc_gpio.c
> @@ -330,6 +330,7 @@ U_BOOT_DRIVER(gpio_mxc) = {
>         .priv_auto_alloc_size = sizeof(struct mxc_bank_info),
>         .of_match = mxc_gpio_ids,
>         .bind   = mxc_gpio_bind,
> +       .flags  = DM_FLAG_PRE_RELOC,
>  };
>
>  #ifndef CONFIG_OF_CONTROL
> --
> 2.3.0
>

This should really be done in the device tree with the
u-boot,dm-pre-reloc property for the particular GPIO banks you need. I
don't think this should be a global setting.

Regards,
Simon

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] gpio: mxc_gpio: enable DM gpio before relocation
  2015-06-16 21:44 ` Simon Glass
@ 2015-06-17  6:18   ` Markus Niebel
  2015-06-17 15:04     ` Simon Glass
  0 siblings, 1 reply; 6+ messages in thread
From: Markus Niebel @ 2015-06-17  6:18 UTC (permalink / raw)
  To: u-boot

Hello Simon,

Am 16.06.2015 um 23:44 schrieb Simon Glass:
> Hi Markus,
> 
> On 16 June 2015 at 01:08, Markus Niebel <list-09_u-boot@tqsc.de> wrote:
>> From: Markus Niebel <Markus.Niebel@tq-group.com>
>>
>> gpio often are needed to detect revision and variants.
>> Therefore gpio should be available ASAP.
>>
>> Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com>
>> ---
>>  drivers/gpio/mxc_gpio.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c
>> index 2012f99..925758a 100644
>> --- a/drivers/gpio/mxc_gpio.c
>> +++ b/drivers/gpio/mxc_gpio.c
>> @@ -330,6 +330,7 @@ U_BOOT_DRIVER(gpio_mxc) = {
>>         .priv_auto_alloc_size = sizeof(struct mxc_bank_info),
>>         .of_match = mxc_gpio_ids,
>>         .bind   = mxc_gpio_bind,
>> +       .flags  = DM_FLAG_PRE_RELOC,
>>  };
>>
>>  #ifndef CONFIG_OF_CONTROL
>> --
>> 2.3.0
>>
> 
> This should really be done in the device tree with the
> u-boot,dm-pre-reloc property for the particular GPIO banks you need. I
> don't think this should be a global setting.
> 

I totally agree for the longer run - but tegra gpio does it the same way.

Regards,
Markus

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] gpio: mxc_gpio: enable DM gpio before relocation
  2015-06-17  6:18   ` Markus Niebel
@ 2015-06-17 15:04     ` Simon Glass
  2015-06-17 17:12       ` Markus Niebel
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Glass @ 2015-06-17 15:04 UTC (permalink / raw)
  To: u-boot

Hi Markus,

On 17 June 2015 at 00:18, Markus Niebel <list-09_u-boot@tqsc.de> wrote:
>
> Hello Simon,
>
> Am 16.06.2015 um 23:44 schrieb Simon Glass:
> > Hi Markus,
> >
> > On 16 June 2015 at 01:08, Markus Niebel <list-09_u-boot@tqsc.de> wrote:
> >> From: Markus Niebel <Markus.Niebel@tq-group.com>
> >>
> >> gpio often are needed to detect revision and variants.
> >> Therefore gpio should be available ASAP.
> >>
> >> Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com>
> >> ---
> >>  drivers/gpio/mxc_gpio.c | 1 +
> >>  1 file changed, 1 insertion(+)
> >>
> >> diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c
> >> index 2012f99..925758a 100644
> >> --- a/drivers/gpio/mxc_gpio.c
> >> +++ b/drivers/gpio/mxc_gpio.c
> >> @@ -330,6 +330,7 @@ U_BOOT_DRIVER(gpio_mxc) = {
> >>         .priv_auto_alloc_size = sizeof(struct mxc_bank_info),
> >>         .of_match = mxc_gpio_ids,
> >>         .bind   = mxc_gpio_bind,
> >> +       .flags  = DM_FLAG_PRE_RELOC,
> >>  };
> >>
> >>  #ifndef CONFIG_OF_CONTROL
> >> --
> >> 2.3.0
> >>
> >
> > This should really be done in the device tree with the
> > u-boot,dm-pre-reloc property for the particular GPIO banks you need. I
> > don't think this should be a global setting.
> >
>
> I totally agree for the longer run - but tegra gpio does it the same way.

That's because it currently doesn't use device tree in SPL. I'll take
a look at converting it over.

Is your GPIO driver used in SPL?

Regards,
Simon

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] gpio: mxc_gpio: enable DM gpio before relocation
  2015-06-17 15:04     ` Simon Glass
@ 2015-06-17 17:12       ` Markus Niebel
  2015-06-17 17:17         ` Simon Glass
  0 siblings, 1 reply; 6+ messages in thread
From: Markus Niebel @ 2015-06-17 17:12 UTC (permalink / raw)
  To: u-boot

Am 17.06.2015 um 17:04 schrieb Simon Glass:
> Hi Markus,
> 
> On 17 June 2015 at 00:18, Markus Niebel <list-09_u-boot@tqsc.de> wrote:
>>
>> Hello Simon,
>>
>> Am 16.06.2015 um 23:44 schrieb Simon Glass:
>>> Hi Markus,
>>>
>>> On 16 June 2015 at 01:08, Markus Niebel <list-09_u-boot@tqsc.de> wrote:
>>>> From: Markus Niebel <Markus.Niebel@tq-group.com>
>>>>
>>>> gpio often are needed to detect revision and variants.
>>>> Therefore gpio should be available ASAP.
>>>>
>>>> Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com>
>>>> ---
>>>>  drivers/gpio/mxc_gpio.c | 1 +
>>>>  1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c
>>>> index 2012f99..925758a 100644
>>>> --- a/drivers/gpio/mxc_gpio.c
>>>> +++ b/drivers/gpio/mxc_gpio.c
>>>> @@ -330,6 +330,7 @@ U_BOOT_DRIVER(gpio_mxc) = {
>>>>         .priv_auto_alloc_size = sizeof(struct mxc_bank_info),
>>>>         .of_match = mxc_gpio_ids,
>>>>         .bind   = mxc_gpio_bind,
>>>> +       .flags  = DM_FLAG_PRE_RELOC,
>>>>  };
>>>>
>>>>  #ifndef CONFIG_OF_CONTROL
>>>> --
>>>> 2.3.0
>>>>
>>>
>>> This should really be done in the device tree with the
>>> u-boot,dm-pre-reloc property for the particular GPIO banks you need. I
>>> don't think this should be a global setting.
>>>
>>
>> I totally agree for the longer run - but tegra gpio does it the same way.
> 
> That's because it currently doesn't use device tree in SPL. I'll take
> a look at converting it over.
> 
> Is your GPIO driver used in SPL?
> 

As far as I understand: include/configs/imx6_spl.h defines CONFIG_SPL_GPIO_SUPPORT. So every mx6 board
using SPL includes GPIO. I2C driver for different imx SOC also uses GPIO for the bus reset logic. 
But I'm not too deep in the SPL stuff. BTW there is also no device tree support for mx6 in the moment 
in U-Boot.

Regards,
Markus

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] gpio: mxc_gpio: enable DM gpio before relocation
  2015-06-17 17:12       ` Markus Niebel
@ 2015-06-17 17:17         ` Simon Glass
  0 siblings, 0 replies; 6+ messages in thread
From: Simon Glass @ 2015-06-17 17:17 UTC (permalink / raw)
  To: u-boot

Hi Markus,

On 17 June 2015 at 11:12, Markus Niebel <list-09_u-boot@tqsc.de> wrote:
> Am 17.06.2015 um 17:04 schrieb Simon Glass:
>> Hi Markus,
>>
>> On 17 June 2015 at 00:18, Markus Niebel <list-09_u-boot@tqsc.de> wrote:
>>>
>>> Hello Simon,
>>>
>>> Am 16.06.2015 um 23:44 schrieb Simon Glass:
>>>> Hi Markus,
>>>>
>>>> On 16 June 2015 at 01:08, Markus Niebel <list-09_u-boot@tqsc.de> wrote:
>>>>> From: Markus Niebel <Markus.Niebel@tq-group.com>
>>>>>
>>>>> gpio often are needed to detect revision and variants.
>>>>> Therefore gpio should be available ASAP.
>>>>>
>>>>> Signed-off-by: Markus Niebel <Markus.Niebel@tq-group.com>
>>>>> ---
>>>>>  drivers/gpio/mxc_gpio.c | 1 +
>>>>>  1 file changed, 1 insertion(+)
>>>>>
>>>>> diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c
>>>>> index 2012f99..925758a 100644
>>>>> --- a/drivers/gpio/mxc_gpio.c
>>>>> +++ b/drivers/gpio/mxc_gpio.c
>>>>> @@ -330,6 +330,7 @@ U_BOOT_DRIVER(gpio_mxc) = {
>>>>>         .priv_auto_alloc_size = sizeof(struct mxc_bank_info),
>>>>>         .of_match = mxc_gpio_ids,
>>>>>         .bind   = mxc_gpio_bind,
>>>>> +       .flags  = DM_FLAG_PRE_RELOC,
>>>>>  };
>>>>>
>>>>>  #ifndef CONFIG_OF_CONTROL
>>>>> --
>>>>> 2.3.0
>>>>>
>>>>
>>>> This should really be done in the device tree with the
>>>> u-boot,dm-pre-reloc property for the particular GPIO banks you need. I
>>>> don't think this should be a global setting.
>>>>
>>>
>>> I totally agree for the longer run - but tegra gpio does it the same way.
>>
>> That's because it currently doesn't use device tree in SPL. I'll take
>> a look at converting it over.
>>
>> Is your GPIO driver used in SPL?
>>
>
> As far as I understand: include/configs/imx6_spl.h defines CONFIG_SPL_GPIO_SUPPORT. So every mx6 board
> using SPL includes GPIO. I2C driver for different imx SOC also uses GPIO for the bus reset logic.
> But I'm not too deep in the SPL stuff. BTW there is also no device tree support for mx6 in the moment
> in U-Boot.

OK, so how about adding a TODO on that line to consider remove it once
device tree support is added?

But in any case it seems like you do need this line. It looks like MXC
does not have many GPIO banks so the impact should be fairly small.

Regards,
Simon

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-06-17 17:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-16  7:08 [U-Boot] [PATCH] gpio: mxc_gpio: enable DM gpio before relocation Markus Niebel
2015-06-16 21:44 ` Simon Glass
2015-06-17  6:18   ` Markus Niebel
2015-06-17 15:04     ` Simon Glass
2015-06-17 17:12       ` Markus Niebel
2015-06-17 17:17         ` Simon Glass

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox