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 c186cda00b6c03a5c0cfdf3412da46203badf0b0
Author: Timothy Pearson <tpearson(a)raptorengineeringinc.com>
Date: Fri Jan 23 20:28:13 2015 -0600
amd/amdht: Compile in multiprocessor support when selected
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/8259
-gerrit
commit c08ad4a18fc99cf484473fd4129833dd16955748
Author: Timothy Pearson <tpearson(a)raptorengineeringinc.com>
Date: Fri Jan 23 20:18:56 2015 -0600
ACPI: 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 | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/src/arch/x86/boot/acpi.c b/src/arch/x86/boot/acpi.c
index 621df2f..f6548f9 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,42 @@ 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 (/dswload-353)
+ * ACPI Exception: AE_ALREADY_EXISTS, During name lookup/catalog (/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.
+ * Commit 2a19fb1d broke multiple physical CPUs.
+ */
+ 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
Timothy Pearson (tpearson(a)raptorengineeringinc.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8258
-gerrit
commit 04b3abfe383e23a51d56e55087cad769b9169f12
Author: Timothy Pearson <tpearson(a)raptorengineeringinc.com>
Date: Fri Jan 23 20:18:19 2015 -0600
nvidia/ck804/lpc.c: Fix power restoration control
Control bits located by changing tristate power
restoration value in proprietary BIOS, booting into
Linux, dumping the entire CK804 configuration space,
then comparing values against those dumped earlier.
"Last state" control bit(s) are unknown at this time.
TEST: Boot ASUS KFSN4-DRE with both Coreboot power on
and power off after power failure settings, then
pull power plug / reinsert power plug and verify
mainboard behaviour matches setting.
Change-Id: I737bdd35632fe786968a1cb8458e56c785363cfa
Signed-off-by: Timothy Pearson <tpearson(a)raptorengineeringinc.com>
---
src/southbridge/nvidia/ck804/lpc.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/southbridge/nvidia/ck804/lpc.c b/src/southbridge/nvidia/ck804/lpc.c
index 9b6049c..0c125b9 100644
--- a/src/southbridge/nvidia/ck804/lpc.c
+++ b/src/southbridge/nvidia/ck804/lpc.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) 2003 Linux Networx
* Copyright (C) 2003 SuSE Linux AG
* Copyright (C) 2004 Tyan Computer
@@ -40,7 +41,7 @@
#define NMI_OFF 0
-// 0x7a or e3
+// Power restoration control register is at 0x7a
#define PREVIOUS_POWER_STATE 0x7A
#define MAINBOARD_POWER_OFF 0
@@ -123,9 +124,9 @@ static void lpc_init(device_t dev)
on = CONFIG_MAINBOARD_POWER_ON_AFTER_POWER_FAIL;
get_option(&on, "power_on_after_fail");
byte = pci_read_config8(dev, PREVIOUS_POWER_STATE);
- byte &= ~0x40;
+ byte &= ~0x45;
if (!on)
- byte |= 0x40;
+ byte |= 0x45;
pci_write_config8(dev, PREVIOUS_POWER_STATE, byte);
printk(BIOS_INFO, "set power %s after power fail\n", on ? "on" : "off");
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 1fa4ed57755745054223a61f12d5b7f91d82a93f
Author: Timothy Pearson <tpearson(a)raptorengineeringinc.com>
Date: Fri Jan 23 20:20:56 2015 -0600
device/device.c: Correct PCI register space location
Fix the incorrect PCI register space location causing corruption
with more than ~3.5GB physical RAM on AMD Family 10h systems.
Change-Id: I66d1bfa1e977a6b492c1909079087a801c7e6a3a
Signed-off-by: Timothy Pearson <tpearson(a)raptorengineeringinc.com>
---
src/device/device.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/src/device/device.c b/src/device/device.c
index 00e323a..94390b7 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
*/
/*
@@ -685,6 +686,25 @@ static void constrain_resources(struct device *dev, struct constraints* limits)
}
}
+/*
+ * In this function there is a provision to shrink the potential 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.
+ */
+
static void avoid_fixed_resources(struct device *dev)
{
struct constraints limits;
@@ -712,6 +732,12 @@ 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 PCI address space */
+ 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;