summaryrefslogtreecommitdiffstats
path: root/arch/x86/cpu/qemu/e820.c
diff options
context:
space:
mode:
authorStefano Babic <sbabic@denx.de>2016-06-18 10:24:54 +0200
committerStefano Babic <sbabic@denx.de>2016-06-18 10:25:13 +0200
commitdc557e9a1fe00ca9d884bd88feef5bebf23fede4 (patch)
treeec09fdf8f7c4c44e30f4b38b7459a2cbbb71d094 /arch/x86/cpu/qemu/e820.c
parentd2ba7a6adcef6e6f8c4418c7b0caf9d7ab98a6d4 (diff)
parent6b3943f1b04be60f147ee540fbd72c4c7ea89f80 (diff)
downloadtalos-obmc-uboot-dc557e9a1fe00ca9d884bd88feef5bebf23fede4.tar.gz
talos-obmc-uboot-dc557e9a1fe00ca9d884bd88feef5bebf23fede4.zip
Merge branch 'master' of git://git.denx.de/u-boot
Signed-off-by: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'arch/x86/cpu/qemu/e820.c')
-rw-r--r--arch/x86/cpu/qemu/e820.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/arch/x86/cpu/qemu/e820.c b/arch/x86/cpu/qemu/e820.c
new file mode 100644
index 0000000000..63853e4b22
--- /dev/null
+++ b/arch/x86/cpu/qemu/e820.c
@@ -0,0 +1,43 @@
+/*
+ * (C) Copyright 2015 Miao Yan <yanmiaobest@gmail.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/e820.h>
+
+unsigned install_e820_map(unsigned max_entries, struct e820entry *entries)
+{
+ entries[0].addr = 0;
+ entries[0].size = ISA_START_ADDRESS;
+ entries[0].type = E820_RAM;
+
+ entries[1].addr = ISA_START_ADDRESS;
+ entries[1].size = ISA_END_ADDRESS - ISA_START_ADDRESS;
+ entries[1].type = E820_RESERVED;
+
+ /*
+ * since we use memalign(malloc) to allocate high memory for
+ * storing ACPI tables, we need to reserve them in e820 tables,
+ * otherwise kernel will reclaim them and data will be corrupted
+ */
+ entries[2].addr = ISA_END_ADDRESS;
+ entries[2].size = gd->relocaddr - TOTAL_MALLOC_LEN - ISA_END_ADDRESS;
+ entries[2].type = E820_RAM;
+
+ /* for simplicity, reserve entire malloc space */
+ entries[3].addr = gd->relocaddr - TOTAL_MALLOC_LEN;
+ entries[3].size = TOTAL_MALLOC_LEN;
+ entries[3].type = E820_RESERVED;
+
+ entries[4].addr = gd->relocaddr;
+ entries[4].size = gd->ram_size - gd->relocaddr;
+ entries[4].type = E820_RESERVED;
+
+ entries[5].addr = CONFIG_PCIE_ECAM_BASE;
+ entries[5].size = CONFIG_PCIE_ECAM_SIZE;
+ entries[5].type = E820_RESERVED;
+
+ return 6;
+}
OpenPOWER on IntegriCloud