blob: 8d9298b6f3fec410a912b5a06f7a7cc16de935e1 [file] [log] [blame]
Kyösti Mälkki91162702011-11-03 15:22:01 +02001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2011 Kyösti Mälkki <kyosti.malkki@gmail.com>
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.
Kyösti Mälkki91162702011-11-03 15:22:01 +020014 */
15
16#include <arch/pirq_routing.h>
17#include <device/pci_def.h>
18#include <device/pci_ids.h>
19#include "bus.h"
20
21#define UNUSED_INTERRUPT {0, 0}
22#define PIRQ_A 0x60
23#define PIRQ_B 0x61
24#define PIRQ_C 0x62
25#define PIRQ_D 0x63
26#define PIRQ_E 0x68
27#define PIRQ_F 0x69
28#define PIRQ_G 0x6A
29#define PIRQ_H 0x6B
30
Stefan Reinauera47bd912012-11-15 15:15:15 -080031static const struct irq_routing_table intel_irq_routing_table = {
Kyösti Mälkki91162702011-11-03 15:22:01 +020032 PIRQ_SIGNATURE,
33 PIRQ_VERSION,
Elyes HAOUAS46829862016-10-07 17:35:50 +020034 32 + 16 * CONFIG_IRQ_SLOT_COUNT, /* Size of this struct in bytes */
35 0, /* PCI bus number on which the interrupt router resides */
36 PCI_DEVFN(31, 0), /* PCI device/function number of the interrupt router */
37 0, /* PCI-exclusive IRQ bitmap */
38 PCI_VENDOR_ID_INTEL, /* Vendor ID of compatible PCI interrupt router */
39 PCI_DEVICE_ID_INTEL_82801DB_LPC, /* Device ID of compatible PCI interrupt router */
40 0, /* Additional miniport information */
41 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* Reserved, must be zero */
42 0xB1, /* Checksum of the entire structure (causes 8-bit sum == 0) */
Kyösti Mälkki91162702011-11-03 15:22:01 +020043 {
Elyes HAOUAS46829862016-10-07 17:35:50 +020044 /* NOTE: For 82801, a nonzero link value is a pointer to a PIRQ[n]_ROUT register in PCI configuration space */
45 /* This was determined from linux-2.6.11/arch/i386/pci/irq.c */
46 /* bitmap of 0xdcf8 == routable to IRQ3-IRQ7, IRQ10-IRQ12, or IRQ14-IRQ15 */
47 /* ICH-3 doesn't allow SERIRQ or PCI message to generate IRQ0, IRQ2, IRQ8, or IRQ13 */
48 /* Not sure why IRQ9 isn't routable (inherited from Tyan S2735) */
Kyösti Mälkki91162702011-11-03 15:22:01 +020049
Elyes HAOUAS46829862016-10-07 17:35:50 +020050 /* INTA# INTB# INTC# INTD# */
51 /* bus, device # {link , bitmap}, {link , bitmap}, {link , bitmap}, {link , bitmap}, slot, rfu */
Kyösti Mälkki91162702011-11-03 15:22:01 +020052
Elyes HAOUAS46829862016-10-07 17:35:50 +020053 {PCI_BUS_ROOT, PCI_DEVFN(31, 0), {{PIRQ_C, 0xdcf8}, {PIRQ_B, 0xdcf8}, UNUSED_INTERRUPT, UNUSED_INTERRUPT}, 0, 0}, /* IDE / SMBus */
54 {PCI_BUS_ROOT, PCI_DEVFN(29, 0), {{PIRQ_A, 0xdcf8}, {PIRQ_D, 0xdcf8}, {PIRQ_C, 0xdcf8}, {PIRQ_H, 0xdcf8}}, 0, 0}, /* USB 1.1 */
Kyösti Mälkki91162702011-11-03 15:22:01 +020055
56 {PCI_BUS_P64H2_B, PCI_DEVFN(2, 0) , {{PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}}, 0, 0},
57 {PCI_BUS_P64H2_B, PCI_DEVFN(3, 0) , {{PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}}, 0, 0},
Elyes HAOUAS46829862016-10-07 17:35:50 +020058 {PCI_BUS_P64H2_B, PCI_DEVFN(4, 0) , {{PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}}, 0, 0}, /* GbE */
Kyösti Mälkki91162702011-11-03 15:22:01 +020059
60 {PCI_BUS_P64H2_A, PCI_DEVFN(2, 0) , {{PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}}, 0, 0},
61 {PCI_BUS_P64H2_A, PCI_DEVFN(3, 0) , {{PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}}, 0, 0},
Elyes HAOUAS46829862016-10-07 17:35:50 +020062 {PCI_BUS_P64H2_A, PCI_DEVFN(4, 0) , {{PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}}, 0, 0}, /* SCSI */
Kyösti Mälkki91162702011-11-03 15:22:01 +020063
Elyes HAOUAS46829862016-10-07 17:35:50 +020064 {PCI_BUS_ICH4, PCI_DEVFN(3, 0), {{PIRQ_E, 0xdcf8}, {PIRQ_F, 0xdcf8}, {PIRQ_G, 0xdcf8}, {PIRQ_H, 0xdcf8}}, 0, 0}, /* 32-bit slot */
Kyösti Mälkki91162702011-11-03 15:22:01 +020065
66 }
67};
68
69unsigned long write_pirq_routing_table(unsigned long addr)
70{
Stefan Reinauera47bd912012-11-15 15:15:15 -080071 return copy_pirq_routing_table(addr, &intel_irq_routing_table);
Kyösti Mälkki91162702011-11-03 15:22:01 +020072}