blob: dfb1ef4d089dbfe0679e65573d60922d92a31cf9 [file] [log] [blame]
Marc Jones9c9083b2007-05-04 18:47:52 +00001/*
Stefan Reinauer7e61e452008-01-18 10:35:56 +00002 * This file is part of the coreboot project.
Uwe Hermann344e4572007-05-22 10:12:49 +00003 *
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 Menzela8ae1c62013-02-20 13:21:20 +010012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Uwe Hermann344e4572007-05-22 10:12:49 +000013 * GNU General Public License for more details.
Uwe Hermann344e4572007-05-22 10:12:49 +000014 */
Marc Jones9c9083b2007-05-04 18:47:52 +000015
16#include <arch/pirq_routing.h>
17#include <console/console.h>
18#include <arch/io.h>
19#include <arch/pirq_routing.h>
Uwe Hermann5df41682010-09-25 16:17:20 +000020#include "southbridge/amd/cs5536/cs5536.h"
Marc Jones9c9083b2007-05-04 18:47:52 +000021
22/* Platform IRQs */
23#define PIRQA 11
24#define PIRQB 5
25#define PIRQC 10
26#define PIRQD 10
27
28/* Map */
Jordan Crouse89d7cd22007-05-10 18:00:24 +000029#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 */
Marc Jones9c9083b2007-05-04 18:47:52 +000033
34/* Link */
Jordan Crouse89d7cd22007-05-10 18:00:24 +000035#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# */
Marc Jones9c9083b2007-05-04 18:47:52 +000039
Stefan Reinauera47bd912012-11-15 15:15:15 -080040static const struct irq_routing_table intel_irq_routing_table = {
Jordan Crouse89d7cd22007-05-10 18:00:24 +000041 PIRQ_SIGNATURE, /* u32 signature */
42 PIRQ_VERSION, /* u16 version */
Uwe Hermann95313d82009-10-07 21:51:33 +000043 32 + 16 * CONFIG_IRQ_SLOT_COUNT, /* there can be total CONFIG_IRQ_SLOT_COUNT devices on the bus */
Marc Jones9c9083b2007-05-04 18:47:52 +000044 0x00, /* Where the interrupt router lies (bus) */
Jordan Crouse89d7cd22007-05-10 18:00:24 +000045 (0x0F << 3) | 0x0, /* Where the interrupt router lies (dev) */
Marc Jones9c9083b2007-05-04 18:47:52 +000046 0x00, /* IRQs devoted exclusively to PCI usage */
47 0x100B, /* Vendor */
48 0x002B, /* Device */
Uwe Hermann8fa90ec2010-09-21 21:16:27 +000049 0, /* Miniport data */
Jordan Crouse89d7cd22007-05-10 18:00:24 +000050 {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) */
Marc Jones9c9083b2007-05-04 18:47:52 +000052 {
Stefan Reinauer08670622009-06-30 15:17:49 +000053 /* If you change the number of entries, change the CONFIG_IRQ_SLOT_COUNT above! */
Uwe Hermannd83f79f2007-05-14 11:33:41 +000054 /* bus, dev|fn, {link, bitmap}, {link, bitmap}, {link, bitmap}, {link, bitmap}, slot, rfu */
Jordan Crouse89d7cd22007-05-10 18:00:24 +000055 {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_PIRQB, M_PIRQB}, {L_PIRQC, M_PIRQC}, {L_PIRQD, M_PIRQD}, {L_PIRQA, M_PIRQA}}, 0x1, 0x0}, /* slot1 */
58 {0x00, (0x0E << 3) | 0x0, {{L_PIRQC, M_PIRQC}, {L_PIRQD, M_PIRQD}, {L_PIRQA, M_PIRQA}, {L_PIRQB, M_PIRQB}}, 0x2, 0x0}, /* slot2 */
59 {0x00, (0x0B << 3) | 0x0, {{L_PIRQD, M_PIRQD}, {L_PIRQA, M_PIRQA}, {L_PIRQB, M_PIRQB}, {L_PIRQC, M_PIRQC}}, 0x3, 0x0}, /* slot3 */
60 {0x00, (0x0C << 3) | 0x0, {{L_PIRQA, M_PIRQA}, {L_PIRQB, M_PIRQB}, {L_PIRQC, M_PIRQC}, {L_PIRQD, M_PIRQD}}, 0x4, 0x0}, /* slot4 */
61 }
Marc Jones9c9083b2007-05-04 18:47:52 +000062};
63
Jordan Crouse89d7cd22007-05-10 18:00:24 +000064unsigned long write_pirq_routing_table(unsigned long addr)
65{
Stefan Reinauera47bd912012-11-15 15:15:15 -080066 return copy_pirq_routing_table(addr, &intel_irq_routing_table);
Marc Jones9c9083b2007-05-04 18:47:52 +000067}