Kyösti Mälkki (kyosti.malkki(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1215
-gerrit
commit fa5c01a4d7ecff7d3a4c0bd3050647bcbfcd697f
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Thu Jul 12 00:18:22 2012 +0300
Check for IORESOURCE_UMA_FB in MTRR setup
If northbridge called uma_resource() a resource of this type
should be found when walking the resources list.
For now, be rude and don't even try to combine it with
neighboring regions. As the type is un-cacheable it is
dominant over other MTRR setups claiming the same region.
Change-Id: I57805e7e7da0709f8ed78d8df62c2abf22172a06
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
---
src/cpu/x86/mtrr/mtrr.c | 28 +++++++++++++---------------
1 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/src/cpu/x86/mtrr/mtrr.c b/src/cpu/x86/mtrr/mtrr.c
index 1ffec0e..77fdb6f 100644
--- a/src/cpu/x86/mtrr/mtrr.c
+++ b/src/cpu/x86/mtrr/mtrr.c
@@ -352,8 +352,20 @@ void set_var_mtrr_resource(void *gp, struct device *dev, struct resource *res)
unsigned long basek, sizek;
if (state->reg >= bios_mtrrs)
return;
+
basek = resk(res->base);
sizek = resk(res->size);
+
+ if (res->flags & IORESOURCE_UMA_FB) {
+ /* FIXME: could I use Write-Combining for Frame Buffer ? */
+ state->reg = range_to_mtrr(state->reg, basek, sizek, 0,
+ MTRR_TYPE_UNCACHEABLE, state->address_bits, state->above4gb);
+ return;
+ }
+
+ if (!(res->flags & IORESOURCE_CACHEABLE))
+ return;
+
/* See if I can merge with the last range
* Either I am below 1M and the fixed mtrrs handle it, or
* the ranges touch.
@@ -451,23 +463,9 @@ void x86_setup_var_mtrrs(unsigned int address_bits, unsigned int above4gb)
if (above4gb == 2)
detect_var_mtrrs();
- search_global_resources(
- IORESOURCE_MEM | IORESOURCE_CACHEABLE, IORESOURCE_MEM | IORESOURCE_CACHEABLE,
+ search_global_resources(IORESOURCE_MEM, IORESOURCE_MEM,
set_var_mtrr_resource, &var_state);
-#if CONFIG_GFXUMA /* UMA or SP. */
- /* For now we assume the UMA space is at the end of memory below 4GB */
- if (var_state.hole_startk || var_state.hole_sizek) {
- printk(BIOS_DEBUG, "Warning: Can't set up MTRR hole for UMA due to pre-existing MTRR hole.\n");
- } else {
- // Increase the base range and set up UMA as an UC hole instead
- if (above4gb != 2)
- var_state.range_sizek += (uma_memory_size >> 10);
-
- var_state.hole_startk = (uma_memory_base >> 10);
- var_state.hole_sizek = (uma_memory_size >> 10);
- }
-#endif
/* Write the last range */
var_state.reg = range_to_mtrr(var_state.reg, var_state.range_startk,
var_state.range_sizek, 0, MTRR_TYPE_WRBACK,
Kyösti Mälkki (kyosti.malkki(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1214
-gerrit
commit 688a6ffbb683d0f12c184f5536214c12486edc00
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Wed Jul 11 23:14:49 2012 +0300
Change uma_resource() to use new type IORESOURCE_UMA_FB.
MTRR setup code can detect this and mark it as UC/WT/WC as suitable
for the specific hardware.
Change-Id: Ib7a3d450fc7c19e3ca72767dfb350412dd35c971
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
---
src/devices/device_util.c | 2 +-
src/include/device/resource.h | 2 ++
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/src/devices/device_util.c b/src/devices/device_util.c
index 4e25eb1..6c10b65 100644
--- a/src/devices/device_util.c
+++ b/src/devices/device_util.c
@@ -833,7 +833,7 @@ void uma_resource(device_t dev, unsigned long index,
resource = new_resource(dev, index);
resource->base = ((resource_t)basek) << 10;
resource->size = ((resource_t)sizek) << 10;
- resource->flags = IORESOURCE_MEM | IORESOURCE_RESERVE |
+ resource->flags = IORESOURCE_MEM | IORESOURCE_RESERVE | IORESOURCE_UMA_FB |
IORESOURCE_FIXED | IORESOURCE_STORED | IORESOURCE_ASSIGNED;
}
diff --git a/src/include/device/resource.h b/src/include/device/resource.h
index ef95b53..e667f91 100644
--- a/src/include/device/resource.h
+++ b/src/include/device/resource.h
@@ -20,6 +20,8 @@
* to the bus below.
*/
#define IORESOURCE_BRIDGE 0x00080000 /* The IO resource has a bus below it. */
+#define IORESOURCE_UMA_FB 0x00100000 /* UMA framebuffer */
+
#define IORESOURCE_RESERVE 0x10000000 /* The resource needs to be reserved in the coreboot table */
#define IORESOURCE_STORED 0x20000000 /* The IO resource assignment has been stored in the device */
#define IORESOURCE_ASSIGNED 0x40000000 /* An IO resource that has been assigned a value */
Sven Schnelle (svens(a)stackframe.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1212
-gerrit
commit c0da995d1c10799eddfc450436d35358eacb619c
Author: Sven Schnelle <svens(a)stackframe.org>
Date: Wed Jul 11 21:41:06 2012 +0200
Fix stack assignment during CPU initialization
There are two errors in the code. The first one is a missing
$ sign in mov _stack, %esp. Thanks to Ronald G Minnich for
catching that bug.
The second bug is the 'incl %eax', which shouldn't be there, as
there's no secondary CPU with index 0. CPU0 uses always the stack
below _estack.
Change-Id: Id267a654ba95b0e898eeaaafb2403b438250a563
Signed-off-by: Sven Schnelle <svens(a)stackframe.org>
---
src/cpu/x86/lapic/secondary.S | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/src/cpu/x86/lapic/secondary.S b/src/cpu/x86/lapic/secondary.S
index 15bae5e..e6650ec 100644
--- a/src/cpu/x86/lapic/secondary.S
+++ b/src/cpu/x86/lapic/secondary.S
@@ -53,10 +53,9 @@ __ap_protected_start:
movl $1, %eax
lock xadd %eax, cpucount
movl %eax, %ecx
- incl %eax
/* assign stack for this specific cpu */
- mov _stack, %esp
+ mov $_stack, %esp
mov $CONFIG_STACK_SIZE, %ebx
mul %ebx
add %eax, %esp