2 # Firmware Management Protocol Device Package
4 # This package provides an implementation of a Firmware Management Protocol
5 # instance that supports the update of firmware storage devices using UEFI
6 # Capsules. The behavior of the Firmware Management Protocol instance is
7 # customized using libraries and PCDs.
9 # Copyright (c) Microsoft Corporation.<BR>
10 # Copyright (c) 2018 - 2021, Intel Corporation. All rights reserved.<BR>
11 # Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
13 # SPDX-License-Identifier: BSD-2-Clause-Patent
18 PLATFORM_NAME = FmpDevicePkg
19 PLATFORM_GUID = 0af3d540-27c6-11e8-828b-f8597177a00a
20 PLATFORM_VERSION = 0.1
21 DSC_SPECIFICATION = 0x00010005
22 OUTPUT_DIRECTORY = Build/FmpDevicePkg
23 SUPPORTED_ARCHITECTURES = IA32|X64|ARM|AARCH64|RISCV64
24 BUILD_TARGETS = DEBUG|RELEASE|NOOPT
25 SKUID_IDENTIFIER = DEFAULT
28 # Define ESRT GUIDs for Firmware Management Protocol instances
30 DEFINE SYSTEM_FMP_ESRT_GUID = B461B3BD-E62A-4A71-841C-50BA4E500267
31 DEFINE DEVICE_FMP_ESRT_GUID = 226034C4-8B67-4536-8653-D6EE7CE5A316
34 # TRUE - Build FmpDxe module for with storage access enabled
35 # FALSE - Build FmpDxe module for with storage access disabled
37 DEFINE DEVICE_FMP_STORAGE_ACCESS_ENABLE = TRUE
39 !include UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
41 !include MdePkg/MdeLibs.dsc.inc
44 UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
45 UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
46 UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
47 UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
48 MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
49 DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
50 BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
51 BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
52 PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
53 DebugLib|MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf
54 DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
55 PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
56 VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
57 !ifdef CONTINUOUS_INTEGRATION
58 BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
60 IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
61 OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
62 BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
63 RngLib|MdePkg/Library/BaseRngLibNull/BaseRngLibNull.inf
65 FmpAuthenticationLib|SecurityPkg/Library/FmpAuthenticationLibPkcs7/FmpAuthenticationLibPkcs7.inf
66 CapsuleUpdatePolicyLib|FmpDevicePkg/Library/CapsuleUpdatePolicyLibNull/CapsuleUpdatePolicyLibNull.inf
67 FmpPayloadHeaderLib|FmpDevicePkg/Library/FmpPayloadHeaderLibV1/FmpPayloadHeaderLibV1.inf
68 FmpDeviceLib|FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLibNull.inf
69 FmpDependencyLib|FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.inf
70 FmpDependencyCheckLib|FmpDevicePkg/Library/FmpDependencyCheckLibNull/FmpDependencyCheckLibNull.inf
71 FmpDependencyDeviceLib|FmpDevicePkg/Library/FmpDependencyDeviceLibNull/FmpDependencyDeviceLibNull.inf
72 TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
74 [LibraryClasses.ARM, LibraryClasses.AARCH64]
76 # It is not possible to prevent the ARM compiler for generic intrinsic functions.
77 # This library provides the intrinsic functions generate by a given compiler.
78 # [LibraryClasses.ARM, LibraryClasses.AARCH64] and NULL mean link this library
79 # into all ARM and AARCH64 images.
81 NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
83 # Add support for stack protector
84 NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
87 ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
89 [PcdsPatchableInModule]
90 gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageTypeIdGuid|{0}
96 FmpDevicePkg/Library/CapsuleUpdatePolicyLibNull/CapsuleUpdatePolicyLibNull.inf
97 FmpDevicePkg/Library/CapsuleUpdatePolicyLibOnProtocol/CapsuleUpdatePolicyLibOnProtocol.inf
98 FmpDevicePkg/Library/FmpPayloadHeaderLibV1/FmpPayloadHeaderLibV1.inf
99 FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLibNull.inf
100 FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.inf
101 FmpDevicePkg/Library/FmpDependencyCheckLib/FmpDependencyCheckLib.inf
102 FmpDevicePkg/Library/FmpDependencyCheckLibNull/FmpDependencyCheckLibNull.inf
103 FmpDevicePkg/Library/FmpDependencyDeviceLibNull/FmpDependencyDeviceLibNull.inf
104 FmpDevicePkg/FmpDxe/FmpDxeLib.inf
109 FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.inf {
111 CapsuleUpdatePolicyLib|FmpDevicePkg/Library/CapsuleUpdatePolicyLibNull/CapsuleUpdatePolicyLibNull.inf
113 FmpDevicePkg/FmpDxe/FmpDxe.inf {
116 # FILE_GUID is used as ESRT GUID
118 FILE_GUID = $(SYSTEM_FMP_ESRT_GUID)
121 # Unicode name string that is used to populate FMP Image Descriptor for this capsule update module
123 gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName|L"Sample Firmware Device"
125 # Certificates used to authenticate capsule update image
127 !include BaseTools/Source/Python/Pkcs7Sign/TestRoot.cer.gFmpDevicePkgTokenSpaceGuid.PcdFmpDevicePkcs7CertBufferXdr.inc
128 <PcdsPatchableInModule>
129 gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageTypeIdGuid|{GUID("$(SYSTEM_FMP_ESRT_GUID)")}
132 # Use CapsuleUpdatePolicyLib that calls the Capsule Update Policy Protocol.
133 # Depends on the CapsuleUpdatePolicyDxe module to produce the protocol.
134 # Required for FmpDxe modules that are intended to be platform independent.
136 CapsuleUpdatePolicyLib|FmpDevicePkg/Library/CapsuleUpdatePolicyLibOnProtocol/CapsuleUpdatePolicyLibOnProtocol.inf
139 FmpDevicePkg/FmpDxe/FmpDxe.inf {
142 # FILE_GUID is used as ESRT GUID
144 FILE_GUID = $(DEVICE_FMP_ESRT_GUID)
146 gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceStorageAccessEnable|$(DEVICE_FMP_STORAGE_ACCESS_ENABLE)
148 !if $(DEVICE_FMP_STORAGE_ACCESS_ENABLE) == FALSE
150 # Disable test key detection
152 gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceTestKeySha256Digest|{0}
155 # Unicode name string that is used to populate FMP Image Descriptor for this capsule update module
157 !if $(DEVICE_FMP_STORAGE_ACCESS_ENABLE) == TRUE
158 gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName|L"Sample Firmware Device"
160 gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName|L"Sample Firmware Device No Storage Access"
163 # Certificates used to authenticate capsule update image
165 !include BaseTools/Source/Python/Pkcs7Sign/TestRoot.cer.gFmpDevicePkgTokenSpaceGuid.PcdFmpDevicePkcs7CertBufferXdr.inc
166 <PcdsPatchableInModule>
167 gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageTypeIdGuid|{GUID("$(DEVICE_FMP_ESRT_GUID)")}
170 # Directly use a platform specific CapsuleUpdatePolicyLib instance.
171 # Only works for FmpDxe modules that are build from sources and included
172 # in a system firmware image.
174 CapsuleUpdatePolicyLib|FmpDevicePkg/Library/CapsuleUpdatePolicyLibNull/CapsuleUpdatePolicyLibNull.inf
178 # Add UEFI Target Based Unit Tests
180 FmpDevicePkg/Test/UnitTest/Library/FmpDependencyLib/FmpDependencyLibUnitTestsUefi.inf
183 *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES