]> git.proxmox.com Git - mirror_edk2.git/blob - FmpDevicePkg/FmpDevicePkg.dsc
f9f26c54bb79723707e474ec53ce1aef97b16a04
[mirror_edk2.git] / FmpDevicePkg / FmpDevicePkg.dsc
1 ## @file
2 # Firmware Management Protocol Device Package
3 #
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.
8 #
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>
12 # Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.<BR>
13 #
14 # SPDX-License-Identifier: BSD-2-Clause-Patent
15 #
16 ##
17
18 [Defines]
19 PLATFORM_NAME = FmpDevicePkg
20 PLATFORM_GUID = 0af3d540-27c6-11e8-828b-f8597177a00a
21 PLATFORM_VERSION = 0.1
22 DSC_SPECIFICATION = 0x00010005
23 OUTPUT_DIRECTORY = Build/FmpDevicePkg
24 SUPPORTED_ARCHITECTURES = IA32|X64|ARM|AARCH64|RISCV64|LOONGARCH64
25 BUILD_TARGETS = DEBUG|RELEASE|NOOPT
26 SKUID_IDENTIFIER = DEFAULT
27
28 #
29 # Define ESRT GUIDs for Firmware Management Protocol instances
30 #
31 DEFINE SYSTEM_FMP_ESRT_GUID = B461B3BD-E62A-4A71-841C-50BA4E500267
32 DEFINE DEVICE_FMP_ESRT_GUID = 226034C4-8B67-4536-8653-D6EE7CE5A316
33
34 #
35 # TRUE - Build FmpDxe module for with storage access enabled
36 # FALSE - Build FmpDxe module for with storage access disabled
37 #
38 DEFINE DEVICE_FMP_STORAGE_ACCESS_ENABLE = TRUE
39
40 !include UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
41
42 !include MdePkg/MdeLibs.dsc.inc
43
44 [LibraryClasses]
45 UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
46 UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
47 UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
48 UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
49 MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
50 DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
51 BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
52 BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
53 PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
54 DebugLib|MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf
55 DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
56 PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
57 VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
58 !ifdef CONTINUOUS_INTEGRATION
59 BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
60 !else
61 IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
62 OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
63 BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
64 RngLib|MdePkg/Library/BaseRngLibNull/BaseRngLibNull.inf
65 !endif
66 FmpAuthenticationLib|SecurityPkg/Library/FmpAuthenticationLibPkcs7/FmpAuthenticationLibPkcs7.inf
67 CapsuleUpdatePolicyLib|FmpDevicePkg/Library/CapsuleUpdatePolicyLibNull/CapsuleUpdatePolicyLibNull.inf
68 FmpPayloadHeaderLib|FmpDevicePkg/Library/FmpPayloadHeaderLibV1/FmpPayloadHeaderLibV1.inf
69 FmpDeviceLib|FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLibNull.inf
70 FmpDependencyLib|FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.inf
71 FmpDependencyCheckLib|FmpDevicePkg/Library/FmpDependencyCheckLibNull/FmpDependencyCheckLibNull.inf
72 FmpDependencyDeviceLib|FmpDevicePkg/Library/FmpDependencyDeviceLibNull/FmpDependencyDeviceLibNull.inf
73 TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
74
75 [LibraryClasses.ARM, LibraryClasses.AARCH64]
76 #
77 # It is not possible to prevent the ARM compiler for generic intrinsic functions.
78 # This library provides the intrinsic functions generate by a given compiler.
79 # [LibraryClasses.ARM, LibraryClasses.AARCH64] and NULL mean link this library
80 # into all ARM and AARCH64 images.
81 #
82 NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
83
84 # Add support for stack protector
85 NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
86
87 [LibraryClasses.ARM]
88 ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
89
90 [PcdsPatchableInModule]
91 gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageTypeIdGuid|{0}
92
93 [Components]
94 #
95 # Libraries
96 #
97 FmpDevicePkg/Library/CapsuleUpdatePolicyLibNull/CapsuleUpdatePolicyLibNull.inf
98 FmpDevicePkg/Library/CapsuleUpdatePolicyLibOnProtocol/CapsuleUpdatePolicyLibOnProtocol.inf
99 FmpDevicePkg/Library/FmpPayloadHeaderLibV1/FmpPayloadHeaderLibV1.inf
100 FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLibNull.inf
101 FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.inf
102 FmpDevicePkg/Library/FmpDependencyCheckLib/FmpDependencyCheckLib.inf
103 FmpDevicePkg/Library/FmpDependencyCheckLibNull/FmpDependencyCheckLibNull.inf
104 FmpDevicePkg/Library/FmpDependencyDeviceLibNull/FmpDependencyDeviceLibNull.inf
105 FmpDevicePkg/FmpDxe/FmpDxeLib.inf
106
107 #
108 # Modules
109 #
110 FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.inf {
111 <LibraryClasses>
112 CapsuleUpdatePolicyLib|FmpDevicePkg/Library/CapsuleUpdatePolicyLibNull/CapsuleUpdatePolicyLibNull.inf
113 }
114 FmpDevicePkg/FmpDxe/FmpDxe.inf {
115 <Defines>
116 #
117 # FILE_GUID is used as ESRT GUID
118 #
119 FILE_GUID = $(SYSTEM_FMP_ESRT_GUID)
120 <PcdsFixedAtBuild>
121 #
122 # Unicode name string that is used to populate FMP Image Descriptor for this capsule update module
123 #
124 gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName|L"Sample Firmware Device"
125 #
126 # Certificates used to authenticate capsule update image
127 #
128 !include BaseTools/Source/Python/Pkcs7Sign/TestRoot.cer.gFmpDevicePkgTokenSpaceGuid.PcdFmpDevicePkcs7CertBufferXdr.inc
129 <PcdsPatchableInModule>
130 gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageTypeIdGuid|{GUID("$(SYSTEM_FMP_ESRT_GUID)")}
131 <LibraryClasses>
132 #
133 # Use CapsuleUpdatePolicyLib that calls the Capsule Update Policy Protocol.
134 # Depends on the CapsuleUpdatePolicyDxe module to produce the protocol.
135 # Required for FmpDxe modules that are intended to be platform independent.
136 #
137 CapsuleUpdatePolicyLib|FmpDevicePkg/Library/CapsuleUpdatePolicyLibOnProtocol/CapsuleUpdatePolicyLibOnProtocol.inf
138 }
139
140 FmpDevicePkg/FmpDxe/FmpDxe.inf {
141 <Defines>
142 #
143 # FILE_GUID is used as ESRT GUID
144 #
145 FILE_GUID = $(DEVICE_FMP_ESRT_GUID)
146 <PcdsFeatureFlag>
147 gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceStorageAccessEnable|$(DEVICE_FMP_STORAGE_ACCESS_ENABLE)
148 <PcdsFixedAtBuild>
149 !if $(DEVICE_FMP_STORAGE_ACCESS_ENABLE) == FALSE
150 #
151 # Disable test key detection
152 #
153 gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceTestKeySha256Digest|{0}
154 !endif
155 #
156 # Unicode name string that is used to populate FMP Image Descriptor for this capsule update module
157 #
158 !if $(DEVICE_FMP_STORAGE_ACCESS_ENABLE) == TRUE
159 gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName|L"Sample Firmware Device"
160 !else
161 gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName|L"Sample Firmware Device No Storage Access"
162 !endif
163 #
164 # Certificates used to authenticate capsule update image
165 #
166 !include BaseTools/Source/Python/Pkcs7Sign/TestRoot.cer.gFmpDevicePkgTokenSpaceGuid.PcdFmpDevicePkcs7CertBufferXdr.inc
167 <PcdsPatchableInModule>
168 gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageTypeIdGuid|{GUID("$(DEVICE_FMP_ESRT_GUID)")}
169 <LibraryClasses>
170 #
171 # Directly use a platform specific CapsuleUpdatePolicyLib instance.
172 # Only works for FmpDxe modules that are build from sources and included
173 # in a system firmware image.
174 #
175 CapsuleUpdatePolicyLib|FmpDevicePkg/Library/CapsuleUpdatePolicyLibNull/CapsuleUpdatePolicyLibNull.inf
176 }
177
178 #
179 # Add UEFI Target Based Unit Tests
180 #
181 FmpDevicePkg/Test/UnitTest/Library/FmpDependencyLib/FmpDependencyLibUnitTestsUefi.inf
182
183 [BuildOptions]
184 *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES