mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] OMAP3: Replace magic GPIO numbers in omap3_generic.c with macros.
@ 2012-12-04 17:54 Robert P. J. Day
  2012-12-05  9:37 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Robert P. J. Day @ 2012-12-04 17:54 UTC (permalink / raw)
  To: U-Boot Version 2 (barebox)


Based on following lines in omap3-silicon.h:

#define OMAP_L4_WKUP_BASE       0x48300000
#define OMAP_L4_PER_BASE        0x49000000
... snip ...
#define OMAP_GPIO1_BASE         (OMAP_L4_WKUP_BASE + 0x10000)
#define OMAP_GPIO2_BASE         (OMAP_L4_PER_BASE + 0x50000)
#define OMAP_GPIO3_BASE         (OMAP_L4_PER_BASE + 0x52000)
#define OMAP_GPIO4_BASE         (OMAP_L4_PER_BASE + 0x54000)
#define OMAP_GPIO5_BASE         (OMAP_L4_PER_BASE + 0x56000)
#define OMAP_GPIO6_BASE         (OMAP_L4_PER_BASE + 0x58000)

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>

---

diff --git a/arch/arm/mach-omap/omap3_generic.c b/arch/arm/mach-omap/omap3_generic.c
index 1e1308e..7b6f1f9 100644
--- a/arch/arm/mach-omap/omap3_generic.c
+++ b/arch/arm/mach-omap/omap3_generic.c
@@ -515,17 +515,17 @@ const struct gpmc_config omap3_nand_cfg = {
 #ifndef __PBL__
 static int omap3_gpio_init(void)
 {
-	add_generic_device("omap-gpio", 0, NULL, 0x48310000,
+	add_generic_device("omap-gpio", 0, NULL, OMAP_GPIO1_BASE,
 					0xf00, IORESOURCE_MEM, NULL);
-	add_generic_device("omap-gpio", 1, NULL, 0x49050000,
+	add_generic_device("omap-gpio", 1, NULL, OMAP_GPIO2_BASE,
 					0xf00, IORESOURCE_MEM, NULL);
-	add_generic_device("omap-gpio", 2, NULL, 0x49052000,
+	add_generic_device("omap-gpio", 2, NULL, OMAP_GPIO3_BASE,
 					0xf00, IORESOURCE_MEM, NULL);
-	add_generic_device("omap-gpio", 3, NULL, 0x49054000,
+	add_generic_device("omap-gpio", 3, NULL, OMAP_GPIO4_BASE,
 					0xf00, IORESOURCE_MEM, NULL);
-	add_generic_device("omap-gpio", 4, NULL, 0x49056000,
+	add_generic_device("omap-gpio", 4, NULL, OMAP_GPIO5_BASE,
 					0xf00, IORESOURCE_MEM, NULL);
-	add_generic_device("omap-gpio", 5, NULL, 0x49058000,
+	add_generic_device("omap-gpio", 5, NULL, OMAP_GPIO6_BASE,
 					0xf00, IORESOURCE_MEM, NULL);

 	return 0;

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] OMAP3: Replace magic GPIO numbers in omap3_generic.c with macros.
  2012-12-04 17:54 [PATCH] OMAP3: Replace magic GPIO numbers in omap3_generic.c with macros Robert P. J. Day
@ 2012-12-05  9:37 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2012-12-05  9:37 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: U-Boot Version 2 (barebox)

On Tue, Dec 04, 2012 at 12:54:22PM -0500, Robert P. J. Day wrote:
> 
> Based on following lines in omap3-silicon.h:

Applied, thanks

Sascha

> 
> #define OMAP_L4_WKUP_BASE       0x48300000
> #define OMAP_L4_PER_BASE        0x49000000
> ... snip ...
> #define OMAP_GPIO1_BASE         (OMAP_L4_WKUP_BASE + 0x10000)
> #define OMAP_GPIO2_BASE         (OMAP_L4_PER_BASE + 0x50000)
> #define OMAP_GPIO3_BASE         (OMAP_L4_PER_BASE + 0x52000)
> #define OMAP_GPIO4_BASE         (OMAP_L4_PER_BASE + 0x54000)
> #define OMAP_GPIO5_BASE         (OMAP_L4_PER_BASE + 0x56000)
> #define OMAP_GPIO6_BASE         (OMAP_L4_PER_BASE + 0x58000)
> 
> Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
> 
> ---
> 
> diff --git a/arch/arm/mach-omap/omap3_generic.c b/arch/arm/mach-omap/omap3_generic.c
> index 1e1308e..7b6f1f9 100644
> --- a/arch/arm/mach-omap/omap3_generic.c
> +++ b/arch/arm/mach-omap/omap3_generic.c
> @@ -515,17 +515,17 @@ const struct gpmc_config omap3_nand_cfg = {
>  #ifndef __PBL__
>  static int omap3_gpio_init(void)
>  {
> -	add_generic_device("omap-gpio", 0, NULL, 0x48310000,
> +	add_generic_device("omap-gpio", 0, NULL, OMAP_GPIO1_BASE,
>  					0xf00, IORESOURCE_MEM, NULL);
> -	add_generic_device("omap-gpio", 1, NULL, 0x49050000,
> +	add_generic_device("omap-gpio", 1, NULL, OMAP_GPIO2_BASE,
>  					0xf00, IORESOURCE_MEM, NULL);
> -	add_generic_device("omap-gpio", 2, NULL, 0x49052000,
> +	add_generic_device("omap-gpio", 2, NULL, OMAP_GPIO3_BASE,
>  					0xf00, IORESOURCE_MEM, NULL);
> -	add_generic_device("omap-gpio", 3, NULL, 0x49054000,
> +	add_generic_device("omap-gpio", 3, NULL, OMAP_GPIO4_BASE,
>  					0xf00, IORESOURCE_MEM, NULL);
> -	add_generic_device("omap-gpio", 4, NULL, 0x49056000,
> +	add_generic_device("omap-gpio", 4, NULL, OMAP_GPIO5_BASE,
>  					0xf00, IORESOURCE_MEM, NULL);
> -	add_generic_device("omap-gpio", 5, NULL, 0x49058000,
> +	add_generic_device("omap-gpio", 5, NULL, OMAP_GPIO6_BASE,
>  					0xf00, IORESOURCE_MEM, NULL);
> 
>  	return 0;
> 
> -- 
> 
> ========================================================================
> Robert P. J. Day                                 Ottawa, Ontario, CANADA
>                         http://crashcourse.ca
> 
> Twitter:                                       http://twitter.com/rpjday
> LinkedIn:                               http://ca.linkedin.com/in/rpjday
> ========================================================================
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-12-05  9:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-04 17:54 [PATCH] OMAP3: Replace magic GPIO numbers in omap3_generic.c with macros Robert P. J. Day
2012-12-05  9:37 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox