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.6359.1623407673438209707 for ; Fri, 11 Jun 2021 03:34:33 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: pranav.madhu@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 1256B1396; Fri, 11 Jun 2021 03:34:33 -0700 (PDT) Received: from usa.arm.com (a074742.blr.arm.com [10.162.16.32]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id DB86B3F694; Fri, 11 Jun 2021 03:34:31 -0700 (PDT) From: "Pranav Madhu" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Sami Mujawar Subject: [edk2-platforms][PATCH v2 2/5] Platform/Sgi: Add GED support Date: Fri, 11 Jun 2021 16:04:18 +0530 Message-Id: <20210611103421.32518-3-pranav.madhu@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210611103421.32518-1-pranav.madhu@arm.com> References: <20210611103421.32518-1-pranav.madhu@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Add ACPI Generic Event Device (GED) support for Arm's reference design platforms. The SP804 dual-timer interrupt is used as the event source for GED. Signed-off-by: Pranav Madhu --- Platform/ARM/SgiPkg/SgiPlatform.dec | 5 ++ Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc | 5 ++ Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc | 5 ++ Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf | 3 ++ Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf | 3 ++ Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf | 3 ++ Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf | 3 ++ Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf | 3 ++ Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf | 3 ++ Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf | 3 ++ Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf | 3 ++ Platform/ARM/SgiPkg/AcpiTables/SsdtEvents.asl | 49 +++++++++++= +++++++++ 12 files changed, 88 insertions(+) diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dec b/Platform/ARM/SgiPkg/Sg= iPlatform.dec index e0aabc566d88..ffbbb24f1c33 100644 --- a/Platform/ARM/SgiPkg/SgiPlatform.dec +++ b/Platform/ARM/SgiPkg/SgiPlatform.dec @@ -81,5 +81,10 @@ gArmSgiTokenSpaceGuid.PcdGpioController0Size|0|UINT32|0x00000020 gArmSgiTokenSpaceGuid.PcdGpioController0Interrupt|0|UINT32|0x00000021 =20 + # SP804 Dual Timer + gArmSgiTokenSpaceGuid.PcdSp804DualTimerBaseAddress|0|UINT32|0x00000022 + gArmSgiTokenSpaceGuid.PcdSp804DualTimerSize|0|UINT32|0x00000023 + gArmSgiTokenSpaceGuid.PcdSp804DualTimerInterrupt|0|UINT32|0x00000024 + [Ppis] gNtFwConfigDtInfoPpiGuid =3D { 0x6f606eb3, 0x9123, 0x4e15, { 0xa8,= 0x9b, 0x0f, 0xac, 0x66, 0xef, 0xd0, 0x17 } } diff --git a/Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc b/Platform/ARM/SgiP= kg/SgiMemoryMap.dsc.inc index a567af8537ec..76707be73d7b 100644 --- a/Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc +++ b/Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc @@ -51,6 +51,11 @@ gArmSgiTokenSpaceGuid.PcdWdogWS0Gsiv|93 gArmSgiTokenSpaceGuid.PcdWdogWS1Gsiv|94 =20 + # SP804 dual timer + gArmSgiTokenSpaceGuid.PcdSp804DualTimerBaseAddress|0x1C110000 + gArmSgiTokenSpaceGuid.PcdSp804DualTimerSize|0x00010000 + gArmSgiTokenSpaceGuid.PcdSp804DualTimerInterrupt|230 + # SMMU gArmSgiTokenSpaceGuid.PcdSmmuBase|0x4F000000 gArmSgiTokenSpaceGuid.PcdSmmuSize|0x01000000 diff --git a/Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc b/Platform/ARM/Sgi= Pkg/SgiMemoryMap2.dsc.inc index 5c137c0991e7..2d612f9b9674 100644 --- a/Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc +++ b/Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc @@ -51,6 +51,11 @@ gArmSgiTokenSpaceGuid.PcdWdogWS0Gsiv|110 gArmSgiTokenSpaceGuid.PcdWdogWS1Gsiv|111 =20 + # SP804 dual timer + gArmSgiTokenSpaceGuid.PcdSp804DualTimerBaseAddress|0x0C110000 + gArmSgiTokenSpaceGuid.PcdSp804DualTimerSize|0x00010000 + gArmSgiTokenSpaceGuid.PcdSp804DualTimerInterrupt|486 + # SMMU gArmSgiTokenSpaceGuid.PcdSmmuBase|0x40000000 gArmSgiTokenSpaceGuid.PcdSmmuSize|0x10000000 diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf b/Plat= form/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf index 56b80f418398..8c34c2fa73e4 100644 --- a/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf +++ b/Platform/ARM/SgiPkg/AcpiTables/RdE1EdgeAcpiTables.inf @@ -57,6 +57,9 @@ gArmSgiTokenSpaceGuid.PcdGpioController0Interrupt gArmSgiTokenSpaceGuid.PcdGtFrame0Gsiv gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv + gArmSgiTokenSpaceGuid.PcdSp804DualTimerBaseAddress + gArmSgiTokenSpaceGuid.PcdSp804DualTimerSize + gArmSgiTokenSpaceGuid.PcdSp804DualTimerInterrupt gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress gArmSgiTokenSpaceGuid.PcdVirtioBlkSize gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf b/Plat= form/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf index fa6692bc86f6..8d46b001444c 100644 --- a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf +++ b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeAcpiTables.inf @@ -57,6 +57,9 @@ gArmSgiTokenSpaceGuid.PcdGpioController0Interrupt gArmSgiTokenSpaceGuid.PcdGtFrame0Gsiv gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv + gArmSgiTokenSpaceGuid.PcdSp804DualTimerBaseAddress + gArmSgiTokenSpaceGuid.PcdSp804DualTimerSize + gArmSgiTokenSpaceGuid.PcdSp804DualTimerInterrupt gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress gArmSgiTokenSpaceGuid.PcdVirtioBlkSize gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf b/Pl= atform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf index d0ee125fa1de..473c9eff0f55 100644 --- a/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf +++ b/Platform/ARM/SgiPkg/AcpiTables/RdN1EdgeX2AcpiTables.inf @@ -66,6 +66,9 @@ gArmSgiTokenSpaceGuid.PcdGpioController0Interrupt gArmSgiTokenSpaceGuid.PcdGtFrame0Gsiv gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv + gArmSgiTokenSpaceGuid.PcdSp804DualTimerBaseAddress + gArmSgiTokenSpaceGuid.PcdSp804DualTimerSize + gArmSgiTokenSpaceGuid.PcdSp804DualTimerInterrupt gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress gArmSgiTokenSpaceGuid.PcdVirtioBlkSize gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf b/Platform= /ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf index 232b58eb012f..c537db45e08f 100644 --- a/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf +++ b/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf @@ -57,6 +57,9 @@ gArmSgiTokenSpaceGuid.PcdGpioController0Interrupt gArmSgiTokenSpaceGuid.PcdGtFrame0Gsiv gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv + gArmSgiTokenSpaceGuid.PcdSp804DualTimerBaseAddress + gArmSgiTokenSpaceGuid.PcdSp804DualTimerSize + gArmSgiTokenSpaceGuid.PcdSp804DualTimerInterrupt gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress gArmSgiTokenSpaceGuid.PcdVirtioBlkSize gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf b/Plat= form/ARM/SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf index 5713ef1ce3a9..6bbc3fc230ae 100644 --- a/Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf +++ b/Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg1AcpiTables.inf @@ -58,6 +58,9 @@ gArmSgiTokenSpaceGuid.PcdGtFrame0Gsiv gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv gArmSgiTokenSpaceGuid.PcdSmmuBase + gArmSgiTokenSpaceGuid.PcdSp804DualTimerBaseAddress + gArmSgiTokenSpaceGuid.PcdSp804DualTimerSize + gArmSgiTokenSpaceGuid.PcdSp804DualTimerInterrupt gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress gArmSgiTokenSpaceGuid.PcdVirtioBlkSize gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf b/Platform= /ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf index e7b702962abe..d461cbe54c68 100644 --- a/Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf +++ b/Platform/ARM/SgiPkg/AcpiTables/RdV1AcpiTables.inf @@ -57,6 +57,9 @@ gArmSgiTokenSpaceGuid.PcdGpioController0Interrupt gArmSgiTokenSpaceGuid.PcdGtFrame0Gsiv gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv + gArmSgiTokenSpaceGuid.PcdSp804DualTimerBaseAddress + gArmSgiTokenSpaceGuid.PcdSp804DualTimerSize + gArmSgiTokenSpaceGuid.PcdSp804DualTimerInterrupt gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress gArmSgiTokenSpaceGuid.PcdVirtioBlkSize gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf b/Platfo= rm/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf index 901391fba70e..3b699b0acbb8 100644 --- a/Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf +++ b/Platform/ARM/SgiPkg/AcpiTables/RdV1McAcpiTables.inf @@ -66,6 +66,9 @@ gArmSgiTokenSpaceGuid.PcdGpioController0Interrupt gArmSgiTokenSpaceGuid.PcdGtFrame0Gsiv gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv + gArmSgiTokenSpaceGuid.PcdSp804DualTimerBaseAddress + gArmSgiTokenSpaceGuid.PcdSp804DualTimerSize + gArmSgiTokenSpaceGuid.PcdSp804DualTimerInterrupt gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress gArmSgiTokenSpaceGuid.PcdVirtioBlkSize gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf b/Platfo= rm/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf index d59aefde735b..3ee66b1dfd5a 100644 --- a/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf +++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf @@ -57,6 +57,9 @@ gArmSgiTokenSpaceGuid.PcdGpioController0Interrupt gArmSgiTokenSpaceGuid.PcdGtFrame0Gsiv gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv + gArmSgiTokenSpaceGuid.PcdSp804DualTimerBaseAddress + gArmSgiTokenSpaceGuid.PcdSp804DualTimerSize + gArmSgiTokenSpaceGuid.PcdSp804DualTimerInterrupt gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress gArmSgiTokenSpaceGuid.PcdVirtioBlkSize gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt diff --git a/Platform/ARM/SgiPkg/AcpiTables/SsdtEvents.asl b/Platform/ARM= /SgiPkg/AcpiTables/SsdtEvents.asl index 28c7ce4e7f3c..58efe62c93ea 100644 --- a/Platform/ARM/SgiPkg/AcpiTables/SsdtEvents.asl +++ b/Platform/ARM/SgiPkg/AcpiTables/SsdtEvents.asl @@ -9,12 +9,20 @@ Interrupt is received by OSPM and that GPIO Interrupt Connection is li= sted in a GPIO controller device=E2=80=99s _AEI object. =20 + Interrupt Signalled ACPI event is another method of signalling events = in + HW-Reduced ACPI model. In this method, ACPI event is generated when an + interrupt is received by the OSPM which is listed in the Generic Event= Device + (GED) _CRS object. + Copyright (c) 2021, ARM Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent =20 @par Specification Reference: - ACPI 6.4, Chapter 5.6.5, GPIO-signaled ACPI Events - Arm Base Boot Requirements 1.0, Issue F, Chapter 8.5.3, GPIO contr= ollers + - ACPI 6.4, Chapter 5.6.9, Interrupt-signaled ACPI events + - Arm Base Boot Requirements 1.0, Issue F, Chapter 8.5.4 Generic Eve= nt + Devices **/ =20 #include "SgiAcpiHeader.h" @@ -64,4 +72,45 @@ DefinitionBlock("SsdtEvent.aml", "SSDT", 2, "ARMLTD", = "ARMSGI", EFI_ACPI_ARM_OEM INC0, 8 } } + + /* ACPI GED object Template. Arm's reference design platforms include = a SP804 + dual timer which is implemented as part of the RoS sub-system. The = SP804 + interrupt is used in GED as interrupt source. */ + Device (\_SB.GED0) { + Name (_HID, "ACPI0013") + Name (_UID, 0) + + /* Resource setting for GED */ + Name (_CRS, ResourceTemplate () { + Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { + FixedPcdGet32 (PcdSp804DualTimerInterrupt) + } + }) + + Method (_STA, 0x0, NotSerialized) { + return (0xF); + } + + /* Register map for interrupt clear register */ + OperationRegion ( + DTIM, + SystemMemory, + FixedPcdGet32 (PcdSp804DualTimerBaseAddress), + FixedPcdGet32 (PcdSp804DualTimerSize)) + Field (DTIM, DWordAcc, NoLock, Preserve) { + Offset (0x0C), + T1IC, 32, /* 0x0C Timer 1 Interrupt clear */ + } + + /* GED event handler */ + Method (_EVT, 1, Serialized) { + switch (ToInteger (Arg0)) + { + case (FixedPcdGet32 (PcdSp804DualTimerInterrupt)) { + Store (0x01, T1IC) + } + } + } + } /* Device (\_SB.GED0) */ + } --=20 2.17.1