[U-Boot] [PATCH 1/2] gpio: Add DW APB GPIO driver

Marek Vasut marex at denx.de
Fri Aug 7 22:35:24 CEST 2015


On Friday, August 07, 2015 at 09:13:45 PM, Simon Glass wrote:
> Hi Marek,

Hi!

> On 5 August 2015 at 19:49, Marek Vasut <marex at denx.de> wrote:
> > On Wednesday, August 05, 2015 at 04:39:33 PM, Simon Glass wrote:
> >> Hi Marek,
> > 
> > Hi Simon,

[...]

> >> It's up to you. Normally each bank has a name and the datasheet
> >> specifies it. In your case if not you could think about a naming
> >> scheme.
> > 
> > Can you please take a look into arch/arm/dts/socfpga.dtsi ?
> > The system has three GPIO controllers (look for gpio0, gpio1, gpio2)
> > and each of these controllers has one bank (porta, portb, portc) .
> > 
> > I can name my gpios portxN , where x is either of a,b,c and N is the
> > GPIO number. The problem is, I cannot determine in dwapb_gpio_bind()
> > which one is "porta", "portb" and "portc" because all I have is the
> > physical addess of the GPIO controller and the index of the bank in
> > the namespace of that controller.
> > 
> > Sure, I can do some sort of global counting in the driver, but I would
> > like to avoid that sort of thing. I can also add some kind of ad-hoc DT
> > prop, but that's also not a good idea I think. Do you have any suggestion
> > for me please ?
> 
> One option is to use the device tree node name but it isn't very
> friendly - gpio0 at xxxxx.

That's what I do now pretty much.

> You could perhaps add a new property like 'bank-name'?

Do we want to add ad-hoc DT nodes which are
a) Not describing hardware
b) Not part of the official DT bindings for that platform
?

Is that really a way to go ?

[...]

Best regards,
Marek Vasut


More information about the U-Boot mailing list