From nobody Sat Nov 2 12:20:30 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1488480421218351.0111384727509; Thu, 2 Mar 2017 10:47:01 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id CF1DC82208; Thu, 2 Mar 2017 10:46:50 -0800 (PST) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0615.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe4a::615]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 54DB9821FA for ; Thu, 2 Mar 2017 10:46:49 -0800 (PST) Received: from leduran-Precision-WorkStation-T5400.amd.com (165.204.77.1) by CY4PR12MB1239.namprd12.prod.outlook.com (10.168.167.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.933.12; Thu, 2 Mar 2017 18:46:45 +0000 X-Original-To: edk2-devel@ml01.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=QLMzMeJwMYNtKelP846Opvv9Z+W91y0llTq6FJxTsVM=; b=uqingo9adfbUjLK4wSd0agAF+MPNmk+YbiCK0SRKosJO3iK3xujnuVVXeyVQiBpRLTVZ8jz5+Soz4KdoLr9yF8RjueL6KWtZwvTKrBGhs/btomed1EFLUsLqnM2CGEinlfsq+6kKBu+J1nPf694scKz5myfBLBMhUjugEM0++b4= Authentication-Results: ml01.01.org; dkim=none (message not signed) header.d=none;ml01.01.org; dmarc=none action=none header.from=amd.com; From: Leo Duran To: Date: Thu, 2 Mar 2017 12:46:31 -0600 Message-ID: <1488480396-32358-2-git-send-email-leo.duran@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488480396-32358-1-git-send-email-leo.duran@amd.com> References: <1488480396-32358-1-git-send-email-leo.duran@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: DM5PR17CA0027.namprd17.prod.outlook.com (10.173.128.141) To CY4PR12MB1239.namprd12.prod.outlook.com (10.168.167.14) X-MS-Office365-Filtering-Correlation-Id: 25e4e75e-d710-45d7-b0ce-08d4619c7a31 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081); SRVR:CY4PR12MB1239; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 3:u72p4QPKDQew+AEAOWqmc+vXyoxiMO/hyW+k76+RBys/4bGVsvHE0ACinjjY8T+bACXFR79wUuyV3yUAmKFQTZ72t31z6fdX/42DFo+VZhO2oP/rpQdWMx9mlft1StguKDQUR8ovJbTuLG5IyKhbOynMmE4Hhfbufk9lHY0vILHMB26KBN+kHHcFBA3CRAcBWs57UpMr9XFOeJtv1TJAUpYua2aGvXhp/iqm5r77sHzdEbf69JqKooMQB1DgNu7L15YLm4oAtUuJX9AfjA3c/Ldns4K2UgpILYMA8lTFCTM=; 25:6ggacL+q37ET9g1vjZXm/de3K/UZNK1ErKNisjICPEiyS50YwSGWIlRlQfE7vus6e9AlMcReZ1VxLS5F7n1XK32l8sJsEsMliipD2ut4ixe4rggWaTNZuoYq8PPpy5pFlEAVg5mDIRB/KhJGZ0wsk3WQYf7KS49aGKy5RUhqT0D+aTQ9D46ohVFoo4aL5XTYwSRIWMDUk+T4vHahFheRVzCly+MxNi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exchange-Antispam-Report-Test: UriScan:(767451399110)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123564025)(20161123562025)(20161123560025)(20161123555025)(20161123558025)(6072148); SRVR:CY4PR12MB1239; BCL:0; PCL:0; RULEID:; SRVR:CY4PR12MB1239; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 4:1v5eN9WTkli4suKZ2rMu3etjshUslt3ASBS3d8gPfwRbXFvm2fh1YRPjanVXVufHzvDbugftdXJpWvdFowHt5QtMzOAO23P69VnNQUnNq3uYDHXKFrnrfBXum7v1BTNbD2pVoSgKqJUpGD9UTxgigEl6eKWYrxNEQmE72lK5iMw+alFkc74+vCDRBZ4PIudrX3+I/8UxmJjD1rcMzHRm/C+xaUW0Zb04elIt8YIhZNpYjT3XQU+u3xaMgppUEtakCoMzWl5OkqUuR5KonP+yf+EWfzwlnwuwW1QapuPSc5EVooF77epURPFy4Emk7saq3vz24BFmhjh5UY0LW6Sb+Zx8gM32yTlW/y943BsHIqSOr4UBu2rF/Clx2BA45DorWIifZL6xvqElmcm79JiKr2YKoUfB9kfQiE87Ve4sAXtYUl4QUNeaFufrMSqOtTshemn0XIoTqVaW6xrzOnpF1SNraLgbVKU39W1KKdZcQBdSatWGx7RzHu3jI2FuHFc4PlIZIIvp8dB+0kx08g+KjQTeYWvZcSQFhPnfwlKUvpu5uvjsaBPKtacE/SbPm3NC0N0nzka25BNa0odRj6cwDBdBJVkb0bHc6ch/54skpifeQ3Y+KqaKq74fj9a4XFRRMhwDE8B3m+qFkLsp8rbg6R5nwYMQrdvvBtrx05gYX65NpK53vNrb9xJzM7mdCW+0Ddfdp9AnwCQHkd8Xz2/OoA== X-Forefront-PRVS: 023495660C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(979002)(6029001)(6009001)(7916002)(39850400002)(39450400003)(39410400002)(39860400002)(39840400002)(76176999)(6486002)(2906002)(50986999)(25786008)(6116002)(189998001)(6666003)(7736002)(36756003)(6916009)(2950100002)(3846002)(305945005)(5660300001)(66066001)(50226002)(42186005)(53416004)(47776003)(16799955002)(4326008)(48376002)(15188155005)(50466002)(966004)(33646002)(81166006)(92566002)(8676002)(6306002)(53376002)(110136004)(38730400002)(5003940100001)(86362001)(54906002)(53936002)(2351001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1239; H:leduran-Precision-WorkStation-T5400.amd.com; FPR:; SPF:None; MLV:ovrnspm; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR12MB1239; 23:/xBBg1sOze4s2Q+i2Hd8ZT8ek5XjYntttfz6tSt6q?= =?us-ascii?Q?qbbwES+Tff7BJoIq86ZaASlGgz2+iTCwx6BuOZ5OYsa8HAyp2nCaUY05jmqD?= =?us-ascii?Q?CgTltpFW3rRui+QlSHY9HNmjaD8OM8/OA+trwrkSezZIZ7au69s7mn3vFD1s?= =?us-ascii?Q?GeR3ERjcg2gHJft06Be7MSmiqFLW8dbPRgKtrs+6gaGH32sDg35VlneyIhcE?= =?us-ascii?Q?fkQU4o/lzF+qY5bl0SQhQLLJwwUYEoXFqGTjQRkkFvvUl/a2bY/7YDj0Kv7Y?= =?us-ascii?Q?KP0Tj0A3Pv7b2pCeOBWOomdrTtRFRBmneYQMgJAef896Xu6hYqNG4Oghbum/?= =?us-ascii?Q?WX7SCfFJKuAjnuM3SJfxjF1uY5fqLMnhJHRPbMe2T37z1ZnWXBYsqb2o81Fr?= =?us-ascii?Q?M0/KOTJR+1qd/LoQEuFR1y0pHihCi3rQ0yxQLFVKhqHvt3itzD9YxSLIyv3T?= =?us-ascii?Q?sS+UnJHDBq89NeZ05dFmUEniQmcQyIN8jH96Qv8RAa1N1Hs7QPslFjCbCwUq?= =?us-ascii?Q?IHdnmqWKEcPImVSFFLMzU6/nC3W3TmJ666aZtrBngjMx+yNPI/hmeR/Xlqil?= =?us-ascii?Q?igElacxnUquU/SfBxOpeMdRNzxRaxIm7n5exIgV6rUhKDJ4/zoQd0CPfB13l?= =?us-ascii?Q?enx63DhwP9zubau8dyUNKnOwTMV/u2gsMbScXKXE3uPtxGN0gRXxOqWJITl2?= =?us-ascii?Q?YjMd8UkwpfjUq+adssFzZgWjXwj4jNzRDS4YT/CTC93SAirNllUrTnjN2r6d?= =?us-ascii?Q?UdsB4z5BraZVy/vXK4IJez1jh1M7UIVRAabTKfe8R2gIe8sI84zFfUNH7cPD?= =?us-ascii?Q?qqk884Z2nqKdwM8LhXQT+lQ7Z3zlyku1xOkv4XSjcHUyLqXNoEyYhH/dbfAA?= =?us-ascii?Q?S++u56cNUEPQtHRMu6gK86GA3Aj+YxbePrjc2URDx2pqFlvQZqglbPUNuh0+?= =?us-ascii?Q?kOwsB6y/N3TdWGAbOYozyyCw/wNvFFUfvk03iaOPZL+LSUg7h5W/FYZvE2wK?= =?us-ascii?Q?1Wf/9+wvtaePJ9hAgvObgkx5OoaNE+EvQdXSDvPcGTAcNp7WAYV7sV5S/dJH?= =?us-ascii?Q?zLRuFG1UIOA66CBSzHD4iEUCnDkroi0CcMah0ZME5a5wwoIYOFN+XRkaDUUS?= =?us-ascii?Q?CF3JvrY8EUTQXEf+HGOc5QVZngeq6z1vjL122qxIUcD9BUNPz1LqHmo1us0X?= =?us-ascii?Q?BHXNC29JZYae9VixyCFweG1sd0BzYbf7aBexwUHjLy6MDMA2gnE9olL0ikVf?= =?us-ascii?Q?rbV63IZHmCHXnWnSDeiF4Tk0TBsysl35pLGQNvP5GDA9Ywb7iQE3TdX41R+D?= =?us-ascii?B?UT09?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 6:TncItZQbX2QXF09qxf9Daa5XPi8vXRo0ixhEnCyAN+h77wiecdzq0ws6msXH+jAaTXoMOm+xaH7+7+/d8N+Qtena0wfmUqg1g6sqEoRX0gLMK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uwqFpRxwRPREMU2WdVUREQVjhip2CfyrDNx0bHUH1vgqEqyWXE+9nJKjIprokosynuiKYLjXm1e6TctVyfTKauBRvzjTvoPW4MU6NpkaCARscef3l9TI6rXuM5370bGy7rZAGlw3/sw1bxj3z8m3t7bknjFSDcchaBDtzX6ougixlwkOsmLPuTby X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2017 18:46:45.6760 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1239 Subject: [edk2] [PATCH v4 1/6] MdeModulePkg: Add DxeBmDmaLib (BmDmaLib class) library X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Feng Tian , Leo Duran , Star Zeng Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch provides an abstraction layer for Bus-master DMA operations as currently implemented by the PciHostBridgeDxe driver. The intent is to then allow override of this library as may be required by specific hardware implementations, such as AMD's Secure Encrypted Virtualization (SEV). This new BmDmaLib class library is cloned from the existing DmaLib with an additional DmaAbove4GB (BOOLEAN) parameter for the Map and Allocate interfaces, so that decisions can be made about the need to allocate DMA buffers below the 4GB boundary. Cc: Feng Tian Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Leo Duran --- MdeModulePkg/Include/Library/BmDmaLib.h | 161 +++++++++++ MdeModulePkg/Library/DxeBmDmaLib/DxeBmDmaLib.c | 351 +++++++++++++++++++= ++++ MdeModulePkg/Library/DxeBmDmaLib/DxeBmDmaLib.inf | 41 +++ MdeModulePkg/MdeModulePkg.dsc | 2 + 4 files changed, 555 insertions(+) create mode 100644 MdeModulePkg/Include/Library/BmDmaLib.h create mode 100644 MdeModulePkg/Library/DxeBmDmaLib/DxeBmDmaLib.c create mode 100644 MdeModulePkg/Library/DxeBmDmaLib/DxeBmDmaLib.inf diff --git a/MdeModulePkg/Include/Library/BmDmaLib.h b/MdeModulePkg/Include= /Library/BmDmaLib.h new file mode 100644 index 0000000..070340c --- /dev/null +++ b/MdeModulePkg/Include/Library/BmDmaLib.h @@ -0,0 +1,161 @@ +/** @file + DMA abstraction library APIs. Based on PCI IO protocol DMA abstractions. + + Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.
+ Copyright (c) 2017, AMD Inc. All rights reserved.
+ + DMA Bus Master Read Operation: + Call BmDmaMap() for DmaOperationBusMasterRead. + Program the DMA Bus Master with the DeviceAddress returned by BmDmaMap= (). + Start the DMA Bus Master. + Wait for DMA Bus Master to complete the read operation. + Call BmDmaUnmap(). + + DMA Bus Master Write Operation: + Call BmDmaMap() for DmaOperationBusMasterWrite. + Program the DMA Bus Master with the DeviceAddress returned by BmDmaMap= (). + Start the DMA Bus Master. + Wait for DMA Bus Master to complete the write operation. + Call BmDmaUnmap(). + + DMA Bus Master Common Buffer Operation: + Call BmDmaAllocateBuffer() to allocate a common buffer. + Call BmDmaMap() for DmaOperationBusMasterCommonBuffer. + Program the DMA Bus Master with the DeviceAddress returned by BmDmaMap= (). + The common buffer can now be accessed equally by the processor and the= DMA bus master. + Call BmDmaUnmap(). + Call BmDmaFreeBuffer(). + + 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. + + Derived from: + EmbeddedPkg/Include/Library/DmaLib.h + +**/ + +#ifndef __BM_DMA_LIB_H__ +#define __BM_DMA_LIB_H__ + + +typedef enum { + /// + /// A read operation from system memory by a bus master. + /// + DmaOperationBusMasterRead, + /// + /// A write operation from system memory by a bus master. + /// + DmaOperationBusMasterWrite, + /// + /// Provides both read and write access to system memory by both the pro= cessor and a + /// bus master. The buffer is coherent from both the processor's and the= bus master's point of view. + /// + DmaOperationBusMasterCommonBuffer, + DmaOperationBusMasterMaximum +} BM_DMA_OPERATION; + + +/** + Provides the DMA controller-specific addresses needed to access system m= emory. + + Operation is relative to the DMA bus master. + + @param DmaAbove4GB Indicates capability of DMA operations abo= ve 4GB. + @param Operation Indicates if the bus master is going to re= ad or write to system memory. + @param HostAddress The system memory address to map to the DM= A controller. + @param NumberOfBytes On input the number of bytes to map. On ou= tput the number of bytes + that were mapped. + @param DeviceAddress The resulting map address for the bus mast= er controller to use to + access the hosts HostAddress. + @param Mapping A resulting value to pass to BmDmaUnmap(). + + @retval EFI_SUCCESS The range was mapped for the returned Numb= erOfBytes. + @retval EFI_UNSUPPORTED The HostAddress cannot be mapped as a comm= on buffer. + @retval EFI_INVALID_PARAMETER One or more parameters are invalid. + @retval EFI_OUT_OF_RESOURCES The request could not be completed due to = a lack of resources. + @retval EFI_DEVICE_ERROR The system hardware could not map the requ= ested address. + +**/ +EFI_STATUS +EFIAPI +BmDmaMap ( + IN BOOLEAN DmaAbove4GB, + IN BM_DMA_OPERATION Operation, + IN VOID *HostAddress, + IN OUT UINTN *NumberOfBytes, + OUT PHYSICAL_ADDRESS *DeviceAddress, + OUT VOID **Mapping + ); + + +/** + Completes the DmaOperationBusMasterRead/Write/CommonBuffer operation + and releases any corresponding resources. + + @param Mapping The mapping value returned from BmDmaMap(). + + @retval EFI_SUCCESS The range was unmapped. + @retval EFI_DEVICE_ERROR The data was not committed to the target s= ystem memory. + +**/ +EFI_STATUS +EFIAPI +BmDmaUnmap ( + IN VOID *Mapping + ); + + +/** + Allocates pages that are suitable for a BmDmaMap() of type DmaOperationB= usMasterCommonBuffer. + + @param DmaAbove4GB Indicates capability of DMA operations abo= ve 4GB. + @param MemoryType The type of memory to allocate: EfiBootSer= vicesData or + EfiRuntimeServicesData. + @param Pages The number of pages to allocate. + @param HostAddress A pointer to store the base system memory = address of the + allocated range. + + @retval EFI_SUCCESS The requested memory pages were allocated. + @retval EFI_UNSUPPORTED Attributes is unsupported. The only legal = attribute bits are + MEMORY_WRITE_COMBINE and MEMORY_CACHED. + @retval EFI_INVALID_PARAMETER One or more parameters are invalid. + @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated. + +**/ +EFI_STATUS +EFIAPI +BmDmaAllocateBuffer ( + IN BOOLEAN DmaAbove4GB, + IN EFI_MEMORY_TYPE MemoryType, + IN UINTN Pages, + OUT VOID **HostAddress + ); + + +/** + Frees memory that was allocated with BmDmaAllocateBuffer(). + + @param HostAddress The base system memory address of the allo= cated range. + @param Pages The number of pages to free. + + @retval EFI_SUCCESS The requested memory pages were freed. + @retval EFI_INVALID_PARAMETER The memory range specified by HostAddress = and Pages + was not allocated with BmDmaAllocateBuffer= (). + +**/ +EFI_STATUS +EFIAPI +BmDmaFreeBuffer ( + IN VOID *HostAddress, + IN UINTN Pages + ); + + +#endif + diff --git a/MdeModulePkg/Library/DxeBmDmaLib/DxeBmDmaLib.c b/MdeModulePkg/= Library/DxeBmDmaLib/DxeBmDmaLib.c new file mode 100644 index 0000000..a342c9e --- /dev/null +++ b/MdeModulePkg/Library/DxeBmDmaLib/DxeBmDmaLib.c @@ -0,0 +1,351 @@ +/** @file + DMA abstraction library APIs. Based on PCI IO protocol DMA abstractions. + + Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.
+ Copyright (c) 2017, AMD Inc. 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. + + Derived from: + MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c + +**/ + +#include +#include +#include +#include +#include +#include +#include +#include + + +#define FORCE_BELOW_4GB_TRUE TRUE +#define FORCE_BELOW_4GB_FALSE FALSE +#define NO_MAPPING (VOID *) (UINTN) -1 + + +typedef struct { + BM_DMA_OPERATION Operation; + UINTN NumberOfBytes; + UINTN NumberOfPages; + EFI_PHYSICAL_ADDRESS HostAddress; + EFI_PHYSICAL_ADDRESS MappedHostAddress; +} MAP_INFO; + + +EFI_STATUS +AllocateBounceBuffer ( + IN BOOLEAN ForceBelow4GB, + IN BM_DMA_OPERATION Operation, + IN EFI_PHYSICAL_ADDRESS HostAddress, + IN OUT UINTN *NumberOfBytes, + OUT PHYSICAL_ADDRESS *DeviceAddress, + OUT VOID **Mapping + ) +{ + EFI_STATUS Status; + MAP_INFO *MapInfo; + EFI_ALLOCATE_TYPE AllocateType; + + // + // Allocate a MAP_INFO structure to remember the mapping when Unmap() is + // called later. + // + MapInfo =3D AllocatePool (sizeof (MAP_INFO)); + if (MapInfo =3D=3D NULL) { + *NumberOfBytes =3D 0; + return EFI_OUT_OF_RESOURCES; + } + + // + // Initialize the MAP_INFO structure + // + MapInfo->Operation =3D Operation; + MapInfo->NumberOfBytes =3D *NumberOfBytes; + MapInfo->NumberOfPages =3D EFI_SIZE_TO_PAGES (MapInfo->NumberOfBytes); + MapInfo->HostAddress =3D HostAddress; + + if (ForceBelow4GB) { + // + // Limit allocations to memory below 4GB + // + AllocateType =3D AllocateMaxAddress; + MapInfo->MappedHostAddress =3D SIZE_4GB - 1; + } else { + AllocateType =3D AllocateAnyPages; + } + + // + // Allocate DMA bounce buffer + // + Status =3D gBS->AllocatePages ( + AllocateType, + EfiBootServicesData, + MapInfo->NumberOfPages, + &MapInfo->MappedHostAddress + ); + + if (EFI_ERROR (Status)) { + FreePool (MapInfo); + *NumberOfBytes =3D 0; + return Status; + } + + // + // If this is a read operation from the Bus Master's point of view, + // then copy the contents of the real buffer into the mapped buffer + // so the Bus Master can read the contents of the real buffer. + // + if (Operation =3D=3D DmaOperationBusMasterRead) { + CopyMem ( + (VOID *) (UINTN) MapInfo->MappedHostAddress, + (VOID *) (UINTN) MapInfo->HostAddress, + MapInfo->NumberOfBytes + ); + } + + // + // The DeviceAddress is the address of the mapped buffer + // + *DeviceAddress =3D MapInfo->MappedHostAddress; + + // + // Return a pointer to the MAP_INFO structure in Mapping + // + *Mapping =3D MapInfo; + + return EFI_SUCCESS; +} + + +/** + Provides the DMA controller-specific addresses needed to access system m= emory. + + Operation is relative to the DMA bus master. + + @param DmaAbove4GB Indicates capability of DMA operations abo= ve 4GB. + @param Operation Indicates if the bus master is going to re= ad or write to system memory. + @param HostAddress The system memory address to map to the DM= A controller. + @param NumberOfBytes On input the number of bytes to map. On ou= tput the number of bytes + that were mapped. + @param DeviceAddress The resulting map address for the bus mast= er controller to use to + access the hosts HostAddress. + @param Mapping A resulting value to pass to BmDmaUnmap(). + + @retval EFI_SUCCESS The range was mapped for the returned Numb= erOfBytes. + @retval EFI_UNSUPPORTED The HostAddress cannot be mapped as a comm= on buffer. + @retval EFI_INVALID_PARAMETER One or more parameters are invalid. + @retval EFI_OUT_OF_RESOURCES The request could not be completed due to = a lack of resources. + @retval EFI_DEVICE_ERROR The system hardware could not map the requ= ested address. + +**/ +EFI_STATUS +EFIAPI +BmDmaMap ( + IN BOOLEAN DmaAbove4GB, + IN BM_DMA_OPERATION Operation, + IN VOID *HostAddress, + IN OUT UINTN *NumberOfBytes, + OUT PHYSICAL_ADDRESS *DeviceAddress, + OUT VOID **Mapping + ) +{ + EFI_PHYSICAL_ADDRESS PhysicalAddress; + + // + // Check for invalid inputs + // + if (HostAddress =3D=3D NULL || NumberOfBytes =3D=3D NULL || DeviceAddres= s =3D=3D NULL || + Mapping =3D=3D NULL || (UINT32) Operation >=3D DmaOperationBusMaster= Maximum) { + return EFI_INVALID_PARAMETER; + } + + PhysicalAddress =3D (EFI_PHYSICAL_ADDRESS) (UINTN) HostAddress; + if (DmaAbove4GB || (PhysicalAddress + *NumberOfBytes) <=3D SIZE_4GB) { + // + // If we CAN handle DMA above 4GB or the transfer is below 4GB, + // the DeviceAddress is simply the HostAddress + // + *DeviceAddress =3D PhysicalAddress; + *Mapping =3D NO_MAPPING; + + return EFI_SUCCESS; + }=20 + + // + // If we cannot handle DMA above 4GB and any part of the DMA transfer + // being is above 4GB, then map the DMA transfer to a buffer below 4GB. + // + if (Operation =3D=3D DmaOperationBusMasterCommonBuffer) { + // + // Common Buffer operations cannot be remapped, so return an error. + // + return EFI_UNSUPPORTED; + } + + return AllocateBounceBuffer (=20 + Operation, + FORCE_BELOW_4GB_TRUE, =20 + PhysicalAddress, + NumberOfBytes, + DeviceAddress, + Mapping + ); +} + + +/** + Completes the DmaOperationBusMasterRead/Write/CommonBuffer operation + and releases any corresponding resources. + + @param Mapping The mapping value returned from BmDmaMap(). + + @retval EFI_SUCCESS The range was unmapped. + @retval EFI_DEVICE_ERROR The data was not committed to the target s= ystem memory. + +**/ +EFI_STATUS +EFIAPI +BmDmaUnmap ( + IN VOID *Mapping + ) +{ + MAP_INFO *MapInfo; + + // + // Check for invalid inputs + // + if (Mapping =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + + // + // See if the Map() operation associated with this Unmap() required a ma= pping + // buffer. If a mapping buffer was not required, then this function simp= ly + // returns EFI_SUCCESS. + // + if (Mapping =3D=3D NO_MAPPING) { + return EFI_SUCCESS; + } + + // + // If this is a write operation from the Bus Master's point of view, + // then copy the contents of the mapped buffer into the real buffer + // so the processor can read the contents of the real buffer. + // + MapInfo =3D (MAP_INFO *)Mapping; + if (MapInfo->Operation =3D=3D DmaOperationBusMasterWrite) { + CopyMem ( + (VOID *) (UINTN) MapInfo->HostAddress, + (VOID *) (UINTN) MapInfo->MappedHostAddress, + MapInfo->NumberOfBytes + ); + } + + // + // Free the mapped buffer and the MAP_INFO structure. + // + gBS->FreePages (MapInfo->MappedHostAddress, MapInfo->NumberOfPages); + FreePool (Mapping); + return EFI_SUCCESS; +} + + +/** + Allocates pages that are suitable for a BmDmaMap() of type DmaOperationB= usMasterCommonBuffer. + + @param DmaAbove4GB Indicates capability of DMA operations abo= ve 4GB. + @param MemoryType The type of memory to allocate: EfiBootSer= vicesData or + EfiRuntimeServicesData. + @param Pages The number of pages to allocate. + @param HostAddress A pointer to store the base system memory = address of the + allocated range. + + @retval EFI_SUCCESS The requested memory pages were allocated. + @retval EFI_UNSUPPORTED Attributes is unsupported. The only legal = attribute bits are + MEMORY_WRITE_COMBINE and MEMORY_CACHED. + @retval EFI_INVALID_PARAMETER One or more parameters are invalid. + @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated. + +**/ +EFI_STATUS +EFIAPI +BmDmaAllocateBuffer ( + IN BOOLEAN DmaAbove4GB, + IN EFI_MEMORY_TYPE MemoryType, + IN UINTN Pages, + OUT VOID **HostAddress + ) +{ + EFI_STATUS Status; + EFI_PHYSICAL_ADDRESS PhysicalAddress; + EFI_ALLOCATE_TYPE AllocateType; + + // + // Check for invalid inputs + // + if (HostAddress =3D=3D NULL) { + return EFI_INVALID_PARAMETER; + } + + // + // The only valid memory types are EfiBootServicesData and + // EfiRuntimeServicesData + // + if (MemoryType !=3D EfiBootServicesData && + MemoryType !=3D EfiRuntimeServicesData) { + return EFI_INVALID_PARAMETER; + } + + if (DmaAbove4GB) { + AllocateType =3D AllocateAnyPages; + } else { + // + // Limit allocations to memory below 4GB + // + AllocateType =3D AllocateMaxAddress; + PhysicalAddress =3D (EFI_PHYSICAL_ADDRESS) (SIZE_4GB - 1); + } + Status =3D gBS->AllocatePages ( + AllocateType, + MemoryType, + Pages, + &PhysicalAddress + ); + if (!EFI_ERROR (Status)) { + *HostAddress =3D (VOID *) (UINTN) PhysicalAddress; + } + + return Status; +} + + +/** + Frees memory that was allocated with BmDmaAllocateBuffer(). + + @param HostAddress The base system memory address of the allo= cated range. + @param Pages The number of pages to free. + + @retval EFI_SUCCESS The requested memory pages were freed. + @retval EFI_INVALID_PARAMETER The memory range specified by HostAddress = and Pages + was not allocated with BmDmaAllocateBuffer= (). + +**/ +EFI_STATUS +EFIAPI +BmDmaFreeBuffer ( + IN VOID *HostAddress, + IN UINTN Pages + ) +{ + return gBS->FreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) HostAddress, Pages= ); +} + diff --git a/MdeModulePkg/Library/DxeBmDmaLib/DxeBmDmaLib.inf b/MdeModulePk= g/Library/DxeBmDmaLib/DxeBmDmaLib.inf new file mode 100644 index 0000000..4ddb27d --- /dev/null +++ b/MdeModulePkg/Library/DxeBmDmaLib/DxeBmDmaLib.inf @@ -0,0 +1,41 @@ +## @file +# +# DMA abstraction library APIs. Based on PCI IO protocol DMA abstractions. +# +# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.
+# Copyright (c) 2017, AMD Inc. All rights reserved.
+# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the B= SD 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 IM= PLIED. +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D DxeBmDmaLib + FILE_GUID =3D daa403e0-071d-44ef-95cf-7f2472e4a4d5 + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D BmDmaLib|DXE_DRIVER + +[Sources.common] + DxeBmDmaLib.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + +[LibraryClasses] + BaseLib + BaseMemoryLib + DebugLib + DxeServicesTableLib + MemoryAllocationLib + UefiBootServicesTableLib + + diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc index 1bb361a..0c63197 100644 --- a/MdeModulePkg/MdeModulePkg.dsc +++ b/MdeModulePkg/MdeModulePkg.dsc @@ -3,6 +3,7 @@ # # (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2017, AMD Inc. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the= BSD License @@ -275,6 +276,7 @@ MdeModulePkg/Core/Pei/PeiMain.inf MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf =20 + MdeModulePkg/Library/DxeBmDmaLib/DxeBmDmaLib.inf MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf MdeModulePkg/Library/UefiMemoryAllocationProfileLib/UefiMemoryAllocation= ProfileLib.inf MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationL= ib.inf --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat Nov 2 12:20:30 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1488480413192265.1645441408083; Thu, 2 Mar 2017 10:46:53 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id DF300821F9; Thu, 2 Mar 2017 10:46:48 -0800 (PST) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0615.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe4a::615]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6BD58821CC for ; Thu, 2 Mar 2017 10:46:48 -0800 (PST) Received: from leduran-Precision-WorkStation-T5400.amd.com (165.204.77.1) by CY4PR12MB1239.namprd12.prod.outlook.com (10.168.167.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.933.12; Thu, 2 Mar 2017 18:46:46 +0000 X-Original-To: edk2-devel@ml01.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=5OxmL+KUMPQ/rye+acA6LE6G1vVB7aIhTBWP3TEhiqw=; b=xpfp4TF2317fdruPnPGk5w7rIHFgjzRhXzHZLjcJbzlcUrNZufSCwwtRr+sI0uH7EvfoXyvA80ukbvGu1+uOXtyQn918J7V9iIsNEwpdx5y57ex9GcMfB1YU6387WIABBKEK/r7vEtYg9AB/ndOYqgAvVIdrJ1AN5Hkgf0ysx6U= Authentication-Results: ml01.01.org; dkim=none (message not signed) header.d=none;ml01.01.org; dmarc=none action=none header.from=amd.com; From: Leo Duran To: Date: Thu, 2 Mar 2017 12:46:32 -0600 Message-ID: <1488480396-32358-3-git-send-email-leo.duran@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488480396-32358-1-git-send-email-leo.duran@amd.com> References: <1488480396-32358-1-git-send-email-leo.duran@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: DM5PR17CA0027.namprd17.prod.outlook.com (10.173.128.141) To CY4PR12MB1239.namprd12.prod.outlook.com (10.168.167.14) X-MS-Office365-Filtering-Correlation-Id: 00614428-7e77-47e3-026a-08d4619c7a79 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081); SRVR:CY4PR12MB1239; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 3:a0ekrXgcknjb27oSw5of6CVXjLi8G1Z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E7xkOyp8IzPqslCSr84MMGi+n1yZJ+npWKYxOEEfwInUC/kubk7NVJrZFV5Dj98LoKmeenbdj8WkIrIdQtT+trKcCdrR4tT+suuga6EIxbQJNdFFzOIymgoo8PbSZXbFE2lVcP+YXqUQBLeIbMTa0xNu/34mtI4/i5tlFSGaPynKyWBrch+HDnLZcRecSyzkbkhB8LnjnglKffbeDjJOUSIFE3JgtsPSBZSODE0yIaCmGIHY7/vRyoDZSLimoffEv48nmB5nYzk1IYZIadKnVNcHmkJR8fWCyvirR5QMRoxBkC/1hG7znpB/Aq3x8279hRdL60Cxj+mCkOqTcrQ947WkeRVBDwDgfmak+/YUx0Tq5AOEcQRpy10XC9VHbjD0oVbQwH908rY/2wLLttujfucKGbLf0OR/gycAVqxpRwsPpp X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123564025)(20161123562025)(20161123560025)(20161123555025)(20161123558025)(6072148); SRVR:CY4PR12MB1239; BCL:0; PCL:0; RULEID:; SRVR:CY4PR12MB1239; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 4:znxZVS1wIo1g7Nni8IW6pdLm2TB6KV3+vfoNDURnNh+b7tMfBiiDtkXXIKBXm7umt8ALopeJEuegKaIkkFdHV/VfLRC4VXhK1D8O66Ji5Y7997Fj4qvlaG4Jzx3Rj9ulB3isluiUBkWsjJkozr2yhvdNPu3IukxLS4lTyp2pE0B5H7pGlC/wt+RLvoCvineVfHGJpAfWBJKPIZ0YrBMoLE8WWWbmtItYniF8RmX++2Ar9uasqOt6Ru7MpQDBj+0LPD4eQJIpFDngFMWesUJxOlnI6HlOzppDxOIJEA7wosFnillszzHXJdJtmPHLd90gXvWPUwAKnF25wGdFfFMjbTU0HTEFLRUYoFi3NBw8RkZLoxtg7ngB19S8scuObZAVHBggW3AKsLPmAQV2RQRpf4mVa0vUGWHl+gYQPefeL/LxpYRZjmzqu95NzMKHknI6gKYY1KqQUrix2kN0IMl0E4z4gx6IuRg7TOkhjaZkZLCmIudFqs8hTgBDTdVtW5scQgB9RyZ+GiJc+t04cHJOf7/ww66iwzSpTHupYp20c9+Nlyks44Vz39qBwtG3fAMgUaaseO4FaLJdBoEWOkF6c+iWW/q5l4WmXmGu6aHMl0D0FXV6BbYlRiUPK6CaNQ1m2keLbubeAvWyWuBx5L0sm91e8SnMvrLUkAItMZDbDpw= X-Forefront-PRVS: 023495660C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6029001)(6009001)(7916002)(39850400002)(39450400003)(39410400002)(39860400002)(39840400002)(76176999)(6486002)(2906002)(50986999)(25786008)(6116002)(189998001)(6666003)(7736002)(36756003)(6916009)(2950100002)(3846002)(305945005)(5660300001)(66066001)(50226002)(42186005)(53416004)(47776003)(4326008)(48376002)(50466002)(33646002)(81166006)(92566002)(8676002)(110136004)(38730400002)(5003940100001)(86362001)(54906002)(53936002)(2351001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1239; H:leduran-Precision-WorkStation-T5400.amd.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR12MB1239; 23:v1cxcPapW+9pZjWfaZ2wYpdPGFcUR+bnlRQqw9rkJ?= =?us-ascii?Q?mSVaceMtcRG2HePglQs25UZ0VOHVWpvCx2laIIMtoKP9NRKiJrYf8LSLOBIX?= =?us-ascii?Q?eAuIN2rmjcjdaWjVrRpIeHtG+cPfq9saUacJYAFhdQ3wh2MZRPZ1yTOPwyGX?= =?us-ascii?Q?/2caMrkd+NrQ+iTR/6PexqjU++Kl0CkWsRpaEm/Yj7O4O0qWE89z8iSF5FW9?= =?us-ascii?Q?qmpZ50ZENslvpjm8oPK9SPcybbljNVe1qT2LKL8qOSmqutFBn1F80QTxlzEf?= =?us-ascii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0UC2LATL57LcWb5bARJaVcDK4q1se+yXhmo0QAIOamxrqToQJZgXkokauwryTiWS4pJwmBI2vVgFBb+/HaznM4GU3r5GQ0isjWv2A4lfy3lkZgLJXBJE+w5PakFkdMgByolWo8wSjD2Ivt7LKktzX1I4VxSlKQ2Bmk0HrhqLplfL8yUVhBLbp+LYEu6DJskKeVQoAGmjbQgDs6bEzEmsw3tQ+IVqrqkROj94bzHyuvA5BJ8Tm2WYTFldmmN1NhBL+MxZJHCWtKykf5MK3prv4GQ7HqQeq/c0LW5kkLd6asMtcP1rEJSpD26gi6PTLH1f2t8cM1HAh2dkbbvPGaolaP64B+nWEBwY4FPooFdEPYKzeUYW4HCzGvgk=; 5:chQe6Qrh2czX1flaQG2VIry/d9xqw7VVs2jFg+xoBELh/6V2OU5gEiLVJicKS9iTtjZyeUukf12u48hq0H5FMfhCxw3KbBScvg9hgiJp00x1zmEjdDFW0Ka06LaAAQHlVIy3wbVHR4cclMK0tcwekg==; 24:kKHEQ82RS1987/NIwcMzHFTV9TvHr1jhrM3I+VXLHvFVPFrOXMfmNmASl/fPRwTDV9+ou1A/fcMOjgXy9JkuB8BdXooFcIrhpF1Y5SqFXjc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 7:KPfUVJtZOAIi/5E07SsdZg36jC7INDK/6luYzTadabNWfKB/9w6xiwAbcnz5KcY350p0d0bafyX7NaupTEZh4vcDaPkbe6LXl+m2h3Ahn3j9jtz1PfpgB83I6fDsOH6W+OWtYAhaF0UR9TYoiXu+StD6GOgSwlAbwkHpAXvJOs1g59mw3VDY7a88JbswA9UlV1Y80tfJa4hoeX5JAre6WsMH/WvnTbTQxhe4WBf0OHHPSA3041dYwytbIsXqswsUtEUEkLST653LRuxN3bas0w28dX+XhsXM7Tw/8WToc8CM88KLrAF2UoE4a45VJ+16hXei+66ZKOD5EuFtNVEEkg==; 20:kff+r0EQo55OjP3LU+vZem6icv3U6IW1wQsn4XjavPb3EeorRoCLfarGRtGy69y9Ov0uaFiyUXb84RJL/8/KKB7QbBS2IjKNgn/uEe8YSgpGilf3XYVg4KWnuW1ttlWr+nnOFOsDn35w2i+IAgQEKzZMEo3biiYnudH6XCUTNXHhdISxjlBLJxZz4YFrVslykKFdR1pVlLg4+Gj4MYGnfcOVesEiVCDDDrg84jaHe2CY+dp7HzXklXxHPOKky9Pf X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2017 18:46:46.1433 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1239 Subject: [edk2] [PATCH v4 2/6] ArmVirtPkg: Resolve BmDmaLib class for PciHostBridgeDxe driver X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Leo Duran , Ard Biesheuvel Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch adds the new DxeBmDmaLib (BmDmaLib class) library, which provides an abstraction layer for DMA operations implemented by the PciHostBridgeDxe driver. Cc: Laszlo Ersek Cc: Ard Biesheuvel Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Leo Duran Reviewed-by: Laszlo Ersek --- ArmVirtPkg/ArmVirtQemu.dsc | 2 ++ ArmVirtPkg/ArmVirtQemuKernel.dsc | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index 615e1fc..04edf99 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -2,6 +2,7 @@ # Copyright (c) 2011-2015, ARM Limited. All rights reserved. # Copyright (c) 2014, Linaro Limited. All rights reserved. # Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved. +# Copyright (c) 2017, AMD Inc. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the B= SD License @@ -59,6 +60,7 @@ TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf NorFlashPlatformLib|ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.i= nf =20 + BmDmaLib|MdeModulePkg/Library/DxeBmDmaLib/DxeBmDmaLib.inf CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf PlatformBootManagerLib|ArmVirtPkg/Library/PlatformBootManagerLib/Platfor= mBootManagerLib.inf diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKerne= l.dsc index e490269..bc8701c 100644 --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc @@ -2,6 +2,7 @@ # Copyright (c) 2011-2015, ARM Limited. All rights reserved. # Copyright (c) 2014, Linaro Limited. All rights reserved. # Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved. +# Copyright (c) 2017, AMD Inc. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the B= SD License @@ -58,6 +59,7 @@ TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf NorFlashPlatformLib|ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.i= nf =20 + BmDmaLib|MdeModulePkg/Library/DxeBmDmaLib/DxeBmDmaLib.inf CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf PlatformBootManagerLib|ArmVirtPkg/Library/PlatformBootManagerLib/Platfor= mBootManagerLib.inf --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat Nov 2 12:20:30 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1488480413822204.6615537233962; Thu, 2 Mar 2017 10:46:53 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 2D79D821FC; Thu, 2 Mar 2017 10:46:50 -0800 (PST) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0615.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe4a::615]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 96D7E821CF for ; Thu, 2 Mar 2017 10:46:48 -0800 (PST) Received: from leduran-Precision-WorkStation-T5400.amd.com (165.204.77.1) by CY4PR12MB1239.namprd12.prod.outlook.com (10.168.167.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.933.12; Thu, 2 Mar 2017 18:46:46 +0000 X-Original-To: edk2-devel@ml01.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=y+ynEQZUne93TkxyuI70RzsbnEbJzOV0GrQo69OB9Ik=; b=wOBUVacyxffjnbNYTAZAiXs8JAsUYHnpoILFPEMQGOPnW3zXlHinSK8ktTojKXqUVtLauIpY7QHxqWInmAKJEehMYqx6ulp9Ko8to3uPnvUZxFAn5JdjT+cJ0FNcUpgxFFwPyKHhzDzZ5c4Q9sJO6wENiQlrNimLsjhf6LxOESI= Authentication-Results: ml01.01.org; dkim=none (message not signed) header.d=none;ml01.01.org; dmarc=none action=none header.from=amd.com; From: Leo Duran To: Date: Thu, 2 Mar 2017 12:46:33 -0600 Message-ID: <1488480396-32358-4-git-send-email-leo.duran@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488480396-32358-1-git-send-email-leo.duran@amd.com> References: <1488480396-32358-1-git-send-email-leo.duran@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: DM5PR17CA0027.namprd17.prod.outlook.com (10.173.128.141) To CY4PR12MB1239.namprd12.prod.outlook.com (10.168.167.14) X-MS-Office365-Filtering-Correlation-Id: bac877a8-21e7-44f7-111b-08d4619c7aba X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081); SRVR:CY4PR12MB1239; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 3:19schtXpnwNbr2OhamvXkHdphXT9zyY1sEjgcHvNsSDZE19CRv969eMPeFIjcjvgSNmzmmr/wN2UP5ztH6ePrJ7fxwlFG/3CcF2NeVMvW+T2NOFxcew1F1k/FfqHEN8r2RYOzqz9CScXsJmj9+Q8Qn4MUfzSv/rLT6ywPTXKjdFmj+z6EIIpYxxu5VmD3UnQsQ8YVhVng3GMPKYTQi9NuqvIviQj5ikaTEpGzgAvUTx+1DR9WP22/6vNGzbve8qZ7iBCx0AVE853iY5VcRxVcG18fiMVH6QKqk5AnjyD9dU=; 25:WIOfYEQJEUWk4kZp4jb9glAvMjiGvNjjrn2HIHwKk8dXHpidmBd/3hoZbuSC/5McECfION/7oeRm/Y7O8HfY0e+MbvgeiExn4jJLx2Jo9wWE690Joofak7xxlds7e+uSDaDr6kjlkopS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TI41MZOE6UXcen/twLR1cw4afukrQw3UDXode5tISnTyF X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123564025)(20161123562025)(20161123560025)(20161123555025)(20161123558025)(6072148); SRVR:CY4PR12MB1239; BCL:0; PCL:0; RULEID:; SRVR:CY4PR12MB1239; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 4:wAD13Ol4HjTFRX2mUB+XkEugX4TWaL/OIvwKZIg+Pmkt+TNr9bmXS7o4ONYFFf2fjpTj1lh1utIQIn/QCfDky0qnn2VQH68vyiByJLtBlrx9PK6tyzQI7eG2PT94VbTHnZCTOUwE8sY+dH0Tc/poDY7h6Tyq6uYzYOFzRWk641yGtjLmjFuaIlut9kwaOhQsPfXUAsKBBcD9Y2yRQgUtHb2TXtU/uDhEvOcpB93sr6Y7wfFynfsfyBvelsHD8cO9ZY0yfMA3N0YMxhYUIBpl2UieC/C+/us2RQbN3LtynClRuibo3f+jTnb0AjTB6l+WfACeSBWwFA6OJANyTVxlrg4kpY1seCmz37HF3LBfEz0/6XO93h0vfd+XtxMTT/2IIgGRqBgXf9N4vvplnsrAXC61isWYY7qlXSZ9JNmgGbNdf9c2fKlhsAVtkxp5od+ZaQe8Lymw27I+a2dnrIOYlFBtbmeeyefPkTNemRSBB/x656mIQeMBiLh0tbn8B1MhcZw1nGiTHYVZoCJYIlWwkmnQhEkRnUZ5TQwJ57HRvO65+ASAsBEvSTkHqeIONbchjd8MCO3V+qTs0B3KNJ8n07SN0p+lkkjhJ2qunEcUGIdY+fpNgLE72wylm6TvG9iec7d+EzL2UR8tL5WBtHkqKqr6efZJWcFEo8PjmiMc11eAMIJzP+7pXAMroU7wI4D9 X-Forefront-PRVS: 023495660C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6029001)(6009001)(7916002)(39850400002)(39450400003)(39410400002)(39860400002)(39840400002)(76176999)(6486002)(2906002)(50986999)(25786008)(6116002)(189998001)(6666003)(7736002)(36756003)(6916009)(2950100002)(3846002)(305945005)(5660300001)(66066001)(50226002)(42186005)(53416004)(47776003)(4326008)(48376002)(50466002)(33646002)(81166006)(92566002)(8676002)(110136004)(38730400002)(5003940100001)(86362001)(54906002)(53936002)(2351001)(19627235001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1239; H:leduran-Precision-WorkStation-T5400.amd.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR12MB1239; 23:gtth5OuGcrpqI8aOaEC9sGParDW0kaM/RXc7q5HKG?= =?us-ascii?Q?lGS6Jo8RIk7OYISFevfkJToKIGUb7hmVYWAYQgBC9hBxmlhR73BYp5bXDVN4?= =?us-ascii?Q?j4gekn+CQYrdkXG7OQJ7uZr0eH2gbzB4Qw5/V96nzl75aNq2jCB4l9DK6+Mo?= =?us-ascii?Q?yLubFdbmuOK5dJ/zUzBOAglaLYGg7hS4bc4QuMOe3B2KC8oqkwLziWFP4Wcy?= =?us-ascii?Q?kkXe91nrWDB1Ty4nsMLbqxJE5Xan1AiM0ql1jEUt28XqQ1fgZY4lc2q1mAgM?= =?us-ascii?Q?8ukldBuiN4dyS+vkGHvWyba4eRr9usdh3P8BqEfhlr6qTOanDjprhuoDll+N?= =?us-ascii?Q?UxtPN5FZcIxyiWhrdes19sXPkXCapw1k8cZdPUHHP7cIueIfkAvEjZ8iv1MG?= =?us-ascii?Q?g6wqNw4Aq75OdHyDQz9DTrJWgOsaJ5ECe6ncdCUAIMvZmoerMoGAuwBVM7lS?= =?us-ascii?Q?aGrj7f/19r1qWLFVKWRb21OGRLvbrm0GEutQvb+MhQ+jLYDROc+lhKAeOhvf?= =?us-ascii?Q?ccJqtceYPKSkhseghQui4nph11FpDNSaHL4w6GeRgVWufjVs6/Hke2pMGA+o?= =?us-ascii?Q?adktYezGYcCshZHNLieaU/utzvULYDUDR8Ky/ouLW7o0wW1CbTUC91FSOdQ+?= =?us-ascii?Q?KiQ0eE4h/F88rls8L9SASpd90++ponfZlnAbH3IxYijTwQv5U5dK3yQpgDdI?= =?us-ascii?Q?D/bWX7sFUeyIkjI+AuXFZnhBoyZLqjJdbgWIy2EJkhSZd0K6ctUy9sGKO4c/?= =?us-ascii?Q?egZ/i/epTt52nlNJRqIW0eUIvK7EVkItjzDDOHjiwwZ/xTK7VT/+9X7plrQt?= =?us-ascii?Q?T7oo2U65T+V5foQRlHuNThT+e1TsFhtGP/vlw/4N2AzbH5hYf4rP2J/CsGhs?= =?us-ascii?Q?QjZnGqgiyG7ZguASWwF0yYrLmisgsPKRMbEEWo/INJlHmUvveg/xMNLmnAdw?= =?us-ascii?Q?AYT7nQTblBXb9ODRD2fj5mTpr4hRDQM6J0Aar+zIz7QihsZAVmRopNdmiYuY?= =?us-ascii?Q?fTNoljXfCfpZVYEmUUB0HNQ8OwCXVFfD5CD1PmkekBj8pQXuLYViFc+/Cols?= =?us-ascii?Q?17it8Gm9WZ1N2Apy2RMUkRC0fyrCf6V/FHvw09TKSaKmrLjbNmywWKRth9qb?= =?us-ascii?Q?haDJwB1tvE=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 6:SKUOrjeDkY+DlkwImOigB2yGorDsPayCSuIwA002nZSmXf072+HHtOrPm7fV5dSjDc+8g9KrFiCM/HXIZYrDTAs31bSZmkXdbyJCX7LZcgoHdOxpC8O9UnTN4pmrHgfRrlQzhC+DAVAoVB0qsoAa5+bG/MF03goKPdDw+4W1MzaK0etThary1EKzazjwpWUNu8RLM20vPoV92NCIbr57QQ7zqMc0d2b53lUuO2sqRT79eGuwmFAu/vM7qOH9v2J4IoiIJ3RmiUr74CONNqvgI7BrOg/KjvqnYi0BM6yuReD65ey6Q0rF/tZ9ltxSbzioY3zj+XR0khaGA02X2ymRnx6R/Ooevg72+PhtVqFjH1+CRGIk7P8Ius8T1Pk0M/q4rt2C2Aqsm9+zTGT1stWgtPVSQ/GyjC1oAuj4RFiLPyI=; 5:Y4nkD1zP0eHTmR4f12umU7lU8E36I6ESu/i0led/1qVafGdwzfGWRR6UylBo9eyKLh/PIoNAO6f5gao+1+2l/ahw1SldqD1jDJTjlsZtpt3y6lZEq/rf6G+a1A3Crvy2DXSPu90ygKlddjMH40kYFA==; 24:Bv5VgoDePiySET2DJLlFELvP7N9jf9yG+WzGH84WlBk6+gzVF78kSRCT/w73O6Ez+BfWadE52DYHAUcw9G8QHRyZnPxYuvpHKXGyocxnqsM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 7:4o3e71arS4KBcuUf2SA8xAK/+TT0LIKMWaX+S1j/KQLvFNKVcWpL3al3WyNjh5RCVk5z2OzlAcCQE7dlq7YKNYXzV0LBln9D3shbfamP98YKmxwilsd0UqZ69XGly/4Kt3qZrq99cg7cohD1X5ptPHD5A7/g+m0TEYdNiFxHViRLU55JpByxZh+pcw6I2MWZCfQwwM6ihagWjugzMf/osLkNzD7/McB8xgyg2mRPbCOwQr+V+Z4EXvBj8MASNjX2t0o80dQiTATb3yUjRMr7p4RaFzpCm9Q3KCRpqVfAwvLUYS6I7bPJ1qJ/oPd6eWGIidC9Gv9Ccmw3zfs8Zb1EzQ==; 20:u0Jw13KdMCRaCuv0EQzQ/BOU1xeXT7S9p2eyUM9R2OGvm4TxoR5sBbZd3g6klG0gozUA21uwXb6LESpwSt6TSYgK9sVYUDCebJflfqhGXOcW1RML430TXMTwdfVrjjjAeXHPSbYLVA7s1ZsXYyQOVAXqfbjbQoGIkFweGGe2YjU0/81p3wvoNWKOJ7bwFcpnBngiuSIayyT54UL/4xK5k1TXHI6a/S/t9j5EuSVrWCpIv4Stv05CJjtb15jaTXwK X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2017 18:46:46.5697 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1239 Subject: [edk2] [PATCH v4 3/6] CorebootPayloadPkg: Resolve BmDmaLib class for PciHostBridgeDxe driver X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Duran , Prince Agyeman Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch adds the new DxeBmDmaLib (BmDmaLib class) library, which provides an abstraction layer for DMA operations implemented by the PciHostBridgeDxe driver. Cc: Maurice Ma Cc: Prince Agyeman Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Leo Duran Reviewed-by: Laszlo Ersek --- CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc | 3 +++ CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc | 3 +++ 2 files changed, 6 insertions(+) diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc b/CorebootPayloa= dPkg/CorebootPayloadPkgIa32.dsc index cdfcb75..59a599f 100644 --- a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc +++ b/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc @@ -4,6 +4,8 @@ # Provides drivers and definitions to create uefi payload for coreboot. # # Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2017, AMD Inc. All rights reserved.
+# # This program and the accompanying materials are licensed and made availa= ble under # the terms and conditions of the BSD License that accompanies this distri= bution. # The full text of the license may be found at @@ -140,6 +142,7 @@ PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeC= offGetEntryPointLib.inf CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMain= tenanceLib.inf + BmDmaLib|MdeModulePkg/Library/DxeBmDmaLib/DxeBmDmaLib.inf =20 # # UEFI & PI diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc b/CorebootPay= loadPkg/CorebootPayloadPkgIa32X64.dsc index 6b16af6..5177811 100644 --- a/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc +++ b/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc @@ -4,6 +4,8 @@ # Provides drivers and definitions to create uefi payload for coreboot. # # Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2017, AMD Inc. All rights reserved.
+# # This program and the accompanying materials are licensed and made availa= ble under # the terms and conditions of the BSD License that accompanies this distri= bution. # The full text of the license may be found at @@ -140,6 +142,7 @@ PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeC= offGetEntryPointLib.inf CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMain= tenanceLib.inf + BmDmaLib|MdeModulePkg/Library/DxeBmDmaLib/DxeBmDmaLib.inf =20 # # UEFI & PI --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat Nov 2 12:20:30 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1488480416061190.39403395472254; Thu, 2 Mar 2017 10:46:56 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 640EB82200; Thu, 2 Mar 2017 10:46:50 -0800 (PST) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0615.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe4a::615]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id BCC54821F2 for ; Thu, 2 Mar 2017 10:46:48 -0800 (PST) Received: from leduran-Precision-WorkStation-T5400.amd.com (165.204.77.1) by CY4PR12MB1239.namprd12.prod.outlook.com (10.168.167.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.933.12; Thu, 2 Mar 2017 18:46:47 +0000 X-Original-To: edk2-devel@ml01.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=wOqHJ2spI9HLm81slpp5G0RyJ82atZ7P0gz+Lw5kpps=; b=fW31sGGeCCv6rcURXaKUmt5G4NckWPrHgAX4X+hs8VbAlcgQmnYjVIGA72cB1XmwpdoFsLAPZyWMkAh4R17tKqw6SbSAoWCdBpW4I1xW5vKgabepUXPre+VR4REqW5QL9gpjNN+1uf9+rZDghxpWygd+0CfOLHe/6iLFtiK7nDA= Authentication-Results: ml01.01.org; dkim=none (message not signed) header.d=none;ml01.01.org; dmarc=none action=none header.from=amd.com; From: Leo Duran To: Date: Thu, 2 Mar 2017 12:46:34 -0600 Message-ID: <1488480396-32358-5-git-send-email-leo.duran@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488480396-32358-1-git-send-email-leo.duran@amd.com> References: <1488480396-32358-1-git-send-email-leo.duran@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: DM5PR17CA0027.namprd17.prod.outlook.com (10.173.128.141) To CY4PR12MB1239.namprd12.prod.outlook.com (10.168.167.14) X-MS-Office365-Filtering-Correlation-Id: 364cad81-8737-4ee9-e4ca-08d4619c7b0f X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081); SRVR:CY4PR12MB1239; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 3:XLpNpDfZWK40J/TScNp0gOEuRbSh8jVPhfO4UTO/OHq8tdSusTlY8STt6+yTmW09qWkRIoffiRBhQoEjWRQW7gvD1xHpqzrjWb41eAqd4U0QG2Rw7LpoqpMorN6zi+iPv6JwLjvhJne73Nz5xvpK/LIxU9kRHNznlmnUagEApIG6+8f/vMkXgAm5YlfaprO+kjv6SXSR06scW7aXT/m63VDV+KUo2fkGMU6YQJfv7bEFhuylUArpcqQWAHKottUxU0MGvsJVjWgqPKQbGRlbjyFsrKpQErrJy+pQ2bLQvJ4=; 25:wzl+Ez4fHzSIsW38wD1aNe0t0OjhotkUiBV+W+HhEuktBdZWAFDpTKCaSbdhtDC1pQeVQDKaAZ9vkDsYmhaXrp6bVqyBhMYTSG/kOKo3lCIN1Kdwj71QpR2I9LJCI3YmcW9KyzUaCEOIbHUiJHMCTL+6vuQBx167OFVSvZV+farJNVMsHdFSHc7E5TZb/ihW8+DY8dWegBS9p0GsNIo2Kz/hSNrvvvF/6Oi/6TGOyVAkTVMlWuhe2CidINJjWpsW5liTPbpm5FBgB6ajujKZctlO+L/dp+AWCvC/skTBiMQhkjKYnFf2aZnWrXkeL890qB3RfcS5Fv6w63mMYiCpX1nlSY8pSZnaLpu+KFq08cG0BcnHkv9/iwZg/Dhk4598tfa1/FJ05LsEasKav+S0cMYe56Cenmu49i2oS7ZQ5ubZlI8ru0f0EXcw2HwXHH367Mu4Se7ElbN3GDa85+jcEw== X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 31:me2wQzhANDBK9igu39YMCRDkngU0noyHOqMZmcFzoo09dWBIT5+cCeU3f5FH4kEkq89CqRBn/k1zkgFZjDKfmcrcOCnYgnJFzSv5EhSicZ/MR7v+SM236EC2PS+k//SYY0Mu+1S55w7XRx27gJ4eMkwDoFylY/c/0WmF6K/9QGD6P0tmpVv7CmLdMRrQQdbfLZDyMFfeajwivGrn/kXtOWmJbJkWERTcxoUtFhrUfZwfHXUwkU//T4v3S/HuRfkL; 20:7JfxZQuTTV41vRaM0y6btjK0xmmf3VAIQUV6OQJwc8ls0xip+YNQI0Jk61RcnopEKcFmtSZlJwnIvcIJygp8dOUHwPvdU8PukMaW5LiGpNcQwWqAus9YNX5074ymxLh0qP+2Gc8GGGFX74HqGpF1rNuBtk6U8k/XdoRS4lNKSsuYOmYijDdoWL33w3OzZD19+j6DFSatR7g+prHMBeTRn1p6lgx6AcHD/UN+E4hicZjLRYB4yp4UUmcbBuy9B3AKRMgQJMKQg9avDxjPvf1Ht4qzaJsJ+8uZLNMrfgMLOoKoKLRuJUuYEhU2Hhi0LzL3B0rRmmCQeEsZQvRi8/Vo8FVwwhlLgMueFsS19mxE80V8e/DQp83uLOT5kWMvYDVuparTvmA0w+awb6mamUiX4VGg1WEq+Aj9tZ+4GKEry0jdoUw+TIxPkUbbpIeNwhxrU5tkx2Qkw16LV5akz5c74nVY/ImmwQbXxherwxiTV6NXNyLWGAJjnnHjKePOYpsA X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123564025)(20161123562025)(20161123560025)(20161123555025)(20161123558025)(6072148); SRVR:CY4PR12MB1239; BCL:0; PCL:0; RULEID:; SRVR:CY4PR12MB1239; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 4:DAiPbo1/u0MSz9fA69cGVGeudZdKHs2sj3EIq8ueJZgUfrfjmKV5xkZnBsbvNAkAiDK2RB42ntxuHk0VizxcnUxPhEv02Z0/siSpH9LgbiwqzMtBipya3D/yuQgKVWaaVrNn3zQAyjLp4OoaLVBPnPn4sjUzaT3AGvV+iejibCD7cFfanWrEC7myUEtT3dD9wcIqfd/7wITpnnkRS2MLA11jxJRTZVE620bOJ5rHY+R/0SjZvcsS5rOV4gFn2mEl8M/r18JGRFRXKutyKJTEZOyMub3Qm5Ne8x4Ck5+VhFSXYXvpBI+jgNXXHniqTz14NNw5TvWYEIo8Lt3LOEKFBLfITwjgbV/TxOmNallA37d/niU2/9/2K9ZD0YuyPlWaiVYhLo48JektFmUvqcDfx0t0s0YCcQn6XpEDuJpDkTuX0882492UwIaV0f/FyCVQ5l+NcxMBIXwB9h3snwb3wdQWD2MDPHcRlpy8u9v9DM5kVsNmZCk0xs9oP8h1nUyp7CqMTIKpXGfEQKnIZOROBUBNFCmOye6tWxu2UDO1THBwWnN3flm9OQV8UXyP3fltF3uBSaORNjWd/o+OwtrrfJdu4Xj+og0I/aqWlwPj0v/ng/5vPTkY6v/1hbXymhgZVTmovUlOtHIdF0/Eo449X0hgKUnsaaBOX9YD1SUpV7jAwGw9mCcdYxY8UHezOrR9W8nX7/SpVwrNWROizK/5Ig== X-Forefront-PRVS: 023495660C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6029001)(6009001)(7916002)(39850400002)(39450400003)(39410400002)(39860400002)(39840400002)(76176999)(6486002)(2906002)(50986999)(25786008)(6116002)(189998001)(6666003)(7736002)(36756003)(6916009)(2950100002)(3846002)(305945005)(5660300001)(66066001)(50226002)(42186005)(53416004)(47776003)(4326008)(48376002)(50466002)(33646002)(81166006)(92566002)(8676002)(110136004)(38730400002)(5003940100001)(86362001)(54906002)(53936002)(2351001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1239; H:leduran-Precision-WorkStation-T5400.amd.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR12MB1239; 23:ckEJFNJ5LL7USsnVm7h0TIQzod8fR6PXTCv+RdLol?= =?us-ascii?Q?3VyCRbDTWHnGt8Ezfn2Khs/J6xTyov2cm8P29QGFK1yF8GLer/eGehfypzrI?= =?us-ascii?Q?atILzbl1Q+0eRVUidkkq5NOZuALOS/Q4Jm0Pnsticpyv43UaFq3Mi4C6H3CP?= =?us-ascii?Q?kiqUbUyl6CnXeJuax8F8h58vk7WPQk6ShA3mw7krLctDWqWNyG5lNSs7fRPa?= =?us-ascii?Q?rZ4AHB55urUiFwZjQFIbEhh9uq9Vgkk8bmleaR8HaFuISKh9QuSacvxBNaOa?= =?us-ascii?Q?V0xKPfzp3aUx95NAqTthEuzOBooaZp5yqkWNW+R7Ly8EipvHqpznDEN+meKS?= =?us-ascii?Q?1KOZ6/cUCP6msNzkMl08f+HYMJKRtIJwN65cmHJ6tD8vG9Di8nYpMShlpDI8?= =?us-ascii?Q?14j2sXVbnX/apASFxUXaXoMCEw7B3P+wpLC3Ptv9moTT54YKRUWcEYuba6EL?= =?us-ascii?Q?hahUOk6mxG5Wl2QfHzHtCZmoi7uc2owskbHncAY9qCQWDH2F5JR1AcnKIJYw?= =?us-ascii?Q?L+JLS8WYkbef5RFIrL+Y2wYMib1MYG+UH/iwTf+kRMCv+RZj4xu2LfCGjY2q?= =?us-ascii?Q?CcJ7Z7lgIAV/R/WOpj9NhFqoBcAn4GDxZiC5lJx0OSOSKi/lKxoEuk8k5zlx?= =?us-ascii?Q?NYysML2GYPh9k4gDh9zZw6CArx4YZp1ZY43MZ+rTly0NPdHTlzUr98tWDK20?= =?us-ascii?Q?R9m0/t8dgo2fu7rbdd+JBtJunUQjJksHnJwPUhLwDq74BrVNavOgUYrfGkqe?= =?us-ascii?Q?nQ2T7F8IMRuDTJf1dvPyHHcwmbkFi/iNrOFKtegg532STgL+BggVy8ZjfK4X?= =?us-ascii?Q?RmGr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nosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 7:ogvGj7d9m0ZBfRW9FytbJl+fHGo9IDEN8EW6Mh0j4rS9Yd/FbtLVpBB9SQYl+vBjItlW2rDh76tbOCpJKae5GD0W1P4gCZ+Ln5lAklU7kfuE3TBEnK043xVk2N4aeonvDYicaBIWs3/JeZ/Oyb0cgd8XalylnICRZ3xtQtXH41t0+qbxLWNBLmto0XeEjFROsxL5X0WB2GsEnsNlPT33EEnyWbJ/cuaZQJ2h0K3vMuY2k3JPVprq+kgS8H5ExBho9+4TC3EzXQmhlfw9m/yqdRDo3M4M73bE0JYOrXEnAMHPMygSK9wBFn6QSL/kYVtPCr2O/e9vjkiMMP0KZYmL3A==; 20:28pTBk8Gh4SW6YXW/s7jkQXsHu2eP7+Xcz83tmh+xjTcHbawrs1Cy7GOcYbTYsBIadzGoLuACtdtOu2aIkalLQHl0p250qjaBwB+9ij+7ABWAkoi1mk/OeZKaM8yP0vuFvpQQ9zG4ig3QgwZM1FI0Qdifi29De3+OF3/h+UF1quygGnV4Zp0zz93eYI82QMNuIRdRYfOctLLDv4qqVW+a4suOIhXP1yKiUuszaVfQ5nk2MHB3OQUCqQInTE0GIB9 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2017 18:46:47.1302 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1239 Subject: [edk2] [PATCH v4 4/6] MdeModulePkg: Resolve BmDmaLib class for PciHostBridgeDxe driver X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Feng Tian , Leo Duran , Star Zeng Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch adds the new DxeBmDmaLib (BmDmaLib class) library, which provides an abstraction layer for DMA operations implemented by the PciHostBridgeDxe driver. Cc: Feng Tian Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Leo Duran Reviewed-by: Laszlo Ersek --- MdeModulePkg/MdeModulePkg.dsc | 1 + 1 file changed, 1 insertion(+) diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc index 0c63197..d8f9a21 100644 --- a/MdeModulePkg/MdeModulePkg.dsc +++ b/MdeModulePkg/MdeModulePkg.dsc @@ -49,6 +49,7 @@ PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeC= offGetEntryPointLib.inf SortLib|MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf + BmDmaLib|MdeModulePkg/Library/DxeBmDmaLib/DxeBmDmaLib.inf # # UEFI & PI # --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat Nov 2 12:20:30 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1488480418497446.98577403690194; Thu, 2 Mar 2017 10:46:58 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 98CE882204; Thu, 2 Mar 2017 10:46:50 -0800 (PST) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0615.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe4a::615]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E2D07821FA for ; Thu, 2 Mar 2017 10:46:48 -0800 (PST) Received: from leduran-Precision-WorkStation-T5400.amd.com (165.204.77.1) by CY4PR12MB1239.namprd12.prod.outlook.com (10.168.167.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.933.12; Thu, 2 Mar 2017 18:46:47 +0000 X-Original-To: edk2-devel@ml01.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=2HBFa596Otek9S4gdhLPAqEcsk3dCVZBZJKM0v0b/2E=; b=eV8HpIR929FkoayJefw9FLhPZbbhHPOJt50TPTmF59gK3ETpymwpg1Lb7CO8XEXvTZoJt2saEQM0pkEI3EymeA+9LTUZLySqozrC1jdN80v5jSHz8WLAYX1jtGI5LsZxlrXs3HBD1N8BLcVIjx8F5CA6GcIkiWN3WQaduc4Swuw= Authentication-Results: ml01.01.org; dkim=none (message not signed) header.d=none;ml01.01.org; dmarc=none action=none header.from=amd.com; From: Leo Duran To: Date: Thu, 2 Mar 2017 12:46:35 -0600 Message-ID: <1488480396-32358-6-git-send-email-leo.duran@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488480396-32358-1-git-send-email-leo.duran@amd.com> References: <1488480396-32358-1-git-send-email-leo.duran@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: DM5PR17CA0027.namprd17.prod.outlook.com (10.173.128.141) To CY4PR12MB1239.namprd12.prod.outlook.com (10.168.167.14) X-MS-Office365-Filtering-Correlation-Id: 25720355-5d15-4b0a-ee9a-08d4619c7b5d X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081); SRVR:CY4PR12MB1239; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 3:WCfMSqqZUF5b6KyGRtMoxuhBUqfmI0EXCMX87qwBVMfhhurCxNFORF2PurLd75sp67+QsilDXgadO+Ywj8E+soSVAERfl1HPCYHRFimOr9czISXLWQHNeWCzbmqU5RgLqPSc3CYU6Ag2mYeziyCwCere+KGFqPY2KQsDb8wn+2j7d8j3xmdU/w1Wfuqo0NepGTixUQCVUpu68IprwlTzeZ1aUZHfhudOXRVHJgvlUK/2+VM8WSE3Ng4X/2puSe78Gjtdl+dM5ExH4lEw0OJxt5mVv+WARGMk5h+uhTEuHx0=; 25:vy7CULDKSyBTme5Cf9ktBekKMtCZSI+sbKuY1nTOxanRrsiD+g733lPulYnycSEByIuHn3iqJn3p9VRBxKAI6GdOoxJyRnKWo3OhLW96yoSYHiDDibbaLNLFSmXxHTdh16xI/qs9LXaQ7NMs6uO5nqztF9kpSbX1FUNUrna+HEUSrtYCopPKhSX6VqkuzppSzlG3SV8eSkW8Z0bahkBPBye0olJHeeESkyYpbKJTKsIOuK+kQ2VTr9BP/v1vvzQ77nz01jj0DaVrGIE6N/0tYZQekwk8usGVZAQ6wgA0nUx/jf8NEqUFxEgABBPEqHIZ3Aah7gFGqpgJRYi+DLC/TqzBzto8avgIV/mcQMWISJTBfmQkfKohd2oQGBbaC8EKQ9dMLmEvsKIWAjl6qIqbMnB46Hd2PKc/M6UbbktZYqz+71PVhkeIPo7cpfCO9ixpv9M9XxtLxWEshzHsKQmUZw== X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 31:1ajA22Cv0ZKnftjMSSUfLLIzEjwtsoKZ/s0vjU/FJhuAT5Y6AyTxGst4Vr3eJ2IK4BtfacnphcN7WmBK5F+h+PYmPT901UkqQU2slLJELbzP8tuUqSdaWJGO6boBJf/z2QVaEem8DQ1oEVJv0K/Hin9fzhjOPvS12FGJikpf2KJ44nIjMiEhgozt+b35c2g7QUcJ/DZVVTm/B7g9WOMZEF7uTgN4ghGOR3wqTMNQrS0=; 20:Z+OZiM88CBvhCOlWB/D82Qxe7dG+G5InDDvmKXa2TJ+Rn/PVF6ZQv+ZKLzBO9gEmBGr87XMo6hLc1XOJfSIE/U0KbwBnpiFr9aKoHHQ1EvTPgtckAVuwTjBvXZJFf0t0/RsANSaXvWTf8/YZds8u01nPSPj6lFqCmBE9EAA33nx/RIvJLcSM9vjcXTEpUdZlAbNuNr3TryFWcqatm9Ms8Xjcq2P1FGCbQt59YE7hXkYbnQIdeTEuBiiUXySPRrmc3EsFQzLwOh6VTVfppcEbcH6GxDtCm2JHW15O7JjrPK18Y+fEATU2YII559bnWwWWCUfWyBybXIrByXQt+eoOnu9MKsEGEbbcnQ5KwYDE4Ui6kQtBLVVFfsz1XiahX3npT5FstBw3YIH+CaUmFbGvm0FPkcGIwacRs+ZFHWB+pW3riEdEXnIkU12JDAGcugCL1HsAy2h/lrxM+iCQQ7T3k/UOFQaNCiKXNr0YSuEB8s5hGOkrH88pyY/YwB9N+3dc X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123564025)(20161123562025)(20161123560025)(20161123555025)(20161123558025)(6072148); SRVR:CY4PR12MB1239; BCL:0; PCL:0; RULEID:; SRVR:CY4PR12MB1239; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 4:vLNrHVLa1P3JPAG1TTf2ao81RnXSoLNq0XpXRZAwzl/X+HNSbivht6cSVuKzHRUAgv+930kb2LlUDTxwcbKiE+DxOfLfGE31xbAtxV2+StpHCcKVJZaCbeckZxnGALbix13wEMtN9+FDG+AftvV+qnvGIilreRIl3Z2ODLtT5/hMpCsHo/s7U8Xp7S7IUACQKJnjl9zq6ZCrQAobDuP6JLpmw7Ko4L2oAnp+NEG400uKeI36TMdFQs+hHx4C2FFj/4P49vQVmOsE3SduwSfnGI7dwMSKkryEAtBbXrL0nU9KlPURdNsRC5YCxv98y0mfOixHvg1DjgPbERIV5OUtxWu5tkmHSgR4D640h7yCy2PvjyCzPjqGHYwPuPZqJ5a2jkvbcRgyNEUh5GN54OxK5SoNITGUu2qbXSjXM2TWT4jL75l1MD59dP4UKFpG+Co7BKT1uKX1gLgqbFdlVM6pdkZrG9diZTIS5w04FT7hwMgOtoPebqBEHPoFx9BvuPZUedXekKIovUiGX87T5PM4XUk328Ia2eJFAs8pw+m/gVCDgksODaNOWnQKYMysd0mHU6Oh7a7CSkt10aNQIwyPRZA0HISJfiBOdND9jFNF4LZlrHfWUWHSnYgwCvch/ePACRxL8bpPS2LUjLRxGmvnEnAWvdaWEje4TZOxRx9INTRgRsmcpgiTNDc+wBOCXhPZAcbsFuWVBgsO8jdUs4AG3g== X-Forefront-PRVS: 023495660C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6029001)(6009001)(7916002)(39850400002)(39450400003)(39410400002)(39860400002)(39840400002)(76176999)(6486002)(2906002)(50986999)(25786008)(6116002)(189998001)(6666003)(7736002)(36756003)(6916009)(2950100002)(3846002)(305945005)(5660300001)(66066001)(50226002)(42186005)(53416004)(47776003)(4326008)(48376002)(50466002)(33646002)(81166006)(92566002)(8676002)(110136004)(38730400002)(5003940100001)(86362001)(54906002)(53936002)(2351001)(575784001)(19627235001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1239; H:leduran-Precision-WorkStation-T5400.amd.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR12MB1239; 23:EqmyE7xAtBAkRqwA699n3oD/MdSSLNh6DDqc9Vz0p?= =?us-ascii?Q?QmimxAPidwvH4O2rDus9Dg4XRE4CAAoWyb6zLtth0FKa5SEOWBR79Fm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7BxB3OCC+6LAmxQkAW4aoFE/DXH?= =?us-ascii?Q?Rqan0PuM3D1IaINAiE+eHACycojmhvPstlDggtPxdrG9cxgj9y25NGOkXqhg?= =?us-ascii?Q?aN85mCCh2yUS9ChvDHJel2xg/pw8Z1ggjRLrs2HZPgSJSpmTdaJkAcUk5VEc?= =?us-ascii?Q?zUfopxXoctJo+wmqErYrAfaGXGAASuZ?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 6:tZJNswRuG/fMXOaRS1A7yDsvmgQiVjnNEAOsr3Vfa1/TtrwH+5/iIVXRuu+Orf45tK2enX/2PLJokUNwAM8HaREgizVYTnuLycVbGEWVBfA6O6+8THyvCVuBrlbNdWk5WtI0ujChsyFw3avIxVanninj5+O8pUCv9xLlFwCr+HG9GDHVKZ/G4KXiaPAMkZJQ1mzdbt2vTyH1V7BoApoN4zBJ2wW10UqagrcVbrS6mI7cWpfnl/3M0rtoks18M327GJR2Cvlg9zHdqu5yt37DfWdUuEMonw7mcUISoHxYfecIGNsStOmY9Apsh0VDazVs+FCgQbhPPMT+j7WQDAqNJpYrjveWUv8DFs/XkU1MVUTjL03bSbqjI4Mb9azkc5kxmIu/NuivEnNqh1lSDpk/YUAE5zo4gtv36/16cqKktZE=; 5:O+4FJ8GwOER6oG/5xUA6Ewvh9wyV+XlGrP/26L75oAiTD0+wCMgAzt/yCeZ6jw2NuWbMQ8X8VEQvZkMSIHz7T4nrT1Mnyuv3nXlnzYAI8PLhIOPhcsGbHxPQrqAPOeb0YbPb7PvAIlsVLLNyKroUmw==; 24:sBLddpctKN0NG27F3oJpN7/tKUGqYMopD/XwSqJ0KqbPHj+6WbcDpOcppwD8qv6kHpZba/6guSp3QwOjwuG5B+fC6fkkmKVa+BvSc0XhRM8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 7:YXxnMluIrwK+ik1Zs6xkMiFwm0IDIdf6dgnuswVCEA4+1mW0AF58Fm+/EwAtyvaSBWMqOZ4lH8DD1CLQKj4AvO2uDDPi/oWOno8wGnWUvEs4bqMUQoE3xFfZINWyJTJNwMUNgrxCfRjC7CmfqgtCBfjle8BJqCZOQMOPmFeKHwU7iX8Mgzq1VqbWTqyY7S+Jkq0I+tfGjjZKpKLykn9h56SX9d5b6b7195Tne3N6Os6GP4FGfLE6Sl64+PTcJc8NLwE/uTDfg6LJt/KGHKs+L8TngR/lRXTc8XAxkN+XFVO6P8Y60mly+/zCkF+0HEvkGz+L0zVA2y8JrXaX1+Gfvg==; 20:Ogwwo5qRKwBl3VhK9Xy5N1PwcvnLafX4b7SRazQ/5muTBbXu+JIyKgdBqOb6W4JmLkeVVDKpMQ8pT8nwY9z0AhofV1wZezNRx2+6oJDdn/a951i6NxK915jhBURa/HQDH4hyPYXtPSbTyTUyZHxhRQ6mWnQJZrXpOo8FrLyZIaPaWM4TuWDS/PjFUwxCnWvCzQOZz79tzBL5JVw3wV56kxSHaPmEMGwDbuQGgOSv91XDottHCasz8VIHJUiJjmZO X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2017 18:46:47.6416 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1239 Subject: [edk2] [PATCH v4 5/6] OvmfPkg: Resolve BmDmaLib class for PciHostBridgeDxe driver X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jordan Justen , Leo Duran , Laszlo Ersek Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch adds the new DxeBmDmaLib (BmDmaLib class) library, which provides an abstraction layer for DMA operations implemented by the PciHostBridgeDxe driver. Cc: Jordan Justen Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Leo Duran Reviewed-by: Laszlo Ersek --- OvmfPkg/OvmfPkgIa32.dsc | 2 ++ OvmfPkg/OvmfPkgIa32X64.dsc | 2 ++ OvmfPkg/OvmfPkgX64.dsc | 2 ++ 3 files changed, 6 insertions(+) diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 0bce56b..345bbc7 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -3,6 +3,7 @@ # # Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
+# Copyright (c) 2017, AMD Inc. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the B= SD License @@ -90,6 +91,7 @@ UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServic= esLib.inf HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf + BmDmaLib|MdeModulePkg/Library/DxeBmDmaLib/DxeBmDmaLib.inf UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManag= erLib.inf BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index 56f7ff9..d798eb3 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -3,6 +3,7 @@ # # Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
+# Copyright (c) 2017, AMD Inc. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the B= SD License @@ -95,6 +96,7 @@ UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServic= esLib.inf HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf + BmDmaLib|MdeModulePkg/Library/DxeBmDmaLib/DxeBmDmaLib.inf UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManag= erLib.inf BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index d0b0b0e..b751974 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -3,6 +3,7 @@ # # Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
+# Copyright (c) 2017, AMD Inc. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the B= SD License @@ -95,6 +96,7 @@ UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServic= esLib.inf HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf + BmDmaLib|MdeModulePkg/Library/DxeBmDmaLib/DxeBmDmaLib.inf UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManag= erLib.inf BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat Nov 2 12:20:30 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 148848042405794.84485995202022; Thu, 2 Mar 2017 10:47:04 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 18EB78220C; Thu, 2 Mar 2017 10:46:51 -0800 (PST) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0615.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe4a::615]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7B4D6821FC for ; Thu, 2 Mar 2017 10:46:49 -0800 (PST) Received: from leduran-Precision-WorkStation-T5400.amd.com (165.204.77.1) by CY4PR12MB1239.namprd12.prod.outlook.com (10.168.167.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.933.12; Thu, 2 Mar 2017 18:46:48 +0000 X-Original-To: edk2-devel@ml01.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=4IcsrEKqzRFcJnZ7mMatdH/eTlX7hN6VHzwoSDoYzBY=; b=h2ioZmlzbF2Uteg1djqpC9QLmC5frM3GnELfNRGuF8ff+nVbfxtVhNOg2RtqZsjsdCh/iZiixzJifOijVkaFVMcZPDsFlTowzt4cDLHJmvx1kkkrp4oMZj6XJWAre8gICxM3pNpl/ChbgkmM8und6BzLuJuusN90a1Fi8SWLCDY= Authentication-Results: ml01.01.org; dkim=none (message not signed) header.d=none;ml01.01.org; dmarc=none action=none header.from=amd.com; From: Leo Duran To: Date: Thu, 2 Mar 2017 12:46:36 -0600 Message-ID: <1488480396-32358-7-git-send-email-leo.duran@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488480396-32358-1-git-send-email-leo.duran@amd.com> References: <1488480396-32358-1-git-send-email-leo.duran@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: DM5PR17CA0027.namprd17.prod.outlook.com (10.173.128.141) To CY4PR12MB1239.namprd12.prod.outlook.com (10.168.167.14) X-MS-Office365-Filtering-Correlation-Id: 7c84e0f1-2de5-40cf-b2d8-08d4619c7b9c X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081); SRVR:CY4PR12MB1239; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 3:Q3Tolpv4PsOsX+y69pO6AbzXnJpZyJdSnduPbIVuhcZho7JYpAaJUuYjxQkwTMDGgVNDK/kM8GISHQ1ouFq9aSMcZeRfmnT9fM0YzeJMZwJhBIj7kLLhwcUPpGtgW8CMe862Ge3bDmQ0Pa7a3oOi87HkT3VtgL/+TshVEcmeUnJs2ip3W8jBHQBryClXlFgPimOtZZKFmp6mAar5MLMF9LuGTTFfV+KHnCjeA02Zg+YxHU7N4AJtK55WkkdicGaOadDAWpHYGwxA06wJbtf5bjqdiXZdHSud5+3+pBqQmtI=; 25:h+CPigiDmpzuMtZpg6OjB+b5G4M41cDoLIHe9UyV4sgs4ZRkct5hoNNqjxO3W7BLuG+7F4LtWkHy0Xpsifohh9j5unhHGm7rh1TXBbWjlssVFi8JwDW7NC1y4Og3B144VEJtDQ8LsN2bcvshinEJUl+byL4FOxbLrJ0uifQ8i0zOhDTJVJpruOX+XJ3YhRN9aQm3oaiLPYURgp2D53sal0etGiTbUDSSCIjGyJBHnXc7RJNEyeDEQHYvmfVoTK00nMvvkiesxs8TRcp2Wyjda/PQ7L/0K6BCyl6tYeyxa0pS1WPrWTZjlLegZRm9zpKJ9vqaIeFu0CxHUJHanFjSFWwQeKBHCrtofkMf5xycCoI53MlM9Dc6pG09lQngz8PaiaJGUef4I6x4EzHzGKCvUl40Lp2MRdnPUSgUd2qc7nfwfoYAvuD0LnzawajlTuwPkYJYY0ckTIRjbkkftGNIIw== X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 31:7K7Ovlz1FLgyJ1A/47+Qe8A2s+ft/Os+O+wBAyom3FnFbUdFliqcURs8SJJRzMER3lxzoks9+PKoZku4j+DmnQDP8+Avm4P7SK3CJUJd85esKJ2eQQwSpuI6IOCDX72C5MkKpco5OqvxG1RZEqslufSPcfYaSkKkAwKenLbFxX8HtJh53SyO3iGjGgYl8RW0w6S+Sb5tkvhvROv+U40JxLOvZi/3OqfFWvvtzxUjddY=; 20:9AesNJQ1HbZ8jPuLBW+/zTW8bKg4K65/B8TAVoiBfbTsJ39fr7WFjUODBlsJlQ2viUmKnHnnuipknM4hjp5zYCzyR7gpnJ1n4VNEB53rPflZaCorfmLRyGWqfV/EQuoDbq3JqR+DagZ8fjajhoPbWXfYiRwFbrxvhSuoWff+wVy4VuMIAM8omjK5Mx+Dcu7cEQ050MFrJeZILM0bZFfcEAeqoS0rvTbdWwqKJd5Srv2NBLGEh1PWQXWYwzPjn4MwcWcN8/Pey98Wo0rWofxX+hUv2DYRz4Wr8mlZ9b6JA+c3N6SwJQTsWkco/jOxIxhET14XKgdwXvYWIVOt//wqULUzjMR0GyLI31UpmkakZTd2MvacJnmfSK7611e+N+fDNsJMCG2hyPXnlc5rUG2VIwVhZiyU3OVFc6/utOwAL5AbD1AybuR/34MiwhIRxZNGjbs1N41We6Gd2CB3q1Xn9z21w6uPuxqdXnjbQv1gWQjhvn/mkuy8cKdcwEAyUtZ/ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123564025)(20161123562025)(20161123560025)(20161123555025)(20161123558025)(6072148); SRVR:CY4PR12MB1239; BCL:0; PCL:0; RULEID:; SRVR:CY4PR12MB1239; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 4:r8B5tU0QxpE6cvMoPdGh1MoPkqAuI1WuR8Q1omf3kxZ2Xx90xgOrHox70iQe612HL0BveTwDIXjnuN1IYFMQR8BBx0lDt97NJM88JnzHS0pOodLzljaSZLtfNCN8/XuzLg2rlGV+GD977z4ivppu2vySaQi3tQlVwTNZ9Q48lvcQUJONZR4N4ZgqP4qnKGdGv6iGm+/1s8GcAieVcPQ41wDIH8JPoszrZrv0kHn8lveGS5XLSs4fmmCZmzPK0lV/kBRdoNUqCso8nipxf8XrgoPuYRyofWznqdD5NnmvaIWtJpy7v+RBmi1hsSg0/7sHyZDuEDh5ByL+rkT2VRw4AAri+drq1kc6+pkuBxqDEUjUguHA0DgMnoePghxN6rK0S90q8H0abexUVpdk3VNxxedkifQTYPag0jh2sj5Y9kJSfGUFJEZkm9BzCAWKWXr61MRHQw5BGUGqBml0pFjy+g+t8tWWQrtbaa6xBan8pUEYyngNB9UfSDTJZ0YyjWZH3QSf+NxSbqBkTNJPupHenevnSF8+nAMm/XDWnbKsMChuCJlyT0Ptv3JQitO3tN+7ZMpgrIZfqhAgBuaAZS0sHUGpGcPH/Cl0njOO4BSTEQnBAQ/j6wrl8eDAukaPgPXd6vFD7K70tpe56buAwDfELGWNarB7qFxGa1vs/niiv0+7XxLNOp1Kqh6Ib8YhaYvKLcQCfy6lV2xBa16xwYnn+g== X-Forefront-PRVS: 023495660C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6029001)(6009001)(7916002)(39850400002)(39450400003)(39410400002)(39860400002)(39840400002)(76176999)(6486002)(2906002)(50986999)(25786008)(6116002)(189998001)(6666003)(7736002)(36756003)(6916009)(2950100002)(3846002)(305945005)(5660300001)(66066001)(50226002)(42186005)(53416004)(47776003)(4326008)(48376002)(50466002)(33646002)(81166006)(92566002)(8676002)(110136004)(38730400002)(5003940100001)(86362001)(54906002)(53936002)(2351001)(19627235001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1239; H:leduran-Precision-WorkStation-T5400.amd.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR12MB1239; 23:mtTTym2rE5nNudVwqWhIuu53AVLKQyBlIlBOtMF0A?= =?us-ascii?Q?fv6+fwymo3S+AlgpfTv7qZIOp+WFWU4fAV0mh/LX5u6q+KV2nENzfdJ10Ffs?= =?us-ascii?Q?bYobeQv1RlUnPXWDEbspU1AvTigsXtf4xmnHba3X1ijv2/4nvK61Jq3h1/A0?= =?us-ascii?Q?iurRLa53XxAujKfBAqRT4HW/sZIXG9QHRdDVFj7dqTP7HbWJGkBySUtJoeFK?= =?us-ascii?Q?K4JHh8kEraQCY75bdZkiD8PlA2zHt1DjLaOq5ur1cdSk6BsNHmCKaVYT/CwO?= =?us-ascii?Q?y65a4I+0c4nJsS/blCtx3DtYbl2eq2szgZ6D5lqV8TX5fdTYwxOBL9Hqcets?= =?us-ascii?Q?nxHICc8LWOc728kZ8nrKgdQF6zGhNUko5AU4lnIMj/NtgRtXLqbKHPjSgVDk?= =?us-ascii?Q?2l/DH9D7iGDspVfQCHWFdm+j6kwl48jjbZLMQbx6CgzriIj4rpM0avcvOyVt?= =?us-ascii?Q?0PNdhtczvqz8ClMQXr275BjFqer4SQsVnfFvyBCBehWu18PMRNIfP9SRPGvH?= =?us-ascii?Q?mETasDdKyPMv/9tSq7CHmupKdaoC3TYLtoLdnm3M98IcnEcJhmVPms6DuU5l?= =?us-ascii?Q?UmyB+vg3MfDHdxrxE7WjvPs4kgO41jA2p5t4SPegYfsHJq+wf8f6V3sFMf4/?= =?us-ascii?Q?+oxbS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4Vcv/c7Xh2tserMr4bLwl41uN8UC30WfiuijhzZMIECMwwSfc9FDprZOvL2Jyy82qD9Bt1WcL1U8V6ho4lYEvOvRd5p9/PoifH/+I3ro9xso6NF9VSP1znVatoBZOMCNujaZWnWKo0iy1uw==; 24:mL9QwjiLtup27Gz90EWZ1XKa7tQcYxTH3LtupyRFI6MxMxk/LXgAg/kmQNSMASbKFFuwud+i2HNpmY2q8yLM+HX9Uj41XYw46UwMnCegg2M= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1239; 7:Nneu7bPC8zY7BuPZbyk2XND6HtPUdmQAsJIxACjs6ecmq29XMkCgFsilif23LFzqxD1mawiC6CUdyuROiChPTr0/LBOOPC8yTJ8CZo8yGHYUW8wzlDxOIpF1Q8lAVpmkcp091jFDNdNcufikAi0GBkJs/HOuzX9wcWSMk9Z3b1Q023SV7s1knMZEgSKiAi+qoK8IGvyTGzxxNnmwC5DzR7QalUGtL0dU4mh5JylTippzDors9MdigvTYNU1LCyU6ZsF5wJ24+u/bgvu6YxcfgeHClNu2LLzy32XnOMtG+k6IWpb98qZQrHZJ/Q4jlVA5WBhLmNJKkeqnL5+A6MjrRA==; 20:H7ghz7XAIz9yrsHCR6uUcyKl0YGYJ8wgOf4+mzWKzTIuJu9oUH7GW+9u1WIMSsdhHJn5r0O7ryHiwPvM+wWWprbXFxOx3hZ4cp8NNIu4LrMJiOwWNUayDACFkXKQa597UeBppd9xfLkY1lHEj1DywFhJDNl6q8fokX3vNkZWzm5cyApaeYNeXxqmpAS1uDsuX4CUjlZ/oa2JHZpbTZYuE/nNSNdtoKfMRYTvsfy6YlxOTTMWYkJSj3cnPsI9J6oA X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2017 18:46:48.0560 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1239 Subject: [edk2] [PATCH v4 6/6] MdeModulePkg: Modify PciHostBridgeDxe to use new BmDmaLib class library X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Feng Tian , Leo Duran , Star Zeng Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The BmDmaLib class library provides an abstraction layer for Bus-master DMA operations as currently implemented by the PciHostBridgeDxe driver. The intent is to allow override of the library as required by specific hardware implementations, such as AMD's Secure Encrypted Virtualization (SEV). Cc: Feng Tian Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.0 signed-off-by: Leo Duran --- .../Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf | 1 + .../Bus/Pci/PciHostBridgeDxe/PciRootBridge.h | 15 +- .../Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c | 274 +++++------------= ---- 3 files changed, 70 insertions(+), 220 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf b/M= deModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf index d8b0439..35bb5c4 100644 --- a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf +++ b/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf @@ -42,6 +42,7 @@ BaseLib PciSegmentLib PciHostBridgeLib + BmDmaLib =20 [Protocols] gEfiMetronomeArchProtocolGuid ## CONSUMES diff --git a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridge.h b/MdeMod= ulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridge.h index 13185b4..ca68bba 100644 --- a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridge.h +++ b/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridge.h @@ -3,6 +3,8 @@ The PCI Root Bridge header file. =20 Copyright (c) 1999 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2017, AMD Incorporated. 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 @@ -34,6 +36,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER= EXPRESS OR IMPLIED. #include #include #include +#include #include "PciHostResource.h" =20 =20 @@ -43,17 +46,6 @@ typedef enum { PciOperation } OPERATION_TYPE; =20 -#define MAP_INFO_SIGNATURE SIGNATURE_32 ('_', 'm', 'a', 'p') -typedef struct { - UINT32 Signature; - LIST_ENTRY Link; - EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION Operation; - UINTN NumberOfBytes; - UINTN NumberOfPages; - EFI_PHYSICAL_ADDRESS HostAddress; - EFI_PHYSICAL_ADDRESS MappedHostAddress; -} MAP_INFO; -#define MAP_INFO_FROM_LINK(a) CR (a, MAP_INFO, Link, MAP_INFO_SIGNATURE) =20 #define PCI_ROOT_BRIDGE_SIGNATURE SIGNATURE_32 ('_', 'p', 'r', 'b') =20 @@ -79,7 +71,6 @@ typedef struct { EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL RootBridgeIo; =20 BOOLEAN ResourceSubmitted; - LIST_ENTRY Maps; } PCI_ROOT_BRIDGE_INSTANCE; =20 #define ROOT_BRIDGE_FROM_THIS(a) CR (a, PCI_ROOT_BRIDGE_INSTANCE, RootBrid= geIo, PCI_ROOT_BRIDGE_SIGNATURE) diff --git a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c b/MdeM= odulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c index 8af131b..7b861c7 100644 --- a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c +++ b/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c @@ -3,6 +3,8 @@ PCI Root Bridge Io Protocol code. =20 Copyright (c) 1999 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2017, AMD Incorporated. 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 @@ -17,7 +19,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER= EXPRESS OR IMPLIED. #include "PciRootBridge.h" #include "PciHostResource.h" =20 -#define NO_MAPPING (VOID *) (UINTN) -1 =20 // // Lookup table for increment values based on transfer widths @@ -55,6 +56,39 @@ UINT8 mOutStride[] =3D { 0 // EfiPciWidthFillUint64 }; =20 + +BM_DMA_OPERATION +ConvertDmaOperation ( + IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION RbOperation + ) +{ + BM_DMA_OPERATION BmOperation; + + switch (RbOperation) { + case EfiPciOperationBusMasterRead: + case EfiPciOperationBusMasterRead64: + BmOperation =3D DmaOperationBusMasterRead; + break; + + case EfiPciOperationBusMasterWrite: + case EfiPciOperationBusMasterWrite64: + BmOperation =3D DmaOperationBusMasterWrite; + break; + + case EfiPciOperationBusMasterCommonBuffer: + case EfiPciOperationBusMasterCommonBuffer64: + BmOperation =3D DmaOperationBusMasterCommonBuffer; + break; + + default: + BmOperation =3D DmaOperationBusMasterMaximum; + break; + } + + return BmOperation; +} + + /** Construct the Pci Root Bridge instance. =20 @@ -168,7 +202,6 @@ CreateRootBridge ( TypeMax * sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) + sizeof (EFI_ACP= I_END_TAG_DESCRIPTOR) ); ASSERT (RootBridge->ConfigBuffer !=3D NULL); - InitializeListHead (&RootBridge->Maps); =20 CopyMem (&RootBridge->Bus, &Bridge->Bus, sizeof (PCI_ROOT_BRIDGE_APERTUR= E)); CopyMem (&RootBridge->Io, &Bridge->Io, sizeof (PCI_ROOT_BRIDGE_APERTURE)= ); @@ -1053,118 +1086,27 @@ RootBridgeIoMap ( OUT VOID **Mapping ) { - EFI_STATUS Status; - PCI_ROOT_BRIDGE_INSTANCE *RootBridge; - EFI_PHYSICAL_ADDRESS PhysicalAddress; - MAP_INFO *MapInfo; - - if (HostAddress =3D=3D NULL || NumberOfBytes =3D=3D NULL || DeviceAddres= s =3D=3D NULL || - Mapping =3D=3D NULL) { - return EFI_INVALID_PARAMETER; - } - - // - // Make sure that Operation is valid - // - if ((UINT32) Operation >=3D EfiPciOperationMaximum) { - return EFI_INVALID_PARAMETER; - } + PCI_ROOT_BRIDGE_INSTANCE *RootBridge; + BOOLEAN DmaAbove4GB; + BM_DMA_OPERATION BmOperation; =20 RootBridge =3D ROOT_BRIDGE_FROM_THIS (This); - - PhysicalAddress =3D (EFI_PHYSICAL_ADDRESS) (UINTN) HostAddress; - if ((!RootBridge->DmaAbove4G || - (Operation !=3D EfiPciOperationBusMasterRead64 && - Operation !=3D EfiPciOperationBusMasterWrite64 && - Operation !=3D EfiPciOperationBusMasterCommonBuffer64)) && - ((PhysicalAddress + *NumberOfBytes) > SIZE_4GB)) { - - // - // If the root bridge or the device cannot handle performing DMA above - // 4GB but any part of the DMA transfer being mapped is above 4GB, then - // map the DMA transfer to a buffer below 4GB. - // - - if (Operation =3D=3D EfiPciOperationBusMasterCommonBuffer || - Operation =3D=3D EfiPciOperationBusMasterCommonBuffer64) { - // - // Common Buffer operations can not be remapped. If the common buff= er - // if above 4GB, then it is not possible to generate a mapping, so r= eturn - // an error. - // - return EFI_UNSUPPORTED; - } - - // - // Allocate a MAP_INFO structure to remember the mapping when Unmap() = is - // called later. - // - MapInfo =3D AllocatePool (sizeof (MAP_INFO)); - if (MapInfo =3D=3D NULL) { - *NumberOfBytes =3D 0; - return EFI_OUT_OF_RESOURCES; - } - - // - // Initialize the MAP_INFO structure - // - MapInfo->Signature =3D MAP_INFO_SIGNATURE; - MapInfo->Operation =3D Operation; - MapInfo->NumberOfBytes =3D *NumberOfBytes; - MapInfo->NumberOfPages =3D EFI_SIZE_TO_PAGES (MapInfo->NumberOfByt= es); - MapInfo->HostAddress =3D PhysicalAddress; - MapInfo->MappedHostAddress =3D SIZE_4GB - 1; - - // - // Allocate a buffer below 4GB to map the transfer to. - // - Status =3D gBS->AllocatePages ( - AllocateMaxAddress, - EfiBootServicesData, - MapInfo->NumberOfPages, - &MapInfo->MappedHostAddress - ); - if (EFI_ERROR (Status)) { - FreePool (MapInfo); - *NumberOfBytes =3D 0; - return Status; - } - - // - // If this is a read operation from the Bus Master's point of view, - // then copy the contents of the real buffer into the mapped buffer - // so the Bus Master can read the contents of the real buffer. - // - if (Operation =3D=3D EfiPciOperationBusMasterRead || - Operation =3D=3D EfiPciOperationBusMasterRead64) { - CopyMem ( - (VOID *) (UINTN) MapInfo->MappedHostAddress, - (VOID *) (UINTN) MapInfo->HostAddress, - MapInfo->NumberOfBytes - ); - } - - InsertTailList (&RootBridge->Maps, &MapInfo->Link); - - // - // The DeviceAddress is the address of the maped buffer below 4GB - // - *DeviceAddress =3D MapInfo->MappedHostAddress; - // - // Return a pointer to the MAP_INFO structure in Mapping - // - *Mapping =3D MapInfo; - } else { - // - // If the root bridge CAN handle performing DMA above 4GB or - // the transfer is below 4GB, so the DeviceAddress is simply the - // HostAddress - // - *DeviceAddress =3D PhysicalAddress; - *Mapping =3D NO_MAPPING; - } - - return EFI_SUCCESS; + DmaAbove4GB =3D RootBridge->DmaAbove4G && ( + Operation =3D=3D EfiPciOperationBusMasterRead64 || + Operation =3D=3D EfiPciOperationBusMasterWrite64 || + Operation =3D=3D EfiPciOperationBusMasterCommonBuffer64 + ); + + BmOperation =3D ConvertDmaOperation (Operation); + + return BmDmaMap ( + DmaAbove4GB, + BmOperation, + HostAddress, + NumberOfBytes, + DeviceAddress, + Mapping + ); } =20 /** @@ -1191,58 +1133,7 @@ RootBridgeIoUnmap ( IN VOID *Mapping ) { - MAP_INFO *MapInfo; - LIST_ENTRY *Link; - PCI_ROOT_BRIDGE_INSTANCE *RootBridge; - - RootBridge =3D ROOT_BRIDGE_FROM_THIS (This); - // - // See if the Map() operation associated with this Unmap() required a ma= pping - // buffer. If a mapping buffer was not required, then this function simp= ly - // returns EFI_SUCCESS. - // - if (Mapping =3D=3D NO_MAPPING) { - return EFI_SUCCESS; - } - - MapInfo =3D NO_MAPPING; - for (Link =3D GetFirstNode (&RootBridge->Maps) - ; !IsNull (&RootBridge->Maps, Link) - ; Link =3D GetNextNode (&RootBridge->Maps, Link) - ) { - MapInfo =3D MAP_INFO_FROM_LINK (Link); - if (MapInfo =3D=3D Mapping) { - break; - } - } - // - // Mapping is not a valid value returned by Map() - // - if (MapInfo !=3D Mapping) { - return EFI_INVALID_PARAMETER; - } - RemoveEntryList (&MapInfo->Link); - - // - // If this is a write operation from the Bus Master's point of view, - // then copy the contents of the mapped buffer into the real buffer - // so the processor can read the contents of the real buffer. - // - if (MapInfo->Operation =3D=3D EfiPciOperationBusMasterWrite || - MapInfo->Operation =3D=3D EfiPciOperationBusMasterWrite64) { - CopyMem ( - (VOID *) (UINTN) MapInfo->HostAddress, - (VOID *) (UINTN) MapInfo->MappedHostAddress, - MapInfo->NumberOfBytes - ); - } - - // - // Free the mapped buffer and the MAP_INFO structure. - // - gBS->FreePages (MapInfo->MappedHostAddress, MapInfo->NumberOfPages); - FreePool (Mapping); - return EFI_SUCCESS; + return BmDmaUnmap (Mapping); } =20 /** @@ -1282,56 +1173,23 @@ RootBridgeIoAllocateBuffer ( IN UINT64 Attributes ) { - EFI_STATUS Status; - EFI_PHYSICAL_ADDRESS PhysicalAddress; - PCI_ROOT_BRIDGE_INSTANCE *RootBridge; - EFI_ALLOCATE_TYPE AllocateType; + PCI_ROOT_BRIDGE_INSTANCE *RootBridge; + BOOLEAN DmaAbove4GB; =20 - // - // Validate Attributes - // if ((Attributes & EFI_PCI_ATTRIBUTE_INVALID_FOR_ALLOCATE_BUFFER) !=3D 0)= { return EFI_UNSUPPORTED; } =20 - // - // Check for invalid inputs - // - if (HostAddress =3D=3D NULL) { - return EFI_INVALID_PARAMETER; - } - - // - // The only valid memory types are EfiBootServicesData and - // EfiRuntimeServicesData - // - if (MemoryType !=3D EfiBootServicesData && - MemoryType !=3D EfiRuntimeServicesData) { - return EFI_INVALID_PARAMETER; - } - RootBridge =3D ROOT_BRIDGE_FROM_THIS (This); + DmaAbove4GB =3D RootBridge->DmaAbove4G && + (Attributes & EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE) !=3D= 0; =20 - AllocateType =3D AllocateAnyPages; - if (!RootBridge->DmaAbove4G || - (Attributes & EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE) =3D=3D 0) { - // - // Limit allocations to memory below 4GB - // - AllocateType =3D AllocateMaxAddress; - PhysicalAddress =3D (EFI_PHYSICAL_ADDRESS) (SIZE_4GB - 1); - } - Status =3D gBS->AllocatePages ( - AllocateType, - MemoryType, - Pages, - &PhysicalAddress - ); - if (!EFI_ERROR (Status)) { - *HostAddress =3D (VOID *) (UINTN) PhysicalAddress; - } - - return Status; + return BmDmaAllocateBuffer ( + DmaAbove4GB, + MemoryType, + Pages, + HostAddress + ); } =20 /** @@ -1356,7 +1214,7 @@ RootBridgeIoFreeBuffer ( OUT VOID *HostAddress ) { - return gBS->FreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) HostAddress, Pages= ); + return BmDmaFreeBuffer (HostAddress, Pages); } =20 /** --=20 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel