Christian Gmeiner | 86f992c | 2012-07-13 11:36:08 +0200 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2012 Bachmann electronic GmbH |
| 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. |
Christian Gmeiner | 86f992c | 2012-07-13 11:36:08 +0200 | [diff] [blame] | 15 | */ |
| 16 | |
| 17 | #include <arch/pirq_routing.h> |
| 18 | |
| 19 | /* Platform IRQs */ |
| 20 | #define PIRQA 5 |
| 21 | #define PIRQB 9 |
Christian Gmeiner | 1b97bdc | 2012-10-10 09:07:28 +0200 | [diff] [blame] | 22 | #define PIRQC 10 |
| 23 | #define PIRQD 7 |
Christian Gmeiner | 86f992c | 2012-07-13 11:36:08 +0200 | [diff] [blame] | 24 | |
| 25 | /* Map */ |
| 26 | #define M_PIRQA (1 << PIRQA) /* Bitmap of supported IRQs */ |
| 27 | #define M_PIRQB (1 << PIRQB) /* Bitmap of supported IRQs */ |
| 28 | #define M_PIRQC (1 << PIRQC) /* Bitmap of supported IRQs */ |
| 29 | #define M_PIRQD (1 << PIRQD) /* Bitmap of supported IRQs */ |
| 30 | |
| 31 | /* Link */ |
| 32 | #define L_PIRQA 1 /* Means Slot INTx# Connects To Chipset INTA# */ |
| 33 | #define L_PIRQB 2 /* Means Slot INTx# Connects To Chipset INTB# */ |
| 34 | #define L_PIRQC 3 /* Means Slot INTx# Connects To Chipset INTC# */ |
| 35 | #define L_PIRQD 4 /* Means Slot INTx# Connects To Chipset INTD# */ |
| 36 | |
| 37 | |
Stefan Reinauer | a47bd91 | 2012-11-15 15:15:15 -0800 | [diff] [blame] | 38 | static const struct irq_routing_table intel_irq_routing_table = { |
Christian Gmeiner | 86f992c | 2012-07-13 11:36:08 +0200 | [diff] [blame] | 39 | PIRQ_SIGNATURE, /* u32 signature */ |
| 40 | PIRQ_VERSION, /* u16 version */ |
| 41 | 32 + 16 * CONFIG_IRQ_SLOT_COUNT, /* Max. number of devices on the bus */ |
| 42 | 0x00, /* Interrupt router bus */ |
| 43 | 0x0f << 3, /* Interrupt router dev */ |
| 44 | 0, /* IRQs devoted exclusively to PCI usage */ |
| 45 | 0x100b, /* Vendor */ |
| 46 | 0x2b, /* Device */ |
| 47 | 0, /* Miniport */ |
| 48 | { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* u8 rfu[11] */ |
| 49 | 0x20, /* Checksum (has to be set to some value that |
| 50 | * would give 0 after the sum of all bytes |
| 51 | * for this structure (including checksum). |
| 52 | */ |
| 53 | { |
| 54 | /* bus, dev | fn, {link, bitmap}, {link, bitmap}, {link, bitmap}, {link, bitmap}, slot, rfu */ |
| 55 | {0x00, (0x01 << 3) | 0x0, {{L_PIRQA, M_PIRQA}, {0x00, 0x0000}, {0x00, 0x0000}, {0x00, 0x0000}}, 0x0, 0x0}, /* CPU */ |
| 56 | {0x00, (0x0f << 3) | 0x0, {{L_PIRQA, M_PIRQA}, {L_PIRQB, M_PIRQB}, {L_PIRQC, M_PIRQC}, {L_PIRQD, M_PIRQD}}, 0x0, 0x0}, /* chipset */ |
| 57 | {0x00, (0x04 << 3) | 0x0, {{L_PIRQA, M_PIRQA}, {0x00, 0x0000}, {0x00, 0x0000}, {0x00, 0x0000}}, 0x0, 0x0}, /* ethernet */ |
| 58 | } |
| 59 | }; |
| 60 | |
| 61 | unsigned long write_pirq_routing_table(unsigned long addr) |
| 62 | { |
Stefan Reinauer | a47bd91 | 2012-11-15 15:15:15 -0800 | [diff] [blame] | 63 | return copy_pirq_routing_table(addr, &intel_irq_routing_table); |
Christian Gmeiner | 86f992c | 2012-07-13 11:36:08 +0200 | [diff] [blame] | 64 | } |