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>
This commit is contained in:
Patrick Rudolph 2018-11-11 12:43:48 +01:00 committed by Ronald G. Minnich
parent c0a1625df1
commit 69d5ef9d14
7 changed files with 48 additions and 19 deletions

View File

@ -1,3 +1,5 @@
cpu_incs-y += $(src)/mainboard/emulation/qemu-i440fx/cache_as_ram.inc
ramstage-y += northbridge.c
ramstage-y += fw_cfg.c
romstage-y += memory.c
ramstage-y += memory.c

View File

@ -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;

View File

@ -0,0 +1,24 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2004 Stefan Reinauer <stefan.reinauer@coreboot.org>
* Copyright (C) 2018 Patrick Rudolph <siro@das-labor.org>
*
* 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.
*/
#ifndef __QEMU_MEMORY_H_
#define __QEMU_MEMORY_H_
unsigned long qemu_get_high_memory_size(void);
unsigned long qemu_get_memory_size(void);
#endif

View File

@ -23,26 +23,13 @@
#include <string.h>
#include <delay.h>
#include <smbios.h>
#include <cbmem.h>
#include "memory.h"
#include "fw_cfg.h"
#include "fw_cfg_if.h"
#include "memory.c"
#include "acpi.h"
static 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;
}
static void qemu_reserve_ports(struct device *dev, unsigned int idx,
unsigned int base, unsigned int size,
const char *name)

View File

@ -18,6 +18,7 @@
#include <device/pci_ids.h>
#include <arch/io.h>
#include <device/pnp_def.h>
#include <cbmem.h>
#include <console/console.h>
#include <cpu/x86/bist.h>
#include <cpu/intel/romstage.h>
@ -25,7 +26,6 @@
#include <delay.h>
#include <cpu/x86/lapic.h>
#include "memory.c"
void *asmlinkage romstage_main(unsigned long bist)
{

View File

@ -1,3 +1,5 @@
cpu_incs-y += $(src)/mainboard/emulation/qemu-i440fx/cache_as_ram.inc
ramstage-y += ../qemu-i440fx/northbridge.c
ramstage-y += ../qemu-i440fx/memory.c
ramstage-y += ../qemu-i440fx/fw_cfg.c
romstage-y += ../qemu-i440fx/memory.c

View File

@ -19,6 +19,7 @@
#include <arch/io.h>
#include <device/pnp_def.h>
#include <pc80/mc146818rtc.h>
#include <cbmem.h>
#include <console/console.h>
#include <southbridge/intel/i82801ix/i82801ix.h>
#include <cpu/x86/bist.h>
@ -27,7 +28,6 @@
#include <delay.h>
#include <cpu/x86/lapic.h>
#include "../qemu-i440fx/memory.c"
void * asmlinkage romstage_main(unsigned long bist)
{