2005-07-11 02:58:15 +08:00
|
|
|
/*
|
|
|
|
* linux/arch/arm/plat-omap/common.c
|
|
|
|
*
|
|
|
|
* Code common to all OMAP machines.
|
2009-05-29 05:16:04 +08:00
|
|
|
* The file is created by Tony Lindgren <tony@atomide.com>
|
|
|
|
*
|
|
|
|
* Copyright (C) 2009 Texas Instruments
|
|
|
|
* Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
|
2005-07-11 02:58:15 +08:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/init.h>
|
2008-09-06 19:10:45 +08:00
|
|
|
#include <linux/io.h>
|
2010-05-23 17:18:16 +08:00
|
|
|
#include <linux/omapfb.h>
|
2005-07-11 02:58:15 +08:00
|
|
|
|
2009-10-21 00:40:47 +08:00
|
|
|
#include <plat/common.h>
|
|
|
|
#include <plat/board.h>
|
2010-05-23 17:18:16 +08:00
|
|
|
#include <plat/vram.h>
|
2010-10-05 00:09:14 +08:00
|
|
|
#include <plat/dsp.h>
|
2005-07-11 02:58:15 +08:00
|
|
|
|
2008-03-18 16:04:51 +08:00
|
|
|
|
2005-07-11 02:58:15 +08:00
|
|
|
#define NO_LENGTH_CHECK 0xffffffff
|
|
|
|
|
|
|
|
struct omap_board_config_kernel *omap_board_config;
|
2005-09-08 00:20:26 +08:00
|
|
|
int omap_board_config_size;
|
2005-07-11 02:58:15 +08:00
|
|
|
|
|
|
|
static const void *get_config(u16 tag, size_t len, int skip, size_t *len_out)
|
|
|
|
{
|
|
|
|
struct omap_board_config_kernel *kinfo = NULL;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
/* Try to find the config from the board-specific structures
|
|
|
|
* in the kernel. */
|
|
|
|
for (i = 0; i < omap_board_config_size; i++) {
|
|
|
|
if (omap_board_config[i].tag == tag) {
|
2006-12-08 05:58:10 +08:00
|
|
|
if (skip == 0) {
|
|
|
|
kinfo = &omap_board_config[i];
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
skip--;
|
|
|
|
}
|
2005-07-11 02:58:15 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if (kinfo == NULL)
|
|
|
|
return NULL;
|
|
|
|
return kinfo->data;
|
|
|
|
}
|
|
|
|
|
|
|
|
const void *__omap_get_config(u16 tag, size_t len, int nr)
|
|
|
|
{
|
|
|
|
return get_config(tag, len, nr, NULL);
|
|
|
|
}
|
|
|
|
EXPORT_SYMBOL(__omap_get_config);
|
|
|
|
|
|
|
|
const void *omap_get_var_config(u16 tag, size_t *len)
|
|
|
|
{
|
|
|
|
return get_config(tag, NO_LENGTH_CHECK, 0, len);
|
|
|
|
}
|
|
|
|
EXPORT_SYMBOL(omap_get_var_config);
|
|
|
|
|
2010-05-23 17:18:16 +08:00
|
|
|
void __init omap_reserve(void)
|
|
|
|
{
|
2010-05-23 06:59:11 +08:00
|
|
|
omapfb_reserve_sdram_memblock();
|
|
|
|
omap_vram_reserve_sdram_memblock();
|
2010-10-05 00:09:14 +08:00
|
|
|
omap_dsp_reserve_sdram_memblock();
|
2010-05-23 17:18:16 +08:00
|
|
|
}
|