blob: ba145f7d58967209baf013647c4d3e702648400a [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 Walmsley02bfc032009-09-03 20:14:05 +030019
Paul Walmsley43b40992010-02-22 22:09:34 -070020#include "omap_hwmod_common_data.h"
21
Paul Walmsley02bfc032009-09-03 20:14:05 +030022#include "prm-regbits-24xx.h"
23
Paul Walmsley73591542010-02-22 22:09:32 -070024/*
25 * OMAP2420 hardware module integration data
26 *
27 * ALl of the data in this section should be autogeneratable from the
28 * TI hardware database or other technical documentation. Data that
29 * is driver-specific or driver-kernel integration-specific belongs
30 * elsewhere.
31 */
32
Paul Walmsley02bfc032009-09-03 20:14:05 +030033static struct omap_hwmod omap2420_mpu_hwmod;
Paul Walmsley08072ac2010-07-26 16:34:33 -060034static struct omap_hwmod omap2420_iva_hwmod;
Kevin Hilman4a7cf902010-07-26 16:34:32 -060035static struct omap_hwmod omap2420_l3_main_hwmod;
Paul Walmsley02bfc032009-09-03 20:14:05 +030036static struct omap_hwmod omap2420_l4_core_hwmod;
37
38/* L3 -> L4_CORE interface */
Kevin Hilman4a7cf902010-07-26 16:34:32 -060039static struct omap_hwmod_ocp_if omap2420_l3_main__l4_core = {
40 .master = &omap2420_l3_main_hwmod,
Paul Walmsley02bfc032009-09-03 20:14:05 +030041 .slave = &omap2420_l4_core_hwmod,
42 .user = OCP_USER_MPU | OCP_USER_SDMA,
43};
44
45/* MPU -> L3 interface */
Kevin Hilman4a7cf902010-07-26 16:34:32 -060046static struct omap_hwmod_ocp_if omap2420_mpu__l3_main = {
Paul Walmsley02bfc032009-09-03 20:14:05 +030047 .master = &omap2420_mpu_hwmod,
Kevin Hilman4a7cf902010-07-26 16:34:32 -060048 .slave = &omap2420_l3_main_hwmod,
Paul Walmsley02bfc032009-09-03 20:14:05 +030049 .user = OCP_USER_MPU,
50};
51
52/* Slave interfaces on the L3 interconnect */
Kevin Hilman4a7cf902010-07-26 16:34:32 -060053static struct omap_hwmod_ocp_if *omap2420_l3_main_slaves[] = {
54 &omap2420_mpu__l3_main,
Paul Walmsley02bfc032009-09-03 20:14:05 +030055};
56
57/* Master interfaces on the L3 interconnect */
Kevin Hilman4a7cf902010-07-26 16:34:32 -060058static struct omap_hwmod_ocp_if *omap2420_l3_main_masters[] = {
59 &omap2420_l3_main__l4_core,
Paul Walmsley02bfc032009-09-03 20:14:05 +030060};
61
62/* L3 */
Kevin Hilman4a7cf902010-07-26 16:34:32 -060063static struct omap_hwmod omap2420_l3_main_hwmod = {
Benoit Coussonfa983472010-07-26 16:34:29 -060064 .name = "l3_main",
Paul Walmsley43b40992010-02-22 22:09:34 -070065 .class = &l3_hwmod_class,
Kevin Hilman4a7cf902010-07-26 16:34:32 -060066 .masters = omap2420_l3_main_masters,
67 .masters_cnt = ARRAY_SIZE(omap2420_l3_main_masters),
68 .slaves = omap2420_l3_main_slaves,
69 .slaves_cnt = ARRAY_SIZE(omap2420_l3_main_slaves),
Kevin Hilman2eb18752010-07-26 16:34:28 -060070 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
71 .flags = HWMOD_NO_IDLEST,
Paul Walmsley02bfc032009-09-03 20:14:05 +030072};
73
74static struct omap_hwmod omap2420_l4_wkup_hwmod;
Kevin Hilman046465b2010-09-27 20:19:30 +053075static struct omap_hwmod omap2420_uart1_hwmod;
76static struct omap_hwmod omap2420_uart2_hwmod;
77static struct omap_hwmod omap2420_uart3_hwmod;
Paul Walmsley02bfc032009-09-03 20:14:05 +030078
79/* L4_CORE -> L4_WKUP interface */
80static struct omap_hwmod_ocp_if omap2420_l4_core__l4_wkup = {
81 .master = &omap2420_l4_core_hwmod,
82 .slave = &omap2420_l4_wkup_hwmod,
83 .user = OCP_USER_MPU | OCP_USER_SDMA,
84};
85
Kevin Hilman046465b2010-09-27 20:19:30 +053086/* L4 CORE -> UART1 interface */
87static struct omap_hwmod_addr_space omap2420_uart1_addr_space[] = {
88 {
89 .pa_start = OMAP2_UART1_BASE,
90 .pa_end = OMAP2_UART1_BASE + SZ_8K - 1,
91 .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
92 },
93};
94
95static struct omap_hwmod_ocp_if omap2_l4_core__uart1 = {
96 .master = &omap2420_l4_core_hwmod,
97 .slave = &omap2420_uart1_hwmod,
98 .clk = "uart1_ick",
99 .addr = omap2420_uart1_addr_space,
100 .addr_cnt = ARRAY_SIZE(omap2420_uart1_addr_space),
101 .user = OCP_USER_MPU | OCP_USER_SDMA,
102};
103
104/* L4 CORE -> UART2 interface */
105static struct omap_hwmod_addr_space omap2420_uart2_addr_space[] = {
106 {
107 .pa_start = OMAP2_UART2_BASE,
108 .pa_end = OMAP2_UART2_BASE + SZ_1K - 1,
109 .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
110 },
111};
112
113static struct omap_hwmod_ocp_if omap2_l4_core__uart2 = {
114 .master = &omap2420_l4_core_hwmod,
115 .slave = &omap2420_uart2_hwmod,
116 .clk = "uart2_ick",
117 .addr = omap2420_uart2_addr_space,
118 .addr_cnt = ARRAY_SIZE(omap2420_uart2_addr_space),
119 .user = OCP_USER_MPU | OCP_USER_SDMA,
120};
121
122/* L4 PER -> UART3 interface */
123static struct omap_hwmod_addr_space omap2420_uart3_addr_space[] = {
124 {
125 .pa_start = OMAP2_UART3_BASE,
126 .pa_end = OMAP2_UART3_BASE + SZ_1K - 1,
127 .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT,
128 },
129};
130
131static struct omap_hwmod_ocp_if omap2_l4_core__uart3 = {
132 .master = &omap2420_l4_core_hwmod,
133 .slave = &omap2420_uart3_hwmod,
134 .clk = "uart3_ick",
135 .addr = omap2420_uart3_addr_space,
136 .addr_cnt = ARRAY_SIZE(omap2420_uart3_addr_space),
137 .user = OCP_USER_MPU | OCP_USER_SDMA,
138};
139
Paul Walmsley02bfc032009-09-03 20:14:05 +0300140/* Slave interfaces on the L4_CORE interconnect */
141static struct omap_hwmod_ocp_if *omap2420_l4_core_slaves[] = {
Kevin Hilman4a7cf902010-07-26 16:34:32 -0600142 &omap2420_l3_main__l4_core,
Paul Walmsley02bfc032009-09-03 20:14:05 +0300143};
144
145/* Master interfaces on the L4_CORE interconnect */
146static struct omap_hwmod_ocp_if *omap2420_l4_core_masters[] = {
147 &omap2420_l4_core__l4_wkup,
Kevin Hilman046465b2010-09-27 20:19:30 +0530148 &omap2_l4_core__uart1,
149 &omap2_l4_core__uart2,
150 &omap2_l4_core__uart3,
Paul Walmsley02bfc032009-09-03 20:14:05 +0300151};
152
153/* L4 CORE */
154static struct omap_hwmod omap2420_l4_core_hwmod = {
Benoit Coussonfa983472010-07-26 16:34:29 -0600155 .name = "l4_core",
Paul Walmsley43b40992010-02-22 22:09:34 -0700156 .class = &l4_hwmod_class,
Paul Walmsley02bfc032009-09-03 20:14:05 +0300157 .masters = omap2420_l4_core_masters,
158 .masters_cnt = ARRAY_SIZE(omap2420_l4_core_masters),
159 .slaves = omap2420_l4_core_slaves,
160 .slaves_cnt = ARRAY_SIZE(omap2420_l4_core_slaves),
Kevin Hilman2eb18752010-07-26 16:34:28 -0600161 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
162 .flags = HWMOD_NO_IDLEST,
Paul Walmsley02bfc032009-09-03 20:14:05 +0300163};
164
165/* Slave interfaces on the L4_WKUP interconnect */
166static struct omap_hwmod_ocp_if *omap2420_l4_wkup_slaves[] = {
167 &omap2420_l4_core__l4_wkup,
168};
169
170/* Master interfaces on the L4_WKUP interconnect */
171static struct omap_hwmod_ocp_if *omap2420_l4_wkup_masters[] = {
172};
173
174/* L4 WKUP */
175static struct omap_hwmod omap2420_l4_wkup_hwmod = {
Benoit Coussonfa983472010-07-26 16:34:29 -0600176 .name = "l4_wkup",
Paul Walmsley43b40992010-02-22 22:09:34 -0700177 .class = &l4_hwmod_class,
Paul Walmsley02bfc032009-09-03 20:14:05 +0300178 .masters = omap2420_l4_wkup_masters,
179 .masters_cnt = ARRAY_SIZE(omap2420_l4_wkup_masters),
180 .slaves = omap2420_l4_wkup_slaves,
181 .slaves_cnt = ARRAY_SIZE(omap2420_l4_wkup_slaves),
Kevin Hilman2eb18752010-07-26 16:34:28 -0600182 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
183 .flags = HWMOD_NO_IDLEST,
Paul Walmsley02bfc032009-09-03 20:14:05 +0300184};
185
186/* Master interfaces on the MPU device */
187static struct omap_hwmod_ocp_if *omap2420_mpu_masters[] = {
Kevin Hilman4a7cf902010-07-26 16:34:32 -0600188 &omap2420_mpu__l3_main,
Paul Walmsley02bfc032009-09-03 20:14:05 +0300189};
190
191/* MPU */
192static struct omap_hwmod omap2420_mpu_hwmod = {
Benoit Cousson5c2c0292010-05-20 12:31:10 -0600193 .name = "mpu",
Paul Walmsley43b40992010-02-22 22:09:34 -0700194 .class = &mpu_hwmod_class,
Paul Walmsley50ebdac2010-02-22 22:09:31 -0700195 .main_clk = "mpu_ck",
Paul Walmsley02bfc032009-09-03 20:14:05 +0300196 .masters = omap2420_mpu_masters,
197 .masters_cnt = ARRAY_SIZE(omap2420_mpu_masters),
198 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
199};
200
Paul Walmsley08072ac2010-07-26 16:34:33 -0600201/*
202 * IVA1 interface data
203 */
204
205/* IVA <- L3 interface */
206static struct omap_hwmod_ocp_if omap2420_l3__iva = {
207 .master = &omap2420_l3_main_hwmod,
208 .slave = &omap2420_iva_hwmod,
209 .clk = "iva1_ifck",
210 .user = OCP_USER_MPU | OCP_USER_SDMA,
211};
212
213static struct omap_hwmod_ocp_if *omap2420_iva_masters[] = {
214 &omap2420_l3__iva,
215};
216
217/*
218 * IVA2 (IVA2)
219 */
220
221static struct omap_hwmod omap2420_iva_hwmod = {
222 .name = "iva",
223 .class = &iva_hwmod_class,
224 .masters = omap2420_iva_masters,
225 .masters_cnt = ARRAY_SIZE(omap2420_iva_masters),
226 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
227};
228
Kevin Hilman046465b2010-09-27 20:19:30 +0530229/* UART */
230
231static struct omap_hwmod_class_sysconfig uart_sysc = {
232 .rev_offs = 0x50,
233 .sysc_offs = 0x54,
234 .syss_offs = 0x58,
235 .sysc_flags = (SYSC_HAS_SIDLEMODE |
236 SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
237 SYSC_HAS_AUTOIDLE),
238 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
239 .sysc_fields = &omap_hwmod_sysc_type1,
240};
241
242static struct omap_hwmod_class uart_class = {
243 .name = "uart",
244 .sysc = &uart_sysc,
245};
246
247/* UART1 */
248
249static struct omap_hwmod_irq_info uart1_mpu_irqs[] = {
250 { .irq = INT_24XX_UART1_IRQ, },
251};
252
253static struct omap_hwmod_dma_info uart1_sdma_reqs[] = {
254 { .name = "rx", .dma_req = OMAP24XX_DMA_UART1_RX, },
255 { .name = "tx", .dma_req = OMAP24XX_DMA_UART1_TX, },
256};
257
258static struct omap_hwmod_ocp_if *omap2420_uart1_slaves[] = {
259 &omap2_l4_core__uart1,
260};
261
262static struct omap_hwmod omap2420_uart1_hwmod = {
263 .name = "uart1",
264 .mpu_irqs = uart1_mpu_irqs,
265 .mpu_irqs_cnt = ARRAY_SIZE(uart1_mpu_irqs),
266 .sdma_reqs = uart1_sdma_reqs,
267 .sdma_reqs_cnt = ARRAY_SIZE(uart1_sdma_reqs),
268 .main_clk = "uart1_fck",
269 .prcm = {
270 .omap2 = {
271 .module_offs = CORE_MOD,
272 .prcm_reg_id = 1,
273 .module_bit = OMAP24XX_EN_UART1_SHIFT,
274 .idlest_reg_id = 1,
275 .idlest_idle_bit = OMAP24XX_EN_UART1_SHIFT,
276 },
277 },
278 .slaves = omap2420_uart1_slaves,
279 .slaves_cnt = ARRAY_SIZE(omap2420_uart1_slaves),
280 .class = &uart_class,
281 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
282};
283
284/* UART2 */
285
286static struct omap_hwmod_irq_info uart2_mpu_irqs[] = {
287 { .irq = INT_24XX_UART2_IRQ, },
288};
289
290static struct omap_hwmod_dma_info uart2_sdma_reqs[] = {
291 { .name = "rx", .dma_req = OMAP24XX_DMA_UART2_RX, },
292 { .name = "tx", .dma_req = OMAP24XX_DMA_UART2_TX, },
293};
294
295static struct omap_hwmod_ocp_if *omap2420_uart2_slaves[] = {
296 &omap2_l4_core__uart2,
297};
298
299static struct omap_hwmod omap2420_uart2_hwmod = {
300 .name = "uart2",
301 .mpu_irqs = uart2_mpu_irqs,
302 .mpu_irqs_cnt = ARRAY_SIZE(uart2_mpu_irqs),
303 .sdma_reqs = uart2_sdma_reqs,
304 .sdma_reqs_cnt = ARRAY_SIZE(uart2_sdma_reqs),
305 .main_clk = "uart2_fck",
306 .prcm = {
307 .omap2 = {
308 .module_offs = CORE_MOD,
309 .prcm_reg_id = 1,
310 .module_bit = OMAP24XX_EN_UART2_SHIFT,
311 .idlest_reg_id = 1,
312 .idlest_idle_bit = OMAP24XX_EN_UART2_SHIFT,
313 },
314 },
315 .slaves = omap2420_uart2_slaves,
316 .slaves_cnt = ARRAY_SIZE(omap2420_uart2_slaves),
317 .class = &uart_class,
318 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
319};
320
321/* UART3 */
322
323static struct omap_hwmod_irq_info uart3_mpu_irqs[] = {
324 { .irq = INT_24XX_UART3_IRQ, },
325};
326
327static struct omap_hwmod_dma_info uart3_sdma_reqs[] = {
328 { .name = "rx", .dma_req = OMAP24XX_DMA_UART3_RX, },
329 { .name = "tx", .dma_req = OMAP24XX_DMA_UART3_TX, },
330};
331
332static struct omap_hwmod_ocp_if *omap2420_uart3_slaves[] = {
333 &omap2_l4_core__uart3,
334};
335
336static struct omap_hwmod omap2420_uart3_hwmod = {
337 .name = "uart3",
338 .mpu_irqs = uart3_mpu_irqs,
339 .mpu_irqs_cnt = ARRAY_SIZE(uart3_mpu_irqs),
340 .sdma_reqs = uart3_sdma_reqs,
341 .sdma_reqs_cnt = ARRAY_SIZE(uart3_sdma_reqs),
342 .main_clk = "uart3_fck",
343 .prcm = {
344 .omap2 = {
345 .module_offs = CORE_MOD,
346 .prcm_reg_id = 2,
347 .module_bit = OMAP24XX_EN_UART3_SHIFT,
348 .idlest_reg_id = 2,
349 .idlest_idle_bit = OMAP24XX_EN_UART3_SHIFT,
350 },
351 },
352 .slaves = omap2420_uart3_slaves,
353 .slaves_cnt = ARRAY_SIZE(omap2420_uart3_slaves),
354 .class = &uart_class,
355 .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
356};
357
Paul Walmsley02bfc032009-09-03 20:14:05 +0300358static __initdata struct omap_hwmod *omap2420_hwmods[] = {
Kevin Hilman4a7cf902010-07-26 16:34:32 -0600359 &omap2420_l3_main_hwmod,
Paul Walmsley02bfc032009-09-03 20:14:05 +0300360 &omap2420_l4_core_hwmod,
361 &omap2420_l4_wkup_hwmod,
362 &omap2420_mpu_hwmod,
Paul Walmsley08072ac2010-07-26 16:34:33 -0600363 &omap2420_iva_hwmod,
Kevin Hilman046465b2010-09-27 20:19:30 +0530364 &omap2420_uart1_hwmod,
365 &omap2420_uart2_hwmod,
366 &omap2420_uart3_hwmod,
Paul Walmsley02bfc032009-09-03 20:14:05 +0300367 NULL,
368};
369
Paul Walmsley73591542010-02-22 22:09:32 -0700370int __init omap2420_hwmod_init(void)
371{
372 return omap_hwmod_init(omap2420_hwmods);
373}
Paul Walmsley02bfc032009-09-03 20:14:05 +0300374
375