2010-05-16 16:24:41 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the coreboot project.
|
2011-10-31 20:56:45 +01:00
|
|
|
*
|
2010-05-16 16:24:41 +02:00
|
|
|
* Copyright (C) 2007-2010 coresystems GmbH
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; version 2 of
|
|
|
|
* the License.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
Remove address from GPLv2 headers
As per discussion with lawyers[tm], it's not a good idea to
shorten the license header too much - not for legal reasons
but because there are tools that look for them, and giving
them a standard pattern simplifies things.
However, we got confirmation that we don't have to update
every file ever added to coreboot whenever the FSF gets a
new lease, but can drop the address instead.
util/kconfig is excluded because that's imported code that
we may want to synchronize every now and then.
$ find * -type f -exec sed -i "s:Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *MA[, ]*02110-1301[, ]*USA:Foundation, Inc.:" {} +
$ find * -type f -exec sed -i "s:Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA:Foundation, Inc.:" {} +
$ find * -type f -exec sed -i "s:Foundation, Inc., 59 Temple Place[-, ]*Suite 330, Boston, MA *02111-1307[, ]*USA:Foundation, Inc.:" {} +
$ find * -type f -exec sed -i "s:Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.:Foundation, Inc.:" {} +
$ find * -type f
-a \! -name \*.patch \
-a \! -name \*_shipped \
-a \! -name LICENSE_GPL \
-a \! -name LGPL.txt \
-a \! -name COPYING \
-a \! -name DISCLAIMER \
-exec sed -i "/Foundation, Inc./ N;s:Foundation, Inc.* USA\.* *:Foundation, Inc. :;s:Foundation, Inc. $:Foundation, Inc.:" {} +
Change-Id: Icc968a5a5f3a5df8d32b940f9cdb35350654bef9
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/9233
Tested-by: build bot (Jenkins)
Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com>
2015-03-26 15:17:45 +01:00
|
|
|
* Foundation, Inc.
|
2010-05-16 16:24:41 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <types.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <console/console.h>
|
|
|
|
#include <arch/acpi.h>
|
2010-10-12 19:34:08 +02:00
|
|
|
#include <arch/ioapic.h>
|
2010-05-16 16:24:41 +02:00
|
|
|
#include <arch/acpigen.h>
|
|
|
|
#include <arch/smp/mpspec.h>
|
|
|
|
#include <device/device.h>
|
|
|
|
#include <device/pci.h>
|
|
|
|
#include <device/pci_ids.h>
|
|
|
|
|
2010-12-08 06:42:47 +01:00
|
|
|
#include "southbridge/intel/i82801gx/nvs.h"
|
2014-08-31 00:27:05 +02:00
|
|
|
#include "mainboard.h"
|
2010-05-16 16:24:41 +02:00
|
|
|
|
2014-08-31 00:27:05 +02:00
|
|
|
void acpi_create_gnvs(global_nvs_t *gnvs)
|
2010-05-16 16:24:41 +02:00
|
|
|
{
|
|
|
|
/* Enable COM port(s) */
|
|
|
|
gnvs->cmap = 0x01;
|
|
|
|
gnvs->cmbp = 0x00;
|
|
|
|
}
|
|
|
|
|
|
|
|
static long acpi_create_ecdt(acpi_ecdt_t * ecdt)
|
|
|
|
{
|
2011-10-31 20:56:45 +01:00
|
|
|
/* Attention: Make sure these match the values from
|
2010-05-16 16:24:41 +02:00
|
|
|
* the DSDT's ec.asl
|
|
|
|
*/
|
|
|
|
static const char ec_id[] = "\\_SB.PCI0.LPCB.EC0";
|
|
|
|
int ecdt_len = sizeof(acpi_ecdt_t) + strlen(ec_id) + 1;
|
|
|
|
|
|
|
|
acpi_header_t *header = &(ecdt->header);
|
|
|
|
|
|
|
|
memset((void *) ecdt, 0, ecdt_len);
|
|
|
|
|
|
|
|
/* fill out header fields */
|
|
|
|
memcpy(header->signature, "ECDT", 4);
|
|
|
|
memcpy(header->oem_id, OEM_ID, 6);
|
|
|
|
memcpy(header->oem_table_id, ACPI_TABLE_CREATOR, 8);
|
|
|
|
memcpy(header->asl_compiler_id, ASLC, 4);
|
|
|
|
|
|
|
|
header->length = ecdt_len;
|
|
|
|
header->revision = 1;
|
|
|
|
|
|
|
|
/* Location of the two EC registers */
|
|
|
|
ecdt->ec_control.space_id = ACPI_ADDRESS_SPACE_IO;
|
|
|
|
ecdt->ec_control.bit_width = 8;
|
|
|
|
ecdt->ec_control.bit_offset = 0;
|
|
|
|
ecdt->ec_control.addrl = 0x66;
|
|
|
|
ecdt->ec_control.addrh = 0;
|
|
|
|
|
|
|
|
ecdt->ec_data.space_id = ACPI_ADDRESS_SPACE_IO; /* Memory */
|
|
|
|
ecdt->ec_data.bit_width = 8;
|
|
|
|
ecdt->ec_data.bit_offset = 0;
|
|
|
|
ecdt->ec_data.addrl = 0x62;
|
|
|
|
ecdt->ec_data.addrh = 0;
|
|
|
|
|
|
|
|
ecdt->uid = 1; // Must match _UID of the EC0 node.
|
2011-10-31 20:56:45 +01:00
|
|
|
|
2010-05-16 16:24:41 +02:00
|
|
|
ecdt->gpe_bit = 23; // SCI interrupt within GPEx_STS
|
|
|
|
|
|
|
|
strncpy((char *)ecdt->ec_id, ec_id, strlen(ec_id));
|
|
|
|
|
|
|
|
header->checksum =
|
|
|
|
acpi_checksum((void *) ecdt, ecdt_len);
|
|
|
|
|
|
|
|
return header->length;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned long acpi_fill_madt(unsigned long current)
|
|
|
|
{
|
|
|
|
/* Local APICs */
|
|
|
|
current = acpi_create_madt_lapics(current);
|
|
|
|
|
|
|
|
/* IOAPIC */
|
|
|
|
current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current,
|
|
|
|
2, IO_APIC_ADDR, 0);
|
|
|
|
|
|
|
|
/* INT_SRC_OVR */
|
|
|
|
current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)
|
|
|
|
current, 0, 0, 2, 0);
|
|
|
|
current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)
|
|
|
|
current, 0, 9, 9, MP_IRQ_TRIGGER_LEVEL | MP_IRQ_POLARITY_HIGH);
|
|
|
|
|
|
|
|
/* LAPIC_NMI */
|
|
|
|
current += acpi_create_madt_lapic_nmi((acpi_madt_lapic_nmi_t *)
|
|
|
|
current, 0, 0x0005, 0x01);
|
|
|
|
current += acpi_create_madt_lapic_nmi((acpi_madt_lapic_nmi_t *)
|
|
|
|
current, 1, 0x0005, 0x01);
|
|
|
|
|
|
|
|
return current;
|
|
|
|
}
|
|
|
|
|
2012-04-20 19:19:47 +02:00
|
|
|
#define ALIGN_CURRENT current = (ALIGN(current, 16))
|
2014-08-31 00:27:05 +02:00
|
|
|
unsigned long mainboard_write_acpi_tables(unsigned long start, acpi_rsdp_t *rsdp)
|
2010-05-16 16:24:41 +02:00
|
|
|
{
|
|
|
|
unsigned long current;
|
|
|
|
acpi_header_t *ecdt;
|
|
|
|
|
|
|
|
current = start;
|
|
|
|
|
|
|
|
/* Align ACPI tables to 16byte */
|
|
|
|
ALIGN_CURRENT;
|
|
|
|
|
|
|
|
printk(BIOS_DEBUG, "ACPI: * ECDT\n");
|
|
|
|
ecdt = (acpi_header_t *)current;
|
|
|
|
current += acpi_create_ecdt((acpi_ecdt_t *)current);
|
|
|
|
ALIGN_CURRENT;
|
|
|
|
acpi_add_table(rsdp, ecdt);
|
|
|
|
|
|
|
|
printk(BIOS_DEBUG, "current = %lx\n", current);
|
|
|
|
return current;
|
|
|
|
}
|