]> git.proxmox.com Git - mirror_edk2.git/blob - Vlv2DeviceRefCodePkg/AcpiTablesPCAT/Madt/Madt30.aslc
Vlv2DeviceRefCodePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / Vlv2DeviceRefCodePkg / AcpiTablesPCAT / Madt / Madt30.aslc
1 /*++
2
3 Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
4
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7
8
9 Module Name:
10
11 Madt3.0.c
12
13 Abstract:
14
15 This file contains a structure definition for the ACPI 2.0 Multiple APIC
16 Description Table (MADT). Any changes to the MADT table require updating the
17 respective structure count in Madt.h and then adding the structure to the
18 MADT defined in this file. The table layout is defined in Madt.h and the
19 table contents are defined in Acpi3_0.h and Madt.h.
20
21 --*/
22
23 //
24 // Statements that include other files
25 //
26 #include "Madt.h"
27 #include <IndustryStandard/Acpi50.h>
28
29 //
30 // Multiple APIC Description Table
31 //
32 EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE Madt = {
33 EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE, // **Signatures are the same 1.0-3.0 because it says "APIC".
34 sizeof (EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE), // **Length
35 EFI_ACPI_5_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION,
36 //
37 // EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION, // **Table Revision must be 2.0 for ACPI 3.0
38 // Checksum will be updated at runtime
39 //
40 0x00, // **Check sum
41 //
42 // It is expected that these values will be programmed at runtime
43 //
44 ' ', // OEMID
45 ' ', // Creative way to
46 ' ', // make six bytes
47 ' ', // of space in
48 ' ', // a table for
49 ' ', // **OEMID
50 0, // **OEM Table ID
51 EFI_ACPI_OEM_MADT_REVISION, // **OEM Revision
52 0, // **Creator ID
53 0, // **Creator Revision
54 //
55 // MADT specific fields
56 //
57 LOCAL_APIC_ADDRESS, // **Local APIC Address
58 EFI_ACPI_4_0_MULTIPLE_APIC_FLAGS, // **Flags
59 //
60 // Processor Local APIC Structure
61 // Correct processor order, Primary threads first then Hyper threads
62 // And correct APIC-ids
63 // This text below is included as a reference until Thurley is 100%:
64 // According to EDS the Local APIC ID is determined based of a bit structure
65 // Bit 24: Core ID Bit 25: Core Pair ID Bit 26-27: Reserved Bit 28-30: Socket ID Bit 31: Reserved
66 // 4 Sockets and 4 Cores per Socket.
67 // So possible LAPIC IDs 00, 01, 02, 03, 10, 11, 12, 13, 20, 21, 22, 23, 30, 31, 32, 33
68 // Static Entries 00, 10, 20, 30, 01, 11, 21, 31, 02, 12, 22, 32, 03, 13, 23, 33
69 // BSP needs to be first entry in table. Check before boot. If BSP non zero need to rotate the entries.
70 // Suppore BSP is LAPIC ID xy. Rotate the table by using formula [x + (y * 4)]
71 // So if BSP LAPIC ID is 21 then table rotated 6 times.
72 // End of Reference Text.
73 // Thurley is supposed to be 2 sockets, 4 cores, and hyperthreading available per each core.
74 // 2 (sockets) x 4 (cores) = 8 (processors non-HT), 8 (processors non-HT) x 2 (HT/proc) = 16 (HT procs)
75 // Rhyme & reason of the ordering below. This is a best guess ordering for now,
76 // Thurley EPS may give better info on LAPIC numbers.
77 // Ordering was established to help dissipate heat across two sockets evenly.
78 // Since logical processor number only has to be unique, I followed
79 // a similar approach to high end servers and have the first digit of the LAPIC
80 // id the socket number.
81 //
82 EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC, // Type 0x00
83 sizeof (EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_STRUCTURE), // Length
84 0x01, // Processor ID
85 0x00, // Local APIC ID
86 0x00000001, // Flags - Disabled (until initialized by platform driver)
87 EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC, // Type
88 sizeof (EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_STRUCTURE), // Length
89 0x02, // Processor ID
90 0x04, // Local APIC ID
91 0x00000001, // Flags - Disabled (until initialized by platform driver)
92 EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC, // Type
93 sizeof (EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_STRUCTURE), // Length
94 0x03, // Processor ID
95 0x02, // Local APIC ID
96 0x00000001, // Flags - Disabled (until initialized by platform driver)
97 EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC, // Type
98 sizeof (EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_STRUCTURE), // Length
99 0x04, // Processor ID
100 0x06, // Local APIC ID
101 0x00000001, // Flags - Disabled (until initialized by platform driver)
102 //
103 // *************** IO APIC Structure ******************
104 //
105 //
106 //
107 // ************************** I/O APIC **************
108 //
109 EFI_ACPI_3_0_IO_APIC, // Type 0x01
110 sizeof (EFI_ACPI_3_0_IO_APIC_STRUCTURE), // Length
111 ICH_IOAPIC_ID, // IO APIC ID
112 EFI_ACPI_RESERVED_BYTE, // Reserved EFI_ACPI_RESERVED_BYTE
113 IO_APIC_ADDRESS, // IO APIC Address (physical) 0xFEC00000
114 0x18 * 0, // Global System Interrupt Base
115
116 //
117 // Interrupt Source Override Structure: Sample
118 //
119 // EFI_ACPI_2_0_INTERRUPT_SOURCE_OVERRIDE, // Type 0x02
120 // sizeof (EFI_ACPI_2_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE),// Length
121 // 0x00, // Bus
122 // 0x00, // Source
123 // 0x00000000, // Global System Interrupt
124 // 0x0000, // Flags
125 //
126 // IRQ0=>IRQ2 Interrupt Source Override Structure
127 //
128 EFI_ACPI_3_0_INTERRUPT_SOURCE_OVERRIDE, // Type 0x02
129 sizeof (EFI_ACPI_3_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE), // Length
130 0x00, // Bus - ISA
131 0x00, // Source - IRQ0
132 0x00000002, // Global System Interrupt - IRQ2
133 0x0000, // Flags - Conforms to specifications of the bus
134 //
135 // ISO (SCI Active High) Interrupt Source Override Structure
136 //
137 EFI_ACPI_3_0_INTERRUPT_SOURCE_OVERRIDE, // Type 0x02
138 sizeof (EFI_ACPI_3_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE), // Length
139 0x00, // Bus - ISA
140 0x09, // Source - IRQ0
141 0x00000009, // Global System Interrupt - IRQ2
142 0x000D, // Flags - Level-tiggered, Active High
143
144
145
146 EFI_ACPI_3_0_LOCAL_APIC_NMI, // Type
147 sizeof (EFI_ACPI_3_0_LOCAL_APIC_NMI_STRUCTURE), // Length
148 0x01, // ACPI Processor ID
149 0x000D, // Flags - Level-tiggered, Active High
150 0x01, // Local APIC LINT#
151 EFI_ACPI_3_0_LOCAL_APIC_NMI, // Type
152 sizeof (EFI_ACPI_3_0_LOCAL_APIC_NMI_STRUCTURE), // Length
153 0x02, // ACPI Processor ID
154 0x000D, // Flags - Level-tiggered, Active High
155 0x01, // Local APIC LINT#
156 EFI_ACPI_3_0_LOCAL_APIC_NMI, // Type
157 sizeof (EFI_ACPI_3_0_LOCAL_APIC_NMI_STRUCTURE), // Length
158 0x03, // ACPI Processor ID
159 0x000D, // Flags - Level-tiggered, Active High
160 0x01, // Local APIC LINT#
161 EFI_ACPI_3_0_LOCAL_APIC_NMI, // Type
162 sizeof (EFI_ACPI_3_0_LOCAL_APIC_NMI_STRUCTURE), // Length
163 0x04, // ACPI Processor ID
164 0x000D, // Flags - Level-tiggered, Active High
165 0x01, // Local APIC LINT#
166 };
167
168 VOID*
169 ReferenceAcpiTable (
170 VOID
171 )
172 {
173 //
174 // Reference the table being generated to prevent the optimizer from
175 // removing the data structure from the executable
176 //
177 return (VOID*)&Madt;
178 }