Re: [PATCH 08/10] OvmfPkg: Update Sec to support Tdvf Config-B
Min Xu
On January 14, 2022 4:32 PM, Gerd Hoffmann wrote:
Hi, Gerd, I think Jiewen has discussed this (PEI-less boot in Config-B) in another mail thread. We can continue the discussion there. Let's first focus on the PlatformInitLib here. Thanks for your understanding.I don't see that PEI-less boot is required for that. Sure, when Yes, Cloudhw support TDX too. Actually we have some PoC and plan to upstream it later.copy.4. But a basic version of PlatformInitLib is a good start.Yes. Having initially only the functions needed by config-b in BTW, cmos is needed in GetSystemMemorySizeBelow4gb which call CmosRead for 0x34/0x35. ThanksAnd PlatformInitLib willAt least not initially. Maybe later when we move more code to the lib to Min
|
|
Re: 回复: [edk2-devel] [PATCH] MdeModulePkg\CoreDxe: Allow DXE Drivers to use untested memory
Howell, Stacy <stacy.howell@...>
Hi Sean,
toggle quoted messageShow quoted text
Setting all memory as tested in PEI is a workaround for the issue that this patch addresses. However, promoting all memory in PEI is not a workable solution for BIOSes that incorporate full memory testing functionality, as this relies on the tested flag to determine which memory regions to test. This patch addresses a discrepancy in EDK2 core regarding how untested memory is treated for allocation by DXE drivers. In the case where a DXE driver does not request a specific memory region DXE Core will promote untested memory if necessary to provide memory to the driver. In the case where a DXE driver requests a specific memory range of untested memory, DXE Core will currently return an error instead of promoting untested memory to make the region available for the driver. Thanks, Stacy
-----Original Message-----
From: Kinney, Michael D <michael.d.kinney@intel.com> Sent: Tuesday, January 11, 2022 10:57 AM To: devel@edk2.groups.io; spbrogan@outlook.com; Gao, Liming <gaoliming@byosoft.com.cn>; Howell, Stacy <stacy.howell@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com> Cc: Bi, Dandan <dandan.bi@intel.com> Subject: RE: 回复: [edk2-devel] [PATCH] MdeModulePkg\CoreDxe: Allow DXE Drivers to use untested memory Hi Sean, The auto promotion of memory was only intended as a dev/debug feature to maximize platform boot without having to tune what memory is tested in PEI phase. In my opinion, a production platform should never trigger any auto promotions of untested to tested memory, and part of production validation should make sure this event never occurs in any production boot scenarios. The specific bug being fix here is that auto promotion was not symmetric across all memory allocation types. It simply aligns this dev/debug feature. Mike -----Original Message-----
|
|
Re: [PATCH 01/79] ProcessorPkg/Include: Add header files of RISC-V processor package
Michael D Kinney
Hi Abner,
toggle quoted messageShow quoted text
We already have a package for common platform content in the edk2 repo. This is the MdeModulePkg. However, the number of common platform features added to the MdeModulePkg over time has made this a very large package, and this can be measured by how complex the Maintainer.txt rules are for this package. The revised approach is to create feature packages that platforms can add if their platform requires that specific feature category. Examples are NetworkPkg, SecurityPkg, FmpDevicePkg, FatPkg, RedfishPkg, SourceLevelDebugPkg. Instead of adding another generic package such as CommonPlatformPkg, I would prefer to see the libs/modules either added to existing packages that match the feature category, or create new feature packages if there is a new feature category. We also try to limit the edk2 repo to components that are directly related the UEFI/PI specifications and are not Si/Platform specific. Si/Platform specific features go into the edk2-platforms repo. An example of a generic feature in the edk2-platforms repo is Features/Ext4. The UEFI spec only specifies FAT for UEFI boot from file system. There are a number of other feature packages in edk2-platforms in the Features directory, so you should review those as well to see if there is natural landing zone for any of your components. Mike
-----Original Message-----
|
|
Re: [PATCH] UefiPayloadPkg: Not use BaseCpuTimerLib by default.
Ma, Maurice <maurice.ma@...>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
toggle quoted messageShow quoted text
-----Original Message-----
|
|
Re: [PATCH 01/79] ProcessorPkg/Include: Add header files of RISC-V processor package
toggle quoted messageShow quoted text
-----Original Message-----How about Leif's suggestion? The CommonPlatformPkg on edk2? Abner
|
|
Re: [PATCH v4 00/11] Create new target for Cloud Hypervisor
Boeuf, Sebastien
Great, thank you!
Sebastien
From: Yao, Jiewen <jiewen.yao@...>
Sent: Thursday, January 13, 2022 3:56:09 PM To: Boeuf, Sebastien <sebastien.boeuf@...>; devel@edk2.groups.io <devel@edk2.groups.io> Cc: Justen, Jordan L <jordan.l.justen@...>; kraxel@... <kraxel@...> Subject: RE: [PATCH v4 00/11] Create new target for Cloud Hypervisor Merged:
https://github.com/tianocore/edk2/pull/2411
> -----Original Message----- > From: Boeuf, Sebastien <sebastien.boeuf@...> > Sent: Tuesday, January 11, 2022 8:31 PM > To: devel@edk2.groups.io > Cc: Yao, Jiewen <jiewen.yao@...>; Justen, Jordan L > <jordan.l.justen@...>; kraxel@...; Boeuf, Sebastien > <sebastien.boeuf@...> > Subject: [PATCH v4 00/11] Create new target for Cloud Hypervisor > > From: Sebastien Boeuf <sebastien.boeuf@...> > > Since Cloud Hypervisor and QEMU pc/q35 are quite different, it makes > more sense to create a dedicated OVMF target for Cloud Hypervisor rather > than trying to support both VMMs from the same OvmfPkgX64 target. > > That's the reason why this series introduces a new target called > CloudHvX64, meant to be used with the Cloud Hypervisor VMM only. > > The new target is initially copied over from the OvmfPkgX64, then it is > trimmed down by removing what is not needed from a Cloud Hypervisor > perspective. > > Sebastien Boeuf (11): > OvmfPkg/CloudHv: Add new target for Cloud Hypervisor > OvmfPkg/CloudHv: Replace legacy 8254 PIT with local APIC timer > OvmfPkg/CloudHv: Connect serial console > OvmfPkg/CloudHv: Remove legacy 8259 PIC support > OvmfPkg/CloudHv: Remove Q35 specifics > OvmfPkg/CloudHv: Reduce dependency on QemuFwCfg > OvmfPkg/CloudHv: Remove video support > OvmfPkg/CloudHv: Remove USB support > OvmfPkg/CloudHv: Remove CSM support > OvmfPkg/CloudHv: add Maintainers.txt entry > OvmfPkg: Add CloudHvX64 to the CI > > Maintainers.txt | 5 + > OvmfPkg/CloudHv/CloudHvX64.dsc | 938 ++++++++++++++++++ > OvmfPkg/CloudHv/CloudHvX64.fdf | 503 ++++++++++ > .../PlatformBootManagerLib/BdsPlatform.c | 8 +- > .../.azurepipelines/Ubuntu-GCC5.yml | 9 + > OvmfPkg/PlatformCI/CloudHvBuild.py | 37 + > 6 files changed, 1499 insertions(+), 1 deletion(-) > create mode 100644 OvmfPkg/CloudHv/CloudHvX64.dsc > create mode 100644 OvmfPkg/CloudHv/CloudHvX64.fdf > create mode 100644 OvmfPkg/PlatformCI/CloudHvBuild.py > > -- > 2.30.2 --------------------------------------------------------------------- This e-mail and any attachments may contain confidential material for
|
|
[PATCH EDK2 v1 1/1] MdeModulePkg/PciBucDxe:Fix issue when initial SR-IVO
wenyi,xie
Reference:https://bugzilla.tianocore.org/show_bug.cgi?id=3804
When calculating SR-IOV reserve bus in function CreatePciIoDevice(), there are two points may have problem. LastVF = PFRid + FirstVFOffset + (PciIoDevice->InitialVFs - 1) * VFStride; PciIoDevice->ReservedBusNum = (UINT16)(EFI_PCI_BUS_OF_RID (LastVF) - Bus + 1); The first is that if the value of PciIoDevice->InitialVFs is 0, it will cause overflow, it's better to check InitialVFs before used. The second is that if number of bus is not enough for all PF and still allocate bus for VF, it will lead to PCI enumerating failure. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com> --- MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c index 9251388bc268..a4d1db534276 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c @@ -2402,12 +2402,12 @@ CreatePciIoDevice ( // Calculate LastVF // PFRid = EFI_PCI_RID (Bus, Device, Func); - LastVF = PFRid + FirstVFOffset + (PciIoDevice->InitialVFs - 1) * VFStride; + LastVF = PFRid + FirstVFOffset + (PciIoDevice->InitialVFs == 0 ? 0 : PciIoDevice->InitialVFs - 1) * VFStride; // // Calculate ReservedBusNum for this PF // - PciIoDevice->ReservedBusNum = (UINT16)(EFI_PCI_BUS_OF_RID (LastVF) - Bus + 1); + PciIoDevice->ReservedBusNum = (UINT16)(EFI_PCI_BUS_OF_RID (LastVF) - Bus); DEBUG (( DEBUG_INFO, -- 2.20.1.windows.1
|
|
[PATCH EDK2 v1 0/1] MdeModulePkg/PciBucDxe:Fix issue when initial SR-IVO
wenyi,xie
Main Changes :
1.Add check before using InitialVFs. 2.Don't allocate bus for VF. Wenyi Xie (1): MdeModulePkg/PciBucDxe:Fix issue when initial SR-IVO MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.20.1.windows.1
|
|
Re: [PATCH 08/10] OvmfPkg: Update Sec to support Tdvf Config-B
Gerd Hoffmann
Hi,
I don't see that PEI-less boot is required for that. Sure, when stripping down No. I have to say PEI-less boot in Config-B is a hard requirement.I'm still wondering why though. I have not yet seen a reason why config-b can't use the PEI-based boot flow. So let me summarize the discussion about PlatformInitLib.4. But a basic version of PlatformInitLib is a good start.Yes. Having initially only the functions needed by config-b in PlatformInitLib 1. PlatformInitLib wraps the common functions in OvmfPkg/PlatformPei.Yes. Everything needed for PEI-less / config-b boot moves to PlatformInitLib. PlatformInitLib is added as dependency to OvmfPkg/PlatformPei, so PlatformPei can call those functions when booting with PEI. PEI-less boot will add PlatformInitLib to SEC (and DXE) instead so the same code can be used then. Not sure how to handle cmos best. Not needed for memory detection on qemu, but cloudhw depends on it so it is back for now. Will cloudhw support tdx too btw? And PlatformInitLib willAt least not initially. Maybe later when we move more code to the lib to reduce code duplication in xen/bhyve/qemu PlatformPei variants. 2. OvmfPkg/PlatformPei will be refactored with PlatformInitLib. The 3. Config-B support PEI-less boot for both legacy guest and td guest.Yes. take care, Gerd
|
|
[PATCH] UefiPayloadPkg: Not use BaseCpuTimerLib by default.
Zhiguang Liu
For recent X86 CPU, 0x15 CPUID instruction will return Time Stamp
Counter. This is recommended way to get the time, and also how BaseCpuTimerLib works However, some CPU doesn't support this feature, so disable it by default. Cc: Guo Dong <guo.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com> --- UefiPayloadPkg/UefiPayloadPkg.dsc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayload= Pkg.dsc index 3d08edfe31..65c1bd610e 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.dsc +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc @@ -111,6 +111,11 @@ DEFINE SERIAL_DRIVER_ENABLE =3D TRUE=0D DEFINE PERFORMANCE_MEASUREMENT_ENABLE =3D FALSE=0D =0D + # For recent X86 CPU, 0x15 CPUID instruction will return Time Stamp Coun= ter.=0D + # This is recommended way to get the time, and also how BaseCpuTimerLib = works.=0D + # However, some CPU doesn't support this feature, so disable it by defau= lt.=0D + DEFINE CPU_TIMER_LIB_ENABLE =3D FALSE=0D +=0D [BuildOptions]=0D *_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECATED_INTERFACES= =0D GCC:*_UNIXGCC_*_CC_FLAGS =3D -DMDEPKG_NDEBUG=0D @@ -217,7 +222,7 @@ #=0D # Platform=0D #=0D -!if $(UNIVERSAL_PAYLOAD) =3D=3D TRUE=0D +!if $(CPU_TIMER_LIB_ENABLE) =3D=3D TRUE=0D TimerLib|UefiCpuPkg/Library/CpuTimerLib/BaseCpuTimerLib.inf=0D !else=0D TimerLib|UefiPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.inf=0D --=20 2.32.0.windows.2
|
|
Re: [PATCH] BaseTools/GenFw: Enhance to add export table in PE-COFF
Bob Feng
Hi Lixia,
toggle quoted messageShow quoted text
This patch introduce a new command line option --PRM. Could you add the help information about --PRM? Could you provide more information about the below change? Would there be side-effect? @@ -750,7 +818,7 @@ ScanSections64 ( if (shdr->sh_addralign <= mCoffAlignment) { continue; } - if (IsTextShdr(shdr) || IsDataShdr(shdr) || IsHiiRsrcShdr(shdr)) { + if (IsTextShdr(shdr) || IsDataShdr(shdr) || IsHiiRsrcShdr(shdr) || IsSymbolShdr(shdr)) { mCoffAlignment = (UINT32)shdr->sh_addralign; } } Thanks, Bob
-----Original Message-----
From: Huang, Li-Xia <lisa.huang@intel.com> Sent: Wednesday, January 12, 2022 3:44 PM To: devel@edk2.groups.io Cc: Huang, Li-Xia <lisa.huang@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Feng, Bob C <bob.c.feng@intel.com>; Chen, Christine <yuwei.chen@intel.com> Subject: [edk2-devel][PATCH] BaseTools/GenFw: Enhance to add export table in PE-COFF REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3802 Since PRM module needs to support export table in PE-COFF, we'll enhance GenFw tool to support this. Add one export flag in GenFw tool. If export flag is set: Step1: Scan ELF symbol table based on PRM module descriptor to get descriptor offset address; Step2: Find PRM handlers number and name in COFF file based on the address from step1; Step3: Write PRM info such as handler name and export RVA into COFF export table. Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Lixia Huang <lisa.huang@intel.com> --- BaseTools/Source/C/GenFw/Elf64Convert.c | 254 +++++++++++++++++- BaseTools/Source/C/GenFw/ElfConvert.c | 10 + BaseTools/Source/C/GenFw/ElfConvert.h | 42 ++- BaseTools/Source/C/GenFw/GenFw.c | 11 +- .../C/Include/IndustryStandard/PeImage.h | 7 + 5 files changed, 318 insertions(+), 6 deletions(-) diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c b/BaseTools/Source/C/GenFw/Elf64Convert.c index 0bb3ead228..0079507356 100644 --- a/BaseTools/Source/C/GenFw/Elf64Convert.c +++ b/BaseTools/Source/C/GenFw/Elf64Convert.c @@ -56,6 +56,18 @@ WriteDebug64 ( VOID ); +STATIC+VOID+ScanSymbol64 (+ VOID+ );++STATIC+VOID+WriteExport64 (+ VOID+ );+ STATIC VOID SetImageSize64 (@@ -122,7 +134,7 @@ STATIC UINT32 mDataOffset; STATIC UINT32 mHiiRsrcOffset; STATIC UINT32 mRelocOffset; STATIC UINT32 mDebugOffset;-+STATIC UINT32 mExportOffset; // // Used for RISC-V relocations. //@@ -132,6 +144,14 @@ STATIC Elf64_Half mRiscVPass1SymSecIndex = 0; STATIC INT32 mRiscVPass1Offset; STATIC INT32 mRiscVPass1GotFixup; +//+// Used for Export section.+//+STATIC UINT32 mExportSize;+STATIC UINT32 mExportRVA[PRM_MODULE_EXPORT_SYMBOL_NUM];+STATIC UINT32 mExportSymNum;+STATIC CHAR8 mExportSymName[PRM_MODULE_EXPORT_SYMBOL_NUM][PRM_HANDLER_NAME_MAXIMUM_LENGTH];+ // // Initialization Function //@@ -200,6 +220,10 @@ InitializeElf64 ( ElfFunctions->SetImageSize = SetImageSize64; ElfFunctions->CleanUp = CleanUp64; + if (mExportFlag) {+ ElfFunctions->ScanSymbol = ScanSymbol64;+ ElfFunctions->WriteExport = WriteExport64;+ } return TRUE; } @@ -263,6 +287,17 @@ IsHiiRsrcShdr ( return (BOOLEAN) (strcmp((CHAR8*)mEhdr + Namedr->sh_offset + Shdr->sh_name, ELF_HII_SECTION_NAME) == 0); } +STATIC+BOOLEAN+IsSymbolShdr (+ Elf_Shdr *Shdr+ )+{+ Elf_Shdr *Namehdr = GetShdrByIndex(mEhdr->e_shstrndx);++ return (BOOLEAN) (strcmp((CHAR8*)mEhdr + Namehdr->sh_offset + Shdr->sh_name, ELF_SYMBOL_SECTION_NAME) == 0);+}+ STATIC BOOLEAN IsDataShdr (@@ -335,6 +370,38 @@ GetSymName ( return StrtabContents + Sym->st_name; } +//+// Get Prm Handler number and name+//+STATIC+VOID+FindPrmHandler (+ UINT64 Offset+ )+{+ PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT_HEADER *PrmExport;+ UINT32 NameOffset;+ UINT32 HandlerNum;+ UINT32 Index;+ UINT8 SymName[PRM_HANDLER_NAME_MAXIMUM_LENGTH];++ PrmExport = (PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT_HEADER*)(mCoffFile + Offset);+ NameOffset = sizeof(PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT_HEADER) + sizeof(EFI_GUID);++ for (HandlerNum = 0; HandlerNum < PrmExport->NumberPrmHandlers; HandlerNum++) {+ for (Index = 0; Index < PRM_HANDLER_NAME_MAXIMUM_LENGTH; Index++) {+ SymName[Index] = *((UINT8 *)PrmExport + NameOffset + Index);+ if (SymName[Index] == 0) {+ break;+ }+ }++ strcpy(mExportSymName[mExportSymNum], (CHAR8*)SymName);+ NameOffset += PRM_HANDLER_NAME_MAXIMUM_LENGTH + sizeof(EFI_GUID);+ mExportSymNum ++;+ }+}+ // // Find the ELF section hosting the GOT from an ELF Rva // of a single GOT entry. Normally, GOT is placed in@@ -717,6 +784,7 @@ ScanSections64 ( UINT32 CoffEntry; UINT32 SectionCount; BOOLEAN FoundSection;+ UINT32 Offset; CoffEntry = 0; mCoffOffset = 0;@@ -750,7 +818,7 @@ ScanSections64 ( if (shdr->sh_addralign <= mCoffAlignment) { continue; }- if (IsTextShdr(shdr) || IsDataShdr(shdr) || IsHiiRsrcShdr(shdr)) {+ if (IsTextShdr(shdr) || IsDataShdr(shdr) || IsHiiRsrcShdr(shdr) || IsSymbolShdr(shdr)) { mCoffAlignment = (UINT32)shdr->sh_addralign; } }@@ -880,6 +948,16 @@ ScanSections64 ( Warning (NULL, 0, 0, NULL, "Multiple sections in %s are merged into 1 data section. Source level debug might not work correctly.", mInImageName); } + //+ // The Symbol sections.+ //+ if (mExportFlag) {+ mExportOffset = mCoffOffset;+ mExportSize = sizeof(EFI_IMAGE_EXPORT_DIRECTORY) + strlen(mInImageName) + 1;+ mCoffOffset += mExportSize;+ mCoffOffset = CoffAlign(mCoffOffset);+ }+ // // The HII resource sections. //@@ -962,7 +1040,11 @@ ScanSections64 ( | EFI_IMAGE_FILE_LARGE_ADDRESS_AWARE; NtHdr->Pe32Plus.OptionalHeader.SizeOfCode = mDataOffset - mTextOffset;- NtHdr->Pe32Plus.OptionalHeader.SizeOfInitializedData = mRelocOffset - mDataOffset;+ if(mExportFlag) {+ NtHdr->Pe32Plus.OptionalHeader.SizeOfInitializedData = mRelocOffset - mExportOffset;+ } else {+ NtHdr->Pe32Plus.OptionalHeader.SizeOfInitializedData = mRelocOffset - mDataOffset;+ } NtHdr->Pe32Plus.OptionalHeader.SizeOfUninitializedData = 0; NtHdr->Pe32Plus.OptionalHeader.AddressOfEntryPoint = CoffEntry; @@ -989,8 +1071,17 @@ ScanSections64 ( NtHdr->Pe32Plus.FileHeader.NumberOfSections--; } + //+ // If found symbol, add edata section between data and rsrc section+ //+ if(mExportFlag) {+ Offset = mExportOffset;+ } else {+ Offset = mHiiRsrcOffset;+ }+ if ((mHiiRsrcOffset - mDataOffset) > 0) {- CreateSectionHeader (".data", mDataOffset, mHiiRsrcOffset - mDataOffset,+ CreateSectionHeader (".data", mDataOffset, Offset - mDataOffset, EFI_IMAGE_SCN_CNT_INITIALIZED_DATA | EFI_IMAGE_SCN_MEM_WRITE | EFI_IMAGE_SCN_MEM_READ);@@ -999,6 +1090,20 @@ ScanSections64 ( NtHdr->Pe32Plus.FileHeader.NumberOfSections--; } + if(mExportFlag) {+ if ((mHiiRsrcOffset - mExportOffset) > 0) {+ CreateSectionHeader (".edata", mExportOffset, mHiiRsrcOffset - mExportOffset,+ EFI_IMAGE_SCN_CNT_INITIALIZED_DATA+ | EFI_IMAGE_SCN_MEM_READ);+ NtHdr->Pe32Plus.OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_EXPORT].Size = mHiiRsrcOffset - mExportOffset;+ NtHdr->Pe32Plus.OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress = mExportOffset;+ NtHdr->Pe32Plus.FileHeader.NumberOfSections++;+ } else {+ // Don't make a section of size 0.+ NtHdr->Pe32Plus.FileHeader.NumberOfSections--;+ }+ }+ if ((mRelocOffset - mHiiRsrcOffset) > 0) { CreateSectionHeader (".rsrc", mHiiRsrcOffset, mRelocOffset - mHiiRsrcOffset, EFI_IMAGE_SCN_CNT_INITIALIZED_DATA@@ -1757,4 +1862,145 @@ CleanUp64 ( } } +STATIC+VOID+ScanSymbol64 (+ VOID+ )+{+ UINT32 shIndex;+ UINT32 SymIndex;+ Elf_Sym *Sym;+ UINT64 SymNum;+ const UINT8 *SymName;++ for (shIndex = 0; shIndex < mEhdr->e_shnum; shIndex++) {+ //+ // Determine if this is a symbol section.+ //+ Elf_Shdr *shdr = GetShdrByIndex(shIndex);+ if (!IsSymbolShdr(shdr)) {+ continue;+ }++ UINT8 *Symtab = (UINT8*)mEhdr + shdr->sh_offset;+ SymNum = (shdr->sh_size) / (shdr->sh_entsize);++ //+ // First Get PrmModuleExportDescriptor+ //+ for (SymIndex = 0; SymIndex < SymNum; SymIndex++) {+ Sym = (Elf_Sym *)(Symtab + SymIndex * shdr->sh_entsize);+ SymName = GetSymName(Sym);+ if (SymName == NULL) {+ continue;+ }++ if (strcmp((CHAR8*)SymName, PRM_MODULE_EXPORT_DESCRIPTOR_NAME) == 0) {+ //+ // Find PrmHandler Number and Name+ //+ FindPrmHandler(Sym->st_value);++ strcpy(mExportSymName[mExportSymNum], (CHAR8*)SymName);+ mExportRVA[mExportSymNum] = (UINT32)(Sym->st_value);+ mExportSize += 2 * EFI_IMAGE_EXPORT_ADDR_SIZE + EFI_IMAGE_EXPORT_ORDINAL_SIZE + strlen((CHAR8 *)SymName) + 1;+ mExportSymNum ++;+ break;+ }+ }++ //+ // Second Get PrmHandler+ //+ for (SymIndex = 0; SymIndex < SymNum; SymIndex++) {+ UINT32 ExpIndex;+ Sym = (Elf_Sym *)(Symtab + SymIndex * shdr->sh_entsize);+ SymName = GetSymName(Sym);+ if (SymName == NULL) {+ continue;+ }++ for (ExpIndex = 0; ExpIndex < (mExportSymNum -1); ExpIndex++) {+ if (strcmp((CHAR8*)SymName, mExportSymName[ExpIndex]) != 0) {+ continue;+ }+ mExportRVA[ExpIndex] = (UINT32)(Sym->st_value);+ mExportSize += 2 * EFI_IMAGE_EXPORT_ADDR_SIZE + EFI_IMAGE_EXPORT_ORDINAL_SIZE + strlen((CHAR8 *)SymName) + 1;+ }+ }++ break;+ }+}++STATIC+VOID+WriteExport64 (+ VOID+ )+{+ EFI_IMAGE_OPTIONAL_HEADER_UNION *NtHdr;+ EFI_IMAGE_EXPORT_DIRECTORY *ExportDir;+ EFI_IMAGE_DATA_DIRECTORY *DataDir;+ UINT32 FileNameOffset;+ UINT32 FuncOffset;+ UINT16 Index;+ UINT8 *Tdata = NULL;++ ExportDir = (EFI_IMAGE_EXPORT_DIRECTORY*)(mCoffFile + mExportOffset);+ ExportDir->Characteristics = 0;+ ExportDir->TimeDateStamp = 0;+ ExportDir->MajorVersion = 0;+ ExportDir->MinorVersion =0;+ ExportDir->Name = 0;+ ExportDir->NumberOfFunctions = mExportSymNum;+ ExportDir->NumberOfNames = mExportSymNum;+ ExportDir->Base = EFI_IMAGE_EXPORT_ORDINAL_BASE;+ ExportDir->AddressOfFunctions = mExportOffset + sizeof(EFI_IMAGE_EXPORT_DIRECTORY);+ ExportDir->AddressOfNames = ExportDir->AddressOfFunctions + EFI_IMAGE_EXPORT_ADDR_SIZE * mExportSymNum;+ ExportDir->AddressOfNameOrdinals = ExportDir->AddressOfNames + EFI_IMAGE_EXPORT_ADDR_SIZE * mExportSymNum;++ FileNameOffset = ExportDir->AddressOfNameOrdinals + EFI_IMAGE_EXPORT_ORDINAL_SIZE * mExportSymNum;+ FuncOffset = FileNameOffset + strlen(mInImageName) + 1;++ // Write Input image Name RVA+ Tdata = mCoffFile + 12;+ *(UINT32 *)Tdata = FileNameOffset;++ // Write Input image Name+ strcpy((char *)(mCoffFile + FileNameOffset), mInImageName);++ for (Index = 0; Index < mExportSymNum; Index++) {+ //+ // Write Export Address Table+ //+ Tdata = mCoffFile + ExportDir->AddressOfFunctions + Index * EFI_IMAGE_EXPORT_ADDR_SIZE;+ *(UINT32 *)Tdata = mExportRVA[Index];++ //+ // Write Export Name Pointer Table+ //+ Tdata = mCoffFile + ExportDir->AddressOfNames + Index * EFI_IMAGE_EXPORT_ADDR_SIZE;+ *(UINT32 *)Tdata = FuncOffset;++ //+ // Write Export Ordinal table+ //+ Tdata = mCoffFile + ExportDir->AddressOfNameOrdinals + Index * EFI_IMAGE_EXPORT_ORDINAL_SIZE;+ *(UINT16 *)Tdata = Index;++ //+ // Write Export Name Table+ //+ strcpy((char *)(mCoffFile + FuncOffset), mExportSymName[Index]);+ FuncOffset += strlen(mExportSymName[Index]) + 1;+ }++ NtHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)(mCoffFile + mNtHdrOffset);+ DataDir = &NtHdr->Pe32Plus.OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_EXPORT];+ DataDir->VirtualAddress = mExportOffset;+ DataDir->Size = mExportSize;++} diff --git a/BaseTools/Source/C/GenFw/ElfConvert.c b/BaseTools/Source/C/GenFw/ElfConvert.c index 7db8721167..795cdbd743 100644 --- a/BaseTools/Source/C/GenFw/ElfConvert.c +++ b/BaseTools/Source/C/GenFw/ElfConvert.c @@ -223,6 +223,16 @@ ConvertElf ( VerboseMsg ("Write debug info."); ElfFunctions.WriteDebug (); + //+ // For PRM Driver to Write export info.+ //+ if (mExportFlag) {+ VerboseMsg ("Scan symbol info.");+ ElfFunctions.ScanSymbol ();+ VerboseMsg ("Write export info.");+ ElfFunctions.WriteExport ();+ }+ // // Make sure image size is correct before returning the new image. //diff --git a/BaseTools/Source/C/GenFw/ElfConvert.h b/BaseTools/Source/C/GenFw/ElfConvert.h index 801e8de4a2..7920765fbb 100644 --- a/BaseTools/Source/C/GenFw/ElfConvert.h +++ b/BaseTools/Source/C/GenFw/ElfConvert.h @@ -24,6 +24,7 @@ extern UINT8 *mCoffFile; extern UINT32 mTableOffset; extern UINT32 mOutImageType; extern UINT32 mFileBufferSize;+extern BOOLEAN mExportFlag; // // Common EFI specific data.@@ -31,6 +32,42 @@ extern UINT32 mFileBufferSize; #define ELF_HII_SECTION_NAME ".hii" #define ELF_STRTAB_SECTION_NAME ".strtab" #define MAX_COFF_ALIGNMENT 0x10000+#define ELF_SYMBOL_SECTION_NAME ".symtab"++//+// Platform Runtime Mechanism (PRM) specific data.+//+#define PRM_MODULE_EXPORT_SYMBOL_NUM 10+#define PRM_HANDLER_NAME_MAXIMUM_LENGTH 128++#define PRM_MODULE_EXPORT_DESCRIPTOR_NAME "PrmModuleExportDescriptor"+#define PRM_MODULE_EXPORT_DESCRIPTOR_SIGNATURE SIGNATURE_64 ('P', 'R', 'M', '_', 'M', 'E', 'D', 'T')+#define PRM_MODULE_EXPORT_REVISION 0x0++//+// Platform Runtime Mechanism (PRM) Export Descriptor Structures+//+#pragma pack(push, 1)++typedef struct {+ EFI_GUID PrmHandlerGuid;+ CHAR8 PrmHandlerName[PRM_HANDLER_NAME_MAXIMUM_LENGTH];+} PRM_HANDLER_EXPORT_DESCRIPTOR_STRUCT;++typedef struct {+ UINT64 Signature;+ UINT16 Revision;+ UINT16 NumberPrmHandlers;+ EFI_GUID PlatformGuid;+ EFI_GUID ModuleGuid;+} PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT_HEADER;++typedef struct {+ PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT_HEADER Header;+ PRM_HANDLER_EXPORT_DESCRIPTOR_STRUCT PrmHandlerExportDescriptors[1];+} PRM_MODULE_EXPORT_DESCRIPTOR_STRUCT;++#pragma pack(pop) // // Filter Types@@ -38,7 +75,8 @@ extern UINT32 mFileBufferSize; typedef enum { SECTION_TEXT, SECTION_HII,- SECTION_DATA+ SECTION_DATA,+ SECTION_SYMBOL } SECTION_FILTER_TYPES; @@ -50,6 +88,8 @@ typedef struct { BOOLEAN (*WriteSections) (SECTION_FILTER_TYPES FilterType); VOID (*WriteRelocations) (); VOID (*WriteDebug) ();+ VOID (*ScanSymbol) ();+ VOID (*WriteExport) (); VOID (*SetImageSize) (); VOID (*CleanUp) (); diff --git a/BaseTools/Source/C/GenFw/GenFw.c b/BaseTools/Source/C/GenFw/GenFw.c index 8cab70ba4d..c7de5b89d8 100644 --- a/BaseTools/Source/C/GenFw/GenFw.c +++ b/BaseTools/Source/C/GenFw/GenFw.c @@ -87,7 +87,7 @@ UINT32 mImageTimeStamp = 0; UINT32 mImageSize = 0; UINT32 mOutImageType = FW_DUMMY_IMAGE; BOOLEAN mIsConvertXip = FALSE;-+BOOLEAN mExportFlag = FALSE; STATIC EFI_STATUS@@ -1436,6 +1436,15 @@ Returns: continue; } + if (stricmp (argv[0], "--PRM") == 0) {+ if (!mExportFlag) {+ mExportFlag = TRUE;+ }+ argc --;+ argv ++;+ continue;+ }+ if (argv[0][0] == '-') { Error (NULL, 0, 1000, "Unknown option", argv[0]); goto Finish;diff --git a/BaseTools/Source/C/Include/IndustryStandard/PeImage.h b/BaseTools/Source/C/Include/IndustryStandard/PeImage.h index f17b8ee19b..21c968e650 100644 --- a/BaseTools/Source/C/Include/IndustryStandard/PeImage.h +++ b/BaseTools/Source/C/Include/IndustryStandard/PeImage.h @@ -571,6 +571,13 @@ typedef struct { UINT32 AddressOfNameOrdinals; } EFI_IMAGE_EXPORT_DIRECTORY; +//+// Based export types.+//+#define EFI_IMAGE_EXPORT_ORDINAL_BASE 1+#define EFI_IMAGE_EXPORT_ADDR_SIZE 4+#define EFI_IMAGE_EXPORT_ORDINAL_SIZE 2+ /// /// DLL support. /// Import Format-- 2.26.2.windows.1
|
|
Re: [edk2-platforms][PATCH V1 20/27] SpcrFeaturePkg: Use MinPlatform build include files
Chaganty, Rangasai V
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
toggle quoted messageShow quoted text
-----Original Message-----
From: Oram, Isaac W <isaac.w.oram@intel.com> Sent: Tuesday, January 11, 2022 6:20 PM To: devel@edk2.groups.io Cc: Oram, Isaac W <isaac.w.oram@intel.com>; Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn> Subject: [edk2-devel][edk2-platforms][PATCH V1 20/27] SpcrFeaturePkg: Use MinPlatform build include files Also added feature enable flag Cc: Sai Chaganty <rangasai.v.chaganty@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Isaac Oram <isaac.w.oram@intel.com> --- Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/Library/SpcrDeviceLib.h | 2 +- Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/PostMemory.fdf | 13 ++++ Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/PreMemory.fdf | 11 ++++ Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/SpcrFeature.dsc | 62 -------------------- Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Readme.md | 12 ++-- Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.dec | 6 ++ Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.dsc | 18 ++++++ 7 files changed, 55 insertions(+), 69 deletions(-) diff --git a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/Library/SpcrDeviceLib.h b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/Library/SpcrDeviceLib.h index 947813815e..2e50270ee6 100644 --- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/Library/SpcrDeviceLib.h +++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/Library/ +++ SpcrDeviceLib.h @@ -12,7 +12,7 @@ /** Get a Serial Port device used for SPCR. - The caller should call FreePool() to free the memory if return value is not NULL. + The caller should call FreePool () to free the memory if return value is not NULL. @retval NULL Can not get device. @retval Others A serial port device path. diff --git a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/PostMemory.fdf b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/PostMemory.fdf new file mode 100644 index 0000000000..f963f567c2 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/PostMemo +++ ry.fdf @@ -0,0 +1,13 @@ +## @file +# FDF file for post-memory SpcrFeature advanced feature. +# +# This file is intended to be included into another package so +advanced features # can be conditionally included in the flash image +by enabling the respective # feature via its FeaturePCD. +# +# Copyright (C) 2022 Intel Corporation. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent ## + +INF SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf diff --git a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/PreMemory.fdf b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/PreMemory.fdf new file mode 100644 index 0000000000..3c461e7fbc --- /dev/null +++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/PreMemor +++ y.fdf @@ -0,0 +1,11 @@ +## @file +# FDF file for pre-memory SpcrFeature advanced feature. +# +# This file is intended to be included into another package so +advanced features # can be conditionally included in the flash image +by enabling the respective # feature via its FeaturePCD. +# +# Copyright (C) 2022 Intel Corporation. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent ## diff --git a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/SpcrFeature.dsc b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/SpcrFeature.dsc index c51e552df5..b06ddf4fe6 100644 --- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/SpcrFeature.dsc +++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Include/SpcrFeat +++ ure.dsc @@ -25,40 +25,9 @@ !error "DXE_ARCH must be specified to build this feature!" !endif -################################################################################ -# -# Library Class section - list of all Library Classes needed by this feature. -# -################################################################################ - -!include MdePkg/MdeLibs.dsc.inc - [LibraryClasses] - ####################################### - # Edk2 Packages - ####################################### - BaseLib|MdePkg/Library/BaseLib/BaseLib.inf - BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf - DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf - UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf - UefiLib|MdePkg/Library/UefiLib/UefiLib.inf - PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf - UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf - DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf - UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf - - ####################################### - # SpcrFeaturePkg Packages - ####################################### SpcrDeviceLib|SpcrFeaturePkg/Library/SpcrDeviceLibNull/SpcrDeviceLibNull.inf -[LibraryClasses.common.DXE_DRIVER] - ####################################### - # Edk2 Packages - ####################################### - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf - ################################################################################ # # Component section - list of all components that need built for this feature. @@ -74,38 +43,7 @@ # ################################################################################ -# -# Feature DXE Components -# - # @todo: Change below line to [Components.$(DXE_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 # is completed. [Components.X64] - ##################################### - # Spcr Feature Package - ##################################### - - # Add library instances here that are not included in package components and should be tested - # in the package build. - - # Add components here that should be included in the package build. SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf - #{ -# <LibraryClasses> -# SpcrDeviceLib|SpcrFeaturePkg/Library/SpcrDeviceLibNull/SpcrDeviceLibNull.inf -# } - -################################################################################################### -# -# BuildOptions Section - Define the module specific tool chain flags that should be used as -# the default flags for a module. These flags are appended to any -# standard flags that are defined by the build process. They can be -# applied for any modules or only those modules with the specific -# module style (EDK or EDKII) specified in [Components] section. -# -# For advanced features, it is recommended to enable [BuildOptions] in -# the applicable INF file so it does not affect the whole board package -# build when this DSC file is active. -# -################################################################################################### -[BuildOptions] diff --git a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Readme.md b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Readme.md index 0a5d48876d..66138ee0f6 100644 --- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Readme.md +++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/Readme.md @@ -22,10 +22,10 @@ Platform can implement its own library to select the serial port device. * SpcrDeviceLibNull ## SpcrAcpiDxe -The main driver of convert the serial port device info to ACPI table. -It will call the function GetSpcrDevice() in the library SpcrDeviceLib to get the serial port device path. +The main driver of convert the serial port device info into an ACPI table. +It will call the function GetSpcrDevice () in the library SpcrDeviceLib to get the serial port device path. If the serial port device path is not NULL, then use gEfiPciIoProtocolGuid to get the PCI info, and use the gEfiSerialIoProtocolGuid to get the serial port info, such as the baud rate etc. -If the serial port device is PCI device 00:16:03 (AMT serial over lan PCI device), then will set the BaseAddress. +If the serial port device is PCI device 00:16:03 (AMT serial over LAN PCI device), then will set the BaseAddress. At last fill the ACPI table as Windows required. ## SpcrDeviceLibNull @@ -37,19 +37,19 @@ Fill the serial port device info used for SPCR to ACPI table. ## Configuration There is not special configuration. -But the platform maybe implemente its own SpcrDeviceLib. +But the platform may implement its own SpcrDeviceLib. ## Data Flows GetSpcrDevice() -> serial port device path -> get PCI info and serial port info -> ACPI table. ## Control Flows -GetSpcrDevice() in SpcrDeviceLib -> SpcrAcpiDxe. +GetSpcrDevice () in SpcrDeviceLib -> SpcrAcpiDxe. ## Build Flows There is not special build flow. ## Test Point Results -* Check the output ACPI table. +There are not test points implemented. ## Functional Exit Criteria * Check the output ACPI table. diff --git a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.dec b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.dec index 03776abf06..b084fad892 100644 --- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.dec +++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.d +++ ec @@ -21,6 +21,12 @@ [Includes] Include +[Guids] + gSpcrFeaturePkgTokenSpaceGuid = { 0xe978c988, 0xeeba, 0x4671, { 0xb8, +0x0d, 0xcc, 0x8b, 0x89, 0xb5, 0xd1, 0xef }} + +[PcdsFeatureFlag] + +gSpcrFeaturePkgTokenSpaceGuid.PcdSpcrFeatureEnable|FALSE|BOOLEAN|0x0000 +0001 + [LibraryClasses] ## @libraryclass Provides an API for get SPCR device. # diff --git a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.dsc b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.dsc index 82d2d3ac73..2ee874a58e 100644 --- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.dsc +++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrFeaturePkg.d +++ sc @@ -24,6 +24,24 @@ PEI_ARCH = IA32 DXE_ARCH = X64 +[Packages] + MinPlatformPkg/MinPlatformPkg.dec + +[PcdsFeatureFlag] + # + # PCD needed for MinPlatform build includes + # + gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable |FALSE + gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable |FALSE + gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable |FALSE + +# +# Include common libraries +# +!include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc +!include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc +!include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc + # # This package always builds the feature. # -- 2.27.0.windows.1
|
|
Re: [edk2-platforms][PATCH V1 21/27] TemplateFeaturePkg: Use MinPlatform build include files
Chaganty, Rangasai V
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
toggle quoted messageShow quoted text
-----Original Message-----
From: Oram, Isaac W <isaac.w.oram@intel.com> Sent: Tuesday, January 11, 2022 6:20 PM To: devel@edk2.groups.io Cc: Oram, Isaac W <isaac.w.oram@intel.com>; Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn> Subject: [edk2-devel][edk2-platforms][PATCH V1 21/27] TemplateFeaturePkg: Use MinPlatform build include files Extend the template to leverage common library build files. Cc: Sai Chaganty <rangasai.v.chaganty@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Isaac Oram <isaac.w.oram@intel.com> --- Features/Intel/TemplateFeaturePkg/Include/TemplateFeature.dsc | 2 +- Features/Intel/TemplateFeaturePkg/TemplateFeaturePkg.dsc | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Features/Intel/TemplateFeaturePkg/Include/TemplateFeature.dsc b/Features/Intel/TemplateFeaturePkg/Include/TemplateFeature.dsc index 6742eddcf9..dd6d033aca 100644 --- a/Features/Intel/TemplateFeaturePkg/Include/TemplateFeature.dsc +++ b/Features/Intel/TemplateFeaturePkg/Include/TemplateFeature.dsc @@ -73,7 +73,7 @@ # is completed. [Components.IA32] ##################################### - # <TEMPALTE> Feature Package + # <TEMPLATE> Feature Package ##################################### # Add library instances here that are not included in package components and should be tested diff --git a/Features/Intel/TemplateFeaturePkg/TemplateFeaturePkg.dsc b/Features/Intel/TemplateFeaturePkg/TemplateFeaturePkg.dsc index 0ce8debee0..03657047dc 100644 --- a/Features/Intel/TemplateFeaturePkg/TemplateFeaturePkg.dsc +++ b/Features/Intel/TemplateFeaturePkg/TemplateFeaturePkg.dsc @@ -24,6 +24,24 @@ PEI_ARCH = IA32 DXE_ARCH = X64 +[Packages] + MinPlatformPkg/MinPlatformPkg.dec + +[PcdsFeatureFlag] + # + # PCD needed for MinPlatform build includes + # + gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable |FALSE + gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable |FALSE + gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable |FALSE + +# +# Include common libraries +# +!include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc +!include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc +!include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc + # # This package always builds the feature. # -- 2.27.0.windows.1
|
|
Re: [edk2-platforms][PATCH V1 24/27] MinPlatformPkg/Build: Add an include file for the common SPI FV info
Chaganty, Rangasai V
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
toggle quoted messageShow quoted text
-----Original Message-----
From: Oram, Isaac W <isaac.w.oram@intel.com> Sent: Tuesday, January 11, 2022 6:20 PM To: devel@edk2.groups.io Cc: Oram, Isaac W <isaac.w.oram@intel.com>; Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Dong, Eric <eric.dong@intel.com> Subject: [edk2-devel][edk2-platforms][PATCH V1 24/27] MinPlatformPkg/Build: Add an include file for the common SPI FV info This include file allows for elimination of a lot of duplicate code and makes FDF files more readable. Cc: Sai Chaganty <rangasai.v.chaganty@intel.com> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Eric Dong <eric.dong@intel.com> Signed-off-by: Isaac Oram <isaac.w.oram@intel.com> --- Platform/Intel/MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Platform/Intel/MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf b/Platform/Intel/MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fdf new file mode 100644 index 0000000000..fdda085a41 --- /dev/null +++ b/Platform/Intel/MinPlatformPkg/Include/Fdf/CommonSpiFvHeaderInfo.fd +++ f @@ -0,0 +1,24 @@ +## @file CommonSpiFvHeaderInfo.fdf +# +# @copyright +# Copyright (C) 2020 - 2021 Intel Corporation # # +SPDX-License-Identifier: BSD-2-Clause-Patent ## + +FvAlignment = 16 #FV alignment and FV attributes setting. +ERASE_POLARITY = 1 +MEMORY_MAPPED = TRUE +STICKY_WRITE = TRUE +LOCK_CAP = TRUE +LOCK_STATUS = TRUE +WRITE_DISABLED_CAP = TRUE +WRITE_ENABLED_CAP = TRUE +WRITE_STATUS = TRUE +WRITE_LOCK_CAP = TRUE +WRITE_LOCK_STATUS = TRUE +READ_DISABLED_CAP = TRUE +READ_ENABLED_CAP = TRUE +READ_STATUS = TRUE +READ_LOCK_CAP = TRUE +READ_LOCK_STATUS = TRUE -- 2.27.0.windows.1
|
|
Re: [edk2-platforms][PATCH V1 15/27] NetworkFeaturePkg: Use MinPlatformPkg build include files
Chaganty, Rangasai V
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
toggle quoted messageShow quoted text
-----Original Message-----
From: Oram, Isaac W <isaac.w.oram@intel.com> Sent: Tuesday, January 11, 2022 6:20 PM To: devel@edk2.groups.io Cc: Oram, Isaac W <isaac.w.oram@intel.com>; Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn> Subject: [edk2-devel][edk2-platforms][PATCH V1 15/27] NetworkFeaturePkg: Use MinPlatformPkg build include files Standalong build was not working due to missing libraries. Leverage MinPlatformPkg common includes for core libraries. Cc: Sai Chaganty <rangasai.v.chaganty@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Isaac Oram <isaac.w.oram@intel.com> --- Features/Intel/Network/NetworkFeaturePkg/Include/NetworkFeature.dsc | 89 ++------------------ Features/Intel/Network/NetworkFeaturePkg/NetworkFeaturePkg.dsc | 18 ++++ 2 files changed, 24 insertions(+), 83 deletions(-) diff --git a/Features/Intel/Network/NetworkFeaturePkg/Include/NetworkFeature.dsc b/Features/Intel/Network/NetworkFeaturePkg/Include/NetworkFeature.dsc index bbc91ecbb1..ca151b4e33 100644 --- a/Features/Intel/Network/NetworkFeaturePkg/Include/NetworkFeature.dsc +++ b/Features/Intel/Network/NetworkFeaturePkg/Include/NetworkFeature.dsc @@ -18,12 +18,12 @@ # ################################################################################ [Defines] -!ifndef $(PEI_ARCH) - !error "PEI_ARCH must be specified to build this feature!" -!endif -!ifndef $(DXE_ARCH) - !error "DXE_ARCH must be specified to build this feature!" -!endif + !ifndef $(PEI_ARCH) + !error "PEI_ARCH must be specified to build this feature!" + !endif + !ifndef $(DXE_ARCH) + !error "DXE_ARCH must be specified to build this feature!" + !endif !include NetworkPkg/NetworkDefines.dsc.inc @@ -41,56 +41,9 @@ # ################################################################################ -!include MdePkg/MdeLibs.dsc.inc - [LibraryClasses] !include NetworkPkg/NetworkLibs.dsc.inc - - ####################################### - # Edk2 Packages - ####################################### - BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf - BaseLib|MdePkg/Library/BaseLib/BaseLib.inf - BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf - DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf - DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf - FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf - HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf - IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf - OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf - PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf - PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf - PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf - ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf - SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf - SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf - TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf - UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf - UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf - UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf - UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf - UefiLib|MdePkg/Library/UefiLib/UefiLib.inf - UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf - -[LibraryClasses.common.SEC,LibraryClasses.common.PEI_CORE,LibraryClasses.common.PEIM] - ####################################### - # Edk2 Packages - ####################################### - HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf - MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - -[LibraryClasses.common.DXE_CORE,LibraryClasses.common.DXE_SMM_DRIVER,LibraryClasses.common.SMM_CORE,LibraryClasses.common.DXE_DRIVER,LibraryClasses.common.DXE_RUNTIME_DRIVER,LibraryClasses.common.UEFI_DRIVER,LibraryClasses.common.UEFI_APPLICATION] - ####################################### - # Edk2 Packages - ####################################### - DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf - DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf - PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf ################################################################################ # @@ -106,21 +59,6 @@ # generated for it, but the binary will not be put into any firmware volume. # ################################################################################ -# -# Feature PEI Components -# - -# @todo: Change below line to [Components.$(PEI_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 -# is completed. -[Components.IA32] - ##################################### - # Network Feature Package - ##################################### - - # Add library instances here that are not included in package components and should be tested - # in the package build. - - # Add components here that should be included in the package build. # # Feature DXE Components @@ -138,18 +76,3 @@ # Add components here that should be included in the package build. !include NetworkPkg/NetworkComponents.dsc.inc - -################################################################################################### -# -# BuildOptions Section - Define the module specific tool chain flags that should be used as -# the default flags for a module. These flags are appended to any -# standard flags that are defined by the build process. They can be -# applied for any modules or only those modules with the specific -# module style (EDK or EDKII) specified in [Components] section. -# -# For advanced features, it is recommended to enable [BuildOptions] in -# the applicable INF file so it does not affect the whole board package -# build when this DSC file is active. -# -################################################################################################### -[BuildOptions] diff --git a/Features/Intel/Network/NetworkFeaturePkg/NetworkFeaturePkg.dsc b/Features/Intel/Network/NetworkFeaturePkg/NetworkFeaturePkg.dsc index 199686fa09..cdc5dc851d 100644 --- a/Features/Intel/Network/NetworkFeaturePkg/NetworkFeaturePkg.dsc +++ b/Features/Intel/Network/NetworkFeaturePkg/NetworkFeaturePkg.dsc @@ -24,6 +24,24 @@ PEI_ARCH = IA32 DXE_ARCH = X64 +[Packages] + MinPlatformPkg/MinPlatformPkg.dec + +[PcdsFeatureFlag] + # + # PCD needed for MinPlatform build includes + # + gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable |FALSE + gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable |FALSE + gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable |FALSE + +# +# Include common libraries +# +!include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc +!include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc +!include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc + # # This package always builds the feature. # -- 2.27.0.windows.1
|
|
Re: [edk2-platforms][PATCH V1 22/27] AdvancedFeaturePkg: Fix all relative package paths
Chaganty, Rangasai V
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
toggle quoted messageShow quoted text
-----Original Message-----
From: Oram, Isaac W <isaac.w.oram@intel.com> Sent: Tuesday, January 11, 2022 6:20 PM To: devel@edk2.groups.io Cc: Oram, Isaac W <isaac.w.oram@intel.com>; Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn> Subject: [edk2-devel][edk2-platforms][PATCH V1 22/27] AdvancedFeaturePkg: Fix all relative package paths Packages should be at the root of a PACKAGES_PATH entry. At some point, paths were relative to edk2-platforms/Features/Intel which was functional, but interferes with the proper functioning of packaging tools. Cc: Sai Chaganty <rangasai.v.chaganty@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Isaac Oram <isaac.w.oram@intel.com> --- Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc | 15 ++++++++------- Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf | 15 ++++++++------- Features/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf | 15 ++++++++------- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc index ac9ab80e8e..874b8ce7db 100644 --- a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc +++ b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc @@ -14,45 +14,46 @@ # Debug Advanced Features # !if gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable == TRUE - !include Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc + !include AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc !endif + !if gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable == TRUE - !include Debugging/Usb3DebugFeaturePkg/Include/Usb3DebugFeature.dsc + !include Usb3DebugFeaturePkg/Include/Usb3DebugFeature.dsc !endif # # Network Advanced Features # !if gNetworkFeaturePkgTokenSpaceGuid.PcdNetworkFeatureEnable == TRUE - !include Network/NetworkFeaturePkg/Include/NetworkFeature.dsc + !include NetworkFeaturePkg/Include/NetworkFeature.dsc !endif # # Out-of-Band Management Advanced Features # !if gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable == TRUE - !include OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc + !include IpmiFeaturePkg/Include/IpmiFeature.dsc !endif # # Power Management Advanced Features # !if gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable == TRUE - !include PowerManagement/S3FeaturePkg/Include/S3Feature.dsc + !include S3FeaturePkg/Include/S3Feature.dsc !endif # # System Information Advanced Features # !if gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable == TRUE - !include SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeature.dsc + !include SmbiosFeaturePkg/Include/SmbiosFeature.dsc !endif # # User Interface Advanced Features # !if gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable == TRUE - !include UserInterface/UserAuthFeaturePkg/Include/UserAuthFeature.dsc + !include UserAuthFeaturePkg/Include/UserAuthFeature.dsc !endif !if gLogoFeaturePkgTokenSpaceGuid.PcdLogoFeatureEnable == TRUE diff --git a/Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf b/Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf index c49a0fd875..e710fe7f01 100644 --- a/Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf +++ b/Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf @@ -15,45 +15,46 @@ # Debug Advanced Features # !if gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable == TRUE - !include Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fdf + !include AcpiDebugFeaturePkg/Include/PostMemory.fdf !endif + !if gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable == TRUE - !include Debugging/Usb3DebugFeaturePkg/Include/PostMemory.fdf + !include Usb3DebugFeaturePkg/Include/PostMemory.fdf !endif # # Network Advanced Features # !if gNetworkFeaturePkgTokenSpaceGuid.PcdNetworkFeatureEnable == TRUE - !include Network/NetworkFeaturePkg/Include/PostMemory.fdf + !include NetworkFeaturePkg/Include/PostMemory.fdf !endif # # Out-of-Band Management Advanced Features # !if gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable == TRUE - !include OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf + !include IpmiFeaturePkg/Include/PostMemory.fdf !endif # # Power Management Advanced Features # !if gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable == TRUE - !include PowerManagement/S3FeaturePkg/Include/PostMemory.fdf + !include S3FeaturePkg/Include/PostMemory.fdf !endif # # System Information Advanced Features # !if gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable == TRUE - !include SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf + !include SmbiosFeaturePkg/Include/PostMemory.fdf !endif # # User Interface Advanced Features # !if gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable == TRUE - !include UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf + !include UserAuthFeaturePkg/Include/PostMemory.fdf !endif !if gLogoFeaturePkgTokenSpaceGuid.PcdLogoFeatureEnable == TRUE diff --git a/Features/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf b/Features/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf index 1b21e96a5f..177aafc1ec 100644 --- a/Features/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf +++ b/Features/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf @@ -15,45 +15,46 @@ # Debug Advanced Features # !if gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable == TRUE - !include Debugging/AcpiDebugFeaturePkg/Include/PreMemory.fdf + !include AcpiDebugFeaturePkg/Include/PreMemory.fdf !endif + !if gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable == TRUE - !include Debugging/Usb3DebugFeaturePkg/Include/PreMemory.fdf + !include Usb3DebugFeaturePkg/Include/PreMemory.fdf !endif # # Network Advanced Features # !if gNetworkFeaturePkgTokenSpaceGuid.PcdNetworkFeatureEnable == TRUE - !include Network/NetworkFeaturePkg/Include/PreMemory.fdf + !include NetworkFeaturePkg/Include/PreMemory.fdf !endif # # Out-of-Band Management Advanced Features # !if gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable == TRUE - !include OutOfBandManagement/IpmiFeaturePkg/Include/PreMemory.fdf + !include IpmiFeaturePkg/Include/PreMemory.fdf !endif # # Power Management Advanced Features # !if gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable == TRUE - !include PowerManagement/S3FeaturePkg/Include/PreMemory.fdf + !include S3FeaturePkg/Include/PreMemory.fdf !endif # # System Information Advanced Features # !if gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable == TRUE - !include SystemInformation/SmbiosFeaturePkg/Include/PreMemory.fdf + !include SmbiosFeaturePkg/Include/PreMemory.fdf !endif # # User Interface Advanced Features # !if gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable == TRUE - !include UserInterface/UserAuthFeaturePkg/Include/PreMemory.fdf + !include UserAuthFeaturePkg/Include/PreMemory.fdf !endif !if gLogoFeaturePkgTokenSpaceGuid.PcdLogoFeatureEnable == TRUE -- 2.27.0.windows.1
|
|
Re: [edk2-platforms][PATCH V1 23/27] AdvancedFeaturePkg: Add missing features
Chaganty, Rangasai V
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
toggle quoted messageShow quoted text
-----Original Message-----
From: Oram, Isaac W <isaac.w.oram@intel.com> Sent: Tuesday, January 11, 2022 6:20 PM To: devel@edk2.groups.io Cc: Oram, Isaac W <isaac.w.oram@intel.com>; Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn> Subject: [edk2-devel][edk2-platforms][PATCH V1 23/27] AdvancedFeaturePkg: Add missing features The AdvancedFeaturePkg is supposed to include all features. Add Beep Debug feature to include DSC and FDF. Order features based on their domains. Cc: Sai Chaganty <rangasai.v.chaganty@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Isaac Oram <isaac.w.oram@intel.com> --- Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc | 66 ++++++++++++++++---- Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc | 36 ++++++++--- Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc | 64 +++++++++++++++---- Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf | 36 ++++++++--- Features/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf | 36 ++++++++--- Features/Intel/Readme.md | 49 ++++++++++----- 6 files changed, 219 insertions(+), 68 deletions(-) diff --git a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc index 0c7a29cc75..02636da916 100644 --- a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc +++ b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc @@ -36,7 +36,6 @@ !include AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc - ################################################################################ # # Advanced Feature Enable section - all advanced features are enabling for the @@ -44,26 +43,71 @@ # ################################################################################ [PcdsFeatureFlag] - gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable |TRUE - gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable |TRUE - gNetworkFeaturePkgTokenSpaceGuid.PcdNetworkFeatureEnable |TRUE - gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable |TRUE - gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable |TRUE - gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable |TRUE - gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable |TRUE - gLogoFeaturePkgTokenSpaceGuid.PcdLogoFeatureEnable |TRUE - gLogoFeaturePkgTokenSpaceGuid.PcdJpgEnable |FALSE + # + # Debugging features + # + gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable |TRUE + gBeepDebugFeaturePkgTokenSpaceGuid.PcdBeepDebugFeatureEnable |TRUE + gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdPostCodeDebugFeatureEnable |TRUE + gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable |TRUE + + # + # Network features + # + gNetworkFeaturePkgTokenSpaceGuid.PcdNetworkFeatureEnable |TRUE + + # + # OutOfBandManagement features + # + gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable |TRUE + gSpcrFeaturePkgTokenSpaceGuid.PcdSpcrFeatureEnable |TRUE + + # + # PowerManagement features + # + gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable |TRUE + + # + # SystemInformation features + # + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable |TRUE + + # + # UserInterface features + # + gLogoFeaturePkgTokenSpaceGuid.PcdLogoFeatureEnable |TRUE + gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable |TRUE + + gVirtualKeyboardFeaturePkgTokenSpaceGuid.PcdVirtualKeyboardFeatureEnab + le |TRUE + +# +# PCD that are required to be set by the build target should be +configured here for test purposes # These settings are only for the purposes of buildings, boards should follow instructions in Readme files. +# + +[PcdsFixedAtBuild] + gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugPortLibInstance|1 + +[PcdsFeatureFlag] + # + # MinPlatform common include currently required PCD + # gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable |FALSE gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable |FALSE gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable |FALSE # -# Include common library +# Include common libraries # !include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc !include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc !include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc +# +# Libraries required to be specified by the build target # +[LibraryClasses.Common] + +PlatformHookLib|MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatfo +rmHookLibNull.inf # Required by BeepDebugFeature + # # This package builds all advanced features. # diff --git a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc index 874b8ce7db..2b36938df6 100644 --- a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc +++ b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc @@ -11,51 +11,67 @@ ## # -# Debug Advanced Features +# Debugging features # !if gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable == TRUE !include AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc !endif +!if gBeepDebugFeaturePkgTokenSpaceGuid.PcdBeepDebugFeatureEnable == +TRUE + !include BeepDebugFeaturePkg/Include/BeepDebugFeature.dsc +!endif + +!if +gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdPostCodeDebugFeatureEnable == +TRUE + !include PostCodeDebugFeaturePkg/Include/PostCodeDebugFeature.dsc +!endif + !if gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable == TRUE !include Usb3DebugFeaturePkg/Include/Usb3DebugFeature.dsc !endif # -# Network Advanced Features +# Network features # !if gNetworkFeaturePkgTokenSpaceGuid.PcdNetworkFeatureEnable == TRUE !include NetworkFeaturePkg/Include/NetworkFeature.dsc !endif # -# Out-of-Band Management Advanced Features +# OutOfBandManagement features # !if gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable == TRUE !include IpmiFeaturePkg/Include/IpmiFeature.dsc !endif +!if gSpcrFeaturePkgTokenSpaceGuid.PcdSpcrFeatureEnable == TRUE + !include SpcrFeaturePkg/Include/SpcrFeature.dsc +!endif + # -# Power Management Advanced Features +# PowerManagement features # !if gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable == TRUE !include S3FeaturePkg/Include/S3Feature.dsc !endif # -# System Information Advanced Features +# SystemInformation features # !if gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable == TRUE !include SmbiosFeaturePkg/Include/SmbiosFeature.dsc !endif # -# User Interface Advanced Features +# UserInterface features # -!if gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable == TRUE - !include UserAuthFeaturePkg/Include/UserAuthFeature.dsc -!endif - !if gLogoFeaturePkgTokenSpaceGuid.PcdLogoFeatureEnable == TRUE !include LogoFeaturePkg/Include/LogoFeature.dsc !endif + +!if +gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable == +TRUE + !include UserAuthFeaturePkg/Include/UserAuthFeature.dsc +!endif + +!if +gVirtualKeyboardFeaturePkgTokenSpaceGuid.PcdVirtualKeyboardFeatureEnabl +e == TRUE + !include VirtualKeyboardFeaturePkg/Include/VirtualKeyboardFeature.dsc +!endif diff --git a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc index ad248de800..e214175eda 100644 --- a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc +++ b/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeaturesPcd.dsc @@ -16,28 +16,70 @@ # [Packages] MdePkg/MdePkg.dec + + # + # Debugging features + # AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec + BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec + PostCodeDebugFeaturePkg/PostCodeDebugFeaturePkg.dec Usb3DebugFeaturePkg/Usb3DebugFeaturePkg.dec + + # + # Networking features + # NetworkFeaturePkg/NetworkFeaturePkg.dec + + # + # OutOfBandManagement features + # IpmiFeaturePkg/IpmiFeaturePkg.dec + SpcrFeaturePkg/SpcrFeaturePkg.dec + + # + # PowerManagement features + # S3FeaturePkg/S3FeaturePkg.dec + + # + # SystemInformation features + # SmbiosFeaturePkg/SmbiosFeaturePkg.dec - UserAuthFeaturePkg/UserAuthFeaturePkg.dec + + # + # UserInterface features + # LogoFeaturePkg/LogoFeaturePkg.dec - BeepDebugFeaturePkg/BeepDebugFeaturePkg.dec - PostCodeDebugFeaturePkg/PostCodeDebugFeaturePkg.dec + UserAuthFeaturePkg/UserAuthFeaturePkg.dec + VirtualKeyboardFeaturePkg/VirtualKeyboardFeaturePkg.dec # # The section below sets all PCDs to FALSE in this DSC file so the feature is not enabled by default. # Board can set PCDs to TRUE in its DSC file to enable a subset of advanced features # [PcdsFeatureFlag] - gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable |FALSE - gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable |FALSE - gNetworkFeaturePkgTokenSpaceGuid.PcdNetworkFeatureEnable |FALSE - gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable |FALSE - gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable |FALSE - gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable |FALSE - gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable |FALSE - gLogoFeaturePkgTokenSpaceGuid.PcdLogoFeatureEnable |FALSE + gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable |FALSE + gBeepDebugFeaturePkgTokenSpaceGuid.PcdBeepDebugFeatureEnable |FALSE + gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdPostCodeDebugFeatureEnable |FALSE + gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable |FALSE + + gNetworkFeaturePkgTokenSpaceGuid.PcdNetworkFeatureEnable |FALSE + + gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable |FALSE + gSpcrFeaturePkgTokenSpaceGuid.PcdSpcrFeatureEnable |FALSE + + gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable |FALSE + + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable |FALSE + + gLogoFeaturePkgTokenSpaceGuid.PcdLogoFeatureEnable |FALSE + gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable |FALSE + + gVirtualKeyboardFeaturePkgTokenSpaceGuid.PcdVirtualKeyboardFeatureEnab + le |FALSE + +# +# There seems to be some build parsing odd behavior that requires this +PCD to be specified even though # the *.fdf that consumes it is dependent on the feature flag. +# This section is to ensure that boards have these PCD instantiated. +# +[PcdsFeatureFlag] gLogoFeaturePkgTokenSpaceGuid.PcdJpgEnable |FALSE diff --git a/Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf b/Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf index e710fe7f01..99089f9a7b 100644 --- a/Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf +++ b/Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf @@ -12,51 +12,67 @@ ## # -# Debug Advanced Features +# Debugging features # !if gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable == TRUE !include AcpiDebugFeaturePkg/Include/PostMemory.fdf !endif +!if gBeepDebugFeaturePkgTokenSpaceGuid.PcdBeepDebugFeatureEnable == +TRUE + !include BeepDebugFeaturePkg/Include/PostMemory.fdf +!endif + +!if +gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdPostCodeDebugFeatureEnable == +TRUE + !include PostCodeDebugFeaturePkg/Include/PostMemory.fdf +!endif + !if gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable == TRUE !include Usb3DebugFeaturePkg/Include/PostMemory.fdf !endif # -# Network Advanced Features +# Network features # !if gNetworkFeaturePkgTokenSpaceGuid.PcdNetworkFeatureEnable == TRUE !include NetworkFeaturePkg/Include/PostMemory.fdf !endif # -# Out-of-Band Management Advanced Features +# OutOfBandManagement features # !if gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable == TRUE !include IpmiFeaturePkg/Include/PostMemory.fdf !endif +!if gSpcrFeaturePkgTokenSpaceGuid.PcdSpcrFeatureEnable == TRUE + !include SpcrFeaturePkg/Include/PostMemory.fdf +!endif + # -# Power Management Advanced Features +# PowerManagement features # !if gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable == TRUE !include S3FeaturePkg/Include/PostMemory.fdf !endif # -# System Information Advanced Features +# SystemInformation features # !if gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable == TRUE !include SmbiosFeaturePkg/Include/PostMemory.fdf !endif # -# User Interface Advanced Features +# UserInterface features # -!if gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable == TRUE - !include UserAuthFeaturePkg/Include/PostMemory.fdf -!endif - !if gLogoFeaturePkgTokenSpaceGuid.PcdLogoFeatureEnable == TRUE !include LogoFeaturePkg/Include/PostMemory.fdf !endif + +!if +gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable == +TRUE + !include UserAuthFeaturePkg/Include/PostMemory.fdf +!endif + +!if +gVirtualKeyboardFeaturePkgTokenSpaceGuid.PcdVirtualKeyboardFeatureEnabl +e == TRUE + !include VirtualKeyboardFeaturePkg/Include/PostMemory.fdf +!endif diff --git a/Features/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf b/Features/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf index 177aafc1ec..1db258446a 100644 --- a/Features/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf +++ b/Features/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf @@ -12,51 +12,67 @@ ## # -# Debug Advanced Features +# Debugging features # !if gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable == TRUE !include AcpiDebugFeaturePkg/Include/PreMemory.fdf !endif +!if gBeepDebugFeaturePkgTokenSpaceGuid.PcdBeepDebugFeatureEnable == +TRUE + !include BeepDebugFeaturePkg/Include/PreMemory.fdf +!endif + +!if +gPostCodeDebugFeaturePkgTokenSpaceGuid.PcdPostCodeDebugFeatureEnable == +TRUE + !include PostCodeDebugFeaturePkg/Include/PreMemory.fdf +!endif + !if gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable == TRUE !include Usb3DebugFeaturePkg/Include/PreMemory.fdf !endif # -# Network Advanced Features +# Network features # !if gNetworkFeaturePkgTokenSpaceGuid.PcdNetworkFeatureEnable == TRUE !include NetworkFeaturePkg/Include/PreMemory.fdf !endif # -# Out-of-Band Management Advanced Features +# OutOfBandManagement features # !if gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable == TRUE !include IpmiFeaturePkg/Include/PreMemory.fdf !endif +!if gSpcrFeaturePkgTokenSpaceGuid.PcdSpcrFeatureEnable == TRUE + !include SpcrFeaturePkg/Include/PreMemory.fdf +!endif + # -# Power Management Advanced Features +# PowerManagement features # !if gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable == TRUE !include S3FeaturePkg/Include/PreMemory.fdf !endif # -# System Information Advanced Features +# SystemInformation features # !if gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable == TRUE !include SmbiosFeaturePkg/Include/PreMemory.fdf !endif # -# User Interface Advanced Features +# UserInterface features # -!if gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable == TRUE - !include UserAuthFeaturePkg/Include/PreMemory.fdf -!endif - !if gLogoFeaturePkgTokenSpaceGuid.PcdLogoFeatureEnable == TRUE !include LogoFeaturePkg/Include/PreMemory.fdf !endif + +!if +gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable == +TRUE + !include UserAuthFeaturePkg/Include/PreMemory.fdf +!endif + +!if +gVirtualKeyboardFeaturePkgTokenSpaceGuid.PcdVirtualKeyboardFeatureEnabl +e == TRUE + !include VirtualKeyboardFeaturePkg/Include/PreMemory.fdf +!endif diff --git a/Features/Intel/Readme.md b/Features/Intel/Readme.md index 1a03a4c0d2..cf5ef7b260 100644 --- a/Features/Intel/Readme.md +++ b/Features/Intel/Readme.md @@ -195,32 +195,47 @@ At a minimum, an advanced feature must consist of the following elements: 6. Add the source code for the advanced feature. * If the feature is large it is recommended to add libraries in one patch and then modules in a following patch. -7. Update the feature DSC file. This file is in `XxxFeaturePkg/Include/XxxFeature.dsc`. +7. Update the feature DSC include file. This file is in `XxxFeaturePkg/Include/XxxFeature.dsc`. * In most cases, `XxxFeaturePkg/XxxFeaturePkg.dsc` should just `!include XxxFeaturePkg/Include/XxxFeature.dsc`. + * This file should not duplicate core content from `MinPlatformPkg/Include/Dsc` except where a change is required by + the feature. -8. Update the feature FDF files. These files are `XxxFeaturePkg/Include/PreMemory.fdf` and +8. Update the feature FDF include files. These files are +`XxxFeaturePkg/Include/PreMemory.fdf` and `XxxFeaturePkg/Include/PostMemory.fdf`. * Each file should contain the feature pre-memory modules and post-memory modules respectively. 9. Build the advanced feature package to ensure the build is successful: - From the workspace root: - 1. cd edk2-platforms/edk2 - 2. Execute edksetup.bat (Windows) or edksetup.sh (Linux). - 3. Verify the "WORKSPACE" environment variable is set to the edk2 directory in your workspace. - 4. Set the "PACKAGES_PATH" environment variable to include the edk2-platforms/Platform/Intel, edk2-platforms/Silicon/Intel, - and edk2-platforms/Features/Intel directories. + 1. Verify the "WORKSPACE" environment variable is set to the parent of edk2 and edk2-platforms directory in your + workspace. + 2. Set the "PACKAGES_PATH" environment variable to include the edk2, edk2-platforms/Platform/Intel, + edk2-platforms/Silicon/Intel, and edk2-platforms/Features/Intel directories. * Windows example: - * set PACKAGES_PATH=c:\Edk2Workspace\edk2-platforms\Platform\Intel; - c:\Edk2Workspace\edk2-platforms\Silicon\Intel; - c:\Edk2Workspace\edk2-platforms\Features\Intel + * set PACKAGES_PATH=%WORKSPACE%\edk2; + %WORKSPACE%\edk2-platforms\Platform\Intel; + %WORKSPACE%\edk2-platforms\Silicon\Intel; + %WORKSPACE%\edk2-platforms\Features\Intel; + %WORKSPACE%\edk2-platforms\Features\Intel\Debugging; + %WORKSPACE%\edk2-platforms\Features\Intel\Network; + %WORKSPACE%\edk2-platforms\Features\Intel\OutOfBandManagement; + %WORKSPACE%\edk2-platforms\Features\Intel\PowerManagement; + %WORKSPACE%\edk2-platforms\Features\Intel\SystemInformation; + + %WORKSPACE%\edk2-platforms\Features\Intel\UserInterface * Linux example: - * export PACKAGES_PATH=~/Edk2Workspace/edk2-platforms/Platform/Intel: + * export PACKAGES_PATH=~Edk2Workspace/edk2: + ~/Edk2Workspace/edk2-platforms/Platform/Intel: ~/Edk2Workspace/edk2-platforms/Silicon/Intel: - ~/Edk2Workspace/edk2-platforms/Features/Intel + ~/Edk2Workspace/edk2-platforms/Features/Intel: + ~/Edk2Workspace/edk2-platforms/Features/Intel/Debugging: + ~/Edk2Workspace/edk2-platforms/Features/Intel/Network: + ~/Edk2Workspace/edk2-platforms/Features/Intel/OutOfBandManagement: + ~/Edk2Workspace/edk2-platforms/Features/Intel/PowerManagement: + ~/Edk2Workspace/edk2-platforms/Features/Intel/SystemInformation: + ~/Edk2Workspace/edk2-platforms/Features/Intel/UserInterface + 3. cd edk2 + 4. Execute edksetup.bat (Windows) or edksetup.sh (Linux). 5. cd edk2-platforms/Features/Intel - 6. <pre>build -p FeatureDomainDirectory/XxxFeaturePkg/XxxFeaturePkg.dsc -a IA32 -a X64</pre> - + 6. <pre>build -a IA32 -a X64 -p + FeatureDomainDirectory/XxxFeaturePkg/XxxFeaturePkg.dsc</pre> *Note:* -a specifies the architecture. Typically IA32 and X64 modules are built for 32-bit PEI and 64-bit DXE though build for your specific requirements. @@ -228,11 +243,13 @@ At a minimum, an advanced feature must consist of the following elements: 1. Add `XxxFeaturePkg/Include/XxxFeature.dsc` to `AdvancedFeatures.dsc` 2. Add `XxxFeaturePkg/Include/PreMemory.fdf` to `AdvancedFeaturePkg/Include/PreMemory.fdf` 3. Add `XxxFeaturePkg/Include/PostMemory.fdf` to `AdvancedFeaturePkg/Include/PostMemory.fdf` + 4. Add the `PcdFeatureEnable` to `AdvancedFeaturesPcd.dsc` set to FALSE + 5. Add the `PcdFeatureEnable` to `AdvancedFeaturePkg.dsc` set to + TRUE 11. Build `AdvancedFeaturePkg` to ensure the build is successful. 1. Follow the steps in step #9 but change the build command to: - <pre>build -p AdvancedFeaturePkg/AdvancedFeaturePkg.dsc -a IA32 -a X64</pre> + <pre>build -a IA32 -a X64 -p + AdvancedFeaturePkg/AdvancedFeaturePkg.dsc</pre> 12. Before sending your patch series, ensure the `Readme.md` file in `XxxFeaturePkg` is completed so others can use it during the feature review. -- 2.27.0.windows.1
|
|
Re: [edk2-platforms][PATCH V1 08/27] SmbiosFeaturePkg: Fix all relative package paths
Chaganty, Rangasai V
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
toggle quoted messageShow quoted text
-----Original Message-----
From: Oram, Isaac W <isaac.w.oram@intel.com> Sent: Tuesday, January 11, 2022 6:20 PM To: devel@edk2.groups.io Cc: Oram, Isaac W <isaac.w.oram@intel.com>; Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn> Subject: [edk2-devel][edk2-platforms][PATCH V1 08/27] SmbiosFeaturePkg: Fix all relative package paths Packages should be at the root of a PACKAGES_PATH entry. At some point, paths were relative to edk2-platforms/Features/Intel which was functional, but interferes with the proper functioning of packaging tools. Cc: Sai Chaganty <rangasai.v.chaganty@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Isaac Oram <isaac.w.oram@intel.com> --- Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf | 2 +- Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeature.dsc | 2 +- Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf | 2 +- Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf b/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf index 3ed23bd937..c3a3e81503 100644 --- a/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf +++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemo +++ ry.fdf @@ -7,4 +7,4 @@ # ## - INF SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf + INF SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeature.dsc b/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeature.dsc index 31d44b68b3..094dd957b8 100644 --- a/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeature.dsc +++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFe +++ ature.dsc @@ -100,7 +100,7 @@ # in the package build. # Add components here that should be included in the package build. - SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf + SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf ################################################################################################### # diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf index bd8736b621..8e530c4945 100644 --- a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf +++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/S +++ mbiosBasicDxe.inf @@ -33,7 +33,7 @@ [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec - SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec + SmbiosFeaturePkg/SmbiosFeaturePkg.dec [LibraryClasses] BaseLib diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec index 6170f37969..db3cdbb0d0 100644 --- a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec +++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg +++ .dec @@ -38,7 +38,7 @@ IndustryStandard/SmBios.h <Packages> MdePkg/MdePkg.dec - SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec + SmbiosFeaturePkg/SmbiosFeaturePkg.dec } gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.Vendor|0x1 gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosVersion|0x2 @@ -71,7 +71,7 @@ IndustryStandard/SmBios.h <Packages> MdePkg/MdePkg.dec - SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec + SmbiosFeaturePkg/SmbiosFeaturePkg.dec } gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1SystemInformation.Manufacturer|0x1 gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1SystemInformation.ProductName|0x2 @@ -87,7 +87,7 @@ IndustryStandard/SmBios.h <Packages> MdePkg/MdePkg.dec - SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec + SmbiosFeaturePkg/SmbiosFeaturePkg.dec } # @@ -111,7 +111,7 @@ IndustryStandard/SmBios.h <Packages> MdePkg/MdePkg.dec - SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec + SmbiosFeaturePkg/SmbiosFeaturePkg.dec } gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3SystemEnclosureChassis.Manufacturer|0x1 gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3SystemEnclosureChassis.Type|MiscChassisTypeRackMountChassis @@ -131,7 +131,7 @@ IndustryStandard/SmBios.h <Packages> MdePkg/MdePkg.dec - SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec + SmbiosFeaturePkg/SmbiosFeaturePkg.dec } gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType32SystemBootInformation.BootStatus|BootInformationStatusNoError -- 2.27.0.windows.1
|
|
Re: [edk2-platforms][PATCH V1 07/27] S3FeaturePkg: Use MinPlatformPkg build include files
Chaganty, Rangasai V
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
toggle quoted messageShow quoted text
-----Original Message-----
From: Oram, Isaac W <isaac.w.oram@intel.com> Sent: Tuesday, January 11, 2022 6:20 PM To: devel@edk2.groups.io Cc: Oram, Isaac W <isaac.w.oram@intel.com>; Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn> Subject: [edk2-devel][edk2-platforms][PATCH V1 07/27] S3FeaturePkg: Use MinPlatformPkg build include files Use the MinPlatformPkg common core build files to build libraries needed by this feature. Cc: Sai Chaganty <rangasai.v.chaganty@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Isaac Oram <isaac.w.oram@intel.com> --- Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf | 2 +- Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc | 72 ++------------------ Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dsc | 18 +++++ 3 files changed, 26 insertions(+), 66 deletions(-) diff --git a/Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf b/Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf index 34caf3dacc..fdd16a4e03 100644 --- a/Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf +++ b/Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf @@ -7,4 +7,4 @@ # ## - INF S3FeaturePkg/S3Pei/S3Pei.inf +INF S3FeaturePkg/S3Pei/S3Pei.inf diff --git a/Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc b/Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc index f94bd2b431..cc34e78507 100644 --- a/Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc +++ b/Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc @@ -18,12 +18,12 @@ # ################################################################################ [Defines] -!ifndef $(PEI_ARCH) - !error "PEI_ARCH must be specified to build this feature!" -!endif -!ifndef $(DXE_ARCH) - !error "DXE_ARCH must be specified to build this feature!" -!endif + !ifndef $(PEI_ARCH) + !error "PEI_ARCH must be specified to build this feature!" + !endif + !ifndef $(DXE_ARCH) + !error "DXE_ARCH must be specified to build this feature!" + !endif ################################################################################ # @@ -31,34 +31,7 @@ # ################################################################################ -!include MdePkg/MdeLibs.dsc.inc - -[LibraryClasses] - ####################################### - # Edk2 Packages - ####################################### - BaseLib|MdePkg/Library/BaseLib/BaseLib.inf - BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf - DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf - IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf - PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf - PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf - PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf - -[LibraryClasses.common.PEI_CORE,LibraryClasses.common.PEIM] - ####################################### - # Edk2 Packages - ####################################### - HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf - MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf - PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf - PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf - - ####################################### - # Silicon Initialization Package - ####################################### +[LibraryClasses.common.PEIM] SmmAccessLib|IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLib/PeiSmmAccessLib.inf ################################################################################ @@ -92,34 +65,3 @@ # Add components here that should be included in the package build. S3FeaturePkg/S3Pei/S3Pei.inf - -# -# Feature DXE Components -# - -# @todo: Change below line to [Components.$(DXE_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 -# is completed. -[Components.X64] - ##################################### - # S3 Feature Package - ##################################### - - # Add library instances here that are not included in package components and should be tested - # in the package build. - - # Add components here that should be included in the package build. - -################################################################################################### -# -# BuildOptions Section - Define the module specific tool chain flags that should be used as -# the default flags for a module. These flags are appended to any -# standard flags that are defined by the build process. They can be -# applied for any modules or only those modules with the specific -# module style (EDK or EDKII) specified in [Components] section. -# -# For advanced features, it is recommended to enable [BuildOptions] in -# the applicable INF file so it does not affect the whole board package -# build when this DSC file is active. -# -################################################################################################### -[BuildOptions] diff --git a/Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dsc b/Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dsc index 28ee49d429..e16a1f8d00 100644 --- a/Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dsc +++ b/Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dsc @@ -24,6 +24,24 @@ PEI_ARCH = IA32 DXE_ARCH = X64 +[Packages] + MinPlatformPkg/MinPlatformPkg.dec + +[PcdsFeatureFlag] + # + # PCD needed for MinPlatform build includes + # + gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable |FALSE + gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable |FALSE + gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable |FALSE + +# +# Include common libraries +# +!include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc +!include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc +!include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc + # # This package always builds the feature. # -- 2.27.0.windows.1
|
|
Re: [edk2-platforms][PATCH V1 02/27] BeepDebugFeaturePkg: Fix all relative package paths
Chaganty, Rangasai V
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
toggle quoted messageShow quoted text
-----Original Message-----
From: Oram, Isaac W <isaac.w.oram@intel.com> Sent: Tuesday, January 11, 2022 6:20 PM To: devel@edk2.groups.io Cc: Oram, Isaac W <isaac.w.oram@intel.com>; Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Gao, Liming <gaoliming@byosoft.com.cn>; Dong, Eric <eric.dong@intel.com> Subject: [edk2-devel][edk2-platforms][PATCH V1 02/27] BeepDebugFeaturePkg: Fix all relative package paths Packages should be at the root of a PACKAGES_PATH entry. At some point, paths were relative to edk2-platforms/Features/Intel which was functional, but interferes with the proper functioning of packaging tools. Cc: Sai Chaganty <rangasai.v.chaganty@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Eric Dong <eric.dong@intel.com> Signed-off-by: Isaac Oram <isaac.w.oram@intel.com> --- Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFeature.dsc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFeature.dsc b/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFeature.dsc index 251de6932b..00ef022657 100644 --- a/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFeature.dsc +++ b/Features/Intel/Debugging/BeepDebugFeaturePkg/Include/BeepDebugFeat +++ ure.dsc @@ -54,17 +54,17 @@ gBeepDebugFeaturePkgTokenSpaceGuid.PcdStatusCodeUseBeep [LibraryClasses.Common] - BeepLib|Debugging/BeepDebugFeaturePkg/Library/BeepLib/BeepLibNull.inf - BeepMapLib|Debugging/BeepDebugFeaturePkg/Library/BeepMapLib/BeepMapLib.inf + BeepLib|BeepDebugFeaturePkg/Library/BeepLib/BeepLibNull.inf + BeepMapLib|BeepDebugFeaturePkg/Library/BeepMapLib/BeepMapLib.inf [LibraryClasses.PEIM, LibraryClasses.PEI_CORE] - StatusCodeHandlerLib|Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatusCodeHandlerLib.inf + + StatusCodeHandlerLib|BeepDebugFeaturePkg/Library/BeepStatusCodeHandler + Lib/PeiBeepStatusCodeHandlerLib.inf [LibraryClasses.DXE_RUNTIME_DRIVER] - StatusCodeHandlerLib|Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf + + StatusCodeHandlerLib|BeepDebugFeaturePkg/Library/BeepStatusCodeHandler + Lib/RuntimeDxeBeepStatusCodeHandlerLib.inf [LibraryClasses.DXE_SMM_DRIVER] - StatusCodeHandlerLib|Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeepStatusCodeHandlerLib.inf + + StatusCodeHandlerLib|BeepDebugFeaturePkg/Library/BeepStatusCodeHandler + Lib/SmmBeepStatusCodeHandlerLib.inf [Components.IA32] @@ -77,7 +77,7 @@ # FILE_GUID = $(BEEP_PEIM_FILENAME) <LibraryClasses> - NULL|Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatusCodeHandlerLib.inf + + NULL|BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/PeiBeepStatu + sCodeHandlerLib.inf } [Components.X64] @@ -90,7 +90,7 @@ # FILE_GUID = $(BEEP_DXE_FILENAME) <LibraryClasses> - NULL|Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBeepStatusCodeHandlerLib.inf + + NULL|BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/RuntimeDxeBe + epStatusCodeHandlerLib.inf } MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.inf { @@ -102,5 +102,5 @@ # FILE_GUID = $(BEEP_SMM_FILENAME) <LibraryClasses> - NULL|Debugging/BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeepStatusCodeHandlerLib.inf + + NULL|BeepDebugFeaturePkg/Library/BeepStatusCodeHandlerLib/SmmBeepStatu + sCodeHandlerLib.inf } -- 2.27.0.windows.1
|
|