Hi,
attached patch moves the mptable entries for ISA bus interrupts (ie. the legacy stuff) to generic code. Instead of the hogde-podge in each board's mptable.c, it's relatively clean code in arch/i386 now.
There are some changes, but I think they don't matter:
- no more "DEFAULT" configuration for the ISA interrupts, they're always explicitely EDGE/LOW now. As ISA is specified that way, DEFAULT should lead to the same result.
- fully specified interrupt map from 1 to 15: Some boards didn't specify various irqs (some of irq 3, 8, 9, 10, 11 were commonly left out). Either these are actually in use, in which case we better provide an entry, or they're not, in which case these entries won't hurt (as far as I can see)
The new function uses an mptable_ prefix. The smp_ prefix is less descriptive, but I didn't want to rename all of this in one go. As I plan to move more code out of the individual mptable.c files, I'd like to hold off with any rename until that's settled down.
The long term goal would be to have coreboot generate the mptable according to the actual bus situation instead of this mostly (but not entirely) hardcoded table. Moving common code sequences out is the first step, after that I'll see how to store the data required for the mptable generation (eg. IOAPIC information) in the device tree.
As this is quite a large patch, affecting lots of boards, I'd welcome some review that I didn't delete a line too much or something like that.
It's abuild tested and Signed-off-by: Patrick Georgi patrick.georgi@coresystems.de
attached patch moves the mptable entries for ISA bus interrupts (ie. the legacy stuff) to generic code. Instead of the hogde-podge in each board's mptable.c, it's relatively clean code in arch/i386 now.
Thanks for doing this.
As this is quite a large patch, affecting lots of boards, I'd welcome some review that I didn't delete a line too much or something like that.
Index: src/mainboard/amd/mahogany_fam10/mptable.c
--- src/mainboard/amd/mahogany_fam10/mptable.c (revision 5574) +++ src/mainboard/amd/mahogany_fam10/mptable.c (working copy) @@ -122,24 +122,8 @@ #define IO_LOCAL_INT(type, intr, apicid, pin) \ smp_write_intsrc(mc, (type), MP_IRQ_TRIGGER_EDGE |
MP_IRQ_POLARITY_HIGH, bus_isa, (intr), (apicid), (pin));
- IO_LOCAL_INT(mp_ExtINT, 0x0, apicid_sb700, 0x0);
- mptable_add_isa_interrupts(mc, bus_isa, apicid_sb700, 0);
It looks like IO_LOCAL_INT should be removed, since it uses bus_isa. Same for tilapia & probably other similar mainboards.
/*I/O Ints: Type Polarity Trigger
Bus ID IRQ APIC ID PIN# */
smp_write_intsrc(mc, mp_INT,
MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, m->bus_mcp55[0], ((sbdn+1)<<2)|1, m->apicid_mcp55, 0xa);
In some places you reformat the comment, in others you just remove it.
It's abuild tested and Signed-off-by: Patrick Georgi patrick.georgi@coresystems.de
Acked-by: Myles Watson mylesgw@gmail.com
Thanks, Myles
Am 20.05.2010 17:00, schrieb Myles Watson:
#define IO_LOCAL_INT(type, intr, apicid, pin) \ smp_write_intsrc(mc, (type), MP_IRQ_TRIGGER_EDGE |
MP_IRQ_POLARITY_HIGH, bus_isa, (intr), (apicid), (pin));
- IO_LOCAL_INT(mp_ExtINT, 0x0, apicid_sb700, 0x0);
- mptable_add_isa_interrupts(mc, bus_isa, apicid_sb700, 0);
It looks like IO_LOCAL_INT should be removed, since it uses bus_isa. Same for tilapia & probably other similar mainboards.
It's still used for some other table entry, so I kept it. Once that entry is gone (I think it can be made generic, too), I'll remove the macro.
With all done, it might be possible to drop board specific mptable.c's completely, which would also fix this issue.
/*I/O Ints: Type Polarity Trigger
Bus ID IRQ APIC ID PIN# */
smp_write_intsrc(mc, mp_INT,
MP_IRQ_TRIGGER_LEVEL|MP_IRQ_POLARITY_LOW, m->bus_mcp55[0], ((sbdn+1)<<2)|1, m->apicid_mcp55, 0xa);
In some places you reformat the comment, in others you just remove it.
And the comment doesn't even exist in all files - mptable.c isn't very consistent to begin with. I guess this happened because some files had /* comment here */ code I removed on the same line as the comment end
Committed as r5575, thank you for the Ack.
Patrick