iPXE
ecam.h
Go to the documentation of this file.
1 #ifndef _IPXE_ECAM_H
2 #define _IPXE_ECAM_H
3 
4 /** @file
5  *
6  * PCI I/O API for Enhanced Configuration Access Mechanism (ECAM)
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11 
12 #include <ipxe/acpi.h>
13 #include <ipxe/pci.h>
14 
15 /** Enhanced Configuration Access Mechanism per-device size */
16 #define ECAM_SIZE 4096
17 
18 /** Enhanced Configuration Access Mechanism table signature */
19 #define ECAM_SIGNATURE ACPI_SIGNATURE ( 'M', 'C', 'F', 'G' )
20 
21 /** An Enhanced Configuration Access Mechanism allocation */
23  /** Base address */
25  /** PCI segment number */
27  /** Start PCI bus number */
29  /** End PCI bus number */
31  /** Reserved */
33 } __attribute__ (( packed ));
34 
35 /** An Enhanced Configuration Access Mechanism table */
36 struct ecam_table {
37  /** ACPI header */
38  struct acpi_header acpi;
39  /** Reserved */
41  /** Allocation structures */
43 } __attribute__ (( packed ));
44 
45 /** A mapped Enhanced Configuration Access Mechanism allocation */
46 struct ecam_mapping {
47  /** Allocation */
49  /** PCI bus:dev.fn address range */
50  struct pci_range range;
51  /** MMIO base address */
52  void *regs;
53  /** Mapping result */
54  int rc;
55 };
56 
57 extern struct pci_api ecam_api;
58 
59 #endif /* _IPXE_ECAM_H */
#define __attribute__(x)
Definition: compiler.h:10
unsigned short uint16_t
Definition: stdint.h:11
struct ecam_allocation alloc
Allocation.
Definition: ecam.h:48
struct pci_api ecam_api
Definition: ecam.c:288
struct pci_range range
PCI bus:dev.fn address range.
Definition: ecam.h:50
A mapped Enhanced Configuration Access Mechanism allocation.
Definition: ecam.h:46
unsigned long long uint64_t
Definition: stdint.h:13
A PCI bus:dev.fn address range.
Definition: pci_io.h:21
struct acpi_header acpi
ACPI header.
Definition: ecam.h:38
uint64_t base
Base address.
Definition: ecam.h:24
ACPI data structures.
PCI bus.
A runtime selectable PCI I/O API.
Definition: pci_io.h:154
void * regs
MMIO base address.
Definition: ecam.h:52
unsigned char uint8_t
Definition: stdint.h:10
int rc
Mapping result.
Definition: ecam.h:54
uint8_t reserved[4]
Reserved.
Definition: ecam.h:32
An ACPI description header.
Definition: acpi.h:163
uint16_t segment
PCI segment number.
Definition: ecam.h:26
An Enhanced Configuration Access Mechanism allocation.
Definition: ecam.h:22
uint8_t start
Start PCI bus number.
Definition: ecam.h:28
uint8_t end
End PCI bus number.
Definition: ecam.h:30
An Enhanced Configuration Access Mechanism table.
Definition: ecam.h:36
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
struct ecam_allocation alloc[0]
Allocation structures.
Definition: ecam.h:42
uint8_t reserved[8]
Reserved.
Definition: ecam.h:40