blob: 27bdff46fda047752738ccda30c63c3d74a0021f [file] [log] [blame]
Paul Walmsley0d619a82011-07-09 19:14:07 -06001/*
2 * omap_hwmod_2xxx_ipblock_data.c - common IP block data for OMAP2xxx
3 *
4 * Copyright (C) 2011 Nokia Corporation
5 * Paul Walmsley
6 *
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.
10 */
Tony Lindgren2a296c82012-10-02 17:41:35 -070011
Paul Walmsley0d619a82011-07-09 19:14:07 -060012#include <plat/serial.h>
Tony Lindgren4b254082012-08-30 15:37:24 -070013#include <linux/platform_data/gpio-omap.h>
Lokesh Vutla2b6c4e72012-10-15 14:04:53 -070014#include <plat-omap/dma-omap.h>
Paul Walmsley273b9462011-07-09 19:14:08 -060015#include <plat/dmtimer.h>
Arnd Bergmann22037472012-08-24 15:21:06 +020016#include <linux/platform_data/spi-omap2-mcspi.h>
Paul Walmsley0d619a82011-07-09 19:14:07 -060017
Tony Lindgren2a296c82012-10-02 17:41:35 -070018#include "omap_hwmod.h"
Paul Walmsley0d619a82011-07-09 19:14:07 -060019#include "omap_hwmod_common_data.h"
Paul Walmsleycb484272012-04-19 04:04:33 -060020#include "cm-regbits-24xx.h"
21#include "prm-regbits-24xx.h"
Paul Walmsley273b9462011-07-09 19:14:08 -060022#include "wd_timer.h"
Paul Walmsley0d619a82011-07-09 19:14:07 -060023
24struct omap_hwmod_irq_info omap2xxx_timer12_mpu_irqs[] = {
Tony Lindgren7d7e1eb2012-08-27 17:43:01 -070025 { .irq = 48 + OMAP_INTC_START, },
26 { .irq = -1 },
Paul Walmsley0d619a82011-07-09 19:14:07 -060027};
Paul Walmsleyd826ebf2011-07-09 19:14:07 -060028
29struct omap_hwmod_dma_info omap2xxx_dss_sdma_chs[] = {
30 { .name = "dispc", .dma_req = 5 },
31 { .dma_req = -1 }
32};
Tomi Valkeinen1ac6d462012-01-23 14:15:28 +020033
34/*
35 * 'dispc' class
36 * display controller
37 */
38
39static struct omap_hwmod_class_sysconfig omap2_dispc_sysc = {
40 .rev_offs = 0x0000,
41 .sysc_offs = 0x0010,
42 .syss_offs = 0x0014,
43 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE |
44 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
45 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
46 MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
47 .sysc_fields = &omap_hwmod_sysc_type1,
48};
49
50struct omap_hwmod_class omap2_dispc_hwmod_class = {
51 .name = "dispc",
52 .sysc = &omap2_dispc_sysc,
53};
54
Paul Walmsley273b9462011-07-09 19:14:08 -060055/* OMAP2xxx Timer Common */
56static struct omap_hwmod_class_sysconfig omap2xxx_timer_sysc = {
57 .rev_offs = 0x0000,
58 .sysc_offs = 0x0010,
59 .syss_offs = 0x0014,
60 .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_CLOCKACTIVITY |
61 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
62 SYSC_HAS_AUTOIDLE),
63 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
64 .sysc_fields = &omap_hwmod_sysc_type1,
65};
66
67struct omap_hwmod_class omap2xxx_timer_hwmod_class = {
68 .name = "timer",
69 .sysc = &omap2xxx_timer_sysc,
Paul Walmsley273b9462011-07-09 19:14:08 -060070};
71
72/*
73 * 'wd_timer' class
74 * 32-bit watchdog upward counter that generates a pulse on the reset pin on
75 * overflow condition
76 */
77
78static struct omap_hwmod_class_sysconfig omap2xxx_wd_timer_sysc = {
79 .rev_offs = 0x0000,
80 .sysc_offs = 0x0010,
81 .syss_offs = 0x0014,
82 .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_SOFTRESET |
83 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
84 .sysc_fields = &omap_hwmod_sysc_type1,
85};
86
87struct omap_hwmod_class omap2xxx_wd_timer_hwmod_class = {
88 .name = "wd_timer",
89 .sysc = &omap2xxx_wd_timer_sysc,
Kevin Hilman414e4122012-05-08 11:34:30 -060090 .pre_shutdown = &omap2_wd_timer_disable,
91 .reset = &omap2_wd_timer_reset,
Paul Walmsley273b9462011-07-09 19:14:08 -060092};
93
94/*
95 * 'gpio' class
96 * general purpose io module
97 */
98static struct omap_hwmod_class_sysconfig omap2xxx_gpio_sysc = {
99 .rev_offs = 0x0000,
100 .sysc_offs = 0x0010,
101 .syss_offs = 0x0014,
102 .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
103 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
104 SYSS_HAS_RESET_STATUS),
105 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
106 .sysc_fields = &omap_hwmod_sysc_type1,
107};
108
109struct omap_hwmod_class omap2xxx_gpio_hwmod_class = {
110 .name = "gpio",
111 .sysc = &omap2xxx_gpio_sysc,
112 .rev = 0,
113};
114
115/* system dma */
116static struct omap_hwmod_class_sysconfig omap2xxx_dma_sysc = {
117 .rev_offs = 0x0000,
118 .sysc_offs = 0x002c,
119 .syss_offs = 0x0028,
120 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_MIDLEMODE |
121 SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_EMUFREE |
122 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
123 .idlemodes = (MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
124 .sysc_fields = &omap_hwmod_sysc_type1,
125};
126
127struct omap_hwmod_class omap2xxx_dma_hwmod_class = {
128 .name = "dma",
129 .sysc = &omap2xxx_dma_sysc,
130};
131
132/*
133 * 'mailbox' class
134 * mailbox module allowing communication between the on-chip processors
135 * using a queued mailbox-interrupt mechanism.
136 */
137
138static struct omap_hwmod_class_sysconfig omap2xxx_mailbox_sysc = {
139 .rev_offs = 0x000,
140 .sysc_offs = 0x010,
141 .syss_offs = 0x014,
142 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
143 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
144 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
145 .sysc_fields = &omap_hwmod_sysc_type1,
146};
147
148struct omap_hwmod_class omap2xxx_mailbox_hwmod_class = {
149 .name = "mailbox",
150 .sysc = &omap2xxx_mailbox_sysc,
151};
152
153/*
154 * 'mcspi' class
155 * multichannel serial port interface (mcspi) / master/slave synchronous serial
156 * bus
157 */
158
159static struct omap_hwmod_class_sysconfig omap2xxx_mcspi_sysc = {
160 .rev_offs = 0x0000,
161 .sysc_offs = 0x0010,
162 .syss_offs = 0x0014,
163 .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_SIDLEMODE |
164 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
165 SYSC_HAS_AUTOIDLE | SYSS_HAS_RESET_STATUS),
166 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
167 .sysc_fields = &omap_hwmod_sysc_type1,
168};
169
170struct omap_hwmod_class omap2xxx_mcspi_class = {
171 .name = "mcspi",
172 .sysc = &omap2xxx_mcspi_sysc,
173 .rev = OMAP2_MCSPI_REV,
174};
Paul Walmsleycb484272012-04-19 04:04:33 -0600175
176/*
Afzal Mohammed49484a62012-09-23 17:28:24 -0600177 * 'gpmc' class
178 * general purpose memory controller
179 */
180
181static struct omap_hwmod_class_sysconfig omap2xxx_gpmc_sysc = {
182 .rev_offs = 0x0000,
183 .sysc_offs = 0x0010,
184 .syss_offs = 0x0014,
185 .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_SIDLEMODE |
186 SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
187 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
188 .sysc_fields = &omap_hwmod_sysc_type1,
189};
190
191static struct omap_hwmod_class omap2xxx_gpmc_hwmod_class = {
192 .name = "gpmc",
193 .sysc = &omap2xxx_gpmc_sysc,
194};
195
196/*
Paul Walmsleycb484272012-04-19 04:04:33 -0600197 * IP blocks
198 */
199
200/* L3 */
201struct omap_hwmod omap2xxx_l3_main_hwmod = {
202 .name = "l3_main",
203 .class = &l3_hwmod_class,
204 .flags = HWMOD_NO_IDLEST,
205};
206
207/* L4 CORE */
208struct omap_hwmod omap2xxx_l4_core_hwmod = {
209 .name = "l4_core",
210 .class = &l4_hwmod_class,
211 .flags = HWMOD_NO_IDLEST,
212};
213
214/* L4 WKUP */
215struct omap_hwmod omap2xxx_l4_wkup_hwmod = {
216 .name = "l4_wkup",
217 .class = &l4_hwmod_class,
218 .flags = HWMOD_NO_IDLEST,
219};
220
221/* MPU */
Jon Hunteree75d952012-09-23 17:28:29 -0600222static struct omap_hwmod_irq_info omap2xxx_mpu_irqs[] = {
Jon Hunter3dc34012012-10-07 13:09:59 -0600223 { .name = "pmu", .irq = 3 + OMAP_INTC_START },
Jon Hunteree75d952012-09-23 17:28:29 -0600224 { .irq = -1 }
225};
226
Paul Walmsleycb484272012-04-19 04:04:33 -0600227struct omap_hwmod omap2xxx_mpu_hwmod = {
228 .name = "mpu",
Jon Hunteree75d952012-09-23 17:28:29 -0600229 .mpu_irqs = omap2xxx_mpu_irqs,
Paul Walmsleycb484272012-04-19 04:04:33 -0600230 .class = &mpu_hwmod_class,
231 .main_clk = "mpu_ck",
232};
233
234/* IVA2 */
235struct omap_hwmod omap2xxx_iva_hwmod = {
236 .name = "iva",
237 .class = &iva_hwmod_class,
238};
239
240/* always-on timers dev attribute */
241static struct omap_timer_capability_dev_attr capability_alwon_dev_attr = {
242 .timer_capability = OMAP_TIMER_ALWON,
243};
244
245/* pwm timers dev attribute */
246static struct omap_timer_capability_dev_attr capability_pwm_dev_attr = {
247 .timer_capability = OMAP_TIMER_HAS_PWM,
248};
249
Jon Hunter5c3e4ec2012-09-23 17:28:27 -0600250/* timers with DSP interrupt dev attribute */
251static struct omap_timer_capability_dev_attr capability_dsp_dev_attr = {
252 .timer_capability = OMAP_TIMER_HAS_DSP_IRQ,
253};
254
Paul Walmsleycb484272012-04-19 04:04:33 -0600255/* timer1 */
256
257struct omap_hwmod omap2xxx_timer1_hwmod = {
258 .name = "timer1",
259 .mpu_irqs = omap2_timer1_mpu_irqs,
260 .main_clk = "gpt1_fck",
261 .prcm = {
262 .omap2 = {
263 .prcm_reg_id = 1,
264 .module_bit = OMAP24XX_EN_GPT1_SHIFT,
265 .module_offs = WKUP_MOD,
266 .idlest_reg_id = 1,
267 .idlest_idle_bit = OMAP24XX_ST_GPT1_SHIFT,
268 },
269 },
270 .dev_attr = &capability_alwon_dev_attr,
271 .class = &omap2xxx_timer_hwmod_class,
272};
273
274/* timer2 */
275
276struct omap_hwmod omap2xxx_timer2_hwmod = {
277 .name = "timer2",
278 .mpu_irqs = omap2_timer2_mpu_irqs,
279 .main_clk = "gpt2_fck",
280 .prcm = {
281 .omap2 = {
282 .prcm_reg_id = 1,
283 .module_bit = OMAP24XX_EN_GPT2_SHIFT,
284 .module_offs = CORE_MOD,
285 .idlest_reg_id = 1,
286 .idlest_idle_bit = OMAP24XX_ST_GPT2_SHIFT,
287 },
288 },
Paul Walmsleycb484272012-04-19 04:04:33 -0600289 .class = &omap2xxx_timer_hwmod_class,
290};
291
292/* timer3 */
293
294struct omap_hwmod omap2xxx_timer3_hwmod = {
295 .name = "timer3",
296 .mpu_irqs = omap2_timer3_mpu_irqs,
297 .main_clk = "gpt3_fck",
298 .prcm = {
299 .omap2 = {
300 .prcm_reg_id = 1,
301 .module_bit = OMAP24XX_EN_GPT3_SHIFT,
302 .module_offs = CORE_MOD,
303 .idlest_reg_id = 1,
304 .idlest_idle_bit = OMAP24XX_ST_GPT3_SHIFT,
305 },
306 },
Paul Walmsleycb484272012-04-19 04:04:33 -0600307 .class = &omap2xxx_timer_hwmod_class,
308};
309
310/* timer4 */
311
312struct omap_hwmod omap2xxx_timer4_hwmod = {
313 .name = "timer4",
314 .mpu_irqs = omap2_timer4_mpu_irqs,
315 .main_clk = "gpt4_fck",
316 .prcm = {
317 .omap2 = {
318 .prcm_reg_id = 1,
319 .module_bit = OMAP24XX_EN_GPT4_SHIFT,
320 .module_offs = CORE_MOD,
321 .idlest_reg_id = 1,
322 .idlest_idle_bit = OMAP24XX_ST_GPT4_SHIFT,
323 },
324 },
Paul Walmsleycb484272012-04-19 04:04:33 -0600325 .class = &omap2xxx_timer_hwmod_class,
326};
327
328/* timer5 */
329
330struct omap_hwmod omap2xxx_timer5_hwmod = {
331 .name = "timer5",
332 .mpu_irqs = omap2_timer5_mpu_irqs,
333 .main_clk = "gpt5_fck",
334 .prcm = {
335 .omap2 = {
336 .prcm_reg_id = 1,
337 .module_bit = OMAP24XX_EN_GPT5_SHIFT,
338 .module_offs = CORE_MOD,
339 .idlest_reg_id = 1,
340 .idlest_idle_bit = OMAP24XX_ST_GPT5_SHIFT,
341 },
342 },
Jon Hunter5c3e4ec2012-09-23 17:28:27 -0600343 .dev_attr = &capability_dsp_dev_attr,
Paul Walmsleycb484272012-04-19 04:04:33 -0600344 .class = &omap2xxx_timer_hwmod_class,
345};
346
347/* timer6 */
348
349struct omap_hwmod omap2xxx_timer6_hwmod = {
350 .name = "timer6",
351 .mpu_irqs = omap2_timer6_mpu_irqs,
352 .main_clk = "gpt6_fck",
353 .prcm = {
354 .omap2 = {
355 .prcm_reg_id = 1,
356 .module_bit = OMAP24XX_EN_GPT6_SHIFT,
357 .module_offs = CORE_MOD,
358 .idlest_reg_id = 1,
359 .idlest_idle_bit = OMAP24XX_ST_GPT6_SHIFT,
360 },
361 },
Jon Hunter5c3e4ec2012-09-23 17:28:27 -0600362 .dev_attr = &capability_dsp_dev_attr,
Paul Walmsleycb484272012-04-19 04:04:33 -0600363 .class = &omap2xxx_timer_hwmod_class,
364};
365
366/* timer7 */
367
368struct omap_hwmod omap2xxx_timer7_hwmod = {
369 .name = "timer7",
370 .mpu_irqs = omap2_timer7_mpu_irqs,
371 .main_clk = "gpt7_fck",
372 .prcm = {
373 .omap2 = {
374 .prcm_reg_id = 1,
375 .module_bit = OMAP24XX_EN_GPT7_SHIFT,
376 .module_offs = CORE_MOD,
377 .idlest_reg_id = 1,
378 .idlest_idle_bit = OMAP24XX_ST_GPT7_SHIFT,
379 },
380 },
Jon Hunter5c3e4ec2012-09-23 17:28:27 -0600381 .dev_attr = &capability_dsp_dev_attr,
Paul Walmsleycb484272012-04-19 04:04:33 -0600382 .class = &omap2xxx_timer_hwmod_class,
383};
384
385/* timer8 */
386
387struct omap_hwmod omap2xxx_timer8_hwmod = {
388 .name = "timer8",
389 .mpu_irqs = omap2_timer8_mpu_irqs,
390 .main_clk = "gpt8_fck",
391 .prcm = {
392 .omap2 = {
393 .prcm_reg_id = 1,
394 .module_bit = OMAP24XX_EN_GPT8_SHIFT,
395 .module_offs = CORE_MOD,
396 .idlest_reg_id = 1,
397 .idlest_idle_bit = OMAP24XX_ST_GPT8_SHIFT,
398 },
399 },
Jon Hunter5c3e4ec2012-09-23 17:28:27 -0600400 .dev_attr = &capability_dsp_dev_attr,
Paul Walmsleycb484272012-04-19 04:04:33 -0600401 .class = &omap2xxx_timer_hwmod_class,
402};
403
404/* timer9 */
405
406struct omap_hwmod omap2xxx_timer9_hwmod = {
407 .name = "timer9",
408 .mpu_irqs = omap2_timer9_mpu_irqs,
409 .main_clk = "gpt9_fck",
410 .prcm = {
411 .omap2 = {
412 .prcm_reg_id = 1,
413 .module_bit = OMAP24XX_EN_GPT9_SHIFT,
414 .module_offs = CORE_MOD,
415 .idlest_reg_id = 1,
416 .idlest_idle_bit = OMAP24XX_ST_GPT9_SHIFT,
417 },
418 },
419 .dev_attr = &capability_pwm_dev_attr,
420 .class = &omap2xxx_timer_hwmod_class,
421};
422
423/* timer10 */
424
425struct omap_hwmod omap2xxx_timer10_hwmod = {
426 .name = "timer10",
427 .mpu_irqs = omap2_timer10_mpu_irqs,
428 .main_clk = "gpt10_fck",
429 .prcm = {
430 .omap2 = {
431 .prcm_reg_id = 1,
432 .module_bit = OMAP24XX_EN_GPT10_SHIFT,
433 .module_offs = CORE_MOD,
434 .idlest_reg_id = 1,
435 .idlest_idle_bit = OMAP24XX_ST_GPT10_SHIFT,
436 },
437 },
438 .dev_attr = &capability_pwm_dev_attr,
439 .class = &omap2xxx_timer_hwmod_class,
440};
441
442/* timer11 */
443
444struct omap_hwmod omap2xxx_timer11_hwmod = {
445 .name = "timer11",
446 .mpu_irqs = omap2_timer11_mpu_irqs,
447 .main_clk = "gpt11_fck",
448 .prcm = {
449 .omap2 = {
450 .prcm_reg_id = 1,
451 .module_bit = OMAP24XX_EN_GPT11_SHIFT,
452 .module_offs = CORE_MOD,
453 .idlest_reg_id = 1,
454 .idlest_idle_bit = OMAP24XX_ST_GPT11_SHIFT,
455 },
456 },
457 .dev_attr = &capability_pwm_dev_attr,
458 .class = &omap2xxx_timer_hwmod_class,
459};
460
461/* timer12 */
462
463struct omap_hwmod omap2xxx_timer12_hwmod = {
464 .name = "timer12",
465 .mpu_irqs = omap2xxx_timer12_mpu_irqs,
466 .main_clk = "gpt12_fck",
467 .prcm = {
468 .omap2 = {
469 .prcm_reg_id = 1,
470 .module_bit = OMAP24XX_EN_GPT12_SHIFT,
471 .module_offs = CORE_MOD,
472 .idlest_reg_id = 1,
473 .idlest_idle_bit = OMAP24XX_ST_GPT12_SHIFT,
474 },
475 },
476 .dev_attr = &capability_pwm_dev_attr,
477 .class = &omap2xxx_timer_hwmod_class,
478};
479
480/* wd_timer2 */
481struct omap_hwmod omap2xxx_wd_timer2_hwmod = {
482 .name = "wd_timer2",
483 .class = &omap2xxx_wd_timer_hwmod_class,
484 .main_clk = "mpu_wdt_fck",
485 .prcm = {
486 .omap2 = {
487 .prcm_reg_id = 1,
488 .module_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
489 .module_offs = WKUP_MOD,
490 .idlest_reg_id = 1,
491 .idlest_idle_bit = OMAP24XX_ST_MPU_WDT_SHIFT,
492 },
493 },
494};
495
496/* UART1 */
497
498struct omap_hwmod omap2xxx_uart1_hwmod = {
499 .name = "uart1",
500 .mpu_irqs = omap2_uart1_mpu_irqs,
501 .sdma_reqs = omap2_uart1_sdma_reqs,
502 .main_clk = "uart1_fck",
503 .prcm = {
504 .omap2 = {
505 .module_offs = CORE_MOD,
506 .prcm_reg_id = 1,
507 .module_bit = OMAP24XX_EN_UART1_SHIFT,
508 .idlest_reg_id = 1,
509 .idlest_idle_bit = OMAP24XX_EN_UART1_SHIFT,
510 },
511 },
512 .class = &omap2_uart_class,
513};
514
515/* UART2 */
516
517struct omap_hwmod omap2xxx_uart2_hwmod = {
518 .name = "uart2",
519 .mpu_irqs = omap2_uart2_mpu_irqs,
520 .sdma_reqs = omap2_uart2_sdma_reqs,
521 .main_clk = "uart2_fck",
522 .prcm = {
523 .omap2 = {
524 .module_offs = CORE_MOD,
525 .prcm_reg_id = 1,
526 .module_bit = OMAP24XX_EN_UART2_SHIFT,
527 .idlest_reg_id = 1,
528 .idlest_idle_bit = OMAP24XX_EN_UART2_SHIFT,
529 },
530 },
531 .class = &omap2_uart_class,
532};
533
534/* UART3 */
535
536struct omap_hwmod omap2xxx_uart3_hwmod = {
537 .name = "uart3",
538 .mpu_irqs = omap2_uart3_mpu_irqs,
539 .sdma_reqs = omap2_uart3_sdma_reqs,
540 .main_clk = "uart3_fck",
541 .prcm = {
542 .omap2 = {
543 .module_offs = CORE_MOD,
544 .prcm_reg_id = 2,
545 .module_bit = OMAP24XX_EN_UART3_SHIFT,
546 .idlest_reg_id = 2,
547 .idlest_idle_bit = OMAP24XX_EN_UART3_SHIFT,
548 },
549 },
550 .class = &omap2_uart_class,
551};
552
553/* dss */
554
555static struct omap_hwmod_opt_clk dss_opt_clks[] = {
556 /*
557 * The DSS HW needs all DSS clocks enabled during reset. The dss_core
558 * driver does not use these clocks.
559 */
560 { .role = "tv_clk", .clk = "dss_54m_fck" },
561 { .role = "sys_clk", .clk = "dss2_fck" },
562};
563
564struct omap_hwmod omap2xxx_dss_core_hwmod = {
565 .name = "dss_core",
566 .class = &omap2_dss_hwmod_class,
567 .main_clk = "dss1_fck", /* instead of dss_fck */
568 .sdma_reqs = omap2xxx_dss_sdma_chs,
569 .prcm = {
570 .omap2 = {
571 .prcm_reg_id = 1,
572 .module_bit = OMAP24XX_EN_DSS1_SHIFT,
573 .module_offs = CORE_MOD,
574 .idlest_reg_id = 1,
575 .idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT,
576 },
577 },
578 .opt_clks = dss_opt_clks,
579 .opt_clks_cnt = ARRAY_SIZE(dss_opt_clks),
580 .flags = HWMOD_NO_IDLEST | HWMOD_CONTROL_OPT_CLKS_IN_RESET,
581};
582
583struct omap_hwmod omap2xxx_dss_dispc_hwmod = {
584 .name = "dss_dispc",
585 .class = &omap2_dispc_hwmod_class,
586 .mpu_irqs = omap2_dispc_irqs,
587 .main_clk = "dss1_fck",
588 .prcm = {
589 .omap2 = {
590 .prcm_reg_id = 1,
591 .module_bit = OMAP24XX_EN_DSS1_SHIFT,
592 .module_offs = CORE_MOD,
593 .idlest_reg_id = 1,
594 .idlest_stdby_bit = OMAP24XX_ST_DSS_SHIFT,
595 },
596 },
597 .flags = HWMOD_NO_IDLEST,
598 .dev_attr = &omap2_3_dss_dispc_dev_attr
599};
600
601static struct omap_hwmod_opt_clk dss_rfbi_opt_clks[] = {
602 { .role = "ick", .clk = "dss_ick" },
603};
604
605struct omap_hwmod omap2xxx_dss_rfbi_hwmod = {
606 .name = "dss_rfbi",
607 .class = &omap2_rfbi_hwmod_class,
608 .main_clk = "dss1_fck",
609 .prcm = {
610 .omap2 = {
611 .prcm_reg_id = 1,
612 .module_bit = OMAP24XX_EN_DSS1_SHIFT,
613 .module_offs = CORE_MOD,
614 },
615 },
616 .opt_clks = dss_rfbi_opt_clks,
617 .opt_clks_cnt = ARRAY_SIZE(dss_rfbi_opt_clks),
618 .flags = HWMOD_NO_IDLEST,
619};
620
621struct omap_hwmod omap2xxx_dss_venc_hwmod = {
622 .name = "dss_venc",
623 .class = &omap2_venc_hwmod_class,
624 .main_clk = "dss_54m_fck",
625 .prcm = {
626 .omap2 = {
627 .prcm_reg_id = 1,
628 .module_bit = OMAP24XX_EN_DSS1_SHIFT,
629 .module_offs = CORE_MOD,
630 },
631 },
632 .flags = HWMOD_NO_IDLEST,
633};
634
635/* gpio dev_attr */
636struct omap_gpio_dev_attr omap2xxx_gpio_dev_attr = {
637 .bank_width = 32,
638 .dbck_flag = false,
639};
640
641/* gpio1 */
642struct omap_hwmod omap2xxx_gpio1_hwmod = {
643 .name = "gpio1",
644 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
645 .mpu_irqs = omap2_gpio1_irqs,
646 .main_clk = "gpios_fck",
647 .prcm = {
648 .omap2 = {
649 .prcm_reg_id = 1,
650 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
651 .module_offs = WKUP_MOD,
652 .idlest_reg_id = 1,
653 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
654 },
655 },
656 .class = &omap2xxx_gpio_hwmod_class,
657 .dev_attr = &omap2xxx_gpio_dev_attr,
658};
659
660/* gpio2 */
661struct omap_hwmod omap2xxx_gpio2_hwmod = {
662 .name = "gpio2",
663 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
664 .mpu_irqs = omap2_gpio2_irqs,
665 .main_clk = "gpios_fck",
666 .prcm = {
667 .omap2 = {
668 .prcm_reg_id = 1,
669 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
670 .module_offs = WKUP_MOD,
671 .idlest_reg_id = 1,
672 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
673 },
674 },
675 .class = &omap2xxx_gpio_hwmod_class,
676 .dev_attr = &omap2xxx_gpio_dev_attr,
677};
678
679/* gpio3 */
680struct omap_hwmod omap2xxx_gpio3_hwmod = {
681 .name = "gpio3",
682 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
683 .mpu_irqs = omap2_gpio3_irqs,
684 .main_clk = "gpios_fck",
685 .prcm = {
686 .omap2 = {
687 .prcm_reg_id = 1,
688 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
689 .module_offs = WKUP_MOD,
690 .idlest_reg_id = 1,
691 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
692 },
693 },
694 .class = &omap2xxx_gpio_hwmod_class,
695 .dev_attr = &omap2xxx_gpio_dev_attr,
696};
697
698/* gpio4 */
699struct omap_hwmod omap2xxx_gpio4_hwmod = {
700 .name = "gpio4",
701 .flags = HWMOD_CONTROL_OPT_CLKS_IN_RESET,
702 .mpu_irqs = omap2_gpio4_irqs,
703 .main_clk = "gpios_fck",
704 .prcm = {
705 .omap2 = {
706 .prcm_reg_id = 1,
707 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
708 .module_offs = WKUP_MOD,
709 .idlest_reg_id = 1,
710 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
711 },
712 },
713 .class = &omap2xxx_gpio_hwmod_class,
714 .dev_attr = &omap2xxx_gpio_dev_attr,
715};
716
717/* mcspi1 */
718static struct omap2_mcspi_dev_attr omap_mcspi1_dev_attr = {
719 .num_chipselect = 4,
720};
721
722struct omap_hwmod omap2xxx_mcspi1_hwmod = {
723 .name = "mcspi1",
724 .mpu_irqs = omap2_mcspi1_mpu_irqs,
725 .sdma_reqs = omap2_mcspi1_sdma_reqs,
726 .main_clk = "mcspi1_fck",
727 .prcm = {
728 .omap2 = {
729 .module_offs = CORE_MOD,
730 .prcm_reg_id = 1,
731 .module_bit = OMAP24XX_EN_MCSPI1_SHIFT,
732 .idlest_reg_id = 1,
733 .idlest_idle_bit = OMAP24XX_ST_MCSPI1_SHIFT,
734 },
735 },
736 .class = &omap2xxx_mcspi_class,
737 .dev_attr = &omap_mcspi1_dev_attr,
738};
739
740/* mcspi2 */
741static struct omap2_mcspi_dev_attr omap_mcspi2_dev_attr = {
742 .num_chipselect = 2,
743};
744
745struct omap_hwmod omap2xxx_mcspi2_hwmod = {
746 .name = "mcspi2",
747 .mpu_irqs = omap2_mcspi2_mpu_irqs,
748 .sdma_reqs = omap2_mcspi2_sdma_reqs,
749 .main_clk = "mcspi2_fck",
750 .prcm = {
751 .omap2 = {
752 .module_offs = CORE_MOD,
753 .prcm_reg_id = 1,
754 .module_bit = OMAP24XX_EN_MCSPI2_SHIFT,
755 .idlest_reg_id = 1,
756 .idlest_idle_bit = OMAP24XX_ST_MCSPI2_SHIFT,
757 },
758 },
759 .class = &omap2xxx_mcspi_class,
760 .dev_attr = &omap_mcspi2_dev_attr,
761};
Vaibhav Hiremathc8d82ff2012-05-08 11:34:30 -0600762
Vaibhav Hiremathc8d82ff2012-05-08 11:34:30 -0600763static struct omap_hwmod_class omap2xxx_counter_hwmod_class = {
764 .name = "counter",
765};
766
767struct omap_hwmod omap2xxx_counter_32k_hwmod = {
768 .name = "counter_32k",
769 .main_clk = "func_32k_ck",
770 .prcm = {
771 .omap2 = {
772 .module_offs = WKUP_MOD,
773 .prcm_reg_id = 1,
774 .module_bit = OMAP24XX_ST_32KSYNC_SHIFT,
775 .idlest_reg_id = 1,
776 .idlest_idle_bit = OMAP24XX_ST_32KSYNC_SHIFT,
777 },
778 },
779 .class = &omap2xxx_counter_hwmod_class,
780};
Afzal Mohammed49484a62012-09-23 17:28:24 -0600781
782/* gpmc */
783static struct omap_hwmod_irq_info omap2xxx_gpmc_irqs[] = {
784 { .irq = 20 },
785 { .irq = -1 }
786};
787
788struct omap_hwmod omap2xxx_gpmc_hwmod = {
789 .name = "gpmc",
790 .class = &omap2xxx_gpmc_hwmod_class,
791 .mpu_irqs = omap2xxx_gpmc_irqs,
792 .main_clk = "gpmc_fck",
793 /*
794 * XXX HWMOD_INIT_NO_RESET should not be needed for this IP
795 * block. It is not being added due to any known bugs with
796 * resetting the GPMC IP block, but rather because any timings
797 * set by the bootloader are not being correctly programmed by
798 * the kernel from the board file or DT data.
799 * HWMOD_INIT_NO_RESET should be removed ASAP.
800 */
801 .flags = (HWMOD_INIT_NO_IDLE | HWMOD_INIT_NO_RESET |
802 HWMOD_NO_IDLEST),
803 .prcm = {
804 .omap2 = {
805 .prcm_reg_id = 3,
806 .module_bit = OMAP24XX_EN_GPMC_MASK,
807 .module_offs = CORE_MOD,
808 },
809 },
810};
Paul Walmsleye9b0a2f2012-09-23 17:28:25 -0600811
812/* RNG */
813
814static struct omap_hwmod_class_sysconfig omap2_rng_sysc = {
815 .rev_offs = 0x3c,
816 .sysc_offs = 0x40,
817 .syss_offs = 0x44,
818 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE |
819 SYSS_HAS_RESET_STATUS),
820 .sysc_fields = &omap_hwmod_sysc_type1,
821};
822
823static struct omap_hwmod_class omap2_rng_hwmod_class = {
824 .name = "rng",
825 .sysc = &omap2_rng_sysc,
826};
827
828static struct omap_hwmod_irq_info omap2_rng_mpu_irqs[] = {
829 { .irq = 52 },
830 { .irq = -1 }
831};
832
833struct omap_hwmod omap2xxx_rng_hwmod = {
834 .name = "rng",
835 .mpu_irqs = omap2_rng_mpu_irqs,
836 .main_clk = "l4_ck",
837 .prcm = {
838 .omap2 = {
839 .module_offs = CORE_MOD,
840 .prcm_reg_id = 4,
841 .module_bit = OMAP24XX_EN_RNG_SHIFT,
842 .idlest_reg_id = 4,
843 .idlest_idle_bit = OMAP24XX_ST_RNG_SHIFT,
844 },
845 },
846 /*
847 * XXX The first read from the SYSSTATUS register of the RNG
848 * after the SYSCONFIG SOFTRESET bit is set triggers an
849 * imprecise external abort. It's unclear why this happens.
850 * Until this is analyzed, skip the IP block reset.
851 */
852 .flags = HWMOD_INIT_NO_RESET,
853 .class = &omap2_rng_hwmod_class,
854};