From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 9688D81F42 for ; Thu, 1 Dec 2016 17:01:02 -0800 (PST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP; 01 Dec 2016 17:01:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,284,1477983600"; d="scan'208";a="36355692" Received: from awillke-mobl1.amr.corp.intel.com (HELO localhost) ([10.252.136.252]) by orsmga004.jf.intel.com with ESMTP; 01 Dec 2016 17:01:02 -0800 MIME-Version: 1.0 To: Laszlo Ersek , "edk2-devel-01" Message-ID: <148064046187.30145.7058829364051206838@jljusten-ivb> From: Jordan Justen In-Reply-To: <7b51a6a6-8d46-177c-9277-00c5af35816f@redhat.com> Cc: "Ard Biesheuvel" References: <20161201175633.2538-1-lersek@redhat.com> <20161201175633.2538-4-lersek@redhat.com> <148062086103.26637.11038536785691900096@jljusten-ivb> <7b51a6a6-8d46-177c-9277-00c5af35816f@redhat.com> User-Agent: alot/0.3.7 Date: Thu, 01 Dec 2016 17:01:01 -0800 Subject: Re: [PATCH 3/5] OvmfPkg/IndustryStandard: add QemuFwCfgDma.h 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: Fri, 02 Dec 2016 01:01:02 -0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On 2016-12-01 12:48:51, Laszlo Ersek wrote: > On 12/01/16 20:34, Jordan Justen wrote: > > On 2016-12-01 09:56:31, Laszlo Ersek wrote: > >> Add the type and macro definitions related to QEMU's DMA-like fw_cfg > >> access method in a dedicated header file. > >> > >> Cc: Ard Biesheuvel > >> Cc: Jordan Justen > >> Contributed-under: TianoCore Contribution Agreement 1.0 > >> Signed-off-by: Laszlo Ersek > >> --- > >> OvmfPkg/Include/IndustryStandard/QemuFwCfgDma.h | 50 ++++++++++++++++= ++++ > > = > > What do you think about just > > OvmfPkg/Include/IndustryStandard/QemuFwCfg.h? > > = > > Arguably, the FIRMWARE_CONFIG_ITEM enums could be moved there as > > well... > > = > > Then again, I think we could also just put this content into > > OvmfPkg/Include/Library/QemuFwCfgLib.h. > = > Adding this stuff to "OvmfPkg/Include/Library/QemuFwCfgLib.h" sounds > good to me; I'll do that in v2. > = Ok. By the way, I looked over the series, and with that change you can add Reviewed-by: Jordan Justen I'll let you decide if you want to send out a v2. -Jordan > = > > -Jordan > > = > >> 1 file changed, 50 insertions(+) > >> > >> diff --git a/OvmfPkg/Include/IndustryStandard/QemuFwCfgDma.h b/OvmfPkg= /Include/IndustryStandard/QemuFwCfgDma.h > >> new file mode 100644 > >> index 000000000000..37a5804adb05 > >> --- /dev/null > >> +++ b/OvmfPkg/Include/IndustryStandard/QemuFwCfgDma.h > >> @@ -0,0 +1,50 @@ > >> +/** @file > >> + Macro and type definitions related to QEMU's DMA-like fw_cfg access= method, > >> + based on "docs/specs/fw_cfg.txt" in the QEMU tree. > >> + > >> + Copyright (C) 2016, Red Hat, Inc. > >> + > >> + This program and the accompanying materials are licensed and made a= vailable > >> + under the terms and conditions of the BSD License which accompanies= this > >> + distribution. The full text of the license may be found at > >> + http://opensource.org/licenses/bsd-license.php > >> + > >> + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASI= S, WITHOUT > >> + WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIE= D. > >> +**/ > >> + > >> + > >> +#ifndef __FW_CFG_DMA__ > >> +#define __FW_CFG_DMA__ > >> + > >> +#include > >> + > >> +// > >> +// If the following bit is set in the UINT32 fw_cfg revision / featur= e bitmap > >> +// -- read from key 0x0001 with the basic IO Port or MMIO method --, = then the > >> +// DMA interface is available. > >> +// > >> +#define FW_CFG_F_DMA BIT1 > >> + > >> +// > >> +// Communication structure for the DMA access method. All fields are = encoded in > >> +// big endian. > >> +// > >> +#pragma pack (1) > >> +typedef struct { > >> + UINT32 Control; > >> + UINT32 Length; > >> + UINT64 Address; > >> +} FW_CFG_DMA_ACCESS; > >> +#pragma pack () > >> + > >> +// > >> +// Macros for the FW_CFG_DMA_ACCESS.Control bitmap (in native encodin= g). > >> +// > >> +#define FW_CFG_DMA_CTL_ERROR BIT0 > >> +#define FW_CFG_DMA_CTL_READ BIT1 > >> +#define FW_CFG_DMA_CTL_SKIP BIT2 > >> +#define FW_CFG_DMA_CTL_SELECT BIT3 > >> +#define FW_CFG_DMA_CTL_WRITE BIT4 > >> + > >> +#endif > >> -- = > >> 2.9.2 > >> > >> >=20