forked from tianocore/edk2-platforms
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Mcfg.aslc
81 lines (72 loc) · 3.17 KB
/
Mcfg.aslc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/** @file
*
* Memory Mapped Configuration Address Space table (MCFG)
*
* Copyright (c) 2019, Pete Batard <pete@akeo.ie>
* Copyright (c) 2013-2015 Intel Corporation.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*
**/
#include <IndustryStandard/Acpi.h>
#include <IndustryStandard/MemoryMappedConfigurationSpaceAccessTable.h>
#include "AcpiTables.h"
//
// Multiple APIC Description Table
//
#pragma pack (1)
#define RPI_ACPI_OEM_MCFG_REVISION 0x00000001
//
// The Pi 4 is not ECAM compliant so, ideally, we would just skip populating
// an allocation structure. However, GenFw throws 'MCFG length check failed'
// when the number of allocation structures is zero, so we need at least one.
//
#define RPI_ACPI_ALLOCATION_STRUCTURE_COUNT 1
typedef struct {
EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_BASE_ADDRESS_TABLE_HEADER Header;
EFI_ACPI_MEMORY_MAPPED_ENHANCED_CONFIGURATION_SPACE_BASE_ADDRESS_ALLOCATION_STRUCTURE AllocationStructure[RPI_ACPI_ALLOCATION_STRUCTURE_COUNT];
} EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_SPACE_ACCESS_DESCRIPTION_TABLE;
STATIC EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_SPACE_ACCESS_DESCRIPTION_TABLE Mcfg =
{
{
//------------------------------------------------------------------------
// ACPI Table Header
//------------------------------------------------------------------------
{
EFI_ACPI_3_0_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_BASE_ADDRESS_DESCRIPTION_TABLE_SIGNATURE,
sizeof (EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_SPACE_ACCESS_DESCRIPTION_TABLE),
EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_SPACE_ACCESS_TABLE_REVISION,
0x00, // Checksum calculated at runtime.
EFI_ACPI_OEM_ID, // OEMID is a 6 bytes long field "BC2836"
EFI_ACPI_OEM_TABLE_ID, // OEM table identification(8 bytes long) "RPI4EDK2"
EFI_ACPI_OEM_REVISION, // OEM revision number
EFI_ACPI_CREATOR_ID, // ASL compiler vendor ID
EFI_ACPI_CREATOR_REVISION // ASL compiler revision number
},
//------------------------------------------------------------------------
// Reserved
//------------------------------------------------------------------------
0x0000000000000000, // Reserved
},
//------------------------------------------------------------------------
// MCFG specific fields
//------------------------------------------------------------------------
{
{
//
// Using (-1) as the base address tells the OS to ignore it.
//
0xFFFFFFFFFFFFFFFFULL, // BaseAddress
0x0000, // PciSegmentGroupNumber
0x00, // StartBusNumber
0x00, // EndBusNumber
0x00000000 // Reserved
}
}
};
#pragma pack()
//
// Reference the table being generated to prevent the optimizer from removing
// the data structure from the executable
//
VOID* CONST ReferenceAcpiTable = &Mcfg;