coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
mainboard.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <device/device.h>
8 
10  /* INTA# - INTH# */
11  [0x00] = 0x03,0x04,0x05,0x07,0x0B,0x0A,0x1F,0x1F,
12  /* Misc-nil,0,1,2, INT from Serial irq */
13  [0x08] = 0x5A,0xF1,0x00,0x00,0x1F,0x1F,0x1F,0x1F,
14  /* SCI, SMBUS0, ASF, HDA, FC, RSVD, PerMon, SD */
15  [0x10] = 0x1F,0x1F,0x1F,0x03,0x1F,0x1F,0x1F,0x1F, // HDA was 1F - now 03
16  /* IMC INT0 - 5 */
17  [0x20] = 0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,
18  /* USB Devs 18/19/22 INTA-C */
19  [0x30] = 0x05,0x04,0x05,0x04,0x04,0x05,0x04,0x05,
20  /* SATA & MISSING IDE */
21  [0x40] = 0x04, 0x04
22 };
23 
25  /* INTA# - INTH# */
26  [0x00] = 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
27  /* Misc-nil,0,1,2, INT from Serial irq */
28  [0x08] = 0x00,0x00,0x00,0x00,0x1F,0x1F,0x1F,0x1F,
29  /* SCI, SMBUS0, ASF, HDA, FC, GEC, PerMon, SD */
30  [0x10] = 0x09,0x1F,0x1F,0x10,0x1F,0x10,0x1F,0x10,0x1F,0x1F,
31  /* IMC INT0 - 5 */
32  [0x20] = 0x05,0x1F,0x1F,0x1F,0x1F,0x1F,
33  /* USB Devs 18/19/20/22 INTA-C */
34  [0x30] = 0x12,0x11,0x12,0x11,0x12,0x11,0x12,
35  /* SATA & MISSING IDE*/
36  [0x40] = 0x11, 0x11
37 };
38 
39 /*
40  * This table defines the index into the picr/intr_data
41  * tables for each device. Any enabled device and slot
42  * that uses hardware interrupts should have an entry
43  * in this table to define its index into the FCH
44  * PCI_INTR register 0xC00/0xC01. This index will define
45  * the interrupt that it should use. Putting PIRQ_A into
46  * the PIN A index for a device will tell that device to
47  * use PIC IRQ 10 if it uses PIN A for its hardware INT.
48  */
49 static const struct pirq_struct mainboard_pirq_data[] = {
50  /* {PCI_devfn, {PIN A, PIN B, PIN C, PIN D}}, */
51  {GFX_DEVFN, {PIRQ_A, PIRQ_NC, PIRQ_NC, PIRQ_NC}}, /* VGA: 01.0 */
52  {ACTL_DEVFN,{PIRQ_NC, PIRQ_B, PIRQ_NC, PIRQ_NC}}, /* Audio: 01.1 */
53  {NB_PCIE_PORT1_DEVFN, {PIRQ_A, PIRQ_B, PIRQ_C, PIRQ_D}}, /* x4 PCIe: 02.1 */
54  {NB_PCIE_PORT2_DEVFN, {PIRQ_B, PIRQ_C, PIRQ_D, PIRQ_A}}, /* mPCIe: 02.2 */
55  {NB_PCIE_PORT3_DEVFN, {PIRQ_C, PIRQ_D, PIRQ_A, PIRQ_B}}, /* NIC: 02.3 */
56  {NB_PCIE_PORT4_DEVFN, {PIRQ_D, PIRQ_A, PIRQ_B, PIRQ_C}}, /* Edge: 02.4 */
57  {NB_PCIE_PORT5_DEVFN, {PIRQ_E, PIRQ_F, PIRQ_G, PIRQ_H}}, /* Edge: 02.5 */
58  {XHCI_DEVFN, {PIRQ_C, PIRQ_NC, PIRQ_NC, PIRQ_NC}}, /* XHCI: 10.0 */
59  {SATA_DEVFN, {PIRQ_SATA, PIRQ_NC, PIRQ_NC, PIRQ_NC}}, /* SATA: 11.0 */
60  {OHCI1_DEVFN, {PIRQ_OHCI1, PIRQ_NC, PIRQ_NC, PIRQ_NC}}, /* OHCI1: 12.0 */
61  {EHCI1_DEVFN, {PIRQ_NC, PIRQ_EHCI1, PIRQ_NC, PIRQ_NC}}, /* EHCI1: 12.2 */
62  {OHCI2_DEVFN, {PIRQ_OHCI2, PIRQ_NC, PIRQ_NC, PIRQ_NC}}, /* OHCI2: 13.0 */
63  {EHCI2_DEVFN, {PIRQ_NC, PIRQ_EHCI2, PIRQ_NC, PIRQ_NC}}, /* EHCI2: 13.2 */
64  {SMBUS_DEVFN, {PIRQ_SMBUS, PIRQ_NC, PIRQ_NC, PIRQ_NC}}, /* SMBUS: 14.0 */
65  {HDA_DEVFN, {PIRQ_HDA, PIRQ_NC, PIRQ_NC, PIRQ_NC}}, /* HDA: 14.2 */
66  {LPC_DEVFN, {PIRQ_C, PIRQ_NC, PIRQ_NC, PIRQ_NC }}, /* LPC: 14.3 */
67  {SD_DEVFN, {PIRQ_SD, PIRQ_NC, PIRQ_NC, PIRQ_NC}}, /* SD: 14.7 */
68 };
69 
70 /* PIRQ Setup */
71 static void pirq_setup(void)
72 {
77 }
78 
79 /**********************************************
80  * enable the dedicated function in mainboard.
81  **********************************************/
82 static void mainboard_enable(struct device *dev)
83 {
84  /* Initialize the PIRQ data structures for consumption */
85  pirq_setup();
86 }
87 
90 };
struct chip_operations mainboard_ops
Definition: mainboard.c:19
@ PIRQ_A
Definition: acpi_pirq_gen.h:22
@ PIRQ_C
Definition: acpi_pirq_gen.h:24
@ PIRQ_G
Definition: acpi_pirq_gen.h:28
@ PIRQ_H
Definition: acpi_pirq_gen.h:29
@ PIRQ_E
Definition: acpi_pirq_gen.h:26
@ PIRQ_D
Definition: acpi_pirq_gen.h:25
@ PIRQ_F
Definition: acpi_pirq_gen.h:27
@ PIRQ_B
Definition: acpi_pirq_gen.h:23
static const u8 mainboard_picr_data[FCH_INT_TABLE_SIZE]
Definition: mainboard.c:9
static const struct pirq_struct mainboard_pirq_data[]
Definition: mainboard.c:49
static void mainboard_enable(struct device *dev)
Definition: mainboard.c:82
static void pirq_setup(void)
Definition: mainboard.c:71
static const u8 mainboard_intr_data[FCH_INT_TABLE_SIZE]
Definition: mainboard.c:24
#define ARRAY_SIZE(a)
Definition: helpers.h:12
#define SD_DEVFN
Definition: variants.h:11
#define NB_PCIE_PORT2_DEVFN
Definition: pci_devs.h:34
#define NB_PCIE_PORT3_DEVFN
Definition: pci_devs.h:35
#define NB_PCIE_PORT4_DEVFN
Definition: pci_devs.h:36
#define NB_PCIE_PORT1_DEVFN
Definition: pci_devs.h:33
#define GFX_DEVFN
Definition: pci_devs.h:13
#define NB_PCIE_PORT5_DEVFN
Definition: pci_devs.h:37
#define ACTL_DEVFN
Definition: pci_devs.h:27
#define PIRQ_SATA
#define PIRQ_SMBUS
#define PIRQ_SD
#define PIRQ_NC
#define LPC_DEVFN
Definition: pci_devs.h:123
#define SMBUS_DEVFN
Definition: pci_devs.h:117
u32 pirq_data_size
Definition: amd_pci_util.c:12
const u8 * intr_data_ptr
Definition: amd_pci_util.c:13
const u8 * picr_data_ptr
Definition: amd_pci_util.c:14
const struct pirq_struct * pirq_data_ptr
Definition: amd_pci_util.c:11
#define SATA_DEVFN
Definition: pci_devs.h:83
#define PIRQ_HDA
#define EHCI1_DEVFN
Definition: pci_devs.h:170
#define XHCI_DEVFN
Definition: pci_devs.h:153
#define PIRQ_OHCI2
#define PIRQ_OHCI1
#define PIRQ_EHCI2
#define PIRQ_EHCI1
#define HDA_DEVFN
Definition: pci_devs.h:69
#define OHCI1_DEVFN
Definition: pci_devs.h:34
#define EHCI2_DEVFN
Definition: pci_devs.h:48
#define OHCI2_DEVFN
Definition: pci_devs.h:35
#define FCH_INT_TABLE_SIZE
uint8_t u8
Definition: stdint.h:45
void(* enable_dev)(struct device *dev)
Definition: device.h:24
Definition: device.h:107