On 5/19/2010 9:23 AM, Varadarajan, Charulatha wrote:
From: Tony Lindgren [mailto:tony@xxxxxxxxxxx]
Sent: Wednesday, May 19, 2010 5:11 AM
* Charulatha V<charu@xxxxxx> [100518 07:44]:
This is in prepartion for implementing GPIO as a platform device.
gpio bank's base addresses are moved from gpio.c to plat/gpio.h.
This patch also modifies omap_gpio_init() to make use of
omap_gpio_chip_init() and omap_gpio_mod_init(). omap_gpio_mod_init() does
the module init by clearing the status register and initializing the
GPIO control register. omap_gpio_chip_init() initializes the chip request,
free, get, set and other function pointers and sets the gpio irq handler.
<snip>
diff --git a/arch/arm/plat-omap/include/plat/gpio.h b/arch/arm/plat-
omap/include/plat/gpio.h
index de7c547..a06acb6 100644
--- a/arch/arm/plat-omap/include/plat/gpio.h
+++ b/arch/arm/plat-omap/include/plat/gpio.h
@@ -29,7 +29,8 @@
#include<linux/io.h>
#include<mach/irqs.h>
-#define OMAP1_MPUIO_BASE 0xfffb5000
+#define OMAP1_MPUIO_BASE 0xfffb5000
+#define OMAP1_MPUIO_VBASE OMAP1_MPUIO_BASE
#if (defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850))
@@ -62,8 +63,73 @@
#define OMAP_MPUIO_LATCH 0x34
#endif
+/*
+ * OMAP1510 GPIO base addresses
+ */
+#define OMAP1510_GPIO_BASE 0xfffce000
+#define OMAP1510_IH_GPIO_BASE 64
+
+/*
+ * OMAP1610 GPIO base addresses
+ */
+#define OMAP1610_GPIO1_BASE 0xfffbe400
+#define OMAP1610_GPIO2_BASE 0xfffbec00
+#define OMAP1610_GPIO3_BASE 0xfffbb400
+#define OMAP1610_GPIO4_BASE 0xfffbbc00
+
+/*
+ * OMAP7XX GPIO base addresses
+ */
+#define OMAP7XX_GPIO1_BASE 0xfffbc000
+#define OMAP7XX_GPIO2_BASE 0xfffbc800
+#define OMAP7XX_GPIO3_BASE 0xfffbd000
+#define OMAP7XX_GPIO4_BASE 0xfffbd800
+#define OMAP7XX_GPIO5_BASE 0xfffbe000
+#define OMAP7XX_GPIO6_BASE 0xfffbe800
Please move these into the mach-omap1/gpio1xxx.c instead,
they should not be needed anywhere else. We don't want
to have the GPIO registers available in the common headers
as otherwise we'll get tons of drivers that suddenly
start tinkering with these registers directly..
+/*
+ * omap24xx GPIO base addresses
+ */
+#define OMAP242X_GPIO1_BASE 0x48018000
+#define OMAP242X_GPIO2_BASE 0x4801a000
+#define OMAP242X_GPIO3_BASE 0x4801c000
+#define OMAP242X_GPIO4_BASE 0x4801e000
+
+#define OMAP243X_GPIO1_BASE 0x4900C000
+#define OMAP243X_GPIO2_BASE 0x4900E000
+#define OMAP243X_GPIO3_BASE 0x49010000
+#define OMAP243X_GPIO4_BASE 0x49012000
+#define OMAP243X_GPIO5_BASE 0x480B6000
These should go into mach-omap2/gpioxxxx.c. The same
for the others.
They are used in omap_hwmod_xxxx_data.c files. That is why they are
moved to plat-omap/gpio.h files.
1. Instead of having them in common headers, I can move them to mach-omapx/gpio.h.
> 2. Else, hard code these addresses directly in hwmod data structures
and avoid
> moving these definitions to header files.
What was agreed on that is to eventually move all the SoC base address
in a single header file (omapXXXX.h) that should be used only by the
omap_hwmod_xxxx_data.c file.
Benoit
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html