Commit 24e873af authored by Len Brown's avatar Len Brown Committed by Len Brown

[ACPI] reserve EBDA for Dell BIOS that neglects to. (David Shaohua Li)

http://bugme.osdl.org/show_bug.cgi?id=2990
parent e8a4a26a
......@@ -49,6 +49,7 @@
#include <asm/ist.h>
#include <asm/std_resources.h>
#include "setup_arch_pre.h"
#include <bios_ebda.h>
/* This value is set up by the early boot code to point to the value
immediately after the boot time page tables. It contains a *physical*
......@@ -808,6 +809,17 @@ static void __init register_bootmem_low_pages(unsigned long max_low_pfn)
}
}
/*
* workaround for Dell systems that neglect to reserve EBDA
*/
static void __init reserve_ebda_region(void)
{
unsigned int addr;
addr = get_bios_ebda();
if (addr)
reserve_bootmem(addr, PAGE_SIZE);
}
static unsigned long __init setup_memory(void)
{
unsigned long bootmap_size, start_pfn, max_low_pfn;
......@@ -854,6 +866,9 @@ static unsigned long __init setup_memory(void)
*/
reserve_bootmem(0, PAGE_SIZE);
/* reserve EBDA region, it's a 4K region */
reserve_ebda_region();
/* could be an AMD 768MPX chipset. Reserve a page before VGA to prevent
PCI prefetch into it (errata #56). Usually the page is reserved anyways,
unless you have no PS/2 mouse plugged in. */
......
......@@ -31,6 +31,7 @@
#include <asm/e820.h>
#include <asm/setup.h>
#include <asm/mmzone.h>
#include <bios_ebda.h>
struct pglist_data *node_data[MAX_NUMNODES];
bootmem_data_t node0_bdata;
......@@ -227,6 +228,17 @@ static unsigned long calculate_numa_remap_pages(void)
return reserve_pages;
}
/*
* workaround for Dell systems that neglect to reserve EBDA
*/
static void __init reserve_ebda_region_node(void)
{
unsigned int addr;
addr = get_bios_ebda();
if (addr)
reserve_bootmem_node(NODE_DATA(0), addr, PAGE_SIZE);
}
unsigned long __init setup_memory(void)
{
int nid;
......@@ -301,6 +313,9 @@ unsigned long __init setup_memory(void)
*/
reserve_bootmem_node(NODE_DATA(0), PAGE_SIZE, PAGE_SIZE);
/* reserve EBDA region, it's a 4K region */
reserve_ebda_region_node();
#ifdef CONFIG_ACPI_SLEEP
/*
* Reserve low memory region for sleep support.
......
......@@ -422,6 +422,20 @@ static inline void copy_edd(void)
#define copy_edd() do {} while (0)
#endif
#define EBDA_ADDR_POINTER 0x40E
static void __init reserve_ebda_region(void)
{
unsigned int addr;
/**
* there is a real-mode segmented pointer pointing to the
* 4K EBDA area at 0x40E
*/
addr = *(unsigned short *)phys_to_virt(EBDA_ADDR_POINTER);
addr <<= 4;
if (addr)
reserve_bootmem_generic(addr, PAGE_SIZE);
}
void __init setup_arch(char **cmdline_p)
{
unsigned long low_mem_size;
......@@ -486,6 +500,9 @@ void __init setup_arch(char **cmdline_p)
*/
reserve_bootmem_generic(0, PAGE_SIZE);
/* reserve ebda region */
reserve_ebda_region();
#ifdef CONFIG_SMP
/*
* But first pinch a few for the stack/trampoline stuff
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment