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.
12 #include <linux/types.h>
13 #include <linux/omap-dma.h>
15 #include "omap_hwmod.h"
16 #include "omap_hwmod_common_data.h"
17 #include "cm-regbits-24xx.h"
18 #include "prm-regbits-24xx.h"
26 static struct omap_hwmod_class_sysconfig omap2_dispc_sysc = {
30 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE |
31 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
32 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
33 MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
34 .sysc_fields = &omap_hwmod_sysc_type1,
37 struct omap_hwmod_class omap2_dispc_hwmod_class = {
39 .sysc = &omap2_dispc_sysc,
42 /* OMAP2xxx Timer Common */
43 static struct omap_hwmod_class_sysconfig omap2xxx_timer_sysc = {
47 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_CLOCKACTIVITY |
48 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
49 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
50 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
51 .sysc_fields = &omap_hwmod_sysc_type1,
54 struct omap_hwmod_class omap2xxx_timer_hwmod_class = {
56 .sysc = &omap2xxx_timer_sysc,
61 * 32-bit watchdog upward counter that generates a pulse on the reset pin on
65 static struct omap_hwmod_class_sysconfig omap2xxx_wd_timer_sysc = {
69 .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_SOFTRESET |
70 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
71 .sysc_fields = &omap_hwmod_sysc_type1,
74 struct omap_hwmod_class omap2xxx_wd_timer_hwmod_class = {
76 .sysc = &omap2xxx_wd_timer_sysc,
77 .pre_shutdown = &omap2_wd_timer_disable,
78 .reset = &omap2_wd_timer_reset,
83 * general purpose io module
85 static struct omap_hwmod_class_sysconfig omap2xxx_gpio_sysc = {
89 .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
90 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
91 SYSS_HAS_RESET_STATUS),
92 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
93 .sysc_fields = &omap_hwmod_sysc_type1,
96 struct omap_hwmod_class omap2xxx_gpio_hwmod_class = {
98 .sysc = &omap2xxx_gpio_sysc,
103 static struct omap_hwmod_class_sysconfig omap2xxx_dma_sysc = {
107 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_MIDLEMODE |
108 SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_EMUFREE |
109 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
110 .idlemodes = (MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
111 .sysc_fields = &omap_hwmod_sysc_type1,
114 struct omap_hwmod_class omap2xxx_dma_hwmod_class = {
116 .sysc = &omap2xxx_dma_sysc,
121 * mailbox module allowing communication between the on-chip processors
122 * using a queued mailbox-interrupt mechanism.
125 static struct omap_hwmod_class_sysconfig omap2xxx_mailbox_sysc = {
129 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
130 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
131 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
132 .sysc_fields = &omap_hwmod_sysc_type1,
135 struct omap_hwmod_class omap2xxx_mailbox_hwmod_class = {
137 .sysc = &omap2xxx_mailbox_sysc,
142 * multichannel serial port interface (mcspi) / master/slave synchronous serial
146 static struct omap_hwmod_class_sysconfig omap2xxx_mcspi_sysc = {
150 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
151 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
152 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
153 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
154 .sysc_fields = &omap_hwmod_sysc_type1,
157 struct omap_hwmod_class omap2xxx_mcspi_class = {
159 .sysc = &omap2xxx_mcspi_sysc,
164 * general purpose memory controller
167 static struct omap_hwmod_class_sysconfig omap2xxx_gpmc_sysc = {
171 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_SIDLEMODE |
172 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
173 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
174 .sysc_fields = &omap_hwmod_sysc_type1,
177 static struct omap_hwmod_class omap2xxx_gpmc_hwmod_class = {
179 .sysc = &omap2xxx_gpmc_sysc,
187 struct omap_hwmod omap2xxx_l3_main_hwmod = {
189 .class = &l3_hwmod_class,
190 .flags = HWMOD_NO_IDLEST,
194 struct omap_hwmod omap2xxx_l4_core_hwmod = {
196 .class = &l4_hwmod_class,
197 .flags = HWMOD_NO_IDLEST,
201 struct omap_hwmod omap2xxx_l4_wkup_hwmod = {
203 .class = &l4_hwmod_class,
204 .flags = HWMOD_NO_IDLEST,
208 struct omap_hwmod omap2xxx_mpu_hwmod = {
210 .class = &mpu_hwmod_class,
211 .main_clk = "mpu_ck",
215 struct omap_hwmod omap2xxx_iva_hwmod = {
217 .class = &iva_hwmod_class,
221 struct omap_hwmod omap2xxx_timer1_hwmod = {
223 .main_clk = "gpt1_fck",
226 .module_offs = WKUP_MOD,
228 .idlest_idle_bit = OMAP24XX_ST_GPT1_SHIFT,
231 .class = &omap2xxx_timer_hwmod_class,
232 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
236 struct omap_hwmod omap2xxx_timer2_hwmod = {
238 .main_clk = "gpt2_fck",
241 .module_offs = CORE_MOD,
243 .idlest_idle_bit = OMAP24XX_ST_GPT2_SHIFT,
246 .class = &omap2xxx_timer_hwmod_class,
247 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
251 struct omap_hwmod omap2xxx_timer3_hwmod = {
253 .main_clk = "gpt3_fck",
256 .module_offs = CORE_MOD,
258 .idlest_idle_bit = OMAP24XX_ST_GPT3_SHIFT,
261 .class = &omap2xxx_timer_hwmod_class,
262 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
266 struct omap_hwmod omap2xxx_timer4_hwmod = {
268 .main_clk = "gpt4_fck",
271 .module_offs = CORE_MOD,
273 .idlest_idle_bit = OMAP24XX_ST_GPT4_SHIFT,
276 .class = &omap2xxx_timer_hwmod_class,
277 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
281 struct omap_hwmod omap2xxx_timer5_hwmod = {
283 .main_clk = "gpt5_fck",
286 .module_offs = CORE_MOD,
288 .idlest_idle_bit = OMAP24XX_ST_GPT5_SHIFT,
291 .class = &omap2xxx_timer_hwmod_class,
292 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
296 struct omap_hwmod omap2xxx_timer6_hwmod = {
298 .main_clk = "gpt6_fck",
301 .module_offs = CORE_MOD,
303 .idlest_idle_bit = OMAP24XX_ST_GPT6_SHIFT,
306 .class = &omap2xxx_timer_hwmod_class,
307 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
311 struct omap_hwmod omap2xxx_timer7_hwmod = {
313 .main_clk = "gpt7_fck",
316 .module_offs = CORE_MOD,
318 .idlest_idle_bit = OMAP24XX_ST_GPT7_SHIFT,
321 .class = &omap2xxx_timer_hwmod_class,
322 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
326 struct omap_hwmod omap2xxx_timer8_hwmod = {
328 .main_clk = "gpt8_fck",
331 .module_offs = CORE_MOD,
333 .idlest_idle_bit = OMAP24XX_ST_GPT8_SHIFT,
336 .class = &omap2xxx_timer_hwmod_class,
337 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
341 struct omap_hwmod omap2xxx_timer9_hwmod = {
343 .main_clk = "gpt9_fck",
346 .module_offs = CORE_MOD,
348 .idlest_idle_bit = OMAP24XX_ST_GPT9_SHIFT,
351 .class = &omap2xxx_timer_hwmod_class,
352 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
356 struct omap_hwmod omap2xxx_timer10_hwmod = {
358 .main_clk = "gpt10_fck",
361 .module_offs = CORE_MOD,
363 .idlest_idle_bit = OMAP24XX_ST_GPT10_SHIFT,
366 .class = &omap2xxx_timer_hwmod_class,
367 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
371 struct omap_hwmod omap2xxx_timer11_hwmod = {
373 .main_clk = "gpt11_fck",
376 .module_offs = CORE_MOD,
378 .idlest_idle_bit = OMAP24XX_ST_GPT11_SHIFT,
381 .class = &omap2xxx_timer_hwmod_class,
382 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
386 struct omap_hwmod omap2xxx_timer12_hwmod = {
388 .main_clk = "gpt12_fck",
391 .module_offs = CORE_MOD,
393 .idlest_idle_bit = OMAP24XX_ST_GPT12_SHIFT,
396 .class = &omap2xxx_timer_hwmod_class,
397 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
401 struct omap_hwmod omap2xxx_wd_timer2_hwmod = {
403 .class = &omap2xxx_wd_timer_hwmod_class,
404 .main_clk = "mpu_wdt_fck",
407 .module_offs = WKUP_MOD,
409 .idlest_idle_bit = OMAP24XX_ST_MPU_WDT_SHIFT,
416 struct omap_hwmod omap2xxx_uart1_hwmod = {
418 .main_clk = "uart1_fck",
419 .flags = DEBUG_OMAP2UART1_FLAGS | HWMOD_SWSUP_SIDLE_ACT,
422 .module_offs = CORE_MOD,
424 .idlest_idle_bit = OMAP24XX_EN_UART1_SHIFT,
427 .class = &omap2_uart_class,
432 struct omap_hwmod omap2xxx_uart2_hwmod = {
434 .main_clk = "uart2_fck",
435 .flags = DEBUG_OMAP2UART2_FLAGS | HWMOD_SWSUP_SIDLE_ACT,
438 .module_offs = CORE_MOD,
440 .idlest_idle_bit = OMAP24XX_EN_UART2_SHIFT,
443 .class = &omap2_uart_class,
448 struct omap_hwmod omap2xxx_uart3_hwmod = {
450 .main_clk = "uart3_fck",
451 .flags = DEBUG_OMAP2UART3_FLAGS | HWMOD_SWSUP_SIDLE_ACT,
454 .module_offs = CORE_MOD,
456 .idlest_idle_bit = OMAP24XX_EN_UART3_SHIFT,
459 .class = &omap2_uart_class,
464 static struct omap_hwmod_opt_clk dss_opt_clks[] = {
466 * The DSS HW needs all DSS clocks enabled during reset. The dss_core
467 * driver does not use these clocks.
469 { .role = "tv_clk", .clk = "dss_54m_fck" },
470 { .role = "sys_clk", .clk = "dss2_fck" },
473 struct omap_hwmod omap2xxx_dss_core_hwmod = {
475 .class = &omap2_dss_hwmod_class,
476 .main_clk = "dss1_fck", /* instead of dss_fck */
479 .module_offs = CORE_MOD,
483 .opt_clks = dss_opt_clks,
484 .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
485 .flags = HWMOD_NO_IDLEST | HWMOD_CONTROL_OPT_CLKS_IN_RESET,
488 struct omap_hwmod omap2xxx_dss_dispc_hwmod = {
490 .class = &omap2_dispc_hwmod_class,
491 .main_clk = "dss1_fck",
494 .module_offs = CORE_MOD,
498 .flags = HWMOD_NO_IDLEST,
499 .dev_attr = &omap2_3_dss_dispc_dev_attr,
502 static struct omap_hwmod_opt_clk dss_rfbi_opt_clks[] = {
503 { .role = "ick", .clk = "dss_ick" },
506 struct omap_hwmod omap2xxx_dss_rfbi_hwmod = {
508 .class = &omap2_rfbi_hwmod_class,
509 .main_clk = "dss1_fck",
512 .module_offs = CORE_MOD,
515 .opt_clks = dss_rfbi_opt_clks,
516 .opt_clks_cnt = ARRAY_SIZE(dss_rfbi_opt_clks),
517 .flags = HWMOD_NO_IDLEST,
520 struct omap_hwmod omap2xxx_dss_venc_hwmod = {
522 .class = &omap2_venc_hwmod_class,
523 .main_clk = "dss_54m_fck",
526 .module_offs = CORE_MOD,
529 .flags = HWMOD_NO_IDLEST,
533 struct omap_hwmod omap2xxx_gpio1_hwmod = {
535 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
536 .main_clk = "gpios_fck",
539 .module_offs = WKUP_MOD,
541 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
544 .class = &omap2xxx_gpio_hwmod_class,
548 struct omap_hwmod omap2xxx_gpio2_hwmod = {
550 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
551 .main_clk = "gpios_fck",
554 .module_offs = WKUP_MOD,
556 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
559 .class = &omap2xxx_gpio_hwmod_class,
563 struct omap_hwmod omap2xxx_gpio3_hwmod = {
565 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
566 .main_clk = "gpios_fck",
569 .module_offs = WKUP_MOD,
571 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
574 .class = &omap2xxx_gpio_hwmod_class,
578 struct omap_hwmod omap2xxx_gpio4_hwmod = {
580 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
581 .main_clk = "gpios_fck",
584 .module_offs = WKUP_MOD,
586 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
589 .class = &omap2xxx_gpio_hwmod_class,
593 struct omap_hwmod omap2xxx_mcspi1_hwmod = {
595 .main_clk = "mcspi1_fck",
598 .module_offs = CORE_MOD,
600 .idlest_idle_bit = OMAP24XX_ST_MCSPI1_SHIFT,
603 .class = &omap2xxx_mcspi_class,
607 struct omap_hwmod omap2xxx_mcspi2_hwmod = {
609 .main_clk = "mcspi2_fck",
612 .module_offs = CORE_MOD,
614 .idlest_idle_bit = OMAP24XX_ST_MCSPI2_SHIFT,
617 .class = &omap2xxx_mcspi_class,
620 static struct omap_hwmod_class omap2xxx_counter_hwmod_class = {
624 struct omap_hwmod omap2xxx_counter_32k_hwmod = {
625 .name = "counter_32k",
626 .main_clk = "func_32k_ck",
629 .module_offs = WKUP_MOD,
631 .idlest_idle_bit = OMAP24XX_ST_32KSYNC_SHIFT,
634 .class = &omap2xxx_counter_hwmod_class,
638 struct omap_hwmod omap2xxx_gpmc_hwmod = {
640 .class = &omap2xxx_gpmc_hwmod_class,
641 .main_clk = "gpmc_fck",
642 /* Skip reset for CONFIG_OMAP_GPMC_DEBUG for bootloader timings */
643 .flags = HWMOD_NO_IDLEST | DEBUG_OMAP_GPMC_HWMOD_FLAGS,
646 .module_offs = CORE_MOD,
653 static struct omap_hwmod_class_sysconfig omap2_rng_sysc = {
657 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
658 SYSS_HAS_RESET_STATUS),
659 .sysc_fields = &omap_hwmod_sysc_type1,
662 static struct omap_hwmod_class omap2_rng_hwmod_class = {
664 .sysc = &omap2_rng_sysc,
667 struct omap_hwmod omap2xxx_rng_hwmod = {
672 .module_offs = CORE_MOD,
674 .idlest_idle_bit = OMAP24XX_ST_RNG_SHIFT,
678 * XXX The first read from the SYSSTATUS register of the RNG
679 * after the SYSCONFIG SOFTRESET bit is set triggers an
680 * imprecise external abort. It's unclear why this happens.
681 * Until this is analyzed, skip the IP block reset.
683 .flags = HWMOD_INIT_NO_RESET,
684 .class = &omap2_rng_hwmod_class,
689 static struct omap_hwmod_class_sysconfig omap2_sham_sysc = {
693 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
694 SYSS_HAS_RESET_STATUS),
695 .sysc_fields = &omap_hwmod_sysc_type1,
698 static struct omap_hwmod_class omap2xxx_sham_class = {
700 .sysc = &omap2_sham_sysc,
703 struct omap_hwmod omap2xxx_sham_hwmod = {
708 .module_offs = CORE_MOD,
710 .idlest_idle_bit = OMAP24XX_ST_SHA_SHIFT,
713 .class = &omap2xxx_sham_class,
718 static struct omap_hwmod_class_sysconfig omap2_aes_sysc = {
722 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
723 SYSS_HAS_RESET_STATUS),
724 .sysc_fields = &omap_hwmod_sysc_type1,
727 static struct omap_hwmod_class omap2xxx_aes_class = {
729 .sysc = &omap2_aes_sysc,
732 struct omap_hwmod omap2xxx_aes_hwmod = {
737 .module_offs = CORE_MOD,
739 .idlest_idle_bit = OMAP24XX_ST_AES_SHIFT,
742 .class = &omap2xxx_aes_class,