RE: [PATCH 01/11] OMAP: GPIO: Modify init() in preparation for platform device implementation
-Original Message- From: Tony Lindgren [mailto:t...@atomide.com] Sent: Wednesday, May 19, 2010 5:11 AM To: Varadarajan, Charulatha Cc: linux-omap@vger.kernel.org; Nayak, Rajendra; p...@pwsan.com; khil...@deeprootsystems.com Subject: Re: [PATCH 01/11] OMAP: GPIO: Modify init() in preparation for platform device implementation * Charulatha V ch...@ti.com [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_BASE0xfffbe400 +#define OMAP1610_GPIO2_BASE0xfffbec00 +#define OMAP1610_GPIO3_BASE0xfffbb400 +#define OMAP1610_GPIO4_BASE0xfffbbc00 + +/* + * 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_BASE0x48018000 +#define OMAP242X_GPIO2_BASE0x4801a000 +#define OMAP242X_GPIO3_BASE0x4801c000 +#define OMAP242X_GPIO4_BASE0x4801e000 + +#define OMAP243X_GPIO1_BASE0x4900C000 +#define OMAP243X_GPIO2_BASE0x4900E000 +#define OMAP243X_GPIO3_BASE0x4901 +#define OMAP243X_GPIO4_BASE0x49012000 +#define OMAP243X_GPIO5_BASE0x480B6000 These should go into mach-omap2/gpio.c. The same for the others. They are used in omap_hwmod__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. Regards, Tony -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 01/11] OMAP: GPIO: Modify init() in preparation for platform device implementation
On 5/19/2010 9:23 AM, Varadarajan, Charulatha wrote: From: Tony Lindgren [mailto:t...@atomide.com] Sent: Wednesday, May 19, 2010 5:11 AM * Charulatha Vch...@ti.com [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 @@ #includelinux/io.h #includemach/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_BASE0xfffbe400 +#define OMAP1610_GPIO2_BASE0xfffbec00 +#define OMAP1610_GPIO3_BASE0xfffbb400 +#define OMAP1610_GPIO4_BASE0xfffbbc00 + +/* + * 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_BASE0x48018000 +#define OMAP242X_GPIO2_BASE0x4801a000 +#define OMAP242X_GPIO3_BASE0x4801c000 +#define OMAP242X_GPIO4_BASE0x4801e000 + +#define OMAP243X_GPIO1_BASE0x4900C000 +#define OMAP243X_GPIO2_BASE0x4900E000 +#define OMAP243X_GPIO3_BASE0x4901 +#define OMAP243X_GPIO4_BASE0x49012000 +#define OMAP243X_GPIO5_BASE0x480B6000 These should go into mach-omap2/gpio.c. The same for the others. They are used in omap_hwmod__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 (omap.h) that should be used only by the omap_hwmod__data.c file. Benoit -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 01/11] OMAP: GPIO: Modify init() in preparation for platform device implementation
-Original Message- From: Cousson, Benoit Sent: Wednesday, May 19, 2010 1:32 PM To: Varadarajan, Charulatha Cc: Tony Lindgren; linux-omap@vger.kernel.org; Nayak, Rajendra; p...@pwsan.com; khil...@deeprootsystems.com Subject: Re: [PATCH 01/11] OMAP: GPIO: Modify init() in preparation for platform device implementation On 5/19/2010 9:23 AM, Varadarajan, Charulatha wrote: From: Tony Lindgren [mailto:t...@atomide.com] Sent: Wednesday, May 19, 2010 5:11 AM * Charulatha Vch...@ti.com [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 @@ #includelinux/io.h #includemach/irqs.h -#define OMAP1_MPUIO_BASE 0xfffb5000 +#define OMAP1_MPUIO_BASE 0xfffb5000 +#define OMAP1_MPUIO_VBASEOMAP1_MPUIO_BASE #if (defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)) @@ -62,8 +63,73 @@ #define OMAP_MPUIO_LATCH0x34 #endif +/* + * OMAP1510 GPIO base addresses + */ +#define OMAP1510_GPIO_BASE 0xfffce000 +#define OMAP1510_IH_GPIO_BASE64 + +/* + * 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 0x4901 +#define OMAP243X_GPIO4_BASE 0x49012000 +#define OMAP243X_GPIO5_BASE 0x480B6000 These should go into mach-omap2/gpio.c. The same for the others. They are used in omap_hwmod__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 (omap.h) that should be used only by the omap_hwmod__data.c file. Can you give pointers on where this file would be located and if it is going to auto-generated? Benoit -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 01/11] OMAP: GPIO: Modify init() in preparation for platform device implementation
On 5/19/2010 3:57 PM, Varadarajan, Charulatha wrote: -Original Message- From: Cousson, Benoit Sent: Wednesday, May 19, 2010 1:32 PM To: Varadarajan, Charulatha Cc: Tony Lindgren; linux-omap@vger.kernel.org; Nayak, Rajendra; p...@pwsan.com; khil...@deeprootsystems.com Subject: Re: [PATCH 01/11] OMAP: GPIO: Modify init() in preparation for platform device implementation On 5/19/2010 9:23 AM, Varadarajan, Charulatha wrote: From: Tony Lindgren [mailto:t...@atomide.com] Sent: Wednesday, May 19, 2010 5:11 AM * Charulatha Vch...@ti.com [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 @@ #includelinux/io.h #includemach/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_BASE0xfffbe400 +#define OMAP1610_GPIO2_BASE0xfffbec00 +#define OMAP1610_GPIO3_BASE0xfffbb400 +#define OMAP1610_GPIO4_BASE0xfffbbc00 + +/* + * 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_BASE0x48018000 +#define OMAP242X_GPIO2_BASE0x4801a000 +#define OMAP242X_GPIO3_BASE0x4801c000 +#define OMAP242X_GPIO4_BASE0x4801e000 + +#define OMAP243X_GPIO1_BASE0x4900C000 +#define OMAP243X_GPIO2_BASE0x4900E000 +#define OMAP243X_GPIO3_BASE0x4901 +#define OMAP243X_GPIO4_BASE0x49012000 +#define OMAP243X_GPIO5_BASE0x480B6000 These should go into mach-omap2/gpio.c. The same for the others. They are used in omap_hwmod__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 (omap.h) that should be used only by the omap_hwmod__data.c file. Can you give pointers on where this file would be located and if it is going to auto-generated? These are the already existing plat-omap/omap.h files. We should be able to generate them, and I think Paul already did a OMAP3 version, but that should not prevent you to just move manually the GPIO defines in theses files for the moment. Do not take into account the following comment: /* * Please place only base defines here and put the rest in device * specific headers. */ Benoit -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 01/11] OMAP: GPIO: Modify init() in preparation for platform device implementation
* Charulatha V ch...@ti.com [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_VBASEOMAP1_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_BASE64 + +/* + * 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 0x4901 +#define OMAP243X_GPIO4_BASE 0x49012000 +#define OMAP243X_GPIO5_BASE 0x480B6000 These should go into mach-omap2/gpio.c. The same for the others. Regards, Tony -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html