2 * This file is part of the LinuxBIOS 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 #define IRQ_BITMAP_LINK0 0x0200 /* bit 9 means IRQ 9 available for this cs5530 INT input*/
43 #define IRQ_BITMAP_LINK1 0x0020 /* bit 5 means IRQ 5 available for this cs5530 INT input*/
44 #define IRQ_BITMAP_LINK2 0x0400 /* bit 10 means IRQ10 available for this cs5530 INT input*/
45 #define IRQ_BITMAP_LINK3 0x0800 /* bit 11 means IRQ11 available for this cs5530 INT input*/
47 const struct irq_routing_table intel_irq_routing_table = {
48 .signature = PIRQ_SIGNATURE, /* u32 signature */
49 .version = PIRQ_VERSION, /* u16 version */
50 .size = 32+16*IRQ_SLOT_COUNT, /* there can be total 4 devices on the bus */
51 .rtr_bus = 0x00, /* Where the interrupt router lies (bus) */
52 .rtr_devfn = (0x12<<3)|0x0, /* Where the interrupt router lies (dev) */
53 .exclusive_irqs = 0x4C20, /* IRQs devoted exclusively to PCI usage */
54 .rtr_vendor = 0x1078, /* Vendor */
55 .rtr_device = 0x0100, /* Device */
56 .miniport_data = 0, /* Crap (miniport) */
57 .checksum = 0xBF+16, /* TODO! calculate correct sum ! */
59 * Definition for "slot#0". There is no real slot,
60 * the network device is soldered...
65 .devfn = (0x0a<<3)|0x0,
68 .link = 0x03, /* INT C */
69 .bitmap = IRQ_BITMAP_LINK2
72 .link = 0x02, /* INT B */
73 .bitmap = IRQ_BITMAP_LINK1
75 [2] = { /* = device INTA output */
76 .link = 0x01, /* INT A */
77 .bitmap = IRQ_BITMAP_LINK0
80 .link = 0x04, /* = cs5530 INT D input */
81 .bitmap = IRQ_BITMAP_LINK3
84 .slot = 0x3, /* soldered */
87 * Definition for "slot#1". There is no real slot,
88 * the network device is soldered...
90 * Configuration is ommited on purpose in the attempt of solving the
91 * issue with IRQ panics (this is device is actually eth1)
95 .devfn = (0x0b<<3)|0x0,
99 .bitmap = IRQ_BITMAP_LINK3
103 .bitmap = IRQ_BITMAP_LINK2
107 .bitmap = IRQ_BITMAP_LINK1
111 .bitmap = IRQ_BITMAP_LINK0
119 * Definition for "slot#2". There is no real slot,
120 * the network device is soldered...
124 .devfn = (0x0c<<3)|0x0,
127 .link = 0x01, /* INT A */
128 .bitmap = IRQ_BITMAP_LINK0
131 .link = 0x04, /* INT D */
132 .bitmap = IRQ_BITMAP_LINK3
134 [2] = { /* = device INTA output */
135 .link = 0x03, /* INT C */
136 .bitmap = IRQ_BITMAP_LINK2
139 .link = 0x02, /* = cs5530 INT B input */
140 .bitmap = IRQ_BITMAP_LINK1
143 .slot = 0x1, /* soldered */
146 * This is a free PCI slot
150 .devfn = (0x0f<<3)|0x0,
152 [0] = { /* = device INTA output */
153 .link = 0x04, /* INT D */
154 .bitmap = IRQ_BITMAP_LINK3
157 .link = 0x03, /* = cs5530 INT C input */
158 .bitmap = IRQ_BITMAP_LINK2
161 .link = 0x02, /* INT B */
162 .bitmap = IRQ_BITMAP_LINK1
165 .link = 0x01, /* INT A */
166 .bitmap = IRQ_BITMAP_LINK0
169 .slot = 0x6, /* FIXME: should be not 0, as it defines a real slot */
172 * Definition for "slot#3". There is no real slot,
173 * the USB device is embedded...
177 .devfn = (0x13<<3)|0x0,
180 .link = 0x02, /* INT B */
181 .bitmap = IRQ_BITMAP_LINK1
184 .link = 0x01, /* INT A */
185 .bitmap = IRQ_BITMAP_LINK0
188 .link = 0x04, /* INT D */
189 .bitmap = IRQ_BITMAP_LINK3
192 .link = 0x03, /* INT C */
193 .bitmap = IRQ_BITMAP_LINK2
196 .slot = 0x5, /* chip internal */
202 * Copy the IRQ routing table to memory.
204 * @param addr Destination address (between 0xF0000...0x100000).
205 * @return The end address of the pirq routing table in memory.
207 unsigned long write_pirq_routing_table(unsigned long addr)
209 return copy_pirq_routing_table(addr);