device_ops: add device_t argument to write_acpi_tables
`device_t device` is missing as argument. Every device_op function
should have a `device_t device` argument.
Change-Id: I1ba4bfa0ac36a09a82b108249158c80c50f9f5fd
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-on: http://review.coreboot.org/9599
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
diff --git a/src/arch/x86/boot/acpi.c b/src/arch/x86/boot/acpi.c
index dd01e0c..4090a1d 100644
--- a/src/arch/x86/boot/acpi.c
+++ b/src/arch/x86/boot/acpi.c
@@ -508,7 +508,7 @@
header->checksum = acpi_checksum((void *)hpet, sizeof(acpi_hpet_t));
}
-unsigned long acpi_write_hpet(unsigned long current, acpi_rsdp_t *rsdp)
+unsigned long acpi_write_hpet(device_t device, unsigned long current, acpi_rsdp_t *rsdp)
{
acpi_hpet_t *hpet;
@@ -898,7 +898,7 @@
for (dev = all_devices; dev; dev = dev->next) {
if (dev->ops && dev->ops->write_acpi_tables) {
- current = dev->ops->write_acpi_tables(current, rsdp);
+ current = dev->ops->write_acpi_tables(dev, current, rsdp);
ALIGN_CURRENT;
}
}
diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h
index be97db5..28f650c 100644
--- a/src/arch/x86/include/arch/acpi.h
+++ b/src/arch/x86/include/arch/acpi.h
@@ -537,7 +537,7 @@
#if ENV_RAMSTAGE
void acpi_create_hpet(acpi_hpet_t *hpet);
-unsigned long acpi_write_hpet(unsigned long start, acpi_rsdp_t *rsdp);
+unsigned long acpi_write_hpet(device_t device, unsigned long start, acpi_rsdp_t *rsdp);
/* cpu/intel/speedstep/acpi.c */
void generate_cpu_entries(device_t device);
diff --git a/src/include/device/device.h b/src/include/device/device.h
index 7836912..f63a05c 100644
--- a/src/include/device/device.h
+++ b/src/include/device/device.h
@@ -56,7 +56,7 @@
void (*get_smbios_strings)(device_t dev, struct smbios_type11 *t);
#endif
#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
- unsigned long (*write_acpi_tables)(unsigned long start, struct acpi_rsdp *rsdp);
+ unsigned long (*write_acpi_tables)(device_t dev, unsigned long start, struct acpi_rsdp *rsdp);
void (*acpi_fill_ssdt_generator)(device_t dev);
void (*acpi_inject_dsdt_generator)(device_t dev);
#endif
diff --git a/src/mainboard/amd/serengeti_cheetah/acpi_tables.c b/src/mainboard/amd/serengeti_cheetah/acpi_tables.c
index 225f897..b25f7e7 100644
--- a/src/mainboard/amd/serengeti_cheetah/acpi_tables.c
+++ b/src/mainboard/amd/serengeti_cheetah/acpi_tables.c
@@ -119,7 +119,7 @@
return current;
}
-unsigned long mainboard_write_acpi_tables(unsigned long start, acpi_rsdp_t *rsdp)
+unsigned long mainboard_write_acpi_tables(device_t dev, unsigned long start, acpi_rsdp_t *rsdp)
{
unsigned long current;
acpi_header_t *ssdtx;
diff --git a/src/mainboard/amd/serengeti_cheetah/mainboard.h b/src/mainboard/amd/serengeti_cheetah/mainboard.h
index 80d8f2a..fc2dcaf 100644
--- a/src/mainboard/amd/serengeti_cheetah/mainboard.h
+++ b/src/mainboard/amd/serengeti_cheetah/mainboard.h
@@ -1 +1 @@
-unsigned long mainboard_write_acpi_tables(unsigned long start, acpi_rsdp_t *rsdp);
+unsigned long mainboard_write_acpi_tables(device_t device, unsigned long start, acpi_rsdp_t *rsdp);
diff --git a/src/mainboard/amd/serengeti_cheetah_fam10/acpi_tables.c b/src/mainboard/amd/serengeti_cheetah_fam10/acpi_tables.c
index ac021d0..7b5be84 100644
--- a/src/mainboard/amd/serengeti_cheetah_fam10/acpi_tables.c
+++ b/src/mainboard/amd/serengeti_cheetah_fam10/acpi_tables.c
@@ -127,7 +127,8 @@
return current;
}
-unsigned long mainboard_write_acpi_tables(unsigned long current,
+unsigned long mainboard_write_acpi_tables(device_t device,
+ unsigned long current,
acpi_rsdp_t *rsdp)
{
acpi_header_t *ssdtx;
diff --git a/src/mainboard/amd/serengeti_cheetah_fam10/mainboard.h b/src/mainboard/amd/serengeti_cheetah_fam10/mainboard.h
index 8f17804..b152b04 100644
--- a/src/mainboard/amd/serengeti_cheetah_fam10/mainboard.h
+++ b/src/mainboard/amd/serengeti_cheetah_fam10/mainboard.h
@@ -1,2 +1,2 @@
-unsigned long mainboard_write_acpi_tables(unsigned long start, acpi_rsdp_t *rsdp);
+unsigned long mainboard_write_acpi_tables(device_t device, unsigned long start, acpi_rsdp_t *rsdp);
diff --git a/src/mainboard/emulation/qemu-i440fx/acpi.h b/src/mainboard/emulation/qemu-i440fx/acpi.h
index c0d4e6e..f2ffdeb 100644
--- a/src/mainboard/emulation/qemu-i440fx/acpi.h
+++ b/src/mainboard/emulation/qemu-i440fx/acpi.h
@@ -1 +1 @@
-unsigned long northbridge_write_acpi_tables(unsigned long start);
+unsigned long northbridge_write_acpi_tables(device_t device, unsigned long start);
diff --git a/src/mainboard/getac/p470/acpi_tables.c b/src/mainboard/getac/p470/acpi_tables.c
index b6cd654..18b7151 100644
--- a/src/mainboard/getac/p470/acpi_tables.c
+++ b/src/mainboard/getac/p470/acpi_tables.c
@@ -110,7 +110,9 @@
}
#define ALIGN_CURRENT current = (ALIGN(current, 16))
-unsigned long mainboard_write_acpi_tables(unsigned long start, acpi_rsdp_t *rsdp)
+unsigned long mainboard_write_acpi_tables(device_t device,
+ unsigned long start,
+ acpi_rsdp_t *rsdp)
{
unsigned long current;
acpi_header_t *ecdt;
diff --git a/src/mainboard/getac/p470/mainboard.h b/src/mainboard/getac/p470/mainboard.h
index 45d961b..56f5455 100644
--- a/src/mainboard/getac/p470/mainboard.h
+++ b/src/mainboard/getac/p470/mainboard.h
@@ -1,4 +1,5 @@
struct acpi_rsdp;
-unsigned long mainboard_write_acpi_tables(unsigned long start,
+unsigned long mainboard_write_acpi_tables(device_t device,
+ unsigned long start,
struct acpi_rsdp *rsdp);
diff --git a/src/mainboard/iwill/dk8_htx/acpi_tables.c b/src/mainboard/iwill/dk8_htx/acpi_tables.c
index 5767878..7c8835a 100644
--- a/src/mainboard/iwill/dk8_htx/acpi_tables.c
+++ b/src/mainboard/iwill/dk8_htx/acpi_tables.c
@@ -125,7 +125,9 @@
return current;
}
-unsigned long mainboard_write_acpi_tables(unsigned long start, acpi_rsdp_t *rsdp)
+unsigned long mainboard_write_acpi_tables(device_t device,
+ unsigned long start,
+ acpi_rsdp_t *rsdp)
{
unsigned long current;
acpi_header_t *ssdtx;
diff --git a/src/mainboard/iwill/dk8_htx/mainboard.h b/src/mainboard/iwill/dk8_htx/mainboard.h
index 80d8f2a..fc2dcaf 100644
--- a/src/mainboard/iwill/dk8_htx/mainboard.h
+++ b/src/mainboard/iwill/dk8_htx/mainboard.h
@@ -1 +1 @@
-unsigned long mainboard_write_acpi_tables(unsigned long start, acpi_rsdp_t *rsdp);
+unsigned long mainboard_write_acpi_tables(device_t device, unsigned long start, acpi_rsdp_t *rsdp);
diff --git a/src/northbridge/amd/agesa/family12/northbridge.c b/src/northbridge/amd/agesa/family12/northbridge.c
index ee291a5..ec1f493 100644
--- a/src/northbridge/amd/agesa/family12/northbridge.c
+++ b/src/northbridge/amd/agesa/family12/northbridge.c
@@ -832,7 +832,8 @@
acpigen_pop_len();
}
-static unsigned long agesa_write_acpi_tables(unsigned long current,
+static unsigned long agesa_write_acpi_tables(device_t device,
+ unsigned long current,
acpi_rsdp_t *rsdp)
{
acpi_srat_t *srat;
diff --git a/src/northbridge/amd/agesa/family14/northbridge.c b/src/northbridge/amd/agesa/family14/northbridge.c
index 2cf4736..6d3a173 100644
--- a/src/northbridge/amd/agesa/family14/northbridge.c
+++ b/src/northbridge/amd/agesa/family14/northbridge.c
@@ -832,7 +832,8 @@
return (unsigned long)current;
}
-static unsigned long agesa_write_acpi_tables(unsigned long current,
+static unsigned long agesa_write_acpi_tables(device_t device,
+ unsigned long current,
acpi_rsdp_t *rsdp)
{
acpi_srat_t *srat;
diff --git a/src/northbridge/amd/agesa/family15/northbridge.c b/src/northbridge/amd/agesa/family15/northbridge.c
index c21da21..cda0ca7 100644
--- a/src/northbridge/amd/agesa/family15/northbridge.c
+++ b/src/northbridge/amd/agesa/family15/northbridge.c
@@ -523,7 +523,8 @@
acpigen_pop_len();
}
-static unsigned long agesa_write_acpi_tables(unsigned long current,
+static unsigned long agesa_write_acpi_tables(device_t device,
+ unsigned long current,
acpi_rsdp_t *rsdp)
{
acpi_srat_t *srat;
diff --git a/src/northbridge/amd/agesa/family15rl/northbridge.c b/src/northbridge/amd/agesa/family15rl/northbridge.c
index 6c2e953..199843e 100644
--- a/src/northbridge/amd/agesa/family15rl/northbridge.c
+++ b/src/northbridge/amd/agesa/family15rl/northbridge.c
@@ -498,7 +498,8 @@
acpigen_pop_len();
}
-static unsigned long agesa_write_acpi_tables(unsigned long current,
+static unsigned long agesa_write_acpi_tables(device_t device,
+ unsigned long current,
acpi_rsdp_t *rsdp)
{
acpi_srat_t *srat;
diff --git a/src/northbridge/amd/agesa/family15tn/northbridge.c b/src/northbridge/amd/agesa/family15tn/northbridge.c
index aef0d83..85b9799 100644
--- a/src/northbridge/amd/agesa/family15tn/northbridge.c
+++ b/src/northbridge/amd/agesa/family15tn/northbridge.c
@@ -498,7 +498,8 @@
acpigen_pop_len();
}
-static unsigned long agesa_write_acpi_tables(unsigned long current,
+static unsigned long agesa_write_acpi_tables(device_t device,
+ unsigned long current,
acpi_rsdp_t *rsdp)
{
acpi_srat_t *srat;
diff --git a/src/northbridge/amd/agesa/family16kb/northbridge.c b/src/northbridge/amd/agesa/family16kb/northbridge.c
index 192c3df..25f40b8 100644
--- a/src/northbridge/amd/agesa/family16kb/northbridge.c
+++ b/src/northbridge/amd/agesa/family16kb/northbridge.c
@@ -498,7 +498,8 @@
acpigen_pop_len();
}
-static unsigned long agesa_write_acpi_tables(unsigned long current,
+static unsigned long agesa_write_acpi_tables(device_t device,
+ unsigned long current,
acpi_rsdp_t *rsdp)
{
acpi_srat_t *srat;
diff --git a/src/northbridge/amd/amdfam10/acpi.c b/src/northbridge/amd/amdfam10/acpi.c
index 734ebb6..4b86e96 100644
--- a/src/northbridge/amd/amdfam10/acpi.c
+++ b/src/northbridge/amd/amdfam10/acpi.c
@@ -330,8 +330,9 @@
acpigen_pop_len();
}
-unsigned long northbridge_write_acpi_tables(unsigned long current,
- struct acpi_rsdp *rsdp)
+unsigned long northbridge_write_acpi_tables(device_t device,
+ unsigned long current,
+ struct acpi_rsdp *rsdp)
{
acpi_srat_t *srat;
acpi_slit_t *slit;
diff --git a/src/northbridge/amd/amdfam10/amdfam10.h b/src/northbridge/amd/amdfam10/amdfam10.h
index 9213ed1..9461385 100644
--- a/src/northbridge/amd/amdfam10/amdfam10.h
+++ b/src/northbridge/amd/amdfam10/amdfam10.h
@@ -1074,7 +1074,8 @@
struct acpi_rsdp;
-unsigned long northbridge_write_acpi_tables(unsigned long start,
+unsigned long northbridge_write_acpi_tables(device_t device,
+ unsigned long start,
struct acpi_rsdp *rsdp);
void northbridge_acpi_write_vars(device_t device);
diff --git a/src/northbridge/amd/amdk8/acpi.c b/src/northbridge/amd/amdk8/acpi.c
index 1bb1d83..10228cfa 100644
--- a/src/northbridge/amd/amdk8/acpi.c
+++ b/src/northbridge/amd/amdk8/acpi.c
@@ -204,7 +204,10 @@
return current;
}
-unsigned long northbridge_write_acpi_tables(unsigned long start, acpi_rsdp_t *rsdp)
+unsigned long northbridge_write_acpi_tables(
+ device_t device,
+ unsigned long start,
+ acpi_rsdp_t *rsdp)
{
unsigned long current;
acpi_srat_t *srat;
diff --git a/src/northbridge/amd/amdk8/acpi.h b/src/northbridge/amd/amdk8/acpi.h
index 4d822e4..b874dd4 100644
--- a/src/northbridge/amd/amdk8/acpi.h
+++ b/src/northbridge/amd/amdk8/acpi.h
@@ -22,6 +22,6 @@
#include <arch/acpigen.h>
void k8acpi_write_vars(device_t device);
-unsigned long northbridge_write_acpi_tables(unsigned long start, acpi_rsdp_t *rsdp);
+unsigned long northbridge_write_acpi_tables(device_t device, unsigned long start, acpi_rsdp_t *rsdp);
#endif
diff --git a/src/northbridge/amd/pi/00630F01/northbridge.c b/src/northbridge/amd/pi/00630F01/northbridge.c
index d21becf..acecb28 100644
--- a/src/northbridge/amd/pi/00630F01/northbridge.c
+++ b/src/northbridge/amd/pi/00630F01/northbridge.c
@@ -492,7 +492,8 @@
acpigen_pop_len();
}
-static unsigned long agesa_write_acpi_tables(unsigned long current,
+static unsigned long agesa_write_acpi_tables(device_t device,
+ unsigned long current,
acpi_rsdp_t *rsdp)
{
acpi_srat_t *srat;
diff --git a/src/northbridge/amd/pi/00730F01/northbridge.c b/src/northbridge/amd/pi/00730F01/northbridge.c
index 2e46b16..3e5b2b2 100644
--- a/src/northbridge/amd/pi/00730F01/northbridge.c
+++ b/src/northbridge/amd/pi/00730F01/northbridge.c
@@ -486,7 +486,8 @@
acpigen_pop_len();
}
-static unsigned long agesa_write_acpi_tables(unsigned long current,
+static unsigned long agesa_write_acpi_tables(device_t device,
+ unsigned long current,
acpi_rsdp_t *rsdp)
{
acpi_srat_t *srat;
diff --git a/src/northbridge/intel/gm45/acpi.c b/src/northbridge/intel/gm45/acpi.c
index a1cfdb5..daa5aed 100644
--- a/src/northbridge/intel/gm45/acpi.c
+++ b/src/northbridge/intel/gm45/acpi.c
@@ -109,7 +109,9 @@
}
#define ALIGN_CURRENT current = (ALIGN(current, 16))
-unsigned long northbridge_write_acpi_tables(unsigned long start, struct acpi_rsdp *rsdp)
+unsigned long northbridge_write_acpi_tables(device_t device,
+ unsigned long start,
+ struct acpi_rsdp *rsdp)
{
unsigned long current;
#if CONFIG_IOMMU
diff --git a/src/northbridge/intel/gm45/gm45.h b/src/northbridge/intel/gm45/gm45.h
index db3db00..cb946fc 100644
--- a/src/northbridge/intel/gm45/gm45.h
+++ b/src/northbridge/intel/gm45/gm45.h
@@ -25,6 +25,7 @@
#ifndef __ACPI__
+#include <rules.h>
#include <stdint.h>
typedef enum {
@@ -435,8 +436,13 @@
void init_iommu(void);
+#if ENV_RAMSTAGE
+#include <device/device.h>
+
struct acpi_rsdp;
-unsigned long northbridge_write_acpi_tables(unsigned long start, struct acpi_rsdp *rsdp);
+unsigned long northbridge_write_acpi_tables(device_t device, unsigned long start, struct acpi_rsdp *rsdp);
#endif
+
+#endif /* !__ACPI__ */
#endif /* __NORTHBRIDGE_INTEL_GM45_GM45_H__ */
diff --git a/src/soc/intel/fsp_baytrail/acpi.c b/src/soc/intel/fsp_baytrail/acpi.c
index 9b0d148..ed607b3 100644
--- a/src/soc/intel/fsp_baytrail/acpi.c
+++ b/src/soc/intel/fsp_baytrail/acpi.c
@@ -569,12 +569,13 @@
#define ALIGN_CURRENT current = (ALIGN(current, 16))
-unsigned long southcluster_write_acpi_tables(unsigned long current,
+unsigned long southcluster_write_acpi_tables(device_t device,
+ unsigned long current,
struct acpi_rsdp *rsdp)
{
acpi_header_t *ssdt2;
- current = acpi_write_hpet(current, rsdp);
+ current = acpi_write_hpet(device, current, rsdp);
ALIGN_CURRENT;
ssdt2 = (acpi_header_t *)current;
diff --git a/src/soc/intel/fsp_baytrail/baytrail/acpi.h b/src/soc/intel/fsp_baytrail/baytrail/acpi.h
index 1e60508..0cd978d 100644
--- a/src/soc/intel/fsp_baytrail/baytrail/acpi.h
+++ b/src/soc/intel/fsp_baytrail/baytrail/acpi.h
@@ -30,7 +30,8 @@
void acpi_fill_in_fadt(acpi_fadt_t * fadt, acpi_facs_t * facs, void *dsdt);
unsigned long acpi_madt_irq_overrides(unsigned long current);
void acpi_init_gnvs(global_nvs_t *gnvs);
-unsigned long southcluster_write_acpi_tables(unsigned long current,
+unsigned long southcluster_write_acpi_tables(device_t device,
+ unsigned long current,
struct acpi_rsdp *rsdp);
void southcluster_inject_dsdt(device_t device);
diff --git a/src/southbridge/intel/lynxpoint/lpc.c b/src/southbridge/intel/lynxpoint/lpc.c
index 50f48cb..8308f41 100644
--- a/src/southbridge/intel/lynxpoint/lpc.c
+++ b/src/southbridge/intel/lynxpoint/lpc.c
@@ -786,7 +786,9 @@
}
#define ALIGN_CURRENT current = (ALIGN(current, 16))
-static unsigned long southbridge_write_acpi_tables(unsigned long start, struct acpi_rsdp *rsdp)
+static unsigned long southbridge_write_acpi_tables(device_t device,
+ unsigned long start,
+ struct acpi_rsdp *rsdp)
{
unsigned long current;
acpi_hpet_t *hpet;