From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.6235.1585651239909250126 for ; Tue, 31 Mar 2020 03:40:40 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ard.biesheuvel@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 89EEF101E for ; Tue, 31 Mar 2020 03:40:39 -0700 (PDT) Received: from mail-wm1-f45.google.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5E5113F802 for ; Tue, 31 Mar 2020 03:40:39 -0700 (PDT) Received: by mail-wm1-f45.google.com with SMTP id a81so1991852wmf.5 for ; Tue, 31 Mar 2020 03:40:39 -0700 (PDT) X-Gm-Message-State: ANhLgQ2bK5/Nm0+HbiqWiRFtO9W6rwWEZx4KfOaisCBtiUKzGlK3NrMQ XD+5e7he9yN7X0/siV4s8r4JlsOJ3O+VBgWWfn2kQg== X-Google-Smtp-Source: ADFU+vtjGgBQC9P+osLSrFlC3AuYV4+yIuqCtmkR4wcaDB0YrlmK3Boz8R62aUJQWKYDVf55HYmITBQPC3mxF2O4Sr0= X-Received: by 2002:a7b:c050:: with SMTP id u16mr3023153wmc.68.1585651234034; Tue, 31 Mar 2020 03:40:34 -0700 (PDT) MIME-Version: 1.0 References: <20200325105252.13905-1-aditya.angadi@arm.com> <20200325105252.13905-6-aditya.angadi@arm.com> In-Reply-To: <20200325105252.13905-6-aditya.angadi@arm.com> From: "Ard Biesheuvel" Date: Tue, 31 Mar 2020 12:40:23 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-platforms][PATCH v3 5/9] Platform/ARM/SgiPkg: add ACPI tables To: Aditya Angadi Cc: edk2-devel-groups-io , Leif Lindholm Content-Type: text/plain; charset="UTF-8" On Wed, 25 Mar 2020 at 11:53, Aditya Angadi wrote: > > Add Madt and Dsdt ACPI tables for RD-Daniel Config-M platform. > OK, it seems I was reviewing the patches out of order. The DSC you add in the next patch should be added here. > Cc: Leif Lindholm > Cc: Ard Biesheuvel > Signed-off-by: Aditya Angadi > --- > Platform/ARM/SgiPkg/AcpiTables/RdDanielCfgM/Dsdt.asl | 118 +++++++++++++++++ > Platform/ARM/SgiPkg/AcpiTables/RdDanielCfgM/Madt.aslc | 134 ++++++++++++++++++++ > Platform/ARM/SgiPkg/AcpiTables/RdDanielCfgMAcpiTables.inf | 63 +++++++++ > Platform/ARM/SgiPkg/SgiPlatform.dec | 1 + > Platform/ARM/SgiPkg/SgiPlatform.dsc | 1 + > Platform/ARM/SgiPkg/SgiPlatform.fdf | 1 + > 6 files changed, 318 insertions(+) > > diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdDanielCfgM/Dsdt.asl b/Platform/ARM/SgiPkg/AcpiTables/RdDanielCfgM/Dsdt.asl > new file mode 100644 > index 000000000000..57873ef5cfa2 > --- /dev/null > +++ b/Platform/ARM/SgiPkg/AcpiTables/RdDanielCfgM/Dsdt.asl > @@ -0,0 +1,118 @@ > +/** @file > +* Differentiated System Description Table Fields (DSDT) > +* > +* Copyright (c) 2020, ARM Ltd. All rights reserved. > +* > +* This program and the accompanying materials are licensed and made available > +* under the terms and conditions of the BSD License which accompanies this > +* distribution. The full text of the license may be found at > +* http://opensource.org/licenses/bsd-license.php > +* > +* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, > +* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. > +* > +**/ > + > +#include "SgiPlatform.h" > +#include "SgiAcpiHeader.h" > + > +DefinitionBlock ("DsdtTable.aml", "DSDT", 1, "ARMLTD", "ARMSGI", > + EFI_ACPI_ARM_OEM_REVISION) { > + Scope (_SB) { > + Device (CP00) { // Zeus core 0 > + Name (_HID, "ACPI0007") > + Name (_UID, 0) > + Name (_STA, 0xF) > + } > + > + Device (CP01) { // Zeus core 1 > + Name (_HID, "ACPI0007") > + Name (_UID, 1) > + Name (_STA, 0xF) > + } > + > + Device (CP02) { // Zeus core 2 > + Name (_HID, "ACPI0007") > + Name (_UID, 2) > + Name (_STA, 0xF) > + } > + > + Device (CP03) { // Zeus core 3 > + Name (_HID, "ACPI0007") > + Name (_UID, 3) > + Name (_STA, 0xF) > + } > + > + Device (CP04) { // Zeus core 4 > + Name (_HID, "ACPI0007") > + Name (_UID, 4) > + Name (_STA, 0xF) > + } > + > + Device (CP05) { // Zeus core 5 > + Name (_HID, "ACPI0007") > + Name (_UID, 5) > + Name (_STA, 0xF) > + } > + > + Device (CP06) { // Zeus core 6 > + Name (_HID, "ACPI0007") > + Name (_UID, 6) > + Name (_STA, 0xF) > + } > + > + Device (CP07) { // Zeus core 7 > + Name (_HID, "ACPI0007") > + Name (_UID, 7) > + Name (_STA, 0xF) > + } > + > + Device (CP08) { // Zeus core 8 > + Name (_HID, "ACPI0007") > + Name (_UID, 8) > + Name (_STA, 0xF) > + } > + > + Device (CP09) { // Zeus core 9 > + Name (_HID, "ACPI0007") > + Name (_UID, 9) > + Name (_STA, 0xF) > + } > + > + Device (CP10) { // Zeus core 10 > + Name (_HID, "ACPI0007") > + Name (_UID, 10) > + Name (_STA, 0xF) > + } > + > + Device (CP11) { // Zeus core 11 > + Name (_HID, "ACPI0007") > + Name (_UID, 11) > + Name (_STA, 0xF) > + } > + > + Device (CP12) { // Zeus core 12 > + Name (_HID, "ACPI0007") > + Name (_UID, 12) > + Name (_STA, 0xF) > + } > + > + Device (CP13) { // Zeus core 13 > + Name (_HID, "ACPI0007") > + Name (_UID, 13) > + Name (_STA, 0xF) > + } > + > + Device (CP14) { // Zeus core 14 > + Name (_HID, "ACPI0007") > + Name (_UID, 14) > + Name (_STA, 0xF) > + } > + > + Device (CP15) { // Zeus core 15 > + Name (_HID, "ACPI0007") > + Name (_UID, 15) > + Name (_STA, 0xF) > + } > + } // Scope(_SB) > +} > diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdDanielCfgM/Madt.aslc b/Platform/ARM/SgiPkg/AcpiTables/RdDanielCfgM/Madt.aslc > new file mode 100644 > index 000000000000..3027b8d223b4 > --- /dev/null > +++ b/Platform/ARM/SgiPkg/AcpiTables/RdDanielCfgM/Madt.aslc > @@ -0,0 +1,134 @@ > +/** @file > +* Multiple APIC Description Table (MADT) > +* > +* Copyright (c) 2020, ARM Limited. All rights reserved. > +* > +* This program and the accompanying materials are licensed and made available > +* under the terms and conditions of the BSD License which accompanies this > +* distribution. The full text of the license may be found at > +* http://opensource.org/licenses/bsd-license.php > +* > +* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, > +* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. > +* > +**/ > + > +#include "SgiPlatform.h" > +#include "SgiAcpiHeader.h" > +#include > +#include > +#include > +#include > + > +#define CLUSTER_COUNT 16 > +#define CORES_PER_CLUSTER 1 > +#define CORE_COUNT (CLUSTER_COUNT * CORES_PER_CLUSTER) > + > +// Multiple APIC Description Table > +#pragma pack (1) > + > +typedef struct { > + EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER Header; > + EFI_ACPI_6_2_GIC_STRUCTURE GicInterfaces[CORE_COUNT]; > + EFI_ACPI_6_2_GIC_DISTRIBUTOR_STRUCTURE GicDistributor; > + EFI_ACPI_6_2_GICR_STRUCTURE GicRedistributor; > +} EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE; > + > +#pragma pack () > + > +STATIC EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE Madt = { > + { > + ARM_ACPI_HEADER ( > + EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE, > + EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE, > + EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION > + ), > + // MADT specific fields > + 0, // LocalApicAddress > + 0 // Flags > + }, > + { > + // Format: EFI_ACPI_6_2_GICC_STRUCTURE_INIT(GicId, AcpiCpuUid, Mpidr, Flags, > + // PmuIrq, GicBase, GicVBase, > + // GicHBase, GsivId, GicRBase, > + // Efficiency) > + // Note: The GIC Structure of the primary CPU must be the first entry > + // (see note in 5.2.12.14 GICC Structure of ACPI v6.2). > + EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // Zeus core0 > + 0, 0, GET_MPID(0x0, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23, > + FixedPcdGet32 (PcdGicDistributorBase), > + 0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */), > + EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // Zeus core1 > + 0, 1, GET_MPID(0x100, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23, > + FixedPcdGet32 (PcdGicDistributorBase), > + 0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */), > + EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // Zeus core2 > + 0, 2, GET_MPID(0x200, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23, > + FixedPcdGet32 (PcdGicDistributorBase), > + 0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */), > + EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // Zeus core3 > + 0, 3, GET_MPID(0x300, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23, > + FixedPcdGet32 (PcdGicDistributorBase), > + 0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */), > + EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // Zeus core4 > + 0, 4, GET_MPID(0x400, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23, > + FixedPcdGet32 (PcdGicDistributorBase), > + 0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */), > + EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // Zeus core5 > + 0, 5, GET_MPID(0x500, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23, > + FixedPcdGet32 (PcdGicDistributorBase), > + 0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */), > + EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // Zeus core6 > + 0, 6, GET_MPID(0x600, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23, > + FixedPcdGet32 (PcdGicDistributorBase), > + 0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */), > + EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // Zeus core7 > + 0, 7, GET_MPID(0x700, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23, > + FixedPcdGet32 (PcdGicDistributorBase), > + 0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */), > + EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // Zeus core8 > + 0, 8, GET_MPID(0x800, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23, > + FixedPcdGet32 (PcdGicDistributorBase), > + 0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */), > + EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // Zeus core9 > + 0, 9, GET_MPID(0x900, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23, > + FixedPcdGet32 (PcdGicDistributorBase), > + 0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */), > + EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // Zeus core10 > + 0, 10, GET_MPID(0xa00, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23, > + FixedPcdGet32 (PcdGicDistributorBase), > + 0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */), > + EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // Zeus core11 > + 0, 11, GET_MPID(0xb00, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23, > + FixedPcdGet32 (PcdGicDistributorBase), > + 0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */), > + EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // Zeus core12 > + 0, 12, GET_MPID(0xc00, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23, > + FixedPcdGet32 (PcdGicDistributorBase), > + 0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */), > + EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // Zeus core13 > + 0, 13, GET_MPID(0xd00, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23, > + FixedPcdGet32 (PcdGicDistributorBase), > + 0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */), > + EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // Zeus core14 > + 0, 14, GET_MPID(0xe00, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23, > + FixedPcdGet32 (PcdGicDistributorBase), > + 0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */), > + EFI_ACPI_6_2_GICC_STRUCTURE_INIT( // Zeus core15 > + 0, 15, GET_MPID(0xf00, 0x0), EFI_ACPI_6_2_GIC_ENABLED, 23, > + FixedPcdGet32 (PcdGicDistributorBase), > + 0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */), > + }, > + // GIC Distributor Entry > + EFI_ACPI_6_2_GIC_DISTRIBUTOR_INIT(0, FixedPcdGet32 (PcdGicDistributorBase), > + 0, 3), > + // GIC Redistributor > + EFI_ACPI_6_2_GIC_REDISTRIBUTOR_INIT(FixedPcdGet32 (PcdGicRedistributorsBase), > + SIZE_16MB), > +}; > + > +// > +// Reference the table being generated to prevent the optimizer from removing > +// the data structure from the executable > +// > +VOID* CONST ReferenceAcpiTable = &Madt; > diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdDanielCfgMAcpiTables.inf b/Platform/ARM/SgiPkg/AcpiTables/RdDanielCfgMAcpiTables.inf > new file mode 100644 > index 000000000000..73b6c7ffafbb > --- /dev/null > +++ b/Platform/ARM/SgiPkg/AcpiTables/RdDanielCfgMAcpiTables.inf > @@ -0,0 +1,63 @@ > +## @file > +# ACPI table data and ASL sources required to boot the platform. > +# > +# Copyright (c) 2020, ARM Ltd. All rights reserved. > +# > +# This program and the accompanying materials are licensed and made available > +# under the terms and conditions of the BSD License which accompanies this > +# distribution. The full text of the license may be found at > +# http://opensource.org/licenses/bsd-license.php > +# > +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, > +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. > +# > +## > + > +[Defines] > + INF_VERSION = 0x0001001A > + BASE_NAME = RdDanielCfgMAcpiTables > + FILE_GUID = 163132b3-8ec1-48f7-b4d1-49306c3f4d51 > + MODULE_TYPE = USER_DEFINED > + VERSION_STRING = 1.0 > + > +[Sources] > + Dbg2.aslc > + SsdtRos.asl > + Fadt.aslc > + Gtdt.aslc > + Iort.aslc > + Mcfg.aslc > + RdDanielCfgM/Dsdt.asl > + RdDanielCfgM/Madt.aslc > + Spcr.aslc > + > +[Packages] > + ArmPkg/ArmPkg.dec > + ArmPlatformPkg/ArmPlatformPkg.dec > + EmbeddedPkg/EmbeddedPkg.dec > + MdePkg/MdePkg.dec > + Platform/ARM/SgiPkg/SgiPlatform.dec > + > +[FixedPcd] > + gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase > + gArmPlatformTokenSpaceGuid.PL011UartInterrupt > + > + gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum > + gArmTokenSpaceGuid.PcdArmArchTimerIntrNum > + gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum > + gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum > + gArmTokenSpaceGuid.PcdGicDistributorBase > + gArmTokenSpaceGuid.PcdGicRedistributorsBase > + gArmTokenSpaceGuid.PcdGenericWatchdogControlBase > + gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase > + gArmTokenSpaceGuid.PcdPciBusMin > + gArmTokenSpaceGuid.PcdPciBusMax > + > + gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress > + gArmSgiTokenSpaceGuid.PcdVirtioBlkSize > + gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt > + gArmSgiTokenSpaceGuid.PcdVirtioNetBaseAddress > + gArmSgiTokenSpaceGuid.PcdVirtioNetSize > + gArmSgiTokenSpaceGuid.PcdVirtioNetInterrupt > + > + gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress > diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dec b/Platform/ARM/SgiPkg/SgiPlatform.dec > index 4ac3dec91e3d..a89bf26365d7 100644 > --- a/Platform/ARM/SgiPkg/SgiPlatform.dec > +++ b/Platform/ARM/SgiPkg/SgiPlatform.dec > @@ -30,6 +30,7 @@ [Guids.common] > gRdN1EdgeAcpiTablesFileGuid = { 0x4b0b91d0, 0x4a05, 0x45c4, { 0x88, 0xa7, 0x88, 0xe1, 0x70, 0xe7, 0x66, 0x94 } } > gRdN1EdgeX2AcpiTablesFileGuid = { 0x82a34150, 0x0fc6, 0x45f4, { 0x8e, 0xa0, 0xf0, 0xa4, 0x66, 0x0c, 0xf3, 0x5d } } > gRdE1EdgeAcpiTablesFileGuid = { 0x2af40815, 0xa84e, 0x4de9, { 0x8c, 0x38, 0x91, 0x40, 0xb3, 0x54, 0x40, 0x73 } } > + gRdDanielCfgMAcpiTablesFileGuid = { 0x163132b3, 0x8ec1, 0x48f7, {0xb4, 0xd1, 0x49, 0x30, 0x6c, 0x3f, 0x4d, 0x51} } > > [PcdsFeatureFlag.common] > gArmSgiTokenSpaceGuid.PcdVirtioBlkSupported|FALSE|BOOLEAN|0x00000001 > diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc b/Platform/ARM/SgiPkg/SgiPlatform.dsc > index 7b95acb9db46..74fe1a4533bd 100644 > --- a/Platform/ARM/SgiPkg/SgiPlatform.dsc > +++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc > @@ -256,6 +256,7 @@ [Components.common] > Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf > Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf > Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf > + Platform/ARM/SgiPkg/AcpiTables/RdDanielCfgMAcpiTables.inf > MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf > > # > diff --git a/Platform/ARM/SgiPkg/SgiPlatform.fdf b/Platform/ARM/SgiPkg/SgiPlatform.fdf > index 3d13998015b9..48192917e22e 100644 > --- a/Platform/ARM/SgiPkg/SgiPlatform.fdf > +++ b/Platform/ARM/SgiPkg/SgiPlatform.fdf > @@ -103,6 +103,7 @@ [FV.FvMain] > INF RuleOverride=ACPITABLE Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf > INF RuleOverride=ACPITABLE Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf > INF RuleOverride=ACPITABLE Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf > + INF RuleOverride=ACPITABLE Platform/ARM/SgiPkg/AcpiTables/RdDanielCfgMAcpiTables.inf > INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf > > # Required by PCI > -- > 2.17.1 >