| 1 |
|
| 2 |
|
| 3 |
#ifndef SOC_INTEL_COMMON_IRQ_H |
| 4 |
#define SOC_INTEL_COMMON_IRQ_H |
| 5 |
|
| 6 |
#include <southbridge/intel/common/acpi_pirq_gen.h> |
| 7 |
#include <types.h> |
| 8 |
|
| 9 |
#define MAX_FNS 8 |
| 10 |
#define INVALID_IRQ -1 |
| 11 |
|
| 12 |
#define ANY_PIRQ(x) [PCI_FUNC(x)] = { .fixed_int_pin = PCI_INT_NONE,\ |
| 13 |
.fixed_pirq = PIRQ_INVALID, \ |
| 14 |
.irq_route = IRQ_PIRQ, } |
| 15 |
#define DIRECT_IRQ(x) [PCI_FUNC(x)] = { .fixed_int_pin = PCI_INT_NONE,\ |
| 16 |
.fixed_pirq = PIRQ_INVALID, \ |
| 17 |
.irq_route = IRQ_DIRECT,} |
| 18 |
#define FIXED_INT_ANY_PIRQ(x, pin) [PCI_FUNC(x)] = { .fixed_int_pin = pin, \ |
| 19 |
.fixed_pirq = PIRQ_INVALID, \ |
| 20 |
.irq_route = IRQ_PIRQ,} |
| 21 |
#define FIXED_INT_PIRQ(x, pin, pirq) [PCI_FUNC(x)] = { .fixed_int_pin = pin, \ |
| 22 |
.fixed_pirq = pirq, \ |
| 23 |
.irq_route = IRQ_PIRQ,} |
| 24 |
|
| 25 |
struct slot_irq_constraints { |
| 26 |
unsigned int slot; |
| 27 |
struct { |
| 28 |
enum pci_pin fixed_int_pin; |
| 29 |
enum pirq fixed_pirq; |
| 30 |
enum { |
| 31 |
IRQ_NONE = 0, |
| 32 |
IRQ_PIRQ = 1, |
| 33 |
IRQ_DIRECT = 2, |
| 34 |
} irq_route; |
| 35 |
} fns[MAX_FNS]; |
| 36 |
}; |
| 37 |
|
| 38 |
struct pci_irq_entry { |
| 39 |
unsigned int devfn; |
| 40 |
enum pci_pin pin; |
| 41 |
unsigned int irq; |
| 42 |
struct pci_irq_entry *next; |
| 43 |
}; |
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
bool assign_pci_irqs(const struct slot_irq_constraints *constraints, size_t num_slots); |
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
bool generate_pin_irq_map(void); |
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
bool irq_program_non_pch(void); |
| 62 |
|
| 63 |
const struct pci_irq_entry *get_cached_pci_irqs(void); |
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
int get_pci_devfn_irq(unsigned int devfn); |
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
bool is_pch_slot(unsigned int devfn); |
| 74 |
|
| 75 |
#endif |