blob: 6f40d4e48524191b245a6a0d68a5b47c56061b7e [file] [log] [blame]
Stefan Reinauer3b314022009-10-26 17:04:28 +00001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2009 coresystems GmbH
5 *
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; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
18 */
19
20#ifndef _CBMEM_H_
21#define _CBMEM_H_
22
23/* Reserve 64k for ACPI and other tables */
24#define HIGH_MEMORY_TABLES ( 64 * 1024 )
25
26#if CONFIG_HAVE_ACPI_RESUME
Rudolf Marekbcaea142010-11-22 22:00:52 +000027#define HIGH_MEMORY_SIZE ((CONFIG_RAMTOP - CONFIG_RAMBASE) + HIGH_MEMORY_TABLES)
Stefan Reinauer3b314022009-10-26 17:04:28 +000028#define HIGH_MEMORY_SAVE ( HIGH_MEMORY_SIZE - HIGH_MEMORY_TABLES )
29#else
30#define HIGH_MEMORY_SIZE HIGH_MEMORY_TABLES
31#endif
32
33#define CBMEM_ID_FREESPACE 0x46524545
34#define CBMEM_ID_GDT 0x4c474454
35#define CBMEM_ID_ACPI 0x41435049
36#define CBMEM_ID_CBTABLE 0x43425442
37#define CBMEM_ID_PIRQ 0x49525154
38#define CBMEM_ID_MPTABLE 0x534d5054
39#define CBMEM_ID_RESUME 0x5245534d
40#define CBMEM_ID_NONE 0x00000000
41
42void cbmem_initialize(void);
43
44void cbmem_init(u64 baseaddr, u64 size);
45int cbmem_reinit(u64 baseaddr);
46void *cbmem_add(u32 id, u64 size);
47void *cbmem_find(u32 id);
Maciej Pijankaea921852009-10-27 14:29:29 +000048void cbmem_list(void);
49void cbmem_arch_init(void);
Stefan Reinauer3b314022009-10-26 17:04:28 +000050
Rudolf Marek33109342010-12-11 22:26:10 +000051#ifndef __PRE_RAM__
Rudolf Marekbcaea142010-11-22 22:00:52 +000052struct cbmem_entry *get_cbmem_toc(void);
53void set_cbmem_toc(struct cbmem_entry *);
Stefan Reinauer3b314022009-10-26 17:04:28 +000054#endif
Rudolf Marek33109342010-12-11 22:26:10 +000055#endif