ARM: OMAP: GPIO: Fix valid range and enable usage of all GPIOs on OMAP5
Subsystems (2)
PATCH 1/1 ARM: OMAP: GPIO: Fix valid range and enable usage of all GPIOs on OMAP5
The omap_gpio driver is used by AM33XX, OMAP3/4, OMAP54XX and DRA7XX SoCs. These SoCs have different gpio count but currently omap_gpio driver uses hard coded 192 which is wrong.
This patch fixes this issue by:
1. Move define of OMAP_MAX_GPIO to all arch/arm/include/asm/arch-omap*/gpio.h.
2. Update gpio bank settings and enable GPIO modules 7 & 8 clocks for OMAP5.
Thanks for Lubomir Popov to provide valuable comments to fix this issue.
---
This patch supersedes below patches:
[PATCH v3 1/2] gpio: omap_gpio: Fix valid gpio range for AM33XX [1] [PATCH v3 2/2] gpio: omap_gpio: Fix valid GPIO range for OMAP5 [2] [PATCH 1/2] OMAP5: Fix gpio_bank_54xx setting [3]
[PATCH 2/2] OMAP: gpio: Introduce get_omap_gpio_count() function to get gpio count [4]
[1] http://lists.denx.de/pipermail/u-boot/2013-June/156980.html
[2] http://lists.denx.de/pipermail/u-boot/2013-June/156981.html
[3] http://lists.denx.de/pipermail/u-boot/2013-June/156984.html
[4] http://lists.denx.de/pipermail/u-boot/2013-June/156985.html
Regards,
Axel
arch/arm/cpu/armv7/omap5/hw_data.c | 2 ++ arch/arm/cpu/armv7/omap5/hwinit.c | 4 +++- arch/arm/include/asm/arch-am33xx/gpio.h | 2 ++ arch/arm/include/asm/arch-omap3/gpio.h | 2 ++ arch/arm/include/asm/arch-omap4/gpio.h | 2 ++ arch/arm/include/asm/arch-omap5/gpio.h | 4 ++++ drivers/gpio/omap_gpio.c | 2 +- 7 files changed, 16 insertions(+), 2 deletions(-)
arch/arm/cpu/armv7/omap5/hw_data.c +2 -0
@@ -412,6 +412,8 @@ void enable_basic_clocks(void) (*prcm)->cm_l4per_gpio4_clkctrl, (*prcm)->cm_l4per_gpio5_clkctrl, (*prcm)->cm_l4per_gpio6_clkctrl, + (*prcm)->cm_l4per_gpio7_clkctrl, + (*prcm)->cm_l4per_gpio8_clkctrl, 0 };
arch/arm/cpu/armv7/omap5/hwinit.c +3 -1
@@ -43,13 +43,15 @@ DECLARE_GLOBAL_DATA_PTR;u32 *const omap_si_rev = (u32 *)OMAP_SRAM_SCRATCH_OMAP_REV ; -static struct gpio_bank gpio_bank_54xx[6 ] = { +static struct gpio_bank gpio_bank_54xx[8 ] = { { (void *)OMAP54XX_GPIO1_BASE ,METHOD_GPIO_24XX }, { (void *)OMAP54XX_GPIO2_BASE ,METHOD_GPIO_24XX }, { (void *)OMAP54XX_GPIO3_BASE ,METHOD_GPIO_24XX }, { (void *)OMAP54XX_GPIO4_BASE ,METHOD_GPIO_24XX }, { (void *)OMAP54XX_GPIO5_BASE ,METHOD_GPIO_24XX }, { (void *)OMAP54XX_GPIO6_BASE ,METHOD_GPIO_24XX }, + { (void *)OMAP54XX_GPIO7_BASE ,METHOD_GPIO_24XX }, + { (void *)OMAP54XX_GPIO8_BASE ,METHOD_GPIO_24XX }, };const struct gpio_bank *const omap_gpio_bank = gpio_bank_54xx;
arch/arm/include/asm/arch-am33xx/gpio.h +2 -0
@@ -21,6 +21,8 @@#include <asm/omap_gpio.h> +#define OMAP_MAX_GPIO 128 +#define AM33XX_GPIO0_BASE 0x44E07000#define AM33XX_GPIO1_BASE 0x4804C000#define AM33XX_GPIO2_BASE 0x481AC000
arch/arm/include/asm/arch-omap3/gpio.h +2 -0
@@ -40,6 +40,8 @@#include <asm/omap_gpio.h> +#define OMAP_MAX_GPIO 192 +#define OMAP34XX_GPIO1_BASE 0x48310000#define OMAP34XX_GPIO2_BASE 0x49050000#define OMAP34XX_GPIO3_BASE 0x49052000
arch/arm/include/asm/arch-omap4/gpio.h +2 -0
@@ -40,6 +40,8 @@#include <asm/omap_gpio.h> +#define OMAP_MAX_GPIO 192 +#define OMAP44XX_GPIO1_BASE 0x4A310000#define OMAP44XX_GPIO2_BASE 0x48055000#define OMAP44XX_GPIO3_BASE 0x48057000
arch/arm/include/asm/arch-omap5/gpio.h +4 -0
@@ -40,11 +40,15 @@#include <asm/omap_gpio.h> +#define OMAP_MAX_GPIO 256 +#define OMAP54XX_GPIO1_BASE 0x4Ae10000#define OMAP54XX_GPIO2_BASE 0x48055000#define OMAP54XX_GPIO3_BASE 0x48057000#define OMAP54XX_GPIO4_BASE 0x48059000#define OMAP54XX_GPIO5_BASE 0x4805B000#define OMAP54XX_GPIO6_BASE 0x4805D000 +#define OMAP54XX_GPIO7_BASE 0x48051000 +#define OMAP54XX_GPIO8_BASE 0x48053000#endif /* _GPIO_OMAP5_H */
drivers/gpio/omap_gpio.c +1 -1
@@ -55,7 +55,7 @@ static inline int get_gpio_index(int gpio)int gpio_is_valid (int gpio) { -return (gpio >=0 ) && (gpio <192 ); +return (gpio >=0 ) && (gpio <OMAP_MAX_GPIO ); }static int check_gpio (int gpio)
Signature · 1 line
1.8.1.2
PATCH 1/1 ARM: OMAP: GPIO: Fix valid range and enable usage of all GPIOs on OMAP5
Hi Axel,
Quoted 10 lines · Axel Lin
The
omap_gpiodriver is used by AM33XX, OMAP3/4, OMAP54XX and DRA7XX SoCs. These SoCs have different gpio count but currentlyomap_gpiodriver uses hard coded 192 which is wrong.This patch fixes this issue by:
1. Move define ofOMAP_MAX_GPIOto allarch/arm/include/asm/arch-omap*/gpio.h.
2. Update gpio bank settings and enable GPIO modules 7 & 8 clocks for OMAP5.Thanks for Lubomir Popov to provide valuable comments to fix this issue.
Quoted 9 lines
Signed-off-by Axel Lin <[email protected]>---
This patch supersedes below patches:[PATCH v3 1/2] gpio:
omap_gpio: Fix valid gpio range for AM33XX [1] [PATCH v3 2/2] gpio:omap_gpio: Fix valid GPIO range for OMAP5 [2] [PATCH 1/2] OMAP5: Fixgpio_bank_54xxsetting [3]
[PATCH 2/2] OMAP: gpio: Introduceget_omap_gpio_count()function to get gpio count [4]
Applied and tested on a custom OMAP5430 board with some GPIOs from banks 7 & 8. Works OK.
PATCH 1/1 ARM: OMAP: GPIO: Fix valid range and enable usage of all GPIOs on OMAP5
In reply to Axel LinHello Axel,
Am 21.06.2013 12:54, schrieb Axel Lin:
Quoted 19 lines
The
omap_gpiodriver is used by AM33XX, OMAP3/4, OMAP54XX and DRA7XX SoCs. These SoCs have different gpio count but currentlyomap_gpiodriver uses hard coded 192 which is wrong.This patch fixes this issue by:
1. Move define ofOMAP_MAX_GPIOto allarch/arm/include/asm/arch-omap*/gpio.h.
2. Update gpio bank settings and enable GPIO modules 7 & 8 clocks for OMAP5.Thanks for Lubomir Popov to provide valuable comments to fix this issue.
Signed-off-by Axel Lin <[email protected]>---
This patch supersedes below patches:[PATCH v3 1/2] gpio:
omap_gpio: Fix valid gpio range for AM33XX [1] [PATCH v3 2/2] gpio:omap_gpio: Fix valid GPIO range for OMAP5 [2] [PATCH 1/2] OMAP5: Fixgpio_bank_54xxsetting [3]
[PATCH 2/2] OMAP: gpio: Introduceget_omap_gpio_count()function to get gpio count [4]
Quoted 4 lines
[1] http://lists.denx.de/pipermail/u-boot/2013-June/156980.html
[2] http://lists.denx.de/pipermail/u-boot/2013-June/156981.html
[3] http://lists.denx.de/pipermail/u-boot/2013-June/156984.html
[4] http://lists.denx.de/pipermail/u-boot/2013-June/156985.html
bye,
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Quoted 8 lines · Axel Lin
The
omap_gpiodriver is used by AM33XX, OMAP3/4, OMAP54XX and DRA7XX SoCs. These SoCs have different gpio count but currentlyomap_gpiodriver uses hard coded 192 which is wrong.This patch fixes this issue by:
1. Move define ofOMAP_MAX_GPIOto allarch/arm/include/asm/arch-omap*/gpio.h.
2. Update gpio bank settings and enable GPIO modules 7 & 8 clocks for OMAP5.
Quoted 5 lines
Thanks for Lubomir Popov to provide valuable comments to fix this issue.
Signed-off-by Axel Lin <[email protected]>Tested-by Lubomir Popov <[email protected]>Acked-by Heiko Schocher <[email protected]>
Applied to u-boot-ti/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130702/09f7f93a/attachment.pgp>