/*
- * Initial LinuxBIOS ACPI Support - headers and defines.
+ * coreboot ACPI Support - headers and defines.
*
* written by Stefan Reinauer <stepan@openbios.org>
* (C) 2004 SUSE LINUX AG
#if HAVE_ACPI_TABLES==1
-typedef unsigned long long u64;
+#include <stdint.h>
#define RSDP_SIG "RSD PTR " /* RSDT Pointer signature */
#define RSDP_NAME "RSDP"
#define RSDT_NAME "RSDT"
#define HPET_NAME "HPET"
#define MADT_NAME "APIC"
+#define MCFG_NAME "MCFG"
#define SRAT_NAME "SRAT"
#define SLIT_NAME "SLIT"
+#define SSDT_NAME "SSDT"
#define RSDT_TABLE "RSDT "
#define HPET_TABLE "AMD64 "
+#define MCFG_TABLE "MCFG "
#define MADT_TABLE "MADT "
#define SRAT_TABLE "SRAT "
#define SLIT_TABLE "SLIT "
-#define OEM_ID "LXBIOS"
-#define ASLC "NONE"
+#define OEM_ID "CORE "
+#define ASLC "CORE"
/* ACPI 2.0 table RSDP */
/* RSDT */
typedef struct acpi_rsdt {
struct acpi_table_header header;
- u32 entry[6+ACPI_SSDTX_NUM+CONFIG_MAX_CPUS]; /* HPET, FADT, SRAT, SLIT, MADT(APIC), SSDT, SSDTX, and SSDT for CPU pstate*/
+ u32 entry[7+ACPI_SSDTX_NUM+CONFIG_MAX_CPUS]; /* MCONFIG, HPET, FADT, SRAT, SLIT, MADT(APIC), SSDT, SSDTX, and SSDT for CPU pstate*/
} __attribute__ ((packed)) acpi_rsdt_t;
/* XSDT */
u8 attributes;
} __attribute__ ((packed)) acpi_hpet_t;
+/* MCFG taken from include/linux/acpi.h */
+typedef struct acpi_mcfg {
+ struct acpi_table_header header;
+ u8 reserved[8];
+} __attribute__ ((packed)) acpi_mcfg_t;
+
+typedef struct acpi_mcfg_mmconfig {
+ u32 base_address;
+ u32 base_reserved;
+ u16 pci_segment_group_number;
+ u8 start_bus_number;
+ u8 end_bus_number;
+ u8 reserved[4];
+} __attribute__ ((packed)) acpi_mcfg_mmconfig_t;
+
+
/* SRAT */
typedef struct acpi_srat {
struct acpi_table_header header;
struct acpi_table_header header;
u32 firmware_ctrl;
u32 dsdt;
- u8 res1;
+ u8 model;
u8 preferred_pm_profile;
u16 sci_int;
u32 smi_cmd;
u32 x_firmware_waking_vector_l;
u32 x_firmware_waking_vector_h;
u8 version;
- u8 resv[33];
+ u8 resv[31];
} __attribute__ ((packed)) acpi_facs_t;
/* These are implemented by the target port */
unsigned long write_acpi_tables(unsigned long addr);
unsigned long acpi_fill_madt(unsigned long current);
+unsigned long acpi_fill_mcfg(unsigned long current);
unsigned long acpi_fill_srat(unsigned long current);
+unsigned long acpi_fill_ssdt_generator(unsigned long current, char *oem_table_id);
+void acpi_create_ssdt_generator(acpi_header_t *ssdt, char *oem_table_id);
void acpi_create_fadt(acpi_fadt_t *fadt,acpi_facs_t *facs,void *dsdt);
/* These can be used by the target port */
int acpi_create_srat_lapic(acpi_srat_lapic_t *lapic, u8 node, u8 apic);
int acpi_create_srat_mem(acpi_srat_mem_t *mem, u8 node, u32 basek,u32 sizek, u32 flags);
+int acpi_create_mcfg_mmconfig(acpi_mcfg_mmconfig_t *mmconfig, u32 base, u16 seg_nr, u8 start, u8 end);
unsigned long acpi_create_srat_lapics(unsigned long current);
void acpi_create_srat(acpi_srat_t *srat);
+void acpi_create_slit(acpi_slit_t *slit);
+
void acpi_create_hpet(acpi_hpet_t *hpet);
+void acpi_create_mcfg(acpi_mcfg_t *mcfg);
+
void acpi_create_facs(acpi_facs_t *facs);
void acpi_write_rsdt(acpi_rsdt_t *rsdt);