From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-db5eur03on0625.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0a::625]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id AC0CE21A18AAA for ; Tue, 18 Apr 2017 03:07:37 -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; bh=dZynKCEY88h+nvkN8uRfeWky9D+5JjITMzyYu9b1CHI=; b=oB2yvLzsnj1UeVU9+jQ91LXYFXB1firejPg1vHD3CA1blhF/fIzIzEsl04giNGF/Dknnt342AvrGTYO1h6PwyP3/QeFVKKs16pJhOHSPEK7/JYyuoh1qt65oVIarRIiF3uvhx9prrduEq+AZhg35yrAqqF2h/cuktuQtr8cH9so= Received: from AM5PR0801MB1955.eurprd08.prod.outlook.com (10.168.157.151) by AM5PR0801MB2083.eurprd08.prod.outlook.com (10.168.158.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.10; Tue, 18 Apr 2017 10:07:35 +0000 Received: from AM5PR0801MB1955.eurprd08.prod.outlook.com ([10.168.157.151]) by AM5PR0801MB1955.eurprd08.prod.outlook.com ([10.168.157.151]) with mapi id 15.01.1034.015; Tue, 18 Apr 2017 10:07:35 +0000 From: Alexei Fedorov To: "ard.biesheuvel@linaro.org" , "edk2-devel@lists.01.org" , "leif.lindholm@linaro.org" CC: Lorenzo Pieralisi , "liming.gao@intel.com" , Evan Lloyd Thread-Topic: [edk2] [PATCH] MdePkg/IndustryStandard: add definitions for ACPI 6.0 IORT Thread-Index: AQHStHQ+ZVrplK1C202XW7eRC9WzeqHK7OTA Date: Tue, 18 Apr 2017 10:07:35 +0000 Message-ID: References: <20170413163705.26316-1-ard.biesheuvel@linaro.org> In-Reply-To: <20170413163705.26316-1-ard.biesheuvel@linaro.org> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; x-originating-ip: [217.140.96.140] x-microsoft-exchange-diagnostics: 1; AM5PR0801MB2083; 7:vlwdpYeOlHAgpgo4rntlDDBBVI3z0KuziymSoUF4U5TodNsmcVpNnrDvzeM9mVDFqUJAkYx6jbPgwP22f7G8XoSjkh+iRNExp9C7XGpjK897aCVbdy1FjGUNRgdsRxOxfFnOckItIOhtMilfYkzrFoe8TTUY8trcLQG2a3ymubO2HZPTGoKr2Ap3t7xtdcfCoi7HTpUDG0vH7vJKr4C13VaCH8hKSD8oL1RsCn90ASzcIQNgtUXLz45Qrzg5AEnsCWt5th2RBNo+v+p5Y2iWcA5i9s5QflG2g/cVuy4Gt6Lnep5y5/rj0hKft6DBUMczo7RjAhCpFMzL02zWtjfouA== x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-ms-office365-filtering-correlation-id: ca673a9d-e26e-4192-66e5-08d48642bc73 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081); SRVR:AM5PR0801MB2083; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(162533806227266)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(6055026)(6041248)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(20161123562025)(20161123564025)(6072148); SRVR:AM5PR0801MB2083; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0801MB2083; x-forefront-prvs: 028166BF91 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39450400003)(39840400002)(39850400002)(39860400002)(39400400002)(39410400002)(40434004)(7696004)(6116002)(38730400002)(25786009)(2950100002)(15188155005)(53376002)(16799955002)(2900100001)(102836003)(54356999)(8676002)(3660700001)(3846002)(74316002)(189998001)(3280700002)(66066001)(7736002)(19627405001)(50986999)(81166006)(76176999)(4326008)(7906003)(2501003)(77096006)(8936002)(6436002)(966004)(606005)(5660300001)(54906002)(54896002)(6306002)(33656002)(5890100001)(236005)(6246003)(229853002)(122556002)(9686003)(53936002)(55016002)(99286003)(6606003)(86362001)(2201001)(6506006); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0801MB2083; H:AM5PR0801MB1955.eurprd08.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Apr 2017 10:07:35.2284 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB2083 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 Subject: Re: [PATCH] MdePkg/IndustryStandard: add definitions for ACPI 6.0 IORT X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Apr 2017 10:07:38 -0000 Content-Language: en-GB Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Aren't comments like // // Table header // , // // Definition for ID mapping table shared by all node types // etc. not allowed according to EDK II C Coding Standards Specification? 6.2.3 Avoid comments where the opening comment characters are alone on a li= ne. // // VIOLATION: Horror Vacui // ________________________________ From: edk2-devel on behalf of Ard Biesheu= vel Sent: 13 April 2017 17:37 To: edk2-devel@lists.01.org; leif.lindholm@linaro.org Cc: Lorenzo Pieralisi; liming.gao@intel.com; ard.biesheuvel@linaro.org Subject: [edk2] [PATCH] MdePkg/IndustryStandard: add definitions for ACPI 6= .0 IORT This adds #defines and struct typedefs for the various node types in the ACPI 6.0 IO Remapping Table (IORT). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- MdePkg/Include/IndustryStandard/IoRemappingTable.h | 187 +++++++++++++++++= +++ 1 file changed, 187 insertions(+) diff --git a/MdePkg/Include/IndustryStandard/IoRemappingTable.h b/MdePkg/In= clude/IndustryStandard/IoRemappingTable.h new file mode 100644 index 000000000000..674cb611961d --- /dev/null +++ b/MdePkg/Include/IndustryStandard/IoRemappingTable.h @@ -0,0 +1,187 @@ +/** @file + ACPI IO Remapping Table (IORT) as specified in ARM spec DEN0049B + + Copyright (c) 2017, Linaro Limited. All rights reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BS= D License + which accompanies this distribution. The full text of the license may b= e 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 IMP= LIED. +**/ + +#ifndef __IO_REMAPPING_TABLE_H__ +#define __IO_REMAPPING_TABLE_H__ + +#include + +#define EFI_ACPI_IO_REMAPPING_TABLE_REVISION 0x0 + +#define EFI_ACPI_IORT_TYPE_ITS_GROUP 0x0 +#define EFI_ACPI_IORT_TYPE_NAMED_COMP 0x1 +#define EFI_ACPI_IORT_TYPE_ROOT_COMPLEX 0x2 +#define EFI_ACPI_IORT_TYPE_SMMUv1v2 0x3 +#define EFI_ACPI_IORT_TYPE_SMMUv3 0x4 + +#define EFI_ACPI_IORT_MEM_ACCESS_PROP_CCA BIT0 + +#define EFI_ACPI_IORT_MEM_ACCESS_PROP_AH_TR BIT0 +#define EFI_ACPI_IORT_MEM_ACCESS_PROP_AH_WA BIT1 +#define EFI_ACPI_IORT_MEM_ACCESS_PROP_AH_RA BIT2 +#define EFI_ACPI_IORT_MEM_ACCESS_PROP_AH_AHO BIT3 + +#define EFI_ACPI_IORT_MEM_ACCESS_FLAGS_CPM BIT0 +#define EFI_ACPI_IORT_MEM_ACCESS_FLAGS_DACS BIT1 + +#define EFI_ACPI_IORT_SMMUv1v2_MODEL_v1 0x0 +#define EFI_ACPI_IORT_SMMUv1v2_MODEL_v2 0x1 +#define EFI_ACPI_IORT_SMMUv1v2_MODEL_MMU400 0x2 +#define EFI_ACPI_IORT_SMMUv1v2_MODEL_MMU500 0x3 + +#define EFI_ACPI_IORT_SMMUv1v2_FLAG_DVM BIT0 +#define EFI_ACPI_IORT_SMMUv1v2_FLAG_COH_WALK BIT1 + +#define EFI_ACPI_IORT_SMMUv1v2_INT_FLAG_LEVEL 0x0 +#define EFI_ACPI_IORT_SMMUv1v2_INT_FLAG_EDGE 0x1 + +#define EFI_ACPI_IORT_SMMUv3_FLAG_COHAC_OVERRIDE BIT0 +#define EFI_ACPI_IORT_SMMUv3_FLAG_HTTU_OVERRIDE BIT1 + +#define EFI_ACPI_IORT_ROOT_COMPLEX_ATS_UNSUPPORTED 0x0 +#define EFI_ACPI_IORT_ROOT_COMPLEX_ATS_SUPPORTED 0x1 + +#define EFI_ACPI_IORT_ID_MAPPING_FLAGS_SINGLE BIT0 + +#pragma pack(1) + +// +// Table header +// +typedef struct { + EFI_ACPI_DESCRIPTION_HEADER Header; + INT32 NumNodes; + INT32 NodeOffset; + INT32 Reserved; +} EFI_ACPI_6_0_IO_REMAPPING_TABLE; + +// +// Definition for ID mapping table shared by all node types +// +typedef struct { + UINT32 InputBase; + UINT32 NumIds; + UINT32 OutputBase; + UINT32 OutputReference; + UINT32 Flags; +} EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE; + +// +// Header definition shared by all node types +// +typedef struct { + UINT8 Type; + UINT16 Length; + UINT8 Revision; + UINT32 Reserved; + UINT32 NumIdMappings; + UINT32 IdReference; +} EFI_ACPI_6_0_IO_REMAPPING_NODE; + +// +// Node type 0: ITS node +// +typedef struct { + EFI_ACPI_6_0_IO_REMAPPING_NODE Node; + + UINT32 NumIts; +/* + UINT32 ItsIdentifiers[0]; +*/ +} EFI_ACPI_6_0_IO_REMAPPING_ITS_NODE; + +// +// Node type 1: root complex node +// +typedef struct { + EFI_ACPI_6_0_IO_REMAPPING_NODE Node; + + UINT32 CacheCoherent; + UINT8 AllocationHints; + UINT16 Reserved; + UINT8 MemoryAccessFlags; + + UINT32 AtsAttribute; + UINT32 PciSegmentNumber; +} EFI_ACPI_6_0_IO_REMAPPING_RC_NODE; + +// +// Node type 2: named component node +// +typedef struct { + EFI_ACPI_6_0_IO_REMAPPING_NODE Node; + + UINT32 Flags; + UINT32 CacheCoherent; + UINT8 AllocationHints; + UINT16 Reserved; + UINT8 MemoryAccessFlags; + UINT8 AddressSizeLimit; +/* + CHAR8 ObjectName[0]; +*/ +} EFI_ACPI_6_0_IO_REMAPPING_NAMED_COMP_NODE; + +// +// Node type 3: SMMUv1 or SMMUv2 node +// +typedef struct { + UINT32 Interrupt; + UINT32 InterruptFlags; +} EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT; + +typedef struct { + EFI_ACPI_6_0_IO_REMAPPING_NODE Node; + + UINT64 Base; + UINT64 Span; + UINT32 Model; + UINT32 Flags; + UINT32 GlobalInterruptArrayRef; + UINT32 NumContextInterrupts; + UINT32 ContextInterruptArrayRef; + UINT32 NumPmuInterrupts; + UINT32 PmuInterruptArrayRef; + + UINT32 SMMU_NSgIrpt; + UINT32 SMMU_NSgIrptFlags; + UINT32 SMMU_NSgCfgIrpt; + UINT32 SMMU_NSgCfgIrptFlags; + +/* + EFI_ACPI_6_0_IO_REMAPPING_SMMU_CTX_INT ContextInterrupt[0]; + EFI_ACPI_6_0_IO_REMAPPING_SMMU_CTX_INT PmuInterrupt[0]; +*/ +} EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE; + +// +// Node type 4: SMMUv4 node +// +typedef struct { + EFI_ACPI_6_0_IO_REMAPPING_NODE Node; + + UINT64 Base; + UINT32 Flags; + UINT32 Reserved; + UINT64 VatosAddress; + UINT32 Model; + UINT32 Event; + UINT32 Pri; + UINT32 Gerr; + UINT32 Sync; +} EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE; + +#pragma pack() + +#endif -- 2.9.3 _______________________________________________ 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.