2007-05-05 05:54:13 +02:00
|
|
|
/*
|
2008-01-18 11:35:56 +01:00
|
|
|
* This file is part of the coreboot project.
|
2007-05-22 12:12:49 +02:00
|
|
|
*
|
|
|
|
* Copyright (C) 2007 Advanced Micro Devices, Inc.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
2007-05-05 05:54:13 +02:00
|
|
|
|
|
|
|
#include <arch/pirq_routing.h>
|
|
|
|
#include <console/console.h>
|
|
|
|
#include <arch/io.h>
|
|
|
|
#include <arch/pirq_routing.h>
|
|
|
|
#include "../../../southbridge/amd/cs5536/cs5536.h"
|
|
|
|
|
|
|
|
/* Platform IRQs */
|
|
|
|
#define PIRQA 11
|
|
|
|
#define PIRQB 5
|
|
|
|
#define PIRQC 10
|
|
|
|
#define PIRQD 10
|
|
|
|
|
|
|
|
/* Map */
|
|
|
|
#define M_PIRQA (1 << PIRQA) /* Bitmap of supported IRQs */
|
|
|
|
#define M_PIRQB (1 << PIRQB) /* Bitmap of supported IRQs */
|
|
|
|
#define M_PIRQC (1 << PIRQC) /* Bitmap of supported IRQs */
|
|
|
|
#define M_PIRQD (1 << PIRQD) /* Bitmap of supported IRQs */
|
|
|
|
|
|
|
|
/* Link */
|
|
|
|
#define L_PIRQA 1 /* Means Slot INTx# Connects To Chipset INTA# */
|
|
|
|
#define L_PIRQB 2 /* Means Slot INTx# Connects To Chipset INTB# */
|
|
|
|
#define L_PIRQC 3 /* Means Slot INTx# Connects To Chipset INTC# */
|
|
|
|
#define L_PIRQD 4 /* Means Slot INTx# Connects To Chipset INTD# */
|
|
|
|
|
|
|
|
const struct irq_routing_table intel_irq_routing_table = {
|
2007-05-08 18:04:36 +02:00
|
|
|
PIRQ_SIGNATURE, /* u32 signature */
|
|
|
|
PIRQ_VERSION, /* u16 version */
|
2009-10-07 23:51:33 +02:00
|
|
|
32+16*CONFIG_IRQ_SLOT_COUNT, /* There can be total CONFIG_IRQ_SLOT_COUNT devices on the bus */
|
2007-05-08 18:04:36 +02:00
|
|
|
0x00, /* Where the interrupt router lies (bus) */
|
|
|
|
(0x0f<<3)|0x0, /* Where the interrupt router lies (dev) */
|
|
|
|
0, /* IRQs devoted exclusively to PCI usage */
|
|
|
|
0x100b, /* Vendor */
|
|
|
|
0x2b, /* Device */
|
|
|
|
0, /* Crap (miniport) */
|
|
|
|
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* u8 rfu[11] */
|
|
|
|
0xe, /* u8 checksum. This has to be set to some
|
|
|
|
value that would give 0 after the sum of all
|
|
|
|
bytes for this structure (including checksum) */
|
|
|
|
{
|
|
|
|
/* bus, dev|fn, {link, bitmap}, {link, bitmap}, {link, bitmap}, {link, bitmap}, slot, rfu */
|
|
|
|
{0x00,(0x01<<3)|0x0, {{0x01, 0x0400}, {0x00, 0x0000}, {0x00, 0x0000}, {0x00, 0x00000}}, 0x0, 0x0},
|
|
|
|
{0x00,(0x0f<<3)|0x0, {{0x01, 0x0400}, {0x02, 0x0800}, {0x03, 0x0400}, {0x04, 0x00800}}, 0x0, 0x0},
|
|
|
|
{0x00,(0x13<<3)|0x0, {{0x01, 0x0400}, {0x00, 0x0000}, {0x00, 0x0000}, {0x00, 0x00000}}, 0x0, 0x0},
|
|
|
|
{0x00,(0x12<<3)|0x0, {{0x03, 0x0400}, {0x00, 0x0000}, {0x00, 0x0000}, {0x00, 0x00000}}, 0x0, 0x0},
|
|
|
|
{0x00,(0x11<<3)|0x0, {{0x01, 0x0400}, {0x02, 0x0800}, {0x00, 0x0000}, {0x00, 0x00000}}, 0x0, 0x0},
|
|
|
|
{0x00,(0x0a<<3)|0x0, {{0x01, 0x0400}, {0x02, 0x0800}, {0x03, 0x0400}, {0x04, 0x00800}}, 0x1, 0x0},
|
|
|
|
{0x00,(0x0b<<3)|0x0, {{0x02, 0x0800}, {0x03, 0x0400}, {0x04, 0x0800}, {0x01, 0x00400}}, 0x2, 0x0},
|
|
|
|
{0x00,(0x0c<<3)|0x0, {{0x03, 0x0400}, {0x04, 0x0800}, {0x01, 0x0400}, {0x02, 0x00800}}, 0x3, 0x0},
|
|
|
|
{0x00,(0x0d<<3)|0x0, {{0x04, 0x0800}, {0x01, 0x0400}, {0x02, 0x0800}, {0x03, 0x00400}}, 0x4, 0x0},
|
|
|
|
}
|
2007-05-05 05:54:13 +02:00
|
|
|
};
|
|
|
|
|
Now coreboot performs IRQ routing for some boards.
You can see this by executing commands like this:
grep -r pci_assign_irqs coreboot/src/*
This basically AMD/LX based boards: pcengines/alix1c,
digitallogic/msm800sev, artecgroup/dbe61, amd/norwich, amd/db800.
Also for AMD/GX1 based boards need a patch
[http://www.pengutronix.de/software/ptxdist/temporary-src/references/geode-5530.patch]
for the right IRQ setup.
AMD/GX1 based boards is: advantech/pcm-5820, asi/mb_5blmp, axus/tc320,
bcom/winnet100, eaglelion/5bcm, iei/nova4899r, iei/juki-511p.
I have two ideas.
1. Delete duplicate code from AMD/LX based boards.
2. Add IRQ routing for AMD/GX1 boards in coreboot.
The pirq.patch for IRQ routing logically consist from of two parts:
First part of pirq.patch independent from type chipsets and assign IRQ for
ever PCI device. It part based on AMD/LX write_pirq_routing_table() function.
Second part of pirq.patch depends of type chipset and set PIRQx lines
in interrupt router. This part supports only CS5530/5536 interrupt routers.
IRQ routing functionality is included through PIRQ_ROUTE in Config.lb.
Tested on iei/juki-511p(cs5530a), iei/pcisa-lx(cs5536) and also on
TeleVideo TC7020, see
http://www.coreboot.org/pipermail/coreboot/2007-December/027973.html.
Signed-off-by: Nikolay Petukhov <nikolay.petukhov@gmail.com>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3196 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
2008-03-29 17:59:27 +01:00
|
|
|
unsigned long write_pirq_routing_table(unsigned long addr)
|
|
|
|
{
|
|
|
|
return copy_pirq_routing_table(addr);
|
2007-05-08 18:04:36 +02:00
|
|
|
}
|