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@gmail.com> Reviewed-on: http://review.coreboot.org/6939 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
parent
efb2a8f7f3
commit
41877d8690
|
@ -687,6 +687,11 @@ void acpi_create_fadt(acpi_fadt_t *fadt,acpi_facs_t *facs, void *dsdt)
|
||||||
|
|
||||||
extern const unsigned char AmlCode[];
|
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))
|
#define ALIGN_CURRENT current = (ALIGN(current, 16))
|
||||||
unsigned long write_acpi_tables(unsigned long start)
|
unsigned long write_acpi_tables(unsigned long start)
|
||||||
{
|
{
|
||||||
|
@ -704,12 +709,17 @@ unsigned long write_acpi_tables(unsigned long start)
|
||||||
acpi_mcfg_t *mcfg;
|
acpi_mcfg_t *mcfg;
|
||||||
acpi_madt_t *madt;
|
acpi_madt_t *madt;
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
|
unsigned long fw;
|
||||||
|
|
||||||
current = start;
|
current = start;
|
||||||
|
|
||||||
/* Align ACPI tables to 16byte */
|
/* Align ACPI tables to 16byte */
|
||||||
ALIGN_CURRENT;
|
ALIGN_CURRENT;
|
||||||
|
|
||||||
|
fw = fw_cfg_acpi_tables(current);
|
||||||
|
if (fw)
|
||||||
|
return fw;
|
||||||
|
|
||||||
printk(BIOS_INFO, "ACPI: Writing ACPI tables at %lx.\n", start);
|
printk(BIOS_INFO, "ACPI: Writing ACPI tables at %lx.\n", start);
|
||||||
|
|
||||||
/* We need at least an RSDP and an RSDT Table */
|
/* We need at least an RSDP and an RSDT Table */
|
||||||
|
|
|
@ -482,6 +482,8 @@ typedef struct acpi_tstate {
|
||||||
u32 status;
|
u32 status;
|
||||||
} __attribute__ ((packed)) acpi_tstate_t;
|
} __attribute__ ((packed)) acpi_tstate_t;
|
||||||
|
|
||||||
|
unsigned long fw_cfg_acpi_tables(unsigned long start);
|
||||||
|
|
||||||
/* These are implemented by the target port or north/southbridge. */
|
/* These are implemented by the target port or north/southbridge. */
|
||||||
unsigned long write_acpi_tables(unsigned long addr);
|
unsigned long write_acpi_tables(unsigned long addr);
|
||||||
unsigned long acpi_fill_madt(unsigned long current);
|
unsigned long acpi_fill_madt(unsigned long current);
|
||||||
|
|
|
@ -19,8 +19,6 @@
|
||||||
|
|
||||||
#include <arch/acpi.h>
|
#include <arch/acpi.h>
|
||||||
|
|
||||||
extern const unsigned char AmlCode[];
|
|
||||||
|
|
||||||
unsigned long acpi_fill_madt(unsigned long current)
|
unsigned long acpi_fill_madt(unsigned long current)
|
||||||
{
|
{
|
||||||
/* mainboard has no ioapic */
|
/* mainboard has no ioapic */
|
||||||
|
|
|
@ -12,6 +12,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
|
||||||
select MAINBOARD_HAS_NATIVE_VGA_INIT
|
select MAINBOARD_HAS_NATIVE_VGA_INIT
|
||||||
select MAINBOARD_DO_NATIVE_VGA_INIT
|
select MAINBOARD_DO_NATIVE_VGA_INIT
|
||||||
select MAINBOARD_HAS_NATIVE_VGA_INIT_TEXTMODECFG
|
select MAINBOARD_HAS_NATIVE_VGA_INIT_TEXTMODECFG
|
||||||
|
select PER_DEVICE_ACPI_TABLES
|
||||||
|
|
||||||
config MAINBOARD_DIR
|
config MAINBOARD_DIR
|
||||||
string
|
string
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
unsigned long northbridge_write_acpi_tables(unsigned long start);
|
|
@ -30,11 +30,7 @@
|
||||||
#include <cpu/x86/msr.h>
|
#include <cpu/x86/msr.h>
|
||||||
|
|
||||||
#include "fw_cfg.h"
|
#include "fw_cfg.h"
|
||||||
|
#include "acpi.h"
|
||||||
extern const unsigned char AmlCode[];
|
|
||||||
#if CONFIG_HAVE_ACPI_SLIC
|
|
||||||
unsigned long acpi_create_slic(unsigned long current);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
unsigned long acpi_fill_madt(unsigned long current)
|
unsigned long acpi_fill_madt(unsigned long current)
|
||||||
{
|
{
|
||||||
|
@ -54,12 +50,6 @@ unsigned long acpi_fill_madt(unsigned long current)
|
||||||
return 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)
|
unsigned long acpi_fill_slit(unsigned long current)
|
||||||
{
|
{
|
||||||
// Not implemented
|
// Not implemented
|
||||||
|
@ -71,125 +61,3 @@ unsigned long acpi_fill_srat(unsigned long current)
|
||||||
/* No NUMA, no SRAT */
|
/* No NUMA, no SRAT */
|
||||||
return current;
|
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;
|
|
||||||
}
|
|
||||||
|
|
|
@ -19,4 +19,3 @@ void fw_cfg_get(int entry, void *dst, int dstlen);
|
||||||
int fw_cfg_check_file(const char *name);
|
int fw_cfg_check_file(const char *name);
|
||||||
void fw_cfg_load_file(const char *name, void *dst);
|
void fw_cfg_load_file(const char *name, void *dst);
|
||||||
int fw_cfg_max_cpus(void);
|
int fw_cfg_max_cpus(void);
|
||||||
unsigned long fw_cfg_acpi_tables(unsigned long start);
|
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include "fw_cfg_if.h"
|
#include "fw_cfg_if.h"
|
||||||
|
|
||||||
#include "memory.c"
|
#include "memory.c"
|
||||||
|
#include "acpi.h"
|
||||||
|
|
||||||
static unsigned long qemu_get_high_memory_size(void)
|
static unsigned long qemu_get_high_memory_size(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,11 +30,23 @@
|
||||||
#include <cpu/x86/msr.h>
|
#include <cpu/x86/msr.h>
|
||||||
|
|
||||||
#include "../qemu-i440fx/fw_cfg.h"
|
#include "../qemu-i440fx/fw_cfg.h"
|
||||||
|
#include "../qemu-i440fx/acpi.h"
|
||||||
|
#include "southbridge/intel/i82801ix/nvs.h"
|
||||||
|
|
||||||
|
void acpi_create_gnvs(global_nvs_t *gnvs)
|
||||||
|
{
|
||||||
|
memset((void *)gnvs, 0, sizeof(*gnvs));
|
||||||
|
gnvs->apic = 1;
|
||||||
|
gnvs->mpen = 1; /* Enable Multi Processing */
|
||||||
|
|
||||||
|
/* Enable both COM ports */
|
||||||
|
gnvs->cmap = 0x01;
|
||||||
|
gnvs->cmbp = 0x01;
|
||||||
|
|
||||||
|
/* IGD Displays */
|
||||||
|
gnvs->ndid = 0; /* Will use default of 0x00000400. */
|
||||||
|
}
|
||||||
|
|
||||||
extern const unsigned char AmlCode[];
|
|
||||||
#if CONFIG_HAVE_ACPI_SLIC
|
|
||||||
unsigned long acpi_create_slic(unsigned long current);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void acpi_create_fadt(acpi_fadt_t * fadt, acpi_facs_t * facs, void *dsdt)
|
void acpi_create_fadt(acpi_fadt_t * fadt, acpi_facs_t * facs, void *dsdt)
|
||||||
{
|
{
|
||||||
|
@ -186,12 +198,6 @@ unsigned long acpi_fill_madt(unsigned long current)
|
||||||
return 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)
|
unsigned long acpi_fill_slit(unsigned long current)
|
||||||
{
|
{
|
||||||
// Not implemented
|
// Not implemented
|
||||||
|
@ -221,125 +227,3 @@ unsigned long acpi_fill_srat(unsigned long current)
|
||||||
/* No NUMA, no SRAT */
|
/* No NUMA, no SRAT */
|
||||||
return current;
|
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;
|
|
||||||
}
|
|
||||||
|
|
|
@ -6,3 +6,11 @@ config BOOTBLOCK_SOUTHBRIDGE_INIT
|
||||||
default "southbridge/intel/i82371eb/bootblock.c"
|
default "southbridge/intel/i82371eb/bootblock.c"
|
||||||
depends on SOUTHBRIDGE_INTEL_I82371EB
|
depends on SOUTHBRIDGE_INTEL_I82371EB
|
||||||
|
|
||||||
|
|
||||||
|
if SOUTHBRIDGE_INTEL_I82371EB
|
||||||
|
|
||||||
|
config SOUTH_BRIDGE_OPTIONS # dummy
|
||||||
|
def_bool y
|
||||||
|
select PER_DEVICE_ACPI_TABLES
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
|
@ -28,8 +28,6 @@
|
||||||
#include <device/pci_ids.h>
|
#include <device/pci_ids.h>
|
||||||
#include "i82371eb.h"
|
#include "i82371eb.h"
|
||||||
|
|
||||||
extern const unsigned char AmlCode[];
|
|
||||||
|
|
||||||
static int determine_total_number_of_cores(void)
|
static int determine_total_number_of_cores(void)
|
||||||
{
|
{
|
||||||
device_t cpu;
|
device_t cpu;
|
||||||
|
@ -49,21 +47,18 @@ static int determine_total_number_of_cores(void)
|
||||||
|
|
||||||
void generate_cpu_entries(void)
|
void generate_cpu_entries(void)
|
||||||
{
|
{
|
||||||
int len;
|
|
||||||
int len_pr;
|
|
||||||
int cpu, pcontrol_blk=DEFAULT_PMBASE+PCNTRL, plen=6;
|
int cpu, pcontrol_blk=DEFAULT_PMBASE+PCNTRL, plen=6;
|
||||||
int numcpus = determine_total_number_of_cores();
|
int numcpus = determine_total_number_of_cores();
|
||||||
printk(BIOS_DEBUG, "Found %d CPU(s).\n", numcpus);
|
printk(BIOS_DEBUG, "Found %d CPU(s).\n", numcpus);
|
||||||
|
|
||||||
/* without the outer scope, furhter ssdt addition will end up
|
/* without the outer scope, furhter ssdt addition will end up
|
||||||
* within the processor statement */
|
* within the processor statement */
|
||||||
len = acpigen_write_scope("\\_PR");
|
acpigen_write_scope("\\_PR");
|
||||||
for (cpu=0; cpu < numcpus; cpu++) {
|
for (cpu=0; cpu < numcpus; cpu++) {
|
||||||
len_pr = acpigen_write_processor(cpu, pcontrol_blk, plen);
|
acpigen_write_processor(cpu, pcontrol_blk, plen);
|
||||||
acpigen_patch_len(len_pr - 1);
|
acpigen_pop_len();
|
||||||
len += len_pr;
|
|
||||||
}
|
}
|
||||||
acpigen_patch_len(len - 1);
|
acpigen_pop_len();
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long __attribute__((weak)) acpi_fill_slit(unsigned long current)
|
unsigned long __attribute__((weak)) acpi_fill_slit(unsigned long current)
|
||||||
|
@ -83,90 +78,3 @@ unsigned long acpi_fill_mcfg(unsigned long current)
|
||||||
/* chipset doesn't have mmconfig */
|
/* chipset doesn't have mmconfig */
|
||||||
return current;
|
return current;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long __attribute__((weak)) 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
|
|
||||||
* last or else the following entries will end up inside the
|
|
||||||
* processor scope */
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include <arch/io.h>
|
#include <arch/io.h>
|
||||||
#include <device/device.h>
|
#include <device/device.h>
|
||||||
#include "chip.h"
|
#include "chip.h"
|
||||||
|
|
||||||
void i82371eb_enable(device_t dev);
|
void i82371eb_enable(device_t dev);
|
||||||
void i82371eb_hard_reset(void);
|
void i82371eb_hard_reset(void);
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -26,6 +26,10 @@
|
||||||
#include <pc80/isa-dma.h>
|
#include <pc80/isa-dma.h>
|
||||||
#include <pc80/mc146818rtc.h>
|
#include <pc80/mc146818rtc.h>
|
||||||
#include <arch/ioapic.h>
|
#include <arch/ioapic.h>
|
||||||
|
#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
|
||||||
|
#include <arch/acpi.h>
|
||||||
|
#include <arch/acpigen.h>
|
||||||
|
#endif
|
||||||
#include "i82371eb.h"
|
#include "i82371eb.h"
|
||||||
|
|
||||||
#if CONFIG_IOAPIC
|
#if CONFIG_IOAPIC
|
||||||
|
@ -124,10 +128,22 @@ static void sb_read_resources(struct device *dev)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
|
||||||
|
static void southbridge_acpi_fill_ssdt_generator(void)
|
||||||
|
{
|
||||||
|
acpigen_write_mainboard_resources("\\_SB.PCI0.MBRS", "_CRS");
|
||||||
|
generate_cpu_entries();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static const struct device_operations isa_ops = {
|
static const struct device_operations isa_ops = {
|
||||||
.read_resources = sb_read_resources,
|
.read_resources = sb_read_resources,
|
||||||
.set_resources = pci_dev_set_resources,
|
.set_resources = pci_dev_set_resources,
|
||||||
.enable_resources = pci_dev_enable_resources,
|
.enable_resources = pci_dev_enable_resources,
|
||||||
|
#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
|
||||||
|
.write_acpi_tables = acpi_write_hpet,
|
||||||
|
.acpi_fill_ssdt_generator = southbridge_acpi_fill_ssdt_generator,
|
||||||
|
#endif
|
||||||
.init = isa_init,
|
.init = isa_init,
|
||||||
.scan_bus = scan_static_bus, /* TODO: Needed? */
|
.scan_bus = scan_static_bus, /* TODO: Needed? */
|
||||||
.enable = 0,
|
.enable = 0,
|
||||||
|
|
|
@ -27,6 +27,7 @@ config SOUTHBRIDGE_INTEL_I82801IX
|
||||||
select USE_WATCHDOG_ON_BOOT
|
select USE_WATCHDOG_ON_BOOT
|
||||||
select HAVE_SMI_HANDLER
|
select HAVE_SMI_HANDLER
|
||||||
select HAVE_USBDEBUG_OPTIONS
|
select HAVE_USBDEBUG_OPTIONS
|
||||||
|
select PER_DEVICE_ACPI_TABLES
|
||||||
|
|
||||||
if SOUTHBRIDGE_INTEL_I82801IX
|
if SOUTHBRIDGE_INTEL_I82801IX
|
||||||
|
|
||||||
|
|
|
@ -539,7 +539,6 @@ static void set_subsystem(device_t dev, unsigned vendor, unsigned device)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_PER_DEVICE_ACPI_TABLES)
|
|
||||||
static void southbridge_inject_dsdt(void)
|
static void southbridge_inject_dsdt(void)
|
||||||
{
|
{
|
||||||
global_nvs_t *gnvs = cbmem_add (CBMEM_ID_ACPI_GNVS, sizeof (*gnvs));
|
global_nvs_t *gnvs = cbmem_add (CBMEM_ID_ACPI_GNVS, sizeof (*gnvs));
|
||||||
|
@ -564,7 +563,6 @@ static void southbridge_fill_ssdt(void)
|
||||||
|
|
||||||
intel_acpi_pcie_hotplug_generator(chip->pcie_hotplug_map, 8);
|
intel_acpi_pcie_hotplug_generator(chip->pcie_hotplug_map, 8);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static struct pci_operations pci_ops = {
|
static struct pci_operations pci_ops = {
|
||||||
.set_subsystem = set_subsystem,
|
.set_subsystem = set_subsystem,
|
||||||
|
@ -574,11 +572,9 @@ static struct device_operations device_ops = {
|
||||||
.read_resources = i82801ix_lpc_read_resources,
|
.read_resources = i82801ix_lpc_read_resources,
|
||||||
.set_resources = pci_dev_set_resources,
|
.set_resources = pci_dev_set_resources,
|
||||||
.enable_resources = pci_dev_enable_resources,
|
.enable_resources = pci_dev_enable_resources,
|
||||||
#if IS_ENABLED(CONFIG_PER_DEVICE_ACPI_TABLES)
|
|
||||||
.acpi_inject_dsdt_generator = southbridge_inject_dsdt,
|
.acpi_inject_dsdt_generator = southbridge_inject_dsdt,
|
||||||
.write_acpi_tables = acpi_write_hpet,
|
.write_acpi_tables = acpi_write_hpet,
|
||||||
.acpi_fill_ssdt_generator = southbridge_fill_ssdt,
|
.acpi_fill_ssdt_generator = southbridge_fill_ssdt,
|
||||||
#endif
|
|
||||||
.init = lpc_init,
|
.init = lpc_init,
|
||||||
.scan_bus = scan_static_bus,
|
.scan_bus = scan_static_bus,
|
||||||
.ops_pci = &pci_ops,
|
.ops_pci = &pci_ops,
|
||||||
|
|
Loading…
Reference in New Issue