coreboot/src/mainboard
Mike Loptien c93a75a5ab AMD/CIMx: Add functions for AMD PCI IRQ routing
The PCI_INTR table is an Index/Data pair of I/O ports
0xC00 and 0xC01.  This table is responsible for physically
routing IRQs to the PIC and IOAPIC.  The settings given
in this table are chipset and mainboard dependent, so the
table values will reside in the mainboard.c file. This
allows for a system to uniquely set its IRQ routing.
The function to write the PCI_INTR table resides in
cimx_util.c because the indices into the table have
the same definitions for all SBx00 FCH chipsets.

The next piece is a function that will read the PCI_INTR
table and program the INT_LINE and INT_PIN registers in
PCI config space appropriately.  This function will read
a devices' INT_PIN register, which is always hardcoded to
a value if it uses hardware interrupts.  It then uses this
value, along with the device and function numbers to
determine an index into the PCI_INTR table.  It will read
the table and program the corresponding value into the PCI
config space register 0x3C, INT_LINE.  Finally, it will set
this IRQ number to LEVEL_TRIGGERED on the PIC because it is
a PCI device interrupt and the must be level triggered.

For example, the SB800 USB EHCI device 0:18.2 has an INT_PIN
value hardcoded to 2.  This corresponds to PIN B.  On the
Persimmon mainboard, I want the USB device to use IRQ 11.  I
will program the PCI_INTR table at index 0x31 (this USB device
index) to 11.  This function will then read the INT_PIN register,
read the PCI_INTR table, and then program the INT_LINE register
with the value it read.  It will then set the IRQ on the PIC to
LEVEL_TRIGGERED by writing a 1 to I/O port 0x4D1 at bit position 4.

Also, the SB700 has slightly different register definitions than
the newer SB800 and SB900 so it needs its own set of #defines for
the pci_intr registers.

Only the Persimmon mainboard is adapted to this change as an
example for other mainboards.

Change-Id: I6de858289a17fa1e1abacf6328ea5099be74b1d6
Signed-off-by: Mike Loptien <mike.loptien@se-eng.com>
Reviewed-on: http://review.coreboot.org/5877
Tested-by: build bot (Jenkins)
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
2014-06-11 17:07:50 +02:00
..
a-trend mainboard: Remove #include early_serial.c from w83977tf boards 2014-06-03 09:36:33 +02:00
aaeon superio/smsc/smscsuperio: Make romstage linkable with header 2014-06-03 09:37:57 +02:00
abit mainboard: Remove #include early_serial.c from w83977tf boards 2014-06-03 09:36:33 +02:00
adlink LiPPERT: Add aliases for board_status wiki 2014-05-19 14:57:14 +02:00
advansus superio/winbond/w83627hf: Avoid .c includes in mainboards 2014-05-31 21:17:37 +02:00
advantech Move ARCH_* from board/Kconfig to cpu or soc Kconfig. 2014-05-03 00:25:20 +02:00
amd AMD/CIMx: Add functions for AMD PCI IRQ routing 2014-06-11 17:07:50 +02:00
aopen Move ARCH_* from board/Kconfig to cpu or soc Kconfig. 2014-05-03 00:25:20 +02:00
arima Move ARCH_* from board/Kconfig to cpu or soc Kconfig. 2014-05-03 00:25:20 +02:00
artecgroup Move ARCH_* from board/Kconfig to cpu or soc Kconfig. 2014-05-03 00:25:20 +02:00
asi Move ARCH_* from board/Kconfig to cpu or soc Kconfig. 2014-05-03 00:25:20 +02:00
asrock AGESA: Use common heap allocator 2014-06-06 13:31:31 +02:00
asus AGESA: Use common heap allocator 2014-06-06 13:31:31 +02:00
avalue superio/winbond/w83627hf: Avoid .c includes in mainboards 2014-05-31 21:17:37 +02:00
axus Move ARCH_* from board/Kconfig to cpu or soc Kconfig. 2014-05-03 00:25:20 +02:00
azza mainboard: Remove #include early_serial.c from w83977tf boards 2014-06-03 09:36:33 +02:00
bachmann Move ARCH_* from board/Kconfig to cpu or soc Kconfig. 2014-05-03 00:25:20 +02:00
bcom superio/winbond/w83697hf: Depreciate romstage component 2014-05-23 20:14:41 +02:00
bifferos Introduce stage-specific architecture for coreboot 2014-05-06 20:23:31 +02:00
biostar superio/smsc/smscsuperio: Make romstage linkable with header 2014-06-03 09:37:57 +02:00
broadcom Drop unused change_i2c_mux() 2014-06-06 07:30:23 +02:00
compaq Move ARCH_* from board/Kconfig to cpu or soc Kconfig. 2014-05-03 00:25:20 +02:00
cubietech Move ARCH_* from board/Kconfig to cpu or soc Kconfig. 2014-05-03 00:25:20 +02:00
digitallogic Move ARCH_* from board/Kconfig to cpu or soc Kconfig. 2014-05-03 00:25:20 +02:00
dmp Move ARCH_* from board/Kconfig to cpu or soc Kconfig. 2014-05-03 00:25:20 +02:00
eaglelion Move ARCH_* from board/Kconfig to cpu or soc Kconfig. 2014-05-03 00:25:20 +02:00
ecs intel: Remove GFXUMA and related global variables 2014-05-19 17:20:13 +02:00
emulation src/drivers/pc80: Remove empty struct keyboard 2014-05-13 10:03:51 +02:00
getac drivers: Drop GbE stub drivers 2014-05-20 13:46:35 +02:00
gigabyte superio/ite/it8718f: Remove hard coding from romstage 2014-05-12 17:43:46 +02:00
gizmosphere AGESA: Use common heap allocator 2014-06-06 13:31:31 +02:00
google sandybridge: Pass chip info to i915lightup. 2014-06-02 21:47:39 +02:00
hp AGESA: Use common heap allocator 2014-06-06 13:31:31 +02:00
ibase mainboard/ibase/mb899: Trivial, Non-local header treated as local 2014-06-01 13:35:24 +02:00
ibm Replace SERIAL_CPU_INIT with PARALLEL_CPU_INIT 2014-05-10 11:27:25 +02:00
iei superio/smsc/smscsuperio: Make romstage linkable with header 2014-06-03 09:37:57 +02:00
intel superio/smsc/smscsuperio: Make romstage linkable with header 2014-06-03 09:37:57 +02:00
iwave intel: Remove GFXUMA and related global variables 2014-05-19 17:20:13 +02:00
iwill Replace SERIAL_CPU_INIT with PARALLEL_CPU_INIT 2014-05-10 11:27:25 +02:00
jetway AGESA: Use common heap allocator 2014-06-06 13:31:31 +02:00
kontron superio/winbond/w83627thg: Depreciate romstage component 2014-05-28 22:53:33 +02:00
lanner Move ARCH_* from board/Kconfig to cpu or soc Kconfig. 2014-05-03 00:25:20 +02:00
lenovo lenovo/x201: Fix order of SPI init. 2014-06-01 11:11:26 +02:00
linutop Move ARCH_* from board/Kconfig to cpu or soc Kconfig. 2014-05-03 00:25:20 +02:00
lippert lippert/toucan-af: Fix comment on HAVE_ACPI_RESUME 2014-06-11 15:52:45 +02:00
mitac superio/smsc/smscsuperio: Make romstage linkable with header 2014-06-03 09:37:57 +02:00
msi Drop unused change_i2c_mux() 2014-06-06 07:30:23 +02:00
nec superio/smsc/smscsuperio: Make romstage linkable with header 2014-06-03 09:37:57 +02:00
newisys Move ARCH_* from board/Kconfig to cpu or soc Kconfig. 2014-05-03 00:25:20 +02:00
nokia superio/smsc/smscsuperio: Make romstage linkable with header 2014-06-03 09:37:57 +02:00
nvidia superio/winbond/w83627ehg: Depreciate romstage component 2014-05-31 21:16:39 +02:00
packardbell intel: Remove GFXUMA and related global variables 2014-05-19 17:20:13 +02:00
pcengines superio/winbond/w83627hf: Avoid .c includes in mainboards 2014-05-31 21:17:37 +02:00
rca superio/smsc/smscsuperio: Make romstage linkable with header 2014-06-03 09:37:57 +02:00
roda drivers: Drop GbE stub drivers 2014-05-20 13:46:35 +02:00
samsung superio/ite/it8772f: Move towards removing #include .c 2014-06-03 09:35:38 +02:00
siemens mainboard/*: Convert to generic ITE superio romstage component 2014-05-28 20:08:21 +02:00
soyo superio/ite/*: Factor out generic romstage component 2014-05-11 17:52:08 +02:00
sunw Move ARCH_* from board/Kconfig to cpu or soc Kconfig. 2014-05-03 00:25:20 +02:00
supermicro AGESA: Use common heap allocator 2014-06-06 13:31:31 +02:00
technexion mainboard/*: Convert to generic ITE superio romstage component 2014-05-28 20:08:21 +02:00
technologic Move ARCH_* from board/Kconfig to cpu or soc Kconfig. 2014-05-03 00:25:20 +02:00
televideo Move ARCH_* from board/Kconfig to cpu or soc Kconfig. 2014-05-03 00:25:20 +02:00
thomson superio/smsc/smscsuperio: Make romstage linkable with header 2014-06-03 09:37:57 +02:00
ti Move ARCH_* from board/Kconfig to cpu or soc Kconfig. 2014-05-03 00:25:20 +02:00
traverse Move ARCH_* from board/Kconfig to cpu or soc Kconfig. 2014-05-03 00:25:20 +02:00
tyan AGESA: Use common heap allocator 2014-06-06 13:31:31 +02:00
via superio/winbond/w83697hf: Depreciate romstage component 2014-05-23 20:14:41 +02:00
winent superio/winbond/w83627hf: Avoid .c includes in mainboards 2014-05-31 21:17:37 +02:00
wyse Move ARCH_* from board/Kconfig to cpu or soc Kconfig. 2014-05-03 00:25:20 +02:00
Kconfig mainboard: New port Packard Bell LM85. 2014-04-20 18:47:19 +02:00