blob: 4de63c48de51e6719d4a3e1121bc23d92b1f5bc3 [file] [log] [blame]
Anish K. Patel3a54ac92010-02-24 16:36:56 +00001/*
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)
Uwe Hermanndbbecb52010-02-25 16:09:53 +00006 *
Anish K. Patel3a54ac92010-02-24 16:36:56 +00007 * This program is free software; you can redistribute it and/or modify
Uwe Hermanndbbecb52010-02-25 16:09:53 +00008 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
Anish K. Patel3a54ac92010-02-24 16:36:56 +000010 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Uwe Hermanndbbecb52010-02-25 16:09:53 +000013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Anish K. Patel3a54ac92010-02-24 16:36:56 +000014 * GNU General Public License for more details.
Anish K. Patel3a54ac92010-02-24 16:36:56 +000015 */
16
17#include <arch/pirq_routing.h>
18#include <console/console.h>
19#include <arch/io.h>
20#include <arch/pirq_routing.h>
Uwe Hermann5df41682010-09-25 16:17:20 +000021#include "southbridge/amd/cs5536/cs5536.h"
Anish K. Patel3a54ac92010-02-24 16:36:56 +000022
23/* Platform IRQs */
24#define PIRQA 11
25#define PIRQB 10
26#define PIRQC 5
27#define PIRQD 10
28
29/* Map */
30#define M_PIRQA (1 << PIRQA) /* Bitmap of supported IRQs */
31#define M_PIRQB (1 << PIRQB) /* Bitmap of supported IRQs */
32#define M_PIRQC (1 << PIRQC) /* Bitmap of supported IRQs */
33#define M_PIRQD (1 << PIRQD) /* Bitmap of supported IRQs */
34
35/* Link */
36#define L_PIRQA 1 /* Means Slot INTx# Connects To Chipset INTA# */
37#define L_PIRQB 2 /* Means Slot INTx# Connects To Chipset INTB# */
38#define L_PIRQC 3 /* Means Slot INTx# Connects To Chipset INTC# */
39#define L_PIRQD 4 /* Means Slot INTx# Connects To Chipset INTD# */
40
Stefan Reinauera47bd912012-11-15 15:15:15 -080041static const struct irq_routing_table intel_irq_routing_table = {
Anish K. Patel3a54ac92010-02-24 16:36:56 +000042 PIRQ_SIGNATURE, /* u32 signature */
43 PIRQ_VERSION, /* u16 version */
44 32 + 16 * CONFIG_IRQ_SLOT_COUNT, /* there can be total CONFIG_IRQ_SLOT_COUNT devices on the bus */
45 0x00, /* Where the interrupt router lies (bus) */
46 (0x0F << 3) | 0x0, /* Where the interrupt router lies (dev) */
47 0x00, /* IRQs devoted exclusively to PCI usage */
48 0x100B, /* Vendor */
49 0x002B, /* Device */
Uwe Hermann8fa90ec2010-09-21 21:16:27 +000050 0, /* Miniport data */
Anish K. Patel3a54ac92010-02-24 16:36:56 +000051 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, /* u8 rfu[11] */
52 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) */
53 {
54 /* If you change the number of entries, change the CONFIG_IRQ_SLOT_COUNT above! */
55 /* bus, dev|fn, {link, bitmap}, {link, bitmap}, {link, bitmap}, {link, bitmap}, slot, rfu */
56 {0x00, (0x01 << 3) | 0x0, {{L_PIRQA, M_PIRQA}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}}, 0x0, 0x0}, /* cpu */
57 {0x00, (0x0F << 3) | 0x0, {{L_PIRQA, M_PIRQA}, {L_PIRQB, M_PIRQB}, {L_PIRQC, M_PIRQC}, {L_PIRQD, M_PIRQD}}, 0x0, 0x0}, /* chipset */
58 {0x00, (0x09 << 3) | 0x0, {{L_PIRQD, M_PIRQD}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}}, 0x0, 0x0}, /* ethernet 0*/
59 {0x00, (0x0A << 3) | 0x0, {{L_PIRQA, M_PIRQA}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}}, 0x0, 0x0}, /* ethernet 1*/
60 {0x00, (0x0B << 3) | 0x0, {{L_PIRQB, M_PIRQB}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}}, 0x0, 0x0}, /* ethernet 2*/
61 {0x00, (0x0C << 3) | 0x0, {{L_PIRQC, M_PIRQC}, {0x00, 0x00}, {0x00, 0x00}, {0x00, 0x00}}, 0x0, 0x0}, /* ethernet 3 on 65 - shared switch on 64*/
62 {0x00, (0x0D << 3) | 0x0, {{L_PIRQC, M_PIRQC}, {L_PIRQD, M_PIRQD}, {L_PIRQA, M_PIRQA}, {L_PIRQB, M_PIRQB}}, 0x1, 0x0}, /* slot1 */
63 }
64};
65
66unsigned long write_pirq_routing_table(unsigned long addr)
67{
Stefan Reinauera47bd912012-11-15 15:15:15 -080068 return copy_pirq_routing_table(addr, &intel_irq_routing_table);
Anish K. Patel3a54ac92010-02-24 16:36:56 +000069}