Eric Biederman | 8ca8d76 | 2003-04-22 19:02:15 +0000 | [diff] [blame] | 1 | #ifndef ARCH_PIRQ_ROUTING_H |
| 2 | #define ARCH_PIRQ_ROUTING_H |
| 3 | |
Stefan Reinauer | 7ac3df8 | 2010-03-30 00:22:29 +0000 | [diff] [blame] | 4 | #if CONFIG_GENERATE_PIRQ_TABLE==1 |
Eric Biederman | 8ca8d76 | 2003-04-22 19:02:15 +0000 | [diff] [blame] | 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 { |
Stefan Reinauer | 7ac3df8 | 2010-03-30 00:22:29 +0000 | [diff] [blame] | 11 | u8 bus, devfn; /* Bus, device and function */ |
Eric Biederman | 8ca8d76 | 2003-04-22 19:02:15 +0000 | [diff] [blame] | 12 | struct { |
Stefan Reinauer | 7ac3df8 | 2010-03-30 00:22:29 +0000 | [diff] [blame] | 13 | u8 link; /* IRQ line ID, chipset dependent, 0=not routed */ |
| 14 | u16 bitmap; /* Available IRQs */ |
Eric Biederman | 8ca8d76 | 2003-04-22 19:02:15 +0000 | [diff] [blame] | 15 | } __attribute__((packed)) irq[4]; |
Stefan Reinauer | 7ac3df8 | 2010-03-30 00:22:29 +0000 | [diff] [blame] | 16 | u8 slot; /* Slot number, 0=onboard */ |
| 17 | u8 rfu; |
Eric Biederman | 8ca8d76 | 2003-04-22 19:02:15 +0000 | [diff] [blame] | 18 | } __attribute__((packed)); |
| 19 | |
Stefan Reinauer | 9b70cb6 | 2010-03-30 08:20:37 +0000 | [diff] [blame] | 20 | #ifndef CONFIG_IRQ_SLOT_COUNT |
| 21 | #warning "IRQ_SLOT_COUNT is not defined in Kconfig. PIRQ won't work correctly." |
Eric Biederman | 8ca8d76 | 2003-04-22 19:02:15 +0000 | [diff] [blame] | 22 | #endif |
| 23 | |
| 24 | struct irq_routing_table { |
Stefan Reinauer | 7ac3df8 | 2010-03-30 00:22:29 +0000 | [diff] [blame] | 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 */ |
Stefan Reinauer | 8e726b7 | 2010-03-29 23:01:35 +0000 | [diff] [blame] | 34 | struct irq_info slots[CONFIG_IRQ_SLOT_COUNT]; |
Eric Biederman | 8ca8d76 | 2003-04-22 19:02:15 +0000 | [diff] [blame] | 35 | } __attribute__((packed)); |
| 36 | |
| 37 | extern const struct irq_routing_table intel_irq_routing_table; |
| 38 | |
Eric Biederman | 8ca8d76 | 2003-04-22 19:02:15 +0000 | [diff] [blame] | 39 | unsigned long copy_pirq_routing_table(unsigned long start); |
arch import user (historical) | 59140cc | 2005-07-06 18:17:35 +0000 | [diff] [blame] | 40 | unsigned long write_pirq_routing_table(unsigned long start); |
Stefan Reinauer | 7ac3df8 | 2010-03-30 00:22:29 +0000 | [diff] [blame] | 41 | |
Stefan Reinauer | 0867062 | 2009-06-30 15:17:49 +0000 | [diff] [blame] | 42 | #if CONFIG_PIRQ_ROUTE==1 |
Nikolay Petukhov | 9c2255c | 2008-03-29 16:59:27 +0000 | [diff] [blame] | 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 |
Stefan Reinauer | 7ac3df8 | 2010-03-30 00:22:29 +0000 | [diff] [blame] | 48 | |
Eric Biederman | 8ca8d76 | 2003-04-22 19:02:15 +0000 | [diff] [blame] | 49 | #else |
| 50 | #define copy_pirq_routing_table(start) (start) |
arch import user (historical) | 59140cc | 2005-07-06 18:17:35 +0000 | [diff] [blame] | 51 | #define write_pirq_routing_table(start) (start) |
Eric Biederman | 8ca8d76 | 2003-04-22 19:02:15 +0000 | [diff] [blame] | 52 | #endif |
| 53 | |
| 54 | #endif /* ARCH_PIRQ_ROUTING_H */ |