Marc Jones | a0aaa75 | 2007-06-20 23:45:44 +0000 | [diff] [blame] | 1 | /* |
Stefan Reinauer | 7e61e45 | 2008-01-18 10:35:56 +0000 | [diff] [blame] | 2 | * This file is part of the coreboot project. |
Ron Minnich | 5e9dc23 | 2006-07-28 16:06:16 +0000 | [diff] [blame] | 3 | * |
Marc Jones | a0aaa75 | 2007-06-20 23:45:44 +0000 | [diff] [blame] | 4 | * Copyright (C) 2007 Advanced Micro Devices, Inc. |
| 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 version 2 as |
| 8 | * published by the Free Software Foundation. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
Paul Menzel | a8ae1c6 | 2013-02-20 13:21:20 +0100 | [diff] [blame] | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
Marc Jones | a0aaa75 | 2007-06-20 23:45:44 +0000 | [diff] [blame] | 13 | * GNU General Public License for more details. |
Marc Jones | a0aaa75 | 2007-06-20 23:45:44 +0000 | [diff] [blame] | 14 | */ |
Ron Minnich | 5e9dc23 | 2006-07-28 16:06:16 +0000 | [diff] [blame] | 15 | |
| 16 | #include <arch/pirq_routing.h> |
Marc Jones | a0aaa75 | 2007-06-20 23:45:44 +0000 | [diff] [blame] | 17 | #include <console/console.h> |
| 18 | #include <arch/io.h> |
| 19 | #include <arch/pirq_routing.h> |
Uwe Hermann | 5df4168 | 2010-09-25 16:17:20 +0000 | [diff] [blame] | 20 | #include "southbridge/amd/cs5536/cs5536.h" |
Ron Minnich | 5e9dc23 | 2006-07-28 16:06:16 +0000 | [diff] [blame] | 21 | |
Marc Jones | a0aaa75 | 2007-06-20 23:45:44 +0000 | [diff] [blame] | 22 | /* Platform IRQs */ |
| 23 | #define PIRQA 10 |
| 24 | #define PIRQB 11 |
| 25 | #define PIRQC 10 |
| 26 | #define PIRQD 11 |
Indrek Kruusa | 8e34641 | 2006-08-03 16:48:18 +0000 | [diff] [blame] | 27 | |
Marc Jones | a0aaa75 | 2007-06-20 23:45:44 +0000 | [diff] [blame] | 28 | /* Map */ |
| 29 | #define M_PIRQA (1 << PIRQA) /* Bitmap of supported IRQs */ |
| 30 | #define M_PIRQB (1 << PIRQB) /* Bitmap of supported IRQs */ |
| 31 | #define M_PIRQC (1 << PIRQC) /* Bitmap of supported IRQs */ |
| 32 | #define M_PIRQD (1 << PIRQD) /* Bitmap of supported IRQs */ |
Indrek Kruusa | 8e34641 | 2006-08-03 16:48:18 +0000 | [diff] [blame] | 33 | |
Marc Jones | a0aaa75 | 2007-06-20 23:45:44 +0000 | [diff] [blame] | 34 | /* Link */ |
| 35 | #define L_PIRQA 1 /* Means Slot INTx# Connects To Chipset INTA# */ |
| 36 | #define L_PIRQB 2 /* Means Slot INTx# Connects To Chipset INTB# */ |
| 37 | #define L_PIRQC 3 /* Means Slot INTx# Connects To Chipset INTC# */ |
| 38 | #define L_PIRQD 4 /* Means Slot INTx# Connects To Chipset INTD# */ |
Indrek Kruusa | 8e34641 | 2006-08-03 16:48:18 +0000 | [diff] [blame] | 39 | |
Stefan Reinauer | a47bd91 | 2012-11-15 15:15:15 -0800 | [diff] [blame] | 40 | static const struct irq_routing_table intel_irq_routing_table = { |
Marc Jones | a0aaa75 | 2007-06-20 23:45:44 +0000 | [diff] [blame] | 41 | PIRQ_SIGNATURE, /* u32 signature */ |
| 42 | PIRQ_VERSION, /* u16 version */ |
Uwe Hermann | 95313d8 | 2009-10-07 21:51:33 +0000 | [diff] [blame] | 43 | 32 + 16 * CONFIG_IRQ_SLOT_COUNT, /* there can be total CONFIG_IRQ_SLOT_COUNT devices on the bus */ |
Marc Jones | a0aaa75 | 2007-06-20 23:45:44 +0000 | [diff] [blame] | 44 | 0x00, /* Where the interrupt router lies (bus) */ |
| 45 | (0x0F << 3) | 0x0, /* Where the interrupt router lies (dev) */ |
| 46 | 0x00, /* IRQs devoted exclusively to PCI usage */ |
| 47 | 0x100B, /* Vendor */ |
| 48 | 0x002B, /* Device */ |
Uwe Hermann | 8fa90ec | 2010-09-21 21:16:27 +0000 | [diff] [blame] | 49 | 0, /* Miniport data */ |
Marc Jones | a0aaa75 | 2007-06-20 23:45:44 +0000 | [diff] [blame] | 50 | {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, /* u8 rfu[11] */ |
| 51 | 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) */ |
Ron Minnich | 5e9dc23 | 2006-07-28 16:06:16 +0000 | [diff] [blame] | 52 | { |
Stefan Reinauer | 0867062 | 2009-06-30 15:17:49 +0000 | [diff] [blame] | 53 | /* If you change the number of entries, change the CONFIG_IRQ_SLOT_COUNT above! */ |
Marc Jones | a0aaa75 | 2007-06-20 23:45:44 +0000 | [diff] [blame] | 54 | /* bus, dev|fn, {link, bitmap}, {link, bitmap}, {link, bitmap}, {link, bitmap}, slot, rfu */ |
| 55 | {0x00, (0x01 << 3) | 0x0, {{L_PIRQA, M_PIRQA}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}}, 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, (0x0D << 3) | 0x0, {{L_PIRQC, M_PIRQC}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}}, 0x0, 0x0}, /* ethernet */ |
| 58 | } |
Ron Minnich | 5e9dc23 | 2006-07-28 16:06:16 +0000 | [diff] [blame] | 59 | }; |
Indrek Kruusa | 8e34641 | 2006-08-03 16:48:18 +0000 | [diff] [blame] | 60 | |
Ron Minnich | 5e9dc23 | 2006-07-28 16:06:16 +0000 | [diff] [blame] | 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); |
Nikolay Petukhov | 9c2255c | 2008-03-29 16:59:27 +0000 | [diff] [blame] | 64 | } |