Merge 'staging-next' to Linus's tree
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / arm / plat-omap / common.c
blobf04731820301c921f8d65c3d394f570ee543b34a
1 /*
2 * linux/arch/arm/plat-omap/common.c
4 * Code common to all OMAP machines.
5 * The file is created by Tony Lindgren <tony@atomide.com>
7 * Copyright (C) 2009 Texas Instruments
8 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
14 #include <linux/kernel.h>
15 #include <linux/init.h>
16 #include <linux/io.h>
17 #include <linux/omapfb.h>
19 #include <plat/common.h>
20 #include <plat/board.h>
21 #include <plat/vram.h>
22 #include <plat/dsp.h>
25 #define NO_LENGTH_CHECK 0xffffffff
27 struct omap_board_config_kernel *omap_board_config;
28 int omap_board_config_size;
30 static const void *get_config(u16 tag, size_t len, int skip, size_t *len_out)
32 struct omap_board_config_kernel *kinfo = NULL;
33 int i;
35 /* Try to find the config from the board-specific structures
36 * in the kernel. */
37 for (i = 0; i < omap_board_config_size; i++) {
38 if (omap_board_config[i].tag == tag) {
39 if (skip == 0) {
40 kinfo = &omap_board_config[i];
41 break;
42 } else {
43 skip--;
47 if (kinfo == NULL)
48 return NULL;
49 return kinfo->data;
52 const void *__omap_get_config(u16 tag, size_t len, int nr)
54 return get_config(tag, len, nr, NULL);
56 EXPORT_SYMBOL(__omap_get_config);
58 const void *omap_get_var_config(u16 tag, size_t *len)
60 return get_config(tag, NO_LENGTH_CHECK, 0, len);
62 EXPORT_SYMBOL(omap_get_var_config);
64 void __init omap_reserve(void)
66 omapfb_reserve_sdram_memblock();
67 omap_vram_reserve_sdram_memblock();
68 omap_dsp_reserve_sdram_memblock();