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