Kyösti Mälkki | 9116270 | 2011-11-03 15:22:01 +0200 | [diff] [blame] | 1 | /* |
| 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. |
| 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 | #include <arch/pirq_routing.h> |
| 21 | #include <device/pci_def.h> |
| 22 | #include <device/pci_ids.h> |
| 23 | #include "bus.h" |
| 24 | |
| 25 | #define UNUSED_INTERRUPT {0, 0} |
| 26 | #define PIRQ_A 0x60 |
| 27 | #define PIRQ_B 0x61 |
| 28 | #define PIRQ_C 0x62 |
| 29 | #define PIRQ_D 0x63 |
| 30 | #define PIRQ_E 0x68 |
| 31 | #define PIRQ_F 0x69 |
| 32 | #define PIRQ_G 0x6A |
| 33 | #define PIRQ_H 0x6B |
| 34 | |
Stefan Reinauer | a47bd91 | 2012-11-15 15:15:15 -0800 | [diff] [blame^] | 35 | static const struct irq_routing_table intel_irq_routing_table = { |
Kyösti Mälkki | 9116270 | 2011-11-03 15:22:01 +0200 | [diff] [blame] | 36 | PIRQ_SIGNATURE, |
| 37 | PIRQ_VERSION, |
| 38 | 32 + 16 * CONFIG_IRQ_SLOT_COUNT, // Size of this struct in bytes |
| 39 | 0, // PCI bus number on which the interrupt router resides |
| 40 | PCI_DEVFN(31, 0), // PCI device/function number of the interrupt router |
| 41 | 0, // PCI-exclusive IRQ bitmap |
| 42 | PCI_VENDOR_ID_INTEL, // Vendor ID of compatible PCI interrupt router |
| 43 | PCI_DEVICE_ID_INTEL_82801DB_LPC, // Device ID of compatible PCI interrupt router |
| 44 | 0, // Additional miniport information |
| 45 | { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Reserved, must be zero |
| 46 | 0xB1, // Checksum of the entire structure (causes 8-bit sum == 0) |
| 47 | { |
| 48 | // NOTE: For 82801, a nonzero link value is a pointer to a PIRQ[n]_ROUT register in PCI configuration space |
| 49 | // This was determined from linux-2.6.11/arch/i386/pci/irq.c |
| 50 | // bitmap of 0xdcf8 == routable to IRQ3-IRQ7, IRQ10-IRQ12, or IRQ14-IRQ15 |
| 51 | // ICH-3 doesn't allow SERIRQ or PCI message to generate IRQ0, IRQ2, IRQ8, or IRQ13 |
| 52 | // Not sure why IRQ9 isn't routable (inherited from Tyan S2735) |
| 53 | |
| 54 | // INTA# INTB# INTC# INTD# |
| 55 | // bus, device # {link , bitmap}, {link , bitmap}, {link , bitmap}, {link , bitmap}, slot, rfu |
| 56 | |
| 57 | {PCI_BUS_ROOT, PCI_DEVFN(31, 0), {{PIRQ_C, 0xdcf8}, {PIRQ_B, 0xdcf8}, UNUSED_INTERRUPT, UNUSED_INTERRUPT}, 0, 0}, // IDE / SMBus |
| 58 | {PCI_BUS_ROOT, PCI_DEVFN(29, 0), {{PIRQ_A, 0xdcf8}, {PIRQ_D, 0xdcf8}, {PIRQ_C, 0xdcf8}, {PIRQ_H, 0xdcf8}}, 0, 0}, // USB 1.1 |
| 59 | |
| 60 | {PCI_BUS_P64H2_B, PCI_DEVFN(2, 0) , {{PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}}, 0, 0}, |
| 61 | {PCI_BUS_P64H2_B, PCI_DEVFN(3, 0) , {{PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}}, 0, 0}, |
| 62 | {PCI_BUS_P64H2_B, PCI_DEVFN(4, 0) , {{PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}}, 0, 0}, // GbE |
| 63 | |
| 64 | {PCI_BUS_P64H2_A, PCI_DEVFN(2, 0) , {{PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}}, 0, 0}, |
| 65 | {PCI_BUS_P64H2_A, PCI_DEVFN(3, 0) , {{PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}}, 0, 0}, |
| 66 | {PCI_BUS_P64H2_A, PCI_DEVFN(4, 0) , {{PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}, {PIRQ_C, 0xdcf8}}, 0, 0}, // SCSI |
| 67 | |
| 68 | {PCI_BUS_ICH4, PCI_DEVFN(3, 0), {{PIRQ_E, 0xdcf8}, {PIRQ_F, 0xdcf8}, {PIRQ_G, 0xdcf8}, {PIRQ_H, 0xdcf8}}, 0, 0}, // 32-bit slot |
| 69 | |
| 70 | } |
| 71 | }; |
| 72 | |
| 73 | unsigned long write_pirq_routing_table(unsigned long addr) |
| 74 | { |
Stefan Reinauer | a47bd91 | 2012-11-15 15:15:15 -0800 | [diff] [blame^] | 75 | return copy_pirq_routing_table(addr, &intel_irq_routing_table); |
Kyösti Mälkki | 9116270 | 2011-11-03 15:22:01 +0200 | [diff] [blame] | 76 | } |