From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=104.47.2.70; helo=eur01-db5-obe.outbound.protection.outlook.com; envelope-from=alexei.fedorov@arm.com; receiver=edk2-devel@lists.01.org Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0070.outbound.protection.outlook.com [104.47.2.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 572E0207E36D1 for ; Wed, 23 May 2018 03:50:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kXcv7UbMt1ZS0pyAEuzeye46hKBnfQW1jeTy+qqht7Q=; b=aYHUV2XrosWRYneJlpuWk9et1rJjGRgigYN64xFaBwCbMiY0ZcRoPniwLrHDEKDDDu7JoF8qeIVTD71YBr0TdKaFVWs4YJR/ceq2x/dUwuzpVeyFQWiDW5a0IklXCd+zPptV286DtFk78HuNnkXQB57mdOPw7zKLQEXQHCOiqO4= Received: from VI1PR0801MB1773.eurprd08.prod.outlook.com (10.168.67.138) by VI1PR0801MB1999.eurprd08.prod.outlook.com (10.173.74.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.776.11; Wed, 23 May 2018 10:50:36 +0000 Received: from VI1PR0801MB1773.eurprd08.prod.outlook.com ([fe80::49a9:8cb7:7972:ff41]) by VI1PR0801MB1773.eurprd08.prod.outlook.com ([fe80::49a9:8cb7:7972:ff41%18]) with mapi id 15.20.0776.019; Wed, 23 May 2018 10:50:36 +0000 From: Alexei Fedorov To: Thomas Abraham , "edk2-devel@lists.01.org" CC: "leif.lindholm@linaro.org" , "ard.biesheuvel@linaro.org" Thread-Topic: [edk2] [PATCH edk2-platforms v6 5/9] Platform/ARM/Sgi: add the initial set of acpi tables Thread-Index: AQHT8llYD3F1cWVk6U+UVMzVuIdHCqQ9IRCg Date: Wed, 23 May 2018 10:50:35 +0000 Message-ID: References: <1527054343-2125-1-git-send-email-thomas.abraham@arm.com> <1527054343-2125-6-git-send-email-thomas.abraham@arm.com> In-Reply-To: <1527054343-2125-6-git-send-email-thomas.abraham@arm.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexei.Fedorov@arm.com; x-originating-ip: [217.140.96.140] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR0801MB1999; 7:SGuVhzLgHLY1mcin08LKPn3fddUe4A8O/TQHN/8adzpzn7IFrMkre37F6kXhMrZQQ1gkW+AjMRySPwCPhv+FUWFdW9MrNSmKekRZVeiSOL5Ig1lX+YDeCPOJlWn+C+AZkkXk8Mm1mCr9GU8H1mXTTkt0qmJfJrGu7vTXKS4bGz6vxX8z30D6Rabh6y3Yo6lP7rKSVMsT/FbqnzGkGAAabcGAkOH3weyeMAuJ2wTkkpECVGwsNlatXi/tuUaQGad1 x-ms-exchange-antispam-srfa-diagnostics: SOS;SOR; x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(2017052603328)(7153060)(7193020); SRVR:VI1PR0801MB1999; x-ms-traffictypediagnostic: VI1PR0801MB1999: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917)(162533806227266); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(3231254)(944501410)(52105095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:VI1PR0801MB1999; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0801MB1999; x-forefront-prvs: 06818431B9 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(366004)(39380400002)(346002)(39860400002)(376002)(189003)(199004)(40434004)(13464003)(4326008)(7696005)(2501003)(25786009)(97736004)(11346002)(575784001)(8676002)(478600001)(305945005)(229853002)(6246003)(2900100001)(81156014)(53376002)(72206003)(966005)(81166006)(74316002)(7736002)(3280700002)(9686003)(8936002)(6306002)(16200700003)(2906002)(3660700001)(446003)(5660300001)(86362001)(53936002)(55016002)(53946003)(476003)(486006)(105586002)(53546011)(316002)(26005)(66066001)(110136005)(54906003)(106356001)(6506007)(6436002)(5250100002)(15188155005)(76176011)(14454004)(16799955002)(102836004)(5890100001)(33656002)(68736007)(99286004)(6116002)(3846002)(59450400001)(569006); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0801MB1999; H:VI1PR0801MB1773.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 6/Wbjwq4a5pqN2+ZODV4IXbhm7/jK7v298lMb96Fwv5rVylp1fGuNTyUueNmk52MMvyYoBKpx7rM2qodUVu7mz5w4028IiFVub0O82B3ZbwIilsLclZHmYXF+b+F5/sRqOMbR86Ua7BTaMeuzh2SuGCiBfdrxWE3hZFe+xCbspAdvEDBidfLh5HCZ6TFX4E5 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 8512e196-b28e-493c-253d-08d5c09b03de X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8512e196-b28e-493c-253d-08d5c09b03de X-MS-Exchange-CrossTenant-originalarrivaltime: 23 May 2018 10:50:35.8740 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1999 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: Wed, 23 May 2018 10:50:41 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 i= nitial > 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 requi= red 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/AcpiTables.inf > b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/AcpiTables.inf > new file mode 100644 > index 0000000..ec47f94 > --- /dev/null > +++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/AcpiTables.inf > @@ -0,0 +1,51 @@ > +## @file > +# ACPI table data and ASL sources required to boot the platform. > +# > +# Copyright (c) 2018, 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 =3D 0x0001001A > + BASE_NAME =3D Sgi575AcpiTables > + FILE_GUID =3D c712719a-0aaf-438c-9cdd-35ab4d60207= d # > gSgi575AcpiTablesiFileGuid > + MODULE_TYPE =3D USER_DEFINED > + VERSION_STRING =3D 1.0 > + > +[Sources] > + Dbg2.aslc > + Dsdt.asl > + Fadt.aslc > + Gtdt.aslc > + Madt.aslc > + Spcr.aslc > + > +[Packages] > + ArmPkg/ArmPkg.dec > + ArmPlatformPkg/ArmPlatformPkg.dec > + EmbeddedPkg/EmbeddedPkg.dec > + MdePkg/MdePkg.dec > + Platform/ARM/SgiPkg/SgiPlatform.dec > + > +[FixedPcd] > + gArmPlatformTokenSpaceGuid.PcdCoreCount > + gArmPlatformTokenSpaceGuid.PcdClusterCount > + gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase > + gArmPlatformTokenSpaceGuid.PL011UartInterrupt > + > + gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum > + gArmTokenSpaceGuid.PcdArmArchTimerIntrNum > + gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum > + gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum > + gArmTokenSpaceGuid.PcdGicDistributorBase > + gArmTokenSpaceGuid.PcdGicRedistributorsBase > + gArmTokenSpaceGuid.PcdGenericWatchdogControlBase > + gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase > diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dbg2.aslc > b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dbg2.aslc > new file mode 100644 > index 0000000..ed671f3 > --- /dev/null > +++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dbg2.aslc > @@ -0,0 +1,90 @@ > +/** @file > +* Debug Port Table 2 (DBG2) > +* > +* 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_DBG2_NUM_DEBUG_PORTS 1 > +#define SGI_DBG2_NUM_GAS 1 > +#define SGI_DBG2_NS_STR_LENGTH 8 > +#define SGI_PL011_REGISTER_SPACE 0x1000 > + > +#define NAME_STR_UART1 {'C', 'O', 'M', '1', '\0', '\0', '\0', '\0'} > + > +#pragma pack(1) > + > +typedef struct { > + EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT Dbg2Device; > + EFI_ACPI_6_1_GENERIC_ADDRESS_STRUCTURE BaseAddressRegister; > + UINT32 AddressSize; > + UINT8 NameSpaceString[SGI_DBG2= _NS_STR_LENGTH]; > +} DBG2_DEBUG_DEVICE_INFORMATION; > + > +typedef struct { > + EFI_ACPI_DEBUG_PORT_2_DESCRIPTION_TABLE Description; > + DBG2_DEBUG_DEVICE_INFORMATION > Dbg2DeviceInfo[SGI_DBG2_NUM_DEBUG_PORTS]; > +} DBG2_TABLE; > + > +#pragma pack() > + > +#define DBG2_DEBUG_PORT_DDI(NumReg, SubType, UartBase, UartAddrLen, > UartNameStr) { \ > + { = \ > + EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT_REVISION, /* > UINT8 Revision */ \ > + sizeof (DBG2_DEBUG_DEVICE_INFORMATION), /* U= INT16 > Length */ \ > + NumReg, /* U= INT8 > NumberofGenericAddressRegisters */ \ > + SGI_DBG2_NS_STR_LENGTH, /* U= INT16 > NameSpaceStringLength */ \ > + OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, NameSpaceString), /* > UINT16 NameSpaceStringOffset */ \ > + 0, /* U= INT16 OemDataLength */ > \ > + 0, /* U= INT16 OemDataOffset */ > \ > + EFI_ACPI_DBG2_PORT_TYPE_SERIAL, /* U= INT16 Port > Type */ \ > + SubType, /* U= INT16 Port Subtype */ > \ > + { EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE }, /* U= INT8 > Reserved[2] */ \ > + OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, BaseAddressRegister), > /* UINT16 BaseAddressRegister Offset */ \ > + OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, AddressSize) /* > UINT16 AddressSize Offset */ \ > + }, = \ > + ARM_GAS32 (UartBase), /* > EFI_ACPI_6_1_GENERIC_ADDRESS_STRUCTURE BaseAddressRegister */ \ > + UartAddrLen, /* UINT32 AddressSiz= e */ > \ > + UartNameStr /* UINT8 > NameSpaceString[MAX_DBG2_NAME_LEN] */ \ > +} > + > +STATIC DBG2_TABLE Dbg2 =3D { > + { > + ARM_ACPI_HEADER ( > + EFI_ACPI_6_1_DEBUG_PORT_2_TABLE_SIGNATURE, > + DBG2_TABLE, > + EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT_REVISION > + ), > + OFFSET_OF (DBG2_TABLE, Dbg2DeviceInfo), > + SGI_DBG2_NUM_DEBUG_PORTS > + }, > + { > + // Kernel Debug Port > + DBG2_DEBUG_PORT_DDI ( > + SGI_DBG2_NUM_GAS, > + EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART, > + FixedPcdGet64 (PcdSerialDbgRegisterBase), > + SGI_PL011_REGISTER_SPACE, > + NAME_STR_UART1 > + ), > + } > +}; > + > +// > +// Reference the table being generated to prevent the optimizer from > +removing // the data structure from the executable // > +VOID* CONST ReferenceAcpiTable =3D &Dbg2; > diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl > b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl > new file mode 100644 > index 0000000..ceeac5f > --- /dev/null > +++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl > @@ -0,0 +1,99 @@ > +/** @file > +* Differentiated System Description Table Fields (DSDT) > +* > +* Copyright (c) 2018, 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", "ARM-SGI575", > +EFI_ACPI_ARM_OEM_REVISION) { > + Scope(_SB) { > + > + Device(CP00) { // A75-0: Cluster 0, Cpu 0 > + Name(_HID, "ACPI0007") > + Name(_UID, 0) > + Name(_STA, 0xF) > + } > + > + Device(CP01) { // A75-0: Cluster 0, Cpu 1 > + Name(_HID, "ACPI0007") > + Name(_UID, 1) > + Name(_STA, 0xF) > + } > + > + Device(CP02) { // A75-0: Cluster 0, Cpu 2 > + Name(_HID, "ACPI0007") > + Name(_UID, 2) > + Name(_STA, 0xF) > + } > + > + Device(CP03) { // A75-0: Cluster 0, Cpu 3 > + Name(_HID, "ACPI0007") > + Name(_UID, 3) > + Name(_STA, 0xF) > + } > + > + Device(CP04) { // A75-0: Cluster 1, Cpu 0 > + Name(_HID, "ACPI0007") > + Name(_UID, 4) > + Name(_STA, 0xF) > + } > + > + Device(CP05) { // A75-0: Cluster 1, Cpu 1 > + Name(_HID, "ACPI0007") > + Name(_UID, 5) > + Name(_STA, 0xF) > + } > + > + Device(CP06) { // A75-0: Cluster 1, Cpu 2 > + Name(_HID, "ACPI0007") > + Name(_UID, 6) > + Name(_STA, 0xF) > + } > + > + Device(CP07) { // A75-0: Cluster 1, Cpu 3 > + Name(_HID, "ACPI0007") > + Name(_UID, 7) > + Name(_STA, 0xF) > + } > + > + // UART PL011 > + Device(COM0) { > + Name(_HID, "ARMH0011") > + Name(_CID, "ARMH0011") > + Name(_UID, Zero) > + Name(_STA, 0xF) > + Name(_CRS, ResourceTemplate() { > + Memory32Fixed(ReadWrite, 0x7FF80000, 0x1000) > + Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive) { 147 = } > + }) > + } > + > + // SMSC 91C111 > + Device(ETH0) { > + Name(_HID, "LNRO0003") > + Name(_UID, Zero) > + Name(_STA, 0xF) > + Name(_CRS, ResourceTemplate() { > + Memory32Fixed(ReadWrite, 0x18000000, 0x1000) > + Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive) { = 111 } > + }) > + Name(_DSD, Package() { > + ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), > + Package() { > + Package(2) {"reg-io-width", 4 }, > + } > + }) > + } > + } // Scope(_SB) > +} > diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Fadt.aslc > b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Fadt.aslc > new file mode 100644 > index 0000000..ed96298 > --- /dev/null > +++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Fadt.aslc > @@ -0,0 +1,87 @@ > +/** @file > +* Fixed ACPI Description Table (FADT) > +* > +* 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 > + > +STATIC EFI_ACPI_6_1_FIXED_ACPI_DESCRIPTION_TABLE Fadt =3D { > + ARM_ACPI_HEADER ( > + EFI_ACPI_6_1_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, > + EFI_ACPI_6_1_FIXED_ACPI_DESCRIPTION_TABLE, > + EFI_ACPI_6_1_FIXED_ACPI_DESCRIPTION_TABLE_REVISION > + ), > + 0, = // UINT32 FirmwareCtrl > + 0, = // UINT32 Dsdt > + EFI_ACPI_RESERVED_BYTE, = // UINT8 Reserved0 > + EFI_ACPI_6_1_PM_PROFILE_ENTERPRISE_SERVER, = // UINT8 > PreferredPmProfile > + 0, = // UINT16 SciInt > + 0, = // UINT32 SmiCmd > + 0, = // UINT8 AcpiEnable > + 0, = // UINT8 AcpiDisable > + 0, = // UINT8 S4BiosReq > + 0, = // UINT8 PstateCnt > + 0, = // UINT32 Pm1aEvtBlk > + 0, = // UINT32 Pm1bEvtBlk > + 0, = // UINT32 Pm1aCntBlk > + 0, = // UINT32 Pm1bCntBlk > + 0, = // UINT32 Pm2CntBlk > + 0, = // UINT32 PmTmrBlk > + 0, = // UINT32 Gpe0Blk > + 0, = // UINT32 Gpe1Blk > + 0, = // UINT8 Pm1EvtLen > + 0, = // UINT8 Pm1CntLen > + 0, = // UINT8 Pm2CntLen > + 0, = // UINT8 PmTmrLen > + 0, = // UINT8 Gpe0BlkLen > + 0, = // UINT8 Gpe1BlkLen > + 0, = // UINT8 Gpe1Base > + 0, = // UINT8 CstCnt > + 0, = // UINT16 PLvl2Lat > + 0, = // UINT16 PLvl3Lat > + 0, = // UINT16 FlushSize > + 0, = // UINT16 FlushStride > + 0, = // UINT8 DutyOffset > + 0, = // UINT8 DutyWidth > + 0, = // UINT8 DayAlrm > + 0, = // UINT8 MonAlrm > + 0, = // UINT8 Century > + 0, = // UINT16 IaPcBootArch > + 0, = // UINT8 Reserved1 > + EFI_ACPI_6_1_HW_REDUCED_ACPI | > EFI_ACPI_6_1_LOW_POWER_S0_IDLE_CAPABLE, // UINT32 Flags > + NULL_GAS, = // GAS ResetReg > + 0, = // UINT8 ResetValue > + EFI_ACPI_6_1_ARM_PSCI_COMPLIANT, = // UINT16 > ArmBootArchFlags > + EFI_ACPI_6_1_FIXED_ACPI_DESCRIPTION_TABLE_MINOR_REVISION, > // UINT8 MinorRevision > + 0, = // UINT64 XFirmwareCtrl > + 0, = // UINT64 XDsdt > + NULL_GAS, = // GAS XPm1aEvtBlk > + NULL_GAS, = // GAS XPm1bEvtBlk > + NULL_GAS, = // GAS XPm1aCntBlk > + NULL_GAS, = // GAS XPm1bCntBlk > + NULL_GAS, = // GAS XPm2CntBlk > + NULL_GAS, = // GAS XPmTmrBlk > + NULL_GAS, = // GAS XGpe0Blk > + NULL_GAS, = // GAS XGpe1Blk > + NULL_GAS, = // GAS SleepControlReg > + NULL_GAS, = // GAS SleepStatusReg > + 0 = // UINT64 > HypervisorVendorIdentity; > +}; > + > +// > +// Reference the table being generated to prevent the optimizer from > +removing the // data structure from the executable // > +VOID* CONST ReferenceAcpiTable =3D &Fadt; > 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 =3D { > + { > + 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 PhysicalAdd= ress > + 0, // UINT32 Reserved > + FixedPcdGet32 (PcdArmArchTimerSecIntrNum), // UINT32 > SecurePL1TimerGSIV > + GTDT_GTIMER_FLAGS, // UINT32 SecurePL1Ti= merFlags > + FixedPcdGet32 (PcdArmArchTimerIntrNum), // UINT32 > NonSecurePL1TimerGSIV > + GTDT_GTIMER_FLAGS, // UINT32 NonSecurePL= 1TimerFlags > + FixedPcdGet32 (PcdArmArchTimerVirtIntrNum), // UINT32 VirtualTime= rGSIV > + GTDT_GTIMER_FLAGS, // UINT32 VirtualTime= rFlags > + FixedPcdGet32 (PcdArmArchTimerHypIntrNum), // UINT32 > NonSecurePL2TimerGSIV > + GTDT_GTIMER_FLAGS, // UINT32 NonSecurePL= 2TimerFlags > + 0xFFFFFFFFFFFFFFFF, // UINT64 CntReadBase= PhysicalAddress > + SGI_PLATFORM_WATCHDOG_COUNT, // UINT32 > PlatformTimerCount This is incorrect, because doesn't take in account GT block. > + sizeof (EFI_ACPI_6_1_GENERIC_TIMER_DESCRIPTION_TABLE) // UINT32 > +PlatfromTimerOffset > + }, > + { > + EFI_ACPI_6_1_GTDT_GT_BLOCK, // UINT8 Type > + sizeof(EFI_ACPI_6_1_GTDT_GT_BLOCK_STRUCTURE) + // UINT16 Leng= th > + sizeof(EFI_ACPI_6_1_GTDT_GT_BLOCK_TIMER_STRUCTURE) * > + SGI_TIMER_FRAMES_COUNT, > + EFI_ACPI_RESERVED_BYTE, // UINT8 Reser= ved > + SGI_GT_BLOCK_CTL_BASE, // UINT64 CntC= tlBase > + SGI_TIMER_FRAMES_COUNT, // UINT32 > GTBlockTimerCount > + sizeof (EFI_ACPI_6_1_GTDT_GT_BLOCK_STRUCTURE) // UINT32 > GTBlockTimerOffset > + }, > + { > + { > + 0, // UINT8 GTFrameNumber > + { > + EFI_ACPI_RESERVED_BYTE, > + EFI_ACPI_RESERVED_BYTE, > + EFI_ACPI_RESERVED_BYTE > + }, // UINT8 Reserved[3] > + SGI_GT_BLOCK_FRAME0_CTL_BASE, // UINT64 CntBaseX > + SGI_GT_BLOCK_FRAME0_CTL_EL0_BASE, // UINT64 CntEL0BaseX > + SGI_GT_BLOCK_FRAME0_GSIV, // UINT32 GTxPhysicalTimerG= SIV > + SGI_GTX_TIMER_FLAGS, // UINT32 GTxPhysicalTimerF= lags > + 0, // UINT32 GTxVirtualTimerGS= IV > + 0, // UINT32 GTxVirtualTimerFl= ags > + SGI_GTX_COMMON_FLAGS_NS // UINT32 GTxCommonFlags > + }, > + { > + 1, // UINT8 GTFrameNumber > + { > + EFI_ACPI_RESERVED_BYTE, > + EFI_ACPI_RESERVED_BYTE, > + EFI_ACPI_RESERVED_BYTE > + }, // UINT8 Reserved[3] > + SGI_GT_BLOCK_FRAME1_CTL_BASE, // UINT64 CntBaseX > + SGI_GT_BLOCK_FRAME1_CTL_EL0_BASE, // UINT64 CntEL0BaseX > + SGI_GT_BLOCK_FRAME1_GSIV, // UINT32 GTxPhysicalTimerG= SIV > + SGI_GTX_TIMER_FLAGS, // UINT32 GTxPhysicalTimerF= lags > + 0, // UINT32 GTxVirtualTimerGS= IV > + 0, // UINT32 GTxVirtualTimerFl= ags > + SGI_GTX_COMMON_FLAGS_S // UINT32 GTxCommonFlags > + } > + }, > + { > + EFI_ACPI_6_1_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT ( > + FixedPcdGet32 (PcdGenericWatchdogRefreshBase), > + FixedPcdGet32 (PcdGenericWatchdogControlBase), > + 93, > + 0 > + ), > + EFI_ACPI_6_1_SBSA_GENERIC_WATCHDOG_STRUCTURE_INIT ( > + FixedPcdGet32 (PcdGenericWatchdogRefreshBase), > + FixedPcdGet32 (PcdGenericWatchdogControlBase), > + 94, > + EFI_ACPI_6_1_GTDT_SBSA_GENERIC_WATCHDOG_FLAG_SECURE_TIMER > + ) > + } > +}; > + > +// > +// Reference the table being generated to prevent the optimizer from > +removing the // data structure from the executable // > +VOID* CONST ReferenceAcpiTable =3D &Gtdt; > diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Madt.aslc > b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Madt.aslc > new file mode 100644 > index 0000000..4f98120 > --- /dev/null > +++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Madt.aslc > @@ -0,0 +1,173 @@ > +/** @file > +* Multiple APIC Description Table (MADT) > +* > +* 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 "SgiPlatform.h" > +#include "SgiAcpiHeader.h" > +#include > +#include > +#include > +#include > + > +#define CORES (FixedPcdGet32 (PcdClusterCount) * \ > + FixedPcdGet32 (PcdCoreCount)) > + > +// EFI_ACPI_6_1_GIC_STRUCTURE > +#define EFI_ACPI_6_1_GICC_STRUCTURE_INIT(GicId, AcpiCpuUid, Mpidr, > Flags, \ > + PmuIrq, GicBase, GicVBase, GicHBase, GsivId, GicRBase, Efficiency) = \ > + { = \ > + EFI_ACPI_6_1_GIC, /* Type */ = \ > + sizeof (EFI_ACPI_6_1_GIC_STRUCTURE), /* Length */ = \ > + EFI_ACPI_RESERVED_WORD, /* Reserved */ = \ > + GicId, /* CPUInterfaceNumber */ = \ > + AcpiCpuUid, /* AcpiProcessorUid */ = \ > + Flags, /* Flags */ = \ > + 0, /* ParkingProtocolVersion */ = \ > + PmuIrq, /* PerformanceInterruptGsiv */= \ > + 0, /* ParkedAddress */ = \ > + GicBase, /* PhysicalBaseAddress */ = \ > + GicVBase, /* GICV */ = \ > + GicHBase, /* GICH */ = \ > + GsivId, /* VGICMaintenanceInterrupt */= \ > + GicRBase, /* GICRBaseAddress */ = \ > + Mpidr, /* MPIDR */ = \ > + Efficiency, /* ProcessorPowerEfficiencyCla= ss */ \ > + { = \ > + EFI_ACPI_RESERVED_BYTE, /* Reserved2[0] */ = \ > + EFI_ACPI_RESERVED_BYTE, /* Reserved2[1] */ = \ > + EFI_ACPI_RESERVED_BYTE /* Reserved2[2] */ = \ > + } = \ > + } > + > +// EFI_ACPI_6_1_GIC_DISTRIBUTOR_STRUCTURE > +#define EFI_ACPI_6_1_GIC_DISTRIBUTOR_INIT(GicDistHwId, GicDistBase, > \ > + GicDistVector, GicVersion) = \ > + { = \ > + EFI_ACPI_6_1_GICD, /* Type */ = \ > + sizeof (EFI_ACPI_6_1_GIC_DISTRIBUTOR_STRUCTURE), = \ > + EFI_ACPI_RESERVED_WORD, /* Reserved1 */ = \ > + GicDistHwId, /* GicId */ = \ > + GicDistBase, /* PhysicalBaseAddress */ = \ > + GicDistVector, /* SystemVectorBase */ = \ > + GicVersion, /* GicVersion */ = \ > + { = \ > + EFI_ACPI_RESERVED_BYTE, /* Reserved2[0] */ = \ > + EFI_ACPI_RESERVED_BYTE, /* Reserved2[1] */ = \ > + EFI_ACPI_RESERVED_BYTE, /* Reserved2[2] */ = \ > + } = \ > + } > + > +// EFI_ACPI_6_1_GICR_STRUCTURE > +#define EFI_ACPI_6_1_GIC_REDISTRIBUTOR_INIT(RedisRegionAddr, > RedisDiscLength) \ > + { = \ > + EFI_ACPI_6_1_GICR, /* Type */ = \ > + sizeof (EFI_ACPI_6_1_GICR_STRUCTURE), /* Length */ = \ > + EFI_ACPI_RESERVED_WORD, /* Reserved */ = \ > + RedisRegionAddr, /* DiscoveryRangeBaseAddress *= / \ > + RedisDiscLength /* DiscoveryRangeLength */ = \ > + } > + > +// EFI_ACPI_6_1_GIC_ITS_STRUCTURE > +#define EFI_ACPI_6_1_GIC_ITS_INIT(GicItsId, GicItsBase) = \ > + { = \ > + EFI_ACPI_6_1_GIC_ITS, /* Type */ = \ > + sizeof (EFI_ACPI_6_1_GIC_ITS_STRUCTURE), = \ > + EFI_ACPI_RESERVED_WORD, /* Reserved */ = \ > + GicItsId, /* GicItsId */ = \ > + GicItsBase, /* PhysicalBaseAddress */ = \ > + EFI_ACPI_RESERVED_DWORD, /* DiscoveryRangeLength */ = \ > + } > + > +// > +// Multiple APIC Description Table > +// > +#pragma pack (1) > + > +typedef struct { > + EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER Header; > + EFI_ACPI_6_1_GIC_STRUCTURE GicInterfaces[CO= RES]; > + EFI_ACPI_6_1_GIC_DISTRIBUTOR_STRUCTURE GicDistributor; > + EFI_ACPI_6_1_GICR_STRUCTURE GicRedistributor= ; > + EFI_ACPI_6_1_GIC_ITS_STRUCTURE GicIts; > +} EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE; > + > +#pragma pack () > + > +STATIC EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE Madt =3D { > + { > + ARM_ACPI_HEADER ( > + EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE, > + EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE, > + EFI_ACPI_6_1_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION > + ), > + // MADT specific fields > + 0, // LocalApicAddress > + 0, // Flags > + }, > + { > + // Format: EFI_ACPI_6_1_GICC_STRUCTURE_INIT(GicId, AcpiCpuUid, Mpidr= , > Flags, > + // PmuIrq, GicBase, GicVBas= e, > + // GicHBase, GsivId, GicRBa= se, > + // Efficiency) > + // Note: The GIC Structure of the primary CPU must be the first entr= y > + // (see note in 5.2.12.14 GICC Structure of ACPI v6.1). > + EFI_ACPI_6_1_GICC_STRUCTURE_INIT( // A75-0 > + 0, 0, GET_MPID(0x0, 0x0), EFI_ACPI_6_1_GIC_ENABLED, 23, > + FixedPcdGet32 (PcdGicDistributorBase), > + 0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */), > + EFI_ACPI_6_1_GICC_STRUCTURE_INIT( // A75-1 > + 0, 1, GET_MPID(0x0, 0x100), EFI_ACPI_6_1_GIC_ENABLED, 23, > + FixedPcdGet32 (PcdGicDistributorBase), > + 0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */), > + EFI_ACPI_6_1_GICC_STRUCTURE_INIT( // A75-2 > + 0, 2, GET_MPID(0x0, 0x200), EFI_ACPI_6_1_GIC_ENABLED, 23, > + FixedPcdGet32 (PcdGicDistributorBase), > + 0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */), > + EFI_ACPI_6_1_GICC_STRUCTURE_INIT( // A75-3 > + 0, 3, GET_MPID(0x0, 0x300), EFI_ACPI_6_1_GIC_ENABLED, 23, > + FixedPcdGet32 (PcdGicDistributorBase), > + 0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency > +*/), > + > + EFI_ACPI_6_1_GICC_STRUCTURE_INIT( // A75-4 > + 0, 4, GET_MPID(0x100, 0x00), EFI_ACPI_6_1_GIC_ENABLED, 23, > + FixedPcdGet32 (PcdGicDistributorBase), > + 0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */), > + EFI_ACPI_6_1_GICC_STRUCTURE_INIT( // A75-5 > + 0, 5, GET_MPID(0x100, 0x100), EFI_ACPI_6_1_GIC_ENABLED, 23, > + FixedPcdGet32 (PcdGicDistributorBase), > + 0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */), > + EFI_ACPI_6_1_GICC_STRUCTURE_INIT( // A75-6 > + 0, 6, GET_MPID(0x100, 0x200), EFI_ACPI_6_1_GIC_ENABLED, 23, > + FixedPcdGet32 (PcdGicDistributorBase), > + 0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency */), > + EFI_ACPI_6_1_GICC_STRUCTURE_INIT( // A75-7 > + 0, 7, GET_MPID(0x100, 0x300), EFI_ACPI_6_1_GIC_ENABLED, 23, > + FixedPcdGet32 (PcdGicDistributorBase), > + 0x2c020000, 0x2c010000, 25, 0 /* GicRBase */, 0 /* Efficiency > +*/), > + }, > + // GIC Distributor Entry > + EFI_ACPI_6_1_GIC_DISTRIBUTOR_INIT(0, FixedPcdGet32 > (PcdGicDistributorBase), > + 0, 3), > + // GIC Redistributor > + EFI_ACPI_6_1_GIC_REDISTRIBUTOR_INIT(FixedPcdGet32 > (PcdGicRedistributorsBase), > + SIZE_1MB), > + // GIC ITS > + EFI_ACPI_6_1_GIC_ITS_INIT(0, 0x30040000), }; > + > +// > +// Reference the table being generated to prevent the optimizer from > +removing // the data structure from the executable // > +VOID* CONST ReferenceAcpiTable =3D &Madt; > diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Spcr.aslc > b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Spcr.aslc > new file mode 100644 > index 0000000..5265225 > --- /dev/null > +++ b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/Spcr.aslc > @@ -0,0 +1,77 @@ > +/** @file > +* Serial Port Console Redirection Table (SPCR) > +* > +* 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 > + > +STATIC EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE Spcr =3D { > + ARM_ACPI_HEADER ( > + EFI_ACPI_6_1_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE, > + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE, > + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_REVISION > + ), > + // UINT8 InterfaceType; > + > EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERFACE_TYPE_AR > M_PL011_UART, > + // UINT8 Reserved1[3]; > + { > + EFI_ACPI_RESERVED_BYTE, > + EFI_ACPI_RESERVED_BYTE, > + EFI_ACPI_RESERVED_BYTE > + }, > + // EFI_ACPI_6_1_GENERIC_ADDRESS_STRUCTURE BaseAddress; > + ARM_GAS32 (0x7FF80000), > + // UINT8 InterruptType; > + > EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GI > C, > + // UINT8 Irq; > + 0, > + // UINT32 GlobalSystemInterrupt; > + FixedPcdGet32 (PL011UartInterrupt), > + // UINT8 BaudRate; > + > EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_BAUD_RATE_115200, > + // UINT8 Parity; > + > EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_PARITY_NO_PARITY, > + // UINT8 StopBits; > + EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_STOP_BITS_1, > + // UINT8 FlowControl; > + 0, > + // UINT8 TerminalType; > + > EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_TERMINAL_TYPE_AN > SI, > + // UINT8 Reserved2; > + EFI_ACPI_RESERVED_BYTE, > + // UINT16 PciDeviceId; > + 0xFFFF, > + // UINT16 PciVendorId; > + 0xFFFF, > + // UINT8 PciBusNumber; > + 0x00, > + // UINT8 PciDeviceNumber; > + 0x00, > + // UINT8 PciFunctionNumber; > + 0x00, > + // UINT32 PciFlags; > + 0x00000000, > + // UINT8 PciSegment; > + 0x00, > + // UINT32 Reserved3; > + EFI_ACPI_RESERVED_DWORD > +}; > + > +// > +// Reference the table being generated to prevent the optimizer from > +removing the // data structure from the executable // > +VOID* CONST ReferenceAcpiTable =3D &Spcr; > diff --git a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c > b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c > index ff30a42..39de49e 100644 > --- a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c > +++ b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c > @@ -12,6 +12,7 @@ > * > **/ > > +#include > #include > > EFI_STATUS > @@ -28,6 +29,12 @@ ArmSgiPkgEntryPoint ( { > EFI_STATUS Status; > > + Status =3D LocateAndInstallAcpiFromFv (&gSgi575AcpiTablesiFileGuid); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a: Failed to install ACPI tables\n", > __FUNCTION__)); > + return Status; > + } > + > if (FeaturePcdGet (PcdVirtioSupported)) { > Status =3D InitVirtioBlockIo (ImageHandle); > if (EFI_ERROR (Status)) { > diff --git a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf > b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf > index 6aa286f..51ad22f 100644 > --- a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf > +++ b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf > @@ -23,13 +23,19 @@ > VirtioBlockIo.c > > [Packages] > + EmbeddedPkg/EmbeddedPkg.dec > MdePkg/MdePkg.dec > OvmfPkg/OvmfPkg.dec > + Platform/ARM/SgiPkg/SgiPlatform.dec > > [LibraryClasses] > + AcpiLib > UefiDriverEntryPoint > VirtioMmioDeviceLib > > +[Guids] > + gSgi575AcpiTablesiFileGuid > + > [FeaturePcd] > gArmSgiTokenSpaceGuid.PcdVirtioSupported > > diff --git a/Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h > b/Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h > new file mode 100644 > index 0000000..870ffe9 > --- /dev/null > +++ b/Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h > @@ -0,0 +1,41 @@ > +/** @file > +* > +* 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. > +* > +**/ > + > +#ifndef __SGI_ACPI_HEADER__ > +#define __SGI_ACPI_HEADER__ > + > +// > +// ACPI table information used to initialize tables. > +// > +#define EFI_ACPI_ARM_OEM_ID 'A','R','M','L','T','D' // OEMID= 6 bytes > long > +#define EFI_ACPI_ARM_OEM_TABLE_ID > SIGNATURE_64('E','N','T','P','L','A','T','F') // OEM table id 8 bytes lon= g > +#define EFI_ACPI_ARM_OEM_REVISION 0x20140727 > +#define EFI_ACPI_ARM_CREATOR_ID SIGNATURE_32('A','R','M',' ') > +#define EFI_ACPI_ARM_CREATOR_REVISION 0x00000099 > + > +// A macro to initialise the common header part of EFI ACPI tables as > +defined by // EFI_ACPI_DESCRIPTION_HEADER structure. > +#define ARM_ACPI_HEADER(Signature, Type, Revision) { \ > + Signature, /* UINT32 Signature */ \ > + sizeof (Type), /* UINT32 Length */ \ > + Revision, /* UINT8 Revision */ \ > + 0, /* UINT8 Checksum */ \ > + { EFI_ACPI_ARM_OEM_ID }, /* UINT8 OemId[6] */ \ > + EFI_ACPI_ARM_OEM_TABLE_ID, /* UINT64 OemTableId */ \ > + EFI_ACPI_ARM_OEM_REVISION, /* UINT32 OemRevision */ \ > + EFI_ACPI_ARM_CREATOR_ID, /* UINT32 CreatorId */ \ > + EFI_ACPI_ARM_CREATOR_REVISION /* UINT32 CreatorRevision */ \ > + } > + > +#endif /* __SGI_ACPI_HEADER__ */ > diff --git a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf > b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf > index dea1a42..853f56e 100644 > --- a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf > +++ b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf > @@ -42,8 +42,12 @@ > AArch64/Helper.S | GCC > > [FixedPcd] > + gArmPlatformTokenSpaceGuid.PcdClusterCount > + gArmPlatformTokenSpaceGuid.PcdCoreCount > gArmTokenSpaceGuid.PcdSystemMemoryBase > gArmTokenSpaceGuid.PcdSystemMemorySize > + gArmTokenSpaceGuid.PcdGicDistributorBase > + gArmTokenSpaceGuid.PcdGicRedistributorsBase > gArmTokenSpaceGuid.PcdFvBaseAddress > gArmTokenSpaceGuid.PcdArmPrimaryCore > gArmTokenSpaceGuid.PcdArmPrimaryCoreMask > -- > 2.7.4 > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.