device_ops: add device_t argument to acpi_fill_ssdt_generator

`device_t device` is missing as argument. Every device_op function
should have a `device_t device` argument.

Change-Id: I7fca8c3fa15c1be672e50e4422d7ac8e4aaa1e36
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Reviewed-on: http://review.coreboot.org/9598
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
Alexander Couzens 2015-04-12 22:18:55 +02:00 committed by Stefan Reinauer
parent a90dad1bf0
commit 5eea458822
51 changed files with 60 additions and 53 deletions

View File

@ -325,7 +325,7 @@ void acpi_create_ssdt_generator(acpi_header_t *ssdt, const char *oem_table_id)
struct device *dev;
for (dev = all_devices; dev; dev = dev->next)
if (dev->ops && dev->ops->acpi_fill_ssdt_generator) {
dev->ops->acpi_fill_ssdt_generator();
dev->ops->acpi_fill_ssdt_generator(dev);
}
current = (unsigned long) acpigen_get_current();
}

View File

@ -29,6 +29,7 @@
#include <stdint.h>
#include <rules.h>
#include <device/device.h>
#define RSDP_SIG "RSD PTR " /* RSDT pointer signature */
#define ACPI_TABLE_CREATOR "COREBOOT" /* Must be exactly 8 bytes long! */
@ -539,7 +540,7 @@ void acpi_create_hpet(acpi_hpet_t *hpet);
unsigned long acpi_write_hpet(unsigned long start, acpi_rsdp_t *rsdp);
/* cpu/intel/speedstep/acpi.c */
void generate_cpu_entries(void);
void generate_cpu_entries(device_t device);
#endif
void acpi_create_mcfg(acpi_mcfg_t *mcfg);

View File

@ -302,7 +302,7 @@ static void generate_P_state_entries(int core, int cores_per_package)
acpigen_pop_len();
}
void generate_cpu_entries(void)
void generate_cpu_entries(device_t device)
{
int coreID, cpuID, pcontrol_blk = PMB0_BASE, plen = 6;
int totalcores = dev_count_cpu();

View File

@ -263,7 +263,7 @@ static void generate_P_state_entries(int core, int cores_per_package)
acpigen_pop_len();
}
void generate_cpu_entries(void)
void generate_cpu_entries(device_t device)
{
int coreID, cpuID, pcontrol_blk = PMB0_BASE, plen = 6;
int totalcores = dev_count_cpu();

View File

@ -307,7 +307,7 @@ static void generate_P_state_entries(int core, int cores_per_package)
acpigen_pop_len();
}
void generate_cpu_entries(void)
void generate_cpu_entries(device_t device)
{
int coreID, cpuID, pcontrol_blk = get_pmbase(), plen = 6;
int totalcores = dev_count_cpu();

View File

@ -299,7 +299,7 @@ static void generate_P_state_entries(int core, int cores_per_package)
acpigen_pop_len();
}
void generate_cpu_entries(void)
void generate_cpu_entries(device_t device)
{
int coreID, cpuID, pcontrol_blk = PMB0_BASE, plen = 6;
int totalcores = dev_count_cpu();

View File

@ -302,7 +302,7 @@ static void generate_P_state_entries(int core, int cores_per_package)
acpigen_pop_len();
}
void generate_cpu_entries(void)
void generate_cpu_entries(device_t device)
{
int coreID, cpuID, pcontrol_blk = PMB0_BASE, plen = 6;
int totalcores = dev_count_cpu();

View File

@ -117,7 +117,7 @@ static void gen_pstate_entries(const sst_table_t *const pstates,
/**
* @brief Generate ACPI entries for Speedstep for each cpu
*/
void generate_cpu_entries(void)
void generate_cpu_entries(device_t device)
{
int coreID, cpuID, pcontrol_blk = PMB0_BASE, plen = 6;
int totalcores = determine_total_number_of_cores();

View File

@ -57,7 +57,7 @@ struct device_operations {
#endif
#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
unsigned long (*write_acpi_tables)(unsigned long start, struct acpi_rsdp *rsdp);
void (*acpi_fill_ssdt_generator)(void);
void (*acpi_fill_ssdt_generator)(device_t dev);
void (*acpi_inject_dsdt_generator)(device_t dev);
#endif
const struct pci_operations *ops_pci;

View File

@ -32,7 +32,7 @@
#include <ec/lenovo/h8/h8.h>
#include "drivers/lenovo/lenovo.h"
static void fill_ssdt(void)
static void fill_ssdt(device_t device)
{
drivers_lenovo_serial_ports_ssdt_generate("\\_SB.PCI0.LPCB", 0);
}

View File

@ -87,7 +87,7 @@ static void mainboard_init(device_t dev)
printk(BIOS_SPEW, "SPI configured\n");
}
static void fill_ssdt(void)
static void fill_ssdt(device_t device)
{
drivers_lenovo_serial_ports_ssdt_generate("\\_SB.PCI0.LPCB", 0);
}

View File

@ -99,7 +99,7 @@ static void mainboard_init(device_t dev)
}
}
static void fill_ssdt(void)
static void fill_ssdt(device_t device)
{
drivers_lenovo_serial_ports_ssdt_generate("\\_SB.PCI0.LPCB", 1);
}

View File

@ -6,7 +6,7 @@
#include <arch/acpigen.h>
#include <cpu/amd/amdk8_sysconf.h>
static void mainboard_acpi_fill_ssdt_generator(void) {
static void mainboard_acpi_fill_ssdt_generator(device_t device) {
amd_generate_powernow(0, 0, 0);
}

View File

@ -6,7 +6,7 @@
#include <arch/acpigen.h>
#include <cpu/amd/amdk8_sysconf.h>
static void mainboard_acpi_fill_ssdt_generator(void) {
static void mainboard_acpi_fill_ssdt_generator(device_t device) {
amd_generate_powernow(0, 0, 0);
}

View File

@ -8,7 +8,7 @@
extern u16 pm_base;
static void mainboard_acpi_fill_ssdt_generator(void) {
static void mainboard_acpi_fill_ssdt_generator(device_t device) {
amd_generate_powernow(0, 0, 0);
}

View File

@ -6,7 +6,7 @@
#include <arch/acpigen.h>
#include <cpu/amd/amdk8_sysconf.h>
static void mainboard_acpi_fill_ssdt_generator(void) {
static void mainboard_acpi_fill_ssdt_generator(device_t device) {
amd_generate_powernow(0, 0, 0);
}

View File

@ -811,7 +811,7 @@ static unsigned long acpi_fill_hest(acpi_hest_t *hest)
return (unsigned long)current;
}
static void northbridge_fill_ssdt_generator(void)
static void northbridge_fill_ssdt_generator(device_t device)
{
msr_t msr;
char pscope[] = "\\_SB.PCI0";

View File

@ -793,7 +793,7 @@ static void cpu_bus_init(device_t dev)
/* North Bridge Structures */
static void northbridge_fill_ssdt_generator(void)
static void northbridge_fill_ssdt_generator(device_t device)
{
msr_t msr;
char pscope[] = "\\_SB.PCI0";

View File

@ -502,7 +502,7 @@ static unsigned long acpi_fill_hest(acpi_hest_t *hest)
return (unsigned long)current;
}
static void northbridge_fill_ssdt_generator(void)
static void northbridge_fill_ssdt_generator(device_t device)
{
msr_t msr;
char pscope[] = "\\_SB.PCI0";

View File

@ -477,7 +477,7 @@ static unsigned long acpi_fill_hest(acpi_hest_t *hest)
return (unsigned long)current;
}
static void northbridge_fill_ssdt_generator(void)
static void northbridge_fill_ssdt_generator(device_t device)
{
msr_t msr;
char pscope[] = "\\_SB.PCI0";

View File

@ -477,7 +477,7 @@ static unsigned long acpi_fill_hest(acpi_hest_t *hest)
return (unsigned long)current;
}
static void northbridge_fill_ssdt_generator(void)
static void northbridge_fill_ssdt_generator(device_t device)
{
msr_t msr;
char pscope[] = "\\_SB.PCI0";

View File

@ -477,7 +477,7 @@ static unsigned long acpi_fill_hest(acpi_hest_t *hest)
return (unsigned long)current;
}
static void northbridge_fill_ssdt_generator(void)
static void northbridge_fill_ssdt_generator(device_t device)
{
msr_t msr;
char pscope[] = "\\_SB.PCI0";

View File

@ -196,7 +196,7 @@ void update_ssdtx(void *ssdtx, int i)
}
void northbridge_acpi_write_vars(void)
void northbridge_acpi_write_vars(device_t device)
{
/*
* If more than one physical CPU is installed, northbridge_acpi_write_vars()

View File

@ -1076,6 +1076,6 @@ struct acpi_rsdp;
unsigned long northbridge_write_acpi_tables(unsigned long start,
struct acpi_rsdp *rsdp);
void northbridge_acpi_write_vars(void);
void northbridge_acpi_write_vars(device_t device);
#endif /* AMDFAM10_H */

View File

@ -277,7 +277,7 @@ static void k8acpi_write_pci_data(int dlen, const char *name, int offset) {
acpigen_pop_len();
}
void k8acpi_write_vars(void)
void k8acpi_write_vars(device_t device)
{
msr_t msr;
char pscope[] = "\\_SB.PCI0";

View File

@ -21,7 +21,7 @@
#define AMDK8_ACPI_H
#include <arch/acpigen.h>
void k8acpi_write_vars(void);
void k8acpi_write_vars(device_t device);
unsigned long northbridge_write_acpi_tables(unsigned long start, acpi_rsdp_t *rsdp);
#endif

View File

@ -471,7 +471,7 @@ static unsigned long acpi_fill_hest(acpi_hest_t *hest)
return (unsigned long)current;
}
static void northbridge_fill_ssdt_generator(void)
static void northbridge_fill_ssdt_generator(device_t device)
{
msr_t msr;
char pscope[] = "\\_SB.PCI0";

View File

@ -465,7 +465,7 @@ static unsigned long acpi_fill_hest(acpi_hest_t *hest)
return (unsigned long)current;
}
static void northbridge_fill_ssdt_generator(void)
static void northbridge_fill_ssdt_generator(device_t device)
{
msr_t msr;
char pscope[] = "\\_SB.PCI0";

View File

@ -65,7 +65,7 @@ unsigned long acpi_fill_mcfg(unsigned long current)
return current;
}
void northbridge_acpi_fill_ssdt_generator(void)
void northbridge_acpi_fill_ssdt_generator(device_t device)
{
u32 bmbound;
char pscope[] = "\\_SB.PCI0";
@ -74,5 +74,5 @@ void northbridge_acpi_fill_ssdt_generator(void)
acpigen_write_scope(pscope);
acpigen_write_name_dword("BMBD", bmbound);
acpigen_pop_len();
generate_cpu_entries();
generate_cpu_entries(device);
}

View File

@ -27,6 +27,9 @@
/* Everything below this line is ignored in the DSDT */
#ifndef __ACPI__
#include <rules.h>
#include <device/device.h>
/* Device 0:0.0 PCI configuration space (Host Bridge) */
/* SideBand B-UNIT */
@ -72,7 +75,10 @@ void dump_pci_devices(void);
void dump_spd_registers(void);
void dump_mem(unsigned start, unsigned end);
void report_platform_info(void);
void northbridge_acpi_fill_ssdt_generator(void);
#if ENV_RAMSTAGE
void northbridge_acpi_fill_ssdt_generator(device_t device);
#endif
#endif /* #ifndef __ASSEMBLER__ */
#endif /* #ifndef __ACPI__ */

View File

@ -74,7 +74,7 @@ intel_gma_get_controller_info(void)
return &chip->gfx;
}
static void gma_ssdt(void)
static void gma_ssdt(device_t device)
{
const struct i915_gpu_controller_info *gfx = intel_gma_get_controller_info();
if (!gfx) {

View File

@ -502,7 +502,7 @@ intel_gma_get_controller_info(void)
return &chip->gfx;
}
static void gma_ssdt(void)
static void gma_ssdt(device_t device)
{
const struct i915_gpu_controller_info *gfx = intel_gma_get_controller_info();
if (!gfx) {

View File

@ -498,7 +498,7 @@ intel_gma_get_controller_info(void)
return &chip->gfx;
}
static void gma_ssdt(void)
static void gma_ssdt(device_t device)
{
const struct i915_gpu_controller_info *gfx = intel_gma_get_controller_info();
if (!gfx) {

View File

@ -499,7 +499,7 @@ intel_gma_get_controller_info(void)
return &chip->gfx;
}
static void gma_ssdt(void)
static void gma_ssdt(device_t device)
{
const struct i915_gpu_controller_info *gfx = intel_gma_get_controller_info();
if (!gfx) {

View File

@ -1082,7 +1082,7 @@ intel_gma_get_controller_info(void)
return &chip->gfx;
}
static void gma_ssdt(void)
static void gma_ssdt(device_t device)
{
const struct i915_gpu_controller_info *gfx = intel_gma_get_controller_info();
if (!gfx) {

View File

@ -624,7 +624,7 @@ intel_gma_get_controller_info(void)
return &chip->gfx;
}
static void gma_ssdt(void)
static void gma_ssdt(device_t device)
{
const struct i915_gpu_controller_info *gfx = intel_gma_get_controller_info();
if (!gfx) {

View File

@ -57,7 +57,7 @@ intel_gma_get_controller_info(void)
return &chip->gfx;
}
static void gma_ssdt(void)
static void gma_ssdt(device_t device)
{
const struct i915_gpu_controller_info *gfx = intel_gma_get_controller_info();
if (!gfx) {

View File

@ -447,7 +447,7 @@ static void generate_P_state_entries(int core, int cores_per_package)
acpigen_pop_len();
}
void generate_cpu_entries(void)
void generate_cpu_entries(device_t device)
{
int core;
int pcontrol_blk = get_pmbase(), plen = 6;

View File

@ -537,7 +537,7 @@ static void generate_P_state_entries(int core, int cores_per_package)
acpigen_pop_len();
}
void generate_cpu_entries(void)
void generate_cpu_entries(device_t device)
{
int coreID, cpuID, pcontrol_blk = ACPI_BASE_ADDRESS, plen = 6;
int totalcores = dev_count_cpu();

View File

@ -513,7 +513,7 @@ static void generate_P_state_entries(int core, int cores_per_package)
acpigen_pop_len();
}
void generate_cpu_entries(void)
void generate_cpu_entries(device_t device)
{
int core;
int pcontrol_blk = get_pmbase(), plen = 6;

View File

@ -128,7 +128,7 @@ unsigned long acpi_fill_mcfg(unsigned long current)
return current;
}
static void southbridge_acpi_fill_ssdt_generator(void) {
static void southbridge_acpi_fill_ssdt_generator(device_t device) {
#if CONFIG_SET_FIDVID
amd_generate_powernow(pm_base + 0x10, 6, 1);
acpigen_write_mainboard_resources("\\_SB.PCI0.MBRS", "_CRS");

View File

@ -223,7 +223,7 @@ static void sb600_lpc_enable_resources(device_t dev)
extern u16 pm_base;
static void southbridge_acpi_fill_ssdt_generator(void) {
static void southbridge_acpi_fill_ssdt_generator(device_t device) {
amd_generate_powernow(pm_base + 8, 6, 1);
}

View File

@ -267,7 +267,7 @@ static void sb700_lpc_enable_resources(device_t dev)
#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
static void southbridge_acpi_fill_ssdt_generator(void) {
static void southbridge_acpi_fill_ssdt_generator(device_t device) {
amd_generate_powernow(ACPI_CPU_CONTROL, 6, 1);
}

View File

@ -797,7 +797,7 @@ void acpi_fill_fadt(acpi_fadt_t *fadt)
fadt->x_gpe1_blk.addrh = 0x0;
}
static void southbridge_fill_ssdt(void)
static void southbridge_fill_ssdt(device_t device)
{
device_t dev = dev_find_slot(0, PCI_DEVFN(0x1f,0));
config_t *chip = dev->chip_info;

View File

@ -45,7 +45,7 @@ static int determine_total_number_of_cores(void)
return count;
}
void generate_cpu_entries(void)
void generate_cpu_entries(device_t device)
{
int cpu, pcontrol_blk=DEFAULT_PMBASE+PCNTRL, plen=6;
int numcpus = determine_total_number_of_cores();

View File

@ -129,10 +129,10 @@ static void sb_read_resources(struct device *dev)
}
#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
static void southbridge_acpi_fill_ssdt_generator(void)
static void southbridge_acpi_fill_ssdt_generator(device_t device)
{
acpigen_write_mainboard_resources("\\_SB.PCI0.MBRS", "_CRS");
generate_cpu_entries();
generate_cpu_entries(device);
}
#endif

View File

@ -562,7 +562,7 @@ static void southbridge_inject_dsdt(device_t dev)
}
}
static void southbridge_fill_ssdt(void)
static void southbridge_fill_ssdt(device_t device)
{
device_t dev = dev_find_slot(0, PCI_DEVFN(0x1f,0));
config_t *chip = dev->chip_info;

View File

@ -784,7 +784,7 @@ void acpi_fill_fadt(acpi_fadt_t *fadt)
fadt->x_gpe1_blk.addrh = 0x0;
}
static void southbridge_fill_ssdt(void)
static void southbridge_fill_ssdt(device_t device)
{
device_t dev = dev_find_slot(0, PCI_DEVFN(0x1f,0));
config_t *chip = dev->chip_info;

View File

@ -313,7 +313,7 @@ static void ck804_lpc_enable_resources(device_t dev)
#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
static void southbridge_acpi_fill_ssdt_generator(void)
static void southbridge_acpi_fill_ssdt_generator(device_t device)
{
amd_generate_powernow(0, 0, 0);
}

View File

@ -283,7 +283,7 @@ static const struct pci_driver lpc_driver __pci_driver = {
#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
static void southbridge_acpi_fill_ssdt_generator(void)
static void southbridge_acpi_fill_ssdt_generator(device_t device)
{
amd_generate_powernow(0, 0, 0);
}

View File

@ -126,7 +126,7 @@ static void traf_ctrl_enable_k8t890(struct device *dev)
#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
static void southbridge_acpi_fill_ssdt_generator(void) {
static void southbridge_acpi_fill_ssdt_generator(device_t dev) {
amd_generate_powernow(0, 0, 0);
acpigen_write_mainboard_resources("\\_SB.PCI0.MBRS", "_CRS");
}