aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/emulation/qemu-i440fx/memory.c
diff options
context:
space:
mode:
authorPatrick Rudolph <siro@das-labor.org>2018-11-11 12:43:48 +0100
committerRonald G. Minnich <rminnich@gmail.com>2018-11-11 21:23:27 +0000
commit69d5ef9d143afbd9904507dd02d32148c40c6474 (patch)
tree8de2998bbc69565c0db50112b6efbde504bf6cfc /src/mainboard/emulation/qemu-i440fx/memory.c
parentc0a1625df13ac9e95ca4de849ac52bb3af29c7b6 (diff)
mb/emulation/qemu-i440fx|q35: Link memory.c
Link memory.c instead of including it. Change-Id: I2bc461b13332ec5885c33c87828a5fd023f8e730 Signed-off-by: Patrick Rudolph <siro@das-labor.org> Reviewed-on: https://review.coreboot.org/29574 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src/mainboard/emulation/qemu-i440fx/memory.c')
-rw-r--r--src/mainboard/emulation/qemu-i440fx/memory.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/mainboard/emulation/qemu-i440fx/memory.c b/src/mainboard/emulation/qemu-i440fx/memory.c
index b8109e53fb..dea96f275d 100644
--- a/src/mainboard/emulation/qemu-i440fx/memory.c
+++ b/src/mainboard/emulation/qemu-i440fx/memory.c
@@ -14,6 +14,8 @@
*/
#include <cbmem.h>
+#include <arch/io.h>
+#include "memory.h"
#define CMOS_ADDR_PORT 0x70
#define CMOS_DATA_PORT 0x71
@@ -25,12 +27,24 @@
#define MID_HIGHRAM_ADDR 0x5c
#define LOW_HIGHRAM_ADDR 0x5b
-static unsigned long qemu_get_memory_size(void)
+unsigned long qemu_get_high_memory_size(void)
+{
+ unsigned long high;
+ outb(HIGH_HIGHRAM_ADDR, CMOS_ADDR_PORT);
+ high = ((unsigned long) inb(CMOS_DATA_PORT)) << 22;
+ outb(MID_HIGHRAM_ADDR, CMOS_ADDR_PORT);
+ high |= ((unsigned long) inb(CMOS_DATA_PORT)) << 14;
+ outb(LOW_HIGHRAM_ADDR, CMOS_ADDR_PORT);
+ high |= ((unsigned long) inb(CMOS_DATA_PORT)) << 6;
+ return high;
+}
+
+unsigned long qemu_get_memory_size(void)
{
unsigned long tomk;
- outb (HIGH_RAM_ADDR, CMOS_ADDR_PORT);
+ outb(HIGH_RAM_ADDR, CMOS_ADDR_PORT);
tomk = ((unsigned long) inb(CMOS_DATA_PORT)) << 14;
- outb (LOW_RAM_ADDR, CMOS_ADDR_PORT);
+ outb(LOW_RAM_ADDR, CMOS_ADDR_PORT);
tomk |= ((unsigned long) inb(CMOS_DATA_PORT)) << 6;
tomk += 16 * 1024;
return tomk;