[coreboot-gerrit] Patch set updated for coreboot: 5162b80 i82371eb & qemu: Move to per-device ACPI.

Vladimir Serbinenko (phcoder@gmail.com) gerrit at coreboot.org
Sun Sep 21 11:34:54 CEST 2014


Vladimir Serbinenko (phcoder at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6939

-gerrit

commit 5162b80da5ca2430d51d1d1a190e5314535d4d28
Author: Vladimir Serbinenko <phcoder at gmail.com>
Date:   Mon Sep 1 22:18:01 2014 +0200

    i82371eb & qemu: Move to per-device ACPI.
    
    This one is special because qemu is really far from anything real but
    shares some common features.
    
    Change-Id: Ia1631611724a074780e1fece50166730b2ee94ae
    Signed-off-by: Vladimir Serbinenko <phcoder at gmail.com>
---
 src/arch/x86/boot/acpi.c                          |  10 ++
 src/arch/x86/include/arch/acpi.h                  |   2 +
 src/mainboard/emulation/qemu-i440fx/Kconfig       |   1 +
 src/mainboard/emulation/qemu-i440fx/acpi.h        |   1 +
 src/mainboard/emulation/qemu-i440fx/acpi_tables.c | 134 +---------------------
 src/mainboard/emulation/qemu-i440fx/fw_cfg.h      |   1 -
 src/mainboard/emulation/qemu-i440fx/northbridge.c |   1 +
 src/mainboard/emulation/qemu-q35/Kconfig          |   1 +
 src/mainboard/emulation/qemu-q35/acpi_tables.c    | 134 +---------------------
 src/southbridge/intel/i82371eb/Kconfig            |   8 ++
 src/southbridge/intel/i82371eb/acpi_tables.c      |  80 +------------
 src/southbridge/intel/i82371eb/i82371eb.h         |   3 +
 src/southbridge/intel/i82371eb/isa.c              |   6 +
 src/southbridge/intel/i82801ix/Kconfig            |   1 +
 src/southbridge/intel/i82801ix/lpc.c              |   4 -
 15 files changed, 38 insertions(+), 349 deletions(-)

diff --git a/src/arch/x86/boot/acpi.c b/src/arch/x86/boot/acpi.c
index 3bfa3bd..fb576e3 100644
--- a/src/arch/x86/boot/acpi.c
+++ b/src/arch/x86/boot/acpi.c
@@ -654,6 +654,11 @@ void acpi_write_hest(acpi_hest_t *hest)
 
 extern const unsigned char AmlCode[];
 
+unsigned long __attribute__ ((weak)) fw_cfg_acpi_tables(unsigned long start)
+{
+	return 0;
+}
+
 #define ALIGN_CURRENT current = (ALIGN(current, 16))
 unsigned long write_acpi_tables(unsigned long start)
 {
@@ -671,12 +676,17 @@ unsigned long write_acpi_tables(unsigned long start)
 	acpi_mcfg_t *mcfg;
 	acpi_madt_t *madt;
 	device_t dev;
+	unsigned long fw;
 
 	current = start;
 
 	/* Align ACPI tables to 16byte */
 	ALIGN_CURRENT;
 
+	fw = fw_cfg_acpi_tables(current);
+	if (fw)
+		return fw;
+
 	printk(BIOS_INFO, "ACPI: Writing ACPI tables at %lx.\n", start);
 
 	/* We need at least an RSDP and an RSDT Table */
diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h
index 4adf89e..a015635 100644
--- a/src/arch/x86/include/arch/acpi.h
+++ b/src/arch/x86/include/arch/acpi.h
@@ -484,6 +484,8 @@ typedef struct acpi_tstate {
 	u32 status;
 } __attribute__ ((packed)) acpi_tstate_t;
 
+unsigned long fw_cfg_acpi_tables(unsigned long start);
+
 /* These are implemented by the target port or north/southbridge. */
 unsigned long write_acpi_tables(unsigned long addr);
 unsigned long acpi_fill_madt(unsigned long current);
diff --git a/src/mainboard/emulation/qemu-i440fx/Kconfig b/src/mainboard/emulation/qemu-i440fx/Kconfig
index 34f3342..b002c21 100644
--- a/src/mainboard/emulation/qemu-i440fx/Kconfig
+++ b/src/mainboard/emulation/qemu-i440fx/Kconfig
@@ -12,6 +12,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
 	select MAINBOARD_HAS_NATIVE_VGA_INIT
 	select MAINBOARD_DO_NATIVE_VGA_INIT
 	select MAINBOARD_HAS_NATIVE_VGA_INIT_TEXTMODECFG
+	select PER_DEVICE_ACPI_TABLES
 
 config MAINBOARD_DIR
 	string
diff --git a/src/mainboard/emulation/qemu-i440fx/acpi.h b/src/mainboard/emulation/qemu-i440fx/acpi.h
new file mode 100644
index 0000000..c0d4e6e
--- /dev/null
+++ b/src/mainboard/emulation/qemu-i440fx/acpi.h
@@ -0,0 +1 @@
+unsigned long northbridge_write_acpi_tables(unsigned long start);
diff --git a/src/mainboard/emulation/qemu-i440fx/acpi_tables.c b/src/mainboard/emulation/qemu-i440fx/acpi_tables.c
index 8be187a..da1a78d 100644
--- a/src/mainboard/emulation/qemu-i440fx/acpi_tables.c
+++ b/src/mainboard/emulation/qemu-i440fx/acpi_tables.c
@@ -30,11 +30,7 @@
 #include <cpu/x86/msr.h>
 
 #include "fw_cfg.h"
-
-extern const unsigned char AmlCode[];
-#if CONFIG_HAVE_ACPI_SLIC
-unsigned long acpi_create_slic(unsigned long current);
-#endif
+#include "acpi.h"
 
 unsigned long acpi_fill_madt(unsigned long current)
 {
@@ -54,12 +50,6 @@ unsigned long acpi_fill_madt(unsigned long current)
 	return current;
 }
 
-unsigned long acpi_fill_ssdt_generator(unsigned long current, const char *oem_table_id)
-{
-	generate_cpu_entries();
-	return (unsigned long) (acpigen_get_current());
-}
-
 unsigned long acpi_fill_slit(unsigned long current)
 {
 	// Not implemented
@@ -71,125 +61,3 @@ unsigned long acpi_fill_srat(unsigned long current)
 	/* No NUMA, no SRAT */
 	return current;
 }
-
-#define ALIGN_CURRENT current = (ALIGN(current, 16))
-unsigned long write_acpi_tables(unsigned long start)
-{
-	unsigned long current;
-	acpi_rsdp_t *rsdp;
-	acpi_rsdt_t *rsdt;
-	acpi_xsdt_t *xsdt;
-	acpi_hpet_t *hpet;
-	acpi_madt_t *madt;
-	acpi_mcfg_t *mcfg;
-	acpi_fadt_t *fadt;
-	acpi_facs_t *facs;
-#if CONFIG_HAVE_ACPI_SLIC
-	acpi_header_t *slic;
-#endif
-	acpi_header_t *ssdt;
-	acpi_header_t *dsdt;
-
-	current = fw_cfg_acpi_tables(start);
-	if (current)
-		return current;
-
-	current = start;
-
-	/* Align ACPI tables to 16byte */
-	ALIGN_CURRENT;
-
-	printk(BIOS_INFO, "ACPI: Writing ACPI tables at %lx.\n", start);
-
-	/* We need at least an RSDP and an RSDT Table */
-	rsdp = (acpi_rsdp_t *) current;
-	current += sizeof(acpi_rsdp_t);
-	ALIGN_CURRENT;
-	rsdt = (acpi_rsdt_t *) current;
-	current += sizeof(acpi_rsdt_t);
-	ALIGN_CURRENT;
-	xsdt = (acpi_xsdt_t *) current;
-	current += sizeof(acpi_xsdt_t);
-	ALIGN_CURRENT;
-
-	/* clear all table memory */
-	memset((void *) start, 0, current - start);
-
-	acpi_write_rsdp(rsdp, rsdt, xsdt);
-	acpi_write_rsdt(rsdt);
-	acpi_write_xsdt(xsdt);
-
-	/*
-	 * We explicitly add these tables later on:
-	 */
-	printk(BIOS_DEBUG, "ACPI:    * HPET\n");
-
-	hpet = (acpi_hpet_t *) current;
-	current += sizeof(acpi_hpet_t);
-	ALIGN_CURRENT;
-	acpi_create_hpet(hpet);
-	acpi_add_table(rsdp, hpet);
-
-	/* If we want to use HPET Timers Linux wants an MADT */
-	printk(BIOS_DEBUG, "ACPI:    * MADT\n");
-
-	madt = (acpi_madt_t *) current;
-	acpi_create_madt(madt);
-	current += madt->header.length;
-	ALIGN_CURRENT;
-	acpi_add_table(rsdp, madt);
-
-	printk(BIOS_DEBUG, "ACPI:    * MCFG\n");
-	mcfg = (acpi_mcfg_t *) current;
-	acpi_create_mcfg(mcfg);
-	current += mcfg->header.length;
-	ALIGN_CURRENT;
-	acpi_add_table(rsdp, mcfg);
-
-	printk(BIOS_DEBUG, "ACPI:     * FACS\n");
-	facs = (acpi_facs_t *) current;
-	current += sizeof(acpi_facs_t);
-	ALIGN_CURRENT;
-	acpi_create_facs(facs);
-
-	dsdt = (acpi_header_t *) current;
-	memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
-	current += dsdt->length;
-	memcpy(dsdt, &AmlCode, dsdt->length);
-
-	ALIGN_CURRENT;
-
-	/* We patched up the DSDT, so we need to recalculate the checksum */
-	dsdt->checksum = 0;
-	dsdt->checksum = acpi_checksum((void *)dsdt, dsdt->length);
-
-	printk(BIOS_DEBUG, "ACPI:     * DSDT @ %p Length %x\n", dsdt,
-		     dsdt->length);
-
-#if CONFIG_HAVE_ACPI_SLIC
-	printk(BIOS_DEBUG, "ACPI:     * SLIC\n");
-	slic = (acpi_header_t *)current;
-	current += acpi_create_slic(current);
-	ALIGN_CURRENT;
-	acpi_add_table(rsdp, slic);
-#endif
-
-	printk(BIOS_DEBUG, "ACPI:     * FADT\n");
-	fadt = (acpi_fadt_t *) current;
-	current += sizeof(acpi_fadt_t);
-	ALIGN_CURRENT;
-
-	acpi_create_fadt(fadt, facs, dsdt);
-	acpi_add_table(rsdp, fadt);
-
-	printk(BIOS_DEBUG, "ACPI:     * SSDT\n");
-	ssdt = (acpi_header_t *)current;
-	acpi_create_ssdt_generator(ssdt, ACPI_TABLE_CREATOR);
-	current += ssdt->length;
-	acpi_add_table(rsdp, ssdt);
-	ALIGN_CURRENT;
-
-	printk(BIOS_DEBUG, "current = %lx\n", current);
-	printk(BIOS_INFO, "ACPI: done.\n");
-	return current;
-}
diff --git a/src/mainboard/emulation/qemu-i440fx/fw_cfg.h b/src/mainboard/emulation/qemu-i440fx/fw_cfg.h
index 5ab024f..2a10d8b 100644
--- a/src/mainboard/emulation/qemu-i440fx/fw_cfg.h
+++ b/src/mainboard/emulation/qemu-i440fx/fw_cfg.h
@@ -19,4 +19,3 @@ void fw_cfg_get(int entry, void *dst, int dstlen);
 int fw_cfg_check_file(const char *name);
 void fw_cfg_load_file(const char *name, void *dst);
 int fw_cfg_max_cpus(void);
-unsigned long fw_cfg_acpi_tables(unsigned long start);
diff --git a/src/mainboard/emulation/qemu-i440fx/northbridge.c b/src/mainboard/emulation/qemu-i440fx/northbridge.c
index 0f8c0c2..433e729 100644
--- a/src/mainboard/emulation/qemu-i440fx/northbridge.c
+++ b/src/mainboard/emulation/qemu-i440fx/northbridge.c
@@ -16,6 +16,7 @@
 #include "fw_cfg_if.h"
 
 #include "memory.c"
+#include "acpi.h"
 
 static unsigned long qemu_get_high_memory_size(void)
 {
diff --git a/src/mainboard/emulation/qemu-q35/Kconfig b/src/mainboard/emulation/qemu-q35/Kconfig
index 3949937..e9f775c 100644
--- a/src/mainboard/emulation/qemu-q35/Kconfig
+++ b/src/mainboard/emulation/qemu-q35/Kconfig
@@ -15,6 +15,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
 	select MAINBOARD_HAS_NATIVE_VGA_INIT
 	select MAINBOARD_DO_NATIVE_VGA_INIT
 	select MAINBOARD_HAS_NATIVE_VGA_INIT_TEXTMODECFG
+	select COLLABORATIVE_ACPI_TABLES
 
 config MAINBOARD_DIR
 	string
diff --git a/src/mainboard/emulation/qemu-q35/acpi_tables.c b/src/mainboard/emulation/qemu-q35/acpi_tables.c
index 4e79b2c..aa8f1dd 100644
--- a/src/mainboard/emulation/qemu-q35/acpi_tables.c
+++ b/src/mainboard/emulation/qemu-q35/acpi_tables.c
@@ -30,11 +30,7 @@
 #include <cpu/x86/msr.h>
 
 #include "../qemu-i440fx/fw_cfg.h"
-
-extern const unsigned char AmlCode[];
-#if CONFIG_HAVE_ACPI_SLIC
-unsigned long acpi_create_slic(unsigned long current);
-#endif
+#include "../qemu-i440fx/acpi.h"
 
 void acpi_create_fadt(acpi_fadt_t * fadt, acpi_facs_t * facs, void *dsdt)
 {
@@ -186,12 +182,6 @@ unsigned long acpi_fill_madt(unsigned long current)
 	return current;
 }
 
-unsigned long acpi_fill_ssdt_generator(unsigned long current, const char *oem_table_id)
-{
-	// Not implemented
-	return current;
-}
-
 unsigned long acpi_fill_slit(unsigned long current)
 {
 	// Not implemented
@@ -221,125 +211,3 @@ unsigned long acpi_fill_srat(unsigned long current)
 	/* No NUMA, no SRAT */
 	return current;
 }
-
-#define ALIGN_CURRENT current = (ALIGN(current, 16))
-unsigned long write_acpi_tables(unsigned long start)
-{
-	unsigned long current;
-	acpi_rsdp_t *rsdp;
-	acpi_rsdt_t *rsdt;
-	acpi_xsdt_t *xsdt;
-	acpi_hpet_t *hpet;
-	acpi_madt_t *madt;
-	acpi_mcfg_t *mcfg;
-	acpi_fadt_t *fadt;
-	acpi_facs_t *facs;
-#if CONFIG_HAVE_ACPI_SLIC
-	acpi_header_t *slic;
-#endif
-	acpi_header_t *ssdt;
-	acpi_header_t *dsdt;
-
-	current = fw_cfg_acpi_tables(start);
-	if (current)
-		return current;
-
-	current = start;
-
-	/* Align ACPI tables to 16byte */
-	ALIGN_CURRENT;
-
-	printk(BIOS_INFO, "ACPI: Writing ACPI tables at %lx.\n", start);
-
-	/* We need at least an RSDP and an RSDT Table */
-	rsdp = (acpi_rsdp_t *) current;
-	current += sizeof(acpi_rsdp_t);
-	ALIGN_CURRENT;
-	rsdt = (acpi_rsdt_t *) current;
-	current += sizeof(acpi_rsdt_t);
-	ALIGN_CURRENT;
-	xsdt = (acpi_xsdt_t *) current;
-	current += sizeof(acpi_xsdt_t);
-	ALIGN_CURRENT;
-
-	/* clear all table memory */
-	memset((void *) start, 0, current - start);
-
-	acpi_write_rsdp(rsdp, rsdt, xsdt);
-	acpi_write_rsdt(rsdt);
-	acpi_write_xsdt(xsdt);
-
-	/*
-	 * We explicitly add these tables later on:
-	 */
-	printk(BIOS_DEBUG, "ACPI:    * HPET\n");
-
-	hpet = (acpi_hpet_t *) current;
-	current += sizeof(acpi_hpet_t);
-	ALIGN_CURRENT;
-	acpi_create_hpet(hpet);
-	acpi_add_table(rsdp, hpet);
-
-	/* If we want to use HPET Timers Linux wants an MADT */
-	printk(BIOS_DEBUG, "ACPI:    * MADT\n");
-
-	madt = (acpi_madt_t *) current;
-	acpi_create_madt(madt);
-	current += madt->header.length;
-	ALIGN_CURRENT;
-	acpi_add_table(rsdp, madt);
-
-	printk(BIOS_DEBUG, "ACPI:    * MCFG\n");
-	mcfg = (acpi_mcfg_t *) current;
-	acpi_create_mcfg(mcfg);
-	current += mcfg->header.length;
-	ALIGN_CURRENT;
-	acpi_add_table(rsdp, mcfg);
-
-	printk(BIOS_DEBUG, "ACPI:     * FACS\n");
-	facs = (acpi_facs_t *) current;
-	current += sizeof(acpi_facs_t);
-	ALIGN_CURRENT;
-	acpi_create_facs(facs);
-
-	dsdt = (acpi_header_t *) current;
-	memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
-	current += dsdt->length;
-	memcpy(dsdt, &AmlCode, dsdt->length);
-
-	ALIGN_CURRENT;
-
-	/* We patched up the DSDT, so we need to recalculate the checksum */
-	dsdt->checksum = 0;
-	dsdt->checksum = acpi_checksum((void *)dsdt, dsdt->length);
-
-	printk(BIOS_DEBUG, "ACPI:     * DSDT @ %p Length %x\n", dsdt,
-		     dsdt->length);
-
-#if CONFIG_HAVE_ACPI_SLIC
-	printk(BIOS_DEBUG, "ACPI:     * SLIC\n");
-	slic = (acpi_header_t *)current;
-	current += acpi_create_slic(current);
-	ALIGN_CURRENT;
-	acpi_add_table(rsdp, slic);
-#endif
-
-	printk(BIOS_DEBUG, "ACPI:     * FADT\n");
-	fadt = (acpi_fadt_t *) current;
-	current += sizeof(acpi_fadt_t);
-	ALIGN_CURRENT;
-
-	acpi_create_fadt(fadt, facs, dsdt);
-	acpi_add_table(rsdp, fadt);
-
-	printk(BIOS_DEBUG, "ACPI:     * SSDT\n");
-	ssdt = (acpi_header_t *)current;
-	acpi_create_ssdt_generator(ssdt, ACPI_TABLE_CREATOR);
-	current += ssdt->length;
-	acpi_add_table(rsdp, ssdt);
-	ALIGN_CURRENT;
-
-	printk(BIOS_DEBUG, "current = %lx\n", current);
-	printk(BIOS_INFO, "ACPI: done.\n");
-	return current;
-}
diff --git a/src/southbridge/intel/i82371eb/Kconfig b/src/southbridge/intel/i82371eb/Kconfig
index d91c8b7..5ddbe0f 100644
--- a/src/southbridge/intel/i82371eb/Kconfig
+++ b/src/southbridge/intel/i82371eb/Kconfig
@@ -6,3 +6,11 @@ config BOOTBLOCK_SOUTHBRIDGE_INIT
 	default "southbridge/intel/i82371eb/bootblock.c"
 	depends on SOUTHBRIDGE_INTEL_I82371EB
 
+
+if SOUTHBRIDGE_INTEL_I82371EB
+
+config SOUTH_BRIDGE_OPTIONS # dummy
+	def_bool y
+	select PER_DEVICE_ACPI_TABLES
+
+endif
diff --git a/src/southbridge/intel/i82371eb/acpi_tables.c b/src/southbridge/intel/i82371eb/acpi_tables.c
index a0cc82b..21e056a 100644
--- a/src/southbridge/intel/i82371eb/acpi_tables.c
+++ b/src/southbridge/intel/i82371eb/acpi_tables.c
@@ -90,8 +90,8 @@ unsigned long __attribute__((weak)) acpi_fill_mcfg(unsigned long current)
 	return current;
 }
 
-unsigned long __attribute__((weak)) acpi_fill_ssdt_generator(unsigned long current,
-						 const char *oem_table_id)
+unsigned long southbridge_acpi_fill_ssdt_generator(unsigned long current,
+						   const char *oem_table_id)
 {
 	acpigen_write_mainboard_resources("\\_SB.PCI0.MBRS", "_CRS");
 	/* generate_cpu_entries() generates weird bytecode and has to come
@@ -100,79 +100,3 @@ unsigned long __attribute__((weak)) acpi_fill_ssdt_generator(unsigned long curre
 	generate_cpu_entries();
 	return (unsigned long) acpigen_get_current();
 }
-
-unsigned long __attribute__((weak)) write_acpi_tables(unsigned long start)
-{
-	unsigned long current;
-	acpi_rsdp_t *rsdp;
-	acpi_rsdt_t *rsdt;
-	acpi_fadt_t *fadt;
-	acpi_facs_t *facs;
-	acpi_madt_t *madt;
-	acpi_header_t *ssdt;
-	acpi_header_t *dsdt;
-
-	/* Align ACPI tables to 16 byte. */
-	start = ALIGN(start, 16);
-	current = start;
-
-	printk(BIOS_INFO, "ACPI: Writing ACPI tables at %lx...\n", start);
-
-	/* We need at least an RSDP and an RSDT table. */
-	rsdp = (acpi_rsdp_t *) current;
-	current += sizeof(acpi_rsdp_t);
-	rsdt = (acpi_rsdt_t *) current;
-	current += sizeof(acpi_rsdt_t);
-
-	/* Clear all table memory. */
-	memset((void *) start, 0, current - start);
-
-	acpi_write_rsdp(rsdp, rsdt, NULL);
-	acpi_write_rsdt(rsdt);
-
-	/* We explicitly add these tables later on: */
-	printk(BIOS_DEBUG, "ACPI:     * FACS\n");
-
-	/* we should align FACS to 64B as per ACPI specs */
-	current = ALIGN(current, 64);
-	facs = (acpi_facs_t *) current;
-	current += sizeof(acpi_facs_t);
-	acpi_create_facs(facs);
-
-	dsdt = (acpi_header_t *)current;
-	memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
-	current += dsdt->length;
-	memcpy(dsdt, &AmlCode, dsdt->length);
-	/* Don't trust iasl to get checksum right. */
-	dsdt->checksum = 0; /* needs to be set to 0 first (part of csum) */
-	dsdt->checksum = acpi_checksum((u8*)dsdt, dsdt->length);
-	printk(BIOS_DEBUG, "ACPI:     * DSDT @ %p Length %x\n", dsdt,
-		     dsdt->length);
-	printk(BIOS_DEBUG, "ACPI:     * FADT\n");
-
-	fadt = (acpi_fadt_t *) current;
-	current += sizeof(acpi_fadt_t);
-
-	acpi_create_fadt(fadt, facs, dsdt);
-	acpi_add_table(rsdp, fadt);
-
-	printk(BIOS_DEBUG, "ACPI:    * MADT\n");
-	madt = (acpi_madt_t *) current;
-	acpi_create_madt(madt);
-	if (madt->header.length > sizeof(acpi_madt_t)) {
-		current += madt->header.length;
-		acpi_add_table(rsdp, madt);
-	} else {
-		/* don't add empty madt */
-		current = (unsigned long)madt;
-	}
-
-	printk(BIOS_DEBUG, "ACPI:    * SSDT\n");
-	ssdt = (acpi_header_t *)current;
-	acpi_create_ssdt_generator(ssdt, ACPI_TABLE_CREATOR);
-	current += ssdt->length;
-	acpi_add_table(rsdp, ssdt);
-
-	printk(BIOS_INFO, "ACPI: done.\n");
-	return current;
-}
diff --git a/src/southbridge/intel/i82371eb/i82371eb.h b/src/southbridge/intel/i82371eb/i82371eb.h
index e6062c6..991f49e 100644
--- a/src/southbridge/intel/i82371eb/i82371eb.h
+++ b/src/southbridge/intel/i82371eb/i82371eb.h
@@ -26,6 +26,9 @@
 #include <arch/io.h>
 #include <device/device.h>
 #include "chip.h"
+unsigned long southbridge_acpi_fill_ssdt_generator(unsigned long current,
+						   const char *oem_table_id);
+
 void i82371eb_enable(device_t dev);
 void i82371eb_hard_reset(void);
 #else
diff --git a/src/southbridge/intel/i82371eb/isa.c b/src/southbridge/intel/i82371eb/isa.c
index 5605106..632e509 100644
--- a/src/southbridge/intel/i82371eb/isa.c
+++ b/src/southbridge/intel/i82371eb/isa.c
@@ -26,6 +26,8 @@
 #include <pc80/isa-dma.h>
 #include <pc80/mc146818rtc.h>
 #include <arch/ioapic.h>
+#include <arch/acpi.h>
+#include <arch/acpigen.h>
 #include "i82371eb.h"
 
 #if CONFIG_IOAPIC
@@ -128,6 +130,10 @@ static const struct device_operations isa_ops = {
 	.read_resources		= sb_read_resources,
 	.set_resources		= pci_dev_set_resources,
 	.enable_resources	= pci_dev_enable_resources,
+#if IS_ENABLED(CONFIG_GENERATE_ACPI_TABLES)
+	.write_acpi_tables      = acpi_write_hpet,
+	.acpi_fill_ssdt_generator = southbridge_acpi_fill_ssdt_generator,
+#endif
 	.init			= isa_init,
 	.scan_bus		= scan_static_bus,	/* TODO: Needed? */
 	.enable			= 0,
diff --git a/src/southbridge/intel/i82801ix/Kconfig b/src/southbridge/intel/i82801ix/Kconfig
index 1ad5aad..d8a32e5 100644
--- a/src/southbridge/intel/i82801ix/Kconfig
+++ b/src/southbridge/intel/i82801ix/Kconfig
@@ -27,6 +27,7 @@ config SOUTHBRIDGE_INTEL_I82801IX
 	select USE_WATCHDOG_ON_BOOT
 	select HAVE_SMI_HANDLER
 	select HAVE_USBDEBUG_OPTIONS
+	select PER_DEVICE_ACPI_TABLES
 
 if SOUTHBRIDGE_INTEL_I82801IX
 
diff --git a/src/southbridge/intel/i82801ix/lpc.c b/src/southbridge/intel/i82801ix/lpc.c
index b9e926f..7ab9627 100644
--- a/src/southbridge/intel/i82801ix/lpc.c
+++ b/src/southbridge/intel/i82801ix/lpc.c
@@ -537,7 +537,6 @@ static void set_subsystem(device_t dev, unsigned vendor, unsigned device)
 	}
 }
 
-#if IS_ENABLED(CONFIG_PER_DEVICE_ACPI_TABLES)
 static unsigned long southbridge_fill_ssdt(unsigned long current, const char *oem_table_id)
 {
 	global_nvs_t *gnvs = cbmem_add (CBMEM_ID_ACPI_GNVS, sizeof (*gnvs));
@@ -556,7 +555,6 @@ static unsigned long southbridge_fill_ssdt(unsigned long current, const char *oe
 
 	return (unsigned long) (acpigen_get_current());
 }
-#endif
 
 static struct pci_operations pci_ops = {
 	.set_subsystem = set_subsystem,
@@ -566,10 +564,8 @@ static struct device_operations device_ops = {
 	.read_resources		= i82801ix_lpc_read_resources,
 	.set_resources		= pci_dev_set_resources,
 	.enable_resources	= pci_dev_enable_resources,
-#if IS_ENABLED(CONFIG_PER_DEVICE_ACPI_TABLES)
 	.acpi_fill_ssdt_generator = southbridge_fill_ssdt,
 	.write_acpi_tables      = acpi_write_hpet,
-#endif
 	.init			= lpc_init,
 	.scan_bus		= scan_static_bus,
 	.ops_pci		= &pci_ops,



More information about the coreboot-gerrit mailing list