2 * linux/arch/arm/plat-omap/devices.c
4 * Common platform device setup/initialization for OMAP1 and OMAP2
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.
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>
17 #include <linux/slab.h>
18 #include <linux/memblock.h>
20 #include <mach/hardware.h>
21 #include <asm/mach-types.h>
22 #include <asm/mach/map.h>
23 #include <asm/memblock.h>
27 #include <plat/menelaus.h>
28 #include <plat/omap44xx.h>
30 /*-------------------------------------------------------------------------*/
32 #if defined(CONFIG_HW_RANDOM_OMAP) || defined(CONFIG_HW_RANDOM_OMAP_MODULE)
34 #ifdef CONFIG_ARCH_OMAP2
35 #define OMAP_RNG_BASE 0x480A0000
37 #define OMAP_RNG_BASE 0xfffe5000
40 static struct resource rng_resources[] = {
42 .start = OMAP_RNG_BASE,
43 .end = OMAP_RNG_BASE + 0x4f,
44 .flags = IORESOURCE_MEM,
48 static struct platform_device omap_rng_device = {
51 .num_resources = ARRAY_SIZE(rng_resources),
52 .resource = rng_resources,
55 static void omap_init_rng(void)
57 (void) platform_device_register(&omap_rng_device);
60 static inline void omap_init_rng(void) {}
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):
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.
75 * Claiming GPIOs, and setting their direction and initial values, is the
76 * responsibility of the device drivers. So is responding to probe().
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.
83 static int __init omap_init_devices(void)
85 /* please keep these calls, and their implementations above,
86 * in alphabetical order so they're easier to sort through.
91 arch_initcall(omap_init_devices);