[coreboot-gerrit] New patch to review for coreboot: 93c449a Allocator hack for X201

Vladimir Serbinenko (phcoder@gmail.com) gerrit at coreboot.org
Fri Jun 7 02:16:19 CEST 2013


Vladimir Serbinenko (phcoder at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3409

-gerrit

commit 93c449aeebc4d47fcd772cf56e8fc4b72c52b181
Author: Vladimir Serbinenko <phcoder at gmail.com>
Date:   Fri Jun 7 02:14:56 2013 +0200

    Allocator hack for X201
    
    Current allocator allocates framebuffer either over UMA or over pciexbar
    both of which are marked as protected. This ugly hack is just a quick fix,
    not to be committed.
    
    Change-Id: If86b1b02553c5ccc3a0e8067df2de0652ae94221
    Signed-off-by: Vladimir Serbinenko <phcoder at gmail.com>
---
 src/device/device.c | 28 ++++++++++------------------
 1 file changed, 10 insertions(+), 18 deletions(-)

diff --git a/src/device/device.c b/src/device/device.c
index a971270..834e4a9 100644
--- a/src/device/device.c
+++ b/src/device/device.c
@@ -529,6 +529,12 @@ static void allocate_resources(struct bus *bus, struct resource *bridge,
 		       resource->base, (resource->flags & IORESOURCE_IO)
 		       ? "io" : (resource->flags & IORESOURCE_PREFETCH)
 		       ? "prefmem" : "mem");
+		if (resource->base == 0xe0000000
+		    && 	PCI_SLOT(dev->path.pci.devfn) == 0x2)
+		  {
+		    printk (BIOS_ERR, "moving to 0xd0000000\n");
+		    resource->base = 0xd0000000;
+		  }
 	}
 
 	/*
@@ -586,19 +592,14 @@ static void allocate_resources(struct bus *bus, struct resource *bridge,
 	}
 }
 
-#if CONFIG_PCI_64BIT_PREF_MEM
-#define MEM_MASK (IORESOURCE_PREFETCH | IORESOURCE_MEM)
-#else
 #define MEM_MASK (IORESOURCE_MEM)
-#endif
-
 #define IO_MASK   (IORESOURCE_IO)
 #define PREF_TYPE (IORESOURCE_PREFETCH | IORESOURCE_MEM)
 #define MEM_TYPE  (IORESOURCE_MEM)
 #define IO_TYPE   (IORESOURCE_IO)
 
 struct constraints {
-	struct resource pref, io, mem;
+	struct resource io, mem;
 };
 
 static void constrain_resources(struct device *dev, struct constraints* limits)
@@ -622,9 +623,7 @@ static void constrain_resources(struct device *dev, struct constraints* limits)
 		}
 
 		/* PREFETCH, MEM, or I/O - skip any others. */
-		if ((res->flags & MEM_MASK) == PREF_TYPE)
-			lim = &limits->pref;
-		else if ((res->flags & MEM_MASK) == MEM_TYPE)
+		if ((res->flags & MEM_MASK) == MEM_TYPE)
 			lim = &limits->mem;
 		else if ((res->flags & IO_MASK) == IO_TYPE)
 			lim = &limits->io;
@@ -669,11 +668,9 @@ static void avoid_fixed_resources(struct device *dev)
 	printk(BIOS_SPEW, "%s: %s\n", __func__, dev_path(dev));
 
 	/* Initialize constraints to maximum size. */
-	limits.pref.base = 0;
-	limits.pref.limit = 0xffffffffffffffffULL;
 	limits.io.base = 0;
 	limits.io.limit = 0xffffffffffffffffULL;
-	limits.mem.base = 0;
+	limits.mem.base = 0xe0000000;
 	limits.mem.limit = 0xffffffffffffffffULL;
 
 	/* Constrain the limits to dev's initial resources. */
@@ -682,9 +679,6 @@ static void avoid_fixed_resources(struct device *dev)
 			continue;
 		printk(BIOS_SPEW, "%s:@%s %02lx limit %08llx\n", __func__,
 		       dev_path(dev), res->index, res->limit);
-		if ((res->flags & MEM_MASK) == PREF_TYPE &&
-		    (res->limit < limits.pref.limit))
-			limits.pref.limit = res->limit;
 		if ((res->flags & MEM_MASK) == MEM_TYPE &&
 		    (res->limit < limits.mem.limit))
 			limits.mem.limit = res->limit;
@@ -704,9 +698,7 @@ static void avoid_fixed_resources(struct device *dev)
 			continue;
 
 		/* PREFETCH, MEM, or I/O - skip any others. */
-		if ((res->flags & MEM_MASK) == PREF_TYPE)
-			lim = &limits.pref;
-		else if ((res->flags & MEM_MASK) == MEM_TYPE)
+		if ((res->flags & MEM_MASK) == MEM_TYPE)
 			lim = &limits.mem;
 		else if ((res->flags & IO_MASK) == IO_TYPE)
 			lim = &limits.io;



More information about the coreboot-gerrit mailing list