diff options
author | Jon Harrison <bothlyn@blueyonder.co.uk> | 2009-07-01 10:57:25 +0000 |
---|---|---|
committer | Ronald G. Minnich <rminnich@gmail.com> | 2009-07-01 10:57:25 +0000 |
commit | cfb9cd2f8ab545296f94cbc0580d0a9ae73efc06 (patch) | |
tree | 42646b998067600f07518b5dde4a8222aaf32127 /src/mainboard/via/epia-n/acpi_tables.c | |
parent | db8b4114ff73cc002bb4e15fd9e8f2fc012cf39e (diff) |
Ron,
Attached is the third revision of the CN400/EPIA-N(L) patch for CB V2.
Patch should work against r4381 (or later ?)
This version now boots all of the way through to attempting to launch a
payload (I'm trying FILO right now), where it falls over with exception
6 (invalid opcode)
The coreboot_table issue seems to have been automagically resolved by
the latest core files.
It may still be that the reason for the payload not starting is down to
some issue with the tables initialising, I'll look closer at that.
Signed-off-by: Jon Harrison <bothlyn@blueyonder.co.uk>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4386 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/mainboard/via/epia-n/acpi_tables.c')
-rw-r--r-- | src/mainboard/via/epia-n/acpi_tables.c | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/src/mainboard/via/epia-n/acpi_tables.c b/src/mainboard/via/epia-n/acpi_tables.c new file mode 100644 index 0000000000..9ca946de59 --- /dev/null +++ b/src/mainboard/via/epia-n/acpi_tables.c @@ -0,0 +1,94 @@ +/* + * coreboot ACPI Table support + * written by Stefan Reinauer <stepan@openbios.org> + * ACPI FADT, FACS, and DSDT table support added by + * Nick Barker <nick.barker9@btinternet.com>, and those portions + * (C) Copyright 2004 Nick Barker + * (C) Copyright 2005 Stefan Reinauer + */ + +#include <console/console.h> +#include <string.h> +#include <arch/acpi.h> + +extern unsigned char AmlCode[]; + +unsigned long acpi_fill_mcfg(unsigned long current) +{ + /* Nothing to do */ + return current; +} + +unsigned long acpi_fill_slit(unsigned long current) +{ + // Not implemented + return current; +} + +unsigned long acpi_fill_madt(unsigned long current) +{ + /* Nothing to do */ + return current; +} + +unsigned long acpi_fill_srat(unsigned long current) +{ + /* No NUMA, no SRAT */ + return current; +} + +unsigned long write_acpi_tables(unsigned long start) +{ + unsigned long current; + acpi_rsdp_t *rsdp; + acpi_rsdt_t *rsdt; + acpi_hpet_t *hpet; + acpi_madt_t *madt; + acpi_fadt_t *fadt; + acpi_facs_t *facs; + acpi_header_t *dsdt; + + /* Align ACPI tables to 16byte */ + start = ( start + 0x0f ) & -0x10; + current = start; + + printk_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); + acpi_write_rsdt(rsdt); + + /* + * We explicitly add these tables later on: + */ + printk_debug("ACPI: * FACS\n"); + facs = (acpi_facs_t *) current; + current += sizeof(acpi_facs_t); + acpi_create_facs(facs); + + dsdt = (acpi_header_t *)current; + current += ((acpi_header_t *)AmlCode)->length; + memcpy((void *)dsdt,(void *)AmlCode, ((acpi_header_t *)AmlCode)->length); + dsdt->checksum = 0; // don't trust intel iasl compiler to get this right + dsdt->checksum = acpi_checksum(dsdt,dsdt->length); + printk_debug("ACPI: * DSDT @ %08x Length %x\n",dsdt,dsdt->length); + printk_debug("ACPI: * FADT\n"); + + fadt = (acpi_fadt_t *) current; + current += sizeof(acpi_fadt_t); + + acpi_create_fadt(fadt,facs,dsdt); + acpi_add_table(rsdt,fadt); + + printk_info("ACPI: done.\n"); + return current; +} + |