1 #ifndef ARCH_PIRQ_ROUTING_H
2 #define ARCH_PIRQ_ROUTING_H
6 #define PIRQ_SIGNATURE (('$' << 0) + ('P' << 8) + ('I' << 16) + ('R' << 24))
7 #define PIRQ_VERSION 0x0100
10 uint8_t bus, devfn; /* Bus, device and function */
12 uint8_t link; /* IRQ line ID, chipset dependent, 0=not routed */
13 uint16_t bitmap; /* Available IRQs */
14 } __attribute__((packed)) irq[4];
15 uint8_t slot; /* Slot number, 0=onboard */
17 } __attribute__((packed));
19 #if defined(CONFIG_IRQ_SLOT_COUNT)
20 #define IRQ_SLOTS_COUNT CONFIG_IRQ_SLOT_COUNT
22 #warning "No IRQ_SLOT_COUNT in Kconfig."
23 #define IRQ_SLOTS_COUNT
26 struct irq_routing_table {
27 uint32_t signature; /* PIRQ_SIGNATURE should be here */
28 uint16_t version; /* PIRQ_VERSION */
29 uint16_t size; /* Table size in bytes */
30 uint8_t rtr_bus, rtr_devfn; /* Where the interrupt router lies */
31 uint16_t exclusive_irqs; /* IRQs devoted exclusively to PCI usage */
32 uint16_t rtr_vendor, rtr_device; /* Vendor and device ID of interrupt router */
33 uint32_t miniport_data; /* Crap */
35 uint8_t checksum; /* Modulo 256 checksum must give zero */
36 struct irq_info slots[IRQ_SLOTS_COUNT];
37 } __attribute__((packed));
39 extern const struct irq_routing_table intel_irq_routing_table;
41 #if CONFIG_GENERATE_PIRQ_TABLE==1
42 unsigned long copy_pirq_routing_table(unsigned long start);
43 unsigned long write_pirq_routing_table(unsigned long start);
44 #if CONFIG_PIRQ_ROUTE==1
45 void pirq_routing_irqs(unsigned long start);
46 void pirq_assign_irqs(const unsigned char pIntAtoD[4]);
48 #define pirq_routing_irqs(start) {}
51 #define copy_pirq_routing_table(start) (start)
52 #define write_pirq_routing_table(start) (start)
55 #endif /* ARCH_PIRQ_ROUTING_H */