Timothy Pearson (tpearson(a)raptorengineeringinc.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8268
-gerrit
commit 3b0a7a5a2e1d83d95d3b179becca77ff124df5f1
Author: Timothy Pearson <tpearson(a)raptorengineeringinc.com>
Date: Fri Jan 23 20:28:13 2015 -0600
Fix multiprocessor support not being compiled in when selected via Kconfig on AMD systems
Change-Id: I44c22f2e11096247285b0fb469ccf51963eace2b
Signed-off-by: Timothy Pearson <tpearson(a)raptorengineeringinc.com>
---
src/northbridge/amd/amdht/ht_wrapper.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/northbridge/amd/amdht/ht_wrapper.c b/src/northbridge/amd/amdht/ht_wrapper.c
index 5742494..6a01e14 100644
--- a/src/northbridge/amd/amdht/ht_wrapper.c
+++ b/src/northbridge/amd/amdht/ht_wrapper.c
@@ -1,6 +1,7 @@
/*
* This file is part of the coreboot project.
*
+ * Copyright (C) 2015 Timothy Pearson <tpearson(a)raptorengineeringinc.com>, Raptor Engineering
* Copyright (C) 2007-2008 Advanced Micro Devices, Inc.
*
* This program is free software; you can redistribute it and/or modify
@@ -28,7 +29,7 @@
*/
/* Single CPU system? */
-#if CONFIG_MAX_PHYSICAL_CPUS
+#if (CONFIG_MAX_PHYSICAL_CPUS == 1)
#define HT_BUILD_NC_ONLY 1
#endif
Timothy Pearson (tpearson(a)raptorengineeringinc.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8262
-gerrit
commit 723406ca7d7305a25fc3585e7762c67a60659a0c
Author: Timothy Pearson <tpearson(a)raptorengineeringinc.com>
Date: Fri Jan 23 20:22:56 2015 -0600
Fix typo in comment
Change-Id: Ib63a8b6e7f4663926104426992f6dea9ee3510b0
Signed-off-by: Timothy Pearson <tpearson(a)raptorengineeringinc.com>
---
src/device/hypertransport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/device/hypertransport.c b/src/device/hypertransport.c
index d9ab486..88a5fc6 100644
--- a/src/device/hypertransport.c
+++ b/src/device/hypertransport.c
@@ -512,7 +512,7 @@ unsigned int hypertransport_scan_chain(struct bus *bus, unsigned min_devfn,
flags = pci_read_config16(dev, pos + PCI_CAP_FLAGS);
/*
- * If the devices has a unitid set and is at devfn 0 we are
+ * If the device has a unitid set and is at devfn 0 we are
* done. This can happen with shadow hypertransport devices,
* or if we have reached the bottom of a HT device chain.
*/
Timothy Pearson (tpearson(a)raptorengineeringinc.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8261
-gerrit
commit 5ca5f55b182fdbb08bda646033c2fb80ed67b69d
Author: Timothy Pearson <tpearson(a)raptorengineeringinc.com>
Date: Fri Jan 23 20:20:56 2015 -0600
Fix incorrect PCI register space location causing corruption with more than ~3.5GB physical RAM on AMD Family 10h systems
Tested with 8GB physical RAM
Change-Id: I66d1bfa1e977a6b492c1909079087a801c7e6a3a
Signed-off-by: Timothy Pearson <tpearson(a)raptorengineeringinc.com>
---
src/device/device.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/src/device/device.c b/src/device/device.c
index 00e323a..a251568 100644
--- a/src/device/device.c
+++ b/src/device/device.c
@@ -13,6 +13,7 @@
* (Written by Yinghai Lu <yhlu(a)tyan.com> for Tyan)
* Copyright (C) 2005-2006 Stefan Reinauer <stepan(a)openbios.org>
* Copyright (C) 2009 Myles Watson <mylesgw(a)gmail.com>
+ * Copyright (C) 2015 Timothy Pearson <tpearson(a)raptorengineeringinc.com>, Raptor Engineering
*/
/*
@@ -669,11 +670,14 @@ static void constrain_resources(struct device *dev, struct constraints* limits)
* signed so that "negative" amounts of space are handled
* correctly.
*/
+
if ((signed long long)(lim->limit - (res->base + res->size -1))
- > (signed long long)(res->base - lim->base))
+ > (signed long long)(res->base - lim->base)) {
lim->base = res->base + res->size;
- else
+ }
+ else {
lim->limit = res->base -1;
+ }
}
/* Descend into every enabled child and look for fixed resources. */
@@ -712,6 +716,20 @@ static void avoid_fixed_resources(struct device *dev)
if ((res->flags & MEM_MASK) == MEM_TYPE &&
(res->limit < limits.mem.limit))
limits.mem.limit = res->limit;
+ // Shrink possible PCI address space to the resource specified value
+ // Without this the PCI address space attempts to reserve roughly all 32-bit addressable RAM,
+ // leading to allocation below the AMD fixed resource window instead of above it. When allocated
+ // below the fixed resource window it is not protected by the e820 map and the PCI configuration
+ // is overwritten, causing all PCI devices to become unusable!
+ // This bug is only exposed when the top of system RAM touches the bottom of the fixed resource window.
+ // If less than ~3.5GB of memory is installed there is a gap between system RAM and the fixed resource window
+ // which protects the incorrectly allocated PCI configuration registers and hides this bug.
+ // On non-AMD systems this may not matter as much, but the code below is generic and should not harm other systems.
+ if ((res->flags & MEM_MASK) == MEM_TYPE &&
+ (res->size < (limits.mem.limit - limits.mem.base + 1))) {
+ limits.mem.base = (limits.mem.limit - res->size + 1);
+ limits.mem.size = res->size;
+ }
if ((res->flags & IO_MASK) == IO_TYPE &&
(res->limit < limits.io.limit))
limits.io.limit = res->limit;
Timothy Pearson (tpearson(a)raptorengineeringinc.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8259
-gerrit
commit c9b012220dfe72cf1beb0dbd16ac339d13536dbb
Author: Timothy Pearson <tpearson(a)raptorengineeringinc.com>
Date: Fri Jan 23 20:18:56 2015 -0600
Fix corrupt SSDT table on multiprocessor AMD Family 10h systems
Signed-off-by: Timothy Pearson <tpearson(a)raptorengineeringinc.com>
Change-Id: I3175c8b29e94a27a2db6b11f8fc9e1d91bde11f9
---
src/arch/x86/boot/acpi.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/src/arch/x86/boot/acpi.c b/src/arch/x86/boot/acpi.c
index 621df2f..6da6f31 100644
--- a/src/arch/x86/boot/acpi.c
+++ b/src/arch/x86/boot/acpi.c
@@ -4,6 +4,7 @@
* coreboot ACPI Table support
* written by Stefan Reinauer <stepan(a)openbios.org>
*
+ * Copyright (C) 2015 Timothy Pearson <tpearson(a)raptorengineeringinc.com>, Raptor Engineering
* Copyright (C) 2004 SUSE LINUX AG
* Copyright (C) 2005-2009 coresystems GmbH
*
@@ -278,10 +279,36 @@ void acpi_create_ssdt_generator(acpi_header_t *ssdt, const char *oem_table_id)
acpigen_set_current((char *) current);
{
#if IS_ENABLED(CONFIG_PER_DEVICE_ACPI_TABLES)
+#if IS_ENABLED(CONFIG_NORTHBRIDGE_AMD_AMDFAM10)
+ char amd_cpu_ssdt_generated = 0;
+#endif
struct device *dev;
for (dev = all_devices; dev; dev = dev->next)
if (dev->ops && dev->ops->acpi_fill_ssdt_generator) {
+#if IS_ENABLED(CONFIG_NORTHBRIDGE_AMD_AMDFAM10)
+ // HACK
+ // If more than one physical CPU is installed, northbridge_acpi_write_vars() is called more than once and the resultant SSDT table is corrupted (duplicated entries)
+ // This prevents Linux from booting, with log messages like these:
+ // ACPI Error: [BUSN] Namespace lookup failure, AE_ALREADY_EXISTS (20131115/dswload-353)
+ // ACPI Exception: AE_ALREADY_EXISTS, During name lookup/catalog (20131115/psobject-222)
+ // followed by a slew of ACPI method failures and a hang when the invalid PCI resource entries are used
+ //
+ // The code in northbridge_acpi_write_vars needs to be reworked to function correctly when called once per device
+ // The commit that broke multiple physical CPUs is GIT hash 2a19fb1d76c42cb516a4ab6f253de8c65d8cc3ad
+ if ((dev->vendor == 0x1022) && (dev->device == 0x1200)) {
+ // AMD K10 CPU...
+ if (!amd_cpu_ssdt_generated) {
+ dev->ops->acpi_fill_ssdt_generator();
+ amd_cpu_ssdt_generated = 1;
+ }
+ }
+ else {
+ // Some other device, proceed normally
+ dev->ops->acpi_fill_ssdt_generator();
+ }
+#else
dev->ops->acpi_fill_ssdt_generator();
+#endif
}
current = (unsigned long) acpigen_get_current();
#else