]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPlatformPkg/ArmJunoPkg/AcpiTables/Madt.aslc
ArmPlatformPkg/ArmJunoPkg: Added the ACPI 5.0 Tables
[mirror_edk2.git] / ArmPlatformPkg / ArmJunoPkg / AcpiTables / Madt.aslc
CommitLineData
3399d5be
OM
1/** @file\r
2* Multiple APIC Description Table (MADT)\r
3*\r
4* Copyright (c) 2012 - 2014, ARM Limited. All rights reserved.\r
5*\r
6* This program and the accompanying materials\r
7* are licensed and made available under the terms and conditions of the BSD License\r
8* which accompanies this distribution. The full text of the license may be found at\r
9* http://opensource.org/licenses/bsd-license.php\r
10*\r
11* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13*\r
14**/\r
15\r
16#include "ArmPlatform.h"\r
17#include <Library/AcpiLib.h>\r
18#include <Library/PcdLib.h>\r
19#include <IndustryStandard/Acpi.h>\r
20\r
21#pragma pack (1)\r
22\r
23typedef struct {\r
24 EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER Header;\r
25 EFI_ACPI_5_0_GIC_STRUCTURE GicInterfaces[FixedPcdGet32 (PcdCoreCount)];\r
26 EFI_ACPI_5_0_GIC_DISTRIBUTOR_STRUCTURE GicDistributor;\r
27} EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE;\r
28\r
29#pragma pack ()\r
30\r
31//\r
32// Multiple APIC Description Table\r
33//\r
34EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE Madt = {\r
35 {\r
36 ARM_ACPI_HEADER (\r
37 EFI_ACPI_1_0_APIC_SIGNATURE,\r
38 EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE,\r
39 EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION\r
40 ),\r
41 //\r
42 // MADT specific fields\r
43 //\r
44 0, // LocalApicAddress\r
45 0, // Flags\r
46 },\r
47 {\r
48 // Format: EFI_ACPI_5_0_GIC_STRUCTURE_INIT(GicId, AcpiCpuId, Flags, PmuIrq, GicBase)\r
49 // Note: The GIC Structure of the primary CPU must be the first entry (see note in 5.2.12.14 GIC Structure of\r
50 // ACPI v5.0).\r
51 // On Juno we can change the primary CPU changing the SCC register. It is not currently supported in the\r
52 // Trusted Firmware. When supported, we will need to code to dynamically change the ordering.\r
53 // For now we leave CPU2 (A53-0) at the first position.\r
54 // The cores from a same cluster are kept together. It is not an ACPI requirement but in case the OSPM uses\r
55 // the ACPI ARM Parking protocol, it might want to wake up the cores in the order of this table.\r
56 EFI_ACPI_5_0_GIC_STRUCTURE_INIT(2, 2, EFI_ACPI_5_0_GIC_ENABLED, 50, FixedPcdGet32 (PcdGicInterruptInterfaceBase)), // A53-0\r
57 EFI_ACPI_5_0_GIC_STRUCTURE_INIT(3, 3, EFI_ACPI_5_0_GIC_ENABLED, 54, FixedPcdGet32 (PcdGicInterruptInterfaceBase)), // A53-1\r
58 EFI_ACPI_5_0_GIC_STRUCTURE_INIT(4, 4, EFI_ACPI_5_0_GIC_ENABLED, 58, FixedPcdGet32 (PcdGicInterruptInterfaceBase)), // A53-2\r
59 EFI_ACPI_5_0_GIC_STRUCTURE_INIT(5, 5, EFI_ACPI_5_0_GIC_ENABLED, 62, FixedPcdGet32 (PcdGicInterruptInterfaceBase)), // A53-3\r
60 EFI_ACPI_5_0_GIC_STRUCTURE_INIT(0, 0, EFI_ACPI_5_0_GIC_ENABLED, 34, FixedPcdGet32 (PcdGicInterruptInterfaceBase)), // A57-0\r
61 EFI_ACPI_5_0_GIC_STRUCTURE_INIT(1, 1, EFI_ACPI_5_0_GIC_ENABLED, 38, FixedPcdGet32 (PcdGicInterruptInterfaceBase)) // A57-1\r
62 },\r
63 EFI_ACPI_5_0_GIC_DISTRIBUTOR_INIT(0, FixedPcdGet32 (PcdGicDistributorBase), 0)\r
64};\r
65\r
66VOID*\r
67ReferenceAcpiTable (\r
68 VOID\r
69 )\r
70{\r
71 //\r
72 // Reference the table being generated to prevent the optimizer from removing the\r
73 // data structure from the executable\r
74 //\r
75 return (VOID*)&Madt;\r
76}\r