qemu: fix IRQ routing setup

Do the setup for all PCI slots, not only the third.

Also remove the bogus message, as slot 3 may carry
any device, not only NICs.

This makes IRQ setup simliar to SeaBIOS.

SeaBIOS assignments (with patch for logging added,
and a bunch of pci devices for testing purposes):

    PCI IRQ [piix]: bdf=00:01.3 pin=1 line=10
    PCI IRQ [piix]: bdf=00:03.0 pin=1 line=11
    PCI IRQ [piix]: bdf=00:04.0 pin=1 line=11
    PCI IRQ [piix]: bdf=00:05.0 pin=1 line=10
    PCI IRQ [piix]: bdf=00:06.0 pin=1 line=10
    PCI IRQ [piix]: bdf=00:1d.0 pin=1 line=10
    PCI IRQ [piix]: bdf=00:1d.1 pin=2 line=10
    PCI IRQ [piix]: bdf=00:1d.2 pin=3 line=11
    PCI IRQ [piix]: bdf=00:1d.7 pin=4 line=11

Coreboot assignments without this patch:

    Assigning IRQ 11 to 0:3.0

Coreboot assignments with this patch:

    Assigning IRQ 10 to 0:1.3
    Assigning IRQ 11 to 0:3.0
    Assigning IRQ 11 to 0:4.0
    Assigning IRQ 10 to 0:5.0
    Assigning IRQ 10 to 0:6.0
    Assigning IRQ 10 to 0:1d.0
    Assigning IRQ 10 to 0:1d.1
    Assigning IRQ 11 to 0:1d.2
    Assigning IRQ 11 to 0:1d.7

Change-Id: Ie96be39185f2f1cbde3c9fc50e29faff59c28493
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-on: http://review.coreboot.org/3334
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
This commit is contained in:
Gerd Hoffmann 2013-05-29 14:59:36 +02:00 committed by Patrick Georgi
parent fd39ddd635
commit 082d2a0ab7
1 changed files with 7 additions and 8 deletions

View File

@ -18,7 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#include <console/console.h>
#include <device/device.h> #include <device/device.h>
#include <device/pci.h> #include <device/pci.h>
#include <device/pci_ids.h> #include <device/pci_ids.h>
@ -26,8 +25,10 @@
#include <pc80/keyboard.h> #include <pc80/keyboard.h>
#include <arch/io.h> #include <arch/io.h>
/* not sure how these are routed in qemu */ static const unsigned char qemu_i440fx_irqs[] = {
static const unsigned char enetIrqs[4] = { 11, 0, 0, 0 }; 11, 10, 10, 11,
11, 10, 10, 11,
};
static void qemu_nb_init(device_t dev) static void qemu_nb_init(device_t dev)
{ {
@ -44,11 +45,9 @@ static void qemu_nb_init(device_t dev)
*/ */
pc_keyboard_init(0); pc_keyboard_init(0);
/* The PIRQ table is not working well for interrupt routing purposes. /* setup IRQ routing */
* so we'll just set the IRQ directly. for (i = 0; i < 32; i++)
*/ pci_assign_irqs(0, i, qemu_i440fx_irqs + (i % 4));
printk(BIOS_INFO, "Setting up ethernet...\n");
pci_assign_irqs(0, 3, enetIrqs);
} }
static struct device_operations nb_operations = { static struct device_operations nb_operations = {