From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4A7CE8222C for ; Tue, 21 Feb 2017 07:38:29 -0800 (PST) Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D214380F97; Tue, 21 Feb 2017 15:38:29 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-47.phx2.redhat.com [10.3.116.47]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1LFcGVG015879; Tue, 21 Feb 2017 10:38:29 -0500 From: Laszlo Ersek To: edk2-devel-01 Cc: Jordan Justen Date: Tue, 21 Feb 2017 16:38:12 +0100 Message-Id: <20170221153812.1420-7-lersek@redhat.com> In-Reply-To: <20170221153812.1420-1-lersek@redhat.com> References: <20170221153812.1420-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 21 Feb 2017 15:38:29 +0000 (UTC) Subject: [PATCH 6/6] OvmfPkg/QemuFwCfg: introduce FW_CFG_IO_DMA_ADDRESS, adapt the package 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: , X-List-Received-Date: Tue, 21 Feb 2017 15:38:29 -0000 Introduce the FW_CFG_IO_DMA_ADDRESS macro for IO Ports 0x514 and 0x518 (most significant and least significant halves of the DMA Address Register, respectively), and update all references in OvmfPkg. Cc: Jordan Justen Suggested-by: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- OvmfPkg/Include/IndustryStandard/QemuFwCfg.h | 1 + OvmfPkg/AcpiPlatformDxe/BootScript.c | 4 ++-- OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c | 4 ++-- OvmfPkg/SmmControl2Dxe/SmiFeatures.c | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h b/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h index 5da6b456febe..8c32f83e8e16 100644 --- a/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h +++ b/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h @@ -48,6 +48,7 @@ // #define FW_CFG_IO_SELECTOR 0x510 #define FW_CFG_IO_DATA 0x511 +#define FW_CFG_IO_DMA_ADDRESS 0x514 // // Numerically defined keys. diff --git a/OvmfPkg/AcpiPlatformDxe/BootScript.c b/OvmfPkg/AcpiPlatformDxe/BootScript.c index 1ad468e2f834..bff42ad8b9b0 100644 --- a/OvmfPkg/AcpiPlatformDxe/BootScript.c +++ b/OvmfPkg/AcpiPlatformDxe/BootScript.c @@ -317,7 +317,7 @@ TransferS3ContextToBootScript ( S3SaveState, // This EFI_BOOT_SCRIPT_IO_WRITE_OPCODE, // OpCode EfiBootScriptWidthUint32, // Width - (UINT64)0x514, // Address + (UINT64)FW_CFG_IO_DMA_ADDRESS, // Address (UINTN)2, // Count &BigEndianAddressOfAccess // Buffer ); @@ -376,7 +376,7 @@ TransferS3ContextToBootScript ( S3SaveState, // This EFI_BOOT_SCRIPT_IO_WRITE_OPCODE, // OpCode EfiBootScriptWidthUint32, // Width - (UINT64)0x514, // Address + (UINT64)FW_CFG_IO_DMA_ADDRESS, // Address (UINTN)2, // Count &BigEndianAddressOfAccess // Buffer ); diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c index d79d0a444ca7..3dd55ba5042e 100644 --- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c +++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c @@ -94,8 +94,8 @@ InternalQemuFwCfgDmaBytes ( // AccessHigh = (UINT32)RShiftU64 ((UINTN)&Access, 32); AccessLow = (UINT32)(UINTN)&Access; - IoWrite32 (0x514, SwapBytes32 (AccessHigh)); - IoWrite32 (0x518, SwapBytes32 (AccessLow)); + IoWrite32 (FW_CFG_IO_DMA_ADDRESS, SwapBytes32 (AccessHigh)); + IoWrite32 (FW_CFG_IO_DMA_ADDRESS + 4, SwapBytes32 (AccessLow)); // // Don't look at Access.Control before starting the transfer. diff --git a/OvmfPkg/SmmControl2Dxe/SmiFeatures.c b/OvmfPkg/SmmControl2Dxe/SmiFeatures.c index 73c29848b334..bd257f15d955 100644 --- a/OvmfPkg/SmmControl2Dxe/SmiFeatures.c +++ b/OvmfPkg/SmmControl2Dxe/SmiFeatures.c @@ -240,7 +240,7 @@ SaveSmiFeatures ( S3SaveState, // This EFI_BOOT_SCRIPT_IO_WRITE_OPCODE, // OpCode EfiBootScriptWidthUint32, // Width - (UINT64)0x514, // Address + (UINT64)FW_CFG_IO_DMA_ADDRESS, // Address (UINTN)2, // Count &AccessAddress // Buffer ); -- 2.9.3