Add CONFIG_GENERATE_* for tables so that the user can select which tables not
[coreboot.git] / src / arch / ppc / include / arch / pirq_routing.h
1 #ifndef ARCH_PIRQ_ROUTING_H
2 #define ARCH_PIRQ_ROUTING_H
3
4 #include <types.h>
5
6 #define PIRQ_SIGNATURE  (('$' << 0) + ('P' << 8) + ('I' << 16) + ('R' << 24))
7 #define PIRQ_VERSION 0x0100
8
9 struct irq_info {
10         u8 bus, devfn;                  /* Bus, device and function */
11         struct {
12                 u8 link;                /* IRQ line ID, chipset dependent, 0=not routed */
13                 u16 bitmap;             /* Available IRQs */
14         } __attribute__((packed)) irq[4];
15         u8 slot;                        /* Slot number, 0=onboard */
16         u8 rfu;
17 } __attribute__((packed));
18
19 #if defined(CONFIG_IRQ_SLOT_COUNT)
20 #define IRQ_SLOTS_COUNT CONFIG_IRQ_SLOT_COUNT
21 #elif (__GNUC__ < 3)
22 #define IRQ_SLOTS_COUNT 1
23 #else
24 #define IRQ_SLOTS_COUNT
25 #endif
26
27 struct irq_routing_table {
28         u32 signature;                  /* PIRQ_SIGNATURE should be here */
29         u16 version;                    /* PIRQ_VERSION */
30         u16 size;                       /* Table size in bytes */
31         u8 rtr_bus, rtr_devfn;          /* Where the interrupt router lies */
32         u16 exclusive_irqs;             /* IRQs devoted exclusively to PCI usage */
33         u16 rtr_vendor, rtr_device;     /* Vendor and device ID of interrupt router */
34         u32 miniport_data;              /* Crap */
35         u8 rfu[11];
36         u8 checksum;                    /* Modulo 256 checksum must give zero */
37         struct irq_info slots[IRQ_SLOTS_COUNT];
38 } __attribute__((packed));
39
40 extern const struct irq_routing_table intel_irq_routing_table;
41
42 #if defined(CONFIG_DEBUG) && defined(CONFIG_GENERATE_PIRQ_TABLE)
43 void check_pirq_routing_table(void);
44 #else
45 #define check_pirq_routing_table() do {} while(0)
46 #endif
47
48 #if defined(CONFIG_GENERATE_PIRQ_TABLE)
49 unsigned long copy_pirq_routing_table(unsigned long start);
50 #else
51 #define copy_pirq_routing_table(start) (start)
52 #endif
53
54 #endif /* ARCH_PIRQ_ROUTING_H */