blob: 8d09cf450c5fceca752f6d55c8a264e4015d50c3 [file] [log] [blame]
Jens Rottmann36224b42010-09-10 21:51:34 +00001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2010 LiPPERT Embedded Computers 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.
Jens Rottmann36224b42010-09-10 21:51:34 +000015 */
16
17/* Based on irq_tables.c from the SpaceRunner-LX mainboard. */
18
19#include <arch/pirq_routing.h>
20#include <console/console.h>
21#include <arch/io.h>
22#include <arch/pirq_routing.h>
Uwe Hermann5df41682010-09-25 16:17:20 +000023#include "southbridge/amd/cs5536/cs5536.h"
Jens Rottmann36224b42010-09-10 21:51:34 +000024
25/* Platform IRQs */
26#define PIRQA 10
27#define PIRQB 11
28#define PIRQC 5
29#define PIRQD 15
30
31/* Map */
32#define M_PIRQA (1 << PIRQA) /* Bitmap of supported IRQs */
33#define M_PIRQB (1 << PIRQB) /* Bitmap of supported IRQs */
34#define M_PIRQC (1 << PIRQC) /* Bitmap of supported IRQs */
35#define M_PIRQD (1 << PIRQD) /* Bitmap of supported IRQs */
36
37/* Link */
38#define L_PIRQA 1 /* Means Slot INTx# Connects To Chipset INTA# */
39#define L_PIRQB 2 /* Means Slot INTx# Connects To Chipset INTB# */
40#define L_PIRQC 3 /* Means Slot INTx# Connects To Chipset INTC# */
41#define L_PIRQD 4 /* Means Slot INTx# Connects To Chipset INTD# */
42
Stefan Reinauera47bd912012-11-15 15:15:15 -080043static const struct irq_routing_table intel_irq_routing_table = {
Jens Rottmann36224b42010-09-10 21:51:34 +000044 PIRQ_SIGNATURE, /* u32 signature */
45 PIRQ_VERSION, /* u16 version */
46 32 + 16 * CONFIG_IRQ_SLOT_COUNT,/* There can be total CONFIG_IRQ_SLOT_COUNT devices on the bus */
47 0x00, /* Where the interrupt router lies (bus) */
48 (0x0F << 3) | 0x0, /* Where the interrupt router lies (dev) */
49 0x00, /* IRQs devoted exclusively to PCI usage */
50 0x100B, /* Vendor */
51 0x002B, /* Device */
Uwe Hermann8fa90ec2010-09-21 21:16:27 +000052 0, /* Miniport data */
Jens Rottmann36224b42010-09-10 21:51:34 +000053 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, /* u8 rfu[11] */
54 0x36, /* u8 checksum, this has to set to some value that would give 0 after the sum of all bytes for this structure (including checksum) */
55 {
56 /* If you change the number of entries, change the CONFIG_IRQ_SLOT_COUNT above! */
57 /* bus, dev|fn, {link, bitmap}, {link, bitmap}, {link, bitmap}, {link, bitmap}, slot, rfu */
58 {0x00, (0x01 << 3) | 0x0, {{L_PIRQA, M_PIRQA}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}}, 0x0, 0x0}, /* CPU */
59 {0x00, (0x0F << 3) | 0x0, {{L_PIRQA, M_PIRQA}, {L_PIRQB, M_PIRQB}, {L_PIRQC, M_PIRQC}, {L_PIRQD, M_PIRQD}}, 0x0, 0x0}, /* chipset */
60 {0x00, (0x0E << 3) | 0x0, {{L_PIRQC, M_PIRQC}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}}, 0x0, 0x0}, /* ethernet */
61 {0x00, (0x0B << 3) | 0x0, {{L_PIRQA, M_PIRQA}, {L_PIRQB, M_PIRQB}, {L_PIRQC, M_PIRQC}, {L_PIRQD, M_PIRQD}}, 0x1, 0x0}, /* slot1 */
62 {0x00, (0x0A << 3) | 0x0, {{L_PIRQB, M_PIRQB}, {L_PIRQC, M_PIRQC}, {L_PIRQD, M_PIRQD}, {L_PIRQA, M_PIRQA}}, 0x2, 0x0}, /* slot2 */
63 {0x00, (0x09 << 3) | 0x0, {{L_PIRQC, M_PIRQC}, {L_PIRQD, M_PIRQD}, {L_PIRQA, M_PIRQA}, {L_PIRQB, M_PIRQB}}, 0x3, 0x0}, /* slot3 */
64 {0x00, (0x08 << 3) | 0x0, {{L_PIRQD, M_PIRQD}, {L_PIRQA, M_PIRQA}, {L_PIRQB, M_PIRQB}, {L_PIRQC, M_PIRQC}}, 0x4, 0x0}, /* slot4 */
65 {0x00, (0x0D << 3) | 0x0, {{L_PIRQB, M_PIRQB}, {L_PIRQA, M_PIRQA}, {0x00, 0x00}, {0x00, 0x00}}, 0x5, 0x0}, /* Mini-PCI */
66 }
67};
68
69unsigned long write_pirq_routing_table(unsigned long addr)
70{
Stefan Reinauera47bd912012-11-15 15:15:15 -080071 return copy_pirq_routing_table(addr, &intel_irq_routing_table);
Jens Rottmann36224b42010-09-10 21:51:34 +000072}