blob: eaf37994403b4d1ae01efbe4ef883b5396d2e1d2 [file] [log] [blame]
Tony Lindgren1dbae812005-11-10 14:26:51 +00001/*
2 * linux/arch/arm/mach-omap2/devices.c
3 *
4 * OMAP2 platform device setup/initialization
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11
Tony Lindgren1dbae812005-11-10 14:26:51 +000012#include <linux/kernel.h>
13#include <linux/init.h>
14#include <linux/platform_device.h>
Russell Kingfced80c2008-09-06 12:10:45 +010015#include <linux/io.h>
Kevin Hilman917fa282008-12-10 17:37:17 -080016#include <linux/clk.h>
Varadarajan, Charulathaf2ce6232010-09-23 20:02:42 +053017#include <linux/err.h>
Tony Lindgren1dbae812005-11-10 14:26:51 +000018
Russell Kinga09e64f2008-08-05 16:14:15 +010019#include <mach/hardware.h>
Will Deacon88341332010-04-09 13:54:43 +010020#include <mach/irqs.h>
Tony Lindgren1dbae812005-11-10 14:26:51 +000021#include <asm/mach-types.h>
22#include <asm/mach/map.h>
Will Deacon88341332010-04-09 13:54:43 +010023#include <asm/pmu.h>
Tony Lindgren1dbae812005-11-10 14:26:51 +000024
Tony Lindgrence491cf2009-10-20 09:40:47 -070025#include <plat/tc.h>
26#include <plat/board.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010027#include <mach/gpio.h>
Tony Lindgrence491cf2009-10-20 09:40:47 -070028#include <plat/mmc.h>
Dmitry Kasatkinee5500c2010-05-03 11:10:03 +080029#include <plat/dma.h>
Varadarajan, Charulathaf2ce6232010-09-23 20:02:42 +053030#include <plat/omap_hwmod.h>
31#include <plat/omap_device.h>
Tony Lindgren1dbae812005-11-10 14:26:51 +000032
Tony Lindgren4896e392009-12-11 16:16:32 -080033#include "mux.h"
Paul Walmsley4814ced2010-10-08 11:40:20 -060034#include "control.h"
Tony Lindgren4896e392009-12-11 16:16:32 -080035
Tony Lindgren828c7072009-03-23 18:23:49 -070036#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
Tony Lindgrenc40fae92006-12-07 13:58:10 -080037
Tony Lindgren828c7072009-03-23 18:23:49 -070038static struct resource cam_resources[] = {
Tony Lindgrenc40fae92006-12-07 13:58:10 -080039 {
Tony Lindgren828c7072009-03-23 18:23:49 -070040 .start = OMAP24XX_CAMERA_BASE,
41 .end = OMAP24XX_CAMERA_BASE + 0xfff,
42 .flags = IORESOURCE_MEM,
43 },
44 {
45 .start = INT_24XX_CAM_IRQ,
46 .flags = IORESOURCE_IRQ,
47 }
48};
49
50static struct platform_device omap_cam_device = {
51 .name = "omap24xxcam",
52 .id = -1,
53 .num_resources = ARRAY_SIZE(cam_resources),
54 .resource = cam_resources,
55};
56
57static inline void omap_init_camera(void)
58{
59 platform_device_register(&omap_cam_device);
60}
61
62#elif defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE)
63
64static struct resource omap3isp_resources[] = {
65 {
66 .start = OMAP3430_ISP_BASE,
67 .end = OMAP3430_ISP_END,
68 .flags = IORESOURCE_MEM,
69 },
70 {
71 .start = OMAP3430_ISP_CBUFF_BASE,
72 .end = OMAP3430_ISP_CBUFF_END,
73 .flags = IORESOURCE_MEM,
74 },
75 {
76 .start = OMAP3430_ISP_CCP2_BASE,
77 .end = OMAP3430_ISP_CCP2_END,
78 .flags = IORESOURCE_MEM,
79 },
80 {
81 .start = OMAP3430_ISP_CCDC_BASE,
82 .end = OMAP3430_ISP_CCDC_END,
83 .flags = IORESOURCE_MEM,
84 },
85 {
86 .start = OMAP3430_ISP_HIST_BASE,
87 .end = OMAP3430_ISP_HIST_END,
88 .flags = IORESOURCE_MEM,
89 },
90 {
91 .start = OMAP3430_ISP_H3A_BASE,
92 .end = OMAP3430_ISP_H3A_END,
93 .flags = IORESOURCE_MEM,
94 },
95 {
96 .start = OMAP3430_ISP_PREV_BASE,
97 .end = OMAP3430_ISP_PREV_END,
98 .flags = IORESOURCE_MEM,
99 },
100 {
101 .start = OMAP3430_ISP_RESZ_BASE,
102 .end = OMAP3430_ISP_RESZ_END,
103 .flags = IORESOURCE_MEM,
104 },
105 {
106 .start = OMAP3430_ISP_SBL_BASE,
107 .end = OMAP3430_ISP_SBL_END,
108 .flags = IORESOURCE_MEM,
109 },
110 {
111 .start = OMAP3430_ISP_CSI2A_BASE,
112 .end = OMAP3430_ISP_CSI2A_END,
113 .flags = IORESOURCE_MEM,
114 },
115 {
116 .start = OMAP3430_ISP_CSI2PHY_BASE,
117 .end = OMAP3430_ISP_CSI2PHY_END,
118 .flags = IORESOURCE_MEM,
119 },
120 {
121 .start = INT_34XX_CAM_IRQ,
122 .flags = IORESOURCE_IRQ,
123 }
124};
125
126static struct platform_device omap3isp_device = {
127 .name = "omap3isp",
128 .id = -1,
129 .num_resources = ARRAY_SIZE(omap3isp_resources),
130 .resource = omap3isp_resources,
131};
132
133static inline void omap_init_camera(void)
134{
135 platform_device_register(&omap3isp_device);
136}
137#else
138static inline void omap_init_camera(void)
139{
140}
141#endif
142
Hiroshi DOYU6c20a682009-03-23 18:07:23 -0700143#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
Tony Lindgrenc40fae92006-12-07 13:58:10 -0800144
C A Subramaniam454bf342009-11-22 10:11:18 -0800145#define MBOX_REG_SIZE 0x120
Hiroshi DOYU6c20a682009-03-23 18:07:23 -0700146
C A Subramaniam454bf342009-11-22 10:11:18 -0800147#ifdef CONFIG_ARCH_OMAP2
Tony Lindgrend10f2b62010-02-12 12:26:47 -0800148static struct resource omap2_mbox_resources[] = {
Tony Lindgrenc40fae92006-12-07 13:58:10 -0800149 {
Hiroshi DOYU6c20a682009-03-23 18:07:23 -0700150 .start = OMAP24XX_MAILBOX_BASE,
151 .end = OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
Tony Lindgrenc40fae92006-12-07 13:58:10 -0800152 .flags = IORESOURCE_MEM,
153 },
154 {
155 .start = INT_24XX_MAIL_U0_MPU,
156 .flags = IORESOURCE_IRQ,
Felipe Contreras1f2c4df2010-06-11 15:51:44 +0000157 .name = "dsp",
Tony Lindgrenc40fae92006-12-07 13:58:10 -0800158 },
159 {
160 .start = INT_24XX_MAIL_U3_MPU,
161 .flags = IORESOURCE_IRQ,
Felipe Contreras1f2c4df2010-06-11 15:51:44 +0000162 .name = "iva",
Tony Lindgrenc40fae92006-12-07 13:58:10 -0800163 },
164};
Tony Lindgrend10f2b62010-02-12 12:26:47 -0800165static int omap2_mbox_resources_sz = ARRAY_SIZE(omap2_mbox_resources);
166#else
167#define omap2_mbox_resources NULL
168#define omap2_mbox_resources_sz 0
C A Subramaniam454bf342009-11-22 10:11:18 -0800169#endif
Tony Lindgrenc40fae92006-12-07 13:58:10 -0800170
C A Subramaniam454bf342009-11-22 10:11:18 -0800171#ifdef CONFIG_ARCH_OMAP3
Tony Lindgrend10f2b62010-02-12 12:26:47 -0800172static struct resource omap3_mbox_resources[] = {
Hiroshi DOYU6c20a682009-03-23 18:07:23 -0700173 {
174 .start = OMAP34XX_MAILBOX_BASE,
175 .end = OMAP34XX_MAILBOX_BASE + MBOX_REG_SIZE - 1,
176 .flags = IORESOURCE_MEM,
177 },
178 {
179 .start = INT_24XX_MAIL_U0_MPU,
180 .flags = IORESOURCE_IRQ,
Felipe Contreras1f2c4df2010-06-11 15:51:44 +0000181 .name = "dsp",
Hiroshi DOYU6c20a682009-03-23 18:07:23 -0700182 },
183};
Tony Lindgrend10f2b62010-02-12 12:26:47 -0800184static int omap3_mbox_resources_sz = ARRAY_SIZE(omap3_mbox_resources);
185#else
186#define omap3_mbox_resources NULL
187#define omap3_mbox_resources_sz 0
C A Subramaniam454bf342009-11-22 10:11:18 -0800188#endif
189
190#ifdef CONFIG_ARCH_OMAP4
191
192#define OMAP4_MBOX_REG_SIZE 0x130
Tony Lindgrend10f2b62010-02-12 12:26:47 -0800193static struct resource omap4_mbox_resources[] = {
C A Subramaniam454bf342009-11-22 10:11:18 -0800194 {
195 .start = OMAP44XX_MAILBOX_BASE,
196 .end = OMAP44XX_MAILBOX_BASE +
197 OMAP4_MBOX_REG_SIZE - 1,
198 .flags = IORESOURCE_MEM,
199 },
200 {
Santosh Shilimkar5772ca72010-02-18 03:14:12 +0530201 .start = OMAP44XX_IRQ_MAIL_U0,
C A Subramaniam454bf342009-11-22 10:11:18 -0800202 .flags = IORESOURCE_IRQ,
Felipe Contreras1f2c4df2010-06-11 15:51:44 +0000203 .name = "mbox",
C A Subramaniam454bf342009-11-22 10:11:18 -0800204 },
205};
Tony Lindgrend10f2b62010-02-12 12:26:47 -0800206static int omap4_mbox_resources_sz = ARRAY_SIZE(omap4_mbox_resources);
207#else
208#define omap4_mbox_resources NULL
209#define omap4_mbox_resources_sz 0
C A Subramaniam454bf342009-11-22 10:11:18 -0800210#endif
Hiroshi DOYU6c20a682009-03-23 18:07:23 -0700211
Tony Lindgrenc40fae92006-12-07 13:58:10 -0800212static struct platform_device mbox_device = {
Felipe Contrerasd7427092010-06-11 15:51:48 +0000213 .name = "omap-mailbox",
Tony Lindgrenc40fae92006-12-07 13:58:10 -0800214 .id = -1,
Tony Lindgrenc40fae92006-12-07 13:58:10 -0800215};
216
217static inline void omap_init_mbox(void)
218{
Tony Lindgrend10f2b62010-02-12 12:26:47 -0800219 if (cpu_is_omap24xx()) {
220 mbox_device.resource = omap2_mbox_resources;
221 mbox_device.num_resources = omap2_mbox_resources_sz;
222 } else if (cpu_is_omap34xx()) {
223 mbox_device.resource = omap3_mbox_resources;
224 mbox_device.num_resources = omap3_mbox_resources_sz;
225 } else if (cpu_is_omap44xx()) {
226 mbox_device.resource = omap4_mbox_resources;
227 mbox_device.num_resources = omap4_mbox_resources_sz;
Hiroshi DOYU6c20a682009-03-23 18:07:23 -0700228 } else {
229 pr_err("%s: platform not supported\n", __func__);
230 return;
231 }
Tony Lindgrenc40fae92006-12-07 13:58:10 -0800232 platform_device_register(&mbox_device);
233}
234#else
235static inline void omap_init_mbox(void) { }
Hiroshi DOYU6c20a682009-03-23 18:07:23 -0700236#endif /* CONFIG_OMAP_MBOX_FWK */
Tony Lindgrenc40fae92006-12-07 13:58:10 -0800237
Tony Lindgren9b6553c2006-04-02 17:46:30 +0100238static inline void omap_init_sti(void) {}
Tony Lindgren9b6553c2006-04-02 17:46:30 +0100239
Tony Lindgren646e3ed2008-10-06 15:49:36 +0300240#if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE)
Juha Yrjolaed7eb9d2006-06-26 16:16:10 -0700241
Tony Lindgrence491cf2009-10-20 09:40:47 -0700242#include <plat/mcspi.h>
Juha Yrjolaed7eb9d2006-06-26 16:16:10 -0700243
244#define OMAP2_MCSPI1_BASE 0x48098000
245#define OMAP2_MCSPI2_BASE 0x4809a000
Tony Lindgren646e3ed2008-10-06 15:49:36 +0300246#define OMAP2_MCSPI3_BASE 0x480b8000
247#define OMAP2_MCSPI4_BASE 0x480ba000
Juha Yrjolaed7eb9d2006-06-26 16:16:10 -0700248
Syed Rafiuddin7869c0b2009-09-22 16:46:18 -0700249#define OMAP4_MCSPI1_BASE 0x48098100
250#define OMAP4_MCSPI2_BASE 0x4809a100
251#define OMAP4_MCSPI3_BASE 0x480b8100
252#define OMAP4_MCSPI4_BASE 0x480ba100
253
Juha Yrjolaed7eb9d2006-06-26 16:16:10 -0700254static struct omap2_mcspi_platform_config omap2_mcspi1_config = {
Juha Yrjolaed7eb9d2006-06-26 16:16:10 -0700255 .num_cs = 4,
256};
257
Tony Lindgrenc40fae92006-12-07 13:58:10 -0800258static struct resource omap2_mcspi1_resources[] = {
259 {
260 .start = OMAP2_MCSPI1_BASE,
261 .end = OMAP2_MCSPI1_BASE + 0xff,
262 .flags = IORESOURCE_MEM,
263 },
264};
265
Tony Lindgren646e3ed2008-10-06 15:49:36 +0300266static struct platform_device omap2_mcspi1 = {
Juha Yrjolaed7eb9d2006-06-26 16:16:10 -0700267 .name = "omap2_mcspi",
268 .id = 1,
Tony Lindgrenc40fae92006-12-07 13:58:10 -0800269 .num_resources = ARRAY_SIZE(omap2_mcspi1_resources),
270 .resource = omap2_mcspi1_resources,
Juha Yrjolaed7eb9d2006-06-26 16:16:10 -0700271 .dev = {
272 .platform_data = &omap2_mcspi1_config,
273 },
274};
275
276static struct omap2_mcspi_platform_config omap2_mcspi2_config = {
Juha Yrjolaed7eb9d2006-06-26 16:16:10 -0700277 .num_cs = 2,
278};
279
Tony Lindgrenc40fae92006-12-07 13:58:10 -0800280static struct resource omap2_mcspi2_resources[] = {
281 {
282 .start = OMAP2_MCSPI2_BASE,
283 .end = OMAP2_MCSPI2_BASE + 0xff,
284 .flags = IORESOURCE_MEM,
285 },
286};
287
Tony Lindgren646e3ed2008-10-06 15:49:36 +0300288static struct platform_device omap2_mcspi2 = {
Juha Yrjolaed7eb9d2006-06-26 16:16:10 -0700289 .name = "omap2_mcspi",
290 .id = 2,
Tony Lindgrenc40fae92006-12-07 13:58:10 -0800291 .num_resources = ARRAY_SIZE(omap2_mcspi2_resources),
292 .resource = omap2_mcspi2_resources,
Juha Yrjolaed7eb9d2006-06-26 16:16:10 -0700293 .dev = {
294 .platform_data = &omap2_mcspi2_config,
295 },
296};
297
Syed Rafiuddin7869c0b2009-09-22 16:46:18 -0700298#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \
299 defined(CONFIG_ARCH_OMAP4)
Tony Lindgren646e3ed2008-10-06 15:49:36 +0300300static struct omap2_mcspi_platform_config omap2_mcspi3_config = {
301 .num_cs = 2,
302};
303
304static struct resource omap2_mcspi3_resources[] = {
305 {
306 .start = OMAP2_MCSPI3_BASE,
307 .end = OMAP2_MCSPI3_BASE + 0xff,
308 .flags = IORESOURCE_MEM,
309 },
310};
311
312static struct platform_device omap2_mcspi3 = {
313 .name = "omap2_mcspi",
314 .id = 3,
315 .num_resources = ARRAY_SIZE(omap2_mcspi3_resources),
316 .resource = omap2_mcspi3_resources,
317 .dev = {
318 .platform_data = &omap2_mcspi3_config,
319 },
320};
321#endif
322
Syed Rafiuddin7869c0b2009-09-22 16:46:18 -0700323#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
Tony Lindgren646e3ed2008-10-06 15:49:36 +0300324static struct omap2_mcspi_platform_config omap2_mcspi4_config = {
325 .num_cs = 1,
326};
327
328static struct resource omap2_mcspi4_resources[] = {
329 {
330 .start = OMAP2_MCSPI4_BASE,
331 .end = OMAP2_MCSPI4_BASE + 0xff,
332 .flags = IORESOURCE_MEM,
333 },
334};
335
336static struct platform_device omap2_mcspi4 = {
337 .name = "omap2_mcspi",
338 .id = 4,
339 .num_resources = ARRAY_SIZE(omap2_mcspi4_resources),
340 .resource = omap2_mcspi4_resources,
341 .dev = {
342 .platform_data = &omap2_mcspi4_config,
343 },
344};
345#endif
346
Tony Lindgrenaf41a122009-09-24 16:23:05 -0700347#ifdef CONFIG_ARCH_OMAP4
348static inline void omap4_mcspi_fixup(void)
Juha Yrjolaed7eb9d2006-06-26 16:16:10 -0700349{
Tony Lindgrenaf41a122009-09-24 16:23:05 -0700350 omap2_mcspi1_resources[0].start = OMAP4_MCSPI1_BASE;
351 omap2_mcspi1_resources[0].end = OMAP4_MCSPI1_BASE + 0xff;
352 omap2_mcspi2_resources[0].start = OMAP4_MCSPI2_BASE;
353 omap2_mcspi2_resources[0].end = OMAP4_MCSPI2_BASE + 0xff;
354 omap2_mcspi3_resources[0].start = OMAP4_MCSPI3_BASE;
355 omap2_mcspi3_resources[0].end = OMAP4_MCSPI3_BASE + 0xff;
356 omap2_mcspi4_resources[0].start = OMAP4_MCSPI4_BASE;
357 omap2_mcspi4_resources[0].end = OMAP4_MCSPI4_BASE + 0xff;
358}
359#else
360static inline void omap4_mcspi_fixup(void)
361{
362}
363#endif
364
Syed Rafiuddin7869c0b2009-09-22 16:46:18 -0700365#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \
366 defined(CONFIG_ARCH_OMAP4)
Tony Lindgrenaf41a122009-09-24 16:23:05 -0700367static inline void omap2_mcspi3_init(void)
368{
369 platform_device_register(&omap2_mcspi3);
370}
371#else
372static inline void omap2_mcspi3_init(void)
373{
374}
Tony Lindgren646e3ed2008-10-06 15:49:36 +0300375#endif
Tony Lindgrenaf41a122009-09-24 16:23:05 -0700376
Syed Rafiuddin7869c0b2009-09-22 16:46:18 -0700377#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
Tony Lindgrenaf41a122009-09-24 16:23:05 -0700378static inline void omap2_mcspi4_init(void)
379{
380 platform_device_register(&omap2_mcspi4);
381}
382#else
383static inline void omap2_mcspi4_init(void)
384{
385}
Tony Lindgren646e3ed2008-10-06 15:49:36 +0300386#endif
Tony Lindgrenaf41a122009-09-24 16:23:05 -0700387
388static void omap_init_mcspi(void)
389{
390 if (cpu_is_omap44xx())
391 omap4_mcspi_fixup();
392
393 platform_device_register(&omap2_mcspi1);
394 platform_device_register(&omap2_mcspi2);
395
396 if (cpu_is_omap2430() || cpu_is_omap343x() || cpu_is_omap44xx())
397 omap2_mcspi3_init();
398
399 if (cpu_is_omap343x() || cpu_is_omap44xx())
400 omap2_mcspi4_init();
Juha Yrjolaed7eb9d2006-06-26 16:16:10 -0700401}
402
403#else
404static inline void omap_init_mcspi(void) {}
405#endif
406
Will Deacon88341332010-04-09 13:54:43 +0100407static struct resource omap2_pmu_resource = {
408 .start = 3,
409 .end = 3,
410 .flags = IORESOURCE_IRQ,
411};
412
413static struct resource omap3_pmu_resource = {
414 .start = INT_34XX_BENCH_MPU_EMUL,
415 .end = INT_34XX_BENCH_MPU_EMUL,
416 .flags = IORESOURCE_IRQ,
417};
418
419static struct platform_device omap_pmu_device = {
420 .name = "arm-pmu",
421 .id = ARM_PMU_DEVICE_CPU,
422 .num_resources = 1,
423};
424
425static void omap_init_pmu(void)
426{
427 if (cpu_is_omap24xx())
428 omap_pmu_device.resource = &omap2_pmu_resource;
429 else if (cpu_is_omap34xx())
430 omap_pmu_device.resource = &omap3_pmu_resource;
431 else
432 return;
433
434 platform_device_register(&omap_pmu_device);
435}
436
437
Dmitry Kasatkinee5500c2010-05-03 11:10:03 +0800438#if defined(CONFIG_CRYPTO_DEV_OMAP_SHAM) || defined(CONFIG_CRYPTO_DEV_OMAP_SHAM_MODULE)
439
Dmitry Kasatkinedc774e2010-05-14 14:45:08 +1000440#ifdef CONFIG_ARCH_OMAP2
Dmitry Kasatkinee5500c2010-05-03 11:10:03 +0800441static struct resource omap2_sham_resources[] = {
Tony Lindgren646e3ed2008-10-06 15:49:36 +0300442 {
443 .start = OMAP24XX_SEC_SHA1MD5_BASE,
444 .end = OMAP24XX_SEC_SHA1MD5_BASE + 0x64,
445 .flags = IORESOURCE_MEM,
446 },
447 {
448 .start = INT_24XX_SHA1MD5,
449 .flags = IORESOURCE_IRQ,
450 }
451};
Dmitry Kasatkinee5500c2010-05-03 11:10:03 +0800452static int omap2_sham_resources_sz = ARRAY_SIZE(omap2_sham_resources);
453#else
454#define omap2_sham_resources NULL
455#define omap2_sham_resources_sz 0
456#endif
Tony Lindgren646e3ed2008-10-06 15:49:36 +0300457
Dmitry Kasatkinedc774e2010-05-14 14:45:08 +1000458#ifdef CONFIG_ARCH_OMAP3
Dmitry Kasatkinee5500c2010-05-03 11:10:03 +0800459static struct resource omap3_sham_resources[] = {
460 {
461 .start = OMAP34XX_SEC_SHA1MD5_BASE,
462 .end = OMAP34XX_SEC_SHA1MD5_BASE + 0x64,
463 .flags = IORESOURCE_MEM,
464 },
465 {
466 .start = INT_34XX_SHA1MD52_IRQ,
467 .flags = IORESOURCE_IRQ,
468 },
469 {
470 .start = OMAP34XX_DMA_SHA1MD5_RX,
471 .flags = IORESOURCE_DMA,
472 }
473};
474static int omap3_sham_resources_sz = ARRAY_SIZE(omap3_sham_resources);
475#else
476#define omap3_sham_resources NULL
477#define omap3_sham_resources_sz 0
478#endif
479
480static struct platform_device sham_device = {
481 .name = "omap-sham",
Tony Lindgren646e3ed2008-10-06 15:49:36 +0300482 .id = -1,
Tony Lindgren646e3ed2008-10-06 15:49:36 +0300483};
484
Dmitry Kasatkinee5500c2010-05-03 11:10:03 +0800485static void omap_init_sham(void)
Tony Lindgren646e3ed2008-10-06 15:49:36 +0300486{
Dmitry Kasatkinee5500c2010-05-03 11:10:03 +0800487 if (cpu_is_omap24xx()) {
488 sham_device.resource = omap2_sham_resources;
489 sham_device.num_resources = omap2_sham_resources_sz;
490 } else if (cpu_is_omap34xx()) {
491 sham_device.resource = omap3_sham_resources;
492 sham_device.num_resources = omap3_sham_resources_sz;
493 } else {
494 pr_err("%s: platform not supported\n", __func__);
495 return;
496 }
497 platform_device_register(&sham_device);
Tony Lindgren646e3ed2008-10-06 15:49:36 +0300498}
499#else
Dmitry Kasatkinee5500c2010-05-03 11:10:03 +0800500static inline void omap_init_sham(void) { }
Tony Lindgren646e3ed2008-10-06 15:49:36 +0300501#endif
502
Dmitry Kasatkin82a0c142010-08-20 13:44:46 +0000503#if defined(CONFIG_CRYPTO_DEV_OMAP_AES) || defined(CONFIG_CRYPTO_DEV_OMAP_AES_MODULE)
504
505#ifdef CONFIG_ARCH_OMAP2
506static struct resource omap2_aes_resources[] = {
507 {
508 .start = OMAP24XX_SEC_AES_BASE,
509 .end = OMAP24XX_SEC_AES_BASE + 0x4C,
510 .flags = IORESOURCE_MEM,
511 },
512 {
513 .start = OMAP24XX_DMA_AES_TX,
514 .flags = IORESOURCE_DMA,
515 },
516 {
517 .start = OMAP24XX_DMA_AES_RX,
518 .flags = IORESOURCE_DMA,
519 }
520};
521static int omap2_aes_resources_sz = ARRAY_SIZE(omap2_aes_resources);
522#else
523#define omap2_aes_resources NULL
524#define omap2_aes_resources_sz 0
525#endif
526
527#ifdef CONFIG_ARCH_OMAP3
528static struct resource omap3_aes_resources[] = {
529 {
530 .start = OMAP34XX_SEC_AES_BASE,
531 .end = OMAP34XX_SEC_AES_BASE + 0x4C,
532 .flags = IORESOURCE_MEM,
533 },
534 {
535 .start = OMAP34XX_DMA_AES2_TX,
536 .flags = IORESOURCE_DMA,
537 },
538 {
539 .start = OMAP34XX_DMA_AES2_RX,
540 .flags = IORESOURCE_DMA,
541 }
542};
543static int omap3_aes_resources_sz = ARRAY_SIZE(omap3_aes_resources);
544#else
545#define omap3_aes_resources NULL
546#define omap3_aes_resources_sz 0
547#endif
548
549static struct platform_device aes_device = {
550 .name = "omap-aes",
551 .id = -1,
552};
553
554static void omap_init_aes(void)
555{
556 if (cpu_is_omap24xx()) {
557 aes_device.resource = omap2_aes_resources;
558 aes_device.num_resources = omap2_aes_resources_sz;
559 } else if (cpu_is_omap34xx()) {
560 aes_device.resource = omap3_aes_resources;
561 aes_device.num_resources = omap3_aes_resources_sz;
562 } else {
563 pr_err("%s: platform not supported\n", __func__);
564 return;
565 }
566 platform_device_register(&aes_device);
567}
568
569#else
570static inline void omap_init_aes(void) { }
571#endif
572
Tony Lindgrend8874662008-12-10 17:37:16 -0800573/*-------------------------------------------------------------------------*/
574
kishore kadiyala82cf8182009-09-22 16:45:25 -0700575#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
Kevin Hilman917fa282008-12-10 17:37:17 -0800576
577#define MMCHS_SYSCONFIG 0x0010
578#define MMCHS_SYSCONFIG_SWRESET (1 << 1)
579#define MMCHS_SYSSTATUS 0x0014
580#define MMCHS_SYSSTATUS_RESETDONE (1 << 0)
581
582static struct platform_device dummy_pdev = {
583 .dev = {
584 .bus = &platform_bus_type,
585 },
586};
587
588/**
589 * omap_hsmmc_reset() - Full reset of each HS-MMC controller
590 *
591 * Ensure that each MMC controller is fully reset. Controllers
592 * left in an unknown state (by bootloader) may prevent retention
593 * or OFF-mode. This is especially important in cases where the
594 * MMC driver is not enabled, _or_ built as a module.
595 *
596 * In order for reset to work, interface, functional and debounce
597 * clocks must be enabled. The debounce clock comes from func_32k_clk
598 * and is not under SW control, so we only enable i- and f-clocks.
599 **/
600static void __init omap_hsmmc_reset(void)
601{
Tony Lindgren4323e9f2010-02-12 12:26:48 -0800602 u32 i, nr_controllers;
603
604 if (cpu_is_omap242x())
605 return;
606
607 nr_controllers = cpu_is_omap44xx() ? OMAP44XX_NR_MMC :
kishore kadiyala82cf8182009-09-22 16:45:25 -0700608 (cpu_is_omap34xx() ? OMAP34XX_NR_MMC : OMAP24XX_NR_MMC);
Kevin Hilman917fa282008-12-10 17:37:17 -0800609
610 for (i = 0; i < nr_controllers; i++) {
611 u32 v, base = 0;
612 struct clk *iclk, *fclk;
613 struct device *dev = &dummy_pdev.dev;
614
615 switch (i) {
616 case 0:
617 base = OMAP2_MMC1_BASE;
618 break;
619 case 1:
620 base = OMAP2_MMC2_BASE;
621 break;
622 case 2:
623 base = OMAP3_MMC3_BASE;
624 break;
kishore kadiyala82cf8182009-09-22 16:45:25 -0700625 case 3:
626 if (!cpu_is_omap44xx())
627 return;
628 base = OMAP4_MMC4_BASE;
629 break;
630 case 4:
631 if (!cpu_is_omap44xx())
632 return;
633 base = OMAP4_MMC5_BASE;
634 break;
Kevin Hilman917fa282008-12-10 17:37:17 -0800635 }
636
kishore kadiyala82cf8182009-09-22 16:45:25 -0700637 if (cpu_is_omap44xx())
638 base += OMAP4_MMC_REG_OFFSET;
639
Kevin Hilman917fa282008-12-10 17:37:17 -0800640 dummy_pdev.id = i;
Russell King1e98ffa2009-01-19 18:56:17 +0000641 dev_set_name(&dummy_pdev.dev, "mmci-omap-hs.%d", i);
Russell King6f7607c2009-01-28 10:22:50 +0000642 iclk = clk_get(dev, "ick");
Kevin Hilman917fa282008-12-10 17:37:17 -0800643 if (iclk && clk_enable(iclk))
644 iclk = NULL;
645
Russell King6f7607c2009-01-28 10:22:50 +0000646 fclk = clk_get(dev, "fck");
Kevin Hilman917fa282008-12-10 17:37:17 -0800647 if (fclk && clk_enable(fclk))
648 fclk = NULL;
649
650 if (!iclk || !fclk) {
651 printk(KERN_WARNING
652 "%s: Unable to enable clocks for MMC%d, "
653 "cannot reset.\n", __func__, i);
654 break;
655 }
656
657 omap_writel(MMCHS_SYSCONFIG_SWRESET, base + MMCHS_SYSCONFIG);
658 v = omap_readl(base + MMCHS_SYSSTATUS);
659 while (!(omap_readl(base + MMCHS_SYSSTATUS) &
660 MMCHS_SYSSTATUS_RESETDONE))
661 cpu_relax();
662
663 if (fclk) {
664 clk_disable(fclk);
665 clk_put(fclk);
666 }
667 if (iclk) {
668 clk_disable(iclk);
669 clk_put(iclk);
670 }
671 }
672}
673#else
674static inline void omap_hsmmc_reset(void) {}
675#endif
676
Tony Lindgrend8874662008-12-10 17:37:16 -0800677#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) || \
678 defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE)
679
680static inline void omap2_mmc_mux(struct omap_mmc_platform_data *mmc_controller,
681 int controller_nr)
682{
stanley.miaoed8303fc2010-05-13 12:39:30 +0000683 if ((mmc_controller->slots[0].switch_pin > 0) && \
684 (mmc_controller->slots[0].switch_pin < OMAP_MAX_GPIO_LINES))
685 omap_mux_init_gpio(mmc_controller->slots[0].switch_pin,
686 OMAP_PIN_INPUT_PULLUP);
687 if ((mmc_controller->slots[0].gpio_wp > 0) && \
688 (mmc_controller->slots[0].gpio_wp < OMAP_MAX_GPIO_LINES))
689 omap_mux_init_gpio(mmc_controller->slots[0].gpio_wp,
690 OMAP_PIN_INPUT_PULLUP);
691
Tony Lindgrend8874662008-12-10 17:37:16 -0800692 if (cpu_is_omap2420() && controller_nr == 0) {
Tony Lindgrenf99bf162010-07-05 16:31:40 +0300693 omap_mux_init_signal("sdmmc_cmd", 0);
694 omap_mux_init_signal("sdmmc_clki", 0);
695 omap_mux_init_signal("sdmmc_clko", 0);
696 omap_mux_init_signal("sdmmc_dat0", 0);
697 omap_mux_init_signal("sdmmc_dat_dir0", 0);
698 omap_mux_init_signal("sdmmc_cmd_dir", 0);
Sukumar Ghorai3a638332010-09-15 14:49:23 +0000699 if (mmc_controller->slots[0].caps & MMC_CAP_4_BIT_DATA) {
Tony Lindgrenf99bf162010-07-05 16:31:40 +0300700 omap_mux_init_signal("sdmmc_dat1", 0);
701 omap_mux_init_signal("sdmmc_dat2", 0);
702 omap_mux_init_signal("sdmmc_dat3", 0);
703 omap_mux_init_signal("sdmmc_dat_dir1", 0);
704 omap_mux_init_signal("sdmmc_dat_dir2", 0);
705 omap_mux_init_signal("sdmmc_dat_dir3", 0);
Tony Lindgrend8874662008-12-10 17:37:16 -0800706 }
707
708 /*
709 * Use internal loop-back in MMC/SDIO Module Input Clock
710 * selection
711 */
712 if (mmc_controller->slots[0].internal_clock) {
713 u32 v = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
714 v |= (1 << 24);
715 omap_ctrl_writel(v, OMAP2_CONTROL_DEVCONF0);
716 }
717 }
Vikram Pandita57b9daa2009-08-28 11:24:11 -0700718
Madhu4596d142009-11-22 10:11:06 -0800719 if (cpu_is_omap34xx()) {
Vikram Pandita57b9daa2009-08-28 11:24:11 -0700720 if (controller_nr == 0) {
Tony Lindgren4896e392009-12-11 16:16:32 -0800721 omap_mux_init_signal("sdmmc1_clk",
722 OMAP_PIN_INPUT_PULLUP);
723 omap_mux_init_signal("sdmmc1_cmd",
724 OMAP_PIN_INPUT_PULLUP);
725 omap_mux_init_signal("sdmmc1_dat0",
726 OMAP_PIN_INPUT_PULLUP);
Sukumar Ghorai3a638332010-09-15 14:49:23 +0000727 if (mmc_controller->slots[0].caps &
728 (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)) {
Tony Lindgren4896e392009-12-11 16:16:32 -0800729 omap_mux_init_signal("sdmmc1_dat1",
730 OMAP_PIN_INPUT_PULLUP);
731 omap_mux_init_signal("sdmmc1_dat2",
732 OMAP_PIN_INPUT_PULLUP);
733 omap_mux_init_signal("sdmmc1_dat3",
734 OMAP_PIN_INPUT_PULLUP);
Vikram Pandita57b9daa2009-08-28 11:24:11 -0700735 }
Sukumar Ghorai3a638332010-09-15 14:49:23 +0000736 if (mmc_controller->slots[0].caps &
737 MMC_CAP_8_BIT_DATA) {
Tony Lindgren4896e392009-12-11 16:16:32 -0800738 omap_mux_init_signal("sdmmc1_dat4",
739 OMAP_PIN_INPUT_PULLUP);
740 omap_mux_init_signal("sdmmc1_dat5",
741 OMAP_PIN_INPUT_PULLUP);
742 omap_mux_init_signal("sdmmc1_dat6",
743 OMAP_PIN_INPUT_PULLUP);
744 omap_mux_init_signal("sdmmc1_dat7",
745 OMAP_PIN_INPUT_PULLUP);
Vikram Pandita57b9daa2009-08-28 11:24:11 -0700746 }
747 }
748 if (controller_nr == 1) {
749 /* MMC2 */
Tony Lindgren4896e392009-12-11 16:16:32 -0800750 omap_mux_init_signal("sdmmc2_clk",
751 OMAP_PIN_INPUT_PULLUP);
752 omap_mux_init_signal("sdmmc2_cmd",
753 OMAP_PIN_INPUT_PULLUP);
754 omap_mux_init_signal("sdmmc2_dat0",
755 OMAP_PIN_INPUT_PULLUP);
Vikram Pandita57b9daa2009-08-28 11:24:11 -0700756
757 /*
758 * For 8 wire configurations, Lines DAT4, 5, 6 and 7 need to be muxed
759 * in the board-*.c files
760 */
Sukumar Ghorai3a638332010-09-15 14:49:23 +0000761 if (mmc_controller->slots[0].caps &
762 (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)) {
Tony Lindgren4896e392009-12-11 16:16:32 -0800763 omap_mux_init_signal("sdmmc2_dat1",
764 OMAP_PIN_INPUT_PULLUP);
765 omap_mux_init_signal("sdmmc2_dat2",
766 OMAP_PIN_INPUT_PULLUP);
767 omap_mux_init_signal("sdmmc2_dat3",
768 OMAP_PIN_INPUT_PULLUP);
Vikram Pandita57b9daa2009-08-28 11:24:11 -0700769 }
Sukumar Ghorai3a638332010-09-15 14:49:23 +0000770 if (mmc_controller->slots[0].caps &
771 MMC_CAP_8_BIT_DATA) {
Tony Lindgren4896e392009-12-11 16:16:32 -0800772 omap_mux_init_signal("sdmmc2_dat4.sdmmc2_dat4",
773 OMAP_PIN_INPUT_PULLUP);
774 omap_mux_init_signal("sdmmc2_dat5.sdmmc2_dat5",
775 OMAP_PIN_INPUT_PULLUP);
776 omap_mux_init_signal("sdmmc2_dat6.sdmmc2_dat6",
777 OMAP_PIN_INPUT_PULLUP);
778 omap_mux_init_signal("sdmmc2_dat7.sdmmc2_dat7",
779 OMAP_PIN_INPUT_PULLUP);
Madhu46792322009-11-22 10:11:08 -0800780 }
Vikram Pandita57b9daa2009-08-28 11:24:11 -0700781 }
782
783 /*
784 * For MMC3 the pins need to be muxed in the board-*.c files
785 */
786 }
Tony Lindgrend8874662008-12-10 17:37:16 -0800787}
788
789void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data,
790 int nr_controllers)
791{
792 int i;
Tony Lindgren0dffb5c2009-01-29 08:57:16 -0800793 char *name;
Tony Lindgrend8874662008-12-10 17:37:16 -0800794
795 for (i = 0; i < nr_controllers; i++) {
796 unsigned long base, size;
797 unsigned int irq = 0;
798
799 if (!mmc_data[i])
800 continue;
801
802 omap2_mmc_mux(mmc_data[i], i);
803
804 switch (i) {
805 case 0:
806 base = OMAP2_MMC1_BASE;
807 irq = INT_24XX_MMC_IRQ;
808 break;
809 case 1:
810 base = OMAP2_MMC2_BASE;
811 irq = INT_24XX_MMC2_IRQ;
812 break;
813 case 2:
kishore kadiyala82cf8182009-09-22 16:45:25 -0700814 if (!cpu_is_omap44xx() && !cpu_is_omap34xx())
Tony Lindgrend8874662008-12-10 17:37:16 -0800815 return;
816 base = OMAP3_MMC3_BASE;
817 irq = INT_34XX_MMC3_IRQ;
818 break;
kishore kadiyala82cf8182009-09-22 16:45:25 -0700819 case 3:
820 if (!cpu_is_omap44xx())
821 return;
kishore kadiyala91a0b082010-10-01 16:35:28 -0700822 base = OMAP4_MMC4_BASE;
Santosh Shilimkar5772ca72010-02-18 03:14:12 +0530823 irq = OMAP44XX_IRQ_MMC4;
kishore kadiyala82cf8182009-09-22 16:45:25 -0700824 break;
825 case 4:
826 if (!cpu_is_omap44xx())
827 return;
kishore kadiyala91a0b082010-10-01 16:35:28 -0700828 base = OMAP4_MMC5_BASE;
kishore kadiyala9df76b72010-04-21 18:19:37 +0000829 irq = OMAP44XX_IRQ_MMC5;
kishore kadiyala82cf8182009-09-22 16:45:25 -0700830 break;
Tony Lindgrend8874662008-12-10 17:37:16 -0800831 default:
832 continue;
833 }
834
Tony Lindgren0dffb5c2009-01-29 08:57:16 -0800835 if (cpu_is_omap2420()) {
Tony Lindgrend8874662008-12-10 17:37:16 -0800836 size = OMAP2420_MMC_SIZE;
Tony Lindgren0dffb5c2009-01-29 08:57:16 -0800837 name = "mmci-omap";
kishore kadiyala82cf8182009-09-22 16:45:25 -0700838 } else if (cpu_is_omap44xx()) {
kishore kadiyala91a0b082010-10-01 16:35:28 -0700839 if (i < 3)
Santosh Shilimkar5772ca72010-02-18 03:14:12 +0530840 irq += OMAP44XX_IRQ_GIC_START;
kishore kadiyala82cf8182009-09-22 16:45:25 -0700841 size = OMAP4_HSMMC_SIZE;
842 name = "mmci-omap-hs";
Tony Lindgren0dffb5c2009-01-29 08:57:16 -0800843 } else {
kishore kadiyala82cf8182009-09-22 16:45:25 -0700844 size = OMAP3_HSMMC_SIZE;
Tony Lindgren0dffb5c2009-01-29 08:57:16 -0800845 name = "mmci-omap-hs";
846 }
847 omap_mmc_add(name, i, base, size, irq, mmc_data[i]);
Tony Lindgrend8874662008-12-10 17:37:16 -0800848 };
849}
850
851#endif
852
853/*-------------------------------------------------------------------------*/
854
Tony Lindgren646e3ed2008-10-06 15:49:36 +0300855#if defined(CONFIG_HDQ_MASTER_OMAP) || defined(CONFIG_HDQ_MASTER_OMAP_MODULE)
856#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3430)
857#define OMAP_HDQ_BASE 0x480B2000
858#endif
859static struct resource omap_hdq_resources[] = {
860 {
861 .start = OMAP_HDQ_BASE,
862 .end = OMAP_HDQ_BASE + 0x1C,
863 .flags = IORESOURCE_MEM,
864 },
865 {
866 .start = INT_24XX_HDQ_IRQ,
867 .flags = IORESOURCE_IRQ,
868 },
869};
870static struct platform_device omap_hdq_dev = {
871 .name = "omap_hdq",
872 .id = 0,
873 .dev = {
874 .platform_data = NULL,
875 },
876 .num_resources = ARRAY_SIZE(omap_hdq_resources),
877 .resource = omap_hdq_resources,
878};
879static inline void omap_hdq_init(void)
880{
881 (void) platform_device_register(&omap_hdq_dev);
882}
883#else
884static inline void omap_hdq_init(void) {}
885#endif
886
Vaibhav Hiremathb2273582010-05-10 14:29:14 -0700887/*---------------------------------------------------------------------------*/
888
889#if defined(CONFIG_VIDEO_OMAP2_VOUT) || \
890 defined(CONFIG_VIDEO_OMAP2_VOUT_MODULE)
891#if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
892static struct resource omap_vout_resource[3 - CONFIG_FB_OMAP2_NUM_FBS] = {
893};
894#else
895static struct resource omap_vout_resource[2] = {
896};
897#endif
898
899static struct platform_device omap_vout_device = {
900 .name = "omap_vout",
901 .num_resources = ARRAY_SIZE(omap_vout_resource),
902 .resource = &omap_vout_resource[0],
903 .id = -1,
904};
905static void omap_init_vout(void)
906{
907 if (platform_device_register(&omap_vout_device) < 0)
908 printk(KERN_ERR "Unable to register OMAP-VOUT device\n");
909}
910#else
911static inline void omap_init_vout(void) {}
912#endif
913
Tony Lindgren1dbae812005-11-10 14:26:51 +0000914/*-------------------------------------------------------------------------*/
915
Charulatha V20252d42010-10-08 10:23:06 -0700916/*
917 * Inorder to avoid any assumptions from bootloader regarding WDT
918 * settings, WDT module is reset during init. This enables the watchdog
919 * timer. Hence it is required to disable the watchdog after the WDT reset
920 * during init. Otherwise the system would reboot as per the default
921 * watchdog timer registers settings.
922 */
923#define OMAP_WDT_WPS (0x34)
924#define OMAP_WDT_SPR (0x48)
925
926static int omap2_disable_wdt(struct omap_hwmod *oh, void *unused)
927{
928 void __iomem *base;
929 int ret;
930
931 if (!oh) {
932 pr_err("%s: Could not look up wdtimer_hwmod\n", __func__);
933 return -EINVAL;
934 }
935
936 base = omap_hwmod_get_mpu_rt_va(oh);
937 if (!base) {
938 pr_err("%s: Could not get the base address for %s\n",
939 oh->name, __func__);
940 return -EINVAL;
941 }
942
943 /* Enable the clocks before accessing the WDT registers */
944 ret = omap_hwmod_enable(oh);
945 if (ret) {
946 pr_err("%s: Could not enable clocks for %s\n",
947 oh->name, __func__);
948 return ret;
949 }
950
951 /* sequence required to disable watchdog */
952 __raw_writel(0xAAAA, base + OMAP_WDT_SPR);
953 while (__raw_readl(base + OMAP_WDT_WPS) & 0x10)
954 cpu_relax();
955
956 __raw_writel(0x5555, base + OMAP_WDT_SPR);
957 while (__raw_readl(base + OMAP_WDT_WPS) & 0x10)
958 cpu_relax();
959
960 ret = omap_hwmod_idle(oh);
961 if (ret)
962 pr_err("%s: Could not disable clocks for %s\n",
963 oh->name, __func__);
964
965 return ret;
966}
967
968static void __init omap_disable_wdt(void)
969{
970 if (cpu_class_is_omap2())
971 omap_hwmod_for_each_by_class("wd_timer",
972 omap2_disable_wdt, NULL);
973 return;
974}
975
Tony Lindgren1dbae812005-11-10 14:26:51 +0000976static int __init omap2_init_devices(void)
977{
978 /* please keep these calls, and their implementations above,
979 * in alphabetical order so they're easier to sort through.
980 */
Charulatha V20252d42010-10-08 10:23:06 -0700981 omap_disable_wdt();
Kevin Hilman917fa282008-12-10 17:37:17 -0800982 omap_hsmmc_reset();
Tony Lindgren828c7072009-03-23 18:23:49 -0700983 omap_init_camera();
Tony Lindgrenc40fae92006-12-07 13:58:10 -0800984 omap_init_mbox();
Juha Yrjolaed7eb9d2006-06-26 16:16:10 -0700985 omap_init_mcspi();
Will Deacon88341332010-04-09 13:54:43 +0100986 omap_init_pmu();
Tony Lindgren646e3ed2008-10-06 15:49:36 +0300987 omap_hdq_init();
Tony Lindgren9b6553c2006-04-02 17:46:30 +0100988 omap_init_sti();
Dmitry Kasatkinee5500c2010-05-03 11:10:03 +0800989 omap_init_sham();
Dmitry Kasatkin82a0c142010-08-20 13:44:46 +0000990 omap_init_aes();
Vaibhav Hiremathb2273582010-05-10 14:29:14 -0700991 omap_init_vout();
Tony Lindgren1dbae812005-11-10 14:26:51 +0000992
993 return 0;
994}
995arch_initcall(omap2_init_devices);
Varadarajan, Charulathaf2ce6232010-09-23 20:02:42 +0530996
997#if defined(CONFIG_OMAP_WATCHDOG) || defined(CONFIG_OMAP_WATCHDOG_MODULE)
998struct omap_device_pm_latency omap_wdt_latency[] = {
999 [0] = {
1000 .deactivate_func = omap_device_idle_hwmods,
1001 .activate_func = omap_device_enable_hwmods,
1002 .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
1003 },
1004};
1005
1006static int __init omap_init_wdt(void)
1007{
1008 int id = -1;
1009 struct omap_device *od;
1010 struct omap_hwmod *oh;
1011 char *oh_name = "wd_timer2";
1012 char *dev_name = "omap_wdt";
1013
1014 if (!cpu_class_is_omap2())
1015 return 0;
1016
1017 oh = omap_hwmod_lookup(oh_name);
1018 if (!oh) {
1019 pr_err("Could not look up wd_timer%d hwmod\n", id);
1020 return -EINVAL;
1021 }
1022
1023 od = omap_device_build(dev_name, id, oh, NULL, 0,
1024 omap_wdt_latency,
1025 ARRAY_SIZE(omap_wdt_latency), 0);
1026 WARN(IS_ERR(od), "Cant build omap_device for %s:%s.\n",
1027 dev_name, oh->name);
1028 return 0;
1029}
1030subsys_initcall(omap_init_wdt);
1031#endif