coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
pirq_routing.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #ifndef ARCH_PIRQ_ROUTING_H
4 #define ARCH_PIRQ_ROUTING_H
5 
6 /* This is the maximum number on interrupt entries that a PCI device may have.
7  * This is NOT the number of slots or devices in the system
8  * This is NOT the number of entries in the PIRQ table
9  * This tells us that in the PIRQ table, we are going to have 4 link-bitmap
10  * entries per PCI device
11  * It is fixed at 4: INTA, INTB, INTC, and INTD
12  * CAUTION: If you change this, pirq_routing will not work correctly */
13 #define MAX_INTX_ENTRIES 4
14 
15 #include <stdint.h>
16 
17 #define PIRQ_SIGNATURE (('$' << 0) + ('P' << 8) + ('I' << 16) + ('R' << 24))
18 #define PIRQ_VERSION 0x0100
19 
20 struct irq_info {
21  u8 bus, devfn; /* Bus, device and function */
22  struct {
23  u8 link; /* IRQ line ID, chipset dependent, 0=not routed */
24  u16 bitmap; /* Available IRQs */
25  } __packed irq[4];
26  u8 slot; /* Slot number, 0=onboard */
29 
31  u32 signature; /* PIRQ_SIGNATURE should be here */
32  u16 version; /* PIRQ_VERSION */
33  u16 size; /* Table size in bytes */
34  u8 rtr_bus, rtr_devfn; /* Where the interrupt router lies */
35  u16 exclusive_irqs; /* IRQs devoted exclusively to PCI usage */
36  u16 rtr_vendor, rtr_device;/* Vendor/device ID of interrupt router */
38  u8 rfu[11];
39  u8 checksum; /* Modulo 256 checksum must give zero */
40  struct irq_info slots[CONFIG_IRQ_SLOT_COUNT];
41 } __packed;
42 
43 unsigned long copy_pirq_routing_table(unsigned long addr,
44  const struct irq_routing_table *routing_table);
45 unsigned long write_pirq_routing_table(unsigned long start);
46 
47 void pirq_assign_irqs(const unsigned char pirq[CONFIG_MAX_PIRQ_LINKS]);
48 
49 #endif /* ARCH_PIRQ_ROUTING_H */
pirq
Definition: acpi_pirq_gen.h:20
static u32 addr
Definition: cirrus.c:14
unsigned long copy_pirq_routing_table(unsigned long addr, const struct irq_routing_table *routing_table)
Definition: pirq_routing.c:172
struct irq_info __packed
unsigned long write_pirq_routing_table(unsigned long start)
Definition: irq_tables.c:28
void pirq_assign_irqs(const unsigned char pirq[CONFIG_MAX_PIRQ_LINKS])
uint32_t u32
Definition: stdint.h:51
uint16_t u16
Definition: stdint.h:48
uint8_t u8
Definition: stdint.h:45
Definition: x86.c:23
u16 bitmap
Definition: pirq_routing.h:24
struct irq_info::@11 irq[4]
struct irq_info slots[CONFIG_IRQ_SLOT_COUNT]
Definition: pirq_routing.h:40