From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=217.140.101.70; helo=foss.arm.com; envelope-from=thomas.abraham@arm.com; receiver=edk2-devel@lists.01.org Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by ml01.01.org (Postfix) with ESMTP id D4F952063E2EA for ; Thu, 24 May 2018 04:36:16 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 884A1165D for ; Thu, 24 May 2018 04:36:16 -0700 (PDT) Received: from mail-it0-f54.google.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 64E463F762 for ; Thu, 24 May 2018 04:36:16 -0700 (PDT) Received: by mail-it0-f54.google.com with SMTP id y189-v6so1899130itb.2 for ; Thu, 24 May 2018 04:36:16 -0700 (PDT) X-Gm-Message-State: ALKqPwd8tBHZlH1yRvoppOMBPg0vcncXvrKsMA/365oB6ArU/EV0mw25 ZD5FgVavnCJyd9lLa0U9cUi8Mxe/S0XPkgDo6j0= X-Google-Smtp-Source: AB8JxZrtGgWRtRYHAsnl6xFK2y28I2q05C310UDfuWOIOKb17THygoEWOD3tZZEVD8U6gR4NA2EF6HxAx9EtS/F4Zjo= X-Received: by 2002:a24:2796:: with SMTP id g144-v6mr8919835ita.71.1527161775553; Thu, 24 May 2018 04:36:15 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:97b8:0:0:0:0:0 with HTTP; Thu, 24 May 2018 04:36:14 -0700 (PDT) In-Reply-To: References: <1527054343-2125-1-git-send-email-thomas.abraham@arm.com> <1527054343-2125-6-git-send-email-thomas.abraham@arm.com> From: Thomas Abraham Date: Thu, 24 May 2018 17:06:14 +0530 X-Gmail-Original-Message-ID: Message-ID: To: Alexei Fedorov Cc: Thomas Abraham , "edk2-devel@lists.01.org" , "leif.lindholm@linaro.org" , "ard.biesheuvel@linaro.org" Subject: Re: [PATCH edk2-platforms v6 5/9] Platform/ARM/Sgi: add the initial set of acpi tables X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2018 11:36:17 -0000 Content-Type: text/plain; charset="UTF-8" Hi Alexei, On Wed, May 23, 2018 at 4:20 PM, Alexei Fedorov wrote: > Please see my comment in-lined. > >> -----Original Message----- >> From: edk2-devel On Behalf Of Thomas >> Abraham >> Sent: 23 May 2018 06:46 >> To: edk2-devel@lists.01.org >> Cc: leif.lindholm@linaro.org; ard.biesheuvel@linaro.org >> Subject: [edk2] [PATCH edk2-platforms v6 5/9] Platform/ARM/Sgi: add the initial >> set of acpi tables >> >> From: Daniil Egranov >> >> Add the initial set of Acpi tables for the SGI-575 platform. These tables conform >> to the ACPI specification version 6.1. Some of the mandatory tables required for >> SBBR v1.0 compilance are not included in this initial set of Acpi tables. >> >> Contributed-under: TianoCore Contribution Agreement 1.1 >> Signed-off-by: Daniil Egranov >> Signed-off-by: Thomas Abraham >> --- >> .../ARM/SgiPkg/AcpiTables/Sgi575/AcpiTables.inf | 51 ++++++ >> Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dbg2.aslc | 90 +++++++++++ >> Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl | 99 ++++++++++++ >> Platform/ARM/SgiPkg/AcpiTables/Sgi575/Fadt.aslc | 87 +++++++++++ >> Platform/ARM/SgiPkg/AcpiTables/Sgi575/Gtdt.aslc | 151 >> ++++++++++++++++++ >> Platform/ARM/SgiPkg/AcpiTables/Sgi575/Madt.aslc | 173 >> +++++++++++++++++++++ >> Platform/ARM/SgiPkg/AcpiTables/Sgi575/Spcr.aslc | 77 +++++++++ >> .../ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c | 7 + >> .../ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf | 6 + >> Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h | 41 +++++ >> .../ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf | 4 + >> 11 files changed, 786 insertions(+) >> create mode 100644 Platform/ARM/SgiPkg/AcpiTables/Sgi575/AcpiTables.inf >> create mode 100644 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dbg2.aslc >> create mode 100644 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl >> create mode 100644 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Fadt.aslc >> create mode 100644 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Gtdt.aslc >> create mode 100644 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Madt.aslc >> create mode 100644 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Spcr.aslc >> create mode 100644 Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h >> >> diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Gtdt.aslc >> b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Gtdt.aslc >> new file mode 100644 >> index 0000000..40657c9 >> --- /dev/null >> +++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Gtdt.aslc >> @@ -0,0 +1,151 @@ >> +/** @file >> +* Generic Timer Description Table (GTDT) >> +* >> +* Copyright (c) 2018, 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 "SgiAcpiHeader.h" >> +#include >> +#include >> +#include >> + >> +#define SGI_PLATFORM_WATCHDOG_COUNT 2 >> +#define SGI_TIMER_FRAMES_COUNT 2 >> + >> +#define SYSTEM_TIMER_BASE_ADDRESS 0xFFFFFFFFFFFFFFFF >> +#define GTDT_GLOBAL_FLAGS 0 >> +#define GTDT_GTIMER_FLAGS >> EFI_ACPI_6_1_GTDT_TIMER_FLAG_TIMER_INTERRUPT_POLARITY >> + >> +#define SGI_GT_BLOCK_CTL_BASE 0x2A810000 >> +#define SGI_GT_BLOCK_FRAME1_CTL_BASE 0x2A820000 >> +#define SGI_GT_BLOCK_FRAME1_CTL_EL0_BASE 0xFFFFFFFFFFFFFFFF >> +#define SGI_GT_BLOCK_FRAME1_GSIV 0x5B >> + >> +#define SGI_GT_BLOCK_FRAME0_CTL_BASE 0x2A830000 >> +#define SGI_GT_BLOCK_FRAME0_CTL_EL0_BASE 0xFFFFFFFFFFFFFFFF >> +#define SGI_GT_BLOCK_FRAME0_GSIV 0x5C >> + >> +#define SGI_GTX_TIMER_FLAGS 0 >> +#define GTX_TIMER_SECURE >> EFI_ACPI_6_1_GTDT_GT_BLOCK_COMMON_FLAG_SECURE_TIMER >> +#define GTX_TIMER_NON_SECURE 0 >> +#define GTX_TIMER_SAVE_CONTEXT >> EFI_ACPI_6_1_GTDT_GT_BLOCK_COMMON_FLAG_ALWAYS_ON_CAPABILITY >> +#define SGI_GTX_COMMON_FLAGS_S (GTX_TIMER_SAVE_CONTEXT | >> GTX_TIMER_SECURE) >> +#define SGI_GTX_COMMON_FLAGS_NS (GTX_TIMER_SAVE_CONTEXT | >> GTX_TIMER_NON_SECURE) >> + >> +#define EFI_ACPI_6_1_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT( \ >> + RefreshFramePhysicalAddress, ControlFramePhysicalAddress, \ >> + WatchdogTimerGSIV, WatchdogTimerFlags) \ >> + { \ >> + EFI_ACPI_6_1_GTDT_SBSA_GENERIC_WATCHDOG, \ >> + sizeof (EFI_ACPI_6_1_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE), \ >> + EFI_ACPI_RESERVED_WORD, \ >> + RefreshFramePhysicalAddress, \ >> + ControlFramePhysicalAddress, \ >> + WatchdogTimerGSIV, \ >> + WatchdogTimerFlags \ >> + } >> + >> +#pragma pack (1) >> + >> +typedef struct { >> + EFI_ACPI_6_1_GENERIC_TIMER_DESCRIPTION_TABLE Gtdt; >> + EFI_ACPI_6_1_GTDT_GT_BLOCK_STRUCTURE GtBlock; >> + EFI_ACPI_6_1_GTDT_GT_BLOCK_TIMER_STRUCTURE >> Frames[SGI_TIMER_FRAMES_COUNT]; >> + EFI_ACPI_6_1_GTDT_SBSA_GENERIC_WATCHDOG_STRUCTURE >> +Watchdogs[SGI_PLATFORM_WATCHDOG_COUNT]; >> +} EFI_ACPI_6_1_GENERIC_TIMER_DESCRIPTION_TABLES; >> + >> +#pragma pack () >> + >> +STATIC EFI_ACPI_6_1_GENERIC_TIMER_DESCRIPTION_TABLES Gtdt = { >> + { >> + ARM_ACPI_HEADER ( >> + EFI_ACPI_6_1_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE, >> + EFI_ACPI_6_1_GENERIC_TIMER_DESCRIPTION_TABLES, >> + EFI_ACPI_6_1_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION >> + ), >> + SYSTEM_TIMER_BASE_ADDRESS, // UINT64 PhysicalAddress >> + 0, // UINT32 Reserved >> + FixedPcdGet32 (PcdArmArchTimerSecIntrNum), // UINT32 >> SecurePL1TimerGSIV >> + GTDT_GTIMER_FLAGS, // UINT32 SecurePL1TimerFlags >> + FixedPcdGet32 (PcdArmArchTimerIntrNum), // UINT32 >> NonSecurePL1TimerGSIV >> + GTDT_GTIMER_FLAGS, // UINT32 NonSecurePL1TimerFlags >> + FixedPcdGet32 (PcdArmArchTimerVirtIntrNum), // UINT32 VirtualTimerGSIV >> + GTDT_GTIMER_FLAGS, // UINT32 VirtualTimerFlags >> + FixedPcdGet32 (PcdArmArchTimerHypIntrNum), // UINT32 >> NonSecurePL2TimerGSIV >> + GTDT_GTIMER_FLAGS, // UINT32 NonSecurePL2TimerFlags >> + 0xFFFFFFFFFFFFFFFF, // UINT64 CntReadBasePhysicalAddress >> + SGI_PLATFORM_WATCHDOG_COUNT, // UINT32 >> PlatformTimerCount > > This is incorrect, because doesn't take in account GT block. Thanks for your review. This has been fixed now. Can you please have a look at the updated patch. Thanks, Thomas.