diff options
| author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
|---|---|---|
| committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
| commit | fcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch) | |
| tree | a57612d1888735a2ec7972891b68c1ac5ec8faea /arch/arm/plat-omap/common.c | |
| parent | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff) | |
Diffstat (limited to 'arch/arm/plat-omap/common.c')
| -rw-r--r-- | arch/arm/plat-omap/common.c | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c new file mode 100644 index 00000000000..d9f10a31e60 --- /dev/null +++ b/arch/arm/plat-omap/common.c | |||
| @@ -0,0 +1,68 @@ | |||
| 1 | /* | ||
| 2 | * linux/arch/arm/plat-omap/common.c | ||
| 3 | * | ||
| 4 | * Code common to all OMAP machines. | ||
| 5 | * The file is created by Tony Lindgren <tony@atomide.com> | ||
| 6 | * | ||
| 7 | * Copyright (C) 2009 Texas Instruments | ||
| 8 | * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com> | ||
| 9 | * | ||
| 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. | ||
| 13 | */ | ||
| 14 | #include <linux/kernel.h> | ||
| 15 | #include <linux/init.h> | ||
| 16 | #include <linux/io.h> | ||
| 17 | #include <linux/omapfb.h> | ||
| 18 | |||
| 19 | #include <plat/common.h> | ||
| 20 | #include <plat/board.h> | ||
| 21 | #include <plat/vram.h> | ||
| 22 | #include <plat/dsp.h> | ||
| 23 | |||
| 24 | |||
| 25 | #define NO_LENGTH_CHECK 0xffffffff | ||
| 26 | |||
| 27 | struct omap_board_config_kernel *omap_board_config __initdata; | ||
| 28 | int omap_board_config_size; | ||
| 29 | |||
| 30 | static const void *__init get_config(u16 tag, size_t len, | ||
| 31 | int skip, size_t *len_out) | ||
| 32 | { | ||
| 33 | struct omap_board_config_kernel *kinfo = NULL; | ||
| 34 | int i; | ||
| 35 | |||
| 36 | /* Try to find the config from the board-specific structures | ||
| 37 | * in the kernel. */ | ||
| 38 | for (i = 0; i < omap_board_config_size; i++) { | ||
| 39 | if (omap_board_config[i].tag == tag) { | ||
| 40 | if (skip == 0) { | ||
| 41 | kinfo = &omap_board_config[i]; | ||
| 42 | break; | ||
| 43 | } else { | ||
| 44 | skip--; | ||
| 45 | } | ||
| 46 | } | ||
| 47 | } | ||
| 48 | if (kinfo == NULL) | ||
| 49 | return NULL; | ||
| 50 | return kinfo->data; | ||
| 51 | } | ||
| 52 | |||
| 53 | const void *__init __omap_get_config(u16 tag, size_t len, int nr) | ||
| 54 | { | ||
| 55 | return get_config(tag, len, nr, NULL); | ||
| 56 | } | ||
| 57 | |||
| 58 | const void *__init omap_get_var_config(u16 tag, size_t *len) | ||
| 59 | { | ||
| 60 | return get_config(tag, NO_LENGTH_CHECK, 0, len); | ||
| 61 | } | ||
| 62 | |||
| 63 | void __init omap_reserve(void) | ||
| 64 | { | ||
| 65 | omapfb_reserve_sdram_memblock(); | ||
| 66 | omap_vram_reserve_sdram_memblock(); | ||
| 67 | omap_dsp_reserve_sdram_memblock(); | ||
| 68 | } | ||
