via/vx800: Migrate to collaborative ACPI

Change-Id: I00d0d0e2556d4cd0553a2b3351ace26bf747ff6a
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/6944
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Vladimir Serbinenko 2014-09-02 00:15:02 +02:00
parent e7ff9d8839
commit 6c71a684a4
3 changed files with 4 additions and 89 deletions

View File

@ -9,6 +9,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
# Note: For ACPI, you need to use the 'get_dsdt' script and uncomment # Note: For ACPI, you need to use the 'get_dsdt' script and uncomment
# the "select HAVE_ACPI_TABLES" line below. # the "select HAVE_ACPI_TABLES" line below.
# select HAVE_ACPI_TABLES # select HAVE_ACPI_TABLES
# select PER_DEVICE_ACPI_TABLES
select HAVE_OPTION_TABLE select HAVE_OPTION_TABLE
select BOARD_ROMSIZE_KB_512 select BOARD_ROMSIZE_KB_512

View File

@ -113,92 +113,3 @@ unsigned long acpi_fill_srat(unsigned long current)
/* No NUMA, no SRAT. */ /* No NUMA, no SRAT. */
return current; return current;
} }
#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
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;
#if 0
acpi_header_t *ssdt;
#endif
/* 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");
current = ALIGN(current, 64);
facs = (acpi_facs_t *) current;
current += sizeof(acpi_facs_t);
acpi_create_facs(facs);
printk(BIOS_DEBUG, "ACPI: * DSDT\n");
dsdt = (acpi_header_t *) current;
memcpy(dsdt, &AmlCode_dsdt, sizeof(acpi_header_t));
current += dsdt->length;
memcpy(dsdt, &AmlCode_dsdt, dsdt->length);
dsdt->checksum = 0; /* Don't trust iasl to get this right. */
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);
/* If we want to use HPET timers Linux wants it in MADT. */
printk(BIOS_DEBUG, "ACPI: * MADT\n");
madt = (acpi_madt_t *) current;
acpi_create_madt(madt);
current += madt->header.length;
acpi_add_table(rsdp, madt);
/* NO MCFG in VX855, no PCI-E. */
printk(BIOS_DEBUG, "ACPI: * HPET\n");
hpet = (acpi_hpet_t *) current;
acpi_create_hpet(hpet);
current += hpet->header.length;
acpi_add_table(rsdp, hpet);
#if 0
printk(BIOS_DEBUG, "ACPI: * SSDT\n");
ssdt = (acpi_header_t *) current;
memcpy(ssdt, &AmlCode_ssdt, sizeof(acpi_header_t));
current += ssdt->length;
memcpy(ssdt, &AmlCode_ssdt, ssdt->length);
ssdt->checksum = 0; /* Don't trust iasl to get this right. */
ssdt->checksum = acpi_checksum((u8*)ssdt, ssdt->length);
acpi_add_table(rsdp, ssdt);
printk(BIOS_DEBUG, "ACPI: * SSDT @ %08x Length %x\n", ssdt, ssdt->length);
#endif
printk(BIOS_INFO, "ACPI: done.\n");
return current;
}

View File

@ -136,6 +136,9 @@ if register with invalid value we set frame buffer size to 32M for default, but
static struct device_operations pci_domain_ops = { static struct device_operations pci_domain_ops = {
.read_resources = pci_domain_read_resources, .read_resources = pci_domain_read_resources,
.set_resources = pci_domain_set_resources, .set_resources = pci_domain_set_resources,
#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
.write_acpi_tables = acpi_write_hpet,
#endif
.enable_resources = NULL, .enable_resources = NULL,
.init = NULL, .init = NULL,
.scan_bus = pci_domain_scan_bus, .scan_bus = pci_domain_scan_bus,