All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vikram Narayanan <vikram186@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/3] imx: Add GPIO_TO_PORT macro
Date: Tue, 10 Apr 2012 08:17:44 +0530	[thread overview]
Message-ID: <4F839F50.2020006@gmail.com> (raw)
In-Reply-To: <4F836326.2000700@denx.de>

Hi Stefano,

On 4/10/2012 4:01 AM, stefano babic wrote:
> Am 09/04/2012 18:09, schrieb Vikram Narayanan:
>> Hi,
>>
>
> Hi,
>
>>
>> Yes. You are right.
>> So, instead of defining all the headers this way,
>>
>> #if defined(CONFIG_MX53) || defined(CONFIG_MX51)
>> #include<asm/arch/mx5x_pins.h>
>> #elif defined(CONFIG_MX6)
>> #include<asm/arch/imx-regs.h>
>> #endif
>> ..... etc
>
>
> We have not this code - I cannot find in u-boot, and wedo not want to
> introduce it. As you say, it is nasty. Where have you find it ?

I don't find it anyway. If I want to use the existing macro, it would 
result in this.

> There is no driver including mx*_pins.h. At the moment, only board
> specific code includes the SOC specific pin header.
>
>>
>> Why not define the GPIO_TO_PORT macro in the driver?
>
> Maybe there was some use of the macro outside the driver in the past. I
> think before i.MX code was adapted to use common gpio_ functions, boards
> are used to write directly into the registers of the GPIO controller.
>
> I do not see any track of the macro in the current tree. So yes, we can
> move GPIO_ macros inside the driver.

Sure. I'll just do that.

>> Anyways for all its
>> the same 32 pins. Any suggestions/flames?
>
> It seems to me also that the defined GPIO_PORT for MX6 is wrong.
>
> arch/arm/include/asm/arch-mx6/imx-regs.h:
>
> #define GPIO_TO_PORT(number)		(((number)/32)+1)
>
> Why is the port starting from 1 ? It is wrong, but really GPIO_TO_PORT()
> is not used anymore.

Yes. You are right. I'll send the v2 for this.

Thanks for your response,
Vikram

> Best regards,
> Stefano Babic
>

      reply	other threads:[~2012-04-10  2:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-04 16:05 [U-Boot] [PATCH 1/3] imx: Add GPIO_TO_PORT macro Vikram Narayanan
2012-04-06  8:56 ` Stefano Babic
2012-04-09  5:33   ` Dirk Behme
2012-04-09 14:30     ` Vikram Narayanan
2012-04-09 16:09   ` Vikram Narayanan
2012-04-09 22:31     ` stefano babic
2012-04-10  2:47       ` Vikram Narayanan [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=4F839F50.2020006@gmail.com \
    --to=vikram186@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.