After this has been brought up many times before, rename src/arch/i386 to
[coreboot.git] / src / arch / x86 / include / arch / pirq_routing.h
1 #ifndef ARCH_PIRQ_ROUTING_H
2 #define ARCH_PIRQ_ROUTING_H
3
4 #if CONFIG_GENERATE_PIRQ_TABLE==1
5 #include <stdint.h>
6
7 #define PIRQ_SIGNATURE  (('$' << 0) + ('P' << 8) + ('I' << 16) + ('R' << 24))
8 #define PIRQ_VERSION 0x0100
9
10 struct irq_info {
11         u8 bus, devfn;      /* Bus, device and function */
12         struct {
13                 u8 link;    /* IRQ line ID, chipset dependent, 0=not routed */
14                 u16 bitmap; /* Available IRQs */
15         } __attribute__((packed)) irq[4];
16         u8 slot;            /* Slot number, 0=onboard */
17         u8 rfu;
18 } __attribute__((packed));
19
20 #ifndef CONFIG_IRQ_SLOT_COUNT
21 #warning "IRQ_SLOT_COUNT is not defined in Kconfig. PIRQ won't work correctly."
22 #endif
23
24 struct irq_routing_table {
25         u32 signature;          /* PIRQ_SIGNATURE should be here */
26         u16 version;            /* PIRQ_VERSION */
27         u16 size;               /* Table size in bytes */
28         u8  rtr_bus, rtr_devfn; /* Where the interrupt router lies */
29         u16 exclusive_irqs;     /* IRQs devoted exclusively to PCI usage */
30         u16 rtr_vendor, rtr_device;/* Vendor/device ID of interrupt router */
31         u32 miniport_data;
32         u8  rfu[11];
33         u8  checksum;           /* Modulo 256 checksum must give zero */
34         struct irq_info slots[CONFIG_IRQ_SLOT_COUNT];
35 } __attribute__((packed));
36
37 extern const struct irq_routing_table intel_irq_routing_table;
38
39 unsigned long copy_pirq_routing_table(unsigned long start);
40 unsigned long write_pirq_routing_table(unsigned long start);
41
42 #if CONFIG_PIRQ_ROUTE==1
43 void pirq_routing_irqs(unsigned long start);
44 void pirq_assign_irqs(const unsigned char pIntAtoD[4]);
45 #else
46 #define pirq_routing_irqs(start) {}
47 #endif
48
49 #else
50 #define copy_pirq_routing_table(start) (start)
51 #define write_pirq_routing_table(start) (start)
52 #endif
53
54 #endif /* ARCH_PIRQ_ROUTING_H */