blob: 0b65eac29b425f6b8152ad308dec5cdedee4a0f9 [file] [log] [blame]
Eric Biederman8ca8d762003-04-22 19:02:15 +00001#ifndef ARCH_PIRQ_ROUTING_H
2#define ARCH_PIRQ_ROUTING_H
3
Stefan Reinauer7ac3df82010-03-30 00:22:29 +00004#if CONFIG_GENERATE_PIRQ_TABLE==1
Eric Biederman8ca8d762003-04-22 19:02:15 +00005#include <stdint.h>
6
7#define PIRQ_SIGNATURE (('$' << 0) + ('P' << 8) + ('I' << 16) + ('R' << 24))
8#define PIRQ_VERSION 0x0100
9
10struct irq_info {
Stefan Reinauer7ac3df82010-03-30 00:22:29 +000011 u8 bus, devfn; /* Bus, device and function */
Eric Biederman8ca8d762003-04-22 19:02:15 +000012 struct {
Stefan Reinauer7ac3df82010-03-30 00:22:29 +000013 u8 link; /* IRQ line ID, chipset dependent, 0=not routed */
14 u16 bitmap; /* Available IRQs */
Eric Biederman8ca8d762003-04-22 19:02:15 +000015 } __attribute__((packed)) irq[4];
Stefan Reinauer7ac3df82010-03-30 00:22:29 +000016 u8 slot; /* Slot number, 0=onboard */
17 u8 rfu;
Eric Biederman8ca8d762003-04-22 19:02:15 +000018} __attribute__((packed));
19
Stefan Reinauer9b70cb62010-03-30 08:20:37 +000020#ifndef CONFIG_IRQ_SLOT_COUNT
21#warning "IRQ_SLOT_COUNT is not defined in Kconfig. PIRQ won't work correctly."
Eric Biederman8ca8d762003-04-22 19:02:15 +000022#endif
23
24struct irq_routing_table {
Stefan Reinauer7ac3df82010-03-30 00:22:29 +000025 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 Reinauer8e726b72010-03-29 23:01:35 +000034 struct irq_info slots[CONFIG_IRQ_SLOT_COUNT];
Eric Biederman8ca8d762003-04-22 19:02:15 +000035} __attribute__((packed));
36
37extern const struct irq_routing_table intel_irq_routing_table;
38
Eric Biederman8ca8d762003-04-22 19:02:15 +000039unsigned long copy_pirq_routing_table(unsigned long start);
arch import user (historical)59140cc2005-07-06 18:17:35 +000040unsigned long write_pirq_routing_table(unsigned long start);
Stefan Reinauer7ac3df82010-03-30 00:22:29 +000041
Stefan Reinauer08670622009-06-30 15:17:49 +000042#if CONFIG_PIRQ_ROUTE==1
Nikolay Petukhov9c2255c2008-03-29 16:59:27 +000043void pirq_routing_irqs(unsigned long start);
44void pirq_assign_irqs(const unsigned char pIntAtoD[4]);
45#else
46#define pirq_routing_irqs(start) {}
47#endif
Stefan Reinauer7ac3df82010-03-30 00:22:29 +000048
Eric Biederman8ca8d762003-04-22 19:02:15 +000049#else
50#define copy_pirq_routing_table(start) (start)
arch import user (historical)59140cc2005-07-06 18:17:35 +000051#define write_pirq_routing_table(start) (start)
Eric Biederman8ca8d762003-04-22 19:02:15 +000052#endif
53
54#endif /* ARCH_PIRQ_ROUTING_H */