Cut the crap.
[coreboot.git] / src / mainboard / winent / pl6064 / irq_tables.c
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2007 Advanced Micro Devices, Inc.
5  * Copyright (C) 2010 Win Enterprises, Inc (anishp@win-ent.com)
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; version 2 of the License.
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 #include <console/console.h>
23 #include <arch/io.h>
24 #include <arch/pirq_routing.h>
25 #include "../../../southbridge/amd/cs5536/cs5536.h"
26
27 /* Platform IRQs */
28 #define PIRQA 11
29 #define PIRQB 10
30 #define PIRQC 5
31 #define PIRQD 10
32
33 /* Map */
34 #define M_PIRQA (1 << PIRQA)    /* Bitmap of supported IRQs */
35 #define M_PIRQB (1 << PIRQB)    /* Bitmap of supported IRQs */
36 #define M_PIRQC (1 << PIRQC)    /* Bitmap of supported IRQs */
37 #define M_PIRQD (1 << PIRQD)    /* Bitmap of supported IRQs */
38
39 /* Link */
40 #define L_PIRQA  1              /* Means Slot INTx# Connects To Chipset INTA# */
41 #define L_PIRQB  2              /* Means Slot INTx# Connects To Chipset INTB# */
42 #define L_PIRQC  3              /* Means Slot INTx# Connects To Chipset INTC# */
43 #define L_PIRQD  4              /* Means Slot INTx# Connects To Chipset INTD# */
44
45 const struct irq_routing_table intel_irq_routing_table = {
46         PIRQ_SIGNATURE,         /* u32 signature */
47         PIRQ_VERSION,           /* u16 version   */
48         32 + 16 * CONFIG_IRQ_SLOT_COUNT,        /* there can be total CONFIG_IRQ_SLOT_COUNT devices on the bus */
49         0x00,                   /* Where the interrupt router lies (bus) */
50         (0x0F << 3) | 0x0,      /* Where the interrupt router lies (dev) */
51         0x00,                   /* IRQs devoted exclusively to PCI usage */
52         0x100B,                 /* Vendor */
53         0x002B,                 /* Device */
54         0,                      /* Miniport data */
55         {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},      /* u8 rfu[11] */
56         0x00,                   /*      u8 checksum , this has to set to some value that would give 0 after the sum of all bytes for this structure (including checksum) */
57         {
58          /* If you change the number of entries, change the CONFIG_IRQ_SLOT_COUNT above! */
59          /* bus, dev|fn,           {link, bitmap},      {link, bitmap},     {link, bitmap},     {link, bitmap},     slot, rfu */
60          {0x00, (0x01 << 3) | 0x0, {{L_PIRQA, M_PIRQA}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}}, 0x0, 0x0},   /* cpu */
61          {0x00, (0x0F << 3) | 0x0, {{L_PIRQA, M_PIRQA}, {L_PIRQB, M_PIRQB}, {L_PIRQC, M_PIRQC}, {L_PIRQD, M_PIRQD}}, 0x0, 0x0}, /* chipset */
62          {0x00, (0x09 << 3) | 0x0, {{L_PIRQD, M_PIRQD}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}}, 0x0, 0x0},   /* ethernet 0*/
63          {0x00, (0x0A << 3) | 0x0, {{L_PIRQA, M_PIRQA}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}}, 0x0, 0x0},   /* ethernet 1*/
64          {0x00, (0x0B << 3) | 0x0, {{L_PIRQB, M_PIRQB}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}}, 0x0, 0x0},   /* ethernet 2*/
65          {0x00, (0x0C << 3) | 0x0, {{L_PIRQC, M_PIRQC}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}}, 0x0, 0x0},   /* ethernet 3 on 65 - shared switch on 64*/
66          {0x00, (0x0D << 3) | 0x0, {{L_PIRQC, M_PIRQC}, {L_PIRQD, M_PIRQD}, {L_PIRQA, M_PIRQA}, {L_PIRQB, M_PIRQB}}, 0x1, 0x0}, /* slot1 */
67          }
68 };
69
70 unsigned long write_pirq_routing_table(unsigned long addr)
71 {
72         return copy_pirq_routing_table(addr);
73 }