2 * This file is part of the coreboot project.
4 * Copyright (C) 2007 Luis Correia <luis.f.correia@gmail.com>
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; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #include <arch/pirq_routing.h>
24 * IRQ 5530 USB Network Network Network free
25 * controller northbridge device device#0 device#1 device#2 slot
26 * 00.13.0 00.0a.00 00.0b.00 00.0c.00 00.0f.00
27 * ------------------------------------------------------------------------
28 * 14 INTA# INTA# n.c. n.c. n.c. INTA#
29 * 5 INTB# n.c. n.c. n.c. INTA# n.c.
30 * 10 INTC# n.c. n.c. INTA# n.c. n.c.
31 * 11 INTD# n.c. INTA# n.c. n.c. n.c.
35 * - the USB controller should be connected to IRQ14
36 * - the network controller #0 should be connected to IRQ11
37 * - the network controller #1 should be connected to IRQ10
38 * - the network controller #2 should be connected to IRQ5
39 * - the additional PCI slot must share the IRQ with the internal USB
42 /* Bit 9 means IRQ 9 is available for this cs5530 INT input. */
43 #define IRQ_BITMAP_LINK0 0x0200
44 /* Bit 5 means IRQ 5 is available for this cs5530 INT input. */
45 #define IRQ_BITMAP_LINK1 0x0020
46 /* Bit 10 means IRQ10 is available for this cs5530 INT input. */
47 #define IRQ_BITMAP_LINK2 0x0400
48 /* Bit 11 means IRQ11 is available for this cs5530 INT input. */
49 #define IRQ_BITMAP_LINK3 0x0800
51 const struct irq_routing_table intel_irq_routing_table = {
52 .signature = PIRQ_SIGNATURE, /* u32 signature */
53 .version = PIRQ_VERSION, /* u16 version */
54 .size = 32+16*CONFIG_IRQ_SLOT_COUNT, /* There can be total 4 devices on the bus */
55 .rtr_bus = 0x00, /* Where the interrupt router lies (bus) */
56 .rtr_devfn = (0x12<<3)|0x0, /* Where the interrupt router lies (dev) */
57 .exclusive_irqs = 0x4C20, /* IRQs devoted exclusively to PCI usage */
58 .rtr_vendor = 0x1078, /* Vendor */
59 .rtr_device = 0x0100, /* Device */
60 .miniport_data = 0, /* Crap (miniport) */
61 .checksum = 0xBF+16, /* TODO! calculate correct sum ! */
63 * Definition for "slot#0". There is no real slot,
64 * the network device is soldered...
69 .devfn = (0x0a<<3)|0x0,
72 .link = 0x03, /* INT C */
73 .bitmap = IRQ_BITMAP_LINK2
76 .link = 0x02, /* INT B */
77 .bitmap = IRQ_BITMAP_LINK1
79 [2] = { /* = device INTA output */
80 .link = 0x01, /* INT A */
81 .bitmap = IRQ_BITMAP_LINK0
84 .link = 0x04, /* = cs5530 INT D input */
85 .bitmap = IRQ_BITMAP_LINK3
88 .slot = 0x3, /* soldered */
91 * Definition for "slot#1". There is no real slot,
92 * the network device is soldered...
94 * Configuration is ommited on purpose in the attempt of solving the
95 * issue with IRQ panics (this is device is actually eth1).
99 .devfn = (0x0b<<3)|0x0,
103 .bitmap = IRQ_BITMAP_LINK3
107 .bitmap = IRQ_BITMAP_LINK2
111 .bitmap = IRQ_BITMAP_LINK1
115 .bitmap = IRQ_BITMAP_LINK0
123 * Definition for "slot#2". There is no real slot,
124 * the network device is soldered...
128 .devfn = (0x0c<<3)|0x0,
131 .link = 0x01, /* INT A */
132 .bitmap = IRQ_BITMAP_LINK0
135 .link = 0x04, /* INT D */
136 .bitmap = IRQ_BITMAP_LINK3
138 [2] = { /* = device INTA output */
139 .link = 0x03, /* INT C */
140 .bitmap = IRQ_BITMAP_LINK2
143 .link = 0x02, /* = cs5530 INT B input */
144 .bitmap = IRQ_BITMAP_LINK1
147 .slot = 0x1, /* soldered */
150 * This is a free PCI slot.
154 .devfn = (0x0f<<3)|0x0,
156 [0] = { /* = device INTA output */
157 .link = 0x04, /* INT D */
158 .bitmap = IRQ_BITMAP_LINK3
161 .link = 0x03, /* = cs5530 INT C input */
162 .bitmap = IRQ_BITMAP_LINK2
165 .link = 0x02, /* INT B */
166 .bitmap = IRQ_BITMAP_LINK1
169 .link = 0x01, /* INT A */
170 .bitmap = IRQ_BITMAP_LINK0
173 .slot = 0x6, /* FIXME: should be not 0, as it defines a real slot */
176 * Definition for "slot#3". There is no real slot,
177 * the USB device is embedded...
181 .devfn = (0x13<<3)|0x0,
184 .link = 0x02, /* INT B */
185 .bitmap = IRQ_BITMAP_LINK1
188 .link = 0x01, /* INT A */
189 .bitmap = IRQ_BITMAP_LINK0
192 .link = 0x04, /* INT D */
193 .bitmap = IRQ_BITMAP_LINK3
196 .link = 0x03, /* INT C */
197 .bitmap = IRQ_BITMAP_LINK2
200 .slot = 0x5, /* chip internal */
206 * Copy the IRQ routing table to memory.
208 * @param addr Destination address (between 0xF0000...0x100000).
209 * @return The end address of the pirq routing table in memory.
211 unsigned long write_pirq_routing_table(unsigned long addr)
213 return copy_pirq_routing_table(addr);