diff options
author | Rajendra Nayak <rnayak@ti.com> | 2010-09-21 10:07:13 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2010-11-09 12:29:13 -0500 |
commit | 4fe20e97c8b1082d16b38e9f4c53feeed143ab98 (patch) | |
tree | 648572477f3cd089cc2499e00985c41e5058aec2 /arch/arm/mach-omap2 | |
parent | 2004290f55f03c52e22044a5843928cf0f6cc56a (diff) |
OMAP3: hwmod: add I2C hwmods for OMAP3430
Add hwmod structures for I2C controllers on OMAP3430.
This patch was developed in collaboration with Paul Walmsley
<paul@pwsan.com>.
OMAP3 fixes for correct IDLEST bit monitoring from
G, Manjunath Kondaiah <manjugk@ti.com>
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: G, Manjunath Kondaiah <manjugk@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 233 | ||||
-rw-r--r-- | arch/arm/mach-omap2/prm-regbits-34xx.h | 3 |
2 files changed, 236 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c index cb97ecf0a3f6..a8bed843079c 100644 --- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | |||
@@ -18,6 +18,9 @@ | |||
18 | #include <plat/cpu.h> | 18 | #include <plat/cpu.h> |
19 | #include <plat/dma.h> | 19 | #include <plat/dma.h> |
20 | #include <plat/serial.h> | 20 | #include <plat/serial.h> |
21 | #include <plat/l4_3xxx.h> | ||
22 | #include <plat/i2c.h> | ||
23 | #include <plat/omap34xx.h> | ||
21 | 24 | ||
22 | #include "omap_hwmod_common_data.h" | 25 | #include "omap_hwmod_common_data.h" |
23 | 26 | ||
@@ -39,6 +42,9 @@ static struct omap_hwmod omap3xxx_l3_main_hwmod; | |||
39 | static struct omap_hwmod omap3xxx_l4_core_hwmod; | 42 | static struct omap_hwmod omap3xxx_l4_core_hwmod; |
40 | static struct omap_hwmod omap3xxx_l4_per_hwmod; | 43 | static struct omap_hwmod omap3xxx_l4_per_hwmod; |
41 | static struct omap_hwmod omap3xxx_wd_timer2_hwmod; | 44 | static struct omap_hwmod omap3xxx_wd_timer2_hwmod; |
45 | static struct omap_hwmod omap3xxx_i2c1_hwmod; | ||
46 | static struct omap_hwmod omap3xxx_i2c2_hwmod; | ||
47 | static struct omap_hwmod omap3xxx_i2c3_hwmod; | ||
42 | 48 | ||
43 | /* L3 -> L4_CORE interface */ | 49 | /* L3 -> L4_CORE interface */ |
44 | static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_core = { | 50 | static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_core = { |
@@ -169,6 +175,84 @@ static struct omap_hwmod_ocp_if omap3_l4_per__uart4 = { | |||
169 | .user = OCP_USER_MPU | OCP_USER_SDMA, | 175 | .user = OCP_USER_MPU | OCP_USER_SDMA, |
170 | }; | 176 | }; |
171 | 177 | ||
178 | /* I2C IP block address space length (in bytes) */ | ||
179 | #define OMAP2_I2C_AS_LEN 128 | ||
180 | |||
181 | /* L4 CORE -> I2C1 interface */ | ||
182 | static struct omap_hwmod_addr_space omap3xxx_i2c1_addr_space[] = { | ||
183 | { | ||
184 | .pa_start = 0x48070000, | ||
185 | .pa_end = 0x48070000 + OMAP2_I2C_AS_LEN - 1, | ||
186 | .flags = ADDR_TYPE_RT, | ||
187 | }, | ||
188 | }; | ||
189 | |||
190 | static struct omap_hwmod_ocp_if omap3_l4_core__i2c1 = { | ||
191 | .master = &omap3xxx_l4_core_hwmod, | ||
192 | .slave = &omap3xxx_i2c1_hwmod, | ||
193 | .clk = "i2c1_ick", | ||
194 | .addr = omap3xxx_i2c1_addr_space, | ||
195 | .addr_cnt = ARRAY_SIZE(omap3xxx_i2c1_addr_space), | ||
196 | .fw = { | ||
197 | .omap2 = { | ||
198 | .l4_fw_region = OMAP3_L4_CORE_FW_I2C1_REGION, | ||
199 | .l4_prot_group = 7, | ||
200 | .flags = OMAP_FIREWALL_L4, | ||
201 | } | ||
202 | }, | ||
203 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
204 | }; | ||
205 | |||
206 | /* L4 CORE -> I2C2 interface */ | ||
207 | static struct omap_hwmod_addr_space omap3xxx_i2c2_addr_space[] = { | ||
208 | { | ||
209 | .pa_start = 0x48072000, | ||
210 | .pa_end = 0x48072000 + OMAP2_I2C_AS_LEN - 1, | ||
211 | .flags = ADDR_TYPE_RT, | ||
212 | }, | ||
213 | }; | ||
214 | |||
215 | static struct omap_hwmod_ocp_if omap3_l4_core__i2c2 = { | ||
216 | .master = &omap3xxx_l4_core_hwmod, | ||
217 | .slave = &omap3xxx_i2c2_hwmod, | ||
218 | .clk = "i2c2_ick", | ||
219 | .addr = omap3xxx_i2c2_addr_space, | ||
220 | .addr_cnt = ARRAY_SIZE(omap3xxx_i2c2_addr_space), | ||
221 | .fw = { | ||
222 | .omap2 = { | ||
223 | .l4_fw_region = OMAP3_L4_CORE_FW_I2C2_REGION, | ||
224 | .l4_prot_group = 7, | ||
225 | .flags = OMAP_FIREWALL_L4, | ||
226 | } | ||
227 | }, | ||
228 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
229 | }; | ||
230 | |||
231 | /* L4 CORE -> I2C3 interface */ | ||
232 | static struct omap_hwmod_addr_space omap3xxx_i2c3_addr_space[] = { | ||
233 | { | ||
234 | .pa_start = 0x48060000, | ||
235 | .pa_end = 0x48060000 + OMAP2_I2C_AS_LEN - 1, | ||
236 | .flags = ADDR_TYPE_RT, | ||
237 | }, | ||
238 | }; | ||
239 | |||
240 | static struct omap_hwmod_ocp_if omap3_l4_core__i2c3 = { | ||
241 | .master = &omap3xxx_l4_core_hwmod, | ||
242 | .slave = &omap3xxx_i2c3_hwmod, | ||
243 | .clk = "i2c3_ick", | ||
244 | .addr = omap3xxx_i2c3_addr_space, | ||
245 | .addr_cnt = ARRAY_SIZE(omap3xxx_i2c3_addr_space), | ||
246 | .fw = { | ||
247 | .omap2 = { | ||
248 | .l4_fw_region = OMAP3_L4_CORE_FW_I2C3_REGION, | ||
249 | .l4_prot_group = 7, | ||
250 | .flags = OMAP_FIREWALL_L4, | ||
251 | } | ||
252 | }, | ||
253 | .user = OCP_USER_MPU | OCP_USER_SDMA, | ||
254 | }; | ||
255 | |||
172 | /* Slave interfaces on the L4_CORE interconnect */ | 256 | /* Slave interfaces on the L4_CORE interconnect */ |
173 | static struct omap_hwmod_ocp_if *omap3xxx_l4_core_slaves[] = { | 257 | static struct omap_hwmod_ocp_if *omap3xxx_l4_core_slaves[] = { |
174 | &omap3xxx_l3_main__l4_core, | 258 | &omap3xxx_l3_main__l4_core, |
@@ -179,6 +263,9 @@ static struct omap_hwmod_ocp_if *omap3xxx_l4_core_masters[] = { | |||
179 | &omap3xxx_l4_core__l4_wkup, | 263 | &omap3xxx_l4_core__l4_wkup, |
180 | &omap3_l4_core__uart1, | 264 | &omap3_l4_core__uart1, |
181 | &omap3_l4_core__uart2, | 265 | &omap3_l4_core__uart2, |
266 | &omap3_l4_core__i2c1, | ||
267 | &omap3_l4_core__i2c2, | ||
268 | &omap3_l4_core__i2c3, | ||
182 | }; | 269 | }; |
183 | 270 | ||
184 | /* L4 CORE */ | 271 | /* L4 CORE */ |
@@ -315,6 +402,18 @@ static struct omap_hwmod_class_sysconfig omap3xxx_wd_timer_sysc = { | |||
315 | .sysc_fields = &omap_hwmod_sysc_type1, | 402 | .sysc_fields = &omap_hwmod_sysc_type1, |
316 | }; | 403 | }; |
317 | 404 | ||
405 | /* I2C common */ | ||
406 | static struct omap_hwmod_class_sysconfig i2c_sysc = { | ||
407 | .rev_offs = 0x00, | ||
408 | .sysc_offs = 0x20, | ||
409 | .syss_offs = 0x10, | ||
410 | .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE | | ||
411 | SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | | ||
412 | SYSC_HAS_AUTOIDLE), | ||
413 | .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), | ||
414 | .sysc_fields = &omap_hwmod_sysc_type1, | ||
415 | }; | ||
416 | |||
318 | static struct omap_hwmod_class omap3xxx_wd_timer_hwmod_class = { | 417 | static struct omap_hwmod_class omap3xxx_wd_timer_hwmod_class = { |
319 | .name = "wd_timer", | 418 | .name = "wd_timer", |
320 | .sysc = &omap3xxx_wd_timer_sysc, | 419 | .sysc = &omap3xxx_wd_timer_sysc, |
@@ -509,6 +608,137 @@ static struct omap_hwmod omap3xxx_uart4_hwmod = { | |||
509 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1), | 608 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1), |
510 | }; | 609 | }; |
511 | 610 | ||
611 | static struct omap_hwmod_class i2c_class = { | ||
612 | .name = "i2c", | ||
613 | .sysc = &i2c_sysc, | ||
614 | }; | ||
615 | |||
616 | /* I2C1 */ | ||
617 | |||
618 | static struct omap_i2c_dev_attr i2c1_dev_attr = { | ||
619 | .fifo_depth = 8, /* bytes */ | ||
620 | }; | ||
621 | |||
622 | static struct omap_hwmod_irq_info i2c1_mpu_irqs[] = { | ||
623 | { .irq = INT_24XX_I2C1_IRQ, }, | ||
624 | }; | ||
625 | |||
626 | static struct omap_hwmod_dma_info i2c1_sdma_reqs[] = { | ||
627 | { .name = "tx", .dma_req = OMAP24XX_DMA_I2C1_TX }, | ||
628 | { .name = "rx", .dma_req = OMAP24XX_DMA_I2C1_RX }, | ||
629 | }; | ||
630 | |||
631 | static struct omap_hwmod_ocp_if *omap3xxx_i2c1_slaves[] = { | ||
632 | &omap3_l4_core__i2c1, | ||
633 | }; | ||
634 | |||
635 | static struct omap_hwmod omap3xxx_i2c1_hwmod = { | ||
636 | .name = "i2c1", | ||
637 | .mpu_irqs = i2c1_mpu_irqs, | ||
638 | .mpu_irqs_cnt = ARRAY_SIZE(i2c1_mpu_irqs), | ||
639 | .sdma_reqs = i2c1_sdma_reqs, | ||
640 | .sdma_reqs_cnt = ARRAY_SIZE(i2c1_sdma_reqs), | ||
641 | .main_clk = "i2c1_fck", | ||
642 | .prcm = { | ||
643 | .omap2 = { | ||
644 | .module_offs = CORE_MOD, | ||
645 | .prcm_reg_id = 1, | ||
646 | .module_bit = OMAP3430_EN_I2C1_SHIFT, | ||
647 | .idlest_reg_id = 1, | ||
648 | .idlest_idle_bit = OMAP3430_ST_I2C1_SHIFT, | ||
649 | }, | ||
650 | }, | ||
651 | .slaves = omap3xxx_i2c1_slaves, | ||
652 | .slaves_cnt = ARRAY_SIZE(omap3xxx_i2c1_slaves), | ||
653 | .class = &i2c_class, | ||
654 | .dev_attr = &i2c1_dev_attr, | ||
655 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
656 | }; | ||
657 | |||
658 | /* I2C2 */ | ||
659 | |||
660 | static struct omap_i2c_dev_attr i2c2_dev_attr = { | ||
661 | .fifo_depth = 8, /* bytes */ | ||
662 | }; | ||
663 | |||
664 | static struct omap_hwmod_irq_info i2c2_mpu_irqs[] = { | ||
665 | { .irq = INT_24XX_I2C2_IRQ, }, | ||
666 | }; | ||
667 | |||
668 | static struct omap_hwmod_dma_info i2c2_sdma_reqs[] = { | ||
669 | { .name = "tx", .dma_req = OMAP24XX_DMA_I2C2_TX }, | ||
670 | { .name = "rx", .dma_req = OMAP24XX_DMA_I2C2_RX }, | ||
671 | }; | ||
672 | |||
673 | static struct omap_hwmod_ocp_if *omap3xxx_i2c2_slaves[] = { | ||
674 | &omap3_l4_core__i2c2, | ||
675 | }; | ||
676 | |||
677 | static struct omap_hwmod omap3xxx_i2c2_hwmod = { | ||
678 | .name = "i2c2", | ||
679 | .mpu_irqs = i2c2_mpu_irqs, | ||
680 | .mpu_irqs_cnt = ARRAY_SIZE(i2c2_mpu_irqs), | ||
681 | .sdma_reqs = i2c2_sdma_reqs, | ||
682 | .sdma_reqs_cnt = ARRAY_SIZE(i2c2_sdma_reqs), | ||
683 | .main_clk = "i2c2_fck", | ||
684 | .prcm = { | ||
685 | .omap2 = { | ||
686 | .module_offs = CORE_MOD, | ||
687 | .prcm_reg_id = 1, | ||
688 | .module_bit = OMAP3430_EN_I2C2_SHIFT, | ||
689 | .idlest_reg_id = 1, | ||
690 | .idlest_idle_bit = OMAP3430_ST_I2C2_SHIFT, | ||
691 | }, | ||
692 | }, | ||
693 | .slaves = omap3xxx_i2c2_slaves, | ||
694 | .slaves_cnt = ARRAY_SIZE(omap3xxx_i2c2_slaves), | ||
695 | .class = &i2c_class, | ||
696 | .dev_attr = &i2c2_dev_attr, | ||
697 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
698 | }; | ||
699 | |||
700 | /* I2C3 */ | ||
701 | |||
702 | static struct omap_i2c_dev_attr i2c3_dev_attr = { | ||
703 | .fifo_depth = 64, /* bytes */ | ||
704 | }; | ||
705 | |||
706 | static struct omap_hwmod_irq_info i2c3_mpu_irqs[] = { | ||
707 | { .irq = INT_34XX_I2C3_IRQ, }, | ||
708 | }; | ||
709 | |||
710 | static struct omap_hwmod_dma_info i2c3_sdma_reqs[] = { | ||
711 | { .name = "tx", .dma_req = OMAP34XX_DMA_I2C3_TX }, | ||
712 | { .name = "rx", .dma_req = OMAP34XX_DMA_I2C3_RX }, | ||
713 | }; | ||
714 | |||
715 | static struct omap_hwmod_ocp_if *omap3xxx_i2c3_slaves[] = { | ||
716 | &omap3_l4_core__i2c3, | ||
717 | }; | ||
718 | |||
719 | static struct omap_hwmod omap3xxx_i2c3_hwmod = { | ||
720 | .name = "i2c3", | ||
721 | .mpu_irqs = i2c3_mpu_irqs, | ||
722 | .mpu_irqs_cnt = ARRAY_SIZE(i2c3_mpu_irqs), | ||
723 | .sdma_reqs = i2c3_sdma_reqs, | ||
724 | .sdma_reqs_cnt = ARRAY_SIZE(i2c3_sdma_reqs), | ||
725 | .main_clk = "i2c3_fck", | ||
726 | .prcm = { | ||
727 | .omap2 = { | ||
728 | .module_offs = CORE_MOD, | ||
729 | .prcm_reg_id = 1, | ||
730 | .module_bit = OMAP3430_EN_I2C3_SHIFT, | ||
731 | .idlest_reg_id = 1, | ||
732 | .idlest_idle_bit = OMAP3430_ST_I2C3_SHIFT, | ||
733 | }, | ||
734 | }, | ||
735 | .slaves = omap3xxx_i2c3_slaves, | ||
736 | .slaves_cnt = ARRAY_SIZE(omap3xxx_i2c3_slaves), | ||
737 | .class = &i2c_class, | ||
738 | .dev_attr = &i2c3_dev_attr, | ||
739 | .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), | ||
740 | }; | ||
741 | |||
512 | static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { | 742 | static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { |
513 | &omap3xxx_l3_main_hwmod, | 743 | &omap3xxx_l3_main_hwmod, |
514 | &omap3xxx_l4_core_hwmod, | 744 | &omap3xxx_l4_core_hwmod, |
@@ -521,6 +751,9 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { | |||
521 | &omap3xxx_uart2_hwmod, | 751 | &omap3xxx_uart2_hwmod, |
522 | &omap3xxx_uart3_hwmod, | 752 | &omap3xxx_uart3_hwmod, |
523 | &omap3xxx_uart4_hwmod, | 753 | &omap3xxx_uart4_hwmod, |
754 | &omap3xxx_i2c1_hwmod, | ||
755 | &omap3xxx_i2c2_hwmod, | ||
756 | &omap3xxx_i2c3_hwmod, | ||
524 | NULL, | 757 | NULL, |
525 | }; | 758 | }; |
526 | 759 | ||
diff --git a/arch/arm/mach-omap2/prm-regbits-34xx.h b/arch/arm/mach-omap2/prm-regbits-34xx.h index 9e63cb743a97..ec1a710db9ce 100644 --- a/arch/arm/mach-omap2/prm-regbits-34xx.h +++ b/arch/arm/mach-omap2/prm-regbits-34xx.h | |||
@@ -101,8 +101,11 @@ | |||
101 | #define OMAP3430_GRPSEL_MCSPI3_MASK (1 << 20) | 101 | #define OMAP3430_GRPSEL_MCSPI3_MASK (1 << 20) |
102 | #define OMAP3430_GRPSEL_MCSPI2_MASK (1 << 19) | 102 | #define OMAP3430_GRPSEL_MCSPI2_MASK (1 << 19) |
103 | #define OMAP3430_GRPSEL_MCSPI1_MASK (1 << 18) | 103 | #define OMAP3430_GRPSEL_MCSPI1_MASK (1 << 18) |
104 | #define OMAP3430_GRPSEL_I2C3_SHIFT 17 | ||
104 | #define OMAP3430_GRPSEL_I2C3_MASK (1 << 17) | 105 | #define OMAP3430_GRPSEL_I2C3_MASK (1 << 17) |
106 | #define OMAP3430_GRPSEL_I2C2_SHIFT 16 | ||
105 | #define OMAP3430_GRPSEL_I2C2_MASK (1 << 16) | 107 | #define OMAP3430_GRPSEL_I2C2_MASK (1 << 16) |
108 | #define OMAP3430_GRPSEL_I2C1_SHIFT 15 | ||
106 | #define OMAP3430_GRPSEL_I2C1_MASK (1 << 15) | 109 | #define OMAP3430_GRPSEL_I2C1_MASK (1 << 15) |
107 | #define OMAP3430_GRPSEL_UART2_MASK (1 << 14) | 110 | #define OMAP3430_GRPSEL_UART2_MASK (1 << 14) |
108 | #define OMAP3430_GRPSEL_UART1_MASK (1 << 13) | 111 | #define OMAP3430_GRPSEL_UART1_MASK (1 << 13) |