summaryrefslogtreecommitdiff
path: root/src/northbridge/amd/amdk8
diff options
context:
space:
mode:
authorVladimir Serbinenko <phcoder@gmail.com>2014-10-11 23:45:40 +0200
committerVladimir Serbinenko <phcoder@gmail.com>2015-05-20 19:51:40 +0200
commit5e597572ef9b32dfd0ea0b94a9fddd998bfd0f77 (patch)
treee15495cd02954efcd0b50a7fc1ac6deb2aa41e1c /src/northbridge/amd/amdk8
parentb4ae5fd107248a51e63474c67afc092d521358c1 (diff)
downloadcoreboot-5e597572ef9b32dfd0ea0b94a9fddd998bfd0f77.tar.xz
acpi: make fill_slit and fill_srat into arguments.
SLIT and SRAT are created this way only on amdk8 and amdfam10. This saves the need of having a lot of dummies. Change-Id: I76d042702209cd6d11ee78ac22cf9fe9d30d0ca5 Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Reviewed-on: http://review.coreboot.org/7052 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/northbridge/amd/amdk8')
-rw-r--r--src/northbridge/amd/amdk8/acpi.c33
-rw-r--r--src/northbridge/amd/amdk8/acpi.h1
-rw-r--r--src/northbridge/amd/amdk8/northbridge.c31
3 files changed, 32 insertions, 33 deletions
diff --git a/src/northbridge/amd/amdk8/acpi.c b/src/northbridge/amd/amdk8/acpi.c
index 3f3b009a7a..7086ba8115 100644
--- a/src/northbridge/amd/amdk8/acpi.c
+++ b/src/northbridge/amd/amdk8/acpi.c
@@ -114,7 +114,7 @@ static void set_srat_mem(void *gp, struct device *dev, struct resource *res)
state->current += acpi_create_srat_mem((acpi_srat_mem_t *)state->current, (res->index & 0xf), basek, sizek, 1);
}
-unsigned long acpi_fill_srat(unsigned long current)
+static unsigned long acpi_fill_srat(unsigned long current)
{
struct acpi_srat_mem_state srat_mem_state;
@@ -135,7 +135,7 @@ unsigned long acpi_fill_srat(unsigned long current)
return current;
}
-unsigned long acpi_fill_slit(unsigned long current)
+static unsigned long acpi_fill_slit(unsigned long current)
{
/* need to find out the node num at first */
/* fill the first 8 byte with that num */
@@ -204,6 +204,35 @@ unsigned long acpi_fill_slit(unsigned long current)
return current;
}
+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;
+
+ /* Fills sysconf structure needed for SRAT and SLIT. */
+ get_bus_conf();
+
+ current = ALIGN(current, 16);
+ srat = (acpi_srat_t *) current;
+ printk(BIOS_DEBUG, "ACPI: * SRAT @ %p\n", srat);
+ acpi_create_srat(srat, acpi_fill_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, acpi_fill_slit);
+ current+=slit->header.length;
+ acpi_add_table(rsdp,slit);
+
+ return current;
+}
+
static void k8acpi_write_HT(void) {
int i;
diff --git a/src/northbridge/amd/amdk8/acpi.h b/src/northbridge/amd/amdk8/acpi.h
index 6d7c4d9753..4d71507355 100644
--- a/src/northbridge/amd/amdk8/acpi.h
+++ b/src/northbridge/amd/amdk8/acpi.h
@@ -22,5 +22,6 @@
#include <arch/acpigen.h>
void k8acpi_write_vars(void);
+unsigned long northbridge_write_acpi_tables(unsigned long start, acpi_rsdp_t *rsdp);
#endif
diff --git a/src/northbridge/amd/amdk8/northbridge.c b/src/northbridge/amd/amdk8/northbridge.c
index a17aa65a82..f2e0e4c5f7 100644
--- a/src/northbridge/amd/amdk8/northbridge.c
+++ b/src/northbridge/amd/amdk8/northbridge.c
@@ -579,37 +579,6 @@ static void mcf0_control_init(struct device *dev)
#endif
}
-#if IS_ENABLED(CONFIG_HAVE_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;
-
- /* Fills sysconf structure needed for SRAT and SLIT. */
- get_bus_conf();
-
- 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,