623f617253ea4c41f68ed4aaa8c8b3bace39dea4
[coreboot.git] / src / arch / x86 / include / arch / ioapic.h
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2010 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.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19
20 #ifndef __I386_ARCH_IOAPIC_H
21 #define __I386_ARCH_IOAPIC_H
22
23 #define IO_APIC_ADDR    0xfec00000UL
24 #define IO_APIC_INTERRUPTS 24
25
26 #define ALL             (0xff << 24)
27 #define NONE            (0)
28 #define DISABLED        (1 << 16)
29 #define ENABLED         (0 << 16)
30 #define TRIGGER_EDGE    (0 << 15)
31 #define TRIGGER_LEVEL   (1 << 15)
32 #define POLARITY_HIGH   (0 << 13)
33 #define POLARITY_LOW    (1 << 13)
34 #define PHYSICAL_DEST   (0 << 11)
35 #define LOGICAL_DEST    (1 << 11)
36 #define ExtINT          (7 << 8)
37 #define NMI             (4 << 8)
38 #define SMI             (2 << 8)
39 #define INT             (1 << 8)
40
41 void setup_ioapic(u32 ioapic_base, u8 ioapic_id);
42 void clear_ioapic(u32 ioapic_base);
43
44 #endif