Please bear with me - another rename checkin. This qualifies as trivial, no
[coreboot.git] / src / mainboard / iei / juki-511p / irq_tables.c
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2007 Nikolay Petukhov <nikolay.petukhov@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 <arch/pirq_routing.h>
22
23 #define IRQ_BITMAP_LINK0 0x0800         /* chipset's INTA# input should be routed to IRQ11 */
24 #define IRQ_BITMAP_LINK1 0x0400         /* chipset's INTB# input should be routed to IRQ10 */
25 #define IRQ_BITMAP_LINK2 0x0000         /* chipset's INTC# input should be routed to nothing (disabled) */
26 #define IRQ_BITMAP_LINK3 0x0000         /* chipset's INTD# input should be routed to nothing (disabled) */
27
28 const struct irq_routing_table intel_irq_routing_table = {
29         PIRQ_SIGNATURE,  /* u32 signature */
30         PIRQ_VERSION,    /* u16 version */
31         32+16*2,         /* There can be a total of 2 devices on the bus */
32         0x00,            /* Where the interrupt router lies (bus) */
33         (0x12<<3)|0x0,   /* Where the interrupt router lies (dev) */
34         0xc00,           /* IRQs devoted exclusively to PCI usage */
35         0x1078,          /* Vendor */
36         0x2,             /* Device */
37         0,               /* Crap (miniport) */
38         { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* u8 rfu[11] */
39         0x57,            /* u8 checksum. This has to be set to some
40                             value that would give 0 after the sum of all
41                             bytes for this structure (including checksum) */
42
43         .slots = {
44                 [0] = {
45                         .slot = 0x0,    /* should be 0 when it is no real slot. My device is soldered */
46                         .bus = 0x00,
47                         .devfn = (0x13<<3)|0x0, /* 0x13 is my USB OHCI */
48                         .irq = {
49                                 [0] = { /* <-- 0 means this is INTA# output from the device or slot */
50                                         .link = 0x01,                   /* 0x01 means its connected to INTA# input at chipset */
51                                         .bitmap = IRQ_BITMAP_LINK0
52                                 },
53                                 [1] = { /* <-- 1 means this is INTB# output from the device or slot */
54                                         .link = 0x02,                   /* 0x02 means its connected to INTB# input at chipset */
55                                         .bitmap = IRQ_BITMAP_LINK1
56                                 },
57                                 [2] = { /* <-- 2 means this is INTC# output from the device or slot */
58                                         .link = 0x03,                   /* 0x03 means its connected to INTC# input at chipset */
59                                         .bitmap = IRQ_BITMAP_LINK2
60                                 },
61                                 [3] = { /* <-- 3 means this is INTD# output from the device or slot */
62                                         .link = 0x04,                   /* 0x04 means its connected to INTD# input at chipset */
63                                         .bitmap = IRQ_BITMAP_LINK3
64                                 }
65                         }
66                 },
67
68                 [1] = {
69                         .slot = 0x0,    /* means also "on board" */
70                         .bus = 0x00,
71                         .devfn = (0x0e<<3)|0x0, /* 0x0e is my Realtek Network device */
72                         .irq = {
73                                 [0] = { /* <-- 0 means this is INTA# output from the device or slot */
74                                         .link = 0x02,                   /* 0x02 means its connected to INTB# input at chipset */
75                                         .bitmap = IRQ_BITMAP_LINK1
76                                 },
77                                 [1] = { /* <-- 1 means this is INTB# output from the device or slot */
78                                         .link = 0x03,                   /* 0x03 means its connected to INTC# input at chipset */
79                                         .bitmap = IRQ_BITMAP_LINK2
80                                 },
81                                 [2] = { /* <-- 2 means this is INTC# output from the device or slot */
82                                         .link = 0x04,                   /* 0x04 means its connected to INTD# input at chipset */
83                                         .bitmap = IRQ_BITMAP_LINK3
84                                 },
85                                 [3] = { /* <-- 3 means this is INTD# output from the device or slot */
86                                         .link = 0x01,                   /* 0x01 means its connected to INTA# input at chipset */
87                                         .bitmap = IRQ_BITMAP_LINK0
88                                 }
89                         }
90                 }
91         }
92 };
93
94 /**
95  * Copy the IRQ routing table to memory.
96  *
97  * @param addr Destination address (between 0xF0000...0x100000).
98  * @return The end address of the pirq routing table in memory.
99  */
100 unsigned long write_pirq_routing_table(unsigned long addr)
101 {
102         return copy_pirq_routing_table(addr);
103 }