ARM: OMAP: remove plat/board.h file
[pandora-kernel.git] / arch / arm / plat-omap / devices.c
1 /*
2  * linux/arch/arm/plat-omap/devices.c
3  *
4  * Common platform device setup/initialization for OMAP1 and OMAP2
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 #include <linux/gpio.h>
12 #include <linux/module.h>
13 #include <linux/kernel.h>
14 #include <linux/init.h>
15 #include <linux/platform_device.h>
16 #include <linux/io.h>
17 #include <linux/slab.h>
18 #include <linux/memblock.h>
19
20 #include <mach/hardware.h>
21 #include <asm/mach-types.h>
22 #include <asm/mach/map.h>
23 #include <asm/memblock.h>
24
25 #include <plat/tc.h>
26 #include <plat/mmc.h>
27 #include <plat/menelaus.h>
28 #include <plat/omap44xx.h>
29
30 /*-------------------------------------------------------------------------*/
31
32 #if defined(CONFIG_HW_RANDOM_OMAP) || defined(CONFIG_HW_RANDOM_OMAP_MODULE)
33
34 #ifdef CONFIG_ARCH_OMAP2
35 #define OMAP_RNG_BASE           0x480A0000
36 #else
37 #define OMAP_RNG_BASE           0xfffe5000
38 #endif
39
40 static struct resource rng_resources[] = {
41         {
42                 .start          = OMAP_RNG_BASE,
43                 .end            = OMAP_RNG_BASE + 0x4f,
44                 .flags          = IORESOURCE_MEM,
45         },
46 };
47
48 static struct platform_device omap_rng_device = {
49         .name           = "omap_rng",
50         .id             = -1,
51         .num_resources  = ARRAY_SIZE(rng_resources),
52         .resource       = rng_resources,
53 };
54
55 static void omap_init_rng(void)
56 {
57         (void) platform_device_register(&omap_rng_device);
58 }
59 #else
60 static inline void omap_init_rng(void) {}
61 #endif
62
63 /*
64  * This gets called after board-specific INIT_MACHINE, and initializes most
65  * on-chip peripherals accessible on this board (except for few like USB):
66  *
67  *  (a) Does any "standard config" pin muxing needed.  Board-specific
68  *      code will have muxed GPIO pins and done "nonstandard" setup;
69  *      that code could live in the boot loader.
70  *  (b) Populating board-specific platform_data with the data drivers
71  *      rely on to handle wiring variations.
72  *  (c) Creating platform devices as meaningful on this board and
73  *      with this kernel configuration.
74  *
75  * Claiming GPIOs, and setting their direction and initial values, is the
76  * responsibility of the device drivers.  So is responding to probe().
77  *
78  * Board-specific knowledge like creating devices or pin setup is to be
79  * kept out of drivers as much as possible.  In particular, pin setup
80  * may be handled by the boot loader, and drivers should expect it will
81  * normally have been done by the time they're probed.
82  */
83 static int __init omap_init_devices(void)
84 {
85         /* please keep these calls, and their implementations above,
86          * in alphabetical order so they're easier to sort through.
87          */
88         omap_init_rng();
89         return 0;
90 }
91 arch_initcall(omap_init_devices);