summaryrefslogtreecommitdiff
path: root/src/mainboard/asus
diff options
context:
space:
mode:
authorRudolf Marek <r.marek@assembler.cz>2009-02-01 18:35:15 +0000
committerRudolf Marek <r.marek@assembler.cz>2009-02-01 18:35:15 +0000
commit293b5f52253ec0e5edb38e9f7113afc7e8f8ba6e (patch)
treed0ab38cd89f3ceace9ee3de1cddd6bb5d9acea1a /src/mainboard/asus
parent1c49bc9744c2e9044ddd1c8d20a1728f57eda85c (diff)
Following patch adds dynamic ACPI AML code generator which can be used to
generate run-time ACPI ASL code. Moreover it demonstrates its use on Asus M2V-MX SE where the SSDT table is generated by new function k8acpi_write_vars (technically similar to update_ssdt). But lot of nicer. x Signed-off-by: Rudolf Marek <r.marek@assembler.cz> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3925 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/mainboard/asus')
-rw-r--r--src/mainboard/asus/m2v-mx_se/acpi_tables.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/mainboard/asus/m2v-mx_se/acpi_tables.c b/src/mainboard/asus/m2v-mx_se/acpi_tables.c
index 4fb27dbbfb..33540e09b8 100644
--- a/src/mainboard/asus/m2v-mx_se/acpi_tables.c
+++ b/src/mainboard/asus/m2v-mx_se/acpi_tables.c
@@ -30,9 +30,9 @@
#include <device/pci_ids.h>
#include <../../../southbridge/via/vt8237r/vt8237r.h>
#include <../../../southbridge/via/k8t890/k8t890.h>
+#include <../../../northbridge/amd/amdk8/amdk8_acpi.h>
extern unsigned char AmlCode[];
-extern unsigned char AmlCode_ssdt[];
unsigned long acpi_fill_mcfg(unsigned long current)
{
@@ -81,6 +81,12 @@ unsigned long acpi_fill_madt(unsigned long current)
return current;
}
+unsigned long acpi_fill_ssdt_generator(unsigned long current, char *oem_table_id) {
+ k8acpi_write_vars();
+ /* put PSTATES generator call here */
+ return (unsigned long) (acpigen_get_current());
+}
+
unsigned long write_acpi_tables(unsigned long start)
{
unsigned long current;
@@ -175,13 +181,10 @@ unsigned long write_acpi_tables(unsigned long start)
/* SSDT */
printk_debug("ACPI: * SSDT\n");
ssdt = (acpi_header_t *)current;
- current += ((acpi_header_t *)AmlCode_ssdt)->length;
- memcpy((void *)ssdt, (void *)AmlCode_ssdt, ((acpi_header_t *)AmlCode_ssdt)->length);
- update_ssdt((void*)ssdt);
- /* recalculate checksum */
- ssdt->checksum = 0;
- ssdt->checksum = acpi_checksum((unsigned char *)ssdt,ssdt->length);
- acpi_add_table(rsdt,ssdt);
+
+ acpi_create_ssdt_generator(ssdt, "DYNADATA");
+ current += ssdt->length;
+ acpi_add_table(rsdt, ssdt);
printk_info("ACPI: done.\n");
return current;