the following patch was just integrated into master:
commit 5ff70e835e2d52a08f072972bc2ba576fa067174
Author: Sven Schnelle <svens(a)stackframe.org>
Date: Mon Aug 20 11:19:00 2012 +0200
MPTABLE: check for fixed IRQ entries on all pins
Don't derive the IRQ pin from the function number. Especially onboard
chipset devices don't follow that rule. Instead check and add all
fixed IRQ entries.
Change-Id: I46c88bad39104c1d9b4154f180f8b3c42df28262
Signed-off-by: Sven Schnelle <svens(a)stackframe.org>
Build-Tested: build bot (Jenkins) at Sat Aug 25 03:07:29 2012, giving +1
Reviewed-By: Alexandru Gagniuc <mr.nuke.me(a)gmail.com> at Sat Aug 25 05:15:50 2012, giving +2
See http://review.coreboot.org/1461 for details.
-gerrit
Alexandru Gagniuc (mr.nuke.me(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1478
-gerrit
commit 200dd809f040c5ef34c4faf1c478e751fe620897
Author: Christian Gmeiner <christian.gmeiner(a)gmail.com>
Date: Wed Aug 22 16:59:02 2012 +0200
Add possibility to patch VGA oprom
In some rare cases it could be useful to patch a VGA oprom in order
to fix some stuff. In later patches this will be used to add EDID
information to SeaVIDEOBIOS in oder to support some flat panels.
Change-Id: Ic1005053265505a65b6fd99bc3c6c9cfcbffee43
Signed-off-by: Christian Gmeiner <christian.gmeiner(a)gmail.com>
---
src/devices/pci_rom.c | 7 +++++++
src/include/device/pci_rom.h | 3 +++
2 files changed, 10 insertions(+)
diff --git a/src/devices/pci_rom.c b/src/devices/pci_rom.c
index fe67515..1135d94 100644
--- a/src/devices/pci_rom.c
+++ b/src/devices/pci_rom.c
@@ -162,6 +162,13 @@ struct rom_header *pci_rom_load(struct device *dev,
memcpy((void *)PCI_VGA_RAM_IMAGE_START, rom_header,
rom_size);
}
+
+ /* In some cases it is useful to patch an pci vga oprom. A good example
+ * is adding/changing some EDID information stored in the VGA option rom.
+ */
+ if (pci_vga_rom_patch)
+ pci_vga_rom_patch(rom_data, (void *)PCI_VGA_RAM_IMAGE_START);
+
return (struct rom_header *) (PCI_VGA_RAM_IMAGE_START);
}
diff --git a/src/include/device/pci_rom.h b/src/include/device/pci_rom.h
index fe77276..690e304 100644
--- a/src/include/device/pci_rom.h
+++ b/src/include/device/pci_rom.h
@@ -37,4 +37,7 @@ struct rom_header *pci_rom_probe(struct device *dev);
struct rom_header *pci_rom_load(struct device *dev, struct rom_header *rom_header);
u32 __attribute__((weak)) map_oprom_vendev(u32 vendev);
+void __attribute__((weak))
+pci_vga_rom_patch(struct pci_data *rom_data, void *pci_vga_ram_image_start);
+
#endif
Alexandru Gagniuc (mr.nuke.me(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1482
-gerrit
commit 3bcbfa3d58496480434c6d9fa4eefcc667365f81
Author: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
Date: Thu Aug 23 02:32:58 2012 -0500
pirq_routing: Allow routing with more than 4 PIRQ links
pirq_routing_irqs assumed that only for links are available for PIRQ
routing, INTA to INTD. Some chipsets provide more, up to INTH.
When pirq_routing_irqs found a link number greater than 4in the pirq table,
it would not assign that IRQ. This is a shame, as it limits the flexibility
of routing IRQs.
Make the maximum number of links a Kconfig variable, and modify the code to
respect it. This works beatifully on the VX900, which provides 8 routable
interrupts.
While we're at it, also refactor pirq_routing_irqs, and add some much
needed comments.
Change-Id: I4b565315404c65b871406f616474e2cc9e6e013e
Signed-off-by: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
---
src/Kconfig | 11 ++++++
src/arch/x86/boot/pirq_routing.c | 77 +++++++++++++++++++++++++---------------
2 files changed, 60 insertions(+), 28 deletions(-)
diff --git a/src/Kconfig b/src/Kconfig
index 469266d..6da906d 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -374,6 +374,17 @@ config HAVE_PIRQ_TABLE
Whether or not the PIRQ table is actually generated by coreboot
is configurable by the user via GENERATE_PIRQ_TABLE.
+config MAX_PIRQ_LINKS
+ int
+ default 4
+ help
+ This variable specifies the number of PIRQ interrupt links which are
+ routable. On most chipsets, this is 4, INTA through INTD. Some
+ chipsets offer more than four links, commonly up to INTH. They may
+ also have a separate link for ATA or IOAPIC interrupts. When the PIRQ
+ table specifies links greater than 4, pirq_routing_irqs will not
+ function properly, unless this variable is correctly set.
+
#These Options are here to avoid "undefined" warnings.
#The actual selection and help texts are in the following menu.
diff --git a/src/arch/x86/boot/pirq_routing.c b/src/arch/x86/boot/pirq_routing.c
index bb8a7b6..dd147c6 100644
--- a/src/arch/x86/boot/pirq_routing.c
+++ b/src/arch/x86/boot/pirq_routing.c
@@ -97,13 +97,47 @@ unsigned long copy_pirq_routing_table(unsigned long addr)
}
#if CONFIG_PIRQ_ROUTE
+
+#define MAX_INTX_ENTRIES 4
+static u8 pirq_get_next_free_irq(u8* pirq, u16 bitmap)
+{
+ int i, link;
+ u8 irq = 0;
+ for (i = 2; i <= 15; i++)
+ {
+ /* Can we assign this IRQ ? */
+ if (!((bitmap >> i) & 1))
+ continue;
+ /* We can, Now let's assume we can use this IRQ */
+ irq = i;
+ /* And assume we have not yet routed it */
+ int already_routed = 0;
+ /* Have we already routed it ? */
+ for(link = 0; link < CONFIG_MAX_PIRQ_LINKS; link++) {
+ if (pirq[link] == irq) {
+ already_routed = 1;
+ break;
+ }
+ }
+ /* If it's not yet routed, use it */
+ if(!already_routed)
+ break;
+ /* But if it was already routed, try the next one */
+ continue;
+ }
+ /* Now we got our IRQ */
+ return irq;
+}
+
void pirq_routing_irqs(unsigned long addr)
{
- int i, j, k, num_entries;
- unsigned char irq_slot[4];
- unsigned char pirq[4] = {0, 0, 0, 0};
+ int i, intx, num_entries;
+ unsigned char irq_slot[MAX_INTX_ENTRIES];
+ unsigned char pirq[CONFIG_MAX_PIRQ_LINKS];
struct irq_routing_table *pirq_tbl;
+ memset(pirq, 0, CONFIG_MAX_PIRQ_LINKS);
+
pirq_tbl = (struct irq_routing_table *)(addr);
num_entries = (pirq_tbl->size - 32) / 16;
@@ -113,37 +147,26 @@ void pirq_routing_irqs(unsigned long addr)
printk(BIOS_DEBUG, "PIRQ Entry %d Dev/Fn: %X Slot: %d\n", i,
pirq_tbl->slots[i].devfn >> 3, pirq_tbl->slots[i].slot);
- for (j = 0; j < 4; j++) {
+ for (intx = 0; intx < MAX_INTX_ENTRIES; intx++) {
- int link = pirq_tbl->slots[i].irq[j].link;
- int bitmap = pirq_tbl->slots[i].irq[j].bitmap;
+ int link = pirq_tbl->slots[i].irq[intx].link;
+ int bitmap = pirq_tbl->slots[i].irq[intx].bitmap;
int irq = 0;
printk(BIOS_DEBUG, "INT: %c link: %x bitmap: %x ",
- 'A' + j, link, bitmap);
+ 'A' + intx, link, bitmap);
- if (!bitmap|| !link || link > 4) {
+ if (!bitmap|| !link || link > CONFIG_MAX_PIRQ_LINKS) {
printk(BIOS_DEBUG, "not routed\n");
- irq_slot[j] = irq;
+ irq_slot[intx] = irq;
continue;
}
/* yet not routed */
- if (!pirq[link - 1]) {
-
- for (k = 2; k <= 15; k++) {
-
- if (!((bitmap >> k) & 1))
- continue;
-
- irq = k;
-
- /* yet not routed */
- if (pirq[0] != irq && pirq[1] != irq && pirq[2] != irq && pirq[3] != irq)
- break;
- }
-
+ if (!pirq[link - 1])
+ {
+ irq = pirq_get_next_free_irq(pirq, bitmap);
if (irq)
pirq[link - 1] = irq;
}
@@ -151,7 +174,7 @@ void pirq_routing_irqs(unsigned long addr)
irq = pirq[link - 1];
printk(BIOS_DEBUG, "IRQ: %d\n", irq);
- irq_slot[j] = irq;
+ irq_slot[intx] = irq;
}
/* Bus, device, slots IRQs for {A,B,C,D}. */
@@ -159,10 +182,8 @@ void pirq_routing_irqs(unsigned long addr)
pirq_tbl->slots[i].devfn >> 3, irq_slot);
}
- printk(BIOS_DEBUG, "PIRQ1: %d\n", pirq[0]);
- printk(BIOS_DEBUG, "PIRQ2: %d\n", pirq[1]);
- printk(BIOS_DEBUG, "PIRQ3: %d\n", pirq[2]);
- printk(BIOS_DEBUG, "PIRQ4: %d\n", pirq[3]);
+ for(i = 0; i < CONFIG_MAX_PIRQ_LINKS; i++)
+ printk(BIOS_DEBUG, "PIRQ%u: %d\n", i+1, pirq[i]);
pirq_assign_irqs(pirq);
}
Alexandru Gagniuc (mr.nuke.me(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1481
-gerrit
commit b52a318592af96e41b1c2d40e8755e6274e41cb9
Author: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
Date: Wed Aug 22 19:12:49 2012 -0500
ioapic driver: typedef the ioapic_config struct (TRIVIAL)
I use the ioapic_config in my VX900 branch.
Typing:
struct drivers_generic_ioapic_config *config = (struct drivers_generic_ioapic_config *)dev->chip_info;
is clumsy at best, so just create a typedef to mahe this more elegant:
ioapic_config_t config = (ioapic_config_t*)ioapic->chip_info;
Change-Id: I407899845cfbd847ba6309dd0cf9ef836a607c8e
Signed-off-by: Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
---
src/drivers/generic/ioapic/chip.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/drivers/generic/ioapic/chip.h b/src/drivers/generic/ioapic/chip.h
index ad6ff0b..0936d63 100644
--- a/src/drivers/generic/ioapic/chip.h
+++ b/src/drivers/generic/ioapic/chip.h
@@ -2,6 +2,7 @@
* This file is part of the coreboot project.
*
* Copyright (C) 2011 Sven Schnelle <svens(a)stackframe.org>
+ * Copyright (C) 2012 Alexandru Gagniuc <mr.nuke.me(a)gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,12 +21,13 @@
#ifndef DRIVERS_GENERIC_IOAPIC_CHIP_H
#define DRIVERS_GENERIC_IOAPIC_CHIP_H
-struct drivers_generic_ioapic_config {
+typedef struct drivers_generic_ioapic_config {
u32 version;
u8 apicid;
u8 irq_on_fsb;
u8 enable_virtual_wire;
u8 have_isa_interrupts;
u32 base;
-};
+} ioapic_config_t;
+
#endif
the following patch was just integrated into master:
commit cf86e09ebfae2cf65beade47ba5da925617a86e2
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Sat Aug 25 00:21:44 2012 +0300
Fix mptable build troubles
A missing mptable.c file got passed jenkins, got merged
and broke the build. Hopefully finally fix this.
Deletes unused files:
src/mainboard/asus/dsbf/mptable.c
src/mainboard/supermicro/x7db8/mptable.c
Change-Id: Ie81f5a6c4c69ab381f86a243bc8874395e69ee26
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Build-Tested: build bot (Jenkins) at Fri Aug 24 23:35:41 2012, giving +1
Reviewed-By: Alexandru Gagniuc <mr.nuke.me(a)gmail.com> at Fri Aug 24 23:36:06 2012, giving +2
See http://review.coreboot.org/1486 for details.
-gerrit