aboutsummaryrefslogtreecommitdiff
path: root/src/northbridge/intel/i945/ram_calc.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/ram_calc.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/ram_calc.c')
-rw-r--r--src/northbridge/intel/i945/ram_calc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/northbridge/intel/i945/ram_calc.c b/src/northbridge/intel/i945/ram_calc.c
index b161431e15..4349d19ea7 100644
--- a/src/northbridge/intel/i945/ram_calc.c
+++ b/src/northbridge/intel/i945/ram_calc.c
@@ -19,6 +19,7 @@
#include <arch/io.h>
#include <cbmem.h>
#include "i945.h"
+#include <console/console.h>
static uintptr_t smm_region_start(void)
{
@@ -56,3 +57,15 @@ void *cbmem_top(void)
{
return (void *) smm_region_start();
}
+
+/** Decodes used Graphics Mode Select (GMS) to kilobytes. */
+u32 decode_igd_memory_size(const u32 gms)
+{
+ static const u16 ggc2uma[] = { 0, 1, 4, 8, 16, 32,
+ 48, 64 };
+
+ if (gms > ARRAY_SIZE(ggc2uma))
+ die("Bad Graphics Mode Select (GMS) setting.\n");
+
+ return ggc2uma[gms] << 10;
+}