coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
irq.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-or-later */
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,
/* Empty function */
32
IRQ_PIRQ
= 1,
/* PIRQ routing, i.e. IRQs 16 - 23 */
33
IRQ_DIRECT
= 2,
/* No PIRQ routing, i.e., IRQs > 23 */
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
* This functions applies rules from FSP, BWG and SoC to come up with a set of
47
* PCI slot/function --> IRQ pin/IRQ number entries.
48
*
49
* The results of this calculation are cached within this module for usage
50
* by the other API functions.
51
*/
52
bool
assign_pci_irqs
(
const
struct
slot_irq_constraints
*
constraints
,
size_t
num_slots);
53
54
/* Generate an ACPI PCI IRQ routing table (_PRT) in the \_SB.PCI0 scope, using
55
the cached results. */
56
bool
generate_pin_irq_map
(
void
);
57
58
/* Typically the FSP can accept a list of the mappings provided above, and
59
program them, but for PCH devices only. This function provides the same
60
function for non-PCH devices. */
61
bool
irq_program_non_pch
(
void
);
62
63
const
struct
pci_irq_entry
*
get_cached_pci_irqs
(
void
);
64
65
/* Search the cached PCI IRQ assignment results for the matching devfn and
66
return the corresponding IRQ, or INVALID_IRQ if not found. */
67
int
get_pci_devfn_irq
(
unsigned
int
devfn
);
68
69
#endif
/* SOC_INTEL_COMMON_IRQ_H */
acpi_pirq_gen.h
pirq
pirq
Definition:
acpi_pirq_gen.h:20
pci_pin
pci_pin
Definition:
acpi_pirq_gen.h:11
generate_pin_irq_map
bool generate_pin_irq_map(void)
Definition:
irq.c:365
get_pci_devfn_irq
int get_pci_devfn_irq(unsigned int devfn)
Definition:
irq.c:433
irq_program_non_pch
bool irq_program_non_pch(void)
Definition:
irq.c:407
MAX_FNS
#define MAX_FNS
Definition:
irq.h:9
assign_pci_irqs
bool assign_pci_irqs(const struct slot_irq_constraints *constraints, size_t num_slots)
Definition:
irq.c:328
get_cached_pci_irqs
const struct pci_irq_entry * get_cached_pci_irqs(void)
Definition:
irq.c:347
constraints
Definition:
resource_allocator_v3.c:357
pci_irq_entry
Definition:
irq.h:38
pci_irq_entry::pin
enum pci_pin pin
Definition:
irq.h:40
pci_irq_entry::devfn
unsigned int devfn
Definition:
irq.h:39
pci_irq_entry::irq
unsigned int irq
Definition:
irq.h:41
pci_irq_entry::next
struct pci_irq_entry * next
Definition:
irq.h:42
slot_irq_constraints
Definition:
irq.h:25
slot_irq_constraints::fixed_pirq
enum pirq fixed_pirq
Definition:
irq.h:29
slot_irq_constraints::slot
unsigned int slot
Definition:
irq.h:26
slot_irq_constraints::fixed_int_pin
enum pci_pin fixed_int_pin
Definition:
irq.h:28
slot_irq_constraints::irq_route
enum slot_irq_constraints::@540::@541 irq_route
slot_irq_constraints::fns
struct slot_irq_constraints::@540 fns[MAX_FNS]
slot_irq_constraints::IRQ_PIRQ
@ IRQ_PIRQ
Definition:
irq.h:32
slot_irq_constraints::IRQ_DIRECT
@ IRQ_DIRECT
Definition:
irq.h:33
slot_irq_constraints::IRQ_NONE
@ IRQ_NONE
Definition:
irq.h:31
src
soc
intel
common
block
include
intelblocks
irq.h
Generated by
1.9.1