]>
git.ipfire.org Git - thirdparty/u-boot.git/blob - arch/x86/cpu/qemu/e820.c
1 // SPDX-License-Identifier: GPL-2.0+
3 * (C) Copyright 2015 Miao Yan <yanmiaobest@gmail.com>
9 DECLARE_GLOBAL_DATA_PTR
;
11 unsigned int install_e820_map(unsigned int max_entries
,
12 struct e820_entry
*entries
)
15 entries
[0].size
= ISA_START_ADDRESS
;
16 entries
[0].type
= E820_RAM
;
18 entries
[1].addr
= ISA_START_ADDRESS
;
19 entries
[1].size
= ISA_END_ADDRESS
- ISA_START_ADDRESS
;
20 entries
[1].type
= E820_RESERVED
;
23 * since we use memalign(malloc) to allocate high memory for
24 * storing ACPI tables, we need to reserve them in e820 tables,
25 * otherwise kernel will reclaim them and data will be corrupted
27 entries
[2].addr
= ISA_END_ADDRESS
;
28 entries
[2].size
= gd
->relocaddr
- TOTAL_MALLOC_LEN
- ISA_END_ADDRESS
;
29 entries
[2].type
= E820_RAM
;
31 /* for simplicity, reserve entire malloc space */
32 entries
[3].addr
= gd
->relocaddr
- TOTAL_MALLOC_LEN
;
33 entries
[3].size
= TOTAL_MALLOC_LEN
;
34 entries
[3].type
= E820_RESERVED
;
36 entries
[4].addr
= gd
->relocaddr
;
37 entries
[4].size
= gd
->ram_size
- gd
->relocaddr
;
38 entries
[4].type
= E820_RESERVED
;
40 entries
[5].addr
= CONFIG_PCIE_ECAM_BASE
;
41 entries
[5].size
= CONFIG_PCIE_ECAM_SIZE
;
42 entries
[5].type
= E820_RESERVED
;