2 * omap_hwmod_2xxx_ipblock_data.c - common IP block data for OMAP2xxx
4 * Copyright (C) 2011 Nokia Corporation
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 #include <plat/omap_hwmod.h>
12 #include <plat/serial.h>
13 #include <plat/gpio.h>
15 #include <plat/dmtimer.h>
16 #include <plat/mcspi.h>
18 #include <mach/irqs.h>
20 #include "omap_hwmod_common_data.h"
21 #include "cm-regbits-24xx.h"
22 #include "prm-regbits-24xx.h"
25 struct omap_hwmod_irq_info omap2xxx_timer12_mpu_irqs
[] = {
30 struct omap_hwmod_dma_info omap2xxx_dss_sdma_chs
[] = {
31 { .name
= "dispc", .dma_req
= 5 },
40 static struct omap_hwmod_class_sysconfig omap2_dispc_sysc
= {
44 .sysc_flags
= (SYSC_HAS_SIDLEMODE
| SYSC_HAS_MIDLEMODE
|
45 SYSC_HAS_SOFTRESET
| SYSC_HAS_AUTOIDLE
),
46 .idlemodes
= (SIDLE_FORCE
| SIDLE_NO
| SIDLE_SMART
|
47 MSTANDBY_FORCE
| MSTANDBY_NO
| MSTANDBY_SMART
),
48 .sysc_fields
= &omap_hwmod_sysc_type1
,
51 struct omap_hwmod_class omap2_dispc_hwmod_class
= {
53 .sysc
= &omap2_dispc_sysc
,
56 /* OMAP2xxx Timer Common */
57 static struct omap_hwmod_class_sysconfig omap2xxx_timer_sysc
= {
61 .sysc_flags
= (SYSC_HAS_SIDLEMODE
| SYSC_HAS_CLOCKACTIVITY
|
62 SYSC_HAS_ENAWAKEUP
| SYSC_HAS_SOFTRESET
|
64 .idlemodes
= (SIDLE_FORCE
| SIDLE_NO
| SIDLE_SMART
),
65 .sysc_fields
= &omap_hwmod_sysc_type1
,
68 struct omap_hwmod_class omap2xxx_timer_hwmod_class
= {
70 .sysc
= &omap2xxx_timer_sysc
,
75 * 32-bit watchdog upward counter that generates a pulse on the reset pin on
79 static struct omap_hwmod_class_sysconfig omap2xxx_wd_timer_sysc
= {
83 .sysc_flags
= (SYSC_HAS_EMUFREE
| SYSC_HAS_SOFTRESET
|
84 SYSC_HAS_AUTOIDLE
| SYSS_HAS_RESET_STATUS
),
85 .sysc_fields
= &omap_hwmod_sysc_type1
,
88 struct omap_hwmod_class omap2xxx_wd_timer_hwmod_class
= {
90 .sysc
= &omap2xxx_wd_timer_sysc
,
91 .pre_shutdown
= &omap2_wd_timer_disable
,
92 .reset
= &omap2_wd_timer_reset
,
97 * general purpose io module
99 static struct omap_hwmod_class_sysconfig omap2xxx_gpio_sysc
= {
103 .sysc_flags
= (SYSC_HAS_ENAWAKEUP
| SYSC_HAS_SIDLEMODE
|
104 SYSC_HAS_SOFTRESET
| SYSC_HAS_AUTOIDLE
|
105 SYSS_HAS_RESET_STATUS
),
106 .idlemodes
= (SIDLE_FORCE
| SIDLE_NO
| SIDLE_SMART
),
107 .sysc_fields
= &omap_hwmod_sysc_type1
,
110 struct omap_hwmod_class omap2xxx_gpio_hwmod_class
= {
112 .sysc
= &omap2xxx_gpio_sysc
,
117 static struct omap_hwmod_class_sysconfig omap2xxx_dma_sysc
= {
121 .sysc_flags
= (SYSC_HAS_SOFTRESET
| SYSC_HAS_MIDLEMODE
|
122 SYSC_HAS_CLOCKACTIVITY
| SYSC_HAS_EMUFREE
|
123 SYSC_HAS_AUTOIDLE
| SYSS_HAS_RESET_STATUS
),
124 .idlemodes
= (MSTANDBY_FORCE
| MSTANDBY_NO
| MSTANDBY_SMART
),
125 .sysc_fields
= &omap_hwmod_sysc_type1
,
128 struct omap_hwmod_class omap2xxx_dma_hwmod_class
= {
130 .sysc
= &omap2xxx_dma_sysc
,
135 * mailbox module allowing communication between the on-chip processors
136 * using a queued mailbox-interrupt mechanism.
139 static struct omap_hwmod_class_sysconfig omap2xxx_mailbox_sysc
= {
143 .sysc_flags
= (SYSC_HAS_CLOCKACTIVITY
| SYSC_HAS_SIDLEMODE
|
144 SYSC_HAS_SOFTRESET
| SYSC_HAS_AUTOIDLE
),
145 .idlemodes
= (SIDLE_FORCE
| SIDLE_NO
| SIDLE_SMART
),
146 .sysc_fields
= &omap_hwmod_sysc_type1
,
149 struct omap_hwmod_class omap2xxx_mailbox_hwmod_class
= {
151 .sysc
= &omap2xxx_mailbox_sysc
,
156 * multichannel serial port interface (mcspi) / master/slave synchronous serial
160 static struct omap_hwmod_class_sysconfig omap2xxx_mcspi_sysc
= {
164 .sysc_flags
= (SYSC_HAS_CLOCKACTIVITY
| SYSC_HAS_SIDLEMODE
|
165 SYSC_HAS_ENAWAKEUP
| SYSC_HAS_SOFTRESET
|
166 SYSC_HAS_AUTOIDLE
| SYSS_HAS_RESET_STATUS
),
167 .idlemodes
= (SIDLE_FORCE
| SIDLE_NO
| SIDLE_SMART
),
168 .sysc_fields
= &omap_hwmod_sysc_type1
,
171 struct omap_hwmod_class omap2xxx_mcspi_class
= {
173 .sysc
= &omap2xxx_mcspi_sysc
,
174 .rev
= OMAP2_MCSPI_REV
,
182 struct omap_hwmod omap2xxx_l3_main_hwmod
= {
184 .class = &l3_hwmod_class
,
185 .flags
= HWMOD_NO_IDLEST
,
189 struct omap_hwmod omap2xxx_l4_core_hwmod
= {
191 .class = &l4_hwmod_class
,
192 .flags
= HWMOD_NO_IDLEST
,
196 struct omap_hwmod omap2xxx_l4_wkup_hwmod
= {
198 .class = &l4_hwmod_class
,
199 .flags
= HWMOD_NO_IDLEST
,
203 struct omap_hwmod omap2xxx_mpu_hwmod
= {
205 .class = &mpu_hwmod_class
,
206 .main_clk
= "mpu_ck",
210 struct omap_hwmod omap2xxx_iva_hwmod
= {
212 .class = &iva_hwmod_class
,
215 /* always-on timers dev attribute */
216 static struct omap_timer_capability_dev_attr capability_alwon_dev_attr
= {
217 .timer_capability
= OMAP_TIMER_ALWON
,
220 /* pwm timers dev attribute */
221 static struct omap_timer_capability_dev_attr capability_pwm_dev_attr
= {
222 .timer_capability
= OMAP_TIMER_HAS_PWM
,
227 struct omap_hwmod omap2xxx_timer1_hwmod
= {
229 .mpu_irqs
= omap2_timer1_mpu_irqs
,
230 .main_clk
= "gpt1_fck",
234 .module_bit
= OMAP24XX_EN_GPT1_SHIFT
,
235 .module_offs
= WKUP_MOD
,
237 .idlest_idle_bit
= OMAP24XX_ST_GPT1_SHIFT
,
240 .dev_attr
= &capability_alwon_dev_attr
,
241 .class = &omap2xxx_timer_hwmod_class
,
246 struct omap_hwmod omap2xxx_timer2_hwmod
= {
248 .mpu_irqs
= omap2_timer2_mpu_irqs
,
249 .main_clk
= "gpt2_fck",
253 .module_bit
= OMAP24XX_EN_GPT2_SHIFT
,
254 .module_offs
= CORE_MOD
,
256 .idlest_idle_bit
= OMAP24XX_ST_GPT2_SHIFT
,
259 .class = &omap2xxx_timer_hwmod_class
,
264 struct omap_hwmod omap2xxx_timer3_hwmod
= {
266 .mpu_irqs
= omap2_timer3_mpu_irqs
,
267 .main_clk
= "gpt3_fck",
271 .module_bit
= OMAP24XX_EN_GPT3_SHIFT
,
272 .module_offs
= CORE_MOD
,
274 .idlest_idle_bit
= OMAP24XX_ST_GPT3_SHIFT
,
277 .class = &omap2xxx_timer_hwmod_class
,
282 struct omap_hwmod omap2xxx_timer4_hwmod
= {
284 .mpu_irqs
= omap2_timer4_mpu_irqs
,
285 .main_clk
= "gpt4_fck",
289 .module_bit
= OMAP24XX_EN_GPT4_SHIFT
,
290 .module_offs
= CORE_MOD
,
292 .idlest_idle_bit
= OMAP24XX_ST_GPT4_SHIFT
,
295 .class = &omap2xxx_timer_hwmod_class
,
300 struct omap_hwmod omap2xxx_timer5_hwmod
= {
302 .mpu_irqs
= omap2_timer5_mpu_irqs
,
303 .main_clk
= "gpt5_fck",
307 .module_bit
= OMAP24XX_EN_GPT5_SHIFT
,
308 .module_offs
= CORE_MOD
,
310 .idlest_idle_bit
= OMAP24XX_ST_GPT5_SHIFT
,
313 .class = &omap2xxx_timer_hwmod_class
,
318 struct omap_hwmod omap2xxx_timer6_hwmod
= {
320 .mpu_irqs
= omap2_timer6_mpu_irqs
,
321 .main_clk
= "gpt6_fck",
325 .module_bit
= OMAP24XX_EN_GPT6_SHIFT
,
326 .module_offs
= CORE_MOD
,
328 .idlest_idle_bit
= OMAP24XX_ST_GPT6_SHIFT
,
331 .class = &omap2xxx_timer_hwmod_class
,
336 struct omap_hwmod omap2xxx_timer7_hwmod
= {
338 .mpu_irqs
= omap2_timer7_mpu_irqs
,
339 .main_clk
= "gpt7_fck",
343 .module_bit
= OMAP24XX_EN_GPT7_SHIFT
,
344 .module_offs
= CORE_MOD
,
346 .idlest_idle_bit
= OMAP24XX_ST_GPT7_SHIFT
,
349 .class = &omap2xxx_timer_hwmod_class
,
354 struct omap_hwmod omap2xxx_timer8_hwmod
= {
356 .mpu_irqs
= omap2_timer8_mpu_irqs
,
357 .main_clk
= "gpt8_fck",
361 .module_bit
= OMAP24XX_EN_GPT8_SHIFT
,
362 .module_offs
= CORE_MOD
,
364 .idlest_idle_bit
= OMAP24XX_ST_GPT8_SHIFT
,
367 .class = &omap2xxx_timer_hwmod_class
,
372 struct omap_hwmod omap2xxx_timer9_hwmod
= {
374 .mpu_irqs
= omap2_timer9_mpu_irqs
,
375 .main_clk
= "gpt9_fck",
379 .module_bit
= OMAP24XX_EN_GPT9_SHIFT
,
380 .module_offs
= CORE_MOD
,
382 .idlest_idle_bit
= OMAP24XX_ST_GPT9_SHIFT
,
385 .dev_attr
= &capability_pwm_dev_attr
,
386 .class = &omap2xxx_timer_hwmod_class
,
391 struct omap_hwmod omap2xxx_timer10_hwmod
= {
393 .mpu_irqs
= omap2_timer10_mpu_irqs
,
394 .main_clk
= "gpt10_fck",
398 .module_bit
= OMAP24XX_EN_GPT10_SHIFT
,
399 .module_offs
= CORE_MOD
,
401 .idlest_idle_bit
= OMAP24XX_ST_GPT10_SHIFT
,
404 .dev_attr
= &capability_pwm_dev_attr
,
405 .class = &omap2xxx_timer_hwmod_class
,
410 struct omap_hwmod omap2xxx_timer11_hwmod
= {
412 .mpu_irqs
= omap2_timer11_mpu_irqs
,
413 .main_clk
= "gpt11_fck",
417 .module_bit
= OMAP24XX_EN_GPT11_SHIFT
,
418 .module_offs
= CORE_MOD
,
420 .idlest_idle_bit
= OMAP24XX_ST_GPT11_SHIFT
,
423 .dev_attr
= &capability_pwm_dev_attr
,
424 .class = &omap2xxx_timer_hwmod_class
,
429 struct omap_hwmod omap2xxx_timer12_hwmod
= {
431 .mpu_irqs
= omap2xxx_timer12_mpu_irqs
,
432 .main_clk
= "gpt12_fck",
436 .module_bit
= OMAP24XX_EN_GPT12_SHIFT
,
437 .module_offs
= CORE_MOD
,
439 .idlest_idle_bit
= OMAP24XX_ST_GPT12_SHIFT
,
442 .dev_attr
= &capability_pwm_dev_attr
,
443 .class = &omap2xxx_timer_hwmod_class
,
447 struct omap_hwmod omap2xxx_wd_timer2_hwmod
= {
449 .class = &omap2xxx_wd_timer_hwmod_class
,
450 .main_clk
= "mpu_wdt_fck",
454 .module_bit
= OMAP24XX_EN_MPU_WDT_SHIFT
,
455 .module_offs
= WKUP_MOD
,
457 .idlest_idle_bit
= OMAP24XX_ST_MPU_WDT_SHIFT
,
464 struct omap_hwmod omap2xxx_uart1_hwmod
= {
466 .mpu_irqs
= omap2_uart1_mpu_irqs
,
467 .sdma_reqs
= omap2_uart1_sdma_reqs
,
468 .main_clk
= "uart1_fck",
471 .module_offs
= CORE_MOD
,
473 .module_bit
= OMAP24XX_EN_UART1_SHIFT
,
475 .idlest_idle_bit
= OMAP24XX_EN_UART1_SHIFT
,
478 .class = &omap2_uart_class
,
483 struct omap_hwmod omap2xxx_uart2_hwmod
= {
485 .mpu_irqs
= omap2_uart2_mpu_irqs
,
486 .sdma_reqs
= omap2_uart2_sdma_reqs
,
487 .main_clk
= "uart2_fck",
490 .module_offs
= CORE_MOD
,
492 .module_bit
= OMAP24XX_EN_UART2_SHIFT
,
494 .idlest_idle_bit
= OMAP24XX_EN_UART2_SHIFT
,
497 .class = &omap2_uart_class
,
502 struct omap_hwmod omap2xxx_uart3_hwmod
= {
504 .mpu_irqs
= omap2_uart3_mpu_irqs
,
505 .sdma_reqs
= omap2_uart3_sdma_reqs
,
506 .main_clk
= "uart3_fck",
509 .module_offs
= CORE_MOD
,
511 .module_bit
= OMAP24XX_EN_UART3_SHIFT
,
513 .idlest_idle_bit
= OMAP24XX_EN_UART3_SHIFT
,
516 .class = &omap2_uart_class
,
521 static struct omap_hwmod_opt_clk dss_opt_clks
[] = {
523 * The DSS HW needs all DSS clocks enabled during reset. The dss_core
524 * driver does not use these clocks.
526 { .role
= "tv_clk", .clk
= "dss_54m_fck" },
527 { .role
= "sys_clk", .clk
= "dss2_fck" },
530 struct omap_hwmod omap2xxx_dss_core_hwmod
= {
532 .class = &omap2_dss_hwmod_class
,
533 .main_clk
= "dss1_fck", /* instead of dss_fck */
534 .sdma_reqs
= omap2xxx_dss_sdma_chs
,
538 .module_bit
= OMAP24XX_EN_DSS1_SHIFT
,
539 .module_offs
= CORE_MOD
,
541 .idlest_stdby_bit
= OMAP24XX_ST_DSS_SHIFT
,
544 .opt_clks
= dss_opt_clks
,
545 .opt_clks_cnt
= ARRAY_SIZE(dss_opt_clks
),
546 .flags
= HWMOD_NO_IDLEST
| HWMOD_CONTROL_OPT_CLKS_IN_RESET
,
549 struct omap_hwmod omap2xxx_dss_dispc_hwmod
= {
551 .class = &omap2_dispc_hwmod_class
,
552 .mpu_irqs
= omap2_dispc_irqs
,
553 .main_clk
= "dss1_fck",
557 .module_bit
= OMAP24XX_EN_DSS1_SHIFT
,
558 .module_offs
= CORE_MOD
,
560 .idlest_stdby_bit
= OMAP24XX_ST_DSS_SHIFT
,
563 .flags
= HWMOD_NO_IDLEST
,
564 .dev_attr
= &omap2_3_dss_dispc_dev_attr
567 static struct omap_hwmod_opt_clk dss_rfbi_opt_clks
[] = {
568 { .role
= "ick", .clk
= "dss_ick" },
571 struct omap_hwmod omap2xxx_dss_rfbi_hwmod
= {
573 .class = &omap2_rfbi_hwmod_class
,
574 .main_clk
= "dss1_fck",
578 .module_bit
= OMAP24XX_EN_DSS1_SHIFT
,
579 .module_offs
= CORE_MOD
,
582 .opt_clks
= dss_rfbi_opt_clks
,
583 .opt_clks_cnt
= ARRAY_SIZE(dss_rfbi_opt_clks
),
584 .flags
= HWMOD_NO_IDLEST
,
587 struct omap_hwmod omap2xxx_dss_venc_hwmod
= {
589 .class = &omap2_venc_hwmod_class
,
590 .main_clk
= "dss_54m_fck",
594 .module_bit
= OMAP24XX_EN_DSS1_SHIFT
,
595 .module_offs
= CORE_MOD
,
598 .flags
= HWMOD_NO_IDLEST
,
602 struct omap_gpio_dev_attr omap2xxx_gpio_dev_attr
= {
608 struct omap_hwmod omap2xxx_gpio1_hwmod
= {
610 .flags
= HWMOD_CONTROL_OPT_CLKS_IN_RESET
,
611 .mpu_irqs
= omap2_gpio1_irqs
,
612 .main_clk
= "gpios_fck",
616 .module_bit
= OMAP24XX_EN_GPIOS_SHIFT
,
617 .module_offs
= WKUP_MOD
,
619 .idlest_idle_bit
= OMAP24XX_ST_GPIOS_SHIFT
,
622 .class = &omap2xxx_gpio_hwmod_class
,
623 .dev_attr
= &omap2xxx_gpio_dev_attr
,
627 struct omap_hwmod omap2xxx_gpio2_hwmod
= {
629 .flags
= HWMOD_CONTROL_OPT_CLKS_IN_RESET
,
630 .mpu_irqs
= omap2_gpio2_irqs
,
631 .main_clk
= "gpios_fck",
635 .module_bit
= OMAP24XX_EN_GPIOS_SHIFT
,
636 .module_offs
= WKUP_MOD
,
638 .idlest_idle_bit
= OMAP24XX_ST_GPIOS_SHIFT
,
641 .class = &omap2xxx_gpio_hwmod_class
,
642 .dev_attr
= &omap2xxx_gpio_dev_attr
,
646 struct omap_hwmod omap2xxx_gpio3_hwmod
= {
648 .flags
= HWMOD_CONTROL_OPT_CLKS_IN_RESET
,
649 .mpu_irqs
= omap2_gpio3_irqs
,
650 .main_clk
= "gpios_fck",
654 .module_bit
= OMAP24XX_EN_GPIOS_SHIFT
,
655 .module_offs
= WKUP_MOD
,
657 .idlest_idle_bit
= OMAP24XX_ST_GPIOS_SHIFT
,
660 .class = &omap2xxx_gpio_hwmod_class
,
661 .dev_attr
= &omap2xxx_gpio_dev_attr
,
665 struct omap_hwmod omap2xxx_gpio4_hwmod
= {
667 .flags
= HWMOD_CONTROL_OPT_CLKS_IN_RESET
,
668 .mpu_irqs
= omap2_gpio4_irqs
,
669 .main_clk
= "gpios_fck",
673 .module_bit
= OMAP24XX_EN_GPIOS_SHIFT
,
674 .module_offs
= WKUP_MOD
,
676 .idlest_idle_bit
= OMAP24XX_ST_GPIOS_SHIFT
,
679 .class = &omap2xxx_gpio_hwmod_class
,
680 .dev_attr
= &omap2xxx_gpio_dev_attr
,
684 static struct omap2_mcspi_dev_attr omap_mcspi1_dev_attr
= {
688 struct omap_hwmod omap2xxx_mcspi1_hwmod
= {
690 .mpu_irqs
= omap2_mcspi1_mpu_irqs
,
691 .sdma_reqs
= omap2_mcspi1_sdma_reqs
,
692 .main_clk
= "mcspi1_fck",
695 .module_offs
= CORE_MOD
,
697 .module_bit
= OMAP24XX_EN_MCSPI1_SHIFT
,
699 .idlest_idle_bit
= OMAP24XX_ST_MCSPI1_SHIFT
,
702 .class = &omap2xxx_mcspi_class
,
703 .dev_attr
= &omap_mcspi1_dev_attr
,
707 static struct omap2_mcspi_dev_attr omap_mcspi2_dev_attr
= {
711 struct omap_hwmod omap2xxx_mcspi2_hwmod
= {
713 .mpu_irqs
= omap2_mcspi2_mpu_irqs
,
714 .sdma_reqs
= omap2_mcspi2_sdma_reqs
,
715 .main_clk
= "mcspi2_fck",
718 .module_offs
= CORE_MOD
,
720 .module_bit
= OMAP24XX_EN_MCSPI2_SHIFT
,
722 .idlest_idle_bit
= OMAP24XX_ST_MCSPI2_SHIFT
,
725 .class = &omap2xxx_mcspi_class
,
726 .dev_attr
= &omap_mcspi2_dev_attr
,
730 static struct omap_hwmod_class omap2xxx_counter_hwmod_class
= {
734 struct omap_hwmod omap2xxx_counter_32k_hwmod
= {
735 .name
= "counter_32k",
736 .main_clk
= "func_32k_ck",
739 .module_offs
= WKUP_MOD
,
741 .module_bit
= OMAP24XX_ST_32KSYNC_SHIFT
,
743 .idlest_idle_bit
= OMAP24XX_ST_32KSYNC_SHIFT
,
746 .class = &omap2xxx_counter_hwmod_class
,