blob: 1e42fa388dd0db2ea70414e9c0980b930e6ea302 [file] [log] [blame]
Patrick Georgibe61a172010-12-18 07:48:43 +00001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2007-2009 coresystems GmbH
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
Patrick Georgibe61a172010-12-18 07:48:43 +000014 */
15
16#include <types.h>
17#include <string.h>
18#include <console/console.h>
19#include <arch/acpi.h>
20#include <arch/ioapic.h>
21#include <arch/acpigen.h>
22#include <arch/smp/mpspec.h>
23#include <device/device.h>
24#include <device/pci.h>
25#include <device/pci_ids.h>
26#include <cpu/x86/msr.h>
Patrick Georgibe61a172010-12-18 07:48:43 +000027
Vladimir Serbinenko8eb7c7d2014-08-31 02:10:34 +020028#include "southbridge/intel/sch/nvs.h"
Uwe Hermann405721d2010-12-18 13:22:37 +000029
Vladimir Serbinenkoe6e5b5e2014-08-31 02:21:43 +020030void acpi_create_gnvs(global_nvs_t * gnvs)
Patrick Georgibe61a172010-12-18 07:48:43 +000031{
32 memset((void *)gnvs, 0, sizeof(*gnvs));
33 gnvs->apic = 1;
Uwe Hermann405721d2010-12-18 13:22:37 +000034 gnvs->mpen = 1; /* Enable Multi Processing. */
Patrick Georgibe61a172010-12-18 07:48:43 +000035
Uwe Hermann405721d2010-12-18 13:22:37 +000036 /* Enable both COM ports. */
Patrick Georgibe61a172010-12-18 07:48:43 +000037 gnvs->cmap = 0x01;
38 gnvs->cmbp = 0x01;
Patrick Georgibe61a172010-12-18 07:48:43 +000039}
40
Patrick Georgibe61a172010-12-18 07:48:43 +000041unsigned long acpi_fill_madt(unsigned long current)
42{
43 /* Local APICs */
44 current = acpi_create_madt_lapics(current);
45
46 /* IOAPIC */
47 current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current,
Uwe Hermann405721d2010-12-18 13:22:37 +000048 2, IO_APIC_ADDR, 0);
Patrick Georgibe61a172010-12-18 07:48:43 +000049
50 /* INT_SRC_OVR */
51 current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)
Uwe Hermann405721d2010-12-18 13:22:37 +000052 current, 0, 0, 2, 0);
Patrick Georgibe61a172010-12-18 07:48:43 +000053 current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)
Uwe Hermann405721d2010-12-18 13:22:37 +000054 current, 0, 9, 9,
55 MP_IRQ_TRIGGER_LEVEL |
56 MP_IRQ_POLARITY_HIGH);
Patrick Georgibe61a172010-12-18 07:48:43 +000057
58 return current;
59}