blob: 5670ddf85e3bd327d8f9719a3f568fcbdd2e2122 [file] [log] [blame]
Ricardo Martins0ca02552012-07-04 03:09:49 +01001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2012 Ricardo Martins <rasmartins@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; either version 2 of the License, or
9 * (at your option) any later version.
10 *
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.
15 *
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
19 */
20
21#include <device/pci_ids.h>
22#include <arch/pirq_routing.h>
23
24/* Platform IRQs */
25#define PIRQA 10
26#define PIRQB 11
27#define PIRQC 11
28#define PIRQD 11
29
30/* Links */
31#define L_PIRQA 1
32#define L_PIRQB 2
33#define L_PIRQC 3
34#define L_PIRQD 4
35
36/* Bitmaps */
37#define B_LINK0 (1 << PIRQA)
38#define B_LINK1 (1 << PIRQB)
39#define B_LINK2 (1 << PIRQC)
40#define B_LINK3 (1 << PIRQD)
41
Stefan Reinauera47bd912012-11-15 15:15:15 -080042static const struct irq_routing_table intel_irq_routing_table = {
Ricardo Martins0ca02552012-07-04 03:09:49 +010043 PIRQ_SIGNATURE, /* u32 signature */
44 PIRQ_VERSION, /* u16 version */
45 32 + 16 * CONFIG_IRQ_SLOT_COUNT, /* Max. number of devices on the bus */
46 0x00, /* Interrupt router bus */
47 0x0f << 3, /* Interrupt router dev */
48 B_LINK0 | B_LINK1 | B_LINK2 | B_LINK3, /* IRQs devoted exclusively to PCI usage */
49 PCI_VENDOR_ID_AMD, /* Vendor */
50 PCI_DEVICE_ID_AMD_CS5536_ISA, /* Device */
51 0, /* Miniport */
52 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, /* Reserved */
53 0xa6, /* Checksum */
54 {
55 [0] = { /* Host bridge */
56 .slot = 0x00,
57 .bus = 0x00,
58 .devfn = (0x01 << 3) | 0x0,
59 .irq = {
60 [0] = {
61 .link = L_PIRQA,
62 .bitmap = B_LINK0
63 },
64 [1] = {
65 .link = L_PIRQB,
66 .bitmap = B_LINK1
67 },
68 [2] = {
69 .link = L_PIRQC,
70 .bitmap = B_LINK2
71 },
72 [3] = {
73 .link = L_PIRQD,
74 .bitmap = B_LINK3
75 }
76 }
77 },
78
79 [1] = { /* ISA bridge */
80 .slot = 0x00,
81 .bus = 0x00,
82 .devfn = (0x0f << 3) | 0x0,
83 .irq = {
84 [0] = {
85 .link = L_PIRQA,
86 .bitmap = B_LINK0
87 },
88 [1] = {
89 .link = L_PIRQB,
90 .bitmap = B_LINK1
91 },
92 [2] = {
93 .link = L_PIRQC,
94 .bitmap = B_LINK2
95 },
96 [3] = {
97 .link = L_PIRQD,
98 .bitmap = B_LINK3
99 }
100 }
101 },
102
103 [2] = { /* Ethernet */
104 .slot = 0x00,
105 .bus = 0x00,
106 .devfn = (0x0e << 3) | 0x0,
107 .irq = {
108 [0] = {
109 .link = L_PIRQD,
110 .bitmap = B_LINK3
111 },
112 [1] = {
113 .link = L_PIRQA,
114 .bitmap = B_LINK0
115 },
116 [2] = {
117 .link = L_PIRQB,
118 .bitmap = B_LINK1
119 },
120 [3] = {
121 .link = L_PIRQC,
122 .bitmap = B_LINK2
123 }
124 }
125 },
126
127 [3] = { /* PCI Connector - Slot 0 */
128 .slot = 0x01,
129 .bus = 0x00,
130 .devfn = (0x09 << 3) | 0x0,
131 .irq = {
132 [0] = {
133 .link = L_PIRQA,
134 .bitmap = B_LINK0
135 },
136 [1] = {
137 .link = L_PIRQB,
138 .bitmap = B_LINK1
139 },
140 [2] = {
141 .link = L_PIRQC,
142 .bitmap = B_LINK2
143 },
144 [3] = {
145 .link = L_PIRQD,
146 .bitmap = B_LINK3
147 }
148 }
149 },
150
151 [4] = { /* PCI Connector - Slot 1 */
152 .slot = 0x02,
153 .bus = 0x00,
154 .devfn = (0x0c << 3) | 0x0,
155 .irq = {
156 [0] = {
157 .link = L_PIRQB,
158 .bitmap = B_LINK1
159 },
160 [1] = {
161 .link = L_PIRQC,
162 .bitmap = B_LINK2
163 },
164 [2] = {
165 .link = L_PIRQD,
166 .bitmap = B_LINK3
167 },
168 [3] = {
169 .link = L_PIRQA,
170 .bitmap = B_LINK0
171 }
172 }
173 },
174
175 [5] = { /* PCI Connector - Slot 2 */
176 .slot = 0x03,
177 .bus = 0x00,
178 .devfn = (0x0b << 3) | 0x0,
179 .irq = {
180 [0] = {
181 .link = L_PIRQC,
182 .bitmap = B_LINK2
183 },
184 [1] = {
185 .link = L_PIRQD,
186 .bitmap = B_LINK3
187 },
188 [2] = {
189 .link = L_PIRQA,
190 .bitmap = B_LINK0
191 },
192 [3] = {
193 .link = L_PIRQB,
194 .bitmap = B_LINK1
195 }
196 }
197 },
198
199 [6] = { /* PCI Connector - Slot 3 */
200 .slot = 0x04,
201 .bus = 0x00,
202 .devfn = (0x0a << 3) | 0x0,
203 .irq = {
204 [0] = {
205 .link = L_PIRQD,
206 .bitmap = B_LINK3
207 },
208 [1] = {
209 .link = L_PIRQA,
210 .bitmap = B_LINK0
211 },
212 [2] = {
213 .link = L_PIRQB,
214 .bitmap = B_LINK1
215 },
216 [3] = {
217 .link = L_PIRQC,
218 .bitmap = B_LINK2
219 }
220 }
221 }
222 }
223};
224
225unsigned long write_pirq_routing_table(unsigned long addr)
226{
Stefan Reinauera47bd912012-11-15 15:15:15 -0800227 return copy_pirq_routing_table(addr, &intel_irq_routing_table);
Ricardo Martins0ca02552012-07-04 03:09:49 +0100228}