summaryrefslogtreecommitdiff
path: root/src/northbridge/amd/amdk8
diff options
context:
space:
mode:
authorVladimir Serbinenko <phcoder@gmail.com>2014-09-21 14:31:19 +0200
committerVladimir Serbinenko <phcoder@gmail.com>2014-10-16 13:35:53 +0200
commit6985d4ee075ff884315d566853be701e238faac6 (patch)
tree394856f4a05cd2e063edfe6fb69458f5473d027b /src/northbridge/amd/amdk8
parent822bc65b0e8cb9c17721b8b776ec7ecf6ac4129e (diff)
downloadcoreboot-6985d4ee075ff884315d566853be701e238faac6.tar.xz
amdk8: Move to per-device ACPI
Change-Id: I485791015aa7eaabba53813945c216f5725554b1 Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/6948 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/northbridge/amd/amdk8')
-rw-r--r--src/northbridge/amd/amdk8/Kconfig1
-rw-r--r--src/northbridge/amd/amdk8/acpi.c7
-rw-r--r--src/northbridge/amd/amdk8/acpi.h2
-rw-r--r--src/northbridge/amd/amdk8/northbridge.c36
4 files changed, 43 insertions, 3 deletions
diff --git a/src/northbridge/amd/amdk8/Kconfig b/src/northbridge/amd/amdk8/Kconfig
index 3f8861edd1..e79b6b2eb0 100644
--- a/src/northbridge/amd/amdk8/Kconfig
+++ b/src/northbridge/amd/amdk8/Kconfig
@@ -23,6 +23,7 @@ config NORTHBRIDGE_AMD_AMDK8
select HAVE_DEBUG_SMBUS
select HAVE_DEBUG_CAR
select HYPERTRANSPORT_PLUGIN_SUPPORT
+ select PER_DEVICE_ACPI_TABLES
if NORTHBRIDGE_AMD_AMDK8
config AGP_APERTURE_SIZE
diff --git a/src/northbridge/amd/amdk8/acpi.c b/src/northbridge/amd/amdk8/acpi.c
index f7134f6e6c..a2dedd3e7d 100644
--- a/src/northbridge/amd/amdk8/acpi.c
+++ b/src/northbridge/amd/amdk8/acpi.c
@@ -118,6 +118,8 @@ unsigned long acpi_fill_srat(unsigned long current)
{
struct acpi_srat_mem_state srat_mem_state;
+ get_bus_conf();
+
/* create all subtables for processors */
current = acpi_create_srat_lapics(current);
@@ -141,6 +143,8 @@ unsigned long acpi_fill_slit(unsigned long current)
/* fill the first 8 byte with that num */
/* fill the next num*num byte with distance, local is 10, 1 hop mean 20, and 2 hop with 30.... */
+ get_bus_conf();
+
/* because We has assume that we know the topology of the HT connection, So we can have set if we know the node_num */
static u8 hops_8[] = { 0, 1, 1, 2, 2, 3, 3, 4,
1, 0, 2, 1, 3, 2, 4, 3,
@@ -253,7 +257,7 @@ static int k8acpi_write_pci_data(int dlen, const char *name, int offset) {
return len + lenp;
}
-int k8acpi_write_vars(void)
+void k8acpi_write_vars(void)
{
int lens;
msr_t msr;
@@ -283,7 +287,6 @@ int k8acpi_write_vars(void)
lens += k8acpi_write_HT();
//minus opcode
acpigen_patch_len(lens - 1);
- return lens;
}
void update_ssdtx(void *ssdtx, int i)
diff --git a/src/northbridge/amd/amdk8/acpi.h b/src/northbridge/amd/amdk8/acpi.h
index 9d0a73aaaf..6d7c4d9753 100644
--- a/src/northbridge/amd/amdk8/acpi.h
+++ b/src/northbridge/amd/amdk8/acpi.h
@@ -21,6 +21,6 @@
#define AMDK8_ACPI_H
#include <arch/acpigen.h>
-int k8acpi_write_vars(void);
+void k8acpi_write_vars(void);
#endif
diff --git a/src/northbridge/amd/amdk8/northbridge.c b/src/northbridge/amd/amdk8/northbridge.c
index 2c19b3aa2a..bfd2c0fc47 100644
--- a/src/northbridge/amd/amdk8/northbridge.c
+++ b/src/northbridge/amd/amdk8/northbridge.c
@@ -16,6 +16,10 @@
#include <string.h>
#include <lib.h>
#include <cpu/cpu.h>
+#if IS_ENABLED(CONFIG_GENERATE_ACPI_TABLES)
+#include <arch/acpi.h>
+#include "acpi.h"
+#endif
#include <cpu/x86/lapic.h>
#include <cpu/amd/mtrr.h>
@@ -580,10 +584,42 @@ static void mcf0_control_init(struct device *dev)
#endif
}
+#if IS_ENABLED(CONFIG_GENERATE_ACPI_TABLES)
+static unsigned long northbridge_write_acpi_tables(unsigned long start, acpi_rsdp_t *rsdp)
+{
+ unsigned long current;
+ acpi_srat_t *srat;
+ acpi_slit_t *slit;
+
+ current = start;
+
+ current = ALIGN(current, 16);
+ srat = (acpi_srat_t *) current;
+ printk(BIOS_DEBUG, "ACPI: * SRAT @ %p\n", srat);
+ acpi_create_srat(srat);
+ current += srat->header.length;
+ acpi_add_table(rsdp, srat);
+
+ /* SLIT */
+ current = ALIGN(current, 16);
+ slit = (acpi_slit_t *) current;
+ printk(BIOS_DEBUG, "ACPI: * SLIT @ %p\n", slit);
+ acpi_create_slit(slit);
+ current+=slit->header.length;
+ acpi_add_table(rsdp,slit);
+
+ return current;
+}
+#endif
+
static struct device_operations northbridge_operations = {
.read_resources = amdk8_read_resources,
.set_resources = amdk8_set_resources,
.enable_resources = pci_dev_enable_resources,
+#if IS_ENABLED(CONFIG_GENERATE_ACPI_TABLES)
+ .acpi_fill_ssdt_generator = k8acpi_write_vars,
+ .write_acpi_tables = northbridge_write_acpi_tables,
+#endif
.init = mcf0_control_init,
.scan_bus = amdk8_scan_chains,
.enable = 0,