public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: stefano babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/3] imx: Add GPIO_TO_PORT macro
Date: Tue, 10 Apr 2012 00:31:02 +0200	[thread overview]
Message-ID: <4F836326.2000700@denx.de> (raw)
In-Reply-To: <4F8309B8.7050002@gmail.com>

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 ?

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.

> 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.

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

  reply	other threads:[~2012-04-09 22:31 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 [this message]
2012-04-10  2:47       ` Vikram Narayanan

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=4F836326.2000700@denx.de \
    --to=sbabic@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