public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] gpio: Add DW APB GPIO driver
Date: Mon, 10 Aug 2015 18:28:45 +0200	[thread overview]
Message-ID: <201508101828.45560.marex@denx.de> (raw)
In-Reply-To: <CAPnjgZ38A9Rqkt4u3-Dak_0URs1pUrUe-2TvHGhmseVfcivjHA@mail.gmail.com>

On Monday, August 10, 2015 at 05:35:25 PM, Simon Glass wrote:
> Hi Marek,
> 
> On 10 August 2015 at 09:01, Marek Vasut <marex@denx.de> wrote:
> > On Friday, August 07, 2015 at 10:37:54 PM, Simon Glass wrote:
> > > Hi Marek,
> > 
> > Hi Simon,
> > 
> > > On 7 August 2015 at 14:35, Marek Vasut <marex@denx.de> wrote:
> > > > 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@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 ?
> > > > 
> > > > [...]
> > > 
> > > It needs to be part of the official binding. Naming the hardware is
> > > part of the hardware definition - see for example the regulator-name
> > > property for regulators.
> > 
> > So what do you think about introducing a 'bank-name' property then ?
> > I think this might work just fine ?
> 
> I think it's OK - just make sure you send the GPIO binding change to Linux
> too.
> 
> > > Another option is to use an alias:
> > > 
> > > aliases {
> > > 
> > >    gpio0 = &gpio_0;
> > >    gpio1 = &gpio_1;
> > >    gpio2 = &gpio_2;
> > > 
> > > }
> > > 
> > > Then you can turn gpio0 into bank A, gpio1 into bank B, etc.
> > 
> > Is there a function which maps the udevice->dev->of_offset into an
> > alias's seq ID ?
> 
> dev->seq, once it is probed. Until it is probed it doesn't have a
> sequence number (by definition).
> 
> You can use fdtdec_get_alias_seq() but I don't recommend it. We're
> trying to drop fdtdec eventually.

OK. I sent a V2, so that should be OK now.

      reply	other threads:[~2015-08-10 16:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-27 20:44 [U-Boot] [PATCH 1/2] gpio: Add DW APB GPIO driver Marek Vasut
2015-07-27 20:44 ` [U-Boot] [PATCH 2/2] arm: socfpga: Enable DWAPB " Marek Vasut
2015-08-02 21:28   ` Simon Glass
2015-08-02 21:28 ` [U-Boot] [PATCH 1/2] gpio: Add DW APB " Simon Glass
2015-08-02 22:19   ` Marek Vasut
2015-08-02 23:38     ` Simon Glass
2015-08-03  0:16       ` Marek Vasut
2015-08-05 14:39         ` Simon Glass
2015-08-06  1:49           ` Marek Vasut
2015-08-07 19:13             ` Simon Glass
2015-08-07 20:35               ` Marek Vasut
2015-08-07 20:37                 ` Simon Glass
2015-08-10 15:01                   ` Marek Vasut
2015-08-10 15:35                     ` Simon Glass
2015-08-10 16:28                       ` Marek Vasut [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201508101828.45560.marex@denx.de \
    --to=marex@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox