blob: 42606f6b0cdf9209eb6246d30327e872708da683 [file] [log] [blame]
Paul Walmsley02bfc032009-09-03 20:14:05 +03001/*
Paul Walmsley73591542010-02-22 22:09:32 -07002 * omap_hwmod_2420_data.c - hardware modules present on the OMAP2420 chips
Paul Walmsley02bfc032009-09-03 20:14:05 +03003 *
Paul Walmsley73591542010-02-22 22:09:32 -07004 * Copyright (C) 2009-2010 Nokia Corporation
Paul Walmsley02bfc032009-09-03 20:14:05 +03005 * 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 *
11 * XXX handle crossbar/shared link difference for L3?
Paul Walmsley73591542010-02-22 22:09:32 -070012 * XXX these should be marked initdata for multi-OMAP kernels
Paul Walmsley02bfc032009-09-03 20:14:05 +030013 */
Tony Lindgrence491cf2009-10-20 09:40:47 -070014#include <plat/omap_hwmod.h>
Paul Walmsley02bfc032009-09-03 20:14:05 +030015#include <mach/irqs.h>
Tony Lindgrence491cf2009-10-20 09:40:47 -070016#include <plat/cpu.h>
17#include <plat/dma.h>
Kevin Hilman046465b2010-09-27 20:19:30 +053018#include <plat/serial.h>
Paul Walmsley20042902010-09-30 02:40:12 +053019#include <plat/i2c.h>
Varadarajan, Charulatha59c348c2010-12-07 16:26:56 -080020#include <plat/gpio.h>
Paul Walmsley02bfc032009-09-03 20:14:05 +030021
Paul Walmsley43b40992010-02-22 22:09:34 -070022#include "omap_hwmod_common_data.h"
23
Varadarajan, Charulathaa714b9c2010-09-23 20:02:39 +053024#include "cm-regbits-24xx.h"
Paul Walmsley20042902010-09-30 02:40:12 +053025#include "prm-regbits-24xx.h"
Paul Walmsley02bfc032009-09-03 20:14:05 +030026
Paul Walmsley73591542010-02-22 22:09:32 -070027/*
28 * OMAP2420 hardware module integration data
29 *
30 * ALl of the data in this section should be autogeneratable from the
31 * TI hardware database or other technical documentation. Data that
32 * is driver-specific or driver-kernel integration-specific belongs
33 * elsewhere.
34 */
35
Paul Walmsley02bfc032009-09-03 20:14:05 +030036static struct omap_hwmod omap2420_mpu_hwmod;
Paul Walmsley08072ac2010-07-26 16:34:33 -060037static struct omap_hwmod omap2420_iva_hwmod;
Kevin Hilman4a7cf902010-07-26 16:34:32 -060038static struct omap_hwmod omap2420_l3_main_hwmod;
Paul Walmsley02bfc032009-09-03 20:14:05 +030039static struct omap_hwmod omap2420_l4_core_hwmod;
Varadarajan, Charulathaa714b9c2010-09-23 20:02:39 +053040static struct omap_hwmod omap2420_wd_timer2_hwmod;
Varadarajan, Charulatha59c348c2010-12-07 16:26:56 -080041static struct omap_hwmod omap2420_gpio1_hwmod;
42static struct omap_hwmod omap2420_gpio2_hwmod;
43static struct omap_hwmod omap2420_gpio3_hwmod;
44static struct omap_hwmod omap2420_gpio4_hwmod;
G, Manjunath Kondaiah745685df92010-12-20 18:27:18 -080045static struct omap_hwmod omap2420_dma_system_hwmod;
Paul Walmsley02bfc032009-09-03 20:14:05 +030046
47/* L3 -> L4_CORE interface */
Kevin Hilman4a7cf902010-07-26 16:34:32 -060048static struct omap_hwmod_ocp_if omap2420_l3_main__l4_core = {
49 .master = &omap2420_l3_main_hwmod,
Paul Walmsley02bfc032009-09-03 20:14:05 +030050 .slave = &omap2420_l4_core_hwmod,
51 .user = OCP_USER_MPU | OCP_USER_SDMA,
52};
53
54/* MPU -> L3 interface */
Kevin Hilman4a7cf902010-07-26 16:34:32 -060055static struct omap_hwmod_ocp_if omap2420_mpu__l3_main = {
Paul Walmsley02bfc032009-09-03 20:14:05 +030056 .master = &omap2420_mpu_hwmod,
Kevin Hilman4a7cf902010-07-26 16:34:32 -060057 .slave = &omap2420_l3_main_hwmod,
Paul Walmsley02bfc032009-09-03 20:14:05 +030058 .user = OCP_USER_MPU,
59};
60
61/* Slave interfaces on the L3 interconnect */
Kevin Hilman4a7cf902010-07-26 16:34:32 -060062static struct omap_hwmod_ocp_if *omap2420_l3_main_slaves[] = {
63 &omap2420_mpu__l3_main,
Paul Walmsley02bfc032009-09-03 20:14:05 +030064};
65
66/* Master interfaces on the L3 interconnect */
Kevin Hilman4a7cf902010-07-26 16:34:32 -060067static struct omap_hwmod_ocp_if *omap2420_l3_main_masters[] = {
68 &omap2420_l3_main__l4_core,
Paul Walmsley02bfc032009-09-03 20:14:05 +030069};
70
71/* L3 */
Kevin Hilman4a7cf902010-07-26 16:34:32 -060072static struct omap_hwmod omap2420_l3_main_hwmod = {
Benoit Coussonfa983472010-07-26 16:34:29 -060073 .name = "l3_main",
Paul Walmsley43b40992010-02-22 22:09:34 -070074 .class = &l3_hwmod_class,
Kevin Hilman4a7cf902010-07-26 16:34:32 -060075 .masters = omap2420_l3_main_masters,
76 .masters_cnt = ARRAY_SIZE(omap2420_l3_main_masters),
77 .slaves = omap2420_l3_main_slaves,
78 .slaves_cnt = ARRAY_SIZE(omap2420_l3_main_slaves),
Kevin Hilman2eb18752010-07-26 16:34:28 -060079 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
80 .flags = HWMOD_NO_IDLEST,
Paul Walmsley02bfc032009-09-03 20:14:05 +030081};
82
83static struct omap_hwmod omap2420_l4_wkup_hwmod;
Kevin Hilman046465b2010-09-27 20:19:30 +053084static struct omap_hwmod omap2420_uart1_hwmod;
85static struct omap_hwmod omap2420_uart2_hwmod;
86static struct omap_hwmod omap2420_uart3_hwmod;
Paul Walmsley20042902010-09-30 02:40:12 +053087static struct omap_hwmod omap2420_i2c1_hwmod;
88static struct omap_hwmod omap2420_i2c2_hwmod;
Paul Walmsley02bfc032009-09-03 20:14:05 +030089
90/* L4_CORE -> L4_WKUP interface */
91static struct omap_hwmod_ocp_if omap2420_l4_core__l4_wkup = {
92 .master = &omap2420_l4_core_hwmod,
93 .slave = &omap2420_l4_wkup_hwmod,
94 .user = OCP_USER_MPU | OCP_USER_SDMA,
95};
96
Kevin Hilman046465b2010-09-27 20:19:30 +053097/* L4 CORE -> UART1 interface */
98static struct omap_hwmod_addr_space omap2420_uart1_addr_space[] = {
99 {
100 .pa_start = OMAP2_UART1_BASE,
101 .pa_end = OMAP2_UART1_BASE + SZ_8K - 1,
102 .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
103 },
104};
105
106static struct omap_hwmod_ocp_if omap2_l4_core__uart1 = {
107 .master = &omap2420_l4_core_hwmod,
108 .slave = &omap2420_uart1_hwmod,
109 .clk = "uart1_ick",
110 .addr = omap2420_uart1_addr_space,
111 .addr_cnt = ARRAY_SIZE(omap2420_uart1_addr_space),
112 .user = OCP_USER_MPU | OCP_USER_SDMA,
113};
114
115/* L4 CORE -> UART2 interface */
116static struct omap_hwmod_addr_space omap2420_uart2_addr_space[] = {
117 {
118 .pa_start = OMAP2_UART2_BASE,
119 .pa_end = OMAP2_UART2_BASE + SZ_1K - 1,
120 .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
121 },
122};
123
124static struct omap_hwmod_ocp_if omap2_l4_core__uart2 = {
125 .master = &omap2420_l4_core_hwmod,
126 .slave = &omap2420_uart2_hwmod,
127 .clk = "uart2_ick",
128 .addr = omap2420_uart2_addr_space,
129 .addr_cnt = ARRAY_SIZE(omap2420_uart2_addr_space),
130 .user = OCP_USER_MPU | OCP_USER_SDMA,
131};
132
133/* L4 PER -> UART3 interface */
134static struct omap_hwmod_addr_space omap2420_uart3_addr_space[] = {
135 {
136 .pa_start = OMAP2_UART3_BASE,
137 .pa_end = OMAP2_UART3_BASE + SZ_1K - 1,
138 .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
139 },
140};
141
142static struct omap_hwmod_ocp_if omap2_l4_core__uart3 = {
143 .master = &omap2420_l4_core_hwmod,
144 .slave = &omap2420_uart3_hwmod,
145 .clk = "uart3_ick",
146 .addr = omap2420_uart3_addr_space,
147 .addr_cnt = ARRAY_SIZE(omap2420_uart3_addr_space),
148 .user = OCP_USER_MPU | OCP_USER_SDMA,
149};
150
Paul Walmsley20042902010-09-30 02:40:12 +0530151/* I2C IP block address space length (in bytes) */
152#define OMAP2_I2C_AS_LEN 128
153
154/* L4 CORE -> I2C1 interface */
155static struct omap_hwmod_addr_space omap2420_i2c1_addr_space[] = {
156 {
157 .pa_start = 0x48070000,
158 .pa_end = 0x48070000 + OMAP2_I2C_AS_LEN - 1,
159 .flags = ADDR_TYPE_RT,
160 },
161};
162
163static struct omap_hwmod_ocp_if omap2420_l4_core__i2c1 = {
164 .master = &omap2420_l4_core_hwmod,
165 .slave = &omap2420_i2c1_hwmod,
166 .clk = "i2c1_ick",
167 .addr = omap2420_i2c1_addr_space,
168 .addr_cnt = ARRAY_SIZE(omap2420_i2c1_addr_space),
169 .user = OCP_USER_MPU | OCP_USER_SDMA,
170};
171
172/* L4 CORE -> I2C2 interface */
173static struct omap_hwmod_addr_space omap2420_i2c2_addr_space[] = {
174 {
175 .pa_start = 0x48072000,
176 .pa_end = 0x48072000 + OMAP2_I2C_AS_LEN - 1,
177 .flags = ADDR_TYPE_RT,
178 },
179};
180
181static struct omap_hwmod_ocp_if omap2420_l4_core__i2c2 = {
182 .master = &omap2420_l4_core_hwmod,
183 .slave = &omap2420_i2c2_hwmod,
184 .clk = "i2c2_ick",
185 .addr = omap2420_i2c2_addr_space,
186 .addr_cnt = ARRAY_SIZE(omap2420_i2c2_addr_space),
187 .user = OCP_USER_MPU | OCP_USER_SDMA,
188};
189
Paul Walmsley02bfc032009-09-03 20:14:05 +0300190/* Slave interfaces on the L4_CORE interconnect */
191static struct omap_hwmod_ocp_if *omap2420_l4_core_slaves[] = {
Kevin Hilman4a7cf902010-07-26 16:34:32 -0600192 &omap2420_l3_main__l4_core,
Paul Walmsley02bfc032009-09-03 20:14:05 +0300193};
194
195/* Master interfaces on the L4_CORE interconnect */
196static struct omap_hwmod_ocp_if *omap2420_l4_core_masters[] = {
197 &omap2420_l4_core__l4_wkup,
Kevin Hilman046465b2010-09-27 20:19:30 +0530198 &omap2_l4_core__uart1,
199 &omap2_l4_core__uart2,
200 &omap2_l4_core__uart3,
Paul Walmsley20042902010-09-30 02:40:12 +0530201 &omap2420_l4_core__i2c1,
202 &omap2420_l4_core__i2c2
Paul Walmsley02bfc032009-09-03 20:14:05 +0300203};
204
205/* L4 CORE */
206static struct omap_hwmod omap2420_l4_core_hwmod = {
Benoit Coussonfa983472010-07-26 16:34:29 -0600207 .name = "l4_core",
Paul Walmsley43b40992010-02-22 22:09:34 -0700208 .class = &l4_hwmod_class,
Paul Walmsley02bfc032009-09-03 20:14:05 +0300209 .masters = omap2420_l4_core_masters,
210 .masters_cnt = ARRAY_SIZE(omap2420_l4_core_masters),
211 .slaves = omap2420_l4_core_slaves,
212 .slaves_cnt = ARRAY_SIZE(omap2420_l4_core_slaves),
Kevin Hilman2eb18752010-07-26 16:34:28 -0600213 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
214 .flags = HWMOD_NO_IDLEST,
Paul Walmsley02bfc032009-09-03 20:14:05 +0300215};
216
217/* Slave interfaces on the L4_WKUP interconnect */
218static struct omap_hwmod_ocp_if *omap2420_l4_wkup_slaves[] = {
219 &omap2420_l4_core__l4_wkup,
220};
221
222/* Master interfaces on the L4_WKUP interconnect */
223static struct omap_hwmod_ocp_if *omap2420_l4_wkup_masters[] = {
224};
225
226/* L4 WKUP */
227static struct omap_hwmod omap2420_l4_wkup_hwmod = {
Benoit Coussonfa983472010-07-26 16:34:29 -0600228 .name = "l4_wkup",
Paul Walmsley43b40992010-02-22 22:09:34 -0700229 .class = &l4_hwmod_class,
Paul Walmsley02bfc032009-09-03 20:14:05 +0300230 .masters = omap2420_l4_wkup_masters,
231 .masters_cnt = ARRAY_SIZE(omap2420_l4_wkup_masters),
232 .slaves = omap2420_l4_wkup_slaves,
233 .slaves_cnt = ARRAY_SIZE(omap2420_l4_wkup_slaves),
Kevin Hilman2eb18752010-07-26 16:34:28 -0600234 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
235 .flags = HWMOD_NO_IDLEST,
Paul Walmsley02bfc032009-09-03 20:14:05 +0300236};
237
238/* Master interfaces on the MPU device */
239static struct omap_hwmod_ocp_if *omap2420_mpu_masters[] = {
Kevin Hilman4a7cf902010-07-26 16:34:32 -0600240 &omap2420_mpu__l3_main,
Paul Walmsley02bfc032009-09-03 20:14:05 +0300241};
242
243/* MPU */
244static struct omap_hwmod omap2420_mpu_hwmod = {
Benoit Cousson5c2c0292010-05-20 12:31:10 -0600245 .name = "mpu",
Paul Walmsley43b40992010-02-22 22:09:34 -0700246 .class = &mpu_hwmod_class,
Paul Walmsley50ebdac2010-02-22 22:09:31 -0700247 .main_clk = "mpu_ck",
Paul Walmsley02bfc032009-09-03 20:14:05 +0300248 .masters = omap2420_mpu_masters,
249 .masters_cnt = ARRAY_SIZE(omap2420_mpu_masters),
250 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
251};
252
Paul Walmsley08072ac2010-07-26 16:34:33 -0600253/*
254 * IVA1 interface data
255 */
256
257/* IVA <- L3 interface */
258static struct omap_hwmod_ocp_if omap2420_l3__iva = {
259 .master = &omap2420_l3_main_hwmod,
260 .slave = &omap2420_iva_hwmod,
261 .clk = "iva1_ifck",
262 .user = OCP_USER_MPU | OCP_USER_SDMA,
263};
264
265static struct omap_hwmod_ocp_if *omap2420_iva_masters[] = {
266 &omap2420_l3__iva,
267};
268
269/*
270 * IVA2 (IVA2)
271 */
272
273static struct omap_hwmod omap2420_iva_hwmod = {
274 .name = "iva",
275 .class = &iva_hwmod_class,
276 .masters = omap2420_iva_masters,
277 .masters_cnt = ARRAY_SIZE(omap2420_iva_masters),
278 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
279};
280
Varadarajan, Charulathaa714b9c2010-09-23 20:02:39 +0530281/* l4_wkup -> wd_timer2 */
282static struct omap_hwmod_addr_space omap2420_wd_timer2_addrs[] = {
283 {
284 .pa_start = 0x48022000,
285 .pa_end = 0x4802207f,
286 .flags = ADDR_TYPE_RT
287 },
288};
289
290static struct omap_hwmod_ocp_if omap2420_l4_wkup__wd_timer2 = {
291 .master = &omap2420_l4_wkup_hwmod,
292 .slave = &omap2420_wd_timer2_hwmod,
293 .clk = "mpu_wdt_ick",
294 .addr = omap2420_wd_timer2_addrs,
295 .addr_cnt = ARRAY_SIZE(omap2420_wd_timer2_addrs),
296 .user = OCP_USER_MPU | OCP_USER_SDMA,
297};
298
299/*
300 * 'wd_timer' class
301 * 32-bit watchdog upward counter that generates a pulse on the reset pin on
302 * overflow condition
303 */
304
305static struct omap_hwmod_class_sysconfig omap2420_wd_timer_sysc = {
306 .rev_offs = 0x0000,
307 .sysc_offs = 0x0010,
308 .syss_offs = 0x0014,
309 .sysc_flags = (SYSC_HAS_EMUFREE | SYSC_HAS_SOFTRESET |
310 SYSC_HAS_AUTOIDLE),
311 .sysc_fields = &omap_hwmod_sysc_type1,
312};
313
314static struct omap_hwmod_class omap2420_wd_timer_hwmod_class = {
315 .name = "wd_timer",
316 .sysc = &omap2420_wd_timer_sysc,
317};
318
319/* wd_timer2 */
320static struct omap_hwmod_ocp_if *omap2420_wd_timer2_slaves[] = {
321 &omap2420_l4_wkup__wd_timer2,
322};
323
324static struct omap_hwmod omap2420_wd_timer2_hwmod = {
325 .name = "wd_timer2",
326 .class = &omap2420_wd_timer_hwmod_class,
327 .main_clk = "mpu_wdt_fck",
328 .prcm = {
329 .omap2 = {
330 .prcm_reg_id = 1,
331 .module_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
332 .module_offs = WKUP_MOD,
333 .idlest_reg_id = 1,
334 .idlest_idle_bit = OMAP24XX_ST_MPU_WDT_SHIFT,
335 },
336 },
337 .slaves = omap2420_wd_timer2_slaves,
338 .slaves_cnt = ARRAY_SIZE(omap2420_wd_timer2_slaves),
339 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
340};
341
Kevin Hilman046465b2010-09-27 20:19:30 +0530342/* UART */
343
344static struct omap_hwmod_class_sysconfig uart_sysc = {
345 .rev_offs = 0x50,
346 .sysc_offs = 0x54,
347 .syss_offs = 0x58,
348 .sysc_flags = (SYSC_HAS_SIDLEMODE |
349 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
350 SYSC_HAS_AUTOIDLE),
351 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
352 .sysc_fields = &omap_hwmod_sysc_type1,
353};
354
355static struct omap_hwmod_class uart_class = {
356 .name = "uart",
357 .sysc = &uart_sysc,
358};
359
360/* UART1 */
361
362static struct omap_hwmod_irq_info uart1_mpu_irqs[] = {
363 { .irq = INT_24XX_UART1_IRQ, },
364};
365
366static struct omap_hwmod_dma_info uart1_sdma_reqs[] = {
367 { .name = "rx", .dma_req = OMAP24XX_DMA_UART1_RX, },
368 { .name = "tx", .dma_req = OMAP24XX_DMA_UART1_TX, },
369};
370
371static struct omap_hwmod_ocp_if *omap2420_uart1_slaves[] = {
372 &omap2_l4_core__uart1,
373};
374
375static struct omap_hwmod omap2420_uart1_hwmod = {
376 .name = "uart1",
377 .mpu_irqs = uart1_mpu_irqs,
378 .mpu_irqs_cnt = ARRAY_SIZE(uart1_mpu_irqs),
379 .sdma_reqs = uart1_sdma_reqs,
380 .sdma_reqs_cnt = ARRAY_SIZE(uart1_sdma_reqs),
381 .main_clk = "uart1_fck",
382 .prcm = {
383 .omap2 = {
384 .module_offs = CORE_MOD,
385 .prcm_reg_id = 1,
386 .module_bit = OMAP24XX_EN_UART1_SHIFT,
387 .idlest_reg_id = 1,
388 .idlest_idle_bit = OMAP24XX_EN_UART1_SHIFT,
389 },
390 },
391 .slaves = omap2420_uart1_slaves,
392 .slaves_cnt = ARRAY_SIZE(omap2420_uart1_slaves),
393 .class = &uart_class,
394 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
395};
396
397/* UART2 */
398
399static struct omap_hwmod_irq_info uart2_mpu_irqs[] = {
400 { .irq = INT_24XX_UART2_IRQ, },
401};
402
403static struct omap_hwmod_dma_info uart2_sdma_reqs[] = {
404 { .name = "rx", .dma_req = OMAP24XX_DMA_UART2_RX, },
405 { .name = "tx", .dma_req = OMAP24XX_DMA_UART2_TX, },
406};
407
408static struct omap_hwmod_ocp_if *omap2420_uart2_slaves[] = {
409 &omap2_l4_core__uart2,
410};
411
412static struct omap_hwmod omap2420_uart2_hwmod = {
413 .name = "uart2",
414 .mpu_irqs = uart2_mpu_irqs,
415 .mpu_irqs_cnt = ARRAY_SIZE(uart2_mpu_irqs),
416 .sdma_reqs = uart2_sdma_reqs,
417 .sdma_reqs_cnt = ARRAY_SIZE(uart2_sdma_reqs),
418 .main_clk = "uart2_fck",
419 .prcm = {
420 .omap2 = {
421 .module_offs = CORE_MOD,
422 .prcm_reg_id = 1,
423 .module_bit = OMAP24XX_EN_UART2_SHIFT,
424 .idlest_reg_id = 1,
425 .idlest_idle_bit = OMAP24XX_EN_UART2_SHIFT,
426 },
427 },
428 .slaves = omap2420_uart2_slaves,
429 .slaves_cnt = ARRAY_SIZE(omap2420_uart2_slaves),
430 .class = &uart_class,
431 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
432};
433
434/* UART3 */
435
436static struct omap_hwmod_irq_info uart3_mpu_irqs[] = {
437 { .irq = INT_24XX_UART3_IRQ, },
438};
439
440static struct omap_hwmod_dma_info uart3_sdma_reqs[] = {
441 { .name = "rx", .dma_req = OMAP24XX_DMA_UART3_RX, },
442 { .name = "tx", .dma_req = OMAP24XX_DMA_UART3_TX, },
443};
444
445static struct omap_hwmod_ocp_if *omap2420_uart3_slaves[] = {
446 &omap2_l4_core__uart3,
447};
448
449static struct omap_hwmod omap2420_uart3_hwmod = {
450 .name = "uart3",
451 .mpu_irqs = uart3_mpu_irqs,
452 .mpu_irqs_cnt = ARRAY_SIZE(uart3_mpu_irqs),
453 .sdma_reqs = uart3_sdma_reqs,
454 .sdma_reqs_cnt = ARRAY_SIZE(uart3_sdma_reqs),
455 .main_clk = "uart3_fck",
456 .prcm = {
457 .omap2 = {
458 .module_offs = CORE_MOD,
459 .prcm_reg_id = 2,
460 .module_bit = OMAP24XX_EN_UART3_SHIFT,
461 .idlest_reg_id = 2,
462 .idlest_idle_bit = OMAP24XX_EN_UART3_SHIFT,
463 },
464 },
465 .slaves = omap2420_uart3_slaves,
466 .slaves_cnt = ARRAY_SIZE(omap2420_uart3_slaves),
467 .class = &uart_class,
468 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
469};
470
Paul Walmsley20042902010-09-30 02:40:12 +0530471/* I2C common */
472static struct omap_hwmod_class_sysconfig i2c_sysc = {
473 .rev_offs = 0x00,
474 .sysc_offs = 0x20,
475 .syss_offs = 0x10,
476 .sysc_flags = SYSC_HAS_SOFTRESET,
477 .sysc_fields = &omap_hwmod_sysc_type1,
478};
479
480static struct omap_hwmod_class i2c_class = {
481 .name = "i2c",
482 .sysc = &i2c_sysc,
483};
484
485static struct omap_i2c_dev_attr i2c_dev_attr;
486
487/* I2C1 */
488
489static struct omap_hwmod_irq_info i2c1_mpu_irqs[] = {
490 { .irq = INT_24XX_I2C1_IRQ, },
491};
492
493static struct omap_hwmod_dma_info i2c1_sdma_reqs[] = {
494 { .name = "tx", .dma_req = OMAP24XX_DMA_I2C1_TX },
495 { .name = "rx", .dma_req = OMAP24XX_DMA_I2C1_RX },
496};
497
498static struct omap_hwmod_ocp_if *omap2420_i2c1_slaves[] = {
499 &omap2420_l4_core__i2c1,
500};
501
502static struct omap_hwmod omap2420_i2c1_hwmod = {
503 .name = "i2c1",
504 .mpu_irqs = i2c1_mpu_irqs,
505 .mpu_irqs_cnt = ARRAY_SIZE(i2c1_mpu_irqs),
506 .sdma_reqs = i2c1_sdma_reqs,
507 .sdma_reqs_cnt = ARRAY_SIZE(i2c1_sdma_reqs),
508 .main_clk = "i2c1_fck",
509 .prcm = {
510 .omap2 = {
511 .module_offs = CORE_MOD,
512 .prcm_reg_id = 1,
513 .module_bit = OMAP2420_EN_I2C1_SHIFT,
514 .idlest_reg_id = 1,
515 .idlest_idle_bit = OMAP2420_ST_I2C1_SHIFT,
516 },
517 },
518 .slaves = omap2420_i2c1_slaves,
519 .slaves_cnt = ARRAY_SIZE(omap2420_i2c1_slaves),
520 .class = &i2c_class,
521 .dev_attr = &i2c_dev_attr,
522 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
523 .flags = HWMOD_16BIT_REG,
524};
525
526/* I2C2 */
527
528static struct omap_hwmod_irq_info i2c2_mpu_irqs[] = {
529 { .irq = INT_24XX_I2C2_IRQ, },
530};
531
532static struct omap_hwmod_dma_info i2c2_sdma_reqs[] = {
533 { .name = "tx", .dma_req = OMAP24XX_DMA_I2C2_TX },
534 { .name = "rx", .dma_req = OMAP24XX_DMA_I2C2_RX },
535};
536
537static struct omap_hwmod_ocp_if *omap2420_i2c2_slaves[] = {
538 &omap2420_l4_core__i2c2,
539};
540
541static struct omap_hwmod omap2420_i2c2_hwmod = {
542 .name = "i2c2",
543 .mpu_irqs = i2c2_mpu_irqs,
544 .mpu_irqs_cnt = ARRAY_SIZE(i2c2_mpu_irqs),
545 .sdma_reqs = i2c2_sdma_reqs,
546 .sdma_reqs_cnt = ARRAY_SIZE(i2c2_sdma_reqs),
547 .main_clk = "i2c2_fck",
548 .prcm = {
549 .omap2 = {
550 .module_offs = CORE_MOD,
551 .prcm_reg_id = 1,
552 .module_bit = OMAP2420_EN_I2C2_SHIFT,
553 .idlest_reg_id = 1,
554 .idlest_idle_bit = OMAP2420_ST_I2C2_SHIFT,
555 },
556 },
557 .slaves = omap2420_i2c2_slaves,
558 .slaves_cnt = ARRAY_SIZE(omap2420_i2c2_slaves),
559 .class = &i2c_class,
560 .dev_attr = &i2c_dev_attr,
561 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
562 .flags = HWMOD_16BIT_REG,
563};
564
Varadarajan, Charulatha59c348c2010-12-07 16:26:56 -0800565/* l4_wkup -> gpio1 */
566static struct omap_hwmod_addr_space omap2420_gpio1_addr_space[] = {
567 {
568 .pa_start = 0x48018000,
569 .pa_end = 0x480181ff,
570 .flags = ADDR_TYPE_RT
571 },
572};
573
574static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio1 = {
575 .master = &omap2420_l4_wkup_hwmod,
576 .slave = &omap2420_gpio1_hwmod,
577 .clk = "gpios_ick",
578 .addr = omap2420_gpio1_addr_space,
579 .addr_cnt = ARRAY_SIZE(omap2420_gpio1_addr_space),
580 .user = OCP_USER_MPU | OCP_USER_SDMA,
581};
582
583/* l4_wkup -> gpio2 */
584static struct omap_hwmod_addr_space omap2420_gpio2_addr_space[] = {
585 {
586 .pa_start = 0x4801a000,
587 .pa_end = 0x4801a1ff,
588 .flags = ADDR_TYPE_RT
589 },
590};
591
592static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio2 = {
593 .master = &omap2420_l4_wkup_hwmod,
594 .slave = &omap2420_gpio2_hwmod,
595 .clk = "gpios_ick",
596 .addr = omap2420_gpio2_addr_space,
597 .addr_cnt = ARRAY_SIZE(omap2420_gpio2_addr_space),
598 .user = OCP_USER_MPU | OCP_USER_SDMA,
599};
600
601/* l4_wkup -> gpio3 */
602static struct omap_hwmod_addr_space omap2420_gpio3_addr_space[] = {
603 {
604 .pa_start = 0x4801c000,
605 .pa_end = 0x4801c1ff,
606 .flags = ADDR_TYPE_RT
607 },
608};
609
610static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio3 = {
611 .master = &omap2420_l4_wkup_hwmod,
612 .slave = &omap2420_gpio3_hwmod,
613 .clk = "gpios_ick",
614 .addr = omap2420_gpio3_addr_space,
615 .addr_cnt = ARRAY_SIZE(omap2420_gpio3_addr_space),
616 .user = OCP_USER_MPU | OCP_USER_SDMA,
617};
618
619/* l4_wkup -> gpio4 */
620static struct omap_hwmod_addr_space omap2420_gpio4_addr_space[] = {
621 {
622 .pa_start = 0x4801e000,
623 .pa_end = 0x4801e1ff,
624 .flags = ADDR_TYPE_RT
625 },
626};
627
628static struct omap_hwmod_ocp_if omap2420_l4_wkup__gpio4 = {
629 .master = &omap2420_l4_wkup_hwmod,
630 .slave = &omap2420_gpio4_hwmod,
631 .clk = "gpios_ick",
632 .addr = omap2420_gpio4_addr_space,
633 .addr_cnt = ARRAY_SIZE(omap2420_gpio4_addr_space),
634 .user = OCP_USER_MPU | OCP_USER_SDMA,
635};
636
637/* gpio dev_attr */
638static struct omap_gpio_dev_attr gpio_dev_attr = {
639 .bank_width = 32,
640 .dbck_flag = false,
641};
642
643static struct omap_hwmod_class_sysconfig omap242x_gpio_sysc = {
644 .rev_offs = 0x0000,
645 .sysc_offs = 0x0010,
646 .syss_offs = 0x0014,
647 .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
648 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
649 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
650 .sysc_fields = &omap_hwmod_sysc_type1,
651};
652
653/*
654 * 'gpio' class
655 * general purpose io module
656 */
657static struct omap_hwmod_class omap242x_gpio_hwmod_class = {
658 .name = "gpio",
659 .sysc = &omap242x_gpio_sysc,
660 .rev = 0,
661};
662
663/* gpio1 */
664static struct omap_hwmod_irq_info omap242x_gpio1_irqs[] = {
665 { .irq = 29 }, /* INT_24XX_GPIO_BANK1 */
666};
667
668static struct omap_hwmod_ocp_if *omap2420_gpio1_slaves[] = {
669 &omap2420_l4_wkup__gpio1,
670};
671
672static struct omap_hwmod omap2420_gpio1_hwmod = {
673 .name = "gpio1",
674 .mpu_irqs = omap242x_gpio1_irqs,
675 .mpu_irqs_cnt = ARRAY_SIZE(omap242x_gpio1_irqs),
676 .main_clk = "gpios_fck",
677 .prcm = {
678 .omap2 = {
679 .prcm_reg_id = 1,
680 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
681 .module_offs = WKUP_MOD,
682 .idlest_reg_id = 1,
683 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
684 },
685 },
686 .slaves = omap2420_gpio1_slaves,
687 .slaves_cnt = ARRAY_SIZE(omap2420_gpio1_slaves),
688 .class = &omap242x_gpio_hwmod_class,
689 .dev_attr = &gpio_dev_attr,
690 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
691};
692
693/* gpio2 */
694static struct omap_hwmod_irq_info omap242x_gpio2_irqs[] = {
695 { .irq = 30 }, /* INT_24XX_GPIO_BANK2 */
696};
697
698static struct omap_hwmod_ocp_if *omap2420_gpio2_slaves[] = {
699 &omap2420_l4_wkup__gpio2,
700};
701
702static struct omap_hwmod omap2420_gpio2_hwmod = {
703 .name = "gpio2",
704 .mpu_irqs = omap242x_gpio2_irqs,
705 .mpu_irqs_cnt = ARRAY_SIZE(omap242x_gpio2_irqs),
706 .main_clk = "gpios_fck",
707 .prcm = {
708 .omap2 = {
709 .prcm_reg_id = 1,
710 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
711 .module_offs = WKUP_MOD,
712 .idlest_reg_id = 1,
713 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
714 },
715 },
716 .slaves = omap2420_gpio2_slaves,
717 .slaves_cnt = ARRAY_SIZE(omap2420_gpio2_slaves),
718 .class = &omap242x_gpio_hwmod_class,
719 .dev_attr = &gpio_dev_attr,
720 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
721};
722
723/* gpio3 */
724static struct omap_hwmod_irq_info omap242x_gpio3_irqs[] = {
725 { .irq = 31 }, /* INT_24XX_GPIO_BANK3 */
726};
727
728static struct omap_hwmod_ocp_if *omap2420_gpio3_slaves[] = {
729 &omap2420_l4_wkup__gpio3,
730};
731
732static struct omap_hwmod omap2420_gpio3_hwmod = {
733 .name = "gpio3",
734 .mpu_irqs = omap242x_gpio3_irqs,
735 .mpu_irqs_cnt = ARRAY_SIZE(omap242x_gpio3_irqs),
736 .main_clk = "gpios_fck",
737 .prcm = {
738 .omap2 = {
739 .prcm_reg_id = 1,
740 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
741 .module_offs = WKUP_MOD,
742 .idlest_reg_id = 1,
743 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
744 },
745 },
746 .slaves = omap2420_gpio3_slaves,
747 .slaves_cnt = ARRAY_SIZE(omap2420_gpio3_slaves),
748 .class = &omap242x_gpio_hwmod_class,
749 .dev_attr = &gpio_dev_attr,
750 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
751};
752
753/* gpio4 */
754static struct omap_hwmod_irq_info omap242x_gpio4_irqs[] = {
755 { .irq = 32 }, /* INT_24XX_GPIO_BANK4 */
756};
757
758static struct omap_hwmod_ocp_if *omap2420_gpio4_slaves[] = {
759 &omap2420_l4_wkup__gpio4,
760};
761
762static struct omap_hwmod omap2420_gpio4_hwmod = {
763 .name = "gpio4",
764 .mpu_irqs = omap242x_gpio4_irqs,
765 .mpu_irqs_cnt = ARRAY_SIZE(omap242x_gpio4_irqs),
766 .main_clk = "gpios_fck",
767 .prcm = {
768 .omap2 = {
769 .prcm_reg_id = 1,
770 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
771 .module_offs = WKUP_MOD,
772 .idlest_reg_id = 1,
773 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
774 },
775 },
776 .slaves = omap2420_gpio4_slaves,
777 .slaves_cnt = ARRAY_SIZE(omap2420_gpio4_slaves),
778 .class = &omap242x_gpio_hwmod_class,
779 .dev_attr = &gpio_dev_attr,
780 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
781};
782
G, Manjunath Kondaiah745685df92010-12-20 18:27:18 -0800783/* system dma */
784static struct omap_hwmod_class_sysconfig omap2420_dma_sysc = {
785 .rev_offs = 0x0000,
786 .sysc_offs = 0x002c,
787 .syss_offs = 0x0028,
788 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_MIDLEMODE |
789 SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_EMUFREE |
790 SYSC_HAS_AUTOIDLE),
791 .idlemodes = (MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
792 .sysc_fields = &omap_hwmod_sysc_type1,
793};
794
795static struct omap_hwmod_class omap2420_dma_hwmod_class = {
796 .name = "dma",
797 .sysc = &omap2420_dma_sysc,
798};
799
800/* dma attributes */
801static struct omap_dma_dev_attr dma_dev_attr = {
802 .dev_caps = RESERVE_CHANNEL | DMA_LINKED_LCH | GLOBAL_PRIORITY |
803 IS_CSSA_32 | IS_CDSA_32,
804 .lch_count = 32,
805};
806
807static struct omap_hwmod_irq_info omap2420_dma_system_irqs[] = {
808 { .name = "0", .irq = 12 }, /* INT_24XX_SDMA_IRQ0 */
809 { .name = "1", .irq = 13 }, /* INT_24XX_SDMA_IRQ1 */
810 { .name = "2", .irq = 14 }, /* INT_24XX_SDMA_IRQ2 */
811 { .name = "3", .irq = 15 }, /* INT_24XX_SDMA_IRQ3 */
812};
813
814static struct omap_hwmod_addr_space omap2420_dma_system_addrs[] = {
815 {
816 .pa_start = 0x48056000,
817 .pa_end = 0x4a0560ff,
818 .flags = ADDR_TYPE_RT
819 },
820};
821
822/* dma_system -> L3 */
823static struct omap_hwmod_ocp_if omap2420_dma_system__l3 = {
824 .master = &omap2420_dma_system_hwmod,
825 .slave = &omap2420_l3_main_hwmod,
826 .clk = "core_l3_ck",
827 .user = OCP_USER_MPU | OCP_USER_SDMA,
828};
829
830/* dma_system master ports */
831static struct omap_hwmod_ocp_if *omap2420_dma_system_masters[] = {
832 &omap2420_dma_system__l3,
833};
834
835/* l4_core -> dma_system */
836static struct omap_hwmod_ocp_if omap2420_l4_core__dma_system = {
837 .master = &omap2420_l4_core_hwmod,
838 .slave = &omap2420_dma_system_hwmod,
839 .clk = "sdma_ick",
840 .addr = omap2420_dma_system_addrs,
841 .addr_cnt = ARRAY_SIZE(omap2420_dma_system_addrs),
842 .user = OCP_USER_MPU | OCP_USER_SDMA,
843};
844
845/* dma_system slave ports */
846static struct omap_hwmod_ocp_if *omap2420_dma_system_slaves[] = {
847 &omap2420_l4_core__dma_system,
848};
849
850static struct omap_hwmod omap2420_dma_system_hwmod = {
851 .name = "dma",
852 .class = &omap2420_dma_hwmod_class,
853 .mpu_irqs = omap2420_dma_system_irqs,
854 .mpu_irqs_cnt = ARRAY_SIZE(omap2420_dma_system_irqs),
855 .main_clk = "core_l3_ck",
856 .slaves = omap2420_dma_system_slaves,
857 .slaves_cnt = ARRAY_SIZE(omap2420_dma_system_slaves),
858 .masters = omap2420_dma_system_masters,
859 .masters_cnt = ARRAY_SIZE(omap2420_dma_system_masters),
860 .dev_attr = &dma_dev_attr,
861 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
862 .flags = HWMOD_NO_IDLEST,
863};
864
Paul Walmsley02bfc032009-09-03 20:14:05 +0300865static __initdata struct omap_hwmod *omap2420_hwmods[] = {
Kevin Hilman4a7cf902010-07-26 16:34:32 -0600866 &omap2420_l3_main_hwmod,
Paul Walmsley02bfc032009-09-03 20:14:05 +0300867 &omap2420_l4_core_hwmod,
868 &omap2420_l4_wkup_hwmod,
869 &omap2420_mpu_hwmod,
Paul Walmsley08072ac2010-07-26 16:34:33 -0600870 &omap2420_iva_hwmod,
Varadarajan, Charulathaa714b9c2010-09-23 20:02:39 +0530871 &omap2420_wd_timer2_hwmod,
Kevin Hilman046465b2010-09-27 20:19:30 +0530872 &omap2420_uart1_hwmod,
873 &omap2420_uart2_hwmod,
874 &omap2420_uart3_hwmod,
Paul Walmsley20042902010-09-30 02:40:12 +0530875 &omap2420_i2c1_hwmod,
876 &omap2420_i2c2_hwmod,
Varadarajan, Charulatha59c348c2010-12-07 16:26:56 -0800877
878 /* gpio class */
879 &omap2420_gpio1_hwmod,
880 &omap2420_gpio2_hwmod,
881 &omap2420_gpio3_hwmod,
882 &omap2420_gpio4_hwmod,
G, Manjunath Kondaiah745685df92010-12-20 18:27:18 -0800883
884 /* dma_system class*/
885 &omap2420_dma_system_hwmod,
Paul Walmsley02bfc032009-09-03 20:14:05 +0300886 NULL,
887};
888
Paul Walmsley73591542010-02-22 22:09:32 -0700889int __init omap2420_hwmod_init(void)
890{
891 return omap_hwmod_init(omap2420_hwmods);
892}