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,
102 static struct omap_hwmod_class_sysconfig omap2xxx_dma_sysc = {
106 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_MIDLEMODE |
107 SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_EMUFREE |
108 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
109 .idlemodes = (MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
110 .sysc_fields = &omap_hwmod_sysc_type1,
113 struct omap_hwmod_class omap2xxx_dma_hwmod_class = {
115 .sysc = &omap2xxx_dma_sysc,
120 * mailbox module allowing communication between the on-chip processors
121 * using a queued mailbox-interrupt mechanism.
124 static struct omap_hwmod_class_sysconfig omap2xxx_mailbox_sysc = {
128 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
129 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
130 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
131 .sysc_fields = &omap_hwmod_sysc_type1,
134 struct omap_hwmod_class omap2xxx_mailbox_hwmod_class = {
136 .sysc = &omap2xxx_mailbox_sysc,
141 * multichannel serial port interface (mcspi) / master/slave synchronous serial
145 static struct omap_hwmod_class_sysconfig omap2xxx_mcspi_sysc = {
149 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
150 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
151 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
152 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
153 .sysc_fields = &omap_hwmod_sysc_type1,
156 struct omap_hwmod_class omap2xxx_mcspi_class = {
158 .sysc = &omap2xxx_mcspi_sysc,
163 * general purpose memory controller
166 static struct omap_hwmod_class_sysconfig omap2xxx_gpmc_sysc = {
170 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_SIDLEMODE |
171 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
172 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
173 .sysc_fields = &omap_hwmod_sysc_type1,
176 static struct omap_hwmod_class omap2xxx_gpmc_hwmod_class = {
178 .sysc = &omap2xxx_gpmc_sysc,
186 struct omap_hwmod omap2xxx_l3_main_hwmod = {
188 .class = &l3_hwmod_class,
189 .flags = HWMOD_NO_IDLEST,
193 struct omap_hwmod omap2xxx_l4_core_hwmod = {
195 .class = &l4_hwmod_class,
196 .flags = HWMOD_NO_IDLEST,
200 struct omap_hwmod omap2xxx_l4_wkup_hwmod = {
202 .class = &l4_hwmod_class,
203 .flags = HWMOD_NO_IDLEST,
207 struct omap_hwmod omap2xxx_mpu_hwmod = {
209 .class = &mpu_hwmod_class,
210 .main_clk = "mpu_ck",
214 struct omap_hwmod omap2xxx_iva_hwmod = {
216 .class = &iva_hwmod_class,
220 struct omap_hwmod omap2xxx_timer1_hwmod = {
222 .main_clk = "gpt1_fck",
225 .module_offs = WKUP_MOD,
227 .idlest_idle_bit = OMAP24XX_ST_GPT1_SHIFT,
230 .class = &omap2xxx_timer_hwmod_class,
231 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
235 struct omap_hwmod omap2xxx_timer2_hwmod = {
237 .main_clk = "gpt2_fck",
240 .module_offs = CORE_MOD,
242 .idlest_idle_bit = OMAP24XX_ST_GPT2_SHIFT,
245 .class = &omap2xxx_timer_hwmod_class,
246 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
250 struct omap_hwmod omap2xxx_timer3_hwmod = {
252 .main_clk = "gpt3_fck",
255 .module_offs = CORE_MOD,
257 .idlest_idle_bit = OMAP24XX_ST_GPT3_SHIFT,
260 .class = &omap2xxx_timer_hwmod_class,
261 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
265 struct omap_hwmod omap2xxx_timer4_hwmod = {
267 .main_clk = "gpt4_fck",
270 .module_offs = CORE_MOD,
272 .idlest_idle_bit = OMAP24XX_ST_GPT4_SHIFT,
275 .class = &omap2xxx_timer_hwmod_class,
276 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
280 struct omap_hwmod omap2xxx_timer5_hwmod = {
282 .main_clk = "gpt5_fck",
285 .module_offs = CORE_MOD,
287 .idlest_idle_bit = OMAP24XX_ST_GPT5_SHIFT,
290 .class = &omap2xxx_timer_hwmod_class,
291 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
295 struct omap_hwmod omap2xxx_timer6_hwmod = {
297 .main_clk = "gpt6_fck",
300 .module_offs = CORE_MOD,
302 .idlest_idle_bit = OMAP24XX_ST_GPT6_SHIFT,
305 .class = &omap2xxx_timer_hwmod_class,
306 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
310 struct omap_hwmod omap2xxx_timer7_hwmod = {
312 .main_clk = "gpt7_fck",
315 .module_offs = CORE_MOD,
317 .idlest_idle_bit = OMAP24XX_ST_GPT7_SHIFT,
320 .class = &omap2xxx_timer_hwmod_class,
321 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
325 struct omap_hwmod omap2xxx_timer8_hwmod = {
327 .main_clk = "gpt8_fck",
330 .module_offs = CORE_MOD,
332 .idlest_idle_bit = OMAP24XX_ST_GPT8_SHIFT,
335 .class = &omap2xxx_timer_hwmod_class,
336 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
340 struct omap_hwmod omap2xxx_timer9_hwmod = {
342 .main_clk = "gpt9_fck",
345 .module_offs = CORE_MOD,
347 .idlest_idle_bit = OMAP24XX_ST_GPT9_SHIFT,
350 .class = &omap2xxx_timer_hwmod_class,
351 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
355 struct omap_hwmod omap2xxx_timer10_hwmod = {
357 .main_clk = "gpt10_fck",
360 .module_offs = CORE_MOD,
362 .idlest_idle_bit = OMAP24XX_ST_GPT10_SHIFT,
365 .class = &omap2xxx_timer_hwmod_class,
366 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
370 struct omap_hwmod omap2xxx_timer11_hwmod = {
372 .main_clk = "gpt11_fck",
375 .module_offs = CORE_MOD,
377 .idlest_idle_bit = OMAP24XX_ST_GPT11_SHIFT,
380 .class = &omap2xxx_timer_hwmod_class,
381 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
385 struct omap_hwmod omap2xxx_timer12_hwmod = {
387 .main_clk = "gpt12_fck",
390 .module_offs = CORE_MOD,
392 .idlest_idle_bit = OMAP24XX_ST_GPT12_SHIFT,
395 .class = &omap2xxx_timer_hwmod_class,
396 .flags = HWMOD_SET_DEFAULT_CLOCKACT,
400 struct omap_hwmod omap2xxx_wd_timer2_hwmod = {
402 .class = &omap2xxx_wd_timer_hwmod_class,
403 .main_clk = "mpu_wdt_fck",
406 .module_offs = WKUP_MOD,
408 .idlest_idle_bit = OMAP24XX_ST_MPU_WDT_SHIFT,
415 struct omap_hwmod omap2xxx_uart1_hwmod = {
417 .main_clk = "uart1_fck",
418 .flags = DEBUG_OMAP2UART1_FLAGS | HWMOD_SWSUP_SIDLE_ACT,
421 .module_offs = CORE_MOD,
423 .idlest_idle_bit = OMAP24XX_EN_UART1_SHIFT,
426 .class = &omap2_uart_class,
431 struct omap_hwmod omap2xxx_uart2_hwmod = {
433 .main_clk = "uart2_fck",
434 .flags = DEBUG_OMAP2UART2_FLAGS | HWMOD_SWSUP_SIDLE_ACT,
437 .module_offs = CORE_MOD,
439 .idlest_idle_bit = OMAP24XX_EN_UART2_SHIFT,
442 .class = &omap2_uart_class,
447 struct omap_hwmod omap2xxx_uart3_hwmod = {
449 .main_clk = "uart3_fck",
450 .flags = DEBUG_OMAP2UART3_FLAGS | HWMOD_SWSUP_SIDLE_ACT,
453 .module_offs = CORE_MOD,
455 .idlest_idle_bit = OMAP24XX_EN_UART3_SHIFT,
458 .class = &omap2_uart_class,
463 static struct omap_hwmod_opt_clk dss_opt_clks[] = {
465 * The DSS HW needs all DSS clocks enabled during reset. The dss_core
466 * driver does not use these clocks.
468 { .role = "tv_clk", .clk = "dss_54m_fck" },
469 { .role = "sys_clk", .clk = "dss2_fck" },
472 struct omap_hwmod omap2xxx_dss_core_hwmod = {
474 .class = &omap2_dss_hwmod_class,
475 .main_clk = "dss1_fck", /* instead of dss_fck */
478 .module_offs = CORE_MOD,
482 .opt_clks = dss_opt_clks,
483 .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
484 .flags = HWMOD_NO_IDLEST | HWMOD_CONTROL_OPT_CLKS_IN_RESET,
487 struct omap_hwmod omap2xxx_dss_dispc_hwmod = {
489 .class = &omap2_dispc_hwmod_class,
490 .main_clk = "dss1_fck",
493 .module_offs = CORE_MOD,
497 .flags = HWMOD_NO_IDLEST,
498 .dev_attr = &omap2_3_dss_dispc_dev_attr,
501 static struct omap_hwmod_opt_clk dss_rfbi_opt_clks[] = {
502 { .role = "ick", .clk = "dss_ick" },
505 struct omap_hwmod omap2xxx_dss_rfbi_hwmod = {
507 .class = &omap2_rfbi_hwmod_class,
508 .main_clk = "dss1_fck",
511 .module_offs = CORE_MOD,
514 .opt_clks = dss_rfbi_opt_clks,
515 .opt_clks_cnt = ARRAY_SIZE(dss_rfbi_opt_clks),
516 .flags = HWMOD_NO_IDLEST,
519 struct omap_hwmod omap2xxx_dss_venc_hwmod = {
521 .class = &omap2_venc_hwmod_class,
522 .main_clk = "dss_54m_fck",
525 .module_offs = CORE_MOD,
528 .flags = HWMOD_NO_IDLEST,
532 struct omap_hwmod omap2xxx_gpio1_hwmod = {
534 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
535 .main_clk = "gpios_fck",
538 .module_offs = WKUP_MOD,
540 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
543 .class = &omap2xxx_gpio_hwmod_class,
547 struct omap_hwmod omap2xxx_gpio2_hwmod = {
549 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
550 .main_clk = "gpios_fck",
553 .module_offs = WKUP_MOD,
555 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
558 .class = &omap2xxx_gpio_hwmod_class,
562 struct omap_hwmod omap2xxx_gpio3_hwmod = {
564 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
565 .main_clk = "gpios_fck",
568 .module_offs = WKUP_MOD,
570 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
573 .class = &omap2xxx_gpio_hwmod_class,
577 struct omap_hwmod omap2xxx_gpio4_hwmod = {
579 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
580 .main_clk = "gpios_fck",
583 .module_offs = WKUP_MOD,
585 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
588 .class = &omap2xxx_gpio_hwmod_class,
592 struct omap_hwmod omap2xxx_mcspi1_hwmod = {
594 .main_clk = "mcspi1_fck",
597 .module_offs = CORE_MOD,
599 .idlest_idle_bit = OMAP24XX_ST_MCSPI1_SHIFT,
602 .class = &omap2xxx_mcspi_class,
606 struct omap_hwmod omap2xxx_mcspi2_hwmod = {
608 .main_clk = "mcspi2_fck",
611 .module_offs = CORE_MOD,
613 .idlest_idle_bit = OMAP24XX_ST_MCSPI2_SHIFT,
616 .class = &omap2xxx_mcspi_class,
619 static struct omap_hwmod_class omap2xxx_counter_hwmod_class = {
623 struct omap_hwmod omap2xxx_counter_32k_hwmod = {
624 .name = "counter_32k",
625 .main_clk = "func_32k_ck",
628 .module_offs = WKUP_MOD,
630 .idlest_idle_bit = OMAP24XX_ST_32KSYNC_SHIFT,
633 .class = &omap2xxx_counter_hwmod_class,
637 struct omap_hwmod omap2xxx_gpmc_hwmod = {
639 .class = &omap2xxx_gpmc_hwmod_class,
640 .main_clk = "gpmc_fck",
641 /* Skip reset for CONFIG_OMAP_GPMC_DEBUG for bootloader timings */
642 .flags = HWMOD_NO_IDLEST | DEBUG_OMAP_GPMC_HWMOD_FLAGS,
645 .module_offs = CORE_MOD,
652 static struct omap_hwmod_class_sysconfig omap2_rng_sysc = {
656 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
657 SYSS_HAS_RESET_STATUS),
658 .sysc_fields = &omap_hwmod_sysc_type1,
661 static struct omap_hwmod_class omap2_rng_hwmod_class = {
663 .sysc = &omap2_rng_sysc,
666 struct omap_hwmod omap2xxx_rng_hwmod = {
671 .module_offs = CORE_MOD,
673 .idlest_idle_bit = OMAP24XX_ST_RNG_SHIFT,
677 * XXX The first read from the SYSSTATUS register of the RNG
678 * after the SYSCONFIG SOFTRESET bit is set triggers an
679 * imprecise external abort. It's unclear why this happens.
680 * Until this is analyzed, skip the IP block reset.
682 .flags = HWMOD_INIT_NO_RESET,
683 .class = &omap2_rng_hwmod_class,
688 static struct omap_hwmod_class_sysconfig omap2_sham_sysc = {
692 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
693 SYSS_HAS_RESET_STATUS),
694 .sysc_fields = &omap_hwmod_sysc_type1,
697 static struct omap_hwmod_class omap2xxx_sham_class = {
699 .sysc = &omap2_sham_sysc,
702 struct omap_hwmod omap2xxx_sham_hwmod = {
707 .module_offs = CORE_MOD,
709 .idlest_idle_bit = OMAP24XX_ST_SHA_SHIFT,
712 .class = &omap2xxx_sham_class,
717 static struct omap_hwmod_class_sysconfig omap2_aes_sysc = {
721 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
722 SYSS_HAS_RESET_STATUS),
723 .sysc_fields = &omap_hwmod_sysc_type1,
726 static struct omap_hwmod_class omap2xxx_aes_class = {
728 .sysc = &omap2_aes_sysc,
731 struct omap_hwmod omap2xxx_aes_hwmod = {
736 .module_offs = CORE_MOD,
738 .idlest_idle_bit = OMAP24XX_ST_AES_SHIFT,
741 .class = &omap2xxx_aes_class,