2 * This file is part of the coreboot project.
4 * Copyright (C) 2007 Nikolay Petukhov <nikolay.petukhov@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>
22 // #include <console/console.h>
39 #define IRQ_BITMAP_LINKA (1 << PIRQA)
40 #define IRQ_BITMAP_LINKB (1 << PIRQB)
41 #define IRQ_BITMAP_LINKC (1 << PIRQC)
42 #define IRQ_BITMAP_LINKD (1 << PIRQD)
43 #define IRQ_BITMAP_NOLINK 0x0
45 #define EXCLUSIVE_PCI_IRQS (IRQ_BITMAP_LINKA | IRQ_BITMAP_LINKB | IRQ_BITMAP_LINKC | IRQ_BITMAP_LINKD)
47 const struct irq_routing_table intel_irq_routing_table = {
48 PIRQ_SIGNATURE, /* u32 signature */
49 PIRQ_VERSION, /* u16 version */
50 32 + 16 * CONFIG_IRQ_SLOT_COUNT,/* there can be total 6 devices on the bus */
51 0x00, /* Where the interrupt router lies (bus) */
52 (0x0F << 3) | 0x0, /* Where the interrupt router lies (dev) */
53 EXCLUSIVE_PCI_IRQS, /* IRQs devoted exclusively to PCI usage */
56 0, /* Crap (miniport) */
57 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, /* u8 rfu[11] */
58 0x62, /* u8 checksum , this has to set to some value that would give 0 after the sum of all bytes for this structure (including checksum) */
62 .slot = 0x0, /* means also "on board" */
64 .devfn = (0x01<<3)|0x0, /* 0x01 is CS5536 */
66 [0] = { /* <-- 0 means this is INTA# output from the device or slot */
68 .bitmap = IRQ_BITMAP_LINKA
70 [1] = { /* <-- 1 means this is INTB# output from the device or slot */
72 .bitmap = IRQ_BITMAP_NOLINK
74 [2] = { /* <-- 2 means this is INTC# output from the device or slot */
76 .bitmap = IRQ_BITMAP_NOLINK
78 [3] = { /* <-- 3 means this is INTD# output from the device or slot */
80 .bitmap = IRQ_BITMAP_NOLINK
86 .slot = 0x0, /* means also "on board" */
88 .devfn = (0x0f<<3)|0x0, /* 0x0f is CS5536 (USB, AUDIO) */
90 [0] = { /* <-- 0 means this is INTA# output from the device or slot */
92 .bitmap = IRQ_BITMAP_NOLINK
94 [1] = { /* <-- 1 means this is INTB# output from the device or slot */
95 .link = LINK_PIRQB, /* Audio */
96 .bitmap = IRQ_BITMAP_LINKB
98 [2] = { /* <-- 2 means this is INTC# output from the device or slot */
100 .bitmap = IRQ_BITMAP_NOLINK
102 [3] = { /* <-- 3 means this is INTD# output from the device or slot */
103 .link = LINK_PIRQD, /* USB */
104 .bitmap = IRQ_BITMAP_LINKD
110 .slot = 0x0, /* means also "on board" */
112 .devfn = (0x0e<<3)|0x0, /* 0x0e is eth0 */
114 [0] = { /* <-- 0 means this is INTA# output from the device or slot */
116 .bitmap = IRQ_BITMAP_LINKD
118 [1] = { /* <-- 1 means this is INTB# output from the device or slot */
120 .bitmap = IRQ_BITMAP_NOLINK
122 [2] = { /* <-- 2 means this is INTC# output from the device or slot */
124 .bitmap = IRQ_BITMAP_NOLINK
126 [3] = { /* <-- 3 means this is INTD# output from the device or slot */
128 .bitmap = IRQ_BITMAP_NOLINK
134 .slot = 0x0, /* means also "on board" */
136 .devfn = (0x10<<3)|0x0, /* 0x10 is eth1 */
138 [0] = { /* <-- 0 means this is INTA# output from the device or slot */
140 .bitmap = IRQ_BITMAP_LINKB
142 [1] = { /* <-- 1 means this is INTB# output from the device or slot */
144 .bitmap = IRQ_BITMAP_NOLINK
146 [2] = { /* <-- 2 means this is INTC# output from the device or slot */
148 .bitmap = IRQ_BITMAP_NOLINK
150 [3] = { /* <-- 3 means this is INTD# output from the device or slot */
152 .bitmap = IRQ_BITMAP_NOLINK
158 .slot = 0x0, /* means also "on board" */
160 .devfn = (0x11<<3)|0x0, /* 0x11 is SATA */
162 [0] = { /* <-- 0 means this is INTA# output from the device or slot */
164 .bitmap = IRQ_BITMAP_LINKA
166 [1] = { /* <-- 1 means this is INTB# output from the device or slot */
168 .bitmap = IRQ_BITMAP_NOLINK
170 [2] = { /* <-- 2 means this is INTC# output from the device or slot */
172 .bitmap = IRQ_BITMAP_NOLINK
174 [3] = { /* <-- 3 means this is INTD# output from the device or slot */
176 .bitmap = IRQ_BITMAP_NOLINK
182 * ################### backplane ###################
189 .slot = 0x1, /* This is real PCI slot. */
191 .devfn = (0x09<<3)|0x0, /* 0x09 is PCI1 */
193 [0] = { /* <-- 0 means this is INTA# output from the device or slot */
195 .bitmap = IRQ_BITMAP_LINKA
197 [1] = { /* <-- 1 means this is INTB# output from the device or slot */
199 .bitmap = IRQ_BITMAP_LINKB
201 [2] = { /* <-- 2 means this is INTC# output from the device or slot */
203 .bitmap = IRQ_BITMAP_LINKC
205 [3] = { /* <-- 3 means this is INTD# output from the device or slot */
207 .bitmap = IRQ_BITMAP_LINKD
215 .slot = 0x2, /* This is real PCI slot. */
217 .devfn = (0x0a<<3)|0x0, /* 0x0a is PCI2 */
219 [0] = { /* <-- 0 means this is INTA# output from the device or slot */
221 .bitmap = IRQ_BITMAP_LINKD
223 [1] = { /* <-- 1 means this is INTB# output from the device or slot */
225 .bitmap = IRQ_BITMAP_LINKA
227 [2] = { /* <-- 2 means this is INTC# output from the device or slot */
229 .bitmap = IRQ_BITMAP_LINKB
231 [3] = { /* <-- 3 means this is INTD# output from the device or slot */
233 .bitmap = IRQ_BITMAP_LINKC
241 .slot = 0x3, /* This is real PCI slot. */
243 .devfn = (0x0b<<3)|0x0, /* 0x0b is PCI3 */
245 [0] = { /* <-- 0 means this is INTA# output from the device or slot */
247 .bitmap = IRQ_BITMAP_LINKC
249 [1] = { /* <-- 1 means this is INTB# output from the device or slot */
251 .bitmap = IRQ_BITMAP_LINKD
253 [2] = { /* <-- 2 means this is INTC# output from the device or slot */
255 .bitmap = IRQ_BITMAP_LINKA
257 [3] = { /* <-- 3 means this is INTD# output from the device or slot */
259 .bitmap = IRQ_BITMAP_LINKB
267 .slot = 0x4, /* This is real PCI slot. */
269 .devfn = (0x0c<<3)|0x0, /* 0x0c is PCI4 */
271 [0] = { /* <-- 0 means this is INTA# output from the device or slot */
273 .bitmap = IRQ_BITMAP_LINKB
275 [1] = { /* <-- 1 means this is INTB# output from the device or slot */
277 .bitmap = IRQ_BITMAP_LINKC
279 [2] = { /* <-- 2 means this is INTC# output from the device or slot */
281 .bitmap = IRQ_BITMAP_LINKD
283 [3] = { /* <-- 3 means this is INTD# output from the device or slot */
285 .bitmap = IRQ_BITMAP_LINKA
292 unsigned long write_pirq_routing_table(unsigned long addr)
294 /* Put the PIR table in memory and checksum. */
295 return copy_pirq_routing_table(addr);