From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Fri, 7 Aug 2015 22:35:24 +0200 Subject: [U-Boot] [PATCH 1/2] gpio: Add DW APB GPIO driver In-Reply-To: References: <1438029890-9901-1-git-send-email-marex@denx.de> <201508060349.50380.marex@denx.de> Message-ID: <201508072235.24897.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 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