diff options
author | Varadarajan, Charulatha <charu@ti.com> | 2010-12-07 19:26:56 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2010-12-07 19:26:56 -0500 |
commit | 59c348c38fbe85e6e86c711b9a38c37315008d9e (patch) | |
tree | 874b3c0b77c74453f798ad8145fd343b2b688e4a /arch | |
parent | 9d52342c27b7b43c4a7b24bac24ff7bee0b80e07 (diff) |
OMAP2420: hwmod data: Add GPIO
Add GPIO hwmod data for OMAP2420 and add the required
GPIO device attributes in the gpio header file
Also remove "omap24xx.h" header file as it is not required
anymore.
Signed-off-by: Charulatha V <charu@ti.com>
Acked-by: Benoit Cousson <b-cousson@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod_2420_data.c | 230 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/gpio.h | 5 |
2 files changed, 234 insertions, 1 deletions
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; | |||
38 | static struct omap_hwmod omap2420_l3_main_hwmod; | 38 | static struct omap_hwmod omap2420_l3_main_hwmod; |
39 | static struct omap_hwmod omap2420_l4_core_hwmod; | 39 | static struct omap_hwmod omap2420_l4_core_hwmod; |
40 | static struct omap_hwmod omap2420_wd_timer2_hwmod; | 40 | static struct omap_hwmod omap2420_wd_timer2_hwmod; |
41 | static struct omap_hwmod omap2420_gpio1_hwmod; | ||
42 | static struct omap_hwmod omap2420_gpio2_hwmod; | ||
43 | static struct omap_hwmod omap2420_gpio3_hwmod; | ||
44 | static struct omap_hwmod omap2420_gpio4_hwmod; | ||
41 | 45 | ||
42 | /* L3 -> L4_CORE interface */ | 46 | /* L3 -> L4_CORE interface */ |
43 | static struct omap_hwmod_ocp_if omap2420_l3_main__l4_core = { | 47 | static 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 */ | ||
565 | static 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 | |||
573 | static 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 */ | ||
583 | static 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 | |||
591 | static 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 */ | ||
601 | static 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 | |||
609 | static 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 */ | ||
619 | static 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 | |||
627 | static 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 */ | ||
637 | static struct omap_gpio_dev_attr gpio_dev_attr = { | ||
638 | .bank_width = 32, | ||
639 | .dbck_flag = false, | ||
640 | }; | ||
641 | |||
642 | static 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 | */ | ||
656 | static struct omap_hwmod_class omap242x_gpio_hwmod_class = { | ||
657 | .name = "gpio", | ||
658 | .sysc = &omap242x_gpio_sysc, | ||
659 | .rev = 0, | ||
660 | }; | ||
661 | |||
662 | /* gpio1 */ | ||
663 | static struct omap_hwmod_irq_info omap242x_gpio1_irqs[] = { | ||
664 | { .irq = 29 }, /* INT_24XX_GPIO_BANK1 */ | ||
665 | }; | ||
666 | |||
667 | static struct omap_hwmod_ocp_if *omap2420_gpio1_slaves[] = { | ||
668 | &omap2420_l4_wkup__gpio1, | ||
669 | }; | ||
670 | |||
671 | static 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 */ | ||
693 | static struct omap_hwmod_irq_info omap242x_gpio2_irqs[] = { | ||
694 | { .irq = 30 }, /* INT_24XX_GPIO_BANK2 */ | ||
695 | }; | ||
696 | |||
697 | static struct omap_hwmod_ocp_if *omap2420_gpio2_slaves[] = { | ||
698 | &omap2420_l4_wkup__gpio2, | ||
699 | }; | ||
700 | |||
701 | static 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 */ | ||
723 | static struct omap_hwmod_irq_info omap242x_gpio3_irqs[] = { | ||
724 | { .irq = 31 }, /* INT_24XX_GPIO_BANK3 */ | ||
725 | }; | ||
726 | |||
727 | static struct omap_hwmod_ocp_if *omap2420_gpio3_slaves[] = { | ||
728 | &omap2420_l4_wkup__gpio3, | ||
729 | }; | ||
730 | |||
731 | static 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 */ | ||
753 | static struct omap_hwmod_irq_info omap242x_gpio4_irqs[] = { | ||
754 | { .irq = 32 }, /* INT_24XX_GPIO_BANK4 */ | ||
755 | }; | ||
756 | |||
757 | static struct omap_hwmod_ocp_if *omap2420_gpio4_slaves[] = { | ||
758 | &omap2420_l4_wkup__gpio4, | ||
759 | }; | ||
760 | |||
761 | static 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 | |||
560 | static __initdata struct omap_hwmod *omap2420_hwmods[] = { | 782 | static __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/plat-omap/include/plat/gpio.h b/arch/arm/plat-omap/include/plat/gpio.h index 5bef86d76a6a..24892a6707c4 100644 --- a/arch/arm/plat-omap/include/plat/gpio.h +++ b/arch/arm/plat-omap/include/plat/gpio.h | |||
@@ -79,6 +79,11 @@ | |||
79 | #define METHOD_GPIO_24XX 5 | 79 | #define METHOD_GPIO_24XX 5 |
80 | #define METHOD_GPIO_44XX 6 | 80 | #define METHOD_GPIO_44XX 6 |
81 | 81 | ||
82 | struct omap_gpio_dev_attr { | ||
83 | int bank_width; /* GPIO bank width */ | ||
84 | bool dbck_flag; /* dbck required or not - True for OMAP3&4 */ | ||
85 | }; | ||
86 | |||
82 | struct omap_gpio_platform_data { | 87 | struct omap_gpio_platform_data { |
83 | u16 virtual_irq_start; | 88 | u16 virtual_irq_start; |
84 | int bank_type; | 89 | int bank_type; |