From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 1B39681D3B for ; Tue, 1 Nov 2016 05:08:05 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP; 01 Nov 2016 05:07:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,579,1473145200"; d="scan'208";a="780809663" Received: from sliu17-mobl1.ccr.corp.intel.com (HELO jyao1-MOBL.ccr.corp.intel.com) ([10.254.210.237]) by FMSMGA003.fm.intel.com with ESMTP; 01 Nov 2016 05:07:52 -0700 From: Jiewen Yao To: edk2-devel@lists.01.org Cc: Jeff Fan , Feng Tian , Star Zeng , Michael D Kinney , Liming Gao , Chao Zhang Date: Tue, 1 Nov 2016 20:07:39 +0800 Message-Id: <1478002060-10208-7-git-send-email-jiewen.yao@intel.com> X-Mailer: git-send-email 2.7.4.windows.1 In-Reply-To: <1478002060-10208-1-git-send-email-jiewen.yao@intel.com> References: <1478002060-10208-1-git-send-email-jiewen.yao@intel.com> Subject: [PATCH V7 6/7] UefiCpuPkg/MicrocodeUpdate: Add Microcode FMP build sample 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, 01 Nov 2016 12:08:05 -0000 This folder provides the sample build for Microcode FMP. The DSC/FDF is to convert the Microcode binary/text to Microcode FMP. Cc: Jeff Fan Cc: Feng Tian Cc: Star Zeng Cc: Michael D Kinney Cc: Liming Gao Cc: Chao Zhang Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao --- UefiCpuPkg/Feature/Capsule/MicrocodeCapsulePdb/MicrocodeCapsulePdb.dsc | 32 +++++++++++++++++ UefiCpuPkg/Feature/Capsule/MicrocodeCapsulePdb/MicrocodeCapsulePdb.fdf | 32 +++++++++++++++++ UefiCpuPkg/Feature/Capsule/MicrocodeCapsulePdb/Readme.md | 20 +++++++++++ UefiCpuPkg/Feature/Capsule/MicrocodeCapsuleTxt/Microcode/Microcode.inf | 27 ++++++++++++++ UefiCpuPkg/Feature/Capsule/MicrocodeCapsuleTxt/MicrocodeCapsuleTxt.dsc | 38 ++++++++++++++++++++ UefiCpuPkg/Feature/Capsule/MicrocodeCapsuleTxt/MicrocodeCapsuleTxt.fdf | 32 +++++++++++++++++ UefiCpuPkg/Feature/Capsule/MicrocodeCapsuleTxt/Readme.md | 33 +++++++++++++++++ 7 files changed, 214 insertions(+) diff --git a/UefiCpuPkg/Feature/Capsule/MicrocodeCapsulePdb/MicrocodeCapsulePdb.dsc b/UefiCpuPkg/Feature/Capsule/MicrocodeCapsulePdb/MicrocodeCapsulePdb.dsc new file mode 100644 index 0000000..b8ab08d --- /dev/null +++ b/UefiCpuPkg/Feature/Capsule/MicrocodeCapsulePdb/MicrocodeCapsulePdb.dsc @@ -0,0 +1,32 @@ +## @file +# +# Copyright (c) 2016, 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 +# 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 IMPLIED. +# +## + +[Defines] +# +# Uncomment the following line and update with your platform pkg name +# +# PLATFORM_NAME = + PLATFORM_GUID = 6875FD33-602E-4EF9-9DF2-8BA7D8B7A7AF + PLATFORM_VERSION = 0.1 +# +# Uncomment the following line and update with your platform pkg name +# +# FLASH_DEFINITION = /MicrocodeCapsulePdb/MicrocodeCapsulePdb.fdf +# +# Uncomment the following line and update with your platform pkg name +# +# OUTPUT_DIRECTORY = Build/ + SUPPORTED_ARCHITECTURES = IA32|X64 + BUILD_TARGETS = DEBUG|RELEASE + SKUID_IDENTIFIER = DEFAULT diff --git a/UefiCpuPkg/Feature/Capsule/MicrocodeCapsulePdb/MicrocodeCapsulePdb.fdf b/UefiCpuPkg/Feature/Capsule/MicrocodeCapsulePdb/MicrocodeCapsulePdb.fdf new file mode 100644 index 0000000..f171604 --- /dev/null +++ b/UefiCpuPkg/Feature/Capsule/MicrocodeCapsulePdb/MicrocodeCapsulePdb.fdf @@ -0,0 +1,32 @@ +## @file +# +# Copyright (c) 2016, 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 +# 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 IMPLIED. +# +## + +[FmpPayload.FmpPayloadMicrocode1] +IMAGE_HEADER_INIT_VERSION = 0x02 +IMAGE_TYPE_ID = 96d4fdcd-1502-424d-9d4c-9b12d2dcae5c # Microcode GUID (do not change it) +IMAGE_INDEX = 0x1 +HARDWARE_INSTANCE = 0x0 + +# +# Uncomment the following line and update with path to Microcode PDB file +# +#FILE DATA = $(WORKSPACE)//Microcode/Microcode.pdb + +[Capsule.MicrocodeCapsule] +CAPSULE_GUID = 6dcbd5ed-e82d-4c44-bda1-7194199ad92a # FMP special Guid (do not change it) +CAPSULE_FLAGS = PersistAcrossReset,InitiateReset +CAPSULE_HEADER_SIZE = 0x20 +CAPSULE_HEADER_INIT_VERSION = 0x1 + +FMP_PAYLOAD = FmpPayloadMicrocode1 diff --git a/UefiCpuPkg/Feature/Capsule/MicrocodeCapsulePdb/Readme.md b/UefiCpuPkg/Feature/Capsule/MicrocodeCapsulePdb/Readme.md new file mode 100644 index 0000000..9f81373 --- /dev/null +++ b/UefiCpuPkg/Feature/Capsule/MicrocodeCapsulePdb/Readme.md @@ -0,0 +1,20 @@ +# How to generate Microcode FMP from Microcode PDB file + +1) Copy directory `UefiCpuPkg/Feature/Capsule/MicrocodeUpdatePdb` to `/MicrocodeUpdatePdb`. + +2) Uncomment and update `FILE DATA` statement in `/MicrocodeUpdatePdb/MicrocodeCapsulePdb.fdf` with path to a Microcode PDB file. The PDB file can placed in `/MicrocodeUpdatePdb` or any other path. + +`FILE DATA = ` + +Uncomment and update `PLATFORM_NAME`, `FLASH_DEFINITION`, `OUTPUT_DIRECTORY` section in `/MicrocodeUpdatePdb/MicrocodeCapsulePdb.dsc` with . + + PLATFORM_NAME = + FLASH_DEFINITION = /MicrocodeCapsulePdb/MicrocodeCapsulePdb.fdf + OUTPUT_DIRECTORY = Build/ + +3) Use EDK II build tools to generate the Microcode FMP Capsule + +`build -p /MicrocodeCapsulePdb/MicrocodeCapsulePdb.dsc` + +4) The Microcode FMP Capsule is generated at `$(WORKSPACE)/$(OUTPUT_DIRECTORY)/$(TARGET)_$(TOOL_CHAIN_TAG)/FV/MicrocodeCapsule.Cap` + diff --git a/UefiCpuPkg/Feature/Capsule/MicrocodeCapsuleTxt/Microcode/Microcode.inf b/UefiCpuPkg/Feature/Capsule/MicrocodeCapsuleTxt/Microcode/Microcode.inf new file mode 100644 index 0000000..cb32936 --- /dev/null +++ b/UefiCpuPkg/Feature/Capsule/MicrocodeCapsuleTxt/Microcode/Microcode.inf @@ -0,0 +1,27 @@ +## @file +# Microcode text file to binary +# +# Convert text format microcode to binary format. +# +# Copyright (c) 2016, 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 +# 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 IMPLIED. +# +## + +[Defines] +BASE_NAME = Microcode +FILE_GUID = ABC36AAC-2031-4422-896E-0A3B899AD0B4 +COMPONENT_TYPE = Microcode +FFS_EXT = .ffs + +[Sources] +# +# Uncomment the following line and update with name of Microcode TXT file +# +#Microcode.txt diff --git a/UefiCpuPkg/Feature/Capsule/MicrocodeCapsuleTxt/MicrocodeCapsuleTxt.dsc b/UefiCpuPkg/Feature/Capsule/MicrocodeCapsuleTxt/MicrocodeCapsuleTxt.dsc new file mode 100644 index 0000000..9b7e026 --- /dev/null +++ b/UefiCpuPkg/Feature/Capsule/MicrocodeCapsuleTxt/MicrocodeCapsuleTxt.dsc @@ -0,0 +1,38 @@ +## @file +# +# Copyright (c) 2016, 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 +# 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 IMPLIED. +# +## + +[Defines] +# +# Uncomment the following line and update with your platform pkg name +# +# PLATFORM_NAME = + PLATFORM_GUID = 6875FD33-602E-4EF9-9DF2-8BA7D8B7A7AF + PLATFORM_VERSION = 0.1 +# +# Uncomment the following line and update with your platform pkg name +# +# FLASH_DEFINITION = /MicrocodeCapsuleTxt/MicrocodeCapsuleTxt.fdf +# +# Uncomment the following line and update with your platform pkg name +# +# OUTPUT_DIRECTORY = Build/ + SUPPORTED_ARCHITECTURES = IA32|X64 + BUILD_TARGETS = DEBUG|RELEASE + SKUID_IDENTIFIER = DEFAULT + +[Components] +# +# Uncomment the following line and update with path to Microcode INF file +# +# /MicrocodeCapsuleTxt/Microcode/Microcode.inf diff --git a/UefiCpuPkg/Feature/Capsule/MicrocodeCapsuleTxt/MicrocodeCapsuleTxt.fdf b/UefiCpuPkg/Feature/Capsule/MicrocodeCapsuleTxt/MicrocodeCapsuleTxt.fdf new file mode 100644 index 0000000..113693b --- /dev/null +++ b/UefiCpuPkg/Feature/Capsule/MicrocodeCapsuleTxt/MicrocodeCapsuleTxt.fdf @@ -0,0 +1,32 @@ +## @file +# +# Copyright (c) 2016, 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 +# 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 IMPLIED. +# +## + +[FmpPayload.FmpPayloadMicrocode1] +IMAGE_HEADER_INIT_VERSION = 0x02 +IMAGE_TYPE_ID = 96d4fdcd-1502-424d-9d4c-9b12d2dcae5c # Microcode GUID (do not change it) +IMAGE_INDEX = 0x1 +HARDWARE_INSTANCE = 0x0 + +# +# Uncomment the following line and update with path to Microcode MCB file +# +#FILE DATA = $(OUTPUT_DIRECTORY)/$(TARGET)_$(TOOL_CHAIN_TAG)/IA32/PlatformPkg/MicrocodeCapsuleTxt/Microcode/Microcode/OUTPUT/Microcode.mcb + +[Capsule.MicrocodeCapsule] +CAPSULE_GUID = 6dcbd5ed-e82d-4c44-bda1-7194199ad92a # FMP special Guid (do not change it) +CAPSULE_FLAGS = PersistAcrossReset,InitiateReset +CAPSULE_HEADER_SIZE = 0x20 +CAPSULE_HEADER_INIT_VERSION = 0x1 + +FMP_PAYLOAD = FmpPayloadMicrocode1 diff --git a/UefiCpuPkg/Feature/Capsule/MicrocodeCapsuleTxt/Readme.md b/UefiCpuPkg/Feature/Capsule/MicrocodeCapsuleTxt/Readme.md new file mode 100644 index 0000000..f7d7040 --- /dev/null +++ b/UefiCpuPkg/Feature/Capsule/MicrocodeCapsuleTxt/Readme.md @@ -0,0 +1,33 @@ +# How to generate Microcode FMP from Microcode TXT file + +1) Copy directory `UefiCpuPkg/Feature/Capsule/MicrocodeUpdateTxt` to `/MicrocodeUpdateTxt` + +2) Copy microcode TXT file to`/MicrocodeUpdateTxt/Microcode` + +3) Uncomment and update statement in `[Sources]` section of `/MicrocodeUpdateTxt/Microcode/Microcode.inf` with name of Microcode TXT file copied in previous step. + + [Sources] + + +Uncomment and update `FILE DATA` statement in `/MicrocodeUpdateTxt/MicrocodeCapsuleTxt.fdf` with path to a Microcode MCB file. The MCB file is placed in `$(WORKSPACE)/$(OUTPUT_DIRECTORY)/$(TARGET)_$(TOOL_CHAIN_TAG)/IA32//MicrocodeUpdateTxt/Microcode/Microcode/OUTPUT/`. + +`FILE DATA = ` + +Uncomment and update `PLATFORM_NAME`, `FLASH_DEFINITION`, `OUTPUT_DIRECTORY` section in `/MicrocodeUpdateTxt/MicrocodeCapsuleTxt.dsc` with . + + PLATFORM_NAME = + FLASH_DEFINITION = /MicrocodeCapsuleTxt/MicrocodeCapsuleTxt.fdf + OUTPUT_DIRECTORY = Build/ + +Uncomment and update statement in `Components` section of `/MicrocodeUpdateTxt/MicrocodeCapsuleTxt.dsc` with path to a Microcode INF file. + + [Components] + + +4) Use EDK II build tools to generate the Microcode FMP Capsule + +`build -p /MicrocodeCapsuleTxt/MicrocodeCapsuleTxt.dsc` + +5) The generated Microcode FMP Capsule is found at `$(WORKSPACE)/$(OUTPUT_DIRECTORY)/$(TARGET)_$(TOOL_CHAIN_TAG)/FV/MicrocodeCapsule.Cap` + + -- 2.7.4.windows.1