mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
Read actual memory size in qemu-i386
Signed-Off-By: Patrick Georgi <patrick@georgi-clan.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://coreboot.org/repository/coreboot-v3@947 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
parent
932667384b
commit
e0ab3a5564
2 changed files with 15 additions and 4 deletions
|
@ -19,6 +19,5 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
{
|
{
|
||||||
ramsize = "128";
|
|
||||||
device_operations = "i440bx_domain";
|
device_operations = "i440bx_domain";
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (C) 2000 Ron Minnich, Advanced Computing Lab, LANL
|
* Copyright (C) 2000 Ron Minnich, Advanced Computing Lab, LANL
|
||||||
* Copyright (C) 2007 Ronald G. Minnich <rminnich@gmail.com>
|
* Copyright (C) 2007 Ronald G. Minnich <rminnich@gmail.com>
|
||||||
|
* Copyright (C) 2008 Patrick Georgi <patrick@georgi-clan.de>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -43,19 +44,30 @@
|
||||||
#include <device/device.h>
|
#include <device/device.h>
|
||||||
#include <device/pci.h>
|
#include <device/pci.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <io.h>
|
||||||
#include "i440bx.h"
|
#include "i440bx.h"
|
||||||
#include <statictree.h>
|
#include <statictree.h>
|
||||||
|
|
||||||
/* Here are the ops for 440BX as a PCI domain. */
|
/* Here are the ops for 440BX as a PCI domain. */
|
||||||
|
|
||||||
|
static int inb_cmos(int port)
|
||||||
|
{
|
||||||
|
outb(port, 0x70);
|
||||||
|
return inb(0x71);
|
||||||
|
}
|
||||||
|
|
||||||
static void pci_domain_set_resources(struct device *dev)
|
static void pci_domain_set_resources(struct device *dev)
|
||||||
{
|
{
|
||||||
struct device *mc_dev;
|
struct device *mc_dev;
|
||||||
u32 tolmk; /* Top of low mem, Kbytes. */
|
u32 tolmk; /* Top of low mem, Kbytes. */
|
||||||
int idx;
|
int idx;
|
||||||
struct northbridge_intel_i440bxemulation_domain_config *device_configuration =
|
/* read large mem memory descriptor
|
||||||
dev->device_configuration;
|
for <16 MB read the more detailed small mem descriptor
|
||||||
tolmk = device_configuration->ramsize * 1024;
|
all values in kbytes */
|
||||||
|
tolmk = ((inb_cmos(0x35)<<8) |inb_cmos(0x34)) * 64;
|
||||||
|
if (tolmk <= 16 * 1024) {
|
||||||
|
tolmk = (inb_cmos(0x31)<<8) |inb_cmos(0x30);
|
||||||
|
}
|
||||||
printk(BIOS_WARNING, "Ignoring chipset specified RAM size. Using dts "
|
printk(BIOS_WARNING, "Ignoring chipset specified RAM size. Using dts "
|
||||||
"settings of %d kB instead.\n", tolmk);
|
"settings of %d kB instead.\n", tolmk);
|
||||||
mc_dev = dev->link[0].children;
|
mc_dev = dev->link[0].children;
|
||||||
|
|
Loading…
Add table
Reference in a new issue