aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2010-12-10 14:37:47 -0500
committerTony Lindgren <tony@atomide.com>2010-12-10 14:37:47 -0500
commit79b357c2171ab3e52148503f0efa66d64a13413e (patch)
tree7f134ef19ae4a882b32da87ce3d3ed9e5134691a /arch/arm/mach-omap2
parentb2d6fef51223a1913c0d3230df4252ab49990bc1 (diff)
parent5de62b86d2f5cf3459cb02ecb7a4530787bbd898 (diff)
Merge branch 'devel-gpio' into omap-for-linus
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/Makefile2
-rw-r--r--arch/arm/mach-omap2/board-2430sdp.c1
-rw-r--r--arch/arm/mach-omap2/board-3430sdp.c1
-rw-r--r--arch/arm/mach-omap2/board-3630sdp.c1
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c1
-rw-r--r--arch/arm/mach-omap2/board-am3517crane.c2
-rw-r--r--arch/arm/mach-omap2/board-am3517evm.c1
-rw-r--r--arch/arm/mach-omap2/board-apollon.c3
-rw-r--r--arch/arm/mach-omap2/board-cm-t35.c1
-rw-r--r--arch/arm/mach-omap2/board-cm-t3517.c1
-rw-r--r--arch/arm/mach-omap2/board-devkit8000.c1
-rw-r--r--arch/arm/mach-omap2/board-h4.c1
-rw-r--r--arch/arm/mach-omap2/board-igep0020.c1
-rw-r--r--arch/arm/mach-omap2/board-igep0030.c1
-rw-r--r--arch/arm/mach-omap2/board-ldp.c3
-rw-r--r--arch/arm/mach-omap2/board-n8x0.c1
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c1
-rw-r--r--arch/arm/mach-omap2/board-omap3evm.c1
-rw-r--r--arch/arm/mach-omap2/board-omap3logic.c1
-rw-r--r--arch/arm/mach-omap2/board-omap3pandora.c1
-rw-r--r--arch/arm/mach-omap2/board-omap3stalker.c1
-rw-r--r--arch/arm/mach-omap2/board-omap3touchbook.c1
-rw-r--r--arch/arm/mach-omap2/board-omap4panda.c1
-rw-r--r--arch/arm/mach-omap2/board-overo.c1
-rw-r--r--arch/arm/mach-omap2/board-rx51.c1
-rw-r--r--arch/arm/mach-omap2/board-zoom.c1
-rw-r--r--arch/arm/mach-omap2/gpio.c104
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2420_data.c230
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2430_data.c280
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_3xxx_data.c361
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_44xx_data.c341
31 files changed, 1316 insertions, 32 deletions
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index ce7b1f017670..fbc87395a025 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -4,7 +4,7 @@
4 4
5# Common support 5# Common support
6obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer-gp.o pm.o \ 6obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer-gp.o pm.o \
7 common.o 7 common.o gpio.o
8 8
9omap-2-3-common = irq.o sdrc.o prm2xxx_3xxx.o 9omap-2-3-common = irq.o sdrc.o prm2xxx_3xxx.o
10hwmod-common = omap_hwmod.o \ 10hwmod-common = omap_hwmod.o \
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index ee7ac993a277..c00f26aca0d6 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -145,7 +145,6 @@ static void __init omap_2430sdp_init_irq(void)
145 omap_board_config_size = ARRAY_SIZE(sdp2430_config); 145 omap_board_config_size = ARRAY_SIZE(sdp2430_config);
146 omap2_init_common_hw(NULL, NULL); 146 omap2_init_common_hw(NULL, NULL);
147 omap_init_irq(); 147 omap_init_irq();
148 omap_gpio_init();
149} 148}
150 149
151static struct twl4030_gpio_platform_data sdp2430_gpio_data = { 150static struct twl4030_gpio_platform_data sdp2430_gpio_data = {
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index ad4cb262719e..869fb133c207 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -328,7 +328,6 @@ static void __init omap_3430sdp_init_irq(void)
328 omap3_pm_init_cpuidle(omap3_cpuidle_params_table); 328 omap3_pm_init_cpuidle(omap3_cpuidle_params_table);
329 omap2_init_common_hw(hyb18m512160af6_sdrc_params, NULL); 329 omap2_init_common_hw(hyb18m512160af6_sdrc_params, NULL);
330 omap_init_irq(); 330 omap_init_irq();
331 omap_gpio_init();
332} 331}
333 332
334static int sdp3430_batt_table[] = { 333static int sdp3430_batt_table[] = {
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
index 4cd96d70b9c7..a8d35ba7781e 100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -76,7 +76,6 @@ static void __init omap_sdp_init_irq(void)
76 omap2_init_common_hw(h8mbx00u0mer0em_sdrc_params, 76 omap2_init_common_hw(h8mbx00u0mer0em_sdrc_params,
77 h8mbx00u0mer0em_sdrc_params); 77 h8mbx00u0mer0em_sdrc_params);
78 omap_init_irq(); 78 omap_init_irq();
79 omap_gpio_init();
80} 79}
81 80
82#ifdef CONFIG_OMAP_MUX 81#ifdef CONFIG_OMAP_MUX
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 94d989bee8ad..8842ec5e51e3 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -223,7 +223,6 @@ static void __init omap_4430sdp_init_irq(void)
223 omap2_gp_clockevent_set_gptimer(1); 223 omap2_gp_clockevent_set_gptimer(1);
224#endif 224#endif
225 gic_init_irq(); 225 gic_init_irq();
226 omap_gpio_init();
227} 226}
228 227
229static struct omap_musb_board_data musb_board_data = { 228static struct omap_musb_board_data musb_board_data = {
diff --git a/arch/arm/mach-omap2/board-am3517crane.c b/arch/arm/mach-omap2/board-am3517crane.c
index 13ead330e389..8ba404770e75 100644
--- a/arch/arm/mach-omap2/board-am3517crane.c
+++ b/arch/arm/mach-omap2/board-am3517crane.c
@@ -19,7 +19,6 @@
19 19
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/gpio.h>
23 22
24#include <mach/hardware.h> 23#include <mach/hardware.h>
25#include <asm/mach-types.h> 24#include <asm/mach-types.h>
@@ -50,7 +49,6 @@ static void __init am3517_crane_init_irq(void)
50 49
51 omap2_init_common_hw(NULL, NULL); 50 omap2_init_common_hw(NULL, NULL);
52 omap_init_irq(); 51 omap_init_irq();
53 omap_gpio_init();
54} 52}
55 53
56static void __init am3517_crane_init(void) 54static void __init am3517_crane_init(void)
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index 63035d8231ef..86867138f1e4 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -392,7 +392,6 @@ static void __init am3517_evm_init_irq(void)
392 392
393 omap2_init_common_hw(NULL, NULL); 393 omap2_init_common_hw(NULL, NULL);
394 omap_init_irq(); 394 omap_init_irq();
395 omap_gpio_init();
396} 395}
397 396
398static struct omap_musb_board_data musb_board_data = { 397static struct omap_musb_board_data musb_board_data = {
diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c
index b01d6e422d7a..4e91f453ea90 100644
--- a/arch/arm/mach-omap2/board-apollon.c
+++ b/arch/arm/mach-omap2/board-apollon.c
@@ -280,8 +280,6 @@ static void __init omap_apollon_init_irq(void)
280 omap_board_config_size = ARRAY_SIZE(apollon_config); 280 omap_board_config_size = ARRAY_SIZE(apollon_config);
281 omap2_init_common_hw(NULL, NULL); 281 omap2_init_common_hw(NULL, NULL);
282 omap_init_irq(); 282 omap_init_irq();
283 omap_gpio_init();
284 apollon_init_smc91x();
285} 283}
286 284
287static void __init apollon_led_init(void) 285static void __init apollon_led_init(void)
@@ -322,6 +320,7 @@ static void __init omap_apollon_init(void)
322 320
323 omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC); 321 omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC);
324 322
323 apollon_init_smc91x();
325 apollon_led_init(); 324 apollon_led_init();
326 apollon_flash_init(); 325 apollon_flash_init();
327 apollon_usb_init(); 326 apollon_usb_init();
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index 63f764e2af3f..78b67fb790bf 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -686,7 +686,6 @@ static void __init cm_t35_init_irq(void)
686 omap2_init_common_hw(mt46h32m32lf6_sdrc_params, 686 omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
687 mt46h32m32lf6_sdrc_params); 687 mt46h32m32lf6_sdrc_params);
688 omap_init_irq(); 688 omap_init_irq();
689 omap_gpio_init();
690} 689}
691 690
692static struct omap_board_mux board_mux[] __initdata = { 691static struct omap_board_mux board_mux[] __initdata = {
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c
index 1dd303e9a267..7ee23dab84fe 100644
--- a/arch/arm/mach-omap2/board-cm-t3517.c
+++ b/arch/arm/mach-omap2/board-cm-t3517.c
@@ -250,7 +250,6 @@ static void __init cm_t3517_init_irq(void)
250 250
251 omap2_init_common_hw(NULL, NULL); 251 omap2_init_common_hw(NULL, NULL);
252 omap_init_irq(); 252 omap_init_irq();
253 omap_gpio_init();
254} 253}
255 254
256static struct omap_board_mux board_mux[] __initdata = { 255static struct omap_board_mux board_mux[] __initdata = {
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 53ac762518bd..a30a7fce8cbf 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -450,7 +450,6 @@ static void __init devkit8000_init_irq(void)
450#ifdef CONFIG_OMAP_32K_TIMER 450#ifdef CONFIG_OMAP_32K_TIMER
451 omap2_gp_clockevent_set_gptimer(12); 451 omap2_gp_clockevent_set_gptimer(12);
452#endif 452#endif
453 omap_gpio_init();
454} 453}
455 454
456static void __init devkit8000_ads7846_init(void) 455static void __init devkit8000_ads7846_init(void)
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index 263da1da181c..9ec77a4a6b88 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -293,7 +293,6 @@ static void __init omap_h4_init_irq(void)
293 omap_board_config_size = ARRAY_SIZE(h4_config); 293 omap_board_config_size = ARRAY_SIZE(h4_config);
294 omap2_init_common_hw(NULL, NULL); 294 omap2_init_common_hw(NULL, NULL);
295 omap_init_irq(); 295 omap_init_irq();
296 omap_gpio_init();
297 h4_init_flash(); 296 h4_init_flash();
298} 297}
299 298
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 6f8f9b4533f9..59b95f2389dd 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -484,7 +484,6 @@ static void __init igep2_init_irq(void)
484{ 484{
485 omap2_init_common_hw(m65kxxxxam_sdrc_params, m65kxxxxam_sdrc_params); 485 omap2_init_common_hw(m65kxxxxam_sdrc_params, m65kxxxxam_sdrc_params);
486 omap_init_irq(); 486 omap_init_irq();
487 omap_gpio_init();
488} 487}
489 488
490static struct twl4030_codec_audio_data igep2_audio_data = { 489static struct twl4030_codec_audio_data igep2_audio_data = {
diff --git a/arch/arm/mach-omap2/board-igep0030.c b/arch/arm/mach-omap2/board-igep0030.c
index 8dc6ed3aa377..886f193a8415 100644
--- a/arch/arm/mach-omap2/board-igep0030.c
+++ b/arch/arm/mach-omap2/board-igep0030.c
@@ -291,7 +291,6 @@ static void __init igep3_init_irq(void)
291{ 291{
292 omap2_init_common_hw(m65kxxxxam_sdrc_params, m65kxxxxam_sdrc_params); 292 omap2_init_common_hw(m65kxxxxam_sdrc_params, m65kxxxxam_sdrc_params);
293 omap_init_irq(); 293 omap_init_irq();
294 omap_gpio_init();
295} 294}
296 295
297static struct twl4030_platform_data igep3_twl4030_pdata = { 296static struct twl4030_platform_data igep3_twl4030_pdata = {
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 84b4ea67d156..7455b0aadf86 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -294,8 +294,6 @@ static void __init omap_ldp_init_irq(void)
294 omap_board_config_size = ARRAY_SIZE(ldp_config); 294 omap_board_config_size = ARRAY_SIZE(ldp_config);
295 omap2_init_common_hw(NULL, NULL); 295 omap2_init_common_hw(NULL, NULL);
296 omap_init_irq(); 296 omap_init_irq();
297 omap_gpio_init();
298 ldp_init_smsc911x();
299} 297}
300 298
301static struct twl4030_usb_data ldp_usb_data = { 299static struct twl4030_usb_data ldp_usb_data = {
@@ -424,6 +422,7 @@ static struct mtd_partition ldp_nand_partitions[] = {
424static void __init omap_ldp_init(void) 422static void __init omap_ldp_init(void)
425{ 423{
426 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 424 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
425 ldp_init_smsc911x();
427 omap_i2c_init(); 426 omap_i2c_init();
428 platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices)); 427 platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices));
429 ts_gpio = 54; 428 ts_gpio = 54;
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index 0a4bc7715c38..d4ce96316e3b 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -633,7 +633,6 @@ static void __init n8x0_init_irq(void)
633{ 633{
634 omap2_init_common_hw(NULL, NULL); 634 omap2_init_common_hw(NULL, NULL);
635 omap_init_irq(); 635 omap_init_irq();
636 omap_gpio_init();
637} 636}
638 637
639#ifdef CONFIG_OMAP_MUX 638#ifdef CONFIG_OMAP_MUX
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index d42c8c936053..f1a8edefa42f 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -490,7 +490,6 @@ static void __init omap3_beagle_init_irq(void)
490#ifdef CONFIG_OMAP_32K_TIMER 490#ifdef CONFIG_OMAP_32K_TIMER
491 omap2_gp_clockevent_set_gptimer(12); 491 omap2_gp_clockevent_set_gptimer(12);
492#endif 492#endif
493 omap_gpio_init();
494} 493}
495 494
496static struct platform_device *omap3_beagle_devices[] __initdata = { 495static struct platform_device *omap3_beagle_devices[] __initdata = {
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 8f1e69a92056..21ffc5c587a1 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -625,7 +625,6 @@ static void __init omap3_evm_init_irq(void)
625 omap_board_config_size = ARRAY_SIZE(omap3_evm_config); 625 omap_board_config_size = ARRAY_SIZE(omap3_evm_config);
626 omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL); 626 omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL);
627 omap_init_irq(); 627 omap_init_irq();
628 omap_gpio_init();
629} 628}
630 629
631static struct platform_device *omap3_evm_devices[] __initdata = { 630static struct platform_device *omap3_evm_devices[] __initdata = {
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c
index e2e9562f4de9..cfd618d3bda8 100644
--- a/arch/arm/mach-omap2/board-omap3logic.c
+++ b/arch/arm/mach-omap2/board-omap3logic.c
@@ -199,7 +199,6 @@ static void __init omap3logic_init_irq(void)
199{ 199{
200 omap2_init_common_hw(NULL, NULL); 200 omap2_init_common_hw(NULL, NULL);
201 omap_init_irq(); 201 omap_init_irq();
202 omap_gpio_init();
203} 202}
204 203
205#ifdef CONFIG_OMAP_MUX 204#ifdef CONFIG_OMAP_MUX
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 445b15843212..de8df58b8f1d 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -639,7 +639,6 @@ static void __init omap3pandora_init_irq(void)
639 omap2_init_common_hw(mt46h32m32lf6_sdrc_params, 639 omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
640 mt46h32m32lf6_sdrc_params); 640 mt46h32m32lf6_sdrc_params);
641 omap_init_irq(); 641 omap_init_irq();
642 omap_gpio_init();
643} 642}
644 643
645static void pandora_wl1251_set_power(bool enable) 644static void pandora_wl1251_set_power(bool enable)
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
index ba65fe8a9e10..1af344b872bc 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -589,7 +589,6 @@ static void __init omap3_stalker_init_irq(void)
589#ifdef CONFIG_OMAP_32K_TIMER 589#ifdef CONFIG_OMAP_32K_TIMER
590 omap2_gp_clockevent_set_gptimer(12); 590 omap2_gp_clockevent_set_gptimer(12);
591#endif 591#endif
592 omap_gpio_init();
593} 592}
594 593
595static struct platform_device *omap3_stalker_devices[] __initdata = { 594static struct platform_device *omap3_stalker_devices[] __initdata = {
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index 8d530a607f85..baa72c507d4c 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -426,7 +426,6 @@ static void __init omap3_touchbook_init_irq(void)
426#ifdef CONFIG_OMAP_32K_TIMER 426#ifdef CONFIG_OMAP_32K_TIMER
427 omap2_gp_clockevent_set_gptimer(12); 427 omap2_gp_clockevent_set_gptimer(12);
428#endif 428#endif
429 omap_gpio_init();
430} 429}
431 430
432static struct platform_device *omap3_touchbook_devices[] __initdata = { 431static struct platform_device *omap3_touchbook_devices[] __initdata = {
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index 801f8146b00c..38f942beb121 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -79,7 +79,6 @@ static void __init omap4_panda_init_irq(void)
79{ 79{
80 omap2_init_common_hw(NULL, NULL); 80 omap2_init_common_hw(NULL, NULL);
81 gic_init_irq(); 81 gic_init_irq();
82 omap_gpio_init();
83} 82}
84 83
85static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { 84static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 133b5ead830d..b75bdcd47117 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -416,7 +416,6 @@ static void __init overo_init_irq(void)
416 omap2_init_common_hw(mt46h32m32lf6_sdrc_params, 416 omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
417 mt46h32m32lf6_sdrc_params); 417 mt46h32m32lf6_sdrc_params);
418 omap_init_irq(); 418 omap_init_irq();
419 omap_gpio_init();
420} 419}
421 420
422static struct platform_device *overo_devices[] __initdata = { 421static struct platform_device *overo_devices[] __initdata = {
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index f3b6e103b01c..6635142d7d07 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -108,7 +108,6 @@ static void __init rx51_init_irq(void)
108 sdrc_params = rx51_get_sdram_timings(); 108 sdrc_params = rx51_get_sdram_timings();
109 omap2_init_common_hw(sdrc_params, sdrc_params); 109 omap2_init_common_hw(sdrc_params, sdrc_params);
110 omap_init_irq(); 110 omap_init_irq();
111 omap_gpio_init();
112} 111}
113 112
114extern void __init rx51_peripherals_init(void); 113extern void __init rx51_peripherals_init(void);
diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c
index 27979fd527d3..0dff9deaa896 100644
--- a/arch/arm/mach-omap2/board-zoom.c
+++ b/arch/arm/mach-omap2/board-zoom.c
@@ -43,7 +43,6 @@ static void __init omap_zoom_init_irq(void)
43 h8mbx00u0mer0em_sdrc_params); 43 h8mbx00u0mer0em_sdrc_params);
44 44
45 omap_init_irq(); 45 omap_init_irq();
46 omap_gpio_init();
47} 46}
48 47
49#ifdef CONFIG_OMAP_MUX 48#ifdef CONFIG_OMAP_MUX
diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
new file mode 100644
index 000000000000..413de18c1d2b
--- /dev/null
+++ b/arch/arm/mach-omap2/gpio.c
@@ -0,0 +1,104 @@
1/*
2 * OMAP2+ specific gpio initialization
3 *
4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
5 *
6 * Author:
7 * Charulatha V <charu@ti.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation version 2.
12 *
13 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
14 * kind, whether express or implied; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 */
18
19#include <linux/gpio.h>
20#include <linux/err.h>
21#include <linux/slab.h>
22#include <linux/interrupt.h>
23
24#include <plat/omap_hwmod.h>
25#include <plat/omap_device.h>
26
27static struct omap_device_pm_latency omap_gpio_latency[] = {
28 [0] = {
29 .deactivate_func = omap_device_idle_hwmods,
30 .activate_func = omap_device_enable_hwmods,
31 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
32 },
33};
34
35static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
36{
37 struct omap_device *od;
38 struct omap_gpio_platform_data *pdata;
39 struct omap_gpio_dev_attr *dev_attr;
40 char *name = "omap_gpio";
41 int id;
42
43 /*
44 * extract the device id from name field available in the
45 * hwmod database and use the same for constructing ids for
46 * gpio devices.
47 * CAUTION: Make sure the name in the hwmod database does
48 * not change. If changed, make corresponding change here
49 * or make use of static variable mechanism to handle this.
50 */
51 sscanf(oh->name, "gpio%d", &id);
52
53 pdata = kzalloc(sizeof(struct omap_gpio_platform_data), GFP_KERNEL);
54 if (!pdata) {
55 pr_err("gpio%d: Memory allocation failed\n", id);
56 return -ENOMEM;
57 }
58
59 dev_attr = (struct omap_gpio_dev_attr *)oh->dev_attr;
60 pdata->bank_width = dev_attr->bank_width;
61 pdata->dbck_flag = dev_attr->dbck_flag;
62 pdata->virtual_irq_start = IH_GPIO_BASE + 32 * (id - 1);
63
64 switch (oh->class->rev) {
65 case 0:
66 case 1:
67 pdata->bank_type = METHOD_GPIO_24XX;
68 break;
69 case 2:
70 pdata->bank_type = METHOD_GPIO_44XX;
71 break;
72 default:
73 WARN(1, "Invalid gpio bank_type\n");
74 kfree(pdata);
75 return -EINVAL;
76 }
77
78 od = omap_device_build(name, id - 1, oh, pdata,
79 sizeof(*pdata), omap_gpio_latency,
80 ARRAY_SIZE(omap_gpio_latency),
81 false);
82 kfree(pdata);
83
84 if (IS_ERR(od)) {
85 WARN(1, "Cant build omap_device for %s:%s.\n",
86 name, oh->name);
87 return PTR_ERR(od);
88 }
89
90 gpio_bank_count++;
91 return 0;
92}
93
94/*
95 * gpio_init needs to be done before
96 * machine_init functions access gpio APIs.
97 * Hence gpio_init is a postcore_initcall.
98 */
99static int __init omap2_gpio_init(void)
100{
101 return omap_hwmod_for_each_by_class("gpio", omap2_gpio_dev_init,
102 NULL);
103}
104postcore_initcall(omap2_gpio_init);
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
index a1a3dd6303b4..d95342599793 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -17,7 +17,7 @@
17#include <plat/dma.h> 17#include <plat/dma.h>
18#include <plat/serial.h> 18#include <plat/serial.h>
19#include <plat/i2c.h> 19#include <plat/i2c.h>
20#include <plat/omap24xx.h> 20#include <plat/gpio.h>
21 21
22#include "omap_hwmod_common_data.h" 22#include "omap_hwmod_common_data.h"
23 23
@@ -38,6 +38,10 @@ static struct omap_hwmod omap2420_iva_hwmod;
38static struct omap_hwmod omap2420_l3_main_hwmod; 38static struct omap_hwmod omap2420_l3_main_hwmod;
39static struct omap_hwmod omap2420_l4_core_hwmod; 39static struct omap_hwmod omap2420_l4_core_hwmod;
40static struct omap_hwmod omap2420_wd_timer2_hwmod; 40static struct omap_hwmod omap2420_wd_timer2_hwmod;
41static struct omap_hwmod omap2420_gpio1_hwmod;
42static struct omap_hwmod omap2420_gpio2_hwmod;
43static struct omap_hwmod omap2420_gpio3_hwmod;
44static struct omap_hwmod omap2420_gpio4_hwmod;
41 45
42/* L3 -> L4_CORE interface */ 46/* L3 -> L4_CORE interface */
43static struct omap_hwmod_ocp_if omap2420_l3_main__l4_core = { 47static struct omap_hwmod_ocp_if omap2420_l3_main__l4_core = {
@@ -557,6 +561,224 @@ static struct omap_hwmod omap2420_i2c2_hwmod = {
557 .flags = HWMOD_16BIT_REG, 561 .flags = HWMOD_16BIT_REG,
558}; 562};
559 563
564/* l4_wkup -> gpio1 */
565static struct omap_hwmod_addr_space omap2420_gpio1_addr_space[] = {
566 {
567 .pa_start = 0x48018000,
568 .pa_end = 0x480181ff,
569 .flags = ADDR_TYPE_RT
570 },
571};
572
573static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio1 = {
574 .master = &omap2420_l4_wkup_hwmod,
575 .slave = &omap2420_gpio1_hwmod,
576 .clk = "gpios_ick",
577 .addr = omap2420_gpio1_addr_space,
578 .addr_cnt = ARRAY_SIZE(omap2420_gpio1_addr_space),
579 .user = OCP_USER_MPU | OCP_USER_SDMA,
580};
581
582/* l4_wkup -> gpio2 */
583static struct omap_hwmod_addr_space omap2420_gpio2_addr_space[] = {
584 {
585 .pa_start = 0x4801a000,
586 .pa_end = 0x4801a1ff,
587 .flags = ADDR_TYPE_RT
588 },
589};
590
591static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio2 = {
592 .master = &omap2420_l4_wkup_hwmod,
593 .slave = &omap2420_gpio2_hwmod,
594 .clk = "gpios_ick",
595 .addr = omap2420_gpio2_addr_space,
596 .addr_cnt = ARRAY_SIZE(omap2420_gpio2_addr_space),
597 .user = OCP_USER_MPU | OCP_USER_SDMA,
598};
599
600/* l4_wkup -> gpio3 */
601static struct omap_hwmod_addr_space omap2420_gpio3_addr_space[] = {
602 {
603 .pa_start = 0x4801c000,
604 .pa_end = 0x4801c1ff,
605 .flags = ADDR_TYPE_RT
606 },
607};
608
609static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio3 = {
610 .master = &omap2420_l4_wkup_hwmod,
611 .slave = &omap2420_gpio3_hwmod,
612 .clk = "gpios_ick",
613 .addr = omap2420_gpio3_addr_space,
614 .addr_cnt = ARRAY_SIZE(omap2420_gpio3_addr_space),
615 .user = OCP_USER_MPU | OCP_USER_SDMA,
616};
617
618/* l4_wkup -> gpio4 */
619static struct omap_hwmod_addr_space omap2420_gpio4_addr_space[] = {
620 {
621 .pa_start = 0x4801e000,
622 .pa_end = 0x4801e1ff,
623 .flags = ADDR_TYPE_RT
624 },
625};
626
627static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio4 = {
628 .master = &omap2420_l4_wkup_hwmod,
629 .slave = &omap2420_gpio4_hwmod,
630 .clk = "gpios_ick",
631 .addr = omap2420_gpio4_addr_space,
632 .addr_cnt = ARRAY_SIZE(omap2420_gpio4_addr_space),
633 .user = OCP_USER_MPU | OCP_USER_SDMA,
634};
635
636/* gpio dev_attr */
637static struct omap_gpio_dev_attr gpio_dev_attr = {
638 .bank_width = 32,
639 .dbck_flag = false,
640};
641
642static struct omap_hwmod_class_sysconfig omap242x_gpio_sysc = {
643 .rev_offs = 0x0000,
644 .sysc_offs = 0x0010,
645 .syss_offs = 0x0014,
646 .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
647 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
648 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
649 .sysc_fields = &omap_hwmod_sysc_type1,
650};
651
652/*
653 * 'gpio' class
654 * general purpose io module
655 */
656static struct omap_hwmod_class omap242x_gpio_hwmod_class = {
657 .name = "gpio",
658 .sysc = &omap242x_gpio_sysc,
659 .rev = 0,
660};
661
662/* gpio1 */
663static struct omap_hwmod_irq_info omap242x_gpio1_irqs[] = {
664 { .irq = 29 }, /* INT_24XX_GPIO_BANK1 */
665};
666
667static struct omap_hwmod_ocp_if *omap2420_gpio1_slaves[] = {
668 &omap2420_l4_wkup__gpio1,
669};
670
671static struct omap_hwmod omap2420_gpio1_hwmod = {
672 .name = "gpio1",
673 .mpu_irqs = omap242x_gpio1_irqs,
674 .mpu_irqs_cnt = ARRAY_SIZE(omap242x_gpio1_irqs),
675 .main_clk = "gpios_fck",
676 .prcm = {
677 .omap2 = {
678 .prcm_reg_id = 1,
679 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
680 .module_offs = WKUP_MOD,
681 .idlest_reg_id = 1,
682 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
683 },
684 },
685 .slaves = omap2420_gpio1_slaves,
686 .slaves_cnt = ARRAY_SIZE(omap2420_gpio1_slaves),
687 .class = &omap242x_gpio_hwmod_class,
688 .dev_attr = &gpio_dev_attr,
689 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
690};
691
692/* gpio2 */
693static struct omap_hwmod_irq_info omap242x_gpio2_irqs[] = {
694 { .irq = 30 }, /* INT_24XX_GPIO_BANK2 */
695};
696
697static struct omap_hwmod_ocp_if *omap2420_gpio2_slaves[] = {
698 &omap2420_l4_wkup__gpio2,
699};
700
701static struct omap_hwmod omap2420_gpio2_hwmod = {
702 .name = "gpio2",
703 .mpu_irqs = omap242x_gpio2_irqs,
704 .mpu_irqs_cnt = ARRAY_SIZE(omap242x_gpio2_irqs),
705 .main_clk = "gpios_fck",
706 .prcm = {
707 .omap2 = {
708 .prcm_reg_id = 1,
709 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
710 .module_offs = WKUP_MOD,
711 .idlest_reg_id = 1,
712 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
713 },
714 },
715 .slaves = omap2420_gpio2_slaves,
716 .slaves_cnt = ARRAY_SIZE(omap2420_gpio2_slaves),
717 .class = &omap242x_gpio_hwmod_class,
718 .dev_attr = &gpio_dev_attr,
719 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
720};
721
722/* gpio3 */
723static struct omap_hwmod_irq_info omap242x_gpio3_irqs[] = {
724 { .irq = 31 }, /* INT_24XX_GPIO_BANK3 */
725};
726
727static struct omap_hwmod_ocp_if *omap2420_gpio3_slaves[] = {
728 &omap2420_l4_wkup__gpio3,
729};
730
731static struct omap_hwmod omap2420_gpio3_hwmod = {
732 .name = "gpio3",
733 .mpu_irqs = omap242x_gpio3_irqs,
734 .mpu_irqs_cnt = ARRAY_SIZE(omap242x_gpio3_irqs),
735 .main_clk = "gpios_fck",
736 .prcm = {
737 .omap2 = {
738 .prcm_reg_id = 1,
739 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
740 .module_offs = WKUP_MOD,
741 .idlest_reg_id = 1,
742 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
743 },
744 },
745 .slaves = omap2420_gpio3_slaves,
746 .slaves_cnt = ARRAY_SIZE(omap2420_gpio3_slaves),
747 .class = &omap242x_gpio_hwmod_class,
748 .dev_attr = &gpio_dev_attr,
749 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
750};
751
752/* gpio4 */
753static struct omap_hwmod_irq_info omap242x_gpio4_irqs[] = {
754 { .irq = 32 }, /* INT_24XX_GPIO_BANK4 */
755};
756
757static struct omap_hwmod_ocp_if *omap2420_gpio4_slaves[] = {
758 &omap2420_l4_wkup__gpio4,
759};
760
761static struct omap_hwmod omap2420_gpio4_hwmod = {
762 .name = "gpio4",
763 .mpu_irqs = omap242x_gpio4_irqs,
764 .mpu_irqs_cnt = ARRAY_SIZE(omap242x_gpio4_irqs),
765 .main_clk = "gpios_fck",
766 .prcm = {
767 .omap2 = {
768 .prcm_reg_id = 1,
769 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
770 .module_offs = WKUP_MOD,
771 .idlest_reg_id = 1,
772 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
773 },
774 },
775 .slaves = omap2420_gpio4_slaves,
776 .slaves_cnt = ARRAY_SIZE(omap2420_gpio4_slaves),
777 .class = &omap242x_gpio_hwmod_class,
778 .dev_attr = &gpio_dev_attr,
779 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
780};
781
560static __initdata struct omap_hwmod *omap2420_hwmods[] = { 782static __initdata struct omap_hwmod *omap2420_hwmods[] = {
561 &omap2420_l3_main_hwmod, 783 &omap2420_l3_main_hwmod,
562 &omap2420_l4_core_hwmod, 784 &omap2420_l4_core_hwmod,
@@ -569,6 +791,12 @@ static __initdata struct omap_hwmod *omap2420_hwmods[] = {
569 &omap2420_uart3_hwmod, 791 &omap2420_uart3_hwmod,
570 &omap2420_i2c1_hwmod, 792 &omap2420_i2c1_hwmod,
571 &omap2420_i2c2_hwmod, 793 &omap2420_i2c2_hwmod,
794
795 /* gpio class */
796 &omap2420_gpio1_hwmod,
797 &omap2420_gpio2_hwmod,
798 &omap2420_gpio3_hwmod,
799 &omap2420_gpio4_hwmod,
572 NULL, 800 NULL,
573}; 801};
574 802
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index 7cf0d3ab2a4a..f68409e9fd3e 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -17,7 +17,7 @@
17#include <plat/dma.h> 17#include <plat/dma.h>
18#include <plat/serial.h> 18#include <plat/serial.h>
19#include <plat/i2c.h> 19#include <plat/i2c.h>
20#include <plat/omap24xx.h> 20#include <plat/gpio.h>
21 21
22#include "omap_hwmod_common_data.h" 22#include "omap_hwmod_common_data.h"
23 23
@@ -38,6 +38,11 @@ static struct omap_hwmod omap2430_iva_hwmod;
38static struct omap_hwmod omap2430_l3_main_hwmod; 38static struct omap_hwmod omap2430_l3_main_hwmod;
39static struct omap_hwmod omap2430_l4_core_hwmod; 39static struct omap_hwmod omap2430_l4_core_hwmod;
40static struct omap_hwmod omap2430_wd_timer2_hwmod; 40static struct omap_hwmod omap2430_wd_timer2_hwmod;
41static struct omap_hwmod omap2430_gpio1_hwmod;
42static struct omap_hwmod omap2430_gpio2_hwmod;
43static struct omap_hwmod omap2430_gpio3_hwmod;
44static struct omap_hwmod omap2430_gpio4_hwmod;
45static struct omap_hwmod omap2430_gpio5_hwmod;
41 46
42/* L3 -> L4_CORE interface */ 47/* L3 -> L4_CORE interface */
43static struct omap_hwmod_ocp_if omap2430_l3_main__l4_core = { 48static struct omap_hwmod_ocp_if omap2430_l3_main__l4_core = {
@@ -569,6 +574,272 @@ static struct omap_hwmod omap2430_i2c2_hwmod = {
569 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430), 574 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
570}; 575};
571 576
577/* l4_wkup -> gpio1 */
578static struct omap_hwmod_addr_space omap2430_gpio1_addr_space[] = {
579 {
580 .pa_start = 0x4900C000,
581 .pa_end = 0x4900C1ff,
582 .flags = ADDR_TYPE_RT
583 },
584};
585
586static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio1 = {
587 .master = &omap2430_l4_wkup_hwmod,
588 .slave = &omap2430_gpio1_hwmod,
589 .clk = "gpios_ick",
590 .addr = omap2430_gpio1_addr_space,
591 .addr_cnt = ARRAY_SIZE(omap2430_gpio1_addr_space),
592 .user = OCP_USER_MPU | OCP_USER_SDMA,
593};
594
595/* l4_wkup -> gpio2 */
596static struct omap_hwmod_addr_space omap2430_gpio2_addr_space[] = {
597 {
598 .pa_start = 0x4900E000,
599 .pa_end = 0x4900E1ff,
600 .flags = ADDR_TYPE_RT
601 },
602};
603
604static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio2 = {
605 .master = &omap2430_l4_wkup_hwmod,
606 .slave = &omap2430_gpio2_hwmod,
607 .clk = "gpios_ick",
608 .addr = omap2430_gpio2_addr_space,
609 .addr_cnt = ARRAY_SIZE(omap2430_gpio2_addr_space),
610 .user = OCP_USER_MPU | OCP_USER_SDMA,
611};
612
613/* l4_wkup -> gpio3 */
614static struct omap_hwmod_addr_space omap2430_gpio3_addr_space[] = {
615 {
616 .pa_start = 0x49010000,
617 .pa_end = 0x490101ff,
618 .flags = ADDR_TYPE_RT
619 },
620};
621
622static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio3 = {
623 .master = &omap2430_l4_wkup_hwmod,
624 .slave = &omap2430_gpio3_hwmod,
625 .clk = "gpios_ick",
626 .addr = omap2430_gpio3_addr_space,
627 .addr_cnt = ARRAY_SIZE(omap2430_gpio3_addr_space),
628 .user = OCP_USER_MPU | OCP_USER_SDMA,
629};
630
631/* l4_wkup -> gpio4 */
632static struct omap_hwmod_addr_space omap2430_gpio4_addr_space[] = {
633 {
634 .pa_start = 0x49012000,
635 .pa_end = 0x490121ff,
636 .flags = ADDR_TYPE_RT
637 },
638};
639
640static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio4 = {
641 .master = &omap2430_l4_wkup_hwmod,
642 .slave = &omap2430_gpio4_hwmod,
643 .clk = "gpios_ick",
644 .addr = omap2430_gpio4_addr_space,
645 .addr_cnt = ARRAY_SIZE(omap2430_gpio4_addr_space),
646 .user = OCP_USER_MPU | OCP_USER_SDMA,
647};
648
649/* l4_core -> gpio5 */
650static struct omap_hwmod_addr_space omap2430_gpio5_addr_space[] = {
651 {
652 .pa_start = 0x480B6000,
653 .pa_end = 0x480B61ff,
654 .flags = ADDR_TYPE_RT
655 },
656};
657
658static struct omap_hwmod_ocp_if omap2430_l4_core__gpio5 = {
659 .master = &omap2430_l4_core_hwmod,
660 .slave = &omap2430_gpio5_hwmod,
661 .clk = "gpio5_ick",
662 .addr = omap2430_gpio5_addr_space,
663 .addr_cnt = ARRAY_SIZE(omap2430_gpio5_addr_space),
664 .user = OCP_USER_MPU | OCP_USER_SDMA,
665};
666
667/* gpio dev_attr */
668static struct omap_gpio_dev_attr gpio_dev_attr = {
669 .bank_width = 32,
670 .dbck_flag = false,
671};
672
673static struct omap_hwmod_class_sysconfig omap243x_gpio_sysc = {
674 .rev_offs = 0x0000,
675 .sysc_offs = 0x0010,
676 .syss_offs = 0x0014,
677 .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
678 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
679 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
680 .sysc_fields = &omap_hwmod_sysc_type1,
681};
682
683/*
684 * 'gpio' class
685 * general purpose io module
686 */
687static struct omap_hwmod_class omap243x_gpio_hwmod_class = {
688 .name = "gpio",
689 .sysc = &omap243x_gpio_sysc,
690 .rev = 0,
691};
692
693/* gpio1 */
694static struct omap_hwmod_irq_info omap243x_gpio1_irqs[] = {
695 { .irq = 29 }, /* INT_24XX_GPIO_BANK1 */
696};
697
698static struct omap_hwmod_ocp_if *omap2430_gpio1_slaves[] = {
699 &omap2430_l4_wkup__gpio1,
700};
701
702static struct omap_hwmod omap2430_gpio1_hwmod = {
703 .name = "gpio1",
704 .mpu_irqs = omap243x_gpio1_irqs,
705 .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio1_irqs),
706 .main_clk = "gpios_fck",
707 .prcm = {
708 .omap2 = {
709 .prcm_reg_id = 1,
710 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
711 .module_offs = WKUP_MOD,
712 .idlest_reg_id = 1,
713 .idlest_idle_bit = OMAP24XX_EN_GPIOS_SHIFT,
714 },
715 },
716 .slaves = omap2430_gpio1_slaves,
717 .slaves_cnt = ARRAY_SIZE(omap2430_gpio1_slaves),
718 .class = &omap243x_gpio_hwmod_class,
719 .dev_attr = &gpio_dev_attr,
720 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
721};
722
723/* gpio2 */
724static struct omap_hwmod_irq_info omap243x_gpio2_irqs[] = {
725 { .irq = 30 }, /* INT_24XX_GPIO_BANK2 */
726};
727
728static struct omap_hwmod_ocp_if *omap2430_gpio2_slaves[] = {
729 &omap2430_l4_wkup__gpio2,
730};
731
732static struct omap_hwmod omap2430_gpio2_hwmod = {
733 .name = "gpio2",
734 .mpu_irqs = omap243x_gpio2_irqs,
735 .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio2_irqs),
736 .main_clk = "gpios_fck",
737 .prcm = {
738 .omap2 = {
739 .prcm_reg_id = 1,
740 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
741 .module_offs = WKUP_MOD,
742 .idlest_reg_id = 1,
743 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
744 },
745 },
746 .slaves = omap2430_gpio2_slaves,
747 .slaves_cnt = ARRAY_SIZE(omap2430_gpio2_slaves),
748 .class = &omap243x_gpio_hwmod_class,
749 .dev_attr = &gpio_dev_attr,
750 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
751};
752
753/* gpio3 */
754static struct omap_hwmod_irq_info omap243x_gpio3_irqs[] = {
755 { .irq = 31 }, /* INT_24XX_GPIO_BANK3 */
756};
757
758static struct omap_hwmod_ocp_if *omap2430_gpio3_slaves[] = {
759 &omap2430_l4_wkup__gpio3,
760};
761
762static struct omap_hwmod omap2430_gpio3_hwmod = {
763 .name = "gpio3",
764 .mpu_irqs = omap243x_gpio3_irqs,
765 .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio3_irqs),
766 .main_clk = "gpios_fck",
767 .prcm = {
768 .omap2 = {
769 .prcm_reg_id = 1,
770 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
771 .module_offs = WKUP_MOD,
772 .idlest_reg_id = 1,
773 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
774 },
775 },
776 .slaves = omap2430_gpio3_slaves,
777 .slaves_cnt = ARRAY_SIZE(omap2430_gpio3_slaves),
778 .class = &omap243x_gpio_hwmod_class,
779 .dev_attr = &gpio_dev_attr,
780 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
781};
782
783/* gpio4 */
784static struct omap_hwmod_irq_info omap243x_gpio4_irqs[] = {
785 { .irq = 32 }, /* INT_24XX_GPIO_BANK4 */
786};
787
788static struct omap_hwmod_ocp_if *omap2430_gpio4_slaves[] = {
789 &omap2430_l4_wkup__gpio4,
790};
791
792static struct omap_hwmod omap2430_gpio4_hwmod = {
793 .name = "gpio4",
794 .mpu_irqs = omap243x_gpio4_irqs,
795 .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio4_irqs),
796 .main_clk = "gpios_fck",
797 .prcm = {
798 .omap2 = {
799 .prcm_reg_id = 1,
800 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
801 .module_offs = WKUP_MOD,
802 .idlest_reg_id = 1,
803 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
804 },
805 },
806 .slaves = omap2430_gpio4_slaves,
807 .slaves_cnt = ARRAY_SIZE(omap2430_gpio4_slaves),
808 .class = &omap243x_gpio_hwmod_class,
809 .dev_attr = &gpio_dev_attr,
810 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
811};
812
813/* gpio5 */
814static struct omap_hwmod_irq_info omap243x_gpio5_irqs[] = {
815 { .irq = 33 }, /* INT_24XX_GPIO_BANK5 */
816};
817
818static struct omap_hwmod_ocp_if *omap2430_gpio5_slaves[] = {
819 &omap2430_l4_core__gpio5,
820};
821
822static struct omap_hwmod omap2430_gpio5_hwmod = {
823 .name = "gpio5",
824 .mpu_irqs = omap243x_gpio5_irqs,
825 .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio5_irqs),
826 .main_clk = "gpio5_fck",
827 .prcm = {
828 .omap2 = {
829 .prcm_reg_id = 2,
830 .module_bit = OMAP2430_EN_GPIO5_SHIFT,
831 .module_offs = CORE_MOD,
832 .idlest_reg_id = 2,
833 .idlest_idle_bit = OMAP2430_ST_GPIO5_SHIFT,
834 },
835 },
836 .slaves = omap2430_gpio5_slaves,
837 .slaves_cnt = ARRAY_SIZE(omap2430_gpio5_slaves),
838 .class = &omap243x_gpio_hwmod_class,
839 .dev_attr = &gpio_dev_attr,
840 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
841};
842
572static __initdata struct omap_hwmod *omap2430_hwmods[] = { 843static __initdata struct omap_hwmod *omap2430_hwmods[] = {
573 &omap2430_l3_main_hwmod, 844 &omap2430_l3_main_hwmod,
574 &omap2430_l4_core_hwmod, 845 &omap2430_l4_core_hwmod,
@@ -581,6 +852,13 @@ static __initdata struct omap_hwmod *omap2430_hwmods[] = {
581 &omap2430_uart3_hwmod, 852 &omap2430_uart3_hwmod,
582 &omap2430_i2c1_hwmod, 853 &omap2430_i2c1_hwmod,
583 &omap2430_i2c2_hwmod, 854 &omap2430_i2c2_hwmod,
855
856 /* gpio class */
857 &omap2430_gpio1_hwmod,
858 &omap2430_gpio2_hwmod,
859 &omap2430_gpio3_hwmod,
860 &omap2430_gpio4_hwmod,
861 &omap2430_gpio5_hwmod,
584 NULL, 862 NULL,
585}; 863};
586 864
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index a8bed843079c..2687be10d7aa 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -20,7 +20,7 @@
20#include <plat/serial.h> 20#include <plat/serial.h>
21#include <plat/l4_3xxx.h> 21#include <plat/l4_3xxx.h>
22#include <plat/i2c.h> 22#include <plat/i2c.h>
23#include <plat/omap34xx.h> 23#include <plat/gpio.h>
24 24
25#include "omap_hwmod_common_data.h" 25#include "omap_hwmod_common_data.h"
26 26
@@ -45,6 +45,12 @@ static struct omap_hwmod omap3xxx_wd_timer2_hwmod;
45static struct omap_hwmod omap3xxx_i2c1_hwmod; 45static struct omap_hwmod omap3xxx_i2c1_hwmod;
46static struct omap_hwmod omap3xxx_i2c2_hwmod; 46static struct omap_hwmod omap3xxx_i2c2_hwmod;
47static struct omap_hwmod omap3xxx_i2c3_hwmod; 47static struct omap_hwmod omap3xxx_i2c3_hwmod;
48static struct omap_hwmod omap3xxx_gpio1_hwmod;
49static struct omap_hwmod omap3xxx_gpio2_hwmod;
50static struct omap_hwmod omap3xxx_gpio3_hwmod;
51static struct omap_hwmod omap3xxx_gpio4_hwmod;
52static struct omap_hwmod omap3xxx_gpio5_hwmod;
53static struct omap_hwmod omap3xxx_gpio6_hwmod;
48 54
49/* L3 -> L4_CORE interface */ 55/* L3 -> L4_CORE interface */
50static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_core = { 56static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_core = {
@@ -739,6 +745,351 @@ static struct omap_hwmod omap3xxx_i2c3_hwmod = {
739 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), 745 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
740}; 746};
741 747
748/* l4_wkup -> gpio1 */
749static struct omap_hwmod_addr_space omap3xxx_gpio1_addrs[] = {
750 {
751 .pa_start = 0x48310000,
752 .pa_end = 0x483101ff,
753 .flags = ADDR_TYPE_RT
754 },
755};
756
757static struct omap_hwmod_ocp_if omap3xxx_l4_wkup__gpio1 = {
758 .master = &omap3xxx_l4_wkup_hwmod,
759 .slave = &omap3xxx_gpio1_hwmod,
760 .addr = omap3xxx_gpio1_addrs,
761 .addr_cnt = ARRAY_SIZE(omap3xxx_gpio1_addrs),
762 .user = OCP_USER_MPU | OCP_USER_SDMA,
763};
764
765/* l4_per -> gpio2 */
766static struct omap_hwmod_addr_space omap3xxx_gpio2_addrs[] = {
767 {
768 .pa_start = 0x49050000,
769 .pa_end = 0x490501ff,
770 .flags = ADDR_TYPE_RT
771 },
772};
773
774static struct omap_hwmod_ocp_if omap3xxx_l4_per__gpio2 = {
775 .master = &omap3xxx_l4_per_hwmod,
776 .slave = &omap3xxx_gpio2_hwmod,
777 .addr = omap3xxx_gpio2_addrs,
778 .addr_cnt = ARRAY_SIZE(omap3xxx_gpio2_addrs),
779 .user = OCP_USER_MPU | OCP_USER_SDMA,
780};
781
782/* l4_per -> gpio3 */
783static struct omap_hwmod_addr_space omap3xxx_gpio3_addrs[] = {
784 {
785 .pa_start = 0x49052000,
786 .pa_end = 0x490521ff,
787 .flags = ADDR_TYPE_RT
788 },
789};
790
791static struct omap_hwmod_ocp_if omap3xxx_l4_per__gpio3 = {
792 .master = &omap3xxx_l4_per_hwmod,
793 .slave = &omap3xxx_gpio3_hwmod,
794 .addr = omap3xxx_gpio3_addrs,
795 .addr_cnt = ARRAY_SIZE(omap3xxx_gpio3_addrs),
796 .user = OCP_USER_MPU | OCP_USER_SDMA,
797};
798
799/* l4_per -> gpio4 */
800static struct omap_hwmod_addr_space omap3xxx_gpio4_addrs[] = {
801 {
802 .pa_start = 0x49054000,
803 .pa_end = 0x490541ff,
804 .flags = ADDR_TYPE_RT
805 },
806};
807
808static struct omap_hwmod_ocp_if omap3xxx_l4_per__gpio4 = {
809 .master = &omap3xxx_l4_per_hwmod,
810 .slave = &omap3xxx_gpio4_hwmod,
811 .addr = omap3xxx_gpio4_addrs,
812 .addr_cnt = ARRAY_SIZE(omap3xxx_gpio4_addrs),
813 .user = OCP_USER_MPU | OCP_USER_SDMA,
814};
815
816/* l4_per -> gpio5 */
817static struct omap_hwmod_addr_space omap3xxx_gpio5_addrs[] = {
818 {
819 .pa_start = 0x49056000,
820 .pa_end = 0x490561ff,
821 .flags = ADDR_TYPE_RT
822 },
823};
824
825static struct omap_hwmod_ocp_if omap3xxx_l4_per__gpio5 = {
826 .master = &omap3xxx_l4_per_hwmod,
827 .slave = &omap3xxx_gpio5_hwmod,
828 .addr = omap3xxx_gpio5_addrs,
829 .addr_cnt = ARRAY_SIZE(omap3xxx_gpio5_addrs),
830 .user = OCP_USER_MPU | OCP_USER_SDMA,
831};
832
833/* l4_per -> gpio6 */
834static struct omap_hwmod_addr_space omap3xxx_gpio6_addrs[] = {
835 {
836 .pa_start = 0x49058000,
837 .pa_end = 0x490581ff,
838 .flags = ADDR_TYPE_RT
839 },
840};
841
842static struct omap_hwmod_ocp_if omap3xxx_l4_per__gpio6 = {
843 .master = &omap3xxx_l4_per_hwmod,
844 .slave = &omap3xxx_gpio6_hwmod,
845 .addr = omap3xxx_gpio6_addrs,
846 .addr_cnt = ARRAY_SIZE(omap3xxx_gpio6_addrs),
847 .user = OCP_USER_MPU | OCP_USER_SDMA,
848};
849
850/*
851 * 'gpio' class
852 * general purpose io module
853 */
854
855static struct omap_hwmod_class_sysconfig omap3xxx_gpio_sysc = {
856 .rev_offs = 0x0000,
857 .sysc_offs = 0x0010,
858 .syss_offs = 0x0014,
859 .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
860 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
861 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
862 .sysc_fields = &omap_hwmod_sysc_type1,
863};
864
865static struct omap_hwmod_class omap3xxx_gpio_hwmod_class = {
866 .name = "gpio",
867 .sysc = &omap3xxx_gpio_sysc,
868 .rev = 1,
869};
870
871/* gpio_dev_attr*/
872static struct omap_gpio_dev_attr gpio_dev_attr = {
873 .bank_width = 32,
874 .dbck_flag = true,
875};
876
877/* gpio1 */
878static struct omap_hwmod_irq_info omap3xxx_gpio1_irqs[] = {
879 { .irq = 29 }, /* INT_34XX_GPIO_BANK1 */
880};
881
882static struct omap_hwmod_opt_clk gpio1_opt_clks[] = {
883 { .role = "dbclk", .clk = "gpio1_dbck", },
884};
885
886static struct omap_hwmod_ocp_if *omap3xxx_gpio1_slaves[] = {
887 &omap3xxx_l4_wkup__gpio1,
888};
889
890static struct omap_hwmod omap3xxx_gpio1_hwmod = {
891 .name = "gpio1",
892 .mpu_irqs = omap3xxx_gpio1_irqs,
893 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_gpio1_irqs),
894 .main_clk = "gpio1_ick",
895 .opt_clks = gpio1_opt_clks,
896 .opt_clks_cnt = ARRAY_SIZE(gpio1_opt_clks),
897 .prcm = {
898 .omap2 = {
899 .prcm_reg_id = 1,
900 .module_bit = OMAP3430_EN_GPIO1_SHIFT,
901 .module_offs = WKUP_MOD,
902 .idlest_reg_id = 1,
903 .idlest_idle_bit = OMAP3430_ST_GPIO1_SHIFT,
904 },
905 },
906 .slaves = omap3xxx_gpio1_slaves,
907 .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio1_slaves),
908 .class = &omap3xxx_gpio_hwmod_class,
909 .dev_attr = &gpio_dev_attr,
910 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
911};
912
913/* gpio2 */
914static struct omap_hwmod_irq_info omap3xxx_gpio2_irqs[] = {
915 { .irq = 30 }, /* INT_34XX_GPIO_BANK2 */
916};
917
918static struct omap_hwmod_opt_clk gpio2_opt_clks[] = {
919 { .role = "dbclk", .clk = "gpio2_dbck", },
920};
921
922static struct omap_hwmod_ocp_if *omap3xxx_gpio2_slaves[] = {
923 &omap3xxx_l4_per__gpio2,
924};
925
926static struct omap_hwmod omap3xxx_gpio2_hwmod = {
927 .name = "gpio2",
928 .mpu_irqs = omap3xxx_gpio2_irqs,
929 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_gpio2_irqs),
930 .main_clk = "gpio2_ick",
931 .opt_clks = gpio2_opt_clks,
932 .opt_clks_cnt = ARRAY_SIZE(gpio2_opt_clks),
933 .prcm = {
934 .omap2 = {
935 .prcm_reg_id = 1,
936 .module_bit = OMAP3430_EN_GPIO2_SHIFT,
937 .module_offs = OMAP3430_PER_MOD,
938 .idlest_reg_id = 1,
939 .idlest_idle_bit = OMAP3430_ST_GPIO2_SHIFT,
940 },
941 },
942 .slaves = omap3xxx_gpio2_slaves,
943 .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio2_slaves),
944 .class = &omap3xxx_gpio_hwmod_class,
945 .dev_attr = &gpio_dev_attr,
946 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
947};
948
949/* gpio3 */
950static struct omap_hwmod_irq_info omap3xxx_gpio3_irqs[] = {
951 { .irq = 31 }, /* INT_34XX_GPIO_BANK3 */
952};
953
954static struct omap_hwmod_opt_clk gpio3_opt_clks[] = {
955 { .role = "dbclk", .clk = "gpio3_dbck", },
956};
957
958static struct omap_hwmod_ocp_if *omap3xxx_gpio3_slaves[] = {
959 &omap3xxx_l4_per__gpio3,
960};
961
962static struct omap_hwmod omap3xxx_gpio3_hwmod = {
963 .name = "gpio3",
964 .mpu_irqs = omap3xxx_gpio3_irqs,
965 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_gpio3_irqs),
966 .main_clk = "gpio3_ick",
967 .opt_clks = gpio3_opt_clks,
968 .opt_clks_cnt = ARRAY_SIZE(gpio3_opt_clks),
969 .prcm = {
970 .omap2 = {
971 .prcm_reg_id = 1,
972 .module_bit = OMAP3430_EN_GPIO3_SHIFT,
973 .module_offs = OMAP3430_PER_MOD,
974 .idlest_reg_id = 1,
975 .idlest_idle_bit = OMAP3430_ST_GPIO3_SHIFT,
976 },
977 },
978 .slaves = omap3xxx_gpio3_slaves,
979 .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio3_slaves),
980 .class = &omap3xxx_gpio_hwmod_class,
981 .dev_attr = &gpio_dev_attr,
982 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
983};
984
985/* gpio4 */
986static struct omap_hwmod_irq_info omap3xxx_gpio4_irqs[] = {
987 { .irq = 32 }, /* INT_34XX_GPIO_BANK4 */
988};
989
990static struct omap_hwmod_opt_clk gpio4_opt_clks[] = {
991 { .role = "dbclk", .clk = "gpio4_dbck", },
992};
993
994static struct omap_hwmod_ocp_if *omap3xxx_gpio4_slaves[] = {
995 &omap3xxx_l4_per__gpio4,
996};
997
998static struct omap_hwmod omap3xxx_gpio4_hwmod = {
999 .name = "gpio4",
1000 .mpu_irqs = omap3xxx_gpio4_irqs,
1001 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_gpio4_irqs),
1002 .main_clk = "gpio4_ick",
1003 .opt_clks = gpio4_opt_clks,
1004 .opt_clks_cnt = ARRAY_SIZE(gpio4_opt_clks),
1005 .prcm = {
1006 .omap2 = {
1007 .prcm_reg_id = 1,
1008 .module_bit = OMAP3430_EN_GPIO4_SHIFT,
1009 .module_offs = OMAP3430_PER_MOD,
1010 .idlest_reg_id = 1,
1011 .idlest_idle_bit = OMAP3430_ST_GPIO4_SHIFT,
1012 },
1013 },
1014 .slaves = omap3xxx_gpio4_slaves,
1015 .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio4_slaves),
1016 .class = &omap3xxx_gpio_hwmod_class,
1017 .dev_attr = &gpio_dev_attr,
1018 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
1019};
1020
1021/* gpio5 */
1022static struct omap_hwmod_irq_info omap3xxx_gpio5_irqs[] = {
1023 { .irq = 33 }, /* INT_34XX_GPIO_BANK5 */
1024};
1025
1026static struct omap_hwmod_opt_clk gpio5_opt_clks[] = {
1027 { .role = "dbclk", .clk = "gpio5_dbck", },
1028};
1029
1030static struct omap_hwmod_ocp_if *omap3xxx_gpio5_slaves[] = {
1031 &omap3xxx_l4_per__gpio5,
1032};
1033
1034static struct omap_hwmod omap3xxx_gpio5_hwmod = {
1035 .name = "gpio5",
1036 .mpu_irqs = omap3xxx_gpio5_irqs,
1037 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_gpio5_irqs),
1038 .main_clk = "gpio5_ick",
1039 .opt_clks = gpio5_opt_clks,
1040 .opt_clks_cnt = ARRAY_SIZE(gpio5_opt_clks),
1041 .prcm = {
1042 .omap2 = {
1043 .prcm_reg_id = 1,
1044 .module_bit = OMAP3430_EN_GPIO5_SHIFT,
1045 .module_offs = OMAP3430_PER_MOD,
1046 .idlest_reg_id = 1,
1047 .idlest_idle_bit = OMAP3430_ST_GPIO5_SHIFT,
1048 },
1049 },
1050 .slaves = omap3xxx_gpio5_slaves,
1051 .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio5_slaves),
1052 .class = &omap3xxx_gpio_hwmod_class,
1053 .dev_attr = &gpio_dev_attr,
1054 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
1055};
1056
1057/* gpio6 */
1058static struct omap_hwmod_irq_info omap3xxx_gpio6_irqs[] = {
1059 { .irq = 34 }, /* INT_34XX_GPIO_BANK6 */
1060};
1061
1062static struct omap_hwmod_opt_clk gpio6_opt_clks[] = {
1063 { .role = "dbclk", .clk = "gpio6_dbck", },
1064};
1065
1066static struct omap_hwmod_ocp_if *omap3xxx_gpio6_slaves[] = {
1067 &omap3xxx_l4_per__gpio6,
1068};
1069
1070static struct omap_hwmod omap3xxx_gpio6_hwmod = {
1071 .name = "gpio6",
1072 .mpu_irqs = omap3xxx_gpio6_irqs,
1073 .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_gpio6_irqs),
1074 .main_clk = "gpio6_ick",
1075 .opt_clks = gpio6_opt_clks,
1076 .opt_clks_cnt = ARRAY_SIZE(gpio6_opt_clks),
1077 .prcm = {
1078 .omap2 = {
1079 .prcm_reg_id = 1,
1080 .module_bit = OMAP3430_EN_GPIO6_SHIFT,
1081 .module_offs = OMAP3430_PER_MOD,
1082 .idlest_reg_id = 1,
1083 .idlest_idle_bit = OMAP3430_ST_GPIO6_SHIFT,
1084 },
1085 },
1086 .slaves = omap3xxx_gpio6_slaves,
1087 .slaves_cnt = ARRAY_SIZE(omap3xxx_gpio6_slaves),
1088 .class = &omap3xxx_gpio_hwmod_class,
1089 .dev_attr = &gpio_dev_attr,
1090 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
1091};
1092
742static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { 1093static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
743 &omap3xxx_l3_main_hwmod, 1094 &omap3xxx_l3_main_hwmod,
744 &omap3xxx_l4_core_hwmod, 1095 &omap3xxx_l4_core_hwmod,
@@ -754,6 +1105,14 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
754 &omap3xxx_i2c1_hwmod, 1105 &omap3xxx_i2c1_hwmod,
755 &omap3xxx_i2c2_hwmod, 1106 &omap3xxx_i2c2_hwmod,
756 &omap3xxx_i2c3_hwmod, 1107 &omap3xxx_i2c3_hwmod,
1108
1109 /* gpio class */
1110 &omap3xxx_gpio1_hwmod,
1111 &omap3xxx_gpio2_hwmod,
1112 &omap3xxx_gpio3_hwmod,
1113 &omap3xxx_gpio4_hwmod,
1114 &omap3xxx_gpio5_hwmod,
1115 &omap3xxx_gpio6_hwmod,
757 NULL, 1116 NULL,
758}; 1117};
759 1118
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index 0d5c6eb7e4c1..d258936410fb 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -22,6 +22,7 @@
22 22
23#include <plat/omap_hwmod.h> 23#include <plat/omap_hwmod.h>
24#include <plat/cpu.h> 24#include <plat/cpu.h>
25#include <plat/gpio.h>
25 26
26#include "omap_hwmod_common_data.h" 27#include "omap_hwmod_common_data.h"
27 28
@@ -1043,6 +1044,338 @@ static struct omap_hwmod omap44xx_uart4_hwmod = {
1043 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), 1044 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1044}; 1045};
1045 1046
1047/*
1048 * 'gpio' class
1049 * general purpose io module
1050 */
1051
1052static struct omap_hwmod_class_sysconfig omap44xx_gpio_sysc = {
1053 .rev_offs = 0x0000,
1054 .sysc_offs = 0x0010,
1055 .syss_offs = 0x0114,
1056 .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
1057 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
1058 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
1059 .sysc_fields = &omap_hwmod_sysc_type1,
1060};
1061
1062static struct omap_hwmod_class omap44xx_gpio_hwmod_class = {
1063 .name = "gpio",
1064 .sysc = &omap44xx_gpio_sysc,
1065 .rev = 2,
1066};
1067
1068/* gpio dev_attr */
1069static struct omap_gpio_dev_attr gpio_dev_attr = {
1070 .bank_width = 32,
1071 .dbck_flag = true,
1072};
1073
1074/* gpio1 */
1075static struct omap_hwmod omap44xx_gpio1_hwmod;
1076static struct omap_hwmod_irq_info omap44xx_gpio1_irqs[] = {
1077 { .irq = 29 + OMAP44XX_IRQ_GIC_START },
1078};
1079
1080static struct omap_hwmod_addr_space omap44xx_gpio1_addrs[] = {
1081 {
1082 .pa_start = 0x4a310000,
1083 .pa_end = 0x4a3101ff,
1084 .flags = ADDR_TYPE_RT
1085 },
1086};
1087
1088/* l4_wkup -> gpio1 */
1089static struct omap_hwmod_ocp_if omap44xx_l4_wkup__gpio1 = {
1090 .master = &omap44xx_l4_wkup_hwmod,
1091 .slave = &omap44xx_gpio1_hwmod,
1092 .addr = omap44xx_gpio1_addrs,
1093 .addr_cnt = ARRAY_SIZE(omap44xx_gpio1_addrs),
1094 .user = OCP_USER_MPU | OCP_USER_SDMA,
1095};
1096
1097/* gpio1 slave ports */
1098static struct omap_hwmod_ocp_if *omap44xx_gpio1_slaves[] = {
1099 &omap44xx_l4_wkup__gpio1,
1100};
1101
1102static struct omap_hwmod_opt_clk gpio1_opt_clks[] = {
1103 { .role = "dbclk", .clk = "sys_32k_ck" },
1104};
1105
1106static struct omap_hwmod omap44xx_gpio1_hwmod = {
1107 .name = "gpio1",
1108 .class = &omap44xx_gpio_hwmod_class,
1109 .mpu_irqs = omap44xx_gpio1_irqs,
1110 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_gpio1_irqs),
1111 .main_clk = "gpio1_ick",
1112 .prcm = {
1113 .omap4 = {
1114 .clkctrl_reg = OMAP4430_CM_WKUP_GPIO1_CLKCTRL,
1115 },
1116 },
1117 .opt_clks = gpio1_opt_clks,
1118 .opt_clks_cnt = ARRAY_SIZE(gpio1_opt_clks),
1119 .dev_attr = &gpio_dev_attr,
1120 .slaves = omap44xx_gpio1_slaves,
1121 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio1_slaves),
1122 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1123};
1124
1125/* gpio2 */
1126static struct omap_hwmod omap44xx_gpio2_hwmod;
1127static struct omap_hwmod_irq_info omap44xx_gpio2_irqs[] = {
1128 { .irq = 30 + OMAP44XX_IRQ_GIC_START },
1129};
1130
1131static struct omap_hwmod_addr_space omap44xx_gpio2_addrs[] = {
1132 {
1133 .pa_start = 0x48055000,
1134 .pa_end = 0x480551ff,
1135 .flags = ADDR_TYPE_RT
1136 },
1137};
1138
1139/* l4_per -> gpio2 */
1140static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio2 = {
1141 .master = &omap44xx_l4_per_hwmod,
1142 .slave = &omap44xx_gpio2_hwmod,
1143 .addr = omap44xx_gpio2_addrs,
1144 .addr_cnt = ARRAY_SIZE(omap44xx_gpio2_addrs),
1145 .user = OCP_USER_MPU | OCP_USER_SDMA,
1146};
1147
1148/* gpio2 slave ports */
1149static struct omap_hwmod_ocp_if *omap44xx_gpio2_slaves[] = {
1150 &omap44xx_l4_per__gpio2,
1151};
1152
1153static struct omap_hwmod_opt_clk gpio2_opt_clks[] = {
1154 { .role = "dbclk", .clk = "sys_32k_ck" },
1155};
1156
1157static struct omap_hwmod omap44xx_gpio2_hwmod = {
1158 .name = "gpio2",
1159 .class = &omap44xx_gpio_hwmod_class,
1160 .mpu_irqs = omap44xx_gpio2_irqs,
1161 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_gpio2_irqs),
1162 .main_clk = "gpio2_ick",
1163 .prcm = {
1164 .omap4 = {
1165 .clkctrl_reg = OMAP4430_CM_L4PER_GPIO2_CLKCTRL,
1166 },
1167 },
1168 .opt_clks = gpio2_opt_clks,
1169 .opt_clks_cnt = ARRAY_SIZE(gpio2_opt_clks),
1170 .dev_attr = &gpio_dev_attr,
1171 .slaves = omap44xx_gpio2_slaves,
1172 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio2_slaves),
1173 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1174};
1175
1176/* gpio3 */
1177static struct omap_hwmod omap44xx_gpio3_hwmod;
1178static struct omap_hwmod_irq_info omap44xx_gpio3_irqs[] = {
1179 { .irq = 31 + OMAP44XX_IRQ_GIC_START },
1180};
1181
1182static struct omap_hwmod_addr_space omap44xx_gpio3_addrs[] = {
1183 {
1184 .pa_start = 0x48057000,
1185 .pa_end = 0x480571ff,
1186 .flags = ADDR_TYPE_RT
1187 },
1188};
1189
1190/* l4_per -> gpio3 */
1191static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio3 = {
1192 .master = &omap44xx_l4_per_hwmod,
1193 .slave = &omap44xx_gpio3_hwmod,
1194 .addr = omap44xx_gpio3_addrs,
1195 .addr_cnt = ARRAY_SIZE(omap44xx_gpio3_addrs),
1196 .user = OCP_USER_MPU | OCP_USER_SDMA,
1197};
1198
1199/* gpio3 slave ports */
1200static struct omap_hwmod_ocp_if *omap44xx_gpio3_slaves[] = {
1201 &omap44xx_l4_per__gpio3,
1202};
1203
1204static struct omap_hwmod_opt_clk gpio3_opt_clks[] = {
1205 { .role = "dbclk", .clk = "sys_32k_ck" },
1206};
1207
1208static struct omap_hwmod omap44xx_gpio3_hwmod = {
1209 .name = "gpio3",
1210 .class = &omap44xx_gpio_hwmod_class,
1211 .mpu_irqs = omap44xx_gpio3_irqs,
1212 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_gpio3_irqs),
1213 .main_clk = "gpio3_ick",
1214 .prcm = {
1215 .omap4 = {
1216 .clkctrl_reg = OMAP4430_CM_L4PER_GPIO3_CLKCTRL,
1217 },
1218 },
1219 .opt_clks = gpio3_opt_clks,
1220 .opt_clks_cnt = ARRAY_SIZE(gpio3_opt_clks),
1221 .dev_attr = &gpio_dev_attr,
1222 .slaves = omap44xx_gpio3_slaves,
1223 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio3_slaves),
1224 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1225};
1226
1227/* gpio4 */
1228static struct omap_hwmod omap44xx_gpio4_hwmod;
1229static struct omap_hwmod_irq_info omap44xx_gpio4_irqs[] = {
1230 { .irq = 32 + OMAP44XX_IRQ_GIC_START },
1231};
1232
1233static struct omap_hwmod_addr_space omap44xx_gpio4_addrs[] = {
1234 {
1235 .pa_start = 0x48059000,
1236 .pa_end = 0x480591ff,
1237 .flags = ADDR_TYPE_RT
1238 },
1239};
1240
1241/* l4_per -> gpio4 */
1242static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio4 = {
1243 .master = &omap44xx_l4_per_hwmod,
1244 .slave = &omap44xx_gpio4_hwmod,
1245 .addr = omap44xx_gpio4_addrs,
1246 .addr_cnt = ARRAY_SIZE(omap44xx_gpio4_addrs),
1247 .user = OCP_USER_MPU | OCP_USER_SDMA,
1248};
1249
1250/* gpio4 slave ports */
1251static struct omap_hwmod_ocp_if *omap44xx_gpio4_slaves[] = {
1252 &omap44xx_l4_per__gpio4,
1253};
1254
1255static struct omap_hwmod_opt_clk gpio4_opt_clks[] = {
1256 { .role = "dbclk", .clk = "sys_32k_ck" },
1257};
1258
1259static struct omap_hwmod omap44xx_gpio4_hwmod = {
1260 .name = "gpio4",
1261 .class = &omap44xx_gpio_hwmod_class,
1262 .mpu_irqs = omap44xx_gpio4_irqs,
1263 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_gpio4_irqs),
1264 .main_clk = "gpio4_ick",
1265 .prcm = {
1266 .omap4 = {
1267 .clkctrl_reg = OMAP4430_CM_L4PER_GPIO4_CLKCTRL,
1268 },
1269 },
1270 .opt_clks = gpio4_opt_clks,
1271 .opt_clks_cnt = ARRAY_SIZE(gpio4_opt_clks),
1272 .dev_attr = &gpio_dev_attr,
1273 .slaves = omap44xx_gpio4_slaves,
1274 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio4_slaves),
1275 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1276};
1277
1278/* gpio5 */
1279static struct omap_hwmod omap44xx_gpio5_hwmod;
1280static struct omap_hwmod_irq_info omap44xx_gpio5_irqs[] = {
1281 { .irq = 33 + OMAP44XX_IRQ_GIC_START },
1282};
1283
1284static struct omap_hwmod_addr_space omap44xx_gpio5_addrs[] = {
1285 {
1286 .pa_start = 0x4805b000,
1287 .pa_end = 0x4805b1ff,
1288 .flags = ADDR_TYPE_RT
1289 },
1290};
1291
1292/* l4_per -> gpio5 */
1293static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio5 = {
1294 .master = &omap44xx_l4_per_hwmod,
1295 .slave = &omap44xx_gpio5_hwmod,
1296 .addr = omap44xx_gpio5_addrs,
1297 .addr_cnt = ARRAY_SIZE(omap44xx_gpio5_addrs),
1298 .user = OCP_USER_MPU | OCP_USER_SDMA,
1299};
1300
1301/* gpio5 slave ports */
1302static struct omap_hwmod_ocp_if *omap44xx_gpio5_slaves[] = {
1303 &omap44xx_l4_per__gpio5,
1304};
1305
1306static struct omap_hwmod_opt_clk gpio5_opt_clks[] = {
1307 { .role = "dbclk", .clk = "sys_32k_ck" },
1308};
1309
1310static struct omap_hwmod omap44xx_gpio5_hwmod = {
1311 .name = "gpio5",
1312 .class = &omap44xx_gpio_hwmod_class,
1313 .mpu_irqs = omap44xx_gpio5_irqs,
1314 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_gpio5_irqs),
1315 .main_clk = "gpio5_ick",
1316 .prcm = {
1317 .omap4 = {
1318 .clkctrl_reg = OMAP4430_CM_L4PER_GPIO5_CLKCTRL,
1319 },
1320 },
1321 .opt_clks = gpio5_opt_clks,
1322 .opt_clks_cnt = ARRAY_SIZE(gpio5_opt_clks),
1323 .dev_attr = &gpio_dev_attr,
1324 .slaves = omap44xx_gpio5_slaves,
1325 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio5_slaves),
1326 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1327};
1328
1329/* gpio6 */
1330static struct omap_hwmod omap44xx_gpio6_hwmod;
1331static struct omap_hwmod_irq_info omap44xx_gpio6_irqs[] = {
1332 { .irq = 34 + OMAP44XX_IRQ_GIC_START },
1333};
1334
1335static struct omap_hwmod_addr_space omap44xx_gpio6_addrs[] = {
1336 {
1337 .pa_start = 0x4805d000,
1338 .pa_end = 0x4805d1ff,
1339 .flags = ADDR_TYPE_RT
1340 },
1341};
1342
1343/* l4_per -> gpio6 */
1344static struct omap_hwmod_ocp_if omap44xx_l4_per__gpio6 = {
1345 .master = &omap44xx_l4_per_hwmod,
1346 .slave = &omap44xx_gpio6_hwmod,
1347 .addr = omap44xx_gpio6_addrs,
1348 .addr_cnt = ARRAY_SIZE(omap44xx_gpio6_addrs),
1349 .user = OCP_USER_MPU | OCP_USER_SDMA,
1350};
1351
1352/* gpio6 slave ports */
1353static struct omap_hwmod_ocp_if *omap44xx_gpio6_slaves[] = {
1354 &omap44xx_l4_per__gpio6,
1355};
1356
1357static struct omap_hwmod_opt_clk gpio6_opt_clks[] = {
1358 { .role = "dbclk", .clk = "sys_32k_ck" },
1359};
1360
1361static struct omap_hwmod omap44xx_gpio6_hwmod = {
1362 .name = "gpio6",
1363 .class = &omap44xx_gpio_hwmod_class,
1364 .mpu_irqs = omap44xx_gpio6_irqs,
1365 .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_gpio6_irqs),
1366 .main_clk = "gpio6_ick",
1367 .prcm = {
1368 .omap4 = {
1369 .clkctrl_reg = OMAP4430_CM_L4PER_GPIO6_CLKCTRL,
1370 },
1371 },
1372 .opt_clks = gpio6_opt_clks,
1373 .opt_clks_cnt = ARRAY_SIZE(gpio6_opt_clks),
1374 .dev_attr = &gpio_dev_attr,
1375 .slaves = omap44xx_gpio6_slaves,
1376 .slaves_cnt = ARRAY_SIZE(omap44xx_gpio6_slaves),
1377 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430),
1378};
1046static __initdata struct omap_hwmod *omap44xx_hwmods[] = { 1379static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
1047 /* dmm class */ 1380 /* dmm class */
1048 &omap44xx_dmm_hwmod, 1381 &omap44xx_dmm_hwmod,
@@ -1066,6 +1399,14 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = {
1066 /* mpu_bus class */ 1399 /* mpu_bus class */
1067 &omap44xx_mpu_private_hwmod, 1400 &omap44xx_mpu_private_hwmod,
1068 1401
1402 /* gpio class */
1403 &omap44xx_gpio1_hwmod,
1404 &omap44xx_gpio2_hwmod,
1405 &omap44xx_gpio3_hwmod,
1406 &omap44xx_gpio4_hwmod,
1407 &omap44xx_gpio5_hwmod,
1408 &omap44xx_gpio6_hwmod,
1409
1069 /* mpu class */ 1410 /* mpu class */
1070 &omap44xx_mpu_hwmod, 1411 &omap44xx_mpu_hwmod,
1071 /* wd_timer class */ 1412 /* wd_timer class */