blob: 3c2c724796a27e555ec72fb56d3efcd242fb3710 [file] [log] [blame]
Paul Walmsley02bfc032009-09-03 20:14:05 +03001/*
Paul Walmsley73591542010-02-22 22:09:32 -07002 * omap_hwmod_2430_data.c - hardware modules present on the OMAP2430 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, Charulathaaeac0e42010-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
Paul Walmsley02bfc032009-09-03 20:14:05 +030024#include "prm-regbits-24xx.h"
Varadarajan, Charulatha165e2162010-09-23 20:02:40 +053025#include "cm-regbits-24xx.h"
Paul Walmsleyff2516f2010-12-21 15:39:15 -070026#include "wd_timer.h"
Paul Walmsley02bfc032009-09-03 20:14:05 +030027
Paul Walmsley73591542010-02-22 22:09:32 -070028/*
29 * OMAP2430 hardware module integration data
30 *
31 * ALl of the data in this section should be autogeneratable from the
32 * TI hardware database or other technical documentation. Data that
33 * is driver-specific or driver-kernel integration-specific belongs
34 * elsewhere.
35 */
36
Paul Walmsley02bfc032009-09-03 20:14:05 +030037static struct omap_hwmod omap2430_mpu_hwmod;
Paul Walmsley08072ac2010-07-26 16:34:33 -060038static struct omap_hwmod omap2430_iva_hwmod;
Kevin Hilman4a7cf902010-07-26 16:34:32 -060039static struct omap_hwmod omap2430_l3_main_hwmod;
Paul Walmsley02bfc032009-09-03 20:14:05 +030040static struct omap_hwmod omap2430_l4_core_hwmod;
Varadarajan, Charulatha165e2162010-09-23 20:02:40 +053041static struct omap_hwmod omap2430_wd_timer2_hwmod;
Varadarajan, Charulathaaeac0e42010-12-07 16:26:56 -080042static struct omap_hwmod omap2430_gpio1_hwmod;
43static struct omap_hwmod omap2430_gpio2_hwmod;
44static struct omap_hwmod omap2430_gpio3_hwmod;
45static struct omap_hwmod omap2430_gpio4_hwmod;
46static struct omap_hwmod omap2430_gpio5_hwmod;
G, Manjunath Kondaiah82cbd1a2010-12-20 18:27:18 -080047static struct omap_hwmod omap2430_dma_system_hwmod;
Paul Walmsley02bfc032009-09-03 20:14:05 +030048
49/* L3 -> L4_CORE interface */
Kevin Hilman4a7cf902010-07-26 16:34:32 -060050static struct omap_hwmod_ocp_if omap2430_l3_main__l4_core = {
51 .master = &omap2430_l3_main_hwmod,
Paul Walmsley02bfc032009-09-03 20:14:05 +030052 .slave = &omap2430_l4_core_hwmod,
53 .user = OCP_USER_MPU | OCP_USER_SDMA,
54};
55
56/* MPU -> L3 interface */
Kevin Hilman4a7cf902010-07-26 16:34:32 -060057static struct omap_hwmod_ocp_if omap2430_mpu__l3_main = {
Paul Walmsley02bfc032009-09-03 20:14:05 +030058 .master = &omap2430_mpu_hwmod,
Kevin Hilman4a7cf902010-07-26 16:34:32 -060059 .slave = &omap2430_l3_main_hwmod,
Paul Walmsley02bfc032009-09-03 20:14:05 +030060 .user = OCP_USER_MPU,
61};
62
63/* Slave interfaces on the L3 interconnect */
Kevin Hilman4a7cf902010-07-26 16:34:32 -060064static struct omap_hwmod_ocp_if *omap2430_l3_main_slaves[] = {
65 &omap2430_mpu__l3_main,
Paul Walmsley02bfc032009-09-03 20:14:05 +030066};
67
68/* Master interfaces on the L3 interconnect */
Kevin Hilman4a7cf902010-07-26 16:34:32 -060069static struct omap_hwmod_ocp_if *omap2430_l3_main_masters[] = {
70 &omap2430_l3_main__l4_core,
Paul Walmsley02bfc032009-09-03 20:14:05 +030071};
72
73/* L3 */
Kevin Hilman4a7cf902010-07-26 16:34:32 -060074static struct omap_hwmod omap2430_l3_main_hwmod = {
Benoit Coussonfa983472010-07-26 16:34:29 -060075 .name = "l3_main",
Paul Walmsley43b40992010-02-22 22:09:34 -070076 .class = &l3_hwmod_class,
Kevin Hilman4a7cf902010-07-26 16:34:32 -060077 .masters = omap2430_l3_main_masters,
78 .masters_cnt = ARRAY_SIZE(omap2430_l3_main_masters),
79 .slaves = omap2430_l3_main_slaves,
80 .slaves_cnt = ARRAY_SIZE(omap2430_l3_main_slaves),
Kevin Hilman2eb18752010-07-26 16:34:28 -060081 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
82 .flags = HWMOD_NO_IDLEST,
Paul Walmsley02bfc032009-09-03 20:14:05 +030083};
84
85static struct omap_hwmod omap2430_l4_wkup_hwmod;
Kevin Hilman046465b2010-09-27 20:19:30 +053086static struct omap_hwmod omap2430_uart1_hwmod;
87static struct omap_hwmod omap2430_uart2_hwmod;
88static struct omap_hwmod omap2430_uart3_hwmod;
Paul Walmsley20042902010-09-30 02:40:12 +053089static struct omap_hwmod omap2430_i2c1_hwmod;
90static struct omap_hwmod omap2430_i2c2_hwmod;
91
92/* I2C IP block address space length (in bytes) */
93#define OMAP2_I2C_AS_LEN 128
94
95/* L4 CORE -> I2C1 interface */
96static struct omap_hwmod_addr_space omap2430_i2c1_addr_space[] = {
97 {
98 .pa_start = 0x48070000,
99 .pa_end = 0x48070000 + OMAP2_I2C_AS_LEN - 1,
100 .flags = ADDR_TYPE_RT,
101 },
102};
103
104static struct omap_hwmod_ocp_if omap2430_l4_core__i2c1 = {
105 .master = &omap2430_l4_core_hwmod,
106 .slave = &omap2430_i2c1_hwmod,
107 .clk = "i2c1_ick",
108 .addr = omap2430_i2c1_addr_space,
109 .addr_cnt = ARRAY_SIZE(omap2430_i2c1_addr_space),
110 .user = OCP_USER_MPU | OCP_USER_SDMA,
111};
112
113/* L4 CORE -> I2C2 interface */
114static struct omap_hwmod_addr_space omap2430_i2c2_addr_space[] = {
115 {
116 .pa_start = 0x48072000,
117 .pa_end = 0x48072000 + OMAP2_I2C_AS_LEN - 1,
118 .flags = ADDR_TYPE_RT,
119 },
120};
121
122static struct omap_hwmod_ocp_if omap2430_l4_core__i2c2 = {
123 .master = &omap2430_l4_core_hwmod,
124 .slave = &omap2430_i2c2_hwmod,
125 .clk = "i2c2_ick",
126 .addr = omap2430_i2c2_addr_space,
127 .addr_cnt = ARRAY_SIZE(omap2430_i2c2_addr_space),
128 .user = OCP_USER_MPU | OCP_USER_SDMA,
129};
Paul Walmsley02bfc032009-09-03 20:14:05 +0300130
131/* L4_CORE -> L4_WKUP interface */
132static struct omap_hwmod_ocp_if omap2430_l4_core__l4_wkup = {
133 .master = &omap2430_l4_core_hwmod,
134 .slave = &omap2430_l4_wkup_hwmod,
135 .user = OCP_USER_MPU | OCP_USER_SDMA,
136};
137
Kevin Hilman046465b2010-09-27 20:19:30 +0530138/* L4 CORE -> UART1 interface */
139static struct omap_hwmod_addr_space omap2430_uart1_addr_space[] = {
140 {
141 .pa_start = OMAP2_UART1_BASE,
142 .pa_end = OMAP2_UART1_BASE + SZ_8K - 1,
143 .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
144 },
145};
146
147static struct omap_hwmod_ocp_if omap2_l4_core__uart1 = {
148 .master = &omap2430_l4_core_hwmod,
149 .slave = &omap2430_uart1_hwmod,
150 .clk = "uart1_ick",
151 .addr = omap2430_uart1_addr_space,
152 .addr_cnt = ARRAY_SIZE(omap2430_uart1_addr_space),
153 .user = OCP_USER_MPU | OCP_USER_SDMA,
154};
155
156/* L4 CORE -> UART2 interface */
157static struct omap_hwmod_addr_space omap2430_uart2_addr_space[] = {
158 {
159 .pa_start = OMAP2_UART2_BASE,
160 .pa_end = OMAP2_UART2_BASE + SZ_1K - 1,
161 .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
162 },
163};
164
165static struct omap_hwmod_ocp_if omap2_l4_core__uart2 = {
166 .master = &omap2430_l4_core_hwmod,
167 .slave = &omap2430_uart2_hwmod,
168 .clk = "uart2_ick",
169 .addr = omap2430_uart2_addr_space,
170 .addr_cnt = ARRAY_SIZE(omap2430_uart2_addr_space),
171 .user = OCP_USER_MPU | OCP_USER_SDMA,
172};
173
174/* L4 PER -> UART3 interface */
175static struct omap_hwmod_addr_space omap2430_uart3_addr_space[] = {
176 {
177 .pa_start = OMAP2_UART3_BASE,
178 .pa_end = OMAP2_UART3_BASE + SZ_1K - 1,
179 .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
180 },
181};
182
183static struct omap_hwmod_ocp_if omap2_l4_core__uart3 = {
184 .master = &omap2430_l4_core_hwmod,
185 .slave = &omap2430_uart3_hwmod,
186 .clk = "uart3_ick",
187 .addr = omap2430_uart3_addr_space,
188 .addr_cnt = ARRAY_SIZE(omap2430_uart3_addr_space),
189 .user = OCP_USER_MPU | OCP_USER_SDMA,
190};
191
Paul Walmsley02bfc032009-09-03 20:14:05 +0300192/* Slave interfaces on the L4_CORE interconnect */
193static struct omap_hwmod_ocp_if *omap2430_l4_core_slaves[] = {
Kevin Hilman4a7cf902010-07-26 16:34:32 -0600194 &omap2430_l3_main__l4_core,
Paul Walmsley02bfc032009-09-03 20:14:05 +0300195};
196
197/* Master interfaces on the L4_CORE interconnect */
198static struct omap_hwmod_ocp_if *omap2430_l4_core_masters[] = {
199 &omap2430_l4_core__l4_wkup,
200};
201
202/* L4 CORE */
203static struct omap_hwmod omap2430_l4_core_hwmod = {
Benoit Coussonfa983472010-07-26 16:34:29 -0600204 .name = "l4_core",
Paul Walmsley43b40992010-02-22 22:09:34 -0700205 .class = &l4_hwmod_class,
Paul Walmsley02bfc032009-09-03 20:14:05 +0300206 .masters = omap2430_l4_core_masters,
207 .masters_cnt = ARRAY_SIZE(omap2430_l4_core_masters),
208 .slaves = omap2430_l4_core_slaves,
209 .slaves_cnt = ARRAY_SIZE(omap2430_l4_core_slaves),
Kevin Hilman2eb18752010-07-26 16:34:28 -0600210 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
211 .flags = HWMOD_NO_IDLEST,
Paul Walmsley02bfc032009-09-03 20:14:05 +0300212};
213
214/* Slave interfaces on the L4_WKUP interconnect */
215static struct omap_hwmod_ocp_if *omap2430_l4_wkup_slaves[] = {
216 &omap2430_l4_core__l4_wkup,
Kevin Hilman046465b2010-09-27 20:19:30 +0530217 &omap2_l4_core__uart1,
218 &omap2_l4_core__uart2,
219 &omap2_l4_core__uart3,
Paul Walmsley02bfc032009-09-03 20:14:05 +0300220};
221
222/* Master interfaces on the L4_WKUP interconnect */
223static struct omap_hwmod_ocp_if *omap2430_l4_wkup_masters[] = {
224};
225
226/* L4 WKUP */
227static struct omap_hwmod omap2430_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 = omap2430_l4_wkup_masters,
231 .masters_cnt = ARRAY_SIZE(omap2430_l4_wkup_masters),
232 .slaves = omap2430_l4_wkup_slaves,
233 .slaves_cnt = ARRAY_SIZE(omap2430_l4_wkup_slaves),
Kevin Hilman2eb18752010-07-26 16:34:28 -0600234 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
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 *omap2430_mpu_masters[] = {
Kevin Hilman4a7cf902010-07-26 16:34:32 -0600240 &omap2430_mpu__l3_main,
Paul Walmsley02bfc032009-09-03 20:14:05 +0300241};
242
243/* MPU */
244static struct omap_hwmod omap2430_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 = omap2430_mpu_masters,
249 .masters_cnt = ARRAY_SIZE(omap2430_mpu_masters),
250 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
251};
252
Paul Walmsley08072ac2010-07-26 16:34:33 -0600253/*
254 * IVA2_1 interface data
255 */
256
257/* IVA2 <- L3 interface */
258static struct omap_hwmod_ocp_if omap2430_l3__iva = {
259 .master = &omap2430_l3_main_hwmod,
260 .slave = &omap2430_iva_hwmod,
261 .clk = "dsp_fck",
262 .user = OCP_USER_MPU | OCP_USER_SDMA,
263};
264
265static struct omap_hwmod_ocp_if *omap2430_iva_masters[] = {
266 &omap2430_l3__iva,
267};
268
269/*
270 * IVA2 (IVA2)
271 */
272
273static struct omap_hwmod omap2430_iva_hwmod = {
274 .name = "iva",
275 .class = &iva_hwmod_class,
276 .masters = omap2430_iva_masters,
277 .masters_cnt = ARRAY_SIZE(omap2430_iva_masters),
278 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
279};
280
Varadarajan, Charulatha165e2162010-09-23 20:02:40 +0530281/* l4_wkup -> wd_timer2 */
282static struct omap_hwmod_addr_space omap2430_wd_timer2_addrs[] = {
283 {
284 .pa_start = 0x49016000,
285 .pa_end = 0x4901607f,
286 .flags = ADDR_TYPE_RT
287 },
288};
289
290static struct omap_hwmod_ocp_if omap2430_l4_wkup__wd_timer2 = {
291 .master = &omap2430_l4_wkup_hwmod,
292 .slave = &omap2430_wd_timer2_hwmod,
293 .clk = "mpu_wdt_ick",
294 .addr = omap2430_wd_timer2_addrs,
295 .addr_cnt = ARRAY_SIZE(omap2430_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 omap2430_wd_timer_sysc = {
306 .rev_offs = 0x0,
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 omap2430_wd_timer_hwmod_class = {
Paul Walmsleyff2516f2010-12-21 15:39:15 -0700315 .name = "wd_timer",
316 .sysc = &omap2430_wd_timer_sysc,
317 .pre_shutdown = &omap2_wd_timer_disable
Varadarajan, Charulatha165e2162010-09-23 20:02:40 +0530318};
319
320/* wd_timer2 */
321static struct omap_hwmod_ocp_if *omap2430_wd_timer2_slaves[] = {
322 &omap2430_l4_wkup__wd_timer2,
323};
324
325static struct omap_hwmod omap2430_wd_timer2_hwmod = {
326 .name = "wd_timer2",
327 .class = &omap2430_wd_timer_hwmod_class,
328 .main_clk = "mpu_wdt_fck",
329 .prcm = {
330 .omap2 = {
331 .prcm_reg_id = 1,
332 .module_bit = OMAP24XX_EN_MPU_WDT_SHIFT,
333 .module_offs = WKUP_MOD,
334 .idlest_reg_id = 1,
335 .idlest_idle_bit = OMAP24XX_ST_MPU_WDT_SHIFT,
336 },
337 },
338 .slaves = omap2430_wd_timer2_slaves,
339 .slaves_cnt = ARRAY_SIZE(omap2430_wd_timer2_slaves),
340 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
341};
342
Kevin Hilman046465b2010-09-27 20:19:30 +0530343/* UART */
344
345static struct omap_hwmod_class_sysconfig uart_sysc = {
346 .rev_offs = 0x50,
347 .sysc_offs = 0x54,
348 .syss_offs = 0x58,
349 .sysc_flags = (SYSC_HAS_SIDLEMODE |
350 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
351 SYSC_HAS_AUTOIDLE),
352 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
353 .sysc_fields = &omap_hwmod_sysc_type1,
354};
355
356static struct omap_hwmod_class uart_class = {
357 .name = "uart",
358 .sysc = &uart_sysc,
359};
360
361/* UART1 */
362
363static struct omap_hwmod_irq_info uart1_mpu_irqs[] = {
364 { .irq = INT_24XX_UART1_IRQ, },
365};
366
367static struct omap_hwmod_dma_info uart1_sdma_reqs[] = {
368 { .name = "rx", .dma_req = OMAP24XX_DMA_UART1_RX, },
369 { .name = "tx", .dma_req = OMAP24XX_DMA_UART1_TX, },
370};
371
372static struct omap_hwmod_ocp_if *omap2430_uart1_slaves[] = {
373 &omap2_l4_core__uart1,
374};
375
376static struct omap_hwmod omap2430_uart1_hwmod = {
377 .name = "uart1",
378 .mpu_irqs = uart1_mpu_irqs,
379 .mpu_irqs_cnt = ARRAY_SIZE(uart1_mpu_irqs),
380 .sdma_reqs = uart1_sdma_reqs,
381 .sdma_reqs_cnt = ARRAY_SIZE(uart1_sdma_reqs),
382 .main_clk = "uart1_fck",
383 .prcm = {
384 .omap2 = {
385 .module_offs = CORE_MOD,
386 .prcm_reg_id = 1,
387 .module_bit = OMAP24XX_EN_UART1_SHIFT,
388 .idlest_reg_id = 1,
389 .idlest_idle_bit = OMAP24XX_EN_UART1_SHIFT,
390 },
391 },
392 .slaves = omap2430_uart1_slaves,
393 .slaves_cnt = ARRAY_SIZE(omap2430_uart1_slaves),
394 .class = &uart_class,
395 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
396};
397
398/* UART2 */
399
400static struct omap_hwmod_irq_info uart2_mpu_irqs[] = {
401 { .irq = INT_24XX_UART2_IRQ, },
402};
403
404static struct omap_hwmod_dma_info uart2_sdma_reqs[] = {
405 { .name = "rx", .dma_req = OMAP24XX_DMA_UART2_RX, },
406 { .name = "tx", .dma_req = OMAP24XX_DMA_UART2_TX, },
407};
408
409static struct omap_hwmod_ocp_if *omap2430_uart2_slaves[] = {
410 &omap2_l4_core__uart2,
411};
412
413static struct omap_hwmod omap2430_uart2_hwmod = {
414 .name = "uart2",
415 .mpu_irqs = uart2_mpu_irqs,
416 .mpu_irqs_cnt = ARRAY_SIZE(uart2_mpu_irqs),
417 .sdma_reqs = uart2_sdma_reqs,
418 .sdma_reqs_cnt = ARRAY_SIZE(uart2_sdma_reqs),
419 .main_clk = "uart2_fck",
420 .prcm = {
421 .omap2 = {
422 .module_offs = CORE_MOD,
423 .prcm_reg_id = 1,
424 .module_bit = OMAP24XX_EN_UART2_SHIFT,
425 .idlest_reg_id = 1,
426 .idlest_idle_bit = OMAP24XX_EN_UART2_SHIFT,
427 },
428 },
429 .slaves = omap2430_uart2_slaves,
430 .slaves_cnt = ARRAY_SIZE(omap2430_uart2_slaves),
431 .class = &uart_class,
432 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
433};
434
435/* UART3 */
436
437static struct omap_hwmod_irq_info uart3_mpu_irqs[] = {
438 { .irq = INT_24XX_UART3_IRQ, },
439};
440
441static struct omap_hwmod_dma_info uart3_sdma_reqs[] = {
442 { .name = "rx", .dma_req = OMAP24XX_DMA_UART3_RX, },
443 { .name = "tx", .dma_req = OMAP24XX_DMA_UART3_TX, },
444};
445
446static struct omap_hwmod_ocp_if *omap2430_uart3_slaves[] = {
447 &omap2_l4_core__uart3,
448};
449
450static struct omap_hwmod omap2430_uart3_hwmod = {
451 .name = "uart3",
452 .mpu_irqs = uart3_mpu_irqs,
453 .mpu_irqs_cnt = ARRAY_SIZE(uart3_mpu_irqs),
454 .sdma_reqs = uart3_sdma_reqs,
455 .sdma_reqs_cnt = ARRAY_SIZE(uart3_sdma_reqs),
456 .main_clk = "uart3_fck",
457 .prcm = {
458 .omap2 = {
459 .module_offs = CORE_MOD,
460 .prcm_reg_id = 2,
461 .module_bit = OMAP24XX_EN_UART3_SHIFT,
462 .idlest_reg_id = 2,
463 .idlest_idle_bit = OMAP24XX_EN_UART3_SHIFT,
464 },
465 },
466 .slaves = omap2430_uart3_slaves,
467 .slaves_cnt = ARRAY_SIZE(omap2430_uart3_slaves),
468 .class = &uart_class,
469 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
470};
471
Paul Walmsley20042902010-09-30 02:40:12 +0530472/* I2C common */
473static struct omap_hwmod_class_sysconfig i2c_sysc = {
474 .rev_offs = 0x00,
475 .sysc_offs = 0x20,
476 .syss_offs = 0x10,
477 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
478 .sysc_fields = &omap_hwmod_sysc_type1,
479};
480
481static struct omap_hwmod_class i2c_class = {
482 .name = "i2c",
483 .sysc = &i2c_sysc,
484};
485
Paul Walmsley20042902010-09-30 02:40:12 +0530486/* I2C1 */
487
488static struct omap_i2c_dev_attr i2c1_dev_attr = {
489 .fifo_depth = 8, /* bytes */
490};
491
492static struct omap_hwmod_irq_info i2c1_mpu_irqs[] = {
493 { .irq = INT_24XX_I2C1_IRQ, },
494};
495
496static struct omap_hwmod_dma_info i2c1_sdma_reqs[] = {
497 { .name = "tx", .dma_req = OMAP24XX_DMA_I2C1_TX },
498 { .name = "rx", .dma_req = OMAP24XX_DMA_I2C1_RX },
499};
500
501static struct omap_hwmod_ocp_if *omap2430_i2c1_slaves[] = {
502 &omap2430_l4_core__i2c1,
503};
504
505static struct omap_hwmod omap2430_i2c1_hwmod = {
506 .name = "i2c1",
507 .mpu_irqs = i2c1_mpu_irqs,
508 .mpu_irqs_cnt = ARRAY_SIZE(i2c1_mpu_irqs),
509 .sdma_reqs = i2c1_sdma_reqs,
510 .sdma_reqs_cnt = ARRAY_SIZE(i2c1_sdma_reqs),
511 .main_clk = "i2chs1_fck",
512 .prcm = {
513 .omap2 = {
514 /*
515 * NOTE: The CM_FCLKEN* and CM_ICLKEN* for
516 * I2CHS IP's do not follow the usual pattern.
517 * prcm_reg_id alone cannot be used to program
518 * the iclk and fclk. Needs to be handled using
519 * additonal flags when clk handling is moved
520 * to hwmod framework.
521 */
522 .module_offs = CORE_MOD,
523 .prcm_reg_id = 1,
524 .module_bit = OMAP2430_EN_I2CHS1_SHIFT,
525 .idlest_reg_id = 1,
526 .idlest_idle_bit = OMAP2430_ST_I2CHS1_SHIFT,
527 },
528 },
529 .slaves = omap2430_i2c1_slaves,
530 .slaves_cnt = ARRAY_SIZE(omap2430_i2c1_slaves),
531 .class = &i2c_class,
532 .dev_attr = &i2c1_dev_attr,
533 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
534};
535
536/* I2C2 */
537
538static struct omap_i2c_dev_attr i2c2_dev_attr = {
539 .fifo_depth = 8, /* bytes */
540};
541
542static struct omap_hwmod_irq_info i2c2_mpu_irqs[] = {
543 { .irq = INT_24XX_I2C2_IRQ, },
544};
545
546static struct omap_hwmod_dma_info i2c2_sdma_reqs[] = {
547 { .name = "tx", .dma_req = OMAP24XX_DMA_I2C2_TX },
548 { .name = "rx", .dma_req = OMAP24XX_DMA_I2C2_RX },
549};
550
551static struct omap_hwmod_ocp_if *omap2430_i2c2_slaves[] = {
552 &omap2430_l4_core__i2c2,
553};
554
555static struct omap_hwmod omap2430_i2c2_hwmod = {
556 .name = "i2c2",
557 .mpu_irqs = i2c2_mpu_irqs,
558 .mpu_irqs_cnt = ARRAY_SIZE(i2c2_mpu_irqs),
559 .sdma_reqs = i2c2_sdma_reqs,
560 .sdma_reqs_cnt = ARRAY_SIZE(i2c2_sdma_reqs),
561 .main_clk = "i2chs2_fck",
562 .prcm = {
563 .omap2 = {
564 .module_offs = CORE_MOD,
565 .prcm_reg_id = 1,
566 .module_bit = OMAP2430_EN_I2CHS2_SHIFT,
567 .idlest_reg_id = 1,
568 .idlest_idle_bit = OMAP2430_ST_I2CHS2_SHIFT,
569 },
570 },
571 .slaves = omap2430_i2c2_slaves,
572 .slaves_cnt = ARRAY_SIZE(omap2430_i2c2_slaves),
573 .class = &i2c_class,
574 .dev_attr = &i2c2_dev_attr,
575 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
576};
577
Varadarajan, Charulathaaeac0e42010-12-07 16:26:56 -0800578/* l4_wkup -> gpio1 */
579static struct omap_hwmod_addr_space omap2430_gpio1_addr_space[] = {
580 {
581 .pa_start = 0x4900C000,
582 .pa_end = 0x4900C1ff,
583 .flags = ADDR_TYPE_RT
584 },
585};
586
587static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio1 = {
588 .master = &omap2430_l4_wkup_hwmod,
589 .slave = &omap2430_gpio1_hwmod,
590 .clk = "gpios_ick",
591 .addr = omap2430_gpio1_addr_space,
592 .addr_cnt = ARRAY_SIZE(omap2430_gpio1_addr_space),
593 .user = OCP_USER_MPU | OCP_USER_SDMA,
594};
595
596/* l4_wkup -> gpio2 */
597static struct omap_hwmod_addr_space omap2430_gpio2_addr_space[] = {
598 {
599 .pa_start = 0x4900E000,
600 .pa_end = 0x4900E1ff,
601 .flags = ADDR_TYPE_RT
602 },
603};
604
605static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio2 = {
606 .master = &omap2430_l4_wkup_hwmod,
607 .slave = &omap2430_gpio2_hwmod,
608 .clk = "gpios_ick",
609 .addr = omap2430_gpio2_addr_space,
610 .addr_cnt = ARRAY_SIZE(omap2430_gpio2_addr_space),
611 .user = OCP_USER_MPU | OCP_USER_SDMA,
612};
613
614/* l4_wkup -> gpio3 */
615static struct omap_hwmod_addr_space omap2430_gpio3_addr_space[] = {
616 {
617 .pa_start = 0x49010000,
618 .pa_end = 0x490101ff,
619 .flags = ADDR_TYPE_RT
620 },
621};
622
623static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio3 = {
624 .master = &omap2430_l4_wkup_hwmod,
625 .slave = &omap2430_gpio3_hwmod,
626 .clk = "gpios_ick",
627 .addr = omap2430_gpio3_addr_space,
628 .addr_cnt = ARRAY_SIZE(omap2430_gpio3_addr_space),
629 .user = OCP_USER_MPU | OCP_USER_SDMA,
630};
631
632/* l4_wkup -> gpio4 */
633static struct omap_hwmod_addr_space omap2430_gpio4_addr_space[] = {
634 {
635 .pa_start = 0x49012000,
636 .pa_end = 0x490121ff,
637 .flags = ADDR_TYPE_RT
638 },
639};
640
641static struct omap_hwmod_ocp_if omap2430_l4_wkup__gpio4 = {
642 .master = &omap2430_l4_wkup_hwmod,
643 .slave = &omap2430_gpio4_hwmod,
644 .clk = "gpios_ick",
645 .addr = omap2430_gpio4_addr_space,
646 .addr_cnt = ARRAY_SIZE(omap2430_gpio4_addr_space),
647 .user = OCP_USER_MPU | OCP_USER_SDMA,
648};
649
650/* l4_core -> gpio5 */
651static struct omap_hwmod_addr_space omap2430_gpio5_addr_space[] = {
652 {
653 .pa_start = 0x480B6000,
654 .pa_end = 0x480B61ff,
655 .flags = ADDR_TYPE_RT
656 },
657};
658
659static struct omap_hwmod_ocp_if omap2430_l4_core__gpio5 = {
660 .master = &omap2430_l4_core_hwmod,
661 .slave = &omap2430_gpio5_hwmod,
662 .clk = "gpio5_ick",
663 .addr = omap2430_gpio5_addr_space,
664 .addr_cnt = ARRAY_SIZE(omap2430_gpio5_addr_space),
665 .user = OCP_USER_MPU | OCP_USER_SDMA,
666};
667
668/* gpio dev_attr */
669static struct omap_gpio_dev_attr gpio_dev_attr = {
670 .bank_width = 32,
671 .dbck_flag = false,
672};
673
674static struct omap_hwmod_class_sysconfig omap243x_gpio_sysc = {
675 .rev_offs = 0x0000,
676 .sysc_offs = 0x0010,
677 .syss_offs = 0x0014,
678 .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
679 SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE),
680 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
681 .sysc_fields = &omap_hwmod_sysc_type1,
682};
683
684/*
685 * 'gpio' class
686 * general purpose io module
687 */
688static struct omap_hwmod_class omap243x_gpio_hwmod_class = {
689 .name = "gpio",
690 .sysc = &omap243x_gpio_sysc,
691 .rev = 0,
692};
693
694/* gpio1 */
695static struct omap_hwmod_irq_info omap243x_gpio1_irqs[] = {
696 { .irq = 29 }, /* INT_24XX_GPIO_BANK1 */
697};
698
699static struct omap_hwmod_ocp_if *omap2430_gpio1_slaves[] = {
700 &omap2430_l4_wkup__gpio1,
701};
702
703static struct omap_hwmod omap2430_gpio1_hwmod = {
704 .name = "gpio1",
705 .mpu_irqs = omap243x_gpio1_irqs,
706 .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio1_irqs),
707 .main_clk = "gpios_fck",
708 .prcm = {
709 .omap2 = {
710 .prcm_reg_id = 1,
711 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
712 .module_offs = WKUP_MOD,
713 .idlest_reg_id = 1,
714 .idlest_idle_bit = OMAP24XX_EN_GPIOS_SHIFT,
715 },
716 },
717 .slaves = omap2430_gpio1_slaves,
718 .slaves_cnt = ARRAY_SIZE(omap2430_gpio1_slaves),
719 .class = &omap243x_gpio_hwmod_class,
720 .dev_attr = &gpio_dev_attr,
721 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
722};
723
724/* gpio2 */
725static struct omap_hwmod_irq_info omap243x_gpio2_irqs[] = {
726 { .irq = 30 }, /* INT_24XX_GPIO_BANK2 */
727};
728
729static struct omap_hwmod_ocp_if *omap2430_gpio2_slaves[] = {
730 &omap2430_l4_wkup__gpio2,
731};
732
733static struct omap_hwmod omap2430_gpio2_hwmod = {
734 .name = "gpio2",
735 .mpu_irqs = omap243x_gpio2_irqs,
736 .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio2_irqs),
737 .main_clk = "gpios_fck",
738 .prcm = {
739 .omap2 = {
740 .prcm_reg_id = 1,
741 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
742 .module_offs = WKUP_MOD,
743 .idlest_reg_id = 1,
744 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
745 },
746 },
747 .slaves = omap2430_gpio2_slaves,
748 .slaves_cnt = ARRAY_SIZE(omap2430_gpio2_slaves),
749 .class = &omap243x_gpio_hwmod_class,
750 .dev_attr = &gpio_dev_attr,
751 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
752};
753
754/* gpio3 */
755static struct omap_hwmod_irq_info omap243x_gpio3_irqs[] = {
756 { .irq = 31 }, /* INT_24XX_GPIO_BANK3 */
757};
758
759static struct omap_hwmod_ocp_if *omap2430_gpio3_slaves[] = {
760 &omap2430_l4_wkup__gpio3,
761};
762
763static struct omap_hwmod omap2430_gpio3_hwmod = {
764 .name = "gpio3",
765 .mpu_irqs = omap243x_gpio3_irqs,
766 .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio3_irqs),
767 .main_clk = "gpios_fck",
768 .prcm = {
769 .omap2 = {
770 .prcm_reg_id = 1,
771 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
772 .module_offs = WKUP_MOD,
773 .idlest_reg_id = 1,
774 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
775 },
776 },
777 .slaves = omap2430_gpio3_slaves,
778 .slaves_cnt = ARRAY_SIZE(omap2430_gpio3_slaves),
779 .class = &omap243x_gpio_hwmod_class,
780 .dev_attr = &gpio_dev_attr,
781 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
782};
783
784/* gpio4 */
785static struct omap_hwmod_irq_info omap243x_gpio4_irqs[] = {
786 { .irq = 32 }, /* INT_24XX_GPIO_BANK4 */
787};
788
789static struct omap_hwmod_ocp_if *omap2430_gpio4_slaves[] = {
790 &omap2430_l4_wkup__gpio4,
791};
792
793static struct omap_hwmod omap2430_gpio4_hwmod = {
794 .name = "gpio4",
795 .mpu_irqs = omap243x_gpio4_irqs,
796 .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio4_irqs),
797 .main_clk = "gpios_fck",
798 .prcm = {
799 .omap2 = {
800 .prcm_reg_id = 1,
801 .module_bit = OMAP24XX_EN_GPIOS_SHIFT,
802 .module_offs = WKUP_MOD,
803 .idlest_reg_id = 1,
804 .idlest_idle_bit = OMAP24XX_ST_GPIOS_SHIFT,
805 },
806 },
807 .slaves = omap2430_gpio4_slaves,
808 .slaves_cnt = ARRAY_SIZE(omap2430_gpio4_slaves),
809 .class = &omap243x_gpio_hwmod_class,
810 .dev_attr = &gpio_dev_attr,
811 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
812};
813
814/* gpio5 */
815static struct omap_hwmod_irq_info omap243x_gpio5_irqs[] = {
816 { .irq = 33 }, /* INT_24XX_GPIO_BANK5 */
817};
818
819static struct omap_hwmod_ocp_if *omap2430_gpio5_slaves[] = {
820 &omap2430_l4_core__gpio5,
821};
822
823static struct omap_hwmod omap2430_gpio5_hwmod = {
824 .name = "gpio5",
825 .mpu_irqs = omap243x_gpio5_irqs,
826 .mpu_irqs_cnt = ARRAY_SIZE(omap243x_gpio5_irqs),
827 .main_clk = "gpio5_fck",
828 .prcm = {
829 .omap2 = {
830 .prcm_reg_id = 2,
831 .module_bit = OMAP2430_EN_GPIO5_SHIFT,
832 .module_offs = CORE_MOD,
833 .idlest_reg_id = 2,
834 .idlest_idle_bit = OMAP2430_ST_GPIO5_SHIFT,
835 },
836 },
837 .slaves = omap2430_gpio5_slaves,
838 .slaves_cnt = ARRAY_SIZE(omap2430_gpio5_slaves),
839 .class = &omap243x_gpio_hwmod_class,
840 .dev_attr = &gpio_dev_attr,
841 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
842};
843
G, Manjunath Kondaiah82cbd1a2010-12-20 18:27:18 -0800844/* dma_system */
845static struct omap_hwmod_class_sysconfig omap2430_dma_sysc = {
846 .rev_offs = 0x0000,
847 .sysc_offs = 0x002c,
848 .syss_offs = 0x0028,
849 .sysc_flags = (SYSC_HAS_SOFTRESET | SYSC_HAS_MIDLEMODE |
850 SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_EMUFREE |
851 SYSC_HAS_AUTOIDLE),
852 .idlemodes = (MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
853 .sysc_fields = &omap_hwmod_sysc_type1,
854};
855
856static struct omap_hwmod_class omap2430_dma_hwmod_class = {
857 .name = "dma",
858 .sysc = &omap2430_dma_sysc,
859};
860
861/* dma attributes */
862static struct omap_dma_dev_attr dma_dev_attr = {
863 .dev_caps = RESERVE_CHANNEL | DMA_LINKED_LCH | GLOBAL_PRIORITY |
864 IS_CSSA_32 | IS_CDSA_32 | IS_RW_PRIORITY,
865 .lch_count = 32,
866};
867
868static struct omap_hwmod_irq_info omap2430_dma_system_irqs[] = {
869 { .name = "0", .irq = 12 }, /* INT_24XX_SDMA_IRQ0 */
870 { .name = "1", .irq = 13 }, /* INT_24XX_SDMA_IRQ1 */
871 { .name = "2", .irq = 14 }, /* INT_24XX_SDMA_IRQ2 */
872 { .name = "3", .irq = 15 }, /* INT_24XX_SDMA_IRQ3 */
873};
874
875static struct omap_hwmod_addr_space omap2430_dma_system_addrs[] = {
876 {
877 .pa_start = 0x48056000,
878 .pa_end = 0x4a0560ff,
879 .flags = ADDR_TYPE_RT
880 },
881};
882
883/* dma_system -> L3 */
884static struct omap_hwmod_ocp_if omap2430_dma_system__l3 = {
885 .master = &omap2430_dma_system_hwmod,
886 .slave = &omap2430_l3_main_hwmod,
887 .clk = "core_l3_ck",
888 .user = OCP_USER_MPU | OCP_USER_SDMA,
889};
890
891/* dma_system master ports */
892static struct omap_hwmod_ocp_if *omap2430_dma_system_masters[] = {
893 &omap2430_dma_system__l3,
894};
895
896/* l4_core -> dma_system */
897static struct omap_hwmod_ocp_if omap2430_l4_core__dma_system = {
898 .master = &omap2430_l4_core_hwmod,
899 .slave = &omap2430_dma_system_hwmod,
900 .clk = "sdma_ick",
901 .addr = omap2430_dma_system_addrs,
902 .addr_cnt = ARRAY_SIZE(omap2430_dma_system_addrs),
903 .user = OCP_USER_MPU | OCP_USER_SDMA,
904};
905
906/* dma_system slave ports */
907static struct omap_hwmod_ocp_if *omap2430_dma_system_slaves[] = {
908 &omap2430_l4_core__dma_system,
909};
910
911static struct omap_hwmod omap2430_dma_system_hwmod = {
912 .name = "dma",
913 .class = &omap2430_dma_hwmod_class,
914 .mpu_irqs = omap2430_dma_system_irqs,
915 .mpu_irqs_cnt = ARRAY_SIZE(omap2430_dma_system_irqs),
916 .main_clk = "core_l3_ck",
917 .slaves = omap2430_dma_system_slaves,
918 .slaves_cnt = ARRAY_SIZE(omap2430_dma_system_slaves),
919 .masters = omap2430_dma_system_masters,
920 .masters_cnt = ARRAY_SIZE(omap2430_dma_system_masters),
921 .dev_attr = &dma_dev_attr,
922 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
923 .flags = HWMOD_NO_IDLEST,
924};
925
Paul Walmsley02bfc032009-09-03 20:14:05 +0300926static __initdata struct omap_hwmod *omap2430_hwmods[] = {
Kevin Hilman4a7cf902010-07-26 16:34:32 -0600927 &omap2430_l3_main_hwmod,
Paul Walmsley02bfc032009-09-03 20:14:05 +0300928 &omap2430_l4_core_hwmod,
929 &omap2430_l4_wkup_hwmod,
930 &omap2430_mpu_hwmod,
Paul Walmsley08072ac2010-07-26 16:34:33 -0600931 &omap2430_iva_hwmod,
Varadarajan, Charulatha165e2162010-09-23 20:02:40 +0530932 &omap2430_wd_timer2_hwmod,
Kevin Hilman046465b2010-09-27 20:19:30 +0530933 &omap2430_uart1_hwmod,
934 &omap2430_uart2_hwmod,
935 &omap2430_uart3_hwmod,
Paul Walmsley20042902010-09-30 02:40:12 +0530936 &omap2430_i2c1_hwmod,
937 &omap2430_i2c2_hwmod,
Varadarajan, Charulathaaeac0e42010-12-07 16:26:56 -0800938
939 /* gpio class */
940 &omap2430_gpio1_hwmod,
941 &omap2430_gpio2_hwmod,
942 &omap2430_gpio3_hwmod,
943 &omap2430_gpio4_hwmod,
944 &omap2430_gpio5_hwmod,
G, Manjunath Kondaiah82cbd1a2010-12-20 18:27:18 -0800945
946 /* dma_system class*/
947 &omap2430_dma_system_hwmod,
Paul Walmsley02bfc032009-09-03 20:14:05 +0300948 NULL,
949};
950
Paul Walmsley73591542010-02-22 22:09:32 -0700951int __init omap2430_hwmod_init(void)
952{
953 return omap_hwmod_init(omap2430_hwmods);
954}