diff options
author | Jason Baron <jbaron@redhat.com> | 2012-11-28 10:17:30 +0100 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2012-12-01 23:18:23 -0500 |
commit | a39a9c382beafc5b91e4256854870a4a6349313e (patch) | |
tree | bb7981622e35edc61111db4c44fe1125bc5746a2 /src | |
parent | 8b73b838de25aaf04ff0d397855b1eecd0443e98 (diff) | |
download | seabios-hppa-a39a9c382beafc5b91e4256854870a4a6349313e.zip seabios-hppa-a39a9c382beafc5b91e4256854870a4a6349313e.tar.gz seabios-hppa-a39a9c382beafc5b91e4256854870a4a6349313e.tar.bz2 |
seabios: make mttr UC area setup dynamic
Set up the UC area of mtrr dynamically based on mtrr_base. This allows
the bios to work for other chipsets that might want to set the mtrr.
Since BUILD_MAX_HIGHMEM is no longer used we can remove the config parameter.
This change reverses the order of pci_setup() and smm_init() with
mtrr_setup().
Signed-off-by: Jason Baron <jbaron@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/config.h | 1 | ||||
-rw-r--r-- | src/mtrr.c | 5 | ||||
-rw-r--r-- | src/post.c | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/config.h b/src/config.h index 0d4066d..71c0b7e 100644 --- a/src/config.h +++ b/src/config.h @@ -44,7 +44,6 @@ #define BUILD_SMM_INIT_ADDR 0x38000 #define BUILD_SMM_ADDR 0xa8000 #define BUILD_SMM_SIZE 0x8000 -#define BUILD_MAX_HIGHMEM 0xe0000000 #define BUILD_PCIMEM_START 0xe0000000 #define BUILD_PCIMEM_END 0xfec00000 /* IOAPIC is mapped at */ @@ -7,6 +7,7 @@ #include "util.h" // dprintf #include "config.h" // CONFIG_* #include "xen.h" // usingXen +#include "pci.h" // pcimem_start #define MSR_MTRRcap 0x000000fe #define MSR_MTRRfix64K_00000 0x00000250 @@ -94,9 +95,9 @@ void mtrr_setup(void) wrmsr_smp(MTRRphysMask_MSR(i), 0); } /* Mark 3.5-4GB as UC, anything not specified defaults to WB */ - wrmsr_smp(MTRRphysBase_MSR(0), BUILD_MAX_HIGHMEM | MTRR_MEMTYPE_UC); + wrmsr_smp(MTRRphysBase_MSR(0), pcimem_start | MTRR_MEMTYPE_UC); wrmsr_smp(MTRRphysMask_MSR(0) - , (-((1ull<<32)-BUILD_MAX_HIGHMEM) & phys_mask) | 0x800); + , (-((1ull<<32)-pcimem_start) & phys_mask) | 0x800); // Enable fixed and variable MTRRs; set default type. wrmsr_smp(MSR_MTRRdefType, 0xc00 | MTRR_MEMTYPE_WB); @@ -230,13 +230,13 @@ maininit(void) timer_setup(); mathcp_setup(); - // Initialize mtrr - mtrr_setup(); - // Initialize pci pci_setup(); smm_init(); + // Initialize mtrr + mtrr_setup(); + // Setup Xen hypercalls xen_init_hypercalls(); |