+++ /dev/null
-/*++\r
-\r
- Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r
-\r
- SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-\r
-\r
-Module Name:\r
-\r
- Madt3.0.c\r
-\r
-Abstract:\r
-\r
- This file contains a structure definition for the ACPI 2.0 Multiple APIC\r
- Description Table (MADT). Any changes to the MADT table require updating the\r
- respective structure count in Madt.h and then adding the structure to the\r
- MADT defined in this file. The table layout is defined in Madt.h and the\r
- table contents are defined in Acpi3_0.h and Madt.h.\r
-\r
---*/\r
-\r
-//\r
-// Statements that include other files\r
-//\r
-#include "Madt.h"\r
-#include <IndustryStandard/Acpi50.h>\r
-\r
-//\r
-// Multiple APIC Description Table\r
-//\r
-EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE Madt = {\r
- EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE, // **Signatures are the same 1.0-3.0 because it says "APIC".\r
- sizeof (EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE), // **Length\r
- EFI_ACPI_5_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION,\r
- //\r
- // EFI_ACPI_3_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION, // **Table Revision must be 2.0 for ACPI 3.0\r
- // Checksum will be updated at runtime\r
- //\r
- 0x00, // **Check sum\r
- //\r
- // It is expected that these values will be programmed at runtime\r
- //\r
- ' ', // OEMID\r
- ' ', // Creative way to\r
- ' ', // make six bytes\r
- ' ', // of space in\r
- ' ', // a table for\r
- ' ', // **OEMID\r
- 0, // **OEM Table ID\r
- EFI_ACPI_OEM_MADT_REVISION, // **OEM Revision\r
- 0, // **Creator ID\r
- 0, // **Creator Revision\r
- //\r
- // MADT specific fields\r
- //\r
- LOCAL_APIC_ADDRESS, // **Local APIC Address\r
- EFI_ACPI_4_0_MULTIPLE_APIC_FLAGS, // **Flags\r
- //\r
- // Processor Local APIC Structure\r
- // Correct processor order, Primary threads first then Hyper threads\r
- // And correct APIC-ids\r
- // This text below is included as a reference until Thurley is 100%:\r
- // According to EDS the Local APIC ID is determined based of a bit structure\r
- // Bit 24: Core ID Bit 25: Core Pair ID Bit 26-27: Reserved Bit 28-30: Socket ID Bit 31: Reserved\r
- // 4 Sockets and 4 Cores per Socket.\r
- // So possible LAPIC IDs 00, 01, 02, 03, 10, 11, 12, 13, 20, 21, 22, 23, 30, 31, 32, 33\r
- // Static Entries 00, 10, 20, 30, 01, 11, 21, 31, 02, 12, 22, 32, 03, 13, 23, 33\r
- // BSP needs to be first entry in table. Check before boot. If BSP non zero need to rotate the entries.\r
- // Suppore BSP is LAPIC ID xy. Rotate the table by using formula [x + (y * 4)]\r
- // So if BSP LAPIC ID is 21 then table rotated 6 times.\r
- // End of Reference Text.\r
- // Thurley is supposed to be 2 sockets, 4 cores, and hyperthreading available per each core.\r
- // 2 (sockets) x 4 (cores) = 8 (processors non-HT), 8 (processors non-HT) x 2 (HT/proc) = 16 (HT procs)\r
- // Rhyme & reason of the ordering below. This is a best guess ordering for now,\r
- // Thurley EPS may give better info on LAPIC numbers.\r
- // Ordering was established to help dissipate heat across two sockets evenly.\r
- // Since logical processor number only has to be unique, I followed\r
- // a similar approach to high end servers and have the first digit of the LAPIC\r
- // id the socket number.\r
- //\r
- EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC, // Type 0x00\r
- sizeof (EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_STRUCTURE), // Length\r
- 0x01, // Processor ID\r
- 0x00, // Local APIC ID\r
- 0x00000001, // Flags - Disabled (until initialized by platform driver)\r
- EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC, // Type\r
- sizeof (EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_STRUCTURE), // Length\r
- 0x02, // Processor ID\r
- 0x04, // Local APIC ID \r
- 0x00000001, // Flags - Disabled (until initialized by platform driver)\r
- EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC, // Type\r
- sizeof (EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_STRUCTURE), // Length\r
- 0x03, // Processor ID\r
- 0x02, // Local APIC ID\r
- 0x00000001, // Flags - Disabled (until initialized by platform driver)\r
- EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC, // Type\r
- sizeof (EFI_ACPI_3_0_PROCESSOR_LOCAL_APIC_STRUCTURE), // Length\r
- 0x04, // Processor ID\r
- 0x06, // Local APIC ID\r
- 0x00000001, // Flags - Disabled (until initialized by platform driver)\r
- //\r
- // *************** IO APIC Structure ******************\r
- //\r
- //\r
- //\r
- // ************************** I/O APIC **************\r
- //\r
- EFI_ACPI_3_0_IO_APIC, // Type 0x01\r
- sizeof (EFI_ACPI_3_0_IO_APIC_STRUCTURE), // Length\r
- ICH_IOAPIC_ID, // IO APIC ID\r
- EFI_ACPI_RESERVED_BYTE, // Reserved EFI_ACPI_RESERVED_BYTE\r
- IO_APIC_ADDRESS, // IO APIC Address (physical) 0xFEC00000\r
- 0x18 * 0, // Global System Interrupt Base\r
-\r
- //\r
- // Interrupt Source Override Structure: Sample\r
- //\r
- // EFI_ACPI_2_0_INTERRUPT_SOURCE_OVERRIDE, // Type 0x02\r
- // sizeof (EFI_ACPI_2_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE),// Length\r
- // 0x00, // Bus\r
- // 0x00, // Source\r
- // 0x00000000, // Global System Interrupt\r
- // 0x0000, // Flags\r
- //\r
- // IRQ0=>IRQ2 Interrupt Source Override Structure\r
- //\r
- EFI_ACPI_3_0_INTERRUPT_SOURCE_OVERRIDE, // Type 0x02\r
- sizeof (EFI_ACPI_3_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE), // Length\r
- 0x00, // Bus - ISA\r
- 0x00, // Source - IRQ0\r
- 0x00000002, // Global System Interrupt - IRQ2\r
- 0x0000, // Flags - Conforms to specifications of the bus\r
- //\r
- // ISO (SCI Active High) Interrupt Source Override Structure\r
- //\r
- EFI_ACPI_3_0_INTERRUPT_SOURCE_OVERRIDE, // Type 0x02\r
- sizeof (EFI_ACPI_3_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE), // Length\r
- 0x00, // Bus - ISA\r
- 0x09, // Source - IRQ0\r
- 0x00000009, // Global System Interrupt - IRQ2\r
- 0x000D, // Flags - Level-tiggered, Active High\r
-\r
-\r
-\r
- EFI_ACPI_3_0_LOCAL_APIC_NMI, // Type\r
- sizeof (EFI_ACPI_3_0_LOCAL_APIC_NMI_STRUCTURE), // Length\r
- 0x01, // ACPI Processor ID\r
- 0x000D, // Flags - Level-tiggered, Active High\r
- 0x01, // Local APIC LINT#\r
- EFI_ACPI_3_0_LOCAL_APIC_NMI, // Type\r
- sizeof (EFI_ACPI_3_0_LOCAL_APIC_NMI_STRUCTURE), // Length\r
- 0x02, // ACPI Processor ID\r
- 0x000D, // Flags - Level-tiggered, Active High\r
- 0x01, // Local APIC LINT#\r
- EFI_ACPI_3_0_LOCAL_APIC_NMI, // Type\r
- sizeof (EFI_ACPI_3_0_LOCAL_APIC_NMI_STRUCTURE), // Length\r
- 0x03, // ACPI Processor ID\r
- 0x000D, // Flags - Level-tiggered, Active High\r
- 0x01, // Local APIC LINT#\r
- EFI_ACPI_3_0_LOCAL_APIC_NMI, // Type\r
- sizeof (EFI_ACPI_3_0_LOCAL_APIC_NMI_STRUCTURE), // Length\r
- 0x04, // ACPI Processor ID\r
- 0x000D, // Flags - Level-tiggered, Active High\r
- 0x01, // Local APIC LINT#\r
-};\r
-\r
-VOID*\r
-ReferenceAcpiTable (\r
- VOID\r
- )\r
-{\r
- //\r
- // Reference the table being generated to prevent the optimizer from\r
- // removing the data structure from the executable\r
- //\r
- return (VOID*)&Madt;\r
-}\r