coreboot-kgpe-d16/src/mainboard/nvidia/l1_2pvv
Patrick Georgi 6eb7a53169 mptable: Refactor lintsrc generation
We copied pretty much the same code for generating mptable entries for
local interrupts (with some notable exceptions).
This change moves these lines into a generic function "mptable_lintsrc"
and makes use of it in many places.

The remaining uses of smp_write_lintsrc should be reviewed and replaced
by mptable_lintsrc calls where possible, and smp_write_lintsrc made static.

This patch was generated using Coccinelle:
  @@
  expression mc;
  expression isa_bus;
  @@
  -smp_write_lintsrc(mc, mp_ExtINT, MP_IRQ_TRIGGER_DEFAULT|MP_IRQ_POLARITY_DEFAULT, isa_bus, 0x0, MP_APIC_ALL, 0x0);
  -smp_write_lintsrc(mc, mp_NMI, MP_IRQ_TRIGGER_DEFAULT|MP_IRQ_POLARITY_DEFAULT, isa_bus, 0x0, MP_APIC_ALL, 0x1);
  +mptable_lintsrc(mc, isa_bus);

  @@
  expression mc;
  expression isa_bus;
  @@
  -smp_write_lintsrc(mc, mp_ExtINT, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, isa_bus, 0x0, MP_APIC_ALL, 0x0);
  -smp_write_lintsrc(mc, mp_NMI, MP_IRQ_TRIGGER_EDGE|MP_IRQ_POLARITY_HIGH, isa_bus, 0x0, MP_APIC_ALL, 0x1);
  +mptable_lintsrc(mc, isa_bus);

  @m@
  identifier mc;
  expression BUS;
  @@
  -#define IO_LOCAL_INT(type, intr, apicid, pin) smp_write_lintsrc(mc, (type), MP_IRQ_TRIGGER_EDGE | MP_IRQ_POLARITY_HIGH, BUS, (intr), (apicid), (pin));
  ...
  -IO_LOCAL_INT(mp_ExtINT, 0x0, MP_APIC_ALL, 0x0);
  -IO_LOCAL_INT(mp_NMI, 0x0, MP_APIC_ALL, 0x1);
  +mptable_lintsrc(mc, BUS);

Change-Id: I97421f820cd039f5fd753cb0da5c1cca68819bb4
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/244
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marcj303@gmail.com>
2011-10-13 01:10:31 +02:00
..
ap_romstage.c In 2007 Adrian Reber suggested that we drop ASSEMBLY in favor of __ASSEMBLER__. 2011-04-10 04:15:23 +00:00
chip.h Remove unused mainboard_config definitions. Trivial. 2010-08-26 18:24:04 +00:00
cmos.layout Replace dual_core and quad_core CMOS (nvram) options with multi_core. Fix some white space. 2010-04-08 15:06:44 +00:00
devicetree.cb Use subsystem id from devicetree.cb instead of Kconfig and move 2011-03-01 19:58:47 +00:00
get_bus_conf.c Convert more boards to use mptable_write_buses. 2010-11-21 14:41:07 +00:00
hda_verb.h Two hda_verb.h files: Add more comments. 2010-12-10 12:52:50 +00:00
irq_tables.c move amd K8/Fam10 "bus detection" function prototypes to a common place. 2010-04-07 15:30:11 +00:00
Kconfig Use subsystem id from devicetree.cb instead of Kconfig and move 2011-03-01 19:58:47 +00:00
mainboard.c My old mcp55 azalia fix from May 2010. Was never checked in. 2010-08-14 17:45:54 +00:00
mb_sysconf.h Convert more boards to use mptable_write_buses. 2010-11-21 14:41:07 +00:00
mptable.c mptable: Refactor lintsrc generation 2011-10-13 01:10:31 +02:00
resourcemap.c Whitespace fixes. 2008-10-06 21:00:46 +00:00
romstage.c run uart_init() from console_init, just like the other console initialization functions. 2011-04-20 20:54:07 +00:00