aboutsummaryrefslogtreecommitdiff
path: root/src/northbridge/intel/i945/early_init.c
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2016-05-19 16:06:09 +0200
committerMartin Roth <martinroth@google.com>2016-08-31 20:01:05 +0200
commit874a8f961ff537bc12cfca3d9937a07fcda2fe6e (patch)
treee9c9c1ba17c4ec15b5401a03350f06cf21a43c40 /src/northbridge/intel/i945/early_init.c
parent868cd7128262ca8442301c2910ed843ab3f193ff (diff)
i945: Enable changing VRAM size
On i945 the vram size is the default 8mb. It is also possible to set it 1mb or 0mb hardcoding the GGC register in early_init.c The intel documentation on i945, "Mobile IntelĀ® 945 Express Chipset Family datasheet june 2008" only documents those three options. They are set using 3 bits. The documententation also makes mention of 4mb, 16mb, 32mb, 48mb, 64mb but not how to set it. The other non documented (straight forward) bit combinations allow to change the VRAM size to those other states. What this patch does is: - add those undocumented registers with their respective vram size to the i945 NB code; - make this a cmos option on targets that have this northbridge. TEST: build, flash to target, set cmos as desired and boot linux. On Debian it can be found using "dmesg | grep stolen". NOTE: dmesg message about reserved vram are quite different depending on linux version Change-Id: Ia71367ae3efb51bd64affd728407b8386e74594f Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/14819 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/northbridge/intel/i945/early_init.c')
-rw-r--r--src/northbridge/intel/i945/early_init.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/northbridge/intel/i945/early_init.c b/src/northbridge/intel/i945/early_init.c
index ade120f442..f4d091696e 100644
--- a/src/northbridge/intel/i945/early_init.c
+++ b/src/northbridge/intel/i945/early_init.c
@@ -23,6 +23,7 @@
#include <halt.h>
#include <string.h>
#include "i945.h"
+#include <pc80/mc146818rtc.h>
int i945_silicon_revision(void)
{
@@ -145,7 +146,7 @@ static void i945_detect_chipset(void)
static void i945_setup_bars(void)
{
- u8 reg8;
+ u8 reg8, gfxsize;
/* As of now, we don't have all the A0 workarounds implemented */
if (i945_silicon_revision() == 0)
@@ -178,10 +179,13 @@ static void i945_setup_bars(void)
pci_write_config32(PCI_DEV(0, 0x00, 0), DMIBAR, (uintptr_t)DEFAULT_DMIBAR | 1);
pci_write_config32(PCI_DEV(0, 0x00, 0), X60BAR, DEFAULT_X60BAR | 1);
- /* Hardware default is 8MB UMA. If someone wants to make this a
- * CMOS or compile time option, send a patch.
- * pci_write_config16(PCI_DEV(0, 0x00, 0), GGC, 0x30);
- */
+ /* vram size from cmos option */
+ if (get_option(&gfxsize, "gfx_uma_size") != CB_SUCCESS)
+ gfxsize = 2; /* 2 for 8MB */
+ /* make sure no invalid setting is used */
+ if (gfxsize > 6)
+ gfxsize = 2;
+ pci_write_config16(PCI_DEV(0, 0x00, 0), GGC, ((gfxsize + 1) << 4));
/* Set C0000-FFFFF to access RAM on both reads and writes */
pci_write_config8(PCI_DEV(0, 0x00, 0), PAM0, 0x30);