aboutsummaryrefslogtreecommitdiff
path: root/src/northbridge/intel/x4x/early_init.c
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2017-09-22 12:22:24 +0200
committerFelix Held <felix-coreboot@felixheld.de>2018-05-01 17:42:30 +0000
commit16a70a48c68f9027b0900e15fc9e3bc14391ad44 (patch)
tree70409c259f50e463913d068a00d1e0f600f8a578 /src/northbridge/intel/x4x/early_init.c
parentdfce932cf0c3d13f41892d6e40d56fbaa8e16240 (diff)
nb/intel/x4x: Change memory layout to improve MTRR
This change also makes sure that the sum the uma regions (TSEG, GSM, GSM) is 4MiB aligned. This is needed to avoid cbmem_top floating between 2 usable ram region, since cbmem_top is aligned 4MiB down to easy MTRR setup for ramstage. At least tianocore requires this and fails to boot without it. Better MTRR are achieved by making the memory 'hole' till 4GiB exactly 2Gib. This code mimics how it is done in nb/intel/gm45 and achieves similar results. TSEG is enabled and set to 8M since this makes it easier to reuse the common smm setup / parallel mp code and makes it possible to cache the ramstage in there like how it's done on newer targets. TESTED on Intel DG43GT. Change-Id: I1b5ea04d9b7d5494a30aa7156d8c17170e77b8ad Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/21634 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
Diffstat (limited to 'src/northbridge/intel/x4x/early_init.c')
-rw-r--r--src/northbridge/intel/x4x/early_init.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/northbridge/intel/x4x/early_init.c b/src/northbridge/intel/x4x/early_init.c
index ab4864b880..d410259d82 100644
--- a/src/northbridge/intel/x4x/early_init.c
+++ b/src/northbridge/intel/x4x/early_init.c
@@ -74,7 +74,11 @@ void x4x_early_init(void)
get_option(&gfxsize, "gfx_uma_size");
if (gfxsize > 12)
gfxsize = 6;
- pci_write_config16(d0f0, D0F0_GGC, 0x0100 | (gfxsize + 1) << 4);
+ /* Need at least 4M for cbmem_top alignment */
+ else if (gfxsize < 1)
+ gfxsize = 1;
+ /* Set GTT size to 2+2M */
+ pci_write_config16(d0f0, D0F0_GGC, 0x0b00 | (gfxsize + 1) << 4);
} else { /* Does not feature internal graphics */
pci_write_config32(d0f0, D0F0_DEVEN, D0EN | D1EN | PEG1EN);
pci_write_config16(d0f0, D0F0_GGC, (1 << 1));