2009-10-26 18:04:28 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the coreboot project.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2009 coresystems GmbH
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; version 2 of the License.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _CBMEM_H_
|
|
|
|
#define _CBMEM_H_
|
|
|
|
|
|
|
|
/* Reserve 64k for ACPI and other tables */
|
2010-12-13 20:50:25 +01:00
|
|
|
#define HIGH_MEMORY_DEF_SIZE ( 64 * 1024 )
|
|
|
|
extern uint64_t high_tables_base, high_tables_size;
|
2009-10-26 18:04:28 +01:00
|
|
|
|
|
|
|
#if CONFIG_HAVE_ACPI_RESUME
|
2010-12-13 20:50:25 +01:00
|
|
|
#define HIGH_MEMORY_SIZE ((CONFIG_RAMTOP - CONFIG_RAMBASE) + HIGH_MEMORY_DEF_SIZE)
|
|
|
|
#define HIGH_MEMORY_SAVE ( HIGH_MEMORY_SIZE - HIGH_MEMORY_DEF_SIZE )
|
2009-10-26 18:04:28 +01:00
|
|
|
#else
|
2010-12-13 20:50:25 +01:00
|
|
|
#define HIGH_MEMORY_SIZE HIGH_MEMORY_DEF_SIZE
|
2009-10-26 18:04:28 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define CBMEM_ID_FREESPACE 0x46524545
|
|
|
|
#define CBMEM_ID_GDT 0x4c474454
|
|
|
|
#define CBMEM_ID_ACPI 0x41435049
|
|
|
|
#define CBMEM_ID_CBTABLE 0x43425442
|
|
|
|
#define CBMEM_ID_PIRQ 0x49525154
|
|
|
|
#define CBMEM_ID_MPTABLE 0x534d5054
|
|
|
|
#define CBMEM_ID_RESUME 0x5245534d
|
2011-08-14 20:56:34 +02:00
|
|
|
#define CBMEM_ID_SMBIOS 0x534d4254
|
2009-10-26 18:04:28 +01:00
|
|
|
#define CBMEM_ID_NONE 0x00000000
|
|
|
|
|
|
|
|
void cbmem_initialize(void);
|
|
|
|
|
|
|
|
void cbmem_init(u64 baseaddr, u64 size);
|
|
|
|
int cbmem_reinit(u64 baseaddr);
|
|
|
|
void *cbmem_add(u32 id, u64 size);
|
|
|
|
void *cbmem_find(u32 id);
|
2009-10-27 15:29:29 +01:00
|
|
|
void cbmem_list(void);
|
|
|
|
void cbmem_arch_init(void);
|
2009-10-26 18:04:28 +01:00
|
|
|
|
2010-12-13 21:02:23 +01:00
|
|
|
extern struct cbmem_entry *get_cbmem_toc(void);
|
|
|
|
|
2010-12-11 23:26:10 +01:00
|
|
|
#ifndef __PRE_RAM__
|
2010-11-22 23:00:52 +01:00
|
|
|
void set_cbmem_toc(struct cbmem_entry *);
|
2009-10-26 18:04:28 +01:00
|
|
|
#endif
|
2010-12-11 23:26:10 +01:00
|
|
|
#endif
|