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 <linux/platform_data/gpio-omap.h>
15 #include <plat/dmtimer.h>
16 #include <linux/platform_data/spi-omap2-mcspi.h>
18 #include "omap_hwmod_common_data.h"
19 #include "cm-regbits-24xx.h"
20 #include "prm-regbits-24xx.h"
23 struct omap_hwmod_irq_info omap2xxx_timer12_mpu_irqs[] = {
24 { .irq = 48 + OMAP_INTC_START, },
28 struct omap_hwmod_dma_info omap2xxx_dss_sdma_chs[] = {
29 { .name = "dispc", .dma_req = 5 },
38 static struct omap_hwmod_class_sysconfig omap2_dispc_sysc = {
42 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE |
43 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
44 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
45 MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
46 .sysc_fields = &omap_hwmod_sysc_type1,
49 struct omap_hwmod_class omap2_dispc_hwmod_class = {
51 .sysc = &omap2_dispc_sysc,
54 /* OMAP2xxx Timer Common */
55 static struct omap_hwmod_class_sysconfig omap2xxx_timer_sysc = {
59 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_CLOCKACTIVITY |
60 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
62 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
63 .sysc_fields = &omap_hwmod_sysc_type1,
66 struct omap_hwmod_class omap2xxx_timer_hwmod_class = {
68 .sysc = &omap2xxx_timer_sysc,
73 * 32-bit watchdog upward counter that generates a pulse on the reset pin on
77 static struct omap_hwmod_class_sysconfig omap2xxx_wd_timer_sysc = {
81 .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_SOFTRESET |
82 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
83 .sysc_fields = &omap_hwmod_sysc_type1,
86 struct omap_hwmod_class omap2xxx_wd_timer_hwmod_class = {
88 .sysc = &omap2xxx_wd_timer_sysc,
89 .pre_shutdown = &omap2_wd_timer_disable,
90 .reset = &omap2_wd_timer_reset,
95 * general purpose io module
97 static struct omap_hwmod_class_sysconfig omap2xxx_gpio_sysc = {
101 .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
102 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
103 SYSS_HAS_RESET_STATUS),
104 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
105 .sysc_fields = &omap_hwmod_sysc_type1,
108 struct omap_hwmod_class omap2xxx_gpio_hwmod_class = {
110 .sysc = &omap2xxx_gpio_sysc,
115 static struct omap_hwmod_class_sysconfig omap2xxx_dma_sysc = {
119 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_MIDLEMODE |
120 SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_EMUFREE |
121 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
122 .idlemodes = (MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
123 .sysc_fields = &omap_hwmod_sysc_type1,
126 struct omap_hwmod_class omap2xxx_dma_hwmod_class = {
128 .sysc = &omap2xxx_dma_sysc,
133 * mailbox module allowing communication between the on-chip processors
134 * using a queued mailbox-interrupt mechanism.
137 static struct omap_hwmod_class_sysconfig omap2xxx_mailbox_sysc = {
141 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
142 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
143 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
144 .sysc_fields = &omap_hwmod_sysc_type1,
147 struct omap_hwmod_class omap2xxx_mailbox_hwmod_class = {
149 .sysc = &omap2xxx_mailbox_sysc,
154 * multichannel serial port interface (mcspi) / master/slave synchronous serial
158 static struct omap_hwmod_class_sysconfig omap2xxx_mcspi_sysc = {
162 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
163 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
164 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
165 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
166 .sysc_fields = &omap_hwmod_sysc_type1,
169 struct omap_hwmod_class omap2xxx_mcspi_class = {
171 .sysc = &omap2xxx_mcspi_sysc,
172 .rev = OMAP2_MCSPI_REV,
180 struct omap_hwmod omap2xxx_l3_main_hwmod = {
182 .class = &l3_hwmod_class,
183 .flags = HWMOD_NO_IDLEST,
187 struct omap_hwmod omap2xxx_l4_core_hwmod = {
189 .class = &l4_hwmod_class,
190 .flags = HWMOD_NO_IDLEST,
194 struct omap_hwmod omap2xxx_l4_wkup_hwmod = {
196 .class = &l4_hwmod_class,
197 .flags = HWMOD_NO_IDLEST,
201 struct omap_hwmod omap2xxx_mpu_hwmod = {
203 .class = &mpu_hwmod_class,
204 .main_clk = "mpu_ck",
208 struct omap_hwmod omap2xxx_iva_hwmod = {
210 .class = &iva_hwmod_class,
213 /* always-on timers dev attribute */
214 static struct omap_timer_capability_dev_attr capability_alwon_dev_attr = {
215 .timer_capability = OMAP_TIMER_ALWON,
218 /* pwm timers dev attribute */
219 static struct omap_timer_capability_dev_attr capability_pwm_dev_attr = {
220 .timer_capability = OMAP_TIMER_HAS_PWM,
225 struct omap_hwmod omap2xxx_timer1_hwmod = {
227 .mpu_irqs = omap2_timer1_mpu_irqs,
228 .main_clk = "gpt1_fck",
232 .module_bit = OMAP24XX_EN_GPT1_SHIFT,
233 .module_offs = WKUP_MOD,
235 .idlest_idle_bit = OMAP24XX_ST_GPT1_SHIFT,
238 .dev_attr = &capability_alwon_dev_attr,
239 .class = &omap2xxx_timer_hwmod_class,
244 struct omap_hwmod omap2xxx_timer2_hwmod = {
246 .mpu_irqs = omap2_timer2_mpu_irqs,
247 .main_clk = "gpt2_fck",
251 .module_bit = OMAP24XX_EN_GPT2_SHIFT,
252 .module_offs = CORE_MOD,
254 .idlest_idle_bit = OMAP24XX_ST_GPT2_SHIFT,
257 .class = &omap2xxx_timer_hwmod_class,
262 struct omap_hwmod omap2xxx_timer3_hwmod = {
264 .mpu_irqs = omap2_timer3_mpu_irqs,
265 .main_clk = "gpt3_fck",
269 .module_bit = OMAP24XX_EN_GPT3_SHIFT,
270 .module_offs = CORE_MOD,
272 .idlest_idle_bit = OMAP24XX_ST_GPT3_SHIFT,
275 .class = &omap2xxx_timer_hwmod_class,
280 struct omap_hwmod omap2xxx_timer4_hwmod = {
282 .mpu_irqs = omap2_timer4_mpu_irqs,
283 .main_clk = "gpt4_fck",
287 .module_bit = OMAP24XX_EN_GPT4_SHIFT,
288 .module_offs = CORE_MOD,
290 .idlest_idle_bit = OMAP24XX_ST_GPT4_SHIFT,
293 .class = &omap2xxx_timer_hwmod_class,
298 struct omap_hwmod omap2xxx_timer5_hwmod = {
300 .mpu_irqs = omap2_timer5_mpu_irqs,
301 .main_clk = "gpt5_fck",
305 .module_bit = OMAP24XX_EN_GPT5_SHIFT,
306 .module_offs = CORE_MOD,
308 .idlest_idle_bit = OMAP24XX_ST_GPT5_SHIFT,
311 .class = &omap2xxx_timer_hwmod_class,
316 struct omap_hwmod omap2xxx_timer6_hwmod = {
318 .mpu_irqs = omap2_timer6_mpu_irqs,
319 .main_clk = "gpt6_fck",
323 .module_bit = OMAP24XX_EN_GPT6_SHIFT,
324 .module_offs = CORE_MOD,
326 .idlest_idle_bit = OMAP24XX_ST_GPT6_SHIFT,
329 .class = &omap2xxx_timer_hwmod_class,
334 struct omap_hwmod omap2xxx_timer7_hwmod = {
336 .mpu_irqs = omap2_timer7_mpu_irqs,
337 .main_clk = "gpt7_fck",
341 .module_bit = OMAP24XX_EN_GPT7_SHIFT,
342 .module_offs = CORE_MOD,
344 .idlest_idle_bit = OMAP24XX_ST_GPT7_SHIFT,
347 .class = &omap2xxx_timer_hwmod_class,
352 struct omap_hwmod omap2xxx_timer8_hwmod = {
354 .mpu_irqs = omap2_timer8_mpu_irqs,
355 .main_clk = "gpt8_fck",
359 .module_bit = OMAP24XX_EN_GPT8_SHIFT,
360 .module_offs = CORE_MOD,
362 .idlest_idle_bit = OMAP24XX_ST_GPT8_SHIFT,
365 .class = &omap2xxx_timer_hwmod_class,
370 struct omap_hwmod omap2xxx_timer9_hwmod = {
372 .mpu_irqs = omap2_timer9_mpu_irqs,
373 .main_clk = "gpt9_fck",
377 .module_bit = OMAP24XX_EN_GPT9_SHIFT,
378 .module_offs = CORE_MOD,
380 .idlest_idle_bit = OMAP24XX_ST_GPT9_SHIFT,
383 .dev_attr = &capability_pwm_dev_attr,
384 .class = &omap2xxx_timer_hwmod_class,
389 struct omap_hwmod omap2xxx_timer10_hwmod = {
391 .mpu_irqs = omap2_timer10_mpu_irqs,
392 .main_clk = "gpt10_fck",
396 .module_bit = OMAP24XX_EN_GPT10_SHIFT,
397 .module_offs = CORE_MOD,
399 .idlest_idle_bit = OMAP24XX_ST_GPT10_SHIFT,
402 .dev_attr = &capability_pwm_dev_attr,
403 .class = &omap2xxx_timer_hwmod_class,
408 struct omap_hwmod omap2xxx_timer11_hwmod = {
410 .mpu_irqs = omap2_timer11_mpu_irqs,
411 .main_clk = "gpt11_fck",
415 .module_bit = OMAP24XX_EN_GPT11_SHIFT,
416 .module_offs = CORE_MOD,
418 .idlest_idle_bit = OMAP24XX_ST_GPT11_SHIFT,
421 .dev_attr = &capability_pwm_dev_attr,
422 .class = &omap2xxx_timer_hwmod_class,
427 struct omap_hwmod omap2xxx_timer12_hwmod = {
429 .mpu_irqs = omap2xxx_timer12_mpu_irqs,
430 .main_clk = "gpt12_fck",
434 .module_bit = OMAP24XX_EN_GPT12_SHIFT,
435 .module_offs = CORE_MOD,
437 .idlest_idle_bit = OMAP24XX_ST_GPT12_SHIFT,
440 .dev_attr = &capability_pwm_dev_attr,
441 .class = &omap2xxx_timer_hwmod_class,
445 struct omap_hwmod omap2xxx_wd_timer2_hwmod = {
447 .class = &omap2xxx_wd_timer_hwmod_class,
448 .main_clk = "mpu_wdt_fck",
452 .module_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
453 .module_offs = WKUP_MOD,
455 .idlest_idle_bit = OMAP24XX_ST_MPU_WDT_SHIFT,
462 struct omap_hwmod omap2xxx_uart1_hwmod = {
464 .mpu_irqs = omap2_uart1_mpu_irqs,
465 .sdma_reqs = omap2_uart1_sdma_reqs,
466 .main_clk = "uart1_fck",
469 .module_offs = CORE_MOD,
471 .module_bit = OMAP24XX_EN_UART1_SHIFT,
473 .idlest_idle_bit = OMAP24XX_EN_UART1_SHIFT,
476 .class = &omap2_uart_class,
481 struct omap_hwmod omap2xxx_uart2_hwmod = {
483 .mpu_irqs = omap2_uart2_mpu_irqs,
484 .sdma_reqs = omap2_uart2_sdma_reqs,
485 .main_clk = "uart2_fck",
488 .module_offs = CORE_MOD,
490 .module_bit = OMAP24XX_EN_UART2_SHIFT,
492 .idlest_idle_bit = OMAP24XX_EN_UART2_SHIFT,
495 .class = &omap2_uart_class,
500 struct omap_hwmod omap2xxx_uart3_hwmod = {
502 .mpu_irqs = omap2_uart3_mpu_irqs,
503 .sdma_reqs = omap2_uart3_sdma_reqs,
504 .main_clk = "uart3_fck",
507 .module_offs = CORE_MOD,
509 .module_bit = OMAP24XX_EN_UART3_SHIFT,
511 .idlest_idle_bit = OMAP24XX_EN_UART3_SHIFT,
514 .class = &omap2_uart_class,
519 static struct omap_hwmod_opt_clk dss_opt_clks[] = {
521 * The DSS HW needs all DSS clocks enabled during reset. The dss_core
522 * driver does not use these clocks.
524 { .role = "tv_clk", .clk = "dss_54m_fck" },
525 { .role = "sys_clk", .clk = "dss2_fck" },
528 struct omap_hwmod omap2xxx_dss_core_hwmod = {
530 .class = &omap2_dss_hwmod_class,
531 .main_clk = "dss1_fck", /* instead of dss_fck */
532 .sdma_reqs = omap2xxx_dss_sdma_chs,
536 .module_bit = OMAP24XX_EN_DSS1_SHIFT,
537 .module_offs = CORE_MOD,
539 .idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT,
542 .opt_clks = dss_opt_clks,
543 .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
544 .flags = HWMOD_NO_IDLEST | HWMOD_CONTROL_OPT_CLKS_IN_RESET,
547 struct omap_hwmod omap2xxx_dss_dispc_hwmod = {
549 .class = &omap2_dispc_hwmod_class,
550 .mpu_irqs = omap2_dispc_irqs,
551 .main_clk = "dss1_fck",
555 .module_bit = OMAP24XX_EN_DSS1_SHIFT,
556 .module_offs = CORE_MOD,
558 .idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT,
561 .flags = HWMOD_NO_IDLEST,
562 .dev_attr = &omap2_3_dss_dispc_dev_attr
565 static struct omap_hwmod_opt_clk dss_rfbi_opt_clks[] = {
566 { .role = "ick", .clk = "dss_ick" },
569 struct omap_hwmod omap2xxx_dss_rfbi_hwmod = {
571 .class = &omap2_rfbi_hwmod_class,
572 .main_clk = "dss1_fck",
576 .module_bit = OMAP24XX_EN_DSS1_SHIFT,
577 .module_offs = CORE_MOD,
580 .opt_clks = dss_rfbi_opt_clks,
581 .opt_clks_cnt = ARRAY_SIZE(dss_rfbi_opt_clks),
582 .flags = HWMOD_NO_IDLEST,
585 struct omap_hwmod omap2xxx_dss_venc_hwmod = {
587 .class = &omap2_venc_hwmod_class,
588 .main_clk = "dss_54m_fck",
592 .module_bit = OMAP24XX_EN_DSS1_SHIFT,
593 .module_offs = CORE_MOD,
596 .flags = HWMOD_NO_IDLEST,
600 struct omap_gpio_dev_attr omap2xxx_gpio_dev_attr = {
606 struct omap_hwmod omap2xxx_gpio1_hwmod = {
608 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
609 .mpu_irqs = omap2_gpio1_irqs,
610 .main_clk = "gpios_fck",
614 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
615 .module_offs = WKUP_MOD,
617 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
620 .class = &omap2xxx_gpio_hwmod_class,
621 .dev_attr = &omap2xxx_gpio_dev_attr,
625 struct omap_hwmod omap2xxx_gpio2_hwmod = {
627 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
628 .mpu_irqs = omap2_gpio2_irqs,
629 .main_clk = "gpios_fck",
633 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
634 .module_offs = WKUP_MOD,
636 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
639 .class = &omap2xxx_gpio_hwmod_class,
640 .dev_attr = &omap2xxx_gpio_dev_attr,
644 struct omap_hwmod omap2xxx_gpio3_hwmod = {
646 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
647 .mpu_irqs = omap2_gpio3_irqs,
648 .main_clk = "gpios_fck",
652 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
653 .module_offs = WKUP_MOD,
655 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
658 .class = &omap2xxx_gpio_hwmod_class,
659 .dev_attr = &omap2xxx_gpio_dev_attr,
663 struct omap_hwmod omap2xxx_gpio4_hwmod = {
665 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
666 .mpu_irqs = omap2_gpio4_irqs,
667 .main_clk = "gpios_fck",
671 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
672 .module_offs = WKUP_MOD,
674 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
677 .class = &omap2xxx_gpio_hwmod_class,
678 .dev_attr = &omap2xxx_gpio_dev_attr,
682 static struct omap2_mcspi_dev_attr omap_mcspi1_dev_attr = {
686 struct omap_hwmod omap2xxx_mcspi1_hwmod = {
688 .mpu_irqs = omap2_mcspi1_mpu_irqs,
689 .sdma_reqs = omap2_mcspi1_sdma_reqs,
690 .main_clk = "mcspi1_fck",
693 .module_offs = CORE_MOD,
695 .module_bit = OMAP24XX_EN_MCSPI1_SHIFT,
697 .idlest_idle_bit = OMAP24XX_ST_MCSPI1_SHIFT,
700 .class = &omap2xxx_mcspi_class,
701 .dev_attr = &omap_mcspi1_dev_attr,
705 static struct omap2_mcspi_dev_attr omap_mcspi2_dev_attr = {
709 struct omap_hwmod omap2xxx_mcspi2_hwmod = {
711 .mpu_irqs = omap2_mcspi2_mpu_irqs,
712 .sdma_reqs = omap2_mcspi2_sdma_reqs,
713 .main_clk = "mcspi2_fck",
716 .module_offs = CORE_MOD,
718 .module_bit = OMAP24XX_EN_MCSPI2_SHIFT,
720 .idlest_idle_bit = OMAP24XX_ST_MCSPI2_SHIFT,
723 .class = &omap2xxx_mcspi_class,
724 .dev_attr = &omap_mcspi2_dev_attr,
728 static struct omap_hwmod_class omap2xxx_counter_hwmod_class = {
732 struct omap_hwmod omap2xxx_counter_32k_hwmod = {
733 .name = "counter_32k",
734 .main_clk = "func_32k_ck",
737 .module_offs = WKUP_MOD,
739 .module_bit = OMAP24XX_ST_32KSYNC_SHIFT,
741 .idlest_idle_bit = OMAP24XX_ST_32KSYNC_SHIFT,
744 .class = &omap2xxx_counter_hwmod_class,