mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: "Robert P. J. Day" <rpjday@crashcourse.ca>
Cc: "U-Boot Version 2 (barebox)" <barebox@lists.infradead.org>
Subject: Re: what is the rationale for funny "0x100" offset for OMAP4 GPIO addresses?
Date: Wed, 5 Dec 2012 13:58:30 +0100	[thread overview]
Message-ID: <20121205125830.GH10369@pengutronix.de> (raw)
In-Reply-To: <alpine.DEB.2.02.1212050751380.5832@oneiric>

On Wed, Dec 05, 2012 at 07:54:51AM -0500, Robert P. J. Day wrote:
> 
>   i was going to submit a patch to replace magic constants for OMAP4
> with more meaningful names but i ran into an oddity.  here's
> omap4-silicon.h:
> 
> #define OMAP44XX_L4_WKUP_BASE           0x4A300000
> #define OMAP44XX_L4_PER_BASE            0x48000000
> 
> and here's part of an old posting to the linux-omap mailing list:
> 
> +/* GPIO controller*/
> +#define OMAP44XX_GPIO1_BASE             (L4_WK_44XX_BASE  + 0x10000)
> +#define OMAP44XX_GPIO2_BASE             (L4_PER_44XX_BASE + 0x55000)
> +#define OMAP44XX_GPIO3_BASE             (L4_PER_44XX_BASE + 0x57000)
> +#define OMAP44XX_GPIO4_BASE             (L4_PER_44XX_BASE + 0x59000)
> +#define OMAP44XX_GPIO5_BASE             (L4_PER_44XX_BASE + 0x5B000)
> +#define OMAP44XX_GPIO6_BASE             (L4_PER_44XX_BASE + 0x5D000)
> 
> but here's the tail end of omap4-generic.c:
> 
> static int omap4_gpio_init(void)
> {
>         add_generic_device("omap-gpio", 0, NULL, 0x4a310100,
>                                 0xf00, IORESOURCE_MEM, NULL);
>         add_generic_device("omap-gpio", 1, NULL, 0x48055100,
>                                 0xf00, IORESOURCE_MEM, NULL);
>         add_generic_device("omap-gpio", 2, NULL, 0x48057100,
>                                 0xf00, IORESOURCE_MEM, NULL);
>         add_generic_device("omap-gpio", 3, NULL, 0x48059100,
>                                 0xf00, IORESOURCE_MEM, NULL);
>         add_generic_device("omap-gpio", 4, NULL, 0x4805b100,
>                                 0xf00, IORESOURCE_MEM, NULL);
>         add_generic_device("omap-gpio", 5, NULL, 0x4805d100,
>                                 0xf00, IORESOURCE_MEM, NULL);
> 
>         return 0;
> }
> 
>   as you can see, the numbers don't add up exactly -- the constants in
> that final file are all 0x100 larger than a simple addition.  anyone
> know where that comes from?

This comes from the hardware. The GPIO controller is the same as on
omap3, but the base addresses have an additional 0x100 offset.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2012-12-05 12:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-05 12:54 Robert P. J. Day
2012-12-05 12:58 ` Sascha Hauer [this message]
2012-12-05 13:01   ` Robert P. J. Day
2012-12-05 13:29   ` Robert P. J. Day
2012-12-05 14:11   ` Robert P. J. Day

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=20121205125830.GH10369@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=rpjday@crashcourse.ca \
    /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