From 4cc8c70c3297a99449ca731a7ea34d3fbe32d614 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Fri, 27 Apr 2012 21:34:16 +0200 Subject: Rework ACPI CST table generation ... in order to unify the Sandybridge and Lenovo implementations currently used in the tree. - use acpi_addr_t in acpigen_write_register() - use acpi_cstate_t for cstate tables (and fix up the x60 and t60) - drop cst_entry from acpigen.h Change-Id: Icb87418d44d355f607c4a67300107b40f40b3b3f Signed-off-by: Stefan Reinauer Reviewed-on: http://review.coreboot.org/943 Tested-by: build bot (Jenkins) Reviewed-by: Duncan Laurie --- src/arch/x86/include/arch/acpi.h | 7 +++++++ src/arch/x86/include/arch/acpigen.h | 18 ++++-------------- 2 files changed, 11 insertions(+), 14 deletions(-) (limited to 'src/arch/x86/include') diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h index d1341e6a0f..913ea5872a 100644 --- a/src/arch/x86/include/arch/acpi.h +++ b/src/arch/x86/include/arch/acpi.h @@ -411,6 +411,13 @@ typedef struct acpi_hest_hen { u32 error_threshold_win; } __attribute__ ((packed)) acpi_hest_hen_t; +typedef struct acpi_cstate { + u8 ctype; + u16 latency; + u32 power; + acpi_addr_t resource; +} __attribute__ ((packed)) acpi_cstate_t; + /* 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/arch/x86/include/arch/acpigen.h b/src/arch/x86/include/arch/acpigen.h index 8b5513ce5e..ea8cba7dd7 100644 --- a/src/arch/x86/include/arch/acpigen.h +++ b/src/arch/x86/include/arch/acpigen.h @@ -23,17 +23,7 @@ #include #include #include - -struct cst_entry { - int type; - int width; - int offset; - int addrsize; - u64 address; - int ctype; - int latency; - int power; -}; +#include int acpigen_write_len_f(void); void acpigen_patch_len(int len); @@ -57,16 +47,16 @@ int acpigen_write_PSS_package(u32 coreFreq, u32 power, u32 transLat, u32 busmLat u32 control, u32 status); typedef enum { SW_ALL=0xfc, SW_ANY=0xfd, HW_ALL=0xfe } PSD_coord; int acpigen_write_PSD_package(u32 domain, u32 numprocs, PSD_coord coordtype); -int acpigen_write_CST_package(struct cst_entry *entry, int nentries); +int acpigen_write_CST_package(acpi_cstate_t *entry, int nentries); int acpigen_write_processor(u8 cpuindex, u32 pblock_addr, u8 pblock_len); int acpigen_write_mem32fixed(int readwrite, u32 base, u32 size); int acpigen_write_io16(u16 min, u16 max, u8 align, u8 len, u8 decode16); -int acpigen_write_register(int type, int width, int offset, int addrsize, u64 address); +int acpigen_write_register(acpi_addr_t *addr); int acpigen_write_resourcetemplate_header(void); int acpigen_write_resourcetemplate_footer(int len); int acpigen_write_mainboard_resource_template(void); int acpigen_write_mainboard_resources(const char *scope, const char *name); -int get_cst_entries(struct cst_entry **); +int get_cst_entries(acpi_cstate_t **); #endif -- cgit v1.2.3