[coreboot-gerrit] Patch set updated for coreboot: c097331 sandybridge: add option to mark graphics memory write-combining.

Aaron Durbin (adurbin@google.com) gerrit at coreboot.org
Tue Mar 26 21:20:27 CET 2013


Aaron Durbin (adurbin at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2894

-gerrit

commit c097331388d94cb554237abcbd60aae1dc5fe395
Author: Aaron Durbin <adurbin at chromium.org>
Date:   Fri Mar 22 22:25:37 2013 -0500

    sandybridge: add option to mark graphics memory write-combining.
    
    The graphics memory can be accessed in a faster manner by
    setting it to write-combing mode.  Add an option to enable
    write-combining for the graphics memory.
    
    Change-Id: I7d37fd78906262aabef92c2b4f4cab0e3f7e4f6d
    Signed-off-by: Aaron Durbin <adurbin at chromium.org>
---
 src/northbridge/intel/sandybridge/Kconfig |  8 ++++++++
 src/northbridge/intel/sandybridge/gma.c   | 21 ++++++++++++++++++++-
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/src/northbridge/intel/sandybridge/Kconfig b/src/northbridge/intel/sandybridge/Kconfig
index 56d2cd7..6c9ae99 100644
--- a/src/northbridge/intel/sandybridge/Kconfig
+++ b/src/northbridge/intel/sandybridge/Kconfig
@@ -107,6 +107,14 @@ config DCACHE_RAM_MRC_VAR_SIZE
 	hex
 	default 0x4000
 
+config MARK_GRAPHICS_MEM_WRCOMB
+	bool "Mark graphics memory as write-combining."
+	default n
+	help
+	 The graphics performance may increase if the graphics
+	 memory is set as write-combining cache type. This option
+	 enables marking the graphics memory as write-combining.
+
 config HAVE_MRC
 	bool "Add a System Agent binary"
 	help
diff --git a/src/northbridge/intel/sandybridge/gma.c b/src/northbridge/intel/sandybridge/gma.c
index b9a07a2..68309d5 100644
--- a/src/northbridge/intel/sandybridge/gma.c
+++ b/src/northbridge/intel/sandybridge/gma.c
@@ -664,12 +664,31 @@ static void gma_set_subsystem(device_t dev, unsigned vendor, unsigned device)
 	}
 }
 
+static void gma_read_resources(struct device *dev)
+{
+	struct resource *res;
+
+	pci_dev_read_resources(dev);
+
+#if CONFIG_MARK_GRAPHICS_MEM_WRCOMB
+	struct resource *res;
+
+	/* Set the graphics memory to write combining. */
+	res = find_resource(dev, PCI_BASE_ADDRESS_2);
+	if (res == NULL) {
+		printk(BIOS_DEBUG, "gma: memory resource not found.\n");
+		return;
+	}
+	res->flags |= IORESOURCE_WRCOMB;
+#endif
+}
+
 static struct pci_operations gma_pci_ops = {
 	.set_subsystem    = gma_set_subsystem,
 };
 
 static struct device_operations gma_func0_ops = {
-	.read_resources		= pci_dev_read_resources,
+	.read_resources		= gma_read_resources,
 	.set_resources		= pci_dev_set_resources,
 	.enable_resources	= pci_dev_enable_resources,
 	.init			= gma_func0_init,



More information about the coreboot-gerrit mailing list