/** @file * Multiple APIC Description Table (MADT) * * Copyright (c) 2016 Linaro Ltd. All rights reserved. * Copyright (c) 2012 - 2015, ARM Limited. All rights reserved. * * SPDX-License-Identifier: BSD-2-Clause-Patent * **/ #include #include #include #include #include "AcpiTables.h" // // Multiple APIC Description Table // #pragma pack (1) typedef struct { EFI_ACPI_5_1_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER Header; EFI_ACPI_5_1_GIC_STRUCTURE GicInterfaces[4]; #if (RPI_MODEL != 3) EFI_ACPI_5_1_GIC_DISTRIBUTOR_STRUCTURE GicDistributor; #endif } PI_MULTIPLE_APIC_DESCRIPTION_TABLE; #pragma pack () PI_MULTIPLE_APIC_DESCRIPTION_TABLE Madt = { { ACPI_HEADER ( EFI_ACPI_5_1_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE, PI_MULTIPLE_APIC_DESCRIPTION_TABLE, EFI_ACPI_5_1_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION ), // // MADT specific fields // 0, // LocalApicAddress 0, // Flags }, { #if (RPI_MODEL == 3) EFI_ACPI_5_1_GICC_STRUCTURE_INIT( 0, 0, GET_MPID(0, 0), EFI_ACPI_5_1_GIC_ENABLED, 0x09, 0x40000000, 0, 0, 0, 0), EFI_ACPI_5_1_GICC_STRUCTURE_INIT( 1, 1, GET_MPID(0, 1), EFI_ACPI_5_1_GIC_ENABLED, 0x09, 0x40000000, 0, 0, 0, 0), EFI_ACPI_5_1_GICC_STRUCTURE_INIT( 2, 2, GET_MPID(0, 2), EFI_ACPI_5_1_GIC_ENABLED, 0x09, 0x40000000, 0, 0, 0, 0), EFI_ACPI_5_1_GICC_STRUCTURE_INIT( 3, 3, GET_MPID(0, 3), EFI_ACPI_5_1_GIC_ENABLED, 0x09, 0x40000000, 0, 0, 0, 0), #elif (RPI_MODEL == 4) EFI_ACPI_5_1_GICC_STRUCTURE_INIT( 0, 0, GET_MPID(0, 0), EFI_ACPI_5_1_GIC_ENABLED, 48, FixedPcdGet64 (PcdGicInterruptInterfaceBase), 0xFF846000, 0xFF844000, 0x19, 0), EFI_ACPI_5_1_GICC_STRUCTURE_INIT( 1, 1, GET_MPID(0, 1), EFI_ACPI_5_1_GIC_ENABLED, 49, FixedPcdGet64 (PcdGicInterruptInterfaceBase), 0xFF846000, 0xFF844000, 0x19, 0), EFI_ACPI_5_1_GICC_STRUCTURE_INIT( 2, 2, GET_MPID(0, 2), EFI_ACPI_5_1_GIC_ENABLED, 50, FixedPcdGet64 (PcdGicInterruptInterfaceBase), 0xFF846000, 0xFF844000, 0x19, 0), EFI_ACPI_5_1_GICC_STRUCTURE_INIT( 3, 3, GET_MPID(0, 3), EFI_ACPI_5_1_GIC_ENABLED, 51, FixedPcdGet64 (PcdGicInterruptInterfaceBase), 0xFF846000, 0xFF844000, 0x19, 0), #endif }, #if (RPI_MODEL != 3) EFI_ACPI_5_0_GIC_DISTRIBUTOR_INIT(0, FixedPcdGet64 (PcdGicDistributorBase), 0) #endif }; // // Reference the table being generated to prevent the optimizer from removing the // data structure from the executable // VOID* CONST ReferenceAcpiTable = &Madt;