Patrick Georgi | be61a17 | 2010-12-18 07:48:43 +0000 | [diff] [blame] | 1 | /* |
| 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 Georgi | be61a17 | 2010-12-18 07:48:43 +0000 | [diff] [blame] | 14 | */ |
| 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 Georgi | be61a17 | 2010-12-18 07:48:43 +0000 | [diff] [blame] | 27 | |
Vladimir Serbinenko | 8eb7c7d | 2014-08-31 02:10:34 +0200 | [diff] [blame] | 28 | #include "southbridge/intel/sch/nvs.h" |
Uwe Hermann | 405721d | 2010-12-18 13:22:37 +0000 | [diff] [blame] | 29 | |
Vladimir Serbinenko | e6e5b5e | 2014-08-31 02:21:43 +0200 | [diff] [blame] | 30 | void acpi_create_gnvs(global_nvs_t * gnvs) |
Patrick Georgi | be61a17 | 2010-12-18 07:48:43 +0000 | [diff] [blame] | 31 | { |
| 32 | memset((void *)gnvs, 0, sizeof(*gnvs)); |
| 33 | gnvs->apic = 1; |
Uwe Hermann | 405721d | 2010-12-18 13:22:37 +0000 | [diff] [blame] | 34 | gnvs->mpen = 1; /* Enable Multi Processing. */ |
Patrick Georgi | be61a17 | 2010-12-18 07:48:43 +0000 | [diff] [blame] | 35 | |
Uwe Hermann | 405721d | 2010-12-18 13:22:37 +0000 | [diff] [blame] | 36 | /* Enable both COM ports. */ |
Patrick Georgi | be61a17 | 2010-12-18 07:48:43 +0000 | [diff] [blame] | 37 | gnvs->cmap = 0x01; |
| 38 | gnvs->cmbp = 0x01; |
Patrick Georgi | be61a17 | 2010-12-18 07:48:43 +0000 | [diff] [blame] | 39 | } |
| 40 | |
Patrick Georgi | be61a17 | 2010-12-18 07:48:43 +0000 | [diff] [blame] | 41 | unsigned 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 Hermann | 405721d | 2010-12-18 13:22:37 +0000 | [diff] [blame] | 48 | 2, IO_APIC_ADDR, 0); |
Patrick Georgi | be61a17 | 2010-12-18 07:48:43 +0000 | [diff] [blame] | 49 | |
| 50 | /* INT_SRC_OVR */ |
| 51 | current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *) |
Uwe Hermann | 405721d | 2010-12-18 13:22:37 +0000 | [diff] [blame] | 52 | current, 0, 0, 2, 0); |
Patrick Georgi | be61a17 | 2010-12-18 07:48:43 +0000 | [diff] [blame] | 53 | current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *) |
Uwe Hermann | 405721d | 2010-12-18 13:22:37 +0000 | [diff] [blame] | 54 | current, 0, 9, 9, |
| 55 | MP_IRQ_TRIGGER_LEVEL | |
| 56 | MP_IRQ_POLARITY_HIGH); |
Patrick Georgi | be61a17 | 2010-12-18 07:48:43 +0000 | [diff] [blame] | 57 | |
| 58 | return current; |
| 59 | } |