From nobody Sun May 5 08:17:22 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.zohomail.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 1506075730082412.6920161161653; Fri, 22 Sep 2017 03:22:10 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 52DF720945B70; Fri, 22 Sep 2017 03:19:01 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 D51FA21E43B64 for ; Fri, 22 Sep 2017 03:18:58 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP; 22 Sep 2017 03:22:06 -0700 Received: from shwdeopenpsi068.ccr.corp.intel.com ([10.239.9.31]) by orsmga003.jf.intel.com with ESMTP; 22 Sep 2017 03:22:05 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,427,1500966000"; d="scan'208";a="1017307631" From: Star Zeng To: edk2-devel@lists.01.org Date: Fri, 22 Sep 2017 18:22:01 +0800 Message-Id: <1506075722-54216-2-git-send-email-star.zeng@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 In-Reply-To: <1506075722-54216-1-git-send-email-star.zeng@intel.com> References: <1506075722-54216-1-git-send-email-star.zeng@intel.com> Subject: [edk2] [PATCH 1/2] MdePkg PiFirmwareFile.h: Add FFS_ATTRIB_DATA_ALIGNMENT_2 definition X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao , Star Zeng MIME-Version: 1.0 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" Follow PI 1.6 spec to add FFS_ATTRIB_DATA_ALIGNMENT_2 definition for FFS alignment extended to support maximum 16MB. Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng Reviewed-by: Liming Gao --- MdePkg/Include/Pi/PiFirmwareFile.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/MdePkg/Include/Pi/PiFirmwareFile.h b/MdePkg/Include/Pi/PiFirmw= areFile.h index 734344430aa6..b982c9eda3b6 100644 --- a/MdePkg/Include/Pi/PiFirmwareFile.h +++ b/MdePkg/Include/Pi/PiFirmwareFile.h @@ -1,7 +1,7 @@ /** @file The firmware file related definitions in PI. =20 -Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made availabl= e under the terms and conditions of the BSD License that accompanies this distribu= tion. The full text of the license may be found at @@ -11,7 +11,7 @@ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "A= S IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLI= ED. =20 @par Revision Reference: - PI Version 1.4. + PI Version 1.6. =20 **/ =20 @@ -86,6 +86,7 @@ typedef UINT8 EFI_FFS_FILE_STATE; /// FFS File Attributes. /// #define FFS_ATTRIB_LARGE_FILE 0x01 +#define FFS_ATTRIB_DATA_ALIGNMENT_2 0x02 #define FFS_ATTRIB_FIXED 0x04 #define FFS_ATTRIB_DATA_ALIGNMENT 0x38 #define FFS_ATTRIB_CHECKSUM 0x40 --=20 2.7.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sun May 5 08:17:22 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.zohomail.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 1506075732103269.4227390957774; Fri, 22 Sep 2017 03:22:12 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 8C68921CEB0E2; Fri, 22 Sep 2017 03:19:01 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 6D62C21E43B63 for ; Fri, 22 Sep 2017 03:19:00 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP; 22 Sep 2017 03:22:08 -0700 Received: from shwdeopenpsi068.ccr.corp.intel.com ([10.239.9.31]) by orsmga003.jf.intel.com with ESMTP; 22 Sep 2017 03:22:06 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,427,1500966000"; d="scan'208";a="1017307637" From: Star Zeng To: edk2-devel@lists.01.org Date: Fri, 22 Sep 2017 18:22:02 +0800 Message-Id: <1506075722-54216-3-git-send-email-star.zeng@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 In-Reply-To: <1506075722-54216-1-git-send-email-star.zeng@intel.com> References: <1506075722-54216-1-git-send-email-star.zeng@intel.com> Subject: [edk2] [PATCH 2/2] MdeModulePkg Core: Support FFS_ATTRIB_DATA_ALIGNMENT_2 X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Liming Gao , Star Zeng MIME-Version: 1.0 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" Follow PI 1.6 spec to support FFS_ATTRIB_DATA_ALIGNMENT_2 for FFS alignment extended to support maximum 16MB. Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng Reviewed-by: Liming Gao --- MdeModulePkg/Core/Dxe/FwVol/FwVolRead.c | 37 ++++++++++++++++++++++-------= ---- MdeModulePkg/Core/Pei/FwVol/FwVol.c | 35 +++++++++++++++++++++--------= -- 2 files changed, 49 insertions(+), 23 deletions(-) diff --git a/MdeModulePkg/Core/Dxe/FwVol/FwVolRead.c b/MdeModulePkg/Core/Dx= e/FwVol/FwVolRead.c index 00e0d7d289ec..c59c384f5c75 100644 --- a/MdeModulePkg/Core/Dxe/FwVol/FwVolRead.c +++ b/MdeModulePkg/Core/Dxe/FwVol/FwVolRead.c @@ -1,7 +1,7 @@ /** @file Implements functions to read firmware file =20 -Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2017, Intel Corporation. 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 @@ -16,18 +16,27 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITH= ER EXPRESS OR IMPLIED. #include "FwVolDriver.h" =20 /** -Required Alignment Alignment Value in FFS Alignment Va= lue in -(bytes) Attributes Field Firmware Vol= ume Interfaces -1 0 = 0 -16 1 = 4 -128 2 = 7 -512 3 = 9 -1 KB 4 = 10 -4 KB 5 = 12 -32 KB 6 = 15 -64 KB 7 = 16 +Required Alignment Alignment Value in FFS FFS_ATTRIB_DATA_ALIGNMENT2 = Alignment Value in +(bytes) Attributes Field in FFS Attributes Field = Firmware Volume Interfaces +1 0 0 = 0 +16 1 0 = 4 +128 2 0 = 7 +512 3 0 = 9 +1 KB 4 0 = 10 +4 KB 5 0 = 12 +32 KB 6 0 = 15 +64 KB 7 0 = 16 +128 KB 0 1 = 17 +256 KB 1 1 = 18 +512 KB 2 1 = 19 +1 MB 3 1 = 20 +2 MB 4 1 = 21 +4 MB 5 1 = 22 +8 MB 6 1 = 23 +16 MB 7 1 = 24 **/ UINT8 mFvAttributes[] =3D {0, 4, 7, 9, 10, 12, 15, 16}; +UINT8 mFvAttributes2[] =3D {17, 18, 19, 20, 21, 22, 23, 24}; =20 /** Convert the FFS File Attributes to FV File Attributes @@ -48,7 +57,11 @@ FfsAttributes2FvFileAttributes ( DataAlignment =3D (UINT8) ((FfsAttributes & FFS_ATTRIB_DATA_ALIGNMENT) >= > 3); ASSERT (DataAlignment < 8); =20 - FileAttribute =3D (EFI_FV_FILE_ATTRIBUTES) mFvAttributes[DataAlignment]; + if ((FfsAttributes & FFS_ATTRIB_DATA_ALIGNMENT_2) !=3D 0) { + FileAttribute =3D (EFI_FV_FILE_ATTRIBUTES) mFvAttributes2[DataAlignmen= t]; + } else { + FileAttribute =3D (EFI_FV_FILE_ATTRIBUTES) mFvAttributes[DataAlignment= ]; + } =20 if ((FfsAttributes & FFS_ATTRIB_FIXED) =3D=3D FFS_ATTRIB_FIXED) { FileAttribute |=3D EFI_FV_FILE_ATTRIB_FIXED; diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.c b/MdeModulePkg/Core/Pei/Fw= Vol/FwVol.c index 0bbb86d95819..c90a70b5f799 100644 --- a/MdeModulePkg/Core/Pei/FwVol/FwVol.c +++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.c @@ -75,18 +75,27 @@ EFI_PEI_PPI_DESCRIPTOR mPeiFfs3FvPpiList =3D { }; =20 /** -Required Alignment Alignment Value in FFS Alignment Va= lue in -(bytes) Attributes Field Firmware Vol= ume Interfaces -1 0 = 0 -16 1 = 4 -128 2 = 7 -512 3 = 9 -1 KB 4 = 10 -4 KB 5 = 12 -32 KB 6 = 15 -64 KB 7 = 16 +Required Alignment Alignment Value in FFS FFS_ATTRIB_DATA_ALIGNMENT2 = Alignment Value in +(bytes) Attributes Field in FFS Attributes Field = Firmware Volume Interfaces +1 0 0 = 0 +16 1 0 = 4 +128 2 0 = 7 +512 3 0 = 9 +1 KB 4 0 = 10 +4 KB 5 0 = 12 +32 KB 6 0 = 15 +64 KB 7 0 = 16 +128 KB 0 1 = 17 +256 KB 1 1 = 18 +512 KB 2 1 = 19 +1 MB 3 1 = 20 +2 MB 4 1 = 21 +4 MB 5 1 = 22 +8 MB 6 1 = 23 +16 MB 7 1 = 24 **/ UINT8 mFvAttributes[] =3D {0, 4, 7, 9, 10, 12, 15, 16}; +UINT8 mFvAttributes2[] =3D {17, 18, 19, 20, 21, 22, 23, 24}; =20 /** Convert the FFS File Attributes to FV File Attributes @@ -107,7 +116,11 @@ FfsAttributes2FvFileAttributes ( DataAlignment =3D (UINT8) ((FfsAttributes & FFS_ATTRIB_DATA_ALIGNMENT) >= > 3); ASSERT (DataAlignment < 8); =20 - FileAttribute =3D (EFI_FV_FILE_ATTRIBUTES) mFvAttributes[DataAlignment]; + if ((FfsAttributes & FFS_ATTRIB_DATA_ALIGNMENT_2) !=3D 0) { + FileAttribute =3D (EFI_FV_FILE_ATTRIBUTES) mFvAttributes2[DataAlignmen= t]; + } else { + FileAttribute =3D (EFI_FV_FILE_ATTRIBUTES) mFvAttributes[DataAlignment= ]; + } =20 if ((FfsAttributes & FFS_ATTRIB_FIXED) =3D=3D FFS_ATTRIB_FIXED) { FileAttribute |=3D EFI_FV_FILE_ATTRIB_FIXED; --=20 2.7.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel