Re: [edk2-devel] [PATCH V2 0/2] MdeModulePkg PeiCore: Fix grammatical errors
For this patch series, Reviewed-by: Jian J Wang Regards, Jian > -Original Message- > From: Kubacki, Michael A > Sent: Thursday, November 28, 2019 3:58 AM > To: devel@edk2.groups.io > Cc: Bi, Dandan ; Gao, Liming ; > Wang, Jian J ; Wu, Hao A > Subject: [PATCH V2 0/2] MdeModulePkg PeiCore: Fix grammatical errors > > V2 Changes: > * "The index of the FV to search." to "Index of the FV to search" >in the "Instance" parameter of ProcessFvFile () > * Removed "in this FV format" in the function description of >AddUnknownFormatFvInfo () > * Explicitly stated the implied subject noun in the commit message >of patch 2/2 > > This patch series fixes grammatical errors in the PeiCore module. > > Originally, this was sent as a single patch which received two > Reviewed-by responses: > https://edk2.groups.io/g/devel/message/50841 > > However, a suggestion was made to split the patch into syntactical > and semantical changes. That suggestion is implemented in this > series. > > The Reviewed-by responses were not carried forward so the maintainers > can evaluate this series as a whole. The previous patch has been > dropped. > > Cc: Dandan Bi > Cc: Liming Gao > Cc: Jian J Wang > Cc: Hao A Wu > Signed-off-by: Michael Kubacki > > Michael Kubacki (2): > MdeModulePkg PeiCore: Fix typos > MdeModulePkg PeiCore: Improve comment semantics > > MdeModulePkg/Core/Pei/PeiMain.inf | 10 +-- > MdeModulePkg/Core/Pei/FwVol/FwVol.h | 23 +++ > MdeModulePkg/Core/Pei/PeiMain.h | 49 +++ > MdeModulePkg/Core/Pei/Dependency/Dependency.c | 12 ++-- > MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 52 > MdeModulePkg/Core/Pei/FwVol/FwVol.c | 64 ++-- > MdeModulePkg/Core/Pei/Hob/Hob.c | 4 +- > MdeModulePkg/Core/Pei/Image/Image.c | 10 +-- > MdeModulePkg/Core/Pei/Memory/MemoryServices.c | 18 +++--- > MdeModulePkg/Core/Pei/PeiMain/PeiMain.c | 2 +- > MdeModulePkg/Core/Pei/Ppi/Ppi.c | 4 +- > MdeModulePkg/Core/Pei/Security/Security.c | 12 ++-- > 12 files changed, 132 insertions(+), 128 deletions(-) > > -- > 2.16.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51444): https://edk2.groups.io/g/devel/message/51444 Mute This Topic: https://groups.io/mt/62875486/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v2] UefiCpuPkg/PiSmmCpuDxeSmm: Avoid allocate Token every time.
Reviewed-by: Ray Ni > -Original Message- > From: devel@edk2.groups.io On Behalf Of Dong, > Eric > Sent: Thursday, November 28, 2019 2:17 PM > To: devel@edk2.groups.io > Cc: Ni, Ray ; Laszlo Ersek > Subject: [edk2-devel] [PATCH v2] UefiCpuPkg/PiSmmCpuDxeSmm: Avoid > allocate Token every time. > > v2 changes: > > Minor update based on comments. > > > > v1 changes: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2388 > > Current logic allocate Token every time when need to use it. The logic > caused SMI latency raised to very high. Update logic to allocate Token > buffer at driver's entry point. Later use the token from the allocated > token buffer. Only when all the buffer have been used, then need to > allocate new buffer. > > Signed-off-by: Eric Dong > Cc: Ray Ni > Cc: Laszlo Ersek > --- > UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 56 > -- > UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h | 16 +++ > 2 files changed, 68 insertions(+), 4 deletions(-) > > diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c > b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c > index d8d2b6f444..4632e5b0c2 100644 > --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c > +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c > @@ -492,6 +492,23 @@ FreeTokens ( > { > >LIST_ENTRY*Link; > >PROCEDURE_TOKEN *ProcToken; > > + TOKEN_BUFFER *TokenBuf; > > + > > + // > > + // Not free the buffer, just clear the UsedTokenNum. In order to > > + // avoid later trig allcate action again when need to use token. > > + // > > + gSmmCpuPrivate->UsedTokenNum = 0; > > + > > + Link = GetFirstNode (>OldTokenBufList); > > + while (!IsNull (>OldTokenBufList, Link)) { > > +TokenBuf = TOKEN_BUFFER_FROM_LINK (Link); > > + > > +Link = RemoveEntryList (>Link); > > + > > +FreePool (TokenBuf->Buffer); > > +FreePool (TokenBuf); > > + } > > > >while (!IsListEmpty (>TokenList)) { > > Link = GetFirstNode (>TokenList); > > @@ -499,7 +516,6 @@ FreeTokens ( > > > RemoveEntryList (>Link); > > > > -FreePool ((VOID *)ProcToken->ProcedureToken); > > FreePool (ProcToken); > >} > > } > > @@ -1115,13 +1131,35 @@ CreateToken ( >VOID > >) > > { > > - PROCEDURE_TOKEN*ProcToken; > > + PROCEDURE_TOKEN *ProcToken; > >SPIN_LOCK *CpuToken; > >UINTN SpinLockSize; > > + TOKEN_BUFFER*TokenBuf; > > > >SpinLockSize = GetSpinLockProperties (); > > - CpuToken = AllocatePool (SpinLockSize); > > - ASSERT (CpuToken != NULL); > > + > > + if (gSmmCpuPrivate->UsedTokenNum == > MAX_PRE_RESERVE_TOKEN_COUNT) { > > +DEBUG((DEBUG_INFO, "CpuSmm: No free token buffer, allocate new > buffer!\n")); > > + > > +// > > +// Record current token buffer for later free action usage. > > +// Current used token buffer not in this list. > > +// > > +TokenBuf = AllocatePool (sizeof (TOKEN_BUFFER)); > > +ASSERT (TokenBuf != NULL); > > +TokenBuf->Signature = TOKEN_BUFFER_SIGNATURE; > > +TokenBuf->Buffer = gSmmCpuPrivate->CurrentTokenBuf; > > + > > +InsertTailList (>OldTokenBufList, >Link); > > + > > +gSmmCpuPrivate->CurrentTokenBuf = AllocateZeroPool (SpinLockSize * > MAX_PRE_RESERVE_TOKEN_COUNT); > > +ASSERT (gSmmCpuPrivate->CurrentTokenBuf != NULL); > > +gSmmCpuPrivate->UsedTokenNum = 0; > > + } > > + > > + CpuToken = (SPIN_LOCK *)(gSmmCpuPrivate->CurrentTokenBuf + > SpinLockSize * gSmmCpuPrivate->UsedTokenNum); > > + gSmmCpuPrivate->UsedTokenNum++; > > + > >InitializeSpinLock (CpuToken); > >AcquireSpinLock (CpuToken); > > > > @@ -1737,10 +1775,20 @@ InitializeDataForMmMp ( >VOID > >) > > { > > + UINTN SpinLockSize; > > + > > + SpinLockSize = GetSpinLockProperties (); > > + DEBUG((DEBUG_INFO, "CpuSmm: SpinLock Size = 0x%x\n", SpinLockSize)); > > + > > + gSmmCpuPrivate->CurrentTokenBuf = AllocateZeroPool (SpinLockSize * > MAX_PRE_RESERVE_TOKEN_COUNT); > > + ASSERT (gSmmCpuPrivate->CurrentTokenBuf != NULL); > > + gSmmCpuPrivate->UsedTokenNum = 0; > > + > >gSmmCpuPrivate->ApWrapperFunc = AllocatePool (sizeof > (PROCEDURE_WRAPPER) * gSmmCpuPrivate- > >SmmCoreEntryContext.NumberOfCpus); > >ASSERT (gSmmCpuPrivate->ApWrapperFunc != NULL); > > > >InitializeListHead (>TokenList); > > + InitializeListHead (>OldTokenBufList); > > } > > > > /** > > diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h > b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h > index 8c29f1a558..36fd0dae92 100644 > --- a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h > +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h > @@ -198,6 +198,7 @@ typedef UINT32 > SMM_CPU_ARRIVAL_EXCEPTIONS; > #define ARRIVAL_EXCEPTION_DELAYED 0x2 > > #define ARRIVAL_EXCEPTION_SMI_DISABLED 0x4 > > > > +#define MAX_PRE_RESERVE_TOKEN_COUNT 0x512 > > // > > //
[edk2-devel] [PATCH v2] UefiCpuPkg/PiSmmCpuDxeSmm: Avoid allocate Token every time.
v2 changes: Minor update based on comments. v1 changes: REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2388 Current logic allocate Token every time when need to use it. The logic caused SMI latency raised to very high. Update logic to allocate Token buffer at driver's entry point. Later use the token from the allocated token buffer. Only when all the buffer have been used, then need to allocate new buffer. Signed-off-by: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek --- UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 56 -- UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h | 16 +++ 2 files changed, 68 insertions(+), 4 deletions(-) diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c index d8d2b6f444..4632e5b0c2 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c @@ -492,6 +492,23 @@ FreeTokens ( { LIST_ENTRY*Link; PROCEDURE_TOKEN *ProcToken; + TOKEN_BUFFER *TokenBuf; + + // + // Not free the buffer, just clear the UsedTokenNum. In order to + // avoid later trig allcate action again when need to use token. + // + gSmmCpuPrivate->UsedTokenNum = 0; + + Link = GetFirstNode (>OldTokenBufList); + while (!IsNull (>OldTokenBufList, Link)) { +TokenBuf = TOKEN_BUFFER_FROM_LINK (Link); + +Link = RemoveEntryList (>Link); + +FreePool (TokenBuf->Buffer); +FreePool (TokenBuf); + } while (!IsListEmpty (>TokenList)) { Link = GetFirstNode (>TokenList); @@ -499,7 +516,6 @@ FreeTokens ( RemoveEntryList (>Link); -FreePool ((VOID *)ProcToken->ProcedureToken); FreePool (ProcToken); } } @@ -1115,13 +1131,35 @@ CreateToken ( VOID ) { - PROCEDURE_TOKEN*ProcToken; + PROCEDURE_TOKEN *ProcToken; SPIN_LOCK *CpuToken; UINTN SpinLockSize; + TOKEN_BUFFER*TokenBuf; SpinLockSize = GetSpinLockProperties (); - CpuToken = AllocatePool (SpinLockSize); - ASSERT (CpuToken != NULL); + + if (gSmmCpuPrivate->UsedTokenNum == MAX_PRE_RESERVE_TOKEN_COUNT) { +DEBUG((DEBUG_INFO, "CpuSmm: No free token buffer, allocate new buffer!\n")); + +// +// Record current token buffer for later free action usage. +// Current used token buffer not in this list. +// +TokenBuf = AllocatePool (sizeof (TOKEN_BUFFER)); +ASSERT (TokenBuf != NULL); +TokenBuf->Signature = TOKEN_BUFFER_SIGNATURE; +TokenBuf->Buffer = gSmmCpuPrivate->CurrentTokenBuf; + +InsertTailList (>OldTokenBufList, >Link); + +gSmmCpuPrivate->CurrentTokenBuf = AllocateZeroPool (SpinLockSize * MAX_PRE_RESERVE_TOKEN_COUNT); +ASSERT (gSmmCpuPrivate->CurrentTokenBuf != NULL); +gSmmCpuPrivate->UsedTokenNum = 0; + } + + CpuToken = (SPIN_LOCK *)(gSmmCpuPrivate->CurrentTokenBuf + SpinLockSize * gSmmCpuPrivate->UsedTokenNum); + gSmmCpuPrivate->UsedTokenNum++; + InitializeSpinLock (CpuToken); AcquireSpinLock (CpuToken); @@ -1737,10 +1775,20 @@ InitializeDataForMmMp ( VOID ) { + UINTN SpinLockSize; + + SpinLockSize = GetSpinLockProperties (); + DEBUG((DEBUG_INFO, "CpuSmm: SpinLock Size = 0x%x\n", SpinLockSize)); + + gSmmCpuPrivate->CurrentTokenBuf = AllocateZeroPool (SpinLockSize * MAX_PRE_RESERVE_TOKEN_COUNT); + ASSERT (gSmmCpuPrivate->CurrentTokenBuf != NULL); + gSmmCpuPrivate->UsedTokenNum = 0; + gSmmCpuPrivate->ApWrapperFunc = AllocatePool (sizeof (PROCEDURE_WRAPPER) * gSmmCpuPrivate->SmmCoreEntryContext.NumberOfCpus); ASSERT (gSmmCpuPrivate->ApWrapperFunc != NULL); InitializeListHead (>TokenList); + InitializeListHead (>OldTokenBufList); } /** diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h index 8c29f1a558..36fd0dae92 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h @@ -198,6 +198,7 @@ typedef UINT32 SMM_CPU_ARRIVAL_EXCEPTIONS; #define ARRIVAL_EXCEPTION_DELAYED 0x2 #define ARRIVAL_EXCEPTION_SMI_DISABLED 0x4 +#define MAX_PRE_RESERVE_TOKEN_COUNT 0x512 // // Wrapper used to convert EFI_AP_PROCEDURE2 and EFI_AP_PROCEDURE. // @@ -217,6 +218,17 @@ typedef struct { #define PROCEDURE_TOKEN_FROM_LINK(a) CR (a, PROCEDURE_TOKEN, Link, PROCEDURE_TOKEN_SIGNATURE) +#define TOKEN_BUFFER_SIGNATURE SIGNATURE_32 ('T', 'K', 'B', 'S') + +typedef struct { + UINTN Signature; + LIST_ENTRY Link; + + UINT8 *Buffer; +} TOKEN_BUFFER; + +#define TOKEN_BUFFER_FROM_LINK(a) CR (a, TOKEN_BUFFER, Link, TOKEN_BUFFER_SIGNATURE) + // // Private structure for the SMM CPU module that is stored in DXE Runtime memory // Contains the SMM Configuration Protocols that is produced. @@ -243,6 +255,10 @@ typedef struct { PROCEDURE_WRAPPER *ApWrapperFunc; LIST_ENTRY TokenList; + LIST_ENTRY
Re: [edk2-devel] [PATCH v2 3/3] MdeModulePkg/BdsDxe: Set RuntimeServicesSupported variable
This bitmask value only affect the runtime service at runtime phase. So the implementation should be after the ExitBootServices() called. I think the patch set is only implemented the basic setting of the variable but no implementation of the RuntimeServices. Thanks, Zhichao > -Original Message- > From: Ni, Ray > Sent: Thursday, November 28, 2019 1:02 PM > To: Jeff Brasen ; devel@edk2.groups.io > Cc: Gao, Liming ; Wu, Hao A ; > Gao, Zhichao ; Kinney, Michael D > > Subject: RE: [PATCH v2 3/3] MdeModulePkg/BdsDxe: Set > RuntimeServicesSupported variable > > Jeff, > I think I forgot to ask a very basic question on the new variable > RuntimeServicesSupported. > > What if the variable claims SetVariable() is not supported but OS still calls > SetVariable()? > I think to behave in a consistent way, SetVariable() should reject to service. > But I cannot find it in your patch. > > The similar thing was done for OsIndications variable. > When firmware claims BOOT_TO_SETUP is not supported, the request is ignored > even OS requests to boot to setup,. > > I suggest we change all runtime services implementation to return unsupported > when the accordingly bit in the PCD is not set. > > Thanks, > Ray > > > > -Original Message- > > From: Jeff Brasen > > Sent: Thursday, November 28, 2019 7:25 AM > > To: devel@edk2.groups.io > > Cc: Gao, Liming ; Kinney, Michael D > > ; Wu, Hao A ; Ni, Ray > > ; Gao, Zhichao ; > > jbra...@nvidia.com > > Subject: [PATCH v2 3/3] MdeModulePkg/BdsDxe: Set > > RuntimeServicesSupported variable > > > > Add support for initializing and setting the UEFI 2.8 global variable > > RuntimeServicesSupported based on the value of a PCD. > > > > Change-Id: I8fbd404d492ff8278466edde8aa37d203537318c > > Signed-off-by: Jeff Brasen > > --- > > MdeModulePkg/Universal/BdsDxe/BdsDxe.inf | 1 + > > MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 35 > > +++- > > MdePkg/MdePkg.dec| 18 > > MdePkg/MdePkg.uni| 17 > > 4 files changed, 70 insertions(+), 1 deletion(-) > > > > diff --git a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > > b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > > index 9310b4d..52ec04f 100644 > > --- a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > > +++ b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > > @@ -90,6 +90,7 @@ > >gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang ## > > CONSUMES > >gEfiMdePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel## > > CONSUMES > >gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut ## > > CONSUMES > > + gEfiMdePkgTokenSpaceGuid.PcdRuntimeServicesSupported## > > CONSUMES > >gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor## > > CONSUMES > >gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareRevision ## > > CONSUMES > >gEfiMdeModulePkgTokenSpaceGuid.PcdConInConnectOnDemand > > ## CONSUMES > > diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c > > b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c > > index d387dbe..16bc593 100644 > > --- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c > > +++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c > > @@ -40,7 +40,8 @@ CHAR16 *mReadOnlyVariables[] = { > >EFI_LANG_CODES_VARIABLE_NAME, > >EFI_BOOT_OPTION_SUPPORT_VARIABLE_NAME, > >EFI_HW_ERR_REC_SUPPORT_VARIABLE_NAME, > > - EFI_OS_INDICATIONS_SUPPORT_VARIABLE_NAME > > + EFI_OS_INDICATIONS_SUPPORT_VARIABLE_NAME, > > + EFI_RUNTIME_SERVICES_SUPPORTED_VARIABLE_NAME > >}; > > > > CHAR16 *mBdsLoadOptionName[] = { > > @@ -626,6 +627,33 @@ BdsFormalizeOSIndicationVariable ( > > > > /** > > > > + Formalize RuntimeServicesSupported variable. > > + > > +**/ > > +VOID > > +BdsFormalizeRuntimeServicesSupportedVariable ( > > + VOID > > + ) > > +{ > > + EFI_STATUS Status; > > + UINT16 RuntimeServicesSupported; > > + > > + RuntimeServicesSupported = PcdGet16 (PcdRuntimeServicesSupported); > > + Status = gRT->SetVariable ( > > + EFI_RUNTIME_SERVICES_SUPPORTED_VARIABLE_NAME, > > + , > > + EFI_VARIABLE_BOOTSERVICE_ACCESS | > > EFI_VARIABLE_RUNTIME_ACCESS, > > + sizeof(RuntimeServicesSupported), > > + > > + ); > > + // > > + // Platform needs to make sure setting volatile variable before > > + calling 3rd > > party code shouldn't fail. > > + // > > + ASSERT_EFI_ERROR (Status); > > +} > > + > > +/** > > + > >Validate variables. > > > > **/ > > @@ -645,6 +673,11 @@ BdsFormalizeEfiGlobalVariable ( > >// Validate OSIndication related variable. > >// > >BdsFormalizeOSIndicationVariable (); > > + > > + // > > + // Validate Runtime Services Supported variable. > > + // > > + BdsFormalizeRuntimeServicesSupportedVariable (); > > } > > > > /** > > diff --git a/MdePkg/MdePkg.dec
Re: [edk2-devel] [PATCH v2 3/3] MdeModulePkg/BdsDxe: Set RuntimeServicesSupported variable
Jeff, I think I forgot to ask a very basic question on the new variable RuntimeServicesSupported. What if the variable claims SetVariable() is not supported but OS still calls SetVariable()? I think to behave in a consistent way, SetVariable() should reject to service. But I cannot find it in your patch. The similar thing was done for OsIndications variable. When firmware claims BOOT_TO_SETUP is not supported, the request is ignored even OS requests to boot to setup,. I suggest we change all runtime services implementation to return unsupported when the accordingly bit in the PCD is not set. Thanks, Ray > -Original Message- > From: Jeff Brasen > Sent: Thursday, November 28, 2019 7:25 AM > To: devel@edk2.groups.io > Cc: Gao, Liming ; Kinney, Michael D > ; Wu, Hao A ; Ni, Ray > ; Gao, Zhichao ; > jbra...@nvidia.com > Subject: [PATCH v2 3/3] MdeModulePkg/BdsDxe: Set > RuntimeServicesSupported variable > > Add support for initializing and setting the UEFI 2.8 global variable > RuntimeServicesSupported based on the value of a PCD. > > Change-Id: I8fbd404d492ff8278466edde8aa37d203537318c > Signed-off-by: Jeff Brasen > --- > MdeModulePkg/Universal/BdsDxe/BdsDxe.inf | 1 + > MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 35 > +++- > MdePkg/MdePkg.dec| 18 > MdePkg/MdePkg.uni| 17 > 4 files changed, 70 insertions(+), 1 deletion(-) > > diff --git a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > index 9310b4d..52ec04f 100644 > --- a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > +++ b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > @@ -90,6 +90,7 @@ >gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang ## > CONSUMES >gEfiMdePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel## > CONSUMES >gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut ## > CONSUMES > + gEfiMdePkgTokenSpaceGuid.PcdRuntimeServicesSupported## > CONSUMES >gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor## > CONSUMES >gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareRevision ## > CONSUMES >gEfiMdeModulePkgTokenSpaceGuid.PcdConInConnectOnDemand > ## CONSUMES > diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c > b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c > index d387dbe..16bc593 100644 > --- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c > +++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c > @@ -40,7 +40,8 @@ CHAR16 *mReadOnlyVariables[] = { >EFI_LANG_CODES_VARIABLE_NAME, >EFI_BOOT_OPTION_SUPPORT_VARIABLE_NAME, >EFI_HW_ERR_REC_SUPPORT_VARIABLE_NAME, > - EFI_OS_INDICATIONS_SUPPORT_VARIABLE_NAME > + EFI_OS_INDICATIONS_SUPPORT_VARIABLE_NAME, > + EFI_RUNTIME_SERVICES_SUPPORTED_VARIABLE_NAME >}; > > CHAR16 *mBdsLoadOptionName[] = { > @@ -626,6 +627,33 @@ BdsFormalizeOSIndicationVariable ( > > /** > > + Formalize RuntimeServicesSupported variable. > + > +**/ > +VOID > +BdsFormalizeRuntimeServicesSupportedVariable ( > + VOID > + ) > +{ > + EFI_STATUS Status; > + UINT16 RuntimeServicesSupported; > + > + RuntimeServicesSupported = PcdGet16 (PcdRuntimeServicesSupported); > + Status = gRT->SetVariable ( > + EFI_RUNTIME_SERVICES_SUPPORTED_VARIABLE_NAME, > + , > + EFI_VARIABLE_BOOTSERVICE_ACCESS | > EFI_VARIABLE_RUNTIME_ACCESS, > + sizeof(RuntimeServicesSupported), > + > + ); > + // > + // Platform needs to make sure setting volatile variable before calling 3rd > party code shouldn't fail. > + // > + ASSERT_EFI_ERROR (Status); > +} > + > +/** > + >Validate variables. > > **/ > @@ -645,6 +673,11 @@ BdsFormalizeEfiGlobalVariable ( >// Validate OSIndication related variable. >// >BdsFormalizeOSIndicationVariable (); > + > + // > + // Validate Runtime Services Supported variable. > + // > + BdsFormalizeRuntimeServicesSupportedVariable (); > } > > /** > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec > index d022cc5..cdcb2f9 100644 > --- a/MdePkg/MdePkg.dec > +++ b/MdePkg/MdePkg.dec > @@ -2297,5 +2297,23 @@ ># @Prompt Boot Timeout (s) > > gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|0x|UINT16|0x00 > 2c > > + ## Bitmask of supported runtime services > + # BIT0 - GetTime > + # BIT1 - SetTime > + # BIT2 - GetWakeupTime > + # BIT3 - SetWakeupTime > + # BIT4 - GetVariable > + # BIT5 - GetNextVariableName > + # BIT6 - SetVariable > + # BIT7 - SetVirtualAddressMap > + # BIT8 - ConvertPointer > + # BIT9 - GetNextHighMonotonicCount > + # BIT10 - ResetSystem > + # BIT11 - UpdateCapsule > + # BIT12 - QueryCapsuleCapabilites > + # BIT13 - QueryVariableInfo > + # @Prompt Supported Runtime services bitmask. > + >
Re: [edk2-devel] [PATCH] ShellPkg/UefiHandleParsingLib: Fix error allocate pool
Reviewed-by: Ray Ni > -Original Message- > From: Gao, Zhichao > Sent: Thursday, November 28, 2019 10:23 AM > To: devel@edk2.groups.io; Gao, Zhichao > Cc: Carsey, Jaben ; Ni, Ray ; > Andrew Fish > Subject: RE: [edk2-devel] [PATCH] ShellPkg/UefiHandleParsingLib: Fix error > allocate pool > > Hi Ray, > > Can you help to review this patch? > > Thanks, > Zhichao > > > -Original Message- > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Gao, > > Zhichao > > Sent: Monday, July 15, 2019 3:30 PM > > To: devel@edk2.groups.io > > Cc: Carsey, Jaben ; Ni, Ray ; > > Andrew Fish > > Subject: [edk2-devel] [PATCH] ShellPkg/UefiHandleParsingLib: Fix error > allocate > > pool > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1965 > > > > For function InsertNewGuidNameMapping, it rellocate the mGuidList with > new > > size > > "mGuidListCount+1 * sizeof(GUID_INFO_BLOCK)". That isn't its purpose > and > > would cause a overflow operation in "mGuidList[mGuidListCount - 1].xxx = > xxx". > > Its purpose is to increase 1 block size of mGuidList. Change it to > > "(mGuidListCount + 1) * sizeof (GUID_INFO_BLOCK)". > > > > Adjust the coding style of this function. > > > > Cc: Jaben Carsey > > Cc: Ray Ni > > Cc: Andrew Fish > > Signed-off-by: Zhichao Gao > > --- > > .../UefiHandleParsingLib/UefiHandleParsingLib.c | 12 > > 1 file changed, 8 insertions(+), 4 deletions(-) > > > > diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c > > b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c > > index f179c41092..430c0ee70b 100644 > > --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c > > +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c > > @@ -2462,17 +2462,21 @@ InsertNewGuidNameMapping( > >IN CONST DUMP_PROTOCOL_INFO DumpFunc OPTIONAL > >) > > { > > - ASSERT(Guid != NULL); > > - ASSERT(NameID != 0); > > + ASSERT (Guid != NULL); > > + ASSERT (NameID != 0); > > > > - mGuidList = ReallocatePool(mGuidListCount * sizeof(GUID_INFO_BLOCK), > > mGuidListCount+1 * sizeof(GUID_INFO_BLOCK), mGuidList); > > + mGuidList = ReallocatePool ( > > +mGuidListCount * sizeof (GUID_INFO_BLOCK), > > +(mGuidListCount + 1) * sizeof (GUID_INFO_BLOCK), > > +mGuidList > > +); > >if (mGuidList == NULL) { > > mGuidListCount = 0; > > return (EFI_OUT_OF_RESOURCES); > >} > >mGuidListCount++; > > > > - mGuidList[mGuidListCount - 1].GuidId = > AllocateCopyPool(sizeof(EFI_GUID), > > Guid); > > + mGuidList[mGuidListCount - 1].GuidId = AllocateCopyPool (sizeof > (EFI_GUID), > > Guid); > >mGuidList[mGuidListCount - 1].StringId = NameID; > >mGuidList[mGuidListCount - 1].DumpInfo = DumpFunc; > > > > -- > > 2.21.0.windows.1 > > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51439): https://edk2.groups.io/g/devel/message/51439 Mute This Topic: https://groups.io/mt/63589318/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Avoid allocate Token every time.
> -Original Message- > From: devel@edk2.groups.io On Behalf Of Dong, > Eric > Sent: Thursday, November 28, 2019 10:58 AM > To: devel@edk2.groups.io > Cc: Laszlo Ersek > Subject: [edk2-devel] [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Avoid > allocate Token every time. > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2388 > > Current logic allocate Token every time when need to use it. The logic > caused SMI latency raised to very high. Update logic to allocate Token > buffer at driver's entry point. Later use the token from the allocated > token buffer. Only when all the buffer have been used, then need to > allocate new buffer. > > Signed-off-by: Eric Dong > > Cc: Eric Dong > > Cc: Laszlo Ersek > --- > UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 56 > +++--- > UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h | 16 +++ > 2 files changed, 66 insertions(+), 6 deletions(-) > > diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c > b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c > index d8d2b6f444..702bbcd095 100644 > --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c > +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c > @@ -492,6 +492,24 @@ FreeTokens ( > { > >LIST_ENTRY*Link; > >PROCEDURE_TOKEN *ProcToken; > > + TOKEN_BUFFER *TokenBuf; > > + > > + // > > + // Only reset current used Token buffer, not free this buffer. > > + // > > + gSmmCpuPrivate->UsedTokenNum = 0; > > + > > + Link = GetFirstNode (>OldTokenBufList); > > + while (!IsNull (>OldTokenBufList, Link)) { > > +TokenBuf = TOKEN_BUFFER_FROM_LINK (Link); > > + > > +Link = GetNextNode (>OldTokenBufList, Link); > > + > > +RemoveEntryList (>Link); 1. The above two lines can be combined to below single line: Link = RemoveEntryList (>Link); > > + > > +FreePool (TokenBuf->Buffer); > > +FreePool (TokenBuf); > > + } > > > >while (!IsListEmpty (>TokenList)) { > > Link = GetFirstNode (>TokenList); > > @@ -499,7 +517,6 @@ FreeTokens ( > > > RemoveEntryList (>Link); > > > > -FreePool ((VOID *)ProcToken->ProcedureToken); > > FreePool (ProcToken); > >} > > } > > @@ -1115,13 +1132,32 @@ CreateToken ( >VOID > >) > > { > > - PROCEDURE_TOKEN*ProcToken; > > + PROCEDURE_TOKEN *ProcToken; > >SPIN_LOCK *CpuToken; > > - UINTN SpinLockSize; > > + TOKEN_BUFFER*TokenBuf; > > + > > + if (gSmmCpuPrivate->UsedTokenNum >= MAX_TOKEN_COUND_NUMBER > - 1) { 2. Can the macro be MAX_TOKEN_COUNT? The variable be " gSmmCpuPrivate->TokenCount"? Usually when we define a storage, there are three variables: Elements[], Count, Capacity. MAX_TOKEN_COUNT is the capacity. TokenCount is the count. 3. should be "TokenCount == MAX_TOKEN_COUNT". 4. Can you explain how the toke buffer is managed using comments? > > +DEBUG((DEBUG_INFO, "Token buffer not enough, allocate new > buffer[TokenNum=0x%x]!\n", gSmmCpuPrivate->UsedTokenNum)); 5. Suggest add prefix like "CpuSmm: ". > > + > > +// > > +// Save Current Token Buffer to the list. > > +// > > +TokenBuf = AllocatePool (sizeof (TOKEN_BUFFER)); > > +ASSERT (TokenBuf != NULL); > > +TokenBuf->Signature = TOKEN_BUFFER_SIGNATURE; > > +TokenBuf->Buffer = gSmmCpuPrivate->CurrentTokenBuf; > > + > > +InsertTailList (>OldTokenBufList, >Link); > > + > > +gSmmCpuPrivate->CurrentTokenBuf = AllocateZeroPool > (gSmmCpuPrivate->TokenSize * MAX_TOKEN_COUND_NUMBER); > > +ASSERT (gSmmCpuPrivate->CurrentTokenBuf != NULL); > > +gSmmCpuPrivate->UsedTokenNum = 0; > > + } > > + > > + CpuToken = (SPIN_LOCK *)(gSmmCpuPrivate->CurrentTokenBuf + > gSmmCpuPrivate->TokenSize * gSmmCpuPrivate->UsedTokenNum); > > + gSmmCpuPrivate->UsedTokenNum++; > > + //DEBUG((DEBUG_INFO, "Token Address = 0x%x, Token Number = > 0x%x\n", CpuToken, gSmmCpuPrivate->UsedTokenNum)); > > > > - SpinLockSize = GetSpinLockProperties (); > > - CpuToken = AllocatePool (SpinLockSize); > > - ASSERT (CpuToken != NULL); > >InitializeSpinLock (CpuToken); > >AcquireSpinLock (CpuToken); > > > > @@ -1737,10 +1773,18 @@ InitializeDataForMmMp ( >VOID > >) > > { > > + gSmmCpuPrivate->TokenSize = (UINT32)GetSpinLockProperties (); 6. How about not to cache the TokenSize? > > + DEBUG((DEBUG_INFO, "gSmmCpuPrivate->TokenSize = 0x%x\n", > gSmmCpuPrivate->TokenSize)); 7. Maybe no need. > > + > > + gSmmCpuPrivate->CurrentTokenBuf = AllocateZeroPool > (gSmmCpuPrivate->TokenSize * MAX_TOKEN_COUND_NUMBER); > > + ASSERT (gSmmCpuPrivate->CurrentTokenBuf != NULL); > > + gSmmCpuPrivate->UsedTokenNum = 0; > > + > >gSmmCpuPrivate->ApWrapperFunc = AllocatePool (sizeof > (PROCEDURE_WRAPPER) * gSmmCpuPrivate- > >SmmCoreEntryContext.NumberOfCpus); > >ASSERT (gSmmCpuPrivate->ApWrapperFunc != NULL); > > > >InitializeListHead (>TokenList); > > + InitializeListHead (>OldTokenBufList); > > }
[edk2-devel] [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Avoid allocate Token every time.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2388 Current logic allocate Token every time when need to use it. The logic caused SMI latency raised to very high. Update logic to allocate Token buffer at driver's entry point. Later use the token from the allocated token buffer. Only when all the buffer have been used, then need to allocate new buffer. Signed-off-by: Eric Dong Cc: Eric Dong Cc: Laszlo Ersek --- UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 56 +++--- UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h | 16 +++ 2 files changed, 66 insertions(+), 6 deletions(-) diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c index d8d2b6f444..702bbcd095 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c @@ -492,6 +492,24 @@ FreeTokens ( { LIST_ENTRY*Link; PROCEDURE_TOKEN *ProcToken; + TOKEN_BUFFER *TokenBuf; + + // + // Only reset current used Token buffer, not free this buffer. + // + gSmmCpuPrivate->UsedTokenNum = 0; + + Link = GetFirstNode (>OldTokenBufList); + while (!IsNull (>OldTokenBufList, Link)) { +TokenBuf = TOKEN_BUFFER_FROM_LINK (Link); + +Link = GetNextNode (>OldTokenBufList, Link); + +RemoveEntryList (>Link); + +FreePool (TokenBuf->Buffer); +FreePool (TokenBuf); + } while (!IsListEmpty (>TokenList)) { Link = GetFirstNode (>TokenList); @@ -499,7 +517,6 @@ FreeTokens ( RemoveEntryList (>Link); -FreePool ((VOID *)ProcToken->ProcedureToken); FreePool (ProcToken); } } @@ -1115,13 +1132,32 @@ CreateToken ( VOID ) { - PROCEDURE_TOKEN*ProcToken; + PROCEDURE_TOKEN *ProcToken; SPIN_LOCK *CpuToken; - UINTN SpinLockSize; + TOKEN_BUFFER*TokenBuf; + + if (gSmmCpuPrivate->UsedTokenNum >= MAX_TOKEN_COUND_NUMBER - 1) { +DEBUG((DEBUG_INFO, "Token buffer not enough, allocate new buffer[TokenNum=0x%x]!\n", gSmmCpuPrivate->UsedTokenNum)); + +// +// Save Current Token Buffer to the list. +// +TokenBuf = AllocatePool (sizeof (TOKEN_BUFFER)); +ASSERT (TokenBuf != NULL); +TokenBuf->Signature = TOKEN_BUFFER_SIGNATURE; +TokenBuf->Buffer = gSmmCpuPrivate->CurrentTokenBuf; + +InsertTailList (>OldTokenBufList, >Link); + +gSmmCpuPrivate->CurrentTokenBuf = AllocateZeroPool (gSmmCpuPrivate->TokenSize * MAX_TOKEN_COUND_NUMBER); +ASSERT (gSmmCpuPrivate->CurrentTokenBuf != NULL); +gSmmCpuPrivate->UsedTokenNum = 0; + } + + CpuToken = (SPIN_LOCK *)(gSmmCpuPrivate->CurrentTokenBuf + gSmmCpuPrivate->TokenSize * gSmmCpuPrivate->UsedTokenNum); + gSmmCpuPrivate->UsedTokenNum++; + //DEBUG((DEBUG_INFO, "Token Address = 0x%x, Token Number = 0x%x\n", CpuToken, gSmmCpuPrivate->UsedTokenNum)); - SpinLockSize = GetSpinLockProperties (); - CpuToken = AllocatePool (SpinLockSize); - ASSERT (CpuToken != NULL); InitializeSpinLock (CpuToken); AcquireSpinLock (CpuToken); @@ -1737,10 +1773,18 @@ InitializeDataForMmMp ( VOID ) { + gSmmCpuPrivate->TokenSize = (UINT32)GetSpinLockProperties (); + DEBUG((DEBUG_INFO, "gSmmCpuPrivate->TokenSize = 0x%x\n", gSmmCpuPrivate->TokenSize)); + + gSmmCpuPrivate->CurrentTokenBuf = AllocateZeroPool (gSmmCpuPrivate->TokenSize * MAX_TOKEN_COUND_NUMBER); + ASSERT (gSmmCpuPrivate->CurrentTokenBuf != NULL); + gSmmCpuPrivate->UsedTokenNum = 0; + gSmmCpuPrivate->ApWrapperFunc = AllocatePool (sizeof (PROCEDURE_WRAPPER) * gSmmCpuPrivate->SmmCoreEntryContext.NumberOfCpus); ASSERT (gSmmCpuPrivate->ApWrapperFunc != NULL); InitializeListHead (>TokenList); + InitializeListHead (>OldTokenBufList); } /** diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h index 8c29f1a558..c197aad288 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h @@ -198,6 +198,7 @@ typedef UINT32 SMM_CPU_ARRIVAL_EXCEPTIONS; #define ARRIVAL_EXCEPTION_DELAYED 0x2 #define ARRIVAL_EXCEPTION_SMI_DISABLED 0x4 +#define MAX_TOKEN_COUND_NUMBER 0x512 // // Wrapper used to convert EFI_AP_PROCEDURE2 and EFI_AP_PROCEDURE. // @@ -217,6 +218,17 @@ typedef struct { #define PROCEDURE_TOKEN_FROM_LINK(a) CR (a, PROCEDURE_TOKEN, Link, PROCEDURE_TOKEN_SIGNATURE) +#define TOKEN_BUFFER_SIGNATURE SIGNATURE_32 ('T', 'K', 'B', 'S') + +typedef struct { + UINTN Signature; + LIST_ENTRY Link; + + UINT8 *Buffer; +} TOKEN_BUFFER; + +#define TOKEN_BUFFER_FROM_LINK(a) CR (a, TOKEN_BUFFER, Link, TOKEN_BUFFER_SIGNATURE) + // // Private structure for the SMM CPU module that is stored in DXE Runtime memory // Contains the SMM Configuration Protocols that is produced. @@ -243,6 +255,10 @@ typedef struct { PROCEDURE_WRAPPER *ApWrapperFunc; LIST_ENTRY TokenList; +
Re: [edk2-devel] [PATCH] ShellPkg/UefiHandleParsingLib: Fix error allocate pool
Hi Ray, Can you help to review this patch? Thanks, Zhichao > -Original Message- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Gao, > Zhichao > Sent: Monday, July 15, 2019 3:30 PM > To: devel@edk2.groups.io > Cc: Carsey, Jaben ; Ni, Ray ; > Andrew Fish > Subject: [edk2-devel] [PATCH] ShellPkg/UefiHandleParsingLib: Fix error > allocate > pool > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1965 > > For function InsertNewGuidNameMapping, it rellocate the mGuidList with new > size > "mGuidListCount+1 * sizeof(GUID_INFO_BLOCK)". That isn't its purpose and > would cause a overflow operation in "mGuidList[mGuidListCount - 1].xxx = xxx". > Its purpose is to increase 1 block size of mGuidList. Change it to > "(mGuidListCount + 1) * sizeof (GUID_INFO_BLOCK)". > > Adjust the coding style of this function. > > Cc: Jaben Carsey > Cc: Ray Ni > Cc: Andrew Fish > Signed-off-by: Zhichao Gao > --- > .../UefiHandleParsingLib/UefiHandleParsingLib.c | 12 > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c > b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c > index f179c41092..430c0ee70b 100644 > --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c > +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c > @@ -2462,17 +2462,21 @@ InsertNewGuidNameMapping( >IN CONST DUMP_PROTOCOL_INFO DumpFunc OPTIONAL >) > { > - ASSERT(Guid != NULL); > - ASSERT(NameID != 0); > + ASSERT (Guid != NULL); > + ASSERT (NameID != 0); > > - mGuidList = ReallocatePool(mGuidListCount * sizeof(GUID_INFO_BLOCK), > mGuidListCount+1 * sizeof(GUID_INFO_BLOCK), mGuidList); > + mGuidList = ReallocatePool ( > +mGuidListCount * sizeof (GUID_INFO_BLOCK), > +(mGuidListCount + 1) * sizeof (GUID_INFO_BLOCK), > +mGuidList > +); >if (mGuidList == NULL) { > mGuidListCount = 0; > return (EFI_OUT_OF_RESOURCES); >} >mGuidListCount++; > > - mGuidList[mGuidListCount - 1].GuidId = AllocateCopyPool(sizeof(EFI_GUID), > Guid); > + mGuidList[mGuidListCount - 1].GuidId = AllocateCopyPool (sizeof > (EFI_GUID), > Guid); >mGuidList[mGuidListCount - 1].StringId = NameID; >mGuidList[mGuidListCount - 1].DumpInfo = DumpFunc; > > -- > 2.21.0.windows.1 > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51436): https://edk2.groups.io/g/devel/message/51436 Mute This Topic: https://groups.io/mt/63589318/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms][PATCH V2 44/47] DebugFeaturePkg: Remove the ACPI Debug feature
Removes the ACPI Debug feature from DebugFeaturePkg. The feature does not follow the advanced feature design. The feature has been moved to Features/Intel/Debugging/AcpiDebugFeaturePkg. Cc: Eric Dong Cc: Liming Gao Signed-off-by: Michael Kubacki --- Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc| 10 - Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebugDxe.inf | 57 --- Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebugSmm.inf | 59 --- Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.c | 523 Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.asl| 103 Platform/Intel/DebugFeaturePkg/AcpiDebug/Readme.txt | 31 -- 6 files changed, 783 deletions(-) diff --git a/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc b/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc index efe705bd76..c43dd63a06 100644 --- a/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc +++ b/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc @@ -71,14 +71,6 @@ MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf -[LibraryClasses.common.DXE_SMM_DRIVER] - ### - # Edk2 Packages - ### - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf - MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf - SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf - ### # # Components Section - list of the modules and components that will be processed by compilation @@ -113,8 +105,6 @@ DebugFeaturePkg/Library/Usb3DebugPortParameterLibPcd/Usb3DebugPortParameterLibPcd.inf # Add components here that should be included in the package build. - DebugFeaturePkg/AcpiDebug/AcpiDebugDxe.inf - DebugFeaturePkg/AcpiDebug/AcpiDebugSmm.inf [BuildOptions] *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES diff --git a/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebugDxe.inf b/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebugDxe.inf deleted file mode 100644 index 7473126b11..00 --- a/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebugDxe.inf +++ /dev/null @@ -1,57 +0,0 @@ -### @file -# Component description file for Acpi debug module. -# -# Copyright (c) 2019, Intel Corporation. All rights reserved. -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# -### - -[Defines] - INF_VERSION= 0x00010005 - BASE_NAME = AcpiDebugDxe - FILE_GUID = EC98FF95-242C-4513-B1BC-69FA24111C58 - MODULE_TYPE= DXE_DRIVER - VERSION_STRING = 1.0 - ENTRY_POINT= InitializeAcpiDebugDxe -# -# The following information is for reference only and not required by the build tools. -# -# VALID_ARCHITECTURES = IA32 X64 IPF -# - -[LibraryClasses] - BaseLib - BaseMemoryLib - UefiBootServicesTableLib - UefiDriverEntryPoint - DebugLib - PcdLib - DxeServicesLib - -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - DebugFeaturePkg/DebugFeaturePkg.dec - -[Pcd] - gDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugEnable ## CONSUMES - gDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugBufferSize ## CONSUMES - gDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugAddress ## PRODUCES - -[Sources] - AcpiDebug.c - AcpiDebug.asl - -[Protocols] - gEfiAcpiTableProtocolGuid ## CONSUMES - gEfiSmmBase2ProtocolGuid ## CONSUMES # only for SMM version - gEfiSmmSwDispatch2ProtocolGuid## CONSUMES # only for SMM version - gEfiSmmEndOfDxeProtocolGuid ## NOTIFY # only for SMM version - -[Guids] - gEfiEndOfDxeEventGroupGuid## CONSUMES ## Event - -[Depex] - gEfiAcpiTableProtocolGuid - diff --git a/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebugSmm.inf b/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebugSmm.inf deleted file mode 100644 index 679f9eb014..00 --- a/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebugSmm.inf +++ /dev/null @@ -1,59 +0,0 @@ -### @file -# Component description file for Acpi Debug module. -# -# Copyright (c) 2019, Intel Corporation. All rights reserved. -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# -### - -[Defines] - INF_VERSION= 0x00010005 - BASE_NAME = AcpiDebugSmm - FILE_GUID = 9069C144-0A7E-41ef-9C07-418BCA9BF939 - MODULE_TYPE= DXE_SMM_DRIVER - VERSION_STRING = 1.0 - PI_SPECIFICATION_VERSION = 0x0001000A - ENTRY_POINT= InitializeAcpiDebugSmm -# -# The following information is for reference only and not required by the build tools. -# -# VALID_ARCHITECTURES = IA32 X64 IPF -# - -[LibraryClasses] - BaseLib - BaseMemoryLib -
[edk2-devel] [edk2-platforms][PATCH V2 47/47] Maintainers.txt: Update Intel feature maintainers
Cc: Dandan Bi Cc: Sai Chaganty Cc: Eric Dong Cc: Liming Gao Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Maintainers.txt | 32 ++-- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Maintainers.txt b/Maintainers.txt index cb7ae0a95d..8cea67e310 100644 --- a/Maintainers.txt +++ b/Maintainers.txt @@ -124,6 +124,22 @@ F: Silicon/Hisilicon/ M: Leif Lindholm R: Ard Biesheuvel +Features/Intel +F: Features/Intel/ +M: Michael Kubacki +M: Sai Chaganty +R: Liming Gao + +Features/Intel/Debugging +F: Features/Intel/Debugging/ +M: Eric Dong +R: Liming Gao + +Features/Intel/UserInterface +F: Features/Intel/UserInterface/ +M: Dandan Bi +R: Liming Gao + Platform/Intel/QuarkPlatformPkg F: Platform/Intel/QuarkPlatformPkg/ M: Michael D Kinney @@ -134,27 +150,11 @@ F: Platform/Intel/Vlv2TbltDevicePkg/ M: Zailiang Sun M: Yi Qian -Platform/Intel/AdvancedFeaturePkg -F: Platform/Intel/AdvancedFeaturePkg/ -M: Michael Kubacki -M: Sai Chaganty -R: Liming Gao - Platform/Intel/BoardModulePkg F: Platform/Intel/BoardModulePkg/ M: Eric Dong R: Liming Gao -Platform/Intel/DebugFeaturePkg -F: Platform/Intel/DebugFeaturePkg/ -M: Eric Dong -R: Liming Gao - -Platform/Intel/UserInterfaceFeaturePkg -F: Platform/Intel/UserInterfaceFeaturePkg/ -M: Dandan Bi -R: Liming Gao - Platform/Intel/KabylakeOpenBoardPkg F: Platform/Intel/KabylakeOpenBoardPkg/ M: Chasel Chiu -- 2.16.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51435): https://edk2.groups.io/g/devel/message/51435 Mute This Topic: https://groups.io/mt/63584865/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms][PATCH V2 40/47] Platform/Intel/AdvancedFeaturePkg: Remove the S3 feature
Removes the S3 feature from AdvancedFeaturePkg. The feature does not follow the advanced feature design. The feature has been moved to Features/Intel/PowerManagement/S3FeaturePkg. Cc: Sai Chaganty Cc: Liming Gao Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc | 6 Platform/Intel/AdvancedFeaturePkg/S3/S3Pei.inf | 31 - Platform/Intel/AdvancedFeaturePkg/S3/S3Pei.c | 36 3 files changed, 73 deletions(-) diff --git a/Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc b/Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc index b83e72b48c..885b84e2df 100644 --- a/Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc +++ b/Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc @@ -102,11 +102,6 @@ MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - ### - # Silicon Initialization Package - ### - SmmAccessLib|IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLib/PeiSmmAccessLib.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 @@ -158,7 +153,6 @@ AdvancedFeaturePkg/Ipmi/IpmiInit/PeiIpmiInit.inf AdvancedFeaturePkg/Ipmi/OsWdt/OsWdt.inf AdvancedFeaturePkg/Ipmi/SolStatus/SolStatus.inf - AdvancedFeaturePkg/S3/S3Pei.inf AdvancedFeaturePkg/Smbios/SmbiosBasicDxe/SmbiosBasicDxe.inf [BuildOptions] diff --git a/Platform/Intel/AdvancedFeaturePkg/S3/S3Pei.inf b/Platform/Intel/AdvancedFeaturePkg/S3/S3Pei.inf deleted file mode 100644 index 847edd20c0..00 --- a/Platform/Intel/AdvancedFeaturePkg/S3/S3Pei.inf +++ /dev/null @@ -1,31 +0,0 @@ -### @file -# Component information file for the S3 PEI module. -# -# Copyright (c) 2019, Intel Corporation. All rights reserved. -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# -### - -[Defines] - INF_VERSION= 0x00010017 - BASE_NAME = S3Pei - FILE_GUID = 8683EFB2-FDE1-4AFF-B2DB-E96449FDD4E9 - VERSION_STRING = 1.0 - MODULE_TYPE= PEIM - ENTRY_POINT= S3PeiEntryPoint - -[LibraryClasses] - PeimEntryPoint - PeiServicesLib - SmmAccessLib - -[Packages] - MdePkg/MdePkg.dec - IntelSiliconPkg/IntelSiliconPkg.dec - -[Sources] - S3Pei.c - -[Depex] - gEfiPeiMemoryDiscoveredPpiGuid diff --git a/Platform/Intel/AdvancedFeaturePkg/S3/S3Pei.c b/Platform/Intel/AdvancedFeaturePkg/S3/S3Pei.c deleted file mode 100644 index b0aaa04962..00 --- a/Platform/Intel/AdvancedFeaturePkg/S3/S3Pei.c +++ /dev/null @@ -1,36 +0,0 @@ -/** @file - Source code file for S3 PEI module - -Copyright (c) 2019, Intel Corporation. All rights reserved. -SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include -#include - -/** - S3 PEI module entry point - - @param[in] FileHandle Not used. - @param[in] PeiServices General purpose services available to every PEIM. - - @retval EFI_SUCCESS The function completes successfully - @retval EFI_OUT_OF_RESOURCES Insufficient resources to create database -**/ -EFI_STATUS -EFIAPI -S3PeiEntryPoint ( - IN EFI_PEI_FILE_HANDLE FileHandle, - IN CONST EFI_PEI_SERVICES **PeiServices - ) -{ - EFI_STATUS Status; - - // - // Install EFI_PEI_MM_ACCESS_PPI for S3 resume case - // - Status = PeiInstallSmmAccessPpi (); - - return Status; -} -- 2.16.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51428): https://edk2.groups.io/g/devel/message/51428 Mute This Topic: https://groups.io/mt/63584254/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms][PATCH V2 43/47] Platform/Intel/AdvancedFeaturePkg: Remove remaining contents
This change removes the remaining files in AdvancedFeaturePkg that were located in Platform/Intel. Cc: Sai Chaganty Cc: Liming Gao Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dec | 30 Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc | 79 Platform/Intel/AdvancedFeaturePkg/Include/Dsc/CoreAdvancedDxeInclude.dsc | 15 Platform/Intel/AdvancedFeaturePkg/Include/Dsc/CoreAdvancedPeiInclude.dsc | 9 --- Platform/Intel/AdvancedFeaturePkg/Include/Fdf/CoreAdvancedLateInclude.fdf | 14 Platform/Intel/AdvancedFeaturePkg/Include/Fdf/CoreAdvancedPostMemoryInclude.fdf | 8 -- Platform/Intel/AdvancedFeaturePkg/Include/Fdf/CoreAdvancedPreMemoryInclude.fdf | 9 --- 7 files changed, 164 deletions(-) diff --git a/Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dec b/Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dec deleted file mode 100644 index 6cd333d498..00 --- a/Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dec +++ /dev/null @@ -1,30 +0,0 @@ -## @file -# This package provides the modules that build for a full feature platform. -# This AdvancedFeaturePkg should only depend on EDKII Core packages and MinPlatformPkg. -# -# The DEC files are used by the utilities that parse DSC and -# INF files to generate AutoGen.c and AutoGen.h files -# for the build infrastructure. -# -# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved. -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# -## - - -[Defines] -DEC_SPECIFICATION = 0x00010017 -PACKAGE_NAME = AdvancedFeaturePkg -PACKAGE_VERSION = 0.1 -PACKAGE_GUID = 290127D9-ABED-4DD8-A35D-73DCB4261BCB - - -[Includes] -Include - -[Guids] -gAdvancedFeaturePkgTokenSpaceGuid = {0xa8514688, 0x6693, 0x4ab5, {0xaa, 0xc8, 0xcc, 0xa9, 0x8d, 0xde, 0x90, 0xe1}} - -[PcdsFeatureFlag] - gAdvancedFeaturePkgTokenSpaceGuid.PcdNetworkEnable |FALSE|BOOLEAN|0xF0A1 diff --git a/Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc b/Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc deleted file mode 100644 index 4b8ccf3375..00 --- a/Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc +++ /dev/null @@ -1,79 +0,0 @@ -## @file -# Advanced Feature Package build description file. -# -# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved. -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# -## - - -# -# Defines Section - statements that will be processed to create a Makefile. -# - -[Defines] - PLATFORM_NAME = AdvancedFeaturePkg - PLATFORM_GUID = 5E4C05BC-C5F0-4843-BAE1-3AAFE269DB8F - PLATFORM_VERSION= 0.1 - DSC_SPECIFICATION = 0x00010005 - OUTPUT_DIRECTORY= Build/AdvancedFeaturePkg - SUPPORTED_ARCHITECTURES = IA32|X64 - BUILD_TARGETS = DEBUG|RELEASE - SKUID_IDENTIFIER= DEFAULT - - -# -# SKU Identification section - list of all SKU IDs supported. -# - -[SkuIds] - 0|DEFAULT # The entry: 0|DEFAULT is reserved and always required. - - -# -# Pcd Section - list of all EDK II PCD Entries defined by this package. -# - - -[PcdsFeatureFlag] - - -# -# Library Class section - list of all Library Classes needed by this package. -# - - -[LibraryClasses.common] - -### -# -# Components Section - list of the modules and components that will be processed by compilation -# tools and the EDK II tools to generate PE32/PE32+/Coff image files. -# -# Note: The EDK II DSC file is not used to specify how compiled binary images get placed -# into firmware volume images. This section is just a list of modules to compile from -# source into UEFI-compliant binaries. -# It is the FDF file that contains information on combining binary files into firmware -# volume images, whose concept is beyond UEFI and is described in PI specification. -# Binary modules do not need to be listed in this section, as they should be -# specified in the FDF file. For example: Shell binary
[edk2-devel] [edk2-platforms][PATCH V2 39/47] MinPlatformPkg: Install advanced feature FVs by stage enabled
This change updates the FvReportLib instance in MinPlatformPkg to only install advanced feature firmware volumes if the advanced feature stage should be active. Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec | 1 + Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf | 1 + Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.c | 50 +++- 3 files changed, 29 insertions(+), 23 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec index 21013cc87c..7f74ac9380 100644 --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec @@ -272,6 +272,7 @@ SetCacheMtrrLib|Include/Library/SetCacheMtrrLib.h # Stage 3 - boot to shell only # Stage 4 - boot to OS # Stage 5 - boot to OS with security boot enabled + # Stage 6 - boot with advanced features enabled # gMinPlatformPkgTokenSpaceGuid.PcdBootStage|4|UINT8|0xF0A0 diff --git a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf index 1ce3034fcc..ef03e110bd 100644 --- a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf +++ b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf @@ -30,6 +30,7 @@ PeiReportFvLib.c [Pcd] + gMinPlatformPkgTokenSpaceGuid.PcdBootStage ## CONSUMES gMinPlatformPkgTokenSpaceGuid.PcdFspWrapperBootMode ## CONSUMES gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaBaseAddress ## CONSUMES gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize ## CONSUMES diff --git a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.c b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.c index b61587f6e3..0d805d6fe7 100644 --- a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.c +++ b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.c @@ -40,20 +40,22 @@ ReportPreMemFv ( NULL, 0 ); - DEBUG (( -DEBUG_INFO, -"Install FlashFvAdvancedPreMemory - 0x%x, 0x%x\n", -PcdGet32 (PcdFlashFvAdvancedPreMemoryBase), -PcdGet32 (PcdFlashFvAdvancedPreMemorySize) -)); - PeiServicesInstallFvInfo2Ppi ( -&(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFlashFvAdvancedPreMemoryBase))->FileSystemGuid), -(VOID *) (UINTN) PcdGet32 (PcdFlashFvAdvancedPreMemoryBase), -PcdGet32 (PcdFlashFvAdvancedPreMemorySize), -NULL, -NULL, -0 -); + if (PcdGet8 (PcdBootStage) >= 6) { +DEBUG (( + DEBUG_INFO, + "Install FlashFvAdvancedPreMemory - 0x%x, 0x%x\n", + PcdGet32 (PcdFlashFvAdvancedPreMemoryBase), + PcdGet32 (PcdFlashFvAdvancedPreMemorySize) + )); +PeiServicesInstallFvInfo2Ppi ( + &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFlashFvAdvancedPreMemoryBase))->FileSystemGuid), + (VOID *) (UINTN) PcdGet32 (PcdFlashFvAdvancedPreMemoryBase), + PcdGet32 (PcdFlashFvAdvancedPreMemorySize), + NULL, + NULL, + 0 + ); + } } VOID @@ -122,15 +124,17 @@ ReportPostMemFv ( NULL, 0 ); -DEBUG ((DEBUG_INFO, "Install FlashFvAdvanced - 0x%x, 0x%x\n", PcdGet32 (PcdFlashFvAdvancedBase), PcdGet32 (PcdFlashFvAdvancedSize))); -PeiServicesInstallFvInfo2Ppi ( - &(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFlashFvAdvancedBase))->FileSystemGuid), - (VOID *) (UINTN) PcdGet32 (PcdFlashFvAdvancedBase), - PcdGet32 (PcdFlashFvAdvancedSize), - NULL, - NULL, - 0 - ); +if (PcdGet8 (PcdBootStage) >= 6) { + DEBUG ((DEBUG_INFO, "Install FlashFvAdvanced - 0x%x, 0x%x\n", PcdGet32 (PcdFlashFvAdvancedBase), PcdGet32 (PcdFlashFvAdvancedSize))); + PeiServicesInstallFvInfo2Ppi ( +&(((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 (PcdFlashFvAdvancedBase))->FileSystemGuid), +(VOID *) (UINTN) PcdGet32 (PcdFlashFvAdvancedBase), +PcdGet32 (PcdFlashFvAdvancedSize), +NULL, +NULL, +0 +); +} } // -- 2.16.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51427): https://edk2.groups.io/g/devel/message/51427 Mute This Topic: https://groups.io/mt/63584191/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 1/2] MdePkg/UefiDevicePathLib: Separate the device path lib
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2298 UefiDevicePathLibOptionalDevicePathProtocol's implementation isn't fit its description. It should be implement as blow: Try to find the DevicePathProtocol, if found then use it to implement the interface. Else, use the local interface. It should not have the depex and ASSERT of gEfiDevicePathUtilitiesProtocolGuid when not find the DevicePathProtocol. Add a mandatory one to force using the DevicePathUtilities, DevicePathToText and DevicePathFromText protocol. Cc: Michael D Kinney Cc: Liming Gao Cc: Vitaly Cheptsov Signed-off-by: Zhichao Gao --- ...DevicePathLibMandatoryDevicePathProtocol.c | 469 ++ ...vicePathLibMandatoryDevicePathProtocol.inf | 86 ...vicePathLibMandatoryDevicePathProtocol.uni | 18 + ...iDevicePathLibOptionalDevicePathProtocol.c | 7 +- ...evicePathLibOptionalDevicePathProtocol.inf | 5 +- 5 files changed, 576 insertions(+), 9 deletions(-) create mode 100644 MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibMandatoryDevicePathProtocol.c create mode 100644 MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibMandatoryDevicePathProtocol.inf create mode 100644 MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibMandatoryDevicePathProtocol.uni diff --git a/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibMandatoryDevicePathProtocol.c b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibMandatoryDevicePathProtocol.c new file mode 100644 index 00..fa27110fd4 --- /dev/null +++ b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibMandatoryDevicePathProtocol.c @@ -0,0 +1,469 @@ +/** @file + Device Path services. The thing to remember is device paths are built out of + nodes. The device path is terminated by an end node that is length + sizeof(EFI_DEVICE_PATH_PROTOCOL). That would be why there is sizeof(EFI_DEVICE_PATH_PROTOCOL) + all over this file. + + The only place where multi-instance device paths are supported is in + environment varibles. Multi-instance device paths should never be placed + on a Handle. + + Copyright (c) 2019, Intel Corporation. All rights reserved. + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + + +#include "UefiDevicePathLib.h" + +GLOBAL_REMOVE_IF_UNREFERENCED EFI_DEVICE_PATH_UTILITIES_PROTOCOL *mDevicePathLibDevicePathUtilities = NULL; +GLOBAL_REMOVE_IF_UNREFERENCED EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *mDevicePathLibDevicePathToText= NULL; +GLOBAL_REMOVE_IF_UNREFERENCED EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL *mDevicePathLibDevicePathFromText = NULL; + +/** + The constructor function caches the pointer to DevicePathUtilites protocol, + DevicePathToText protocol and DevicePathFromText protocol. + + The constructor function locates these three protocols from protocol database. + It will caches the pointer to local protocol instance if that operation fails + and it will always return EFI_SUCCESS. + + @param ImageHandle The firmware allocated handle for the EFI image. + @param SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. + +**/ +EFI_STATUS +EFIAPI +UefiDevicePathLibMandatoryDevicePathProtocolConstructor ( + IN EFI_HANDLEImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUSStatus; + + Status = gBS->LocateProtocol ( + , + NULL, + (VOID**) + ); + ASSERT_EFI_ERROR (Status); + ASSERT (mDevicePathLibDevicePathUtilities != NULL); + + Status = gBS->LocateProtocol ( + , + NULL, + (VOID**) + ); + ASSERT_EFI_ERROR (Status); + ASSERT (mDevicePathLibDevicePathToText != NULL); + + Status = gBS->LocateProtocol ( + , + NULL, + (VOID**) + ); + ASSERT_EFI_ERROR (Status); + ASSERT (mDevicePathLibDevicePathFromText != NULL); + + return Status; +} + +/** + Returns the size of a device path in bytes. + + This function returns the size, in bytes, of the device path data structure + specified by DevicePath including the end of device path node. + If DevicePath is NULL or invalid, then 0 is returned. + + @param DevicePath A pointer to a device path data structure. + + @retval 0 If DevicePath is NULL or invalid. + @retval Others The size of a device path in bytes. + +**/ +UINTN +EFIAPI +GetDevicePathSize ( + IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath + ) +{ + if (mDevicePathLibDevicePathUtilities != NULL) { +return mDevicePathLibDevicePathUtilities->GetDevicePathSize (DevicePath); + } + + ASSERT (FALSE); + return 0; +} + +/** + Creates a new copy of an existing device path. + + This function allocates space for a new copy of the device path specified by DevicePath. + If DevicePath is NULL, then NULL is returned. If the memory is successfully + allocated, then
[edk2-devel] [PATCH 0/2] MdePkg/UefiDevicePathLib: Separate the lib instances
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2298 The UefiDevicePathLibOptionalDevicePathProtocolConstructor's implementation isn't match with its instance name. Remove the ASSERT and depex of the gEfiDevicePathUtilitiesProtocolGuid because of "Optional". Add a mandatory instance to force using the DevicePathUtilities, DevicePathToText and DevicePathFromText protocol with the ASSERT and depex. Cc: Michael D Kinney Cc: Liming Gao Cc: Vitaly Cheptsov Signed-off-by: Zhichao Gao Zhichao Gao (2): MdePkg/UefiDevicePathLib: Separate the device path lib MdePkg/dsc: Add UefiDevicePathLibMandatoryDevicePathProtocol for build ...DevicePathLibMandatoryDevicePathProtocol.c | 469 ++ ...vicePathLibMandatoryDevicePathProtocol.inf | 86 ...vicePathLibMandatoryDevicePathProtocol.uni | 18 + ...iDevicePathLibOptionalDevicePathProtocol.c | 7 +- ...evicePathLibOptionalDevicePathProtocol.inf | 5 +- MdePkg/MdePkg.dsc | 3 +- 6 files changed, 578 insertions(+), 10 deletions(-) create mode 100644 MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibMandatoryDevicePathProtocol.c create mode 100644 MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibMandatoryDevicePathProtocol.inf create mode 100644 MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibMandatoryDevicePathProtocol.uni -- 2.21.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51424): https://edk2.groups.io/g/devel/message/51424 Mute This Topic: https://groups.io/mt/63579343/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 2/2] MdePkg/dsc: Add UefiDevicePathLibMandatoryDevicePathProtocol for build
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2298 Add the new instance lib for build. Cc: Michael D Kinney Cc: Liming Gao Cc: Vitaly Cheptsov Signed-off-by: Zhichao Gao --- MdePkg/MdePkg.dsc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc index 0aeafaaacc..9e9813dd27 100644 --- a/MdePkg/MdePkg.dsc +++ b/MdePkg/MdePkg.dsc @@ -1,7 +1,7 @@ ## @file # EFI/PI MdePkg Package # -# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved. +# Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved. # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved. # #SPDX-License-Identifier: BSD-2-Clause-Patent @@ -99,6 +99,7 @@ MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProtocol.inf + MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibMandatoryDevicePathProtocol.inf MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLibDevicePathProtocol.inf MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf MdePkg/Library/UefiLib/UefiLib.inf -- 2.21.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51426): https://edk2.groups.io/g/devel/message/51426 Mute This Topic: https://groups.io/mt/63579380/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms][PATCH V2 35/47] KabylakeOpenBoardPkg/GalagoPro3: Enable advanced features
This change enables advanced features to be used by the GalagoPro3 board in KabylakeOpenBoardPkg. Some platform macros in OpenBoardPkg.dsc are consolidated so all values are set at the top of the file before including advanced feature code. Cc: Chasel Chiu Cc: Nate DeSimone Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc| 46 +--- Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc | 1 + Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf| 4 ++ 3 files changed, 25 insertions(+), 26 deletions(-) diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc index d4ca2daa18..a39547f41f 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc @@ -16,38 +16,32 @@ DEFINE PROJECT = $(PLATFORM_BOARD_PACKAGE)/$(BOARD) DEFINE PEI_ARCH= IA32 DEFINE DXE_ARCH= X64 - - # - # Include PCD configuration for this board. - # - !include OpenBoardPkgPcd.dsc - - -# -# Defines Section - statements that will be processed to create a Makefile. -# - -[Defines] - PLATFORM_NAME = $(PLATFORM_PACKAGE) - PLATFORM_GUID = 7324F33D-4E96-4F8B-A550-544DE6162AB7 - PLATFORM_VERSION= 0.1 - DSC_SPECIFICATION = 0x00010005 - OUTPUT_DIRECTORY= Build/$(PROJECT) - SUPPORTED_ARCHITECTURES = IA32|X64 - BUILD_TARGETS = DEBUG|RELEASE - SKUID_IDENTIFIER= ALL - - - FLASH_DEFINITION= $(PROJECT)/OpenBoardPkg.fdf - - FIX_LOAD_TOP_MEMORY_ADDRESS = 0x0 - DEFINE TOP_MEMORY_ADDRESS = 0x0 + DEFINE TOP_MEMORY_ADDRESS = 0x0 # # Default value for OpenBoardPkg.fdf use # DEFINE BIOS_SIZE_OPTION = SIZE_60 + PLATFORM_NAME = $(PLATFORM_PACKAGE) + PLATFORM_GUID = 7324F33D-4E96-4F8B-A550-544DE6162AB7 + PLATFORM_VERSION= 0.1 + DSC_SPECIFICATION = 0x00010005 + OUTPUT_DIRECTORY= Build/$(PROJECT) + SUPPORTED_ARCHITECTURES = IA32|X64 + BUILD_TARGETS = DEBUG|RELEASE + SKUID_IDENTIFIER= ALL + + FLASH_DEFINITION= $(PROJECT)/OpenBoardPkg.fdf + FIX_LOAD_TOP_MEMORY_ADDRESS = 0x0 + + # + # Include PCD configuration for this board. + # + !include AdvancedFeaturePkg/TemporaryBuildWorkaround/TemporaryBuildWorkaround.dsc + !include OpenBoardPkgPcd.dsc + !include AdvancedFeaturePkg/Include/AdvancedFeatures.dsc + # # SKU Identification section - list of all SKU IDs supported by this board. diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc index c6f5ae7534..7393897249 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc @@ -24,6 +24,7 @@ # Stage 3 - boot to shell only # Stage 4 - boot to OS # Stage 5 - boot to OS with security boot enabled + # Stage 6 - boot with advanced features enabled # gMinPlatformPkgTokenSpaceGuid.PcdBootStage|4 diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf index 0a9b933e40..da94ed0cd1 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf @@ -631,6 +631,8 @@ READ_LOCK_CAP = TRUE READ_LOCK_STATUS = TRUE FvNameGuid = 6053D78A-457E-4490-A237-31D0FBE2F305 +!include AdvancedFeaturePkg/Include/PreMemory.fdf + !if gKabylakeOpenBoardPkgTokenSpaceGuid.PcdTbtEnable == TRUE INF $(PLATFORM_BOARD_PACKAGE)/Features/Tbt/TbtInit/Pei/PeiTbtInit.inf !endif @@ -657,6 +659,8 @@ READ_LOCK_CAP = TRUE READ_LOCK_STATUS = TRUE FvNameGuid = BE3DF86F-E464-44A3-83F7-0D27E6B88C27 +!include AdvancedFeaturePkg/Include/PostMemory.fdf + !if gKabylakeOpenBoardPkgTokenSpaceGuid.PcdTbtEnable == TRUE INF $(PLATFORM_BOARD_PACKAGE)/Features/Tbt/TbtInit/Dxe/TbtDxe.inf INF $(PLATFORM_BOARD_PACKAGE)/Features/PciHotPlug/PciHotPlug.inf -- 2.16.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You
[edk2-devel] [edk2-platforms][PATCH V2 38/47] SimicsOpenBoardPkg: Use new advanced feature refactor
Updates advanced feature references in SimicsOpenBoardPkg to the new advanced feature packages in Features/Intel. Previously, the advanced features in Platform/Intel were used. SimicsOpenBoardPkg currently uses the SMBIOS and Network advanced features. These are the same features used by the package prior to the advanced feature refactor. Note that SimicsOpenBoardPkg depends upon these advanced features even when the boot stage is less than the advanced feature stage. This bug was not fixed in this commit and is filed to be resolved in the following Bugzilla item: https://bugzilla.tianocore.org/show_bug.cgi?id=2165 Cc: Wei David Y Cc: Agyeman Prince Signed-off-by: Michael Kubacki --- Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc | 11 ++- Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc | 12 ++-- Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf | 10 ++ Platform/Intel/SimicsOpenBoardPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf | 1 - 4 files changed, 10 insertions(+), 24 deletions(-) diff --git a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc index 2f287a4ca4..7576648d57 100644 --- a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc +++ b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc @@ -42,8 +42,9 @@ DEFINE NETWORK_ISCSI_ENABLE = FALSE DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = TRUE + !include AdvancedFeaturePkg/TemporaryBuildWorkaround/TemporaryBuildWorkaround.dsc !include $(PROJECT)/OpenBoardPkgPcd.dsc - !include NetworkPkg/NetworkDefines.dsc.inc + !include AdvancedFeaturePkg/Include/AdvancedFeatures.dsc # @@ -80,7 +81,6 @@ #is completed [Components.X64] !include $(PLATFORM_PACKAGE)/Include/Dsc/CoreDxeInclude.dsc -!include AdvancedFeaturePkg/Include/Dsc/CoreAdvancedDxeInclude.dsc ### # Build Option Includes @@ -285,13 +285,6 @@ $(PLATFORM_PACKAGE)/Flash/SpiFvbService/SpiFvbServiceSmm.inf !endif - ### - # Advanced Feature Package - ### -!if gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosEnable == TRUE - AdvancedFeaturePkg/Smbios/SmbiosBasicDxe/SmbiosBasicDxe.inf -!endif - ### # Board Package ### diff --git a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc index cd95755f91..cd98d09f01 100644 --- a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc +++ b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc @@ -96,8 +96,8 @@ ## # Advanced Feature Configuration ## - gAdvancedFeaturePkgTokenSpaceGuid.PcdNetworkEnable|TRUE - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosEnable|TRUE + gNetworkFeaturePkgTokenSpaceGuid.PcdNetworkFeatureEnable|TRUE + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable|TRUE [PcdsFeatureFlag.X64] ## @@ -252,10 +252,10 @@ ## # Advanced Feature Configuration ## - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0StringBiosReleaseDate|"2019-08-09" - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType0StringBiosVersion|"Ver.1.0.0" - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringProductName|"QSP UEFI BIOS" - gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringProductName|"QSP UEFI BIOS" + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0StringBiosReleaseDate|"2019-08-09" + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0StringBiosVersion|"Ver.1.0.0" + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringProductName|"QSP UEFI BIOS" + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringProductName|"QSP UEFI BIOS" [PcdsDynamicExDefault] ## diff --git a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf index ef6b35c92f..e0a1daddee 100644 --- a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf +++ b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf @@ -155,7 +155,7 @@ INF MinPlatformPkg/PlatformInit/ReportFv/ReportFvPei.inf INF MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPreMem.inf INF MinPlatformPkg/PlatformInit/SiliconPolicyPei/SiliconPolicyPeiPreMem.inf !include MinPlatformPkg/Include/Fdf/CoreSecurityPreMemoryInclude.fdf -!include AdvancedFeaturePkg/Include/Fdf/CoreAdvancedPreMemoryInclude.fdf +!include
[edk2-devel] [edk2-platforms][PATCH V2 37/47] WhiskeylakeOpenBoardPkg/WhiskeylakeURvp: Enable advanced features
This change enables advanced features to be used by the WhiskeylakeURvp board in WhiskeylakeOpenBoardPkg. Some platform macros in OpenBoardPkg.dsc are consolidated so all values are set at the top of the file before including advanced feature code. Cc: Chasel Chiu Cc: Nate DeSimone Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc| 44 +--- Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkgPcd.dsc | 1 + Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.fdf| 4 ++ 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc index ae3fec05ed..47e156be08 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc @@ -17,36 +17,32 @@ DEFINE PROJECT = $(PLATFORM_BOARD_PACKAGE)/$(BOARD) DEFINE PEI_ARCH = IA32 DEFINE DXE_ARCH = X64 - - # - # Include PCD configuration for this board. - # - !include OpenBoardPkgPcd.dsc - - -# -# Defines Section - statements that will be processed to create a Makefile. -# - -[Defines] - PLATFORM_NAME = $(PLATFORM_PACKAGE) - PLATFORM_GUID = 84D0F5BD-0EF3-4CC0-9B09-F2D0F2AA5C5E - PLATFORM_VERSION= 0.1 - DSC_SPECIFICATION = 0x00010005 - OUTPUT_DIRECTORY= Build/$(PROJECT) - SUPPORTED_ARCHITECTURES = IA32|X64 - BUILD_TARGETS = DEBUG|RELEASE - SKUID_IDENTIFIER= ALL - FLASH_DEFINITION= $(PROJECT)/OpenBoardPkg.fdf - - FIX_LOAD_TOP_MEMORY_ADDRESS = 0x0 - DEFINE TOP_MEMORY_ADDRESS = 0x0 + DEFINE TOP_MEMORY_ADDRESS= 0x0 # # Default value for OpenBoardPkg.fdf use # DEFINE BIOS_SIZE_OPTION = SIZE_70 + PLATFORM_NAME = $(PLATFORM_PACKAGE) + PLATFORM_GUID = 84D0F5BD-0EF3-4CC0-9B09-F2D0F2AA5C5E + PLATFORM_VERSION = 0.1 + DSC_SPECIFICATION = 0x00010005 + OUTPUT_DIRECTORY = Build/$(PROJECT) + SUPPORTED_ARCHITECTURES = IA32|X64 + BUILD_TARGETS = DEBUG|RELEASE + SKUID_IDENTIFIER = ALL + + FLASH_DEFINITION = $(PROJECT)/OpenBoardPkg.fdf + FIX_LOAD_TOP_MEMORY_ADDRESS = 0x0 + + # + # Include PCD configuration for this board. + # + !include AdvancedFeaturePkg/TemporaryBuildWorkaround/TemporaryBuildWorkaround.dsc + !include OpenBoardPkgPcd.dsc + !include AdvancedFeaturePkg/Include/AdvancedFeatures.dsc + # # SKU Identification section - list of all SKU IDs supported by this board. diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkgPcd.dsc b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkgPcd.dsc index 52471cb25b..906f7b7ade 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkgPcd.dsc +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkgPcd.dsc @@ -24,6 +24,7 @@ # Stage 3 - boot to shell only # Stage 4 - boot to OS # Stage 5 - boot to OS with security boot enabled + # Stage 6 - boot with advanced features enabled # gMinPlatformPkgTokenSpaceGuid.PcdBootStage|4 diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.fdf b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.fdf index 130930ad40..f39b41b186 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.fdf +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.fdf @@ -623,6 +623,8 @@ READ_LOCK_CAP = TRUE READ_LOCK_STATUS = TRUE FvNameGuid = 6053D78A-457E-4490-A237-31D0FBE2F305 +!include AdvancedFeaturePkg/Include/PreMemory.fdf + !if gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdTbtEnable == TRUE INF $(PLATFORM_BOARD_PACKAGE)/Features/Tbt/TbtInit/Pei/PeiTbtInit.inf !endif @@ -649,6 +651,8 @@ READ_LOCK_CAP = TRUE READ_LOCK_STATUS = TRUE FvNameGuid = BE3DF86F-E464-44A3-83F7-0D27E6B88C27 +!include AdvancedFeaturePkg/Include/PostMemory.fdf + !if gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdTbtEnable == TRUE INF $(PLATFORM_BOARD_PACKAGE)/Features/Tbt/TbtInit/Dxe/TbtDxe.inf INF $(PLATFORM_BOARD_PACKAGE)/Features/PciHotPlug/PciHotPlug.inf -- 2.16.2.windows.1
[edk2-devel] [edk2-platforms][PATCH V2 33/47] Platform/Intel: Add advanced feature build support
This change adds the ability for board packages built with build_bios.py to build advanced features located in Features/Intel. Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Cc: Agyeman Prince Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Platform/Intel/build.cfg | 1 + Platform/Intel/build_bios.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Platform/Intel/build.cfg b/Platform/Intel/build.cfg index e42db243f6..86a9115021 100644 --- a/Platform/Intel/build.cfg +++ b/Platform/Intel/build.cfg @@ -12,6 +12,7 @@ WORKSPACE_FSP_BIN = FSP EDK_TOOLS_BIN = edk2-BaseTools-win32 EDK_BASETOOLS = BaseTools WORKSPACE_DRIVERS = edk2-platforms/Drivers +WORKSPACE_FEATURES = edk2-platforms/Features/Intel WORKSPACE_PLATFORM = edk2-platforms/Platform/Intel WORKSPACE_SILICON = edk2-platforms/Silicon/Intel WORKSPACE_PLATFORM_BIN = diff --git a/Platform/Intel/build_bios.py b/Platform/Intel/build_bios.py index ea098de705..1ef35aca0a 100644 --- a/Platform/Intel/build_bios.py +++ b/Platform/Intel/build_bios.py @@ -104,6 +104,8 @@ def pre_build(build_config, build_type="DEBUG", silent=False, toolchain=None): config["WORKSPACE_PLATFORM"]) config["WORKSPACE_SILICON"] = os.path.join(config["WORKSPACE"], config["WORKSPACE_SILICON"]) +config["WORKSPACE_FEATURES"] = os.path.join(config["WORKSPACE"], + config["WORKSPACE_FEATURES"]) config["WORKSPACE_DRIVERS"] = os.path.join(config["WORKSPACE"], config["WORKSPACE_DRIVERS"]) config["WORKSPACE_PLATFORM_BIN"] = \ @@ -117,6 +119,7 @@ def pre_build(build_config, build_type="DEBUG", silent=False, toolchain=None): config["PACKAGES_PATH"] = config["WORKSPACE_PLATFORM"] config["PACKAGES_PATH"] += os.pathsep + config["WORKSPACE_SILICON"] config["PACKAGES_PATH"] += os.pathsep + config["WORKSPACE_SILICON_BIN"] +config["PACKAGES_PATH"] += os.pathsep + config["WORKSPACE_FEATURES"] config["PACKAGES_PATH"] += os.pathsep + config["WORKSPACE_DRIVERS"] config["PACKAGES_PATH"] += os.pathsep + \ os.path.join(config["WORKSPACE"], "FSP") -- 2.16.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51418): https://edk2.groups.io/g/devel/message/51418 Mute This Topic: https://groups.io/mt/63459858/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms][PATCH V2 34/47] Platform/Intel/Readme.md Content update
Updates the advanced feature location referenced in Readme.md to edk2-platforms/Features/Intel. Cc: Dandan Bi Cc: Sai Chaganty Cc: Eric Dong Cc: Nate DeSimone Cc: Liming Gao Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Platform/Intel/Readme.md | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Platform/Intel/Readme.md b/Platform/Intel/Readme.md index 0f86978fee..02d9517d19 100644 --- a/Platform/Intel/Readme.md +++ b/Platform/Intel/Readme.md @@ -89,8 +89,7 @@ A UEFI firmware implementation using MinPlatformPkg is constructed using the fol The board package follows the standard EDK II package structure with the following additional elements and guidelines: * Only code usable across more than one board at the root level. * Board-specific code in a directory. The directory name should match that of the board supported. -* Features not essential to achieve stage 5 or earlier boots are maintained in a Features folder at the appropriate - level in the package hierarchy. +* Features not essential to achieve stage 5 or earlier boots are maintained in edk2-platforms/Features/Intel. Shared resources in the package root directory can include interfaces described in header files, library instances, firmware modules, binaries, etc. The UEFI firmware implementation is built using the process described below from the @@ -260,16 +259,17 @@ return back to the minimum platform caller. ### **Package Builds** -In some cases, such as AdvancedFeaturePkg, a package may provide a set of functionality that is included in other +In some cases, such as BoardModulePkg, a package may provide a set of functionality that is included in other packages. To test the build of the whole package, the "build" command should be used following the instructions below. 1. Execute edksetup.bat (Windows) or edksetup.sh (Linux). 2. Verify the "WORKSPACE" environment variable is set to the edk2 directory in your workspace. -3. Set the "PACKAGES_PATH" environment variable to include the edk2-platforms/Platform/Intel and edk2-platforms/Silicon/Intel - directories. - * Windows example: set PACKAGES_PATH=c:\Edk2Workspace\edk2-platforms\Platform\Intel;c:\Edk2Workspace\edk2-platforms\Silicon\Intel +3. Set the "PACKAGES_PATH" environment variable to include the 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 4. Build the package by specifying the package DSC as the platform build target from the Platform/Intel or Silicon/Intel directory: - "build -p AdvancedFeaturePkg/AdvancedFeaturePkg.dsc" + "build -p BoardModulePkg/BoardModulePkg.dsc -a IA32 -a X64" ### **Firmware Image Flashing** -- 2.16.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51419): https://edk2.groups.io/g/devel/message/51419 Mute This Topic: https://groups.io/mt/63459961/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms][PATCH V2 36/47] KabylakeOpenBoardPkg/KabylakeRvp3: Enable advanced features
This change enables advanced features to be used by the KabylakeRvp3 board in KabylakeOpenBoardPkg. Some platform macros in OpenBoardPkg.dsc are consolidated so all values are set at the top of the file before including advanced feature code. Cc: Chasel Chiu Cc: Nate DeSimone Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc| 44 +--- Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc | 1 + Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf| 4 ++ 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc index 831e441d70..50be2bb624 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc +++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc @@ -15,11 +15,31 @@ DEFINE PROJECT = $(PLATFORM_BOARD_PACKAGE)/$(BOARD) DEFINE PEI_ARCH= IA32 DEFINE DXE_ARCH= X64 + DEFINE TOP_MEMORY_ADDRESS = 0x0 + + # + # Default value for OpenBoardPkg.fdf use + # + DEFINE BIOS_SIZE_OPTION = SIZE_70 + + PLATFORM_NAME = $(PLATFORM_PACKAGE) + PLATFORM_GUID = 8470676C-18E8-467F-B126-28DB1941AA5A + PLATFORM_VERSION= 0.1 + DSC_SPECIFICATION = 0x00010005 + OUTPUT_DIRECTORY= Build/$(PROJECT) + SUPPORTED_ARCHITECTURES = IA32|X64 + BUILD_TARGETS = DEBUG|RELEASE + SKUID_IDENTIFIER= ALL + FLASH_DEFINITION= $(PROJECT)/OpenBoardPkg.fdf + + FIX_LOAD_TOP_MEMORY_ADDRESS = 0x0 # # Include PCD configuration for this board. # + !include AdvancedFeaturePkg/TemporaryBuildWorkaround/TemporaryBuildWorkaround.dsc !include OpenBoardPkgPcd.dsc + !include AdvancedFeaturePkg/Include/AdvancedFeatures.dsc [Defines] !if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 1 @@ -51,30 +71,6 @@ !endif !endif - -# -# Defines Section - statements that will be processed to create a Makefile. -# - -[Defines] - PLATFORM_NAME = $(PLATFORM_PACKAGE) - PLATFORM_GUID = 8470676C-18E8-467F-B126-28DB1941AA5A - PLATFORM_VERSION= 0.1 - DSC_SPECIFICATION = 0x00010005 - OUTPUT_DIRECTORY= Build/$(PROJECT) - SUPPORTED_ARCHITECTURES = IA32|X64 - BUILD_TARGETS = DEBUG|RELEASE - SKUID_IDENTIFIER= ALL - FLASH_DEFINITION= $(PROJECT)/OpenBoardPkg.fdf - - FIX_LOAD_TOP_MEMORY_ADDRESS = 0x0 - DEFINE TOP_MEMORY_ADDRESS = 0x0 - - # - # Default value for OpenBoardPkg.fdf use - # - DEFINE BIOS_SIZE_OPTION = SIZE_70 - # # SKU Identification section - list of all SKU IDs supported by this board. diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc index 5474edd01c..916b5189fe 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc +++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc @@ -24,6 +24,7 @@ # Stage 3 - boot to shell only # Stage 4 - boot to OS # Stage 5 - boot to OS with security boot enabled + # Stage 6 - boot with advanced features enabled # gMinPlatformPkgTokenSpaceGuid.PcdBootStage|4 diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf index 59f764f49c..fc1c6a9c25 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf +++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf @@ -638,6 +638,8 @@ READ_LOCK_CAP = TRUE READ_LOCK_STATUS = TRUE FvNameGuid = 6053D78A-457E-4490-A237-31D0FBE2F305 +!include AdvancedFeaturePkg/Include/PreMemory.fdf + !if gKabylakeOpenBoardPkgTokenSpaceGuid.PcdTbtEnable == TRUE INF $(PLATFORM_BOARD_PACKAGE)/Features/Tbt/TbtInit/Pei/PeiTbtInit.inf !endif @@ -664,6 +666,8 @@ READ_LOCK_CAP = TRUE READ_LOCK_STATUS = TRUE FvNameGuid = BE3DF86F-E464-44A3-83F7-0D27E6B88C27 +!include AdvancedFeaturePkg/Include/PostMemory.fdf + !if gKabylakeOpenBoardPkgTokenSpaceGuid.PcdTbtEnable == TRUE INF
[edk2-devel] [edk2-platforms][PATCH V2 25/47] KabylakeOpenBoardPkg/KabylakeRvp3: Add PEI_ARCH and DXE_ARCH
This change adds two new macros to OpenBoardPkg.dsc that identify the build architecture for PEI and DXE modules. The intention of this macro is to ensure that all DSC files that compose the package build (such as those included from MinPlatformPkg or an advanced feature package) build phase-specific drivers for the architecture defined by the board package. This is a macro that is required in all Minimum Platform board packages. Cc: Chasel Chiu Cc: Nate DeSimone Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc | 17 + 1 file changed, 17 insertions(+) diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc index 4b07c0a684..831e441d70 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc +++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc @@ -13,6 +13,8 @@ DEFINE PLATFORM_BOARD_PACKAGE = KabylakeOpenBoardPkg DEFINE BOARD = KabylakeRvp3 DEFINE PROJECT = $(PLATFORM_BOARD_PACKAGE)/$(BOARD) + DEFINE PEI_ARCH= IA32 + DEFINE DXE_ARCH= X64 # # Include PCD configuration for this board. @@ -102,10 +104,15 @@ ### # Component Includes ### + +# @todo: Change below line to [Components.$(PEI_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 +#is completed [Components.IA32] !include $(PLATFORM_PACKAGE)/Include/Dsc/CorePeiInclude.dsc !include $(PLATFORM_SI_PACKAGE)/SiPkgPei.dsc +# @todo: Change below line to [Components.$(DXE_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 +#is completed [Components.X64] !include $(PLATFORM_PACKAGE)/Include/Dsc/CoreDxeInclude.dsc !include $(PLATFORM_SI_PACKAGE)/SiPkgDxe.dsc @@ -266,6 +273,11 @@ TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib/SmmTestPointCheckLib.inf !endif +### +# PEI Components +### +# @todo: Change below line to [Components.$(PEI_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 +#is completed [Components.IA32] ### # Edk2 Packages @@ -373,6 +385,11 @@ !endif $(PLATFORM_BOARD_PACKAGE)/BiosInfo/BiosInfo.inf +### +# DXE Components +### +# @todo: Change below line to [Components.$(DXE_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 +#is completed [Components.X64] ### # Edk2 Packages -- 2.16.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51410): https://edk2.groups.io/g/devel/message/51410 Mute This Topic: https://groups.io/mt/63458703/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms][PATCH V2 28/47] SimicsOpenBoardPkg/BoardX58Ich10: Use PEI_ARCH and DXE_ARCH
This change updates OpenBoardPkg.dsc to use the PEI_ARCH and DXE_ARCH specified in the DSC file for the board package components. An EDK II build limitation currently prevents the macros from being able to be used, so a todo has been placed with the action needed when the BaseTools update is completed as described in the following Bugzilla item: https://bugzilla.tianocore.org/show_bug.cgi?id=2308 The intention of this macro is to ensure that all DSC files that compose the package build (such as those included from MinPlatformPkg or an advanced feature package) build phase-specific drivers for the architecture defined by the board package. This is a macro that is required in all Minimum Platform board packages. Cc: Wei David Y Cc: Agyeman Prince Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc | 14 ++ 1 file changed, 14 insertions(+) diff --git a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc index 35a8c7c765..2f287a4ca4 100644 --- a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc +++ b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc @@ -70,10 +70,14 @@ ### # Component Includes ### +# @todo: Change below line to [Components.$(PEI_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 +#is completed [Components.IA32] !include $(PLATFORM_PACKAGE)/Include/Dsc/CorePeiInclude.dsc !include $(SKT_PKG)/SktPkgPei.dsc +# @todo: Change below line to [Components.$(DXE_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 +#is completed [Components.X64] !include $(PLATFORM_PACKAGE)/Include/Dsc/CoreDxeInclude.dsc !include AdvancedFeaturePkg/Include/Dsc/CoreAdvancedDxeInclude.dsc @@ -153,6 +157,11 @@ ### SpiFlashCommonLib|$(PCH_PKG)/Library/SmmSpiFlashCommonLib/SmmSpiFlashCommonLib.inf +### +# PEI Components +### +# @todo: Change below line to [Components.$(PEI_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 +#is completed [Components.IA32] ### # Edk2 Packages @@ -202,6 +211,11 @@ PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf } +### +# DXE Components +### +# @todo: Change below line to [Components.$(DXE_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 +#is completed [Components.X64] ### # Edk2 Packages -- 2.16.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51413): https://edk2.groups.io/g/devel/message/51413 Mute This Topic: https://groups.io/mt/63459244/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms][PATCH V2 32/47] WhiskeylakeOpenBoardPkg/WhiskeylakeURvp: Add FvAdvancedPreMemory
This change adds a standalone firmware volume for pre-memory advanced features called FvAdvancedPreMemory to the flash map. Pre-memory advanced feature modules were previously kept in a child firmware volume of FvAdvanced called FvAdvancedPreMem. This change simplifies the flash layout and separation of pre-memory and post-memory modules. Cc: Chasel Chiu Cc: Nate DeSimone Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/Fdf/FlashMapInclude.fdf | 24 +- Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.fdf | 46 +++- 2 files changed, 28 insertions(+), 42 deletions(-) diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/Fdf/FlashMapInclude.fdf b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/Fdf/FlashMapInclude.fdf index 9209b9e88a..e0db381942 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/Fdf/FlashMapInclude.fdf +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/Fdf/FlashMapInclude.fdf @@ -1,12 +1,10 @@ ## @file -# FDF file of Platform. -# +# FDF file for the WhiskeylakeURvp board. # # Copyright (c) 2019, Intel Corporation. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # -# ## #=# @@ -27,23 +25,25 @@ SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize = 0x2000 SET gMinPlatformPkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareOffset = 0x0002 # Flash addr (0xFF82) SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize= 0x0002 # SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedOffset = 0x0004 # Flash addr (0xFF84) -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedSize= 0x0006 # -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecurityOffset = 0x000A # Flash addr (0xFF8A) +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedSize= 0x0005 # +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecurityOffset = 0x0009 # Flash addr (0xFF89) SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecuritySize= 0x0007 # -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootOffset= 0x0011 # Flash addr (0xFF91) +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootOffset= 0x0010 # Flash addr (0xFF90) SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootSize = 0x0009 # -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootOffset = 0x001A # Flash addr (0xFF9A) +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootOffset = 0x0019 # Flash addr (0xFF99) SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootSize= 0x0019 # -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryOffset= 0x0033 # Flash addr (0xFFB3) +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryOffset= 0x0032 # Flash addr (0xFFB2) SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize = 0x0017 # -SET gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvOffset = 0x004A # Flash addr (0xFFCA) +SET gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvOffset = 0x0049 # Flash addr (0xFFC9) SET gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize= 0x000B # -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSOffset = 0x0055 # Flash addr (0xFFD5) +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSOffset = 0x0054 # Flash addr (0xFFD4) SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSSize= 0x0007 # -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMOffset = 0x005C # Flash addr (0xFFDC) +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMOffset = 0x005B # Flash addr (0xFFDB) SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMSize= 0x000EC000 # -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTOffset = 0x006AC000 # Flash addr (0xFFEAC000) +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTOffset = 0x0069C000 # Flash addr (0xFFE9C000) SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTSize= 0x00014000 # +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemoryOffset = 0x006B # Flash addr (0xFFEB) +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemorySize = 0x0001 # SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemoryOffset = 0x006C # Flash addr (0xFFEC) SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemorySize = 0x0014 # diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.fdf
[edk2-devel] [edk2-platforms][PATCH V2 26/47] KabylakeOpenBoardPkg/GalagoPro3: Add PEI_ARCH and DXE_ARCH
This change adds two new macros to OpenBoardPkg.dsc that identify the build architecture for PEI and DXE modules. The intention of this macro is to ensure that all DSC files that compose the package build (such as those included from MinPlatformPkg or an advanced feature package) build phase-specific drivers for the architecture defined by the board package. This is a macro that is required in all Minimum Platform board packages. Cc: Chasel Chiu Cc: Nate DeSimone Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc | 16 1 file changed, 16 insertions(+) diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc index acdc31e708..d4ca2daa18 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc @@ -14,6 +14,8 @@ DEFINE PLATFORM_BOARD_PACKAGE = KabylakeOpenBoardPkg DEFINE BOARD = GalagoPro3 DEFINE PROJECT = $(PLATFORM_BOARD_PACKAGE)/$(BOARD) + DEFINE PEI_ARCH= IA32 + DEFINE DXE_ARCH= X64 # # Include PCD configuration for this board. @@ -74,10 +76,14 @@ ### # Component Includes ### +# @todo: Change below line to [Components.$(PEI_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 +#is completed [Components.IA32] !include $(PLATFORM_PACKAGE)/Include/Dsc/CorePeiInclude.dsc !include $(PLATFORM_SI_PACKAGE)/SiPkgPei.dsc +# @todo: Change below line to [Components.$(DXE_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 +#is completed [Components.X64] !include $(PLATFORM_PACKAGE)/Include/Dsc/CoreDxeInclude.dsc !include $(PLATFORM_SI_PACKAGE)/SiPkgDxe.dsc @@ -228,6 +234,11 @@ TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib/SmmTestPointCheckLib.inf !endif +### +# PEI Components +### +# @todo: Change below line to [Components.$(PEI_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 +#is completed [Components.IA32] ### # Edk2 Packages @@ -301,6 +312,11 @@ !endif $(PLATFORM_BOARD_PACKAGE)/BiosInfo/BiosInfo.inf +### +# DXE Components +### +# @todo: Change below line to [Components.$(DXE_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 +#is completed [Components.X64] ### # Edk2 Packages -- 2.16.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51411): https://edk2.groups.io/g/devel/message/51411 Mute This Topic: https://groups.io/mt/63458822/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms][PATCH V2 24/47] Features/Intel/AdvancedFeaturePkg: Add FDF include files
Adds FDF files that group all currently available advanced features so they can be conveniently included into board packages. The Minimum Platform defines two firmware volumes for advanced features: FvAdvancedPreMemory and FvAdvanced. This change provides all pre-memory advanced feature modules to be included in FvAdvancedPreMemory via AdvancedFeaturePkg/Include/PreMemory.fdf. All post-memory advanced feature modules to be included in FvAdvanced are available in AdvancedFeaturePkg/Include/PostMemory.fdf. Cc: Sai Chaganty Cc: Liming Gao Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf | 57 Features/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf | 57 2 files changed, 114 insertions(+) diff --git a/Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf b/Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf new file mode 100644 index 00..57b29a42b9 --- /dev/null +++ b/Features/Intel/AdvancedFeaturePkg/Include/PostMemory.fdf @@ -0,0 +1,57 @@ +## @file +# FDF file for post-memory advanced features. +# +# 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) 2019, Intel Corporation. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +# +# Debug Advanced Features +# +!if gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable == TRUE + !include Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fdf +!endif +!if gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable == TRUE + !include Debugging/Usb3DebugFeaturePkg/Include/PostMemory.fdf +!endif + +# +# Network Advanced Features +# +!if gNetworkFeaturePkgTokenSpaceGuid.PcdNetworkFeatureEnable == TRUE + !include Network/NetworkFeaturePkg/Include/PostMemory.fdf +!endif + +# +# Out-of-Band Management Advanced Features +# +!if gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable == TRUE + !include OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf +!endif + +# +# Power Management Advanced Features +# +!if gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable == TRUE + !include PowerManagement/S3FeaturePkg/Include/PostMemory.fdf +!endif + +# +# System Information Advanced Features +# +!if gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable == TRUE + !include SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf +!endif + +# +# User Interface Advanced Features +# +!if gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable == TRUE + !include UserInterface/UserAuthFeaturePkg/Include/PostMemory.fdf +!endif diff --git a/Features/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf b/Features/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf new file mode 100644 index 00..20d25dd173 --- /dev/null +++ b/Features/Intel/AdvancedFeaturePkg/Include/PreMemory.fdf @@ -0,0 +1,57 @@ +## @file +# FDF file for pre-memory advanced features. +# +# 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) 2019, Intel Corporation. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +# +# Debug Advanced Features +# +!if gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable == TRUE + !include Debugging/AcpiDebugFeaturePkg/Include/PreMemory.fdf +!endif +!if gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable == TRUE + !include Debugging/Usb3DebugFeaturePkg/Include/PreMemory.fdf +!endif + +# +# Network Advanced Features +# +!if gNetworkFeaturePkgTokenSpaceGuid.PcdNetworkFeatureEnable == TRUE + !include Network/NetworkFeaturePkg/Include/PreMemory.fdf +!endif + +# +# Out-of-Band Management Advanced Features +# +!if gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable == TRUE + !include OutOfBandManagement/IpmiFeaturePkg/Include/PreMemory.fdf +!endif + +# +# Power Management Advanced Features +# +!if gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable == TRUE + !include PowerManagement/S3FeaturePkg/Include/PreMemory.fdf +!endif + +# +# System Information Advanced Features +# +!if gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable == TRUE + !include SystemInformation/SmbiosFeaturePkg/Include/PreMemory.fdf +!endif + +# +# User Interface Advanced Features +# +!if gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable == TRUE + !include UserInterface/UserAuthFeaturePkg/Include/PreMemory.fdf +!endif -- 2.16.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51409): https://edk2.groups.io/g/devel/message/51409 Mute This Topic: https://groups.io/mt/63458566/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub
[edk2-devel] [edk2-platforms][PATCH V2 29/47] MinPlatformPkg: Add FvAdvancedPreMemory
This change adds a new firmware volume to MinPlatformPkg called FvAdvancedPreMemory. This firmware volume is used to hold advanced feature modules that must be available in pre-memory. Previously, these modules were kept as an uncompressed child FV in FvAdvanced. However, in memory constrained environments before permanent memory is initialized, it is preferable to have a dedicated firmware volume that can simply be installed as a standalone firmware volume to reduce the need for creating FV HOBs for other post-memory advanced features if they are not needed and to simplify the FV layout and FV installation process. Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Signed-off-by: Michael Kubacki --- Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec | 3 ++ Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf | 42 ++-- Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.c | 24 --- 3 files changed, 44 insertions(+), 25 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec index 6a765d689d..21013cc87c 100644 --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec @@ -168,6 +168,9 @@ SetCacheMtrrLib|Include/Library/SetCacheMtrrLib.h gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecurityBase|0x|UINT32|0x2010 gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecuritySize|0x|UINT32|0x2011 gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecurityOffset|0x|UINT32|0x2012 + gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemoryBase|0x|UINT32|0x202D + gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemorySize|0x|UINT32|0x202E + gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemoryOffset|0x|UINT32|0x202F gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedBase|0x|UINT32|0x2013 gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedSize|0x|UINT32|0x2014 gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedOffset|0x|UINT32|0x2015 diff --git a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf index 4d96c9cf31..1ce3034fcc 100644 --- a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf +++ b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf @@ -1,7 +1,7 @@ ### @file # Component information file for the Report Firmware Volume (FV) library. # -# Copyright (c) 2018, Intel Corporation. All rights reserved. +# Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -30,22 +30,24 @@ PeiReportFvLib.c [Pcd] - gMinPlatformPkgTokenSpaceGuid.PcdFspWrapperBootMode ## CONSUMES - gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaBaseAddress ## CONSUMES - gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize## CONSUMES - gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMBase ## CONSUMES - gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMSize ## CONSUMES - gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSBase ## CONSUMES - gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSSize ## CONSUMES - gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspUBase ## CONSUMES - gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspUSize ## CONSUMES - gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryBase## CONSUMES - gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize## CONSUMES - gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootBase ## CONSUMES - gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootSize ## CONSUMES - gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootBase## CONSUMES - gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootSize## CONSUMES - gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecurityBase ## CONSUMES - gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecuritySize ## CONSUMES - gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedBase ## CONSUMES - gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedSize ## CONSUMES + gMinPlatformPkgTokenSpaceGuid.PcdFspWrapperBootMode ## CONSUMES + gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaBaseAddress ## CONSUMES + gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize ## CONSUMES + gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMBase## CONSUMES + gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMSize## CONSUMES + gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSBase## CONSUMES + gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSSize## CONSUMES + gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspUBase## CONSUMES +
[edk2-devel] [edk2-platforms][PATCH V2 31/47] KabylakeOpenBoardPkg/GalagoPro3: Add FvAdvancedPreMemory
This change adds a standalone firmware volume for pre-memory advanced features called FvAdvancedPreMemory to the flash map. Pre-memory advanced feature modules were previously kept in a child firmware volume of FvAdvanced called FvAdvancedPreMem. This change simplifies the flash layout and separation of pre-memory and post-memory modules. Cc: Chasel Chiu Cc: Nate DeSimone Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Include/Fdf/FlashMapInclude.fdf | 20 + Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf | 46 +++- 2 files changed, 27 insertions(+), 39 deletions(-) diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Include/Fdf/FlashMapInclude.fdf b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Include/Fdf/FlashMapInclude.fdf index c7f314ffe4..6cb6d54f55 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Include/Fdf/FlashMapInclude.fdf +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Include/Fdf/FlashMapInclude.fdf @@ -27,22 +27,24 @@ SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize= 0x0002 SET gKabylakeOpenBoardPkgTokenSpaceGuid.PcdFlashNvDebugMessageOffset = 0x0004 # Flash addr (0xFFA6) SET gKabylakeOpenBoardPkgTokenSpaceGuid.PcdFlashNvDebugMessageSize = 0x0001 # SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedOffset = 0x0005 # Flash addr (0xFFA7) -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedSize= 0x0006 # -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecurityOffset = 0x000B # Flash addr (0xFFAD) +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedSize= 0x0005 # +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecurityOffset = 0x000A # Flash addr (0xFFAC) SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecuritySize= 0x0007 # -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootOffset= 0x0012 # Flash addr (0xFFB4) +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootOffset= 0x0011 # Flash addr (0xFFB3) SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootSize = 0x0009 # -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootOffset = 0x001B # Flash addr (0xFFBD) +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootOffset = 0x001A # Flash addr (0xFFBC) SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootSize= 0x0014 # -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryOffset= 0x002F # Flash addr (0xFFD1) +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryOffset= 0x002E # Flash addr (0xFFD0) SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize = 0x000B # -SET gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvOffset = 0x003A # Flash addr (0xFFDC) +SET gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvOffset = 0x0039 # Flash addr (0xFFDB) SET gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize= 0x000A # -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSOffset = 0x0044 # Flash addr (0xFFE6) +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSOffset = 0x0043 # Flash addr (0xFFE5) SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSSize= 0x0006 # -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMOffset = 0x004A # Flash addr (0xFFEC) +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMOffset = 0x0049 # Flash addr (0xFFEB) SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMSize= 0x000BA000 # -SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTOffset = 0x0055A000 # Flash addr (0xFFF7A000) +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTOffset = 0x0054A000 # Flash addr (0xFFF6A000) SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTSize= 0x6000 # +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemoryOffset = 0x0055 # Flash addr (0xFFF7) +SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedPreMemorySize = 0x0001 # SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemoryOffset = 0x0056 # Flash addr (0xFFF8) SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemorySize = 0x0008 # diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf index d5ae9dce41..0a9b933e40 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf @@ -177,6 +177,10 @@ gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTBase|gMinPlatformPkgTokenSpaceGuid.P # FSP_T Section FILE = $(PLATFORM_FSP_BIN_PACKAGE)/Fsp_Rebased_T.fd
[edk2-devel] [edk2-platforms][PATCH V2 27/47] WhiskeylakeOpenBoardPkg/WhiskeylakeURvp: Add PEI_ARCH and DXE_ARCH
This change adds two new macros to OpenBoardPkg.dsc that identify the build architecture for PEI and DXE modules. The intention of this macro is to ensure that all DSC files that compose the package build (such as those included from MinPlatformPkg or an advanced feature package) build phase-specific drivers for the architecture defined by the board package. This is a macro that is required in all Minimum Platform board packages. Cc: Chasel Chiu Cc: Nate DeSimone Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc | 16 1 file changed, 16 insertions(+) diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc index 127147c734..ae3fec05ed 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.dsc @@ -15,6 +15,8 @@ DEFINE PLATFORM_BOARD_PACKAGE= WhiskeylakeOpenBoardPkg DEFINE BOARD = WhiskeylakeURvp DEFINE PROJECT = $(PLATFORM_BOARD_PACKAGE)/$(BOARD) + DEFINE PEI_ARCH = IA32 + DEFINE DXE_ARCH = X64 # # Include PCD configuration for this board. @@ -73,10 +75,14 @@ ### # Component Includes ### +# @todo: Change below line to [Components.$(PEI_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 +#is completed [Components.IA32] !include $(PLATFORM_PACKAGE)/Include/Dsc/CorePeiInclude.dsc !include $(PLATFORM_SI_PACKAGE)/SiPkgPei.dsc +# @todo: Change below line to [Components.$(DXE_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 +#is completed [Components.X64] !include $(PLATFORM_PACKAGE)/Include/Dsc/CoreDxeInclude.dsc !include $(PLATFORM_SI_PACKAGE)/SiPkgDxe.dsc @@ -260,6 +266,11 @@ TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib/SmmTestPointCheckLib.inf !endif +### +# PEI Components +### +# @todo: Change below line to [Components.$(PEI_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 +#is completed [Components.IA32] ### # Edk2 Packages @@ -330,6 +341,11 @@ !endif $(PLATFORM_BOARD_PACKAGE)/BiosInfo/BiosInfo.inf +### +# DXE Components +### +# @todo: Change below line to [Components.$(DXE_ARCH)] after https://bugzilla.tianocore.org/show_bug.cgi?id=2308 +#is completed [Components.X64] ### # Edk2 Packages -- 2.16.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51412): https://edk2.groups.io/g/devel/message/51412 Mute This Topic: https://groups.io/mt/63459061/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms][PATCH V2 23/47] Features/Intel/AdvancedFeaturePkg: Add temporary build workaround
This change adds a temporary build workaround to allow the advanced feature PCDs to be used in conditional statements in DSC files even if they are not referenced in INF files. Support to allow a FeaturePCD to be used in a conditional statement without being referenced in an INF file has been requested in the following Bugzilla item: https://bugzilla.tianocore.org/show_bug.cgi?id=2270 This change can be reverted when that Bugzilla is completed and the change is submitted to edk2. Cc: Sai Chaganty Cc: Liming Gao Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc | 2 + Features/Intel/AdvancedFeaturePkg/TemporaryBuildWorkaround/TemporaryBuildWorkaround.dsc | 74 Features/Intel/AdvancedFeaturePkg/TemporaryBuildWorkaround/TemporaryBuildWorkaround.inf | 57 +++ Features/Intel/AdvancedFeaturePkg/TemporaryBuildWorkaround/TemporaryBuildWorkaround.c | 31 4 files changed, 164 insertions(+) diff --git a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc index 50c0e81048..23e7c6474a 100644 --- a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc +++ b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc @@ -30,6 +30,8 @@ PEI_ARCH= IA32 DXE_ARCH= X64 +!include AdvancedFeaturePkg/TemporaryBuildWorkaround/TemporaryBuildWorkaround.dsc + # # Advanced Feature Enable section - all advanced features are enabling for the diff --git a/Features/Intel/AdvancedFeaturePkg/TemporaryBuildWorkaround/TemporaryBuildWorkaround.dsc b/Features/Intel/AdvancedFeaturePkg/TemporaryBuildWorkaround/TemporaryBuildWorkaround.dsc new file mode 100644 index 00..227ae00908 --- /dev/null +++ b/Features/Intel/AdvancedFeaturePkg/TemporaryBuildWorkaround/TemporaryBuildWorkaround.dsc @@ -0,0 +1,74 @@ +## @file +# Build description file for a temporary build workaround. +# +# The feature enable PCD for advanced features must be referenced in an INF +# to be referenced in DSC/FDF files. This DSC only exists in the build to +# allow the PCDs to be referenced. This workaround does not affect the final +# flash image or boot in any way. +# +# The request to update BaseTools to allow a PCD to be referenced in DSC/FDF +# files without requiring the PCD to be referenced in an INF file is tracked +# here: https://bugzilla.tianocore.org/show_bug.cgi?id=2270 +# +# When the BaseTools update is complete, this file can entirely be removed +# from this package. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +# +# BEGIN:Temporary Build Workaround (resolution: https://bugzilla.tianocore.org/show_bug.cgi?id=2270) +# + +# THIS FILE IS TEMPORARY. PLEASE TRY TO LOOK PAST THE "HACKS" ASSOCIATED WITH IT. +# +# With the BaseTools change requested, the changes needed to move to the end state are simply: +# 1. Remove the !include for this file in AdvancedFeatures.dsc +# 2. Remove this directory + +!if $(PLATFORM_NAME) != AdvancedFeaturePkg +# +# AdvancedFeaturePkg initializes all FeaturePCDs to TRUE so they can conveniently be built in one package. +# Board packages will normally only enable (and therefore reference) a small subset of advanced features +# relative to the board. If an INF does not reference a package DEC file (which will be the case if the +# feature is not enabled) then the DSC must set ("define") the PCD for the conditional statements based +# on the PCD to work. +# +# AdvancedFeaturePkg has no problem as it naturally has a need to set al PCDs to TRUE for build. +# The section below sets all PCDs to FALSE in the DSC file so if the feature is not enabled by a board, +# the build will still be successful. +# +[PcdsFeatureFlag] + gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable |FALSE + gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable |FALSE + gNetworkFeaturePkgTokenSpaceGuid.PcdNetworkFeatureEnable |FALSE + gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable |FALSE + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable |FALSE + gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable |FALSE + gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable |FALSE +!endif + +# +# The LibraryClasses required to build TemporaryBuildWorkaround.inf +# (mostly libraries requiring other libraries) +# +[LibraryClasses] + BaseLib|MdePkg/Library/BaseLib/BaseLib.inf + BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf +
[edk2-devel] [edk2-platforms][PATCH V2 21/47] Features/Intel/NetworkFeaturePkg: Add initial package
Adds a new feature package for the Network feature. The Network feature code is actually in edk2/NetworkPkg at this time so this package inclues the content from edk2/NetworkPkg. In the future, it is preferred to move the source code from NetworkPkg to NetworkFeaturePkg. Cc: Sai Chaganty Cc: Liming Gao Signed-off-by: Michael Kubacki --- Features/Intel/Network/NetworkFeaturePkg/NetworkFeaturePkg.dec | 30 Features/Intel/Network/NetworkFeaturePkg/Include/NetworkFeature.dsc | 152 Features/Intel/Network/NetworkFeaturePkg/NetworkFeaturePkg.dsc | 30 Features/Intel/Network/NetworkFeaturePkg/Include/PostMemory.fdf | 10 ++ Features/Intel/Network/NetworkFeaturePkg/Include/PreMemory.fdf | 8 ++ Features/Intel/Network/NetworkFeaturePkg/Readme.md | 100 + 6 files changed, 330 insertions(+) diff --git a/Features/Intel/Network/NetworkFeaturePkg/NetworkFeaturePkg.dec b/Features/Intel/Network/NetworkFeaturePkg/NetworkFeaturePkg.dec new file mode 100644 index 00..670b76e52f --- /dev/null +++ b/Features/Intel/Network/NetworkFeaturePkg/NetworkFeaturePkg.dec @@ -0,0 +1,30 @@ +## @file +# This package provides advanced feature functionality for Network support. +# This package should only depend on EDK II Core packages, IntelSiliconPkg, and MinPlatformPkg. +# +# The DEC files are used by the utilities that parse DSC and +# INF files to generate AutoGen.c and AutoGen.h files +# for the build infrastructure. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + DEC_SPECIFICATION = 0x00010017 + PACKAGE_NAME = NetworkFeaturePkg + PACKAGE_GUID = CA1BF91C-8B5E-40C2-9C4C-DD250D2170A9 + PACKAGE_VERSION = 0.1 + +[Includes] + Include + +[LibraryClasses] + +[Guids] + gNetworkFeaturePkgTokenSpaceGuid = {0x990904ed, 0xb62a, 0x4b46, {0xa2, 0x9d, 0xe4, 0x09, 0xa6, 0x7f, 0x54, 0x68}} + +[PcdsFeatureFlag] + gNetworkFeaturePkgTokenSpaceGuid.PcdNetworkFeatureEnable|FALSE|BOOLEAN|0xA001 diff --git a/Features/Intel/Network/NetworkFeaturePkg/Include/NetworkFeature.dsc b/Features/Intel/Network/NetworkFeaturePkg/Include/NetworkFeature.dsc new file mode 100644 index 00..c59c21ee6c --- /dev/null +++ b/Features/Intel/Network/NetworkFeaturePkg/Include/NetworkFeature.dsc @@ -0,0 +1,152 @@ +## @file +# This is a build description file for the Network advanced feature. +# This file should be included into another package DSC file to build this feature. +# +# The DEC files are used by the utilities that parse DSC and +# INF files to generate AutoGen.c and AutoGen.h files +# for the build infrastructure. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + + +# +# Defines Section - statements that will be processed to create a Makefile. +# + +[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 + + !include NetworkPkg/NetworkDefines.dsc.inc + + +# +# PCD Section - list of EDK II PCD Entries modified by the feature. +# + +[PcdsFixedAtBuild] + !include NetworkPkg/NetworkPcds.dsc.inc + + +# +# Library Class section - list of all Library Classes needed by this feature. +# + +[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 +
[edk2-devel] [edk2-platforms][PATCH V2 15/47] Features/Intel/IpmiFeaturePkg: Add modules
This change adds the modules for the IPMI feature to IpmiFeaturePkg. Cc: Sai Chaganty Cc: Liming Gao Signed-off-by: Michael Kubacki --- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec | 8 + Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc | 78 +- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dsc | 2 + Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf | 8 + Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PreMemory.fdf | 3 + Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf | 47 Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcElog/BmcElog.inf | 33 +++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbDxe.inf | 37 +++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.inf | 37 +++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFru/IpmiFru.inf | 35 +++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf | 34 +++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/PeiIpmiInit.inf | 32 +++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/OsWdt/OsWdt.inf | 33 +++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/SolStatus/SolStatus.inf | 37 +++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcAcpi.c | 257 Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcElog/BmcElog.c | 236 ++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbDxe.c | 236 ++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.c | 84 +++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFru/IpmiFru.c | 67 + Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpmiInit.c | 150 Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiInit/PeiIpmiInit.c | 96 Features/Intel/OutOfBandManagement/IpmiFeaturePkg/OsWdt/OsWdt.c | 112 + Features/Intel/OutOfBandManagement/IpmiFeaturePkg/SolStatus/SolStatus.c | 164 + Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcSsdt/BmcSsdt.asl | 28 +++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcSsdt/IpmiOprRegions.asi | 58 + 25 files changed, 1909 insertions(+), 3 deletions(-) diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec index 4c43fc5f49..1426496d28 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec @@ -36,3 +36,11 @@ [PcdsFeatureFlag] gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable|FALSE|BOOLEAN|0xA001 + +[PcdsFixedAtBuild] + gIpmiFeaturePkgTokenSpaceGuid.PcdMaxSOLChannels|3|UINT8|0xF001 + +[PcdsDynamic, PcdsDynamicEx] + gIpmiFeaturePkgTokenSpaceGuid.PcdFRB2EnabledFlag|TRUE|BOOLEAN|0xD001 + gIpmiFeaturePkgTokenSpaceGuid.PcdFRBTimeoutValue|360|UINT16|0xD002 + gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiIoBaseAddress|0xCA2|UINT16|0xD003 diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc index c6a385108b..a82f18a68c 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc @@ -18,6 +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 # @@ -32,6 +38,36 @@ BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf IpmiLib|MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf + PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf + TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf + + # + # IPMI Feature Package + # + IpmiCommandLib|OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLib.inf + +[LibraryClasses.common.PEI_CORE,LibraryClasses.common.PEIM] + ### + # Edk2 Packages +
[edk2-devel] [edk2-platforms][PATCH V2 14/47] Features/Intel/IpmiFeaturePkg: Add libraries
This change adds the libraries required for the IPMI feature to IpmiFeaturePkg. Cc: Sai Chaganty Cc: Liming Gao Signed-off-by: Michael Kubacki --- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec | 9 + Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc | 72 + Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dsc | 5 + Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLib.inf | 32 +++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.inf | 26 ++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Library/IpmiCommandLib.h | 235 + Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Library/IpmiPlatformHookLib.h | 23 ++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLibNetFnApp.c | 248 ++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLibNetFnChassis.c | 101 +++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLibNetFnStorage.c | 275 Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLibNetFnTransport.c | 81 ++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.c | 36 +++ 12 files changed, 1143 insertions(+) diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec index dfae88..4c43fc5f49 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec @@ -22,6 +22,15 @@ [Includes] Include +[LibraryClasses] + ## @libraryclass Provides services to send IPMI commands. + # + IpmiCommandLib|Include/Library/IpmiCommandLib.inf + + ## @libraryclass Provides an API for platform-specific IPMI hooks. + # + IpmiCommandLib|Include/Library/IpmiPlatformHookLib.h + [Guids] gIpmiFeaturePkgTokenSpaceGuid = {0xc05283f6, 0xd6a8, 0x48f3, {0x9b, 0x59, 0xfb, 0xca, 0x71, 0x32, 0x0f, 0x12}} diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc new file mode 100644 index 00..c6a385108b --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc @@ -0,0 +1,72 @@ +## @file +# This is a build description file for the Intelligent Platform Management Interface (IPMI) advanced feature. +# This file should be included into another package DSC file to build this feature. +# +# The DEC files are used by the utilities that parse DSC and +# INF files to generate AutoGen.c and AutoGen.h files +# for the build infrastructure. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + + +# +# Defines Section - statements that will be processed to create a Makefile. +# + +[Defines] + + +# +# Library Class section - list of all Library Classes needed by this feature. +# + +[LibraryClasses] + ### + # Edk2 Packages + ### + BaseLib|MdePkg/Library/BaseLib/BaseLib.inf + BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf + IpmiLib|MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf + + +# +# Component section - list of all components that need built for this feature. +# +# Note: The EDK II DSC file is not used to specify how compiled binary images get placed +# into firmware volume images. This section is just a list of modules to compile from +# source into UEFI-compliant binaries. +# It is the FDF file that contains information on combining binary files into firmware +# volume images, whose concept is beyond UEFI and is described in PI specification. +# There may also be modules listed in this section that are not required in the FDF file, +# When a module listed here is excluded from FDF file, then UEFI-compliant binary will be +#
[edk2-devel] [edk2-platforms][PATCH V2 06/47] Features/Intel/OutOfBandManagement: Add Readme.md
Adds the Readme.md file to briefly explain the types of features supported in the OutOfBandManagement feature domain directory. Cc: Sai Chaganty Cc: Liming Gao Signed-off-by: Michael Kubacki --- Features/Intel/OutOfBandManagement/Readme.md | 8 1 file changed, 8 insertions(+) diff --git a/Features/Intel/OutOfBandManagement/Readme.md b/Features/Intel/OutOfBandManagement/Readme.md new file mode 100644 index 00..dc526029a7 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/Readme.md @@ -0,0 +1,8 @@ +# **EDK II Minimum Platform Firmware Out-of-Band Management Advanced Features** + +This feature domain directory contains out-of-band management related advanced features. + +Features may be added to this domain whose primary role and responsibility is related to out-of-band management. These +are features that typically interface with an external controller to enable system maintenance operations such as +monitoring, logging, and recovery control functions independent of the main processors, host CPU firmware (BIOS), and +host operating system. An out-of-band controller is usually available when the system is in a powered down state. -- 2.16.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51391): https://edk2.groups.io/g/devel/message/51391 Mute This Topic: https://groups.io/mt/63456833/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms][PATCH V2 22/47] Features/Intel/AdvancedFeaturePkg: Add package
This change adds AdvancedFeaturePkg to the Features/Intel directory. AdvancedFeaturePkg is a special package that is located at the root level of Features/Intel. All advanced features can be built using the AdvancedFeaturePkg build. To build all advanced features, follow the instructions in the Feature/Intel/Readme.md file. The actual build is performed by executing the following command in the Features/Intel directory: "build -p AdvancedFeaturePkg/AdvancedFeaturePkg.dsc -a IA32 -a X64" Cc: Sai Chaganty Cc: Liming Gao Signed-off-by: Michael Kubacki --- Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dec | 31 +++ Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc | 51 ++ Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc | 56 3 files changed, 138 insertions(+) diff --git a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dec b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dec new file mode 100644 index 00..797a1eeb98 --- /dev/null +++ b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dec @@ -0,0 +1,31 @@ +## @file +# Advanced Feature Package build declaration file. +# +# Advanced features allow a board package to be extended with advanced functionality. +# +# This package should not contain any specific advanced features. The package has two responsibilities: +# 1. Present a consolidated and simplified view of all available advanced features to board packages. +# 2. Provide a simple, single package build for all available advanced features. +# +# The DEC files are used by the utilities that parse DSC and +# INF files to generate AutoGen.c and AutoGen.h files +# for the build infrastructure. +# +# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## +[Defines] +DEC_SPECIFICATION = 0x00010017 +PACKAGE_NAME = AdvancedFeaturePkg +PACKAGE_VERSION = 0.1 +PACKAGE_GUID = 086F1F68-76CD-4F40-A712-06939A0BDD12 + +[Includes] +Include + +[Guids] +gAdvancedFeaturePkgTokenSpaceGuid = {0xa8514688, 0x6693, 0x4ab5, {0xaa, 0xc8, 0xcc, 0xa9, 0x8d, 0xde, 0x90, 0xe1}} + +[PcdsFeatureFlag] diff --git a/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc new file mode 100644 index 00..50c0e81048 --- /dev/null +++ b/Features/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc @@ -0,0 +1,51 @@ +## @file +# Advanced Feature Package build description file. +# +# Advanced features allow a board package to be extended with advanced functionality. +# +# This package should not contain any specific advanced features. The package has two responsibilities: +# 1. Present a consolidated and simplified view of all available advanced features to board packages. +# 2. Provide a simple, single package build for all available advanced features. +# +# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + + +# +# Defines Section - statements that will be processed to create a Makefile. +# + +[Defines] + PLATFORM_NAME = AdvancedFeaturePkg + PLATFORM_GUID = 5E4C05BC-C5F0-4843-BAE1-3AAFE269DB8F + PLATFORM_VERSION= 0.1 + DSC_SPECIFICATION = 0x00010005 + OUTPUT_DIRECTORY= Build/AdvancedFeaturePkg + SUPPORTED_ARCHITECTURES = IA32|X64 + BUILD_TARGETS = DEBUG|RELEASE + SKUID_IDENTIFIER= DEFAULT + PEI_ARCH= IA32 + DXE_ARCH= X64 + + +# +# Advanced Feature Enable section - all advanced features are enabling for the +# AdvancedFeaturePkg build. +# + +[PcdsFeatureFlag] + gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable|TRUE + gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable |TRUE + gNetworkFeaturePkgTokenSpaceGuid.PcdNetworkFeatureEnable|TRUE + gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable |TRUE + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable |TRUE + gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugFeatureEnable|TRUE + gUserAuthFeaturePkgTokenSpaceGuid.PcdUserAuthenticationFeatureEnable|TRUE + +# +# This package builds all advanced features. +# +!include Include/AdvancedFeatures.dsc diff --git a/Features/Intel/AdvancedFeaturePkg/Include/AdvancedFeatures.dsc
[edk2-devel] [edk2-platforms][PATCH V2 17/47] Features/Intel/SmbiosFeaturePkg: Update default strings
Updates the PCD string default values so they are generic. The PCDs should be customized by the package that uses the feature. Cc: Sai Chaganty Cc: Liming Gao Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec | 30 ++-- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec index c06a87aad0..6170f37969 100644 --- a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec +++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec @@ -138,35 +138,35 @@ # # SMBIOS Type 0 BIOS Information Strings # - gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0StringBiosReleaseDate|"2008-12-23"|VOID*|0xD101 - gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0StringBiosVersion|"PURLEY CV/CRB BIOS Internal"|VOID*|0xD102 - gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0StringVendor|"Intel Corporation"|VOID*|0xD103 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0StringBiosReleaseDate|"01/01/2019"|VOID*|0xD101 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0StringBiosVersion|"1.0"|VOID*|0xD102 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0StringVendor|"BIOS Vendor"|VOID*|0xD103 # # SMBIOS Type 1 System Information Strings # - gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringFamily|"Family"|VOID*|0xD104 - gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringManufacturer|"Intel Corporation"|VOID*|0xD105 - gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringProductName|"PURLEY"|VOID*|0xD106 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringFamily|"System Family"|VOID*|0xD104 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringManufacturer|"System Manufacturer"|VOID*|0xD105 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringProductName|"System Product Name"|VOID*|0xD106 gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringSerialNumber|"UNKNOWN"|VOID*|0xD107 - gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringSKUNumber|"SKU Number"|VOID*|0xD108 - gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringVersion|"1.0"|VOID*|0xD109 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringSKUNumber|"System SKU Number"|VOID*|0xD108 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringVersion|"System Version"|VOID*|0xD109 # # SMBIOS Type 2 Base Board Information Strings # gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringAssetTag|"Base Board Asset Tag"|VOID*|0xD10A gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringLocationInChassis|"Part Component"|VOID*|0xD10B - gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringManufacturer|"Intel Corporation"|VOID*|0xD10C - gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringProductName|"PURLEY"|VOID*|0xD10D - gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringSerialNumber|"SPRO03200016"|VOID*|0xD10E - gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringVersion|"E63448-400"|VOID*|0xD10F + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringManufacturer|"Base Board Manufacturer"|VOID*|0xD10C + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringProductName|"Base Board Product Name"|VOID*|0xD10D + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringSerialNumber|"UNKNOWN"|VOID*|0xD10E + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringVersion|"Base Board Version"|VOID*|0xD10F # # SMBIOS Type 3 System Enclosure Chassis Strings # gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3StringAssetTag|"Chassis Asset Tag"|VOID*|0xD111 - gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3StringManufacturer|"Intel Corporation"|VOID*|0xD112 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3StringManufacturer|"Chassis Manufacturer"|VOID*|0xD112 gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3StringSerialNumber|"UNKNOWN"|VOID*|0xD113 - gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3StringSKUNumber|"SKU Number"|VOID*|0xD114 - gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3StringVersion|"0.1"|VOID*|0xD115 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3StringSKUNumber|"Chassis SKU Number"|VOID*|0xD114 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3StringVersion|"Chassis Version"|VOID*|0xD115 -- 2.16.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51402): https://edk2.groups.io/g/devel/message/51402 Mute This Topic: https://groups.io/mt/63457892/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms][PATCH V2 10/47] Features/Intel/Network: Add Readme.md
Adds the Readme.md file to briefly explain the types of features supported in the Network feature domain directory. Cc: Sai Chaganty Cc: Liming Gao Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Features/Intel/Network/Readme.md | 5 + 1 file changed, 5 insertions(+) diff --git a/Features/Intel/Network/Readme.md b/Features/Intel/Network/Readme.md new file mode 100644 index 00..780a1264ac --- /dev/null +++ b/Features/Intel/Network/Readme.md @@ -0,0 +1,5 @@ +# **EDK II Minimum Platform Firmware Network Features** + +This feature domain directory contains network related advanced features. + +Features may be added to this domain whose primary role and responsibility is related to network technologies. -- 2.16.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51395): https://edk2.groups.io/g/devel/message/51395 Mute This Topic: https://groups.io/mt/63457306/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms][PATCH V2 16/47] Features/Intel/SmbiosFeaturePkg: Add initial package
Adds a new feature package for the SMBIOS feature. Cc: Sai Chaganty Cc: Liming Gao Signed-off-by: Michael Kubacki --- Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec | 172 Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeature.dsc | 115 + Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dsc | 30 Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf | 10 ++ Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PreMemory.fdf | 8 + Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf | 83 ++ Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasic.h | 45 + Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicEntryPoint.c | 125 ++ Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/Type0BiosVendorFunction.c | 81 + Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/Type1SystemManufacturerFunction.c | 114 + Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/Type2BaseBoardManufacturerFunction.c | 131 +++ Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/Type32BootInformationFunction.c | 56 +++ Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/Type3ChassisManufacturerFunction.c | 125 ++ Features/Intel/SystemInformation/SmbiosFeaturePkg/Readme.md | 96 +++ 14 files changed, 1191 insertions(+) diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec new file mode 100644 index 00..c06a87aad0 --- /dev/null +++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec @@ -0,0 +1,172 @@ +## @file +# This package provides advanced feature functionality for System Management BIOS (SMBIOS). +# This package should only depend on EDK II Core packages, IntelSiliconPkg, and MinPlatformPkg. +# +# The DEC files are used by the utilities that parse DSC and +# INF files to generate AutoGen.c and AutoGen.h files +# for the build infrastructure. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + DEC_SPECIFICATION = 0x00010017 + PACKAGE_NAME = SmbiosFeaturePkg + PACKAGE_GUID = 8CCEE569-02AD-4844-8725-F4C7966E320A + PACKAGE_VERSION = 0.1 + +[Includes] + Include + +[LibraryClasses] + +[Guids] + gSmbiosFeaturePkgTokenSpaceGuid = {0xc1530658, 0xe234, 0x4c13, {0xb6, 0x82, 0xd3, 0x87, 0x84, 0xf1, 0xd7, 0x16}} + +[PcdsFeatureFlag] + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable|FALSE|BOOLEAN|0xA001 + +[PcdsDynamic, PcdsDynamicEx] + # + # SMBIOS Type 0 BIOS Information + # + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation|{0x0}|SMBIOS_TABLE_TYPE0|0xD001 { + + IndustryStandard/SmBios.h + + MdePkg/MdePkg.dec + SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec + } + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.Vendor|0x1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosVersion|0x2 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosSegment|0xF000 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosReleaseDate|0x3 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosSize|0xFF + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosCharacteristics.PciIsSupported|1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosCharacteristics.PlugAndPlayIsSupported|1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosCharacteristics.BiosIsUpgradable|1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosCharacteristics.BiosShadowingAllowed|1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosCharacteristics.BootFromCdIsSupported|1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosCharacteristics.SelectableBootIsSupported|1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosCharacteristics.EDDSpecificationIsSupported|1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosCharacteristics.Floppy525_12IsSupported|1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosCharacteristics.Floppy35_720IsSupported|1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosCharacteristics.Floppy35_288IsSupported|1 +
[edk2-devel] [edk2-platforms][PATCH V2 12/47] Features/Intel/S3FeaturePkg: Add initial package
Adds a new feature package for the S3 feature. Cc: Sai Chaganty Cc: Liming Gao Signed-off-by: Michael Kubacki --- Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dec | 30 + Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc | 122 Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dsc | 30 + Features/Intel/PowerManagement/S3FeaturePkg/Include/PostMemory.fdf | 8 ++ Features/Intel/PowerManagement/S3FeaturePkg/Include/PreMemory.fdf | 10 ++ Features/Intel/PowerManagement/S3FeaturePkg/S3Pei/S3Pei.inf| 35 ++ Features/Intel/PowerManagement/S3FeaturePkg/S3Pei/S3Pei.c | 36 ++ Features/Intel/PowerManagement/S3FeaturePkg/Readme.md | 94 +++ 8 files changed, 365 insertions(+) diff --git a/Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dec b/Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dec new file mode 100644 index 00..2a723ad3d6 --- /dev/null +++ b/Features/Intel/PowerManagement/S3FeaturePkg/S3FeaturePkg.dec @@ -0,0 +1,30 @@ +## @file +# This package provides advanced feature functionality for S3 support. +# This package should only depend on EDK II Core packages, IntelSiliconPkg, and MinPlatformPkg. +# +# The DEC files are used by the utilities that parse DSC and +# INF files to generate AutoGen.c and AutoGen.h files +# for the build infrastructure. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + DEC_SPECIFICATION = 0x00010017 + PACKAGE_NAME = S3FeaturePkg + PACKAGE_GUID = 600F7249-65BD-44E2-80D7-344BD5250198 + PACKAGE_VERSION = 0.1 + +[Includes] + Include + +[LibraryClasses] + +[Guids] + gS3FeaturePkgTokenSpaceGuid = {0x423c5a51, 0x36e9, 0x4aea, {0x92, 0xdd, 0xdd, 0xae, 0x5b, 0x4a, 0x3d, 0x24}} + +[PcdsFeatureFlag] + gS3FeaturePkgTokenSpaceGuid.PcdS3FeatureEnable|FALSE|BOOLEAN|0xA001 diff --git a/Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc b/Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc new file mode 100644 index 00..647dc3f93a --- /dev/null +++ b/Features/Intel/PowerManagement/S3FeaturePkg/Include/S3Feature.dsc @@ -0,0 +1,122 @@ +## @file +# This is a build description file for the S3 advanced feature. +# This file should be included into another package DSC file to build this feature. +# +# The DEC files are used by the utilities that parse DSC and +# INF files to generate AutoGen.c and AutoGen.h files +# for the build infrastructure. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + + +# +# Defines Section - statements that will be processed to create a Makefile. +# + +[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 + + +# +# Library Class section - list of all Library Classes needed by this feature. +# + +[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 + ### + SmmAccessLib|IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLib/PeiSmmAccessLib.inf + + +# +# Component section - list of all components that need built for this feature. +# +# Note:
[edk2-devel] [edk2-platforms][PATCH V2 18/47] Features/Intel/AcpiDebugFeaturePkg: Add initial package
Adds a new feature package for the ACPI Debug feature. Cc: Eric Dong Cc: Liming Gao Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec | 39 ++ Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dsc | 30 ++ Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc | 125 + Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/PostMemory.fdf | 11 + Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/PreMemory.fdf | 8 + Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugDxe.inf | 55 +++ Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebugSmm.inf | 58 +++ Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebug.c | 519 Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugDxeSmm/AcpiDebug.asl | 102 Features/Intel/Debugging/AcpiDebugFeaturePkg/Readme.md | 121 + 10 files changed, 1068 insertions(+) diff --git a/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec new file mode 100644 index 00..a74ee3e084 --- /dev/null +++ b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dec @@ -0,0 +1,39 @@ +## @file +# This package provides advanced feature functionality for ACPI Debug support. +# This package should only depend on EDK II Core packages, IntelSiliconPkg, and MinPlatformPkg. +# +# The DEC files are used by the utilities that parse DSC and +# INF files to generate AutoGen.c and AutoGen.h files +# for the build infrastructure. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + DEC_SPECIFICATION = 0x00010017 + PACKAGE_NAME = AcpiDebugFeaturePkg + PACKAGE_GUID = 53E3E908-5DF9-4137-ABB9-6DE162C3898F + PACKAGE_VERSION = 0.1 + +[Includes] + Include + +[LibraryClasses] + +[Guids] + gAcpiDebugFeaturePkgTokenSpaceGuid = {0xaf2582c0, 0x93fe, 0x466d, {0xb6, 0xa4, 0x4d, 0x23, 0x77, 0xf7, 0x82, 0xa7}} + +[PcdsFeatureFlag] + gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugFeatureEnable|FALSE|BOOLEAN|0xA001 + +[PcdsFixedAtBuild,PcdsPatchableInModule,PcdsDynamic,PcdsDynamicEx] + ## This PCD specifies the ACPI debug message buffer size. + gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugBufferSize|0x1|UINT32|0xF001 + +[PcdsDynamic, PcdsDynamicEx] + ## This PCD specifies ACPI debug message buffer address. + # The PCD value will be updated during boot time when the buffer is allocated. + gAcpiDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugAddress|0|UINT32|0xD001 diff --git a/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dsc b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dsc new file mode 100644 index 00..62cc559d8f --- /dev/null +++ b/Features/Intel/Debugging/AcpiDebugFeaturePkg/AcpiDebugFeaturePkg.dsc @@ -0,0 +1,30 @@ +## @file +# This package provides advanced feature functionality for ACPI Debug support. +# This package should only depend on EDK II Core packages, IntelSiliconPkg, and MinPlatformPkg. +# +# The DEC files are used by the utilities that parse DSC and +# INF files to generate AutoGen.c and AutoGen.h files +# for the build infrastructure. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + PLATFORM_NAME = AcpiDebugFeaturePkg + PLATFORM_GUID = F3001DF1-4A5B-42A9-944B-E766BDDC7B99 + PLATFORM_VERSION = 0.1 + DSC_SPECIFICATION = 0x00010005 + OUTPUT_DIRECTORY = Build/$(PLATFORM_NAME) + SUPPORTED_ARCHITECTURES= IA32|X64 + BUILD_TARGETS = DEBUG|RELEASE|NOOPT + SKUID_IDENTIFIER = DEFAULT + PEI_ARCH = IA32 + DXE_ARCH = X64 + +# +# This package always builds the feature. +# +!include Include/AcpiDebugFeature.dsc diff --git a/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc b/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc new file mode 100644 index 00..3e6b1f69c2 --- /dev/null +++ b/Features/Intel/Debugging/AcpiDebugFeaturePkg/Include/AcpiDebugFeature.dsc @@ -0,0 +1,125 @@ +## @file +# This is a build description file for the ACPI Debug advanced feature. +# This file should be included into another package DSC file to build this feature. +# +# The DEC files are used by the utilities that parse DSC and +# INF files to generate AutoGen.c and AutoGen.h files +# for the build infrastructure. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## +
[edk2-devel] [edk2-platforms][PATCH V2 13/47] Features/Intel/IpmiFeaturePkg: Add initial package
Adds a new feature package for the IPMI feature. This change updates the advanced feature package template for IPMI and adds the updated template to the IpmiFeaturePkg. Cc: Sai Chaganty Cc: Liming Gao Signed-off-by: Michael Kubacki --- Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec | 29 +++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dsc | 24 ++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf | 8 ++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PreMemory.fdf | 8 ++ Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Readme.md | 89 5 files changed, 158 insertions(+) diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec new file mode 100644 index 00..dfae88 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dec @@ -0,0 +1,29 @@ +## @file +# This package provides advanced feature functionality to enable the +# Intelligent Platform Management Interface (IPMI). +# This package should only depend on EDK II Core packages, IntelSiliconPkg, and MinPlatformPkg. +# +# The DEC files are used by the utilities that parse DSC and +# INF files to generate AutoGen.c and AutoGen.h files +# for the build infrastructure. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + DEC_SPECIFICATION = 0x00010017 + PACKAGE_NAME = IpmiFeaturePkg + PACKAGE_GUID = AE091910-F6C9-4AB5-B8B4-995E2F0D5166 + PACKAGE_VERSION = 0.1 + +[Includes] + Include + +[Guids] + gIpmiFeaturePkgTokenSpaceGuid = {0xc05283f6, 0xd6a8, 0x48f3, {0x9b, 0x59, 0xfb, 0xca, 0x71, 0x32, 0x0f, 0x12}} + +[PcdsFeatureFlag] + gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiFeatureEnable|FALSE|BOOLEAN|0xA001 diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dsc b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dsc new file mode 100644 index 00..1952ba185e --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dsc @@ -0,0 +1,24 @@ +## @file +# This package provides advanced feature functionality to enable the +# Intelligent Platform Management Interface (IPMI). +# This package should only depend on EDK II Core packages, IntelSiliconPkg, and MinPlatformPkg. +# +# The DEC files are used by the utilities that parse DSC and +# INF files to generate AutoGen.c and AutoGen.h files +# for the build infrastructure. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + PLATFORM_NAME = IpmiFeaturePkg + PLATFORM_GUID = 7B2E74D7-9538-4818-B51A-492F3D33BD20 + PLATFORM_VERSION = 0.1 + DSC_SPECIFICATION = 0x00010005 + OUTPUT_DIRECTORY = Build/$(PLATFORM_NAME) + SUPPORTED_ARCHITECTURES= IA32|X64 + BUILD_TARGETS = DEBUG|RELEASE|NOOPT + SKUID_IDENTIFIER = DEFAULT diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf new file mode 100644 index 00..c3847c54c7 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf @@ -0,0 +1,8 @@ +## @file +# FDF file for post-memory modules that enable Intelligent Platform Management Interface. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PreMemory.fdf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PreMemory.fdf new file mode 100644 index 00..0c82d7eb02 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PreMemory.fdf @@ -0,0 +1,8 @@ +## @file +# FDF file for pre-memory modules that enable Intelligent Platform Management Interface. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Readme.md b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Readme.md new file mode 100644 index 00..e70f1e850b --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Readme.md @@ -0,0 +1,89 @@ +# Overview +* **Feature Name:** Intelligent Platform Management Interface (IPMI) +* **PI Phase(s) Supported:** PEI, DXE +* **SMM Required?** No + +More Information: +* [IPMI Specification 2nd Generation v2.0](https://www.intel.com/content/dam/www/public/us/en/documents/product-briefs/ipmi-second-gen-interface-spec-v2-rev1-1.pdf) + +## Purpose +The IPMI feature provides firmware functionality that
[edk2-devel] [edk2-platforms][PATCH V2 09/47] Features/Intel/UserInterface: Add Readme.md
Adds the Readme.md file to briefly explain the types of features supported in the UserInterface feature domain directory. Cc: Sai Chaganty Cc: Liming Gao Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Features/Intel/UserInterface/Readme.md | 9 + 1 file changed, 9 insertions(+) diff --git a/Features/Intel/UserInterface/Readme.md b/Features/Intel/UserInterface/Readme.md new file mode 100644 index 00..2ef4413ade --- /dev/null +++ b/Features/Intel/UserInterface/Readme.md @@ -0,0 +1,9 @@ +# **EDK II Minimum Platform Firmware User Interface Features** + +This feature domain directory contains user interface related advanced features. + +Features may be added to this domain whose primary role and responsibility is related to user interfaces. This may +include any number of interfaces related to user interaction with the system that require firmware support. High-level +examples of common user interfaces in firmware are console support and Human Interface Infrastructure (HII). These +high-level categories may comprise multiple independent features. It is recommended to reduce individual feature scope +to the minimally required level for the feature to be functional to improve cohesion within the feature package. -- 2.16.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51394): https://edk2.groups.io/g/devel/message/51394 Mute This Topic: https://groups.io/mt/63457198/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms][PATCH V2 08/47] Features/Intel/Debugging: Add Readme.md
Adds the Readme.md file to briefly explain the types of features supported in the Debugging feature domain directory. Note that the domain directory is named "Debugging" as opposed to "Debug" to help indicate that the directory is related to features used for debugging and it is not an output directory for a Debug build target. Cc: Sai Chaganty Cc: Liming Gao Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Features/Intel/Debugging/Readme.md | 8 1 file changed, 8 insertions(+) diff --git a/Features/Intel/Debugging/Readme.md b/Features/Intel/Debugging/Readme.md new file mode 100644 index 00..98bb0b9b6c --- /dev/null +++ b/Features/Intel/Debugging/Readme.md @@ -0,0 +1,8 @@ +# **EDK II Minimum Platform Firmware Debug Advanced Features** + +This feature domain directory contains debug related advanced features. Note that the domain directory is named +"Debugging" as opposed to "Debug" to help indicate that the directory is related to features used for debugging and it +is not an output directory for a Debug build target. + +Features may be added to this domain whose primary role and responsibility is related to debug. The type of debug +technology may include hardware or software debug. -- 2.16.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51393): https://edk2.groups.io/g/devel/message/51393 Mute This Topic: https://groups.io/mt/63457066/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms][PATCH V2 11/47] TemplateFeaturePkg: Add initial package
This change adds a new package called TemplateFeaturePkg that should be used as a starting point for the creation of new advanced feature packages. TemplateFeaturePkg is not meant to be built or used directly for functionality. It simply serves as a template to be copied and modified. The advanced feature package creation process is described in detail in Features/Intel/Readme.md. Cc: Sai Chaganty Cc: Nate DeSimone Cc: Liming Gao Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Features/Intel/TemplateFeaturePkg/TemplateFeaturePkg.dec | 30 ++ Features/Intel/TemplateFeaturePkg/Include/TemplateFeature.dsc | 113 Features/Intel/TemplateFeaturePkg/TemplateFeaturePkg.dsc | 30 ++ Features/Intel/TemplateFeaturePkg/Include/PostMemory.fdf | 8 ++ Features/Intel/TemplateFeaturePkg/Include/PreMemory.fdf | 8 ++ Features/Intel/TemplateFeaturePkg/Readme.md | 71 6 files changed, 260 insertions(+) diff --git a/Features/Intel/TemplateFeaturePkg/TemplateFeaturePkg.dec b/Features/Intel/TemplateFeaturePkg/TemplateFeaturePkg.dec new file mode 100644 index 00..b37ce8f34a --- /dev/null +++ b/Features/Intel/TemplateFeaturePkg/TemplateFeaturePkg.dec @@ -0,0 +1,30 @@ +## @file +# This package provides advanced feature functionality for support. +# This package should only depend on EDK II Core packages, IntelSiliconPkg, and MinPlatformPkg. +# +# The DEC files are used by the utilities that parse DSC and +# INF files to generate AutoGen.c and AutoGen.h files +# for the build infrastructure. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + DEC_SPECIFICATION = 0x00010017 + PACKAGE_NAME = TemplateFeaturePkg + PACKAGE_GUID = ---- + PACKAGE_VERSION = 0.1 + +[Includes] + Include + +[LibraryClasses] + +[Guids] + gTemplateFeaturePkgTokenSpaceGuid = {0x, 0x, 0x, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}} + +[PcdsFeatureFlag] + gTemplateFeaturePkgTokenSpaceGuid.PcdTemplateFeatureEnable|FALSE|BOOLEAN|0xA001 diff --git a/Features/Intel/TemplateFeaturePkg/Include/TemplateFeature.dsc b/Features/Intel/TemplateFeaturePkg/Include/TemplateFeature.dsc new file mode 100644 index 00..6742eddcf9 --- /dev/null +++ b/Features/Intel/TemplateFeaturePkg/Include/TemplateFeature.dsc @@ -0,0 +1,113 @@ +## @file +# This is a build description file for the advanced feature. +# This file should be included into another package DSC file to build this feature. +# +# The DEC files are used by the utilities that parse DSC and +# INF files to generate AutoGen.c and AutoGen.h files +# for the build infrastructure. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + + +# +# Defines Section - statements that will be processed to create a Makefile. +# + +[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 + + +# +# Library Class section - list of all Library Classes needed by this feature. +# + +[LibraryClasses] + + ## Note: This comment block should be removed from the template when the + #template is used. + # + # Library classes should have a comment header that describes the type of + # package the library is used from for organization purposes. + # + # For an advanced feature, these are typically: + #* Edk2 Packages + #* Silicon Initialization Package + #* Platform Package + #* Feature Package + # + # The comment header should follow the format: + # + # ### + # # Edk2 Packages + # ### + + +# +# Component section - list of all components that need built for this feature. +# +# Note: The EDK II DSC file is not used to specify how compiled binary images get placed +# into firmware volume images. This section is just a list of modules to compile from +# source into UEFI-compliant binaries. +# It is the FDF file that contains information on combining binary files into firmware +# volume images, whose concept is beyond UEFI and is described in PI specification. +# There may also be modules listed in this section that are not required in the FDF file, +# When a module listed here is excluded from FDF file, then
[edk2-devel] [edk2-platforms][PATCH V2 07/47] Features/Intel/SystemInformation: Add Readme.md
Adds the Readme.md file to briefly explain the types of features supported in the SystemInformation feature domain directory. Cc: Sai Chaganty Cc: Liming Gao Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Features/Intel/SystemInformation/Readme.md | 8 1 file changed, 8 insertions(+) diff --git a/Features/Intel/SystemInformation/Readme.md b/Features/Intel/SystemInformation/Readme.md new file mode 100644 index 00..cdf061d08d --- /dev/null +++ b/Features/Intel/SystemInformation/Readme.md @@ -0,0 +1,8 @@ +# **EDK II Minimum Platform Firmware System Information Advanced Features** + +This feature domain directory contains advanced features that produce system information. + +Features may be added to this domain whose primary role and responsibility is related to producing structures for +system information. The system information structures supported should be standardized in a public document such as +an industry standard specification or white paper. The feature documentation must be referenced in the `Readme.md` +file in the feature package. -- 2.16.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51392): https://edk2.groups.io/g/devel/message/51392 Mute This Topic: https://groups.io/mt/63456953/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms][PATCH V2 04/47] Features/Intel: Add Readme.md
This change adds the initial Readme.md to the root of the Features/ Intel directory. The features are maintained in an Intel directory because they are not tested on other systems. If there is interest to support a feature on systems other than Intel, the feature should be tested on those other systems and the feature can be promoted above the Intel directory. This Readme.md is the most important file in the Features/Intel tree as it provides the desired attributes and definition of advanced features, the advanced feature source layout, and the new feature creation checklist. This is the primary documentation file for new users to understand advanced features. Cc: Dandan Bi Cc: Sai Chaganty Cc: Chasel Chiu Cc: Wei David Y Cc: Nate DeSimone Cc: Eric Dong Cc: Liming Gao Cc: Agyeman Prince Signed-off-by: Michael Kubacki --- Features/Intel/Readme.md | 236 1 file changed, 236 insertions(+) diff --git a/Features/Intel/Readme.md b/Features/Intel/Readme.md new file mode 100644 index 00..9729f90a41 --- /dev/null +++ b/Features/Intel/Readme.md @@ -0,0 +1,236 @@ +# **EDK II Minimum Platform Firmware Advanced Features for Intel Platforms** + +In the EDK II Minimum Platform, advanced features are non-essential features. Essential features are those required +to achieve an earlier boot stage (Stage I through Stage V). The Minimum Platform boot stages are defined in the +[EDK II Minimum Platform Draft Specification](https://edk2-docs.gitbooks.io/edk-ii-minimum-platform-specification/). A +brief overview is also provided in the [Platform/Intel/Readme.md](https://github.com/tianocore/edk2-platforms/blob/master/Platform/Intel/Readme.md). + +An advanced feature must be implemented as highly cohesive and stand-alone software to only support a specific +feature. Advanced features are the primary method to extend platform firmware capabilities in a modular fashion. + +If you would like to quickly get started creating a new advanced feature, you can jump ahead to the +[Add New Advanced Feature Checklist](#Add-New-Advanced-Feature-Checklist) and reference other sections of this +document as needed. + +## Overview + +### Advanced Feature Attributes +Advanced features should be: +* _Cohesive_, the feature should not contain any functionality unrelated to the feature. +* _Complete_, the feature must have a complete design that minimizes dependencies. A feature package cannot directly + depend on another feature package. +* _Easy to Integrate_, the feature should expose well-defined software interfaces to use and configure the feature. + * It should also present a set of simple and well-documented standard EDK II configuration options such as PCDs to + configure the feature. + * In general, features should be self-contained and started by the dispatcher. The board firmware should +be required to perform as few steps as possible to enable the feature. + * All features are required to have a feature enable PCD (`PcdFeatureEnable`). Any effort to enable the feature +besides this PCD should be carefully considered. Default configuration values should apply to the common case. +* _Portable_, the feature is not allowed to depend on other advanced feature or board source code packages. For example, + if Feature A depends on output Feature B, a board integration module should use a generic interface in Feature A + to get the output and pass it to a generic interface in Feature B. Structures should not be shared between feature + packages. Most structures should be defined in a common package such as MdePkg if the structure is industry standard, + IntelSiliconPkg if the structure is specific to Intel silicon initialization, etc. Feature-specific structures are + of course allowed to be defined within a feature package and used by libraries and modules in that package. +* _Self Documenting_, the feature should follow software best practices to allow others to debug the code and + contribute changes. In addition to source code, advanced features must have a Readme.md with sufficient + information for a newcomer to understand the feature. +* _Single Instance_, the feature should not have more than one instance of a source solution. If an existing feature + package does not solve a specific instance of a problem for the feature, the feature package should be re-worked + to consider new requirements instead of duplicating feature code. + + Features should be written for a specific feature technology. Outside of technology restrictions, the feature + should not make arbitrary assumptions about the type of board or system that may integrate the feature. Any + board or hardware-specific details that may vary in design should be given to the feature through a defined + and documented software interface. + +### Advanced Feature Packages +Feature portability is a key aspect of board scalability. To maintain high cohesion within a feature package and
[edk2-devel] [edk2-platforms][PATCH V2 02/47] DebugFeaturePkg: Package DSC style cleanup
This change refactors DebugFeaturePkg.dsc to consolidate redundant sections and better group file content to improve maintainability and readability. This pattern is being applied in all Minimum Platform package DSC files. Cc: Eric Dong Cc: Liming Gao Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc | 55 +--- 1 file changed, 37 insertions(+), 18 deletions(-) diff --git a/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc b/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc index 8e5ff4c9a3..efe705bd76 100644 --- a/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc +++ b/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc @@ -1,6 +1,6 @@ ## @file # This package provides the modules that build for debug feature. -# This DebugFeaturePkg should only depend on EDKII Core packages and MinPlatformPkg. +# This package should only depend on EDKII Core packages and MinPlatformPkg. # # The DEC files are used by the utilities that parse DSC and # INF files to generate AutoGen.c and AutoGen.h files @@ -23,46 +23,58 @@ SKUID_IDENTIFIER = DEFAULT [LibraryClasses] - # - # Entry point - # - UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf + ### + # Edk2 Packages + ### BaseLib|MdePkg/Library/BaseLib/BaseLib.inf BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf - PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf + DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf - UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf + PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf - DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf - DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf - DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf + UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf + UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf UefiLib|MdePkg/Library/UefiLib/UefiLib.inf UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf [LibraryClasses.common.PEIM] + ### + # Edk2 Packages + ### HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf - #Usb3DebugPortLib|DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibPeiIoMmu.inf - -[LibraryClasses.IA32.PEIM, LibraryClasses.X64.PEIM] PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf [LibraryClasses.common.DXE_DRIVER] + ### + # Edk2 Packages + ### HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf [LibraryClasses.common.UEFI_DRIVER] + ### + # Edk2 Packages + ### HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf [LibraryClasses.common.DXE_RUNTIME_DRIVER] + ### + # Edk2 Packages + ### HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf [LibraryClasses.common.DXE_SMM_DRIVER] + ### + # Edk2 Packages + ### HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf @@ -87,13 +99,20 @@ ### [Components] - DebugFeaturePkg/Library/Usb3DebugPortParameterLibPcd/Usb3DebugPortParameterLibPcd.inf - DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibNull.inf - DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibPeiIoMmu.inf +
[edk2-devel] [edk2-platforms][PATCH V2 00/47] Intel Advanced Feature Refactor
RFC:https://edk2.groups.io/g/devel/message/49880 V2 Changes: 1. Reordered the patch series to the following high-level order: 1. Clean up existing advanced feature DSC files 2. Add new Readme.md files 3. Add new advanced feature packages in Features/Intel 4. Make changes in board packages in Platform/Intel to use the new features 5. Enable the advanced features in the board packages in Platform/Intel 6. Remove the original set of advanced features in Platform/Intel 7. Update Maintainers.txt for the changes This is done to allow closed source platforms to switch their advanced features from the set in Platform/Intel to Features/Intel after line #3 and before line #6. 2. [edk2-platforms][PATCH V1 28/49] Features/Intel/NetworkFeaturePkg: Add initial package 1. Filled in the "Purpose" section of the feature Readme.md. 3. [edk2-platforms][PATCH V1 27/49] Features/Intel/UserAuthFeaturePkg: Add initial package 1. Filled in the "Purpose" section of the feature Readme.md. 4. [edk2-platforms][PATCH V1 25/49] Features/Intel/Usb3DebugFeaturePkg: Add initial package 1. Filled in the "Purpose" section of the feature Readme.md. 5. [edk2-platforms][PATCH V1 22/49] DebugFeaturePkg: Remove the ACPI Debug feature 1. Filled in the "Purpose" section of the feature Readme.md. 6. [edk2-platforms][PATCH V1 20/49] Features/Intel/SmbiosFeaturePkg: Add initial package 1. Filled in the "Purpose" section of the feature Readme.md. 2. Updated copyright years. 7. [edk2-platforms][PATCH V1 18/49] Features/Intel/IpmiFeaturePkg: Add modules 1. Updated copyright years. 8. [edk2-platforms][PATCH V1 16/49] Features/Intel/IpmiFeaturePkg: Add initial package 1. Filled in the "Purpose" section of the feature Readme.md. 9. [edk2-platforms][PATCH V1 14/49] Features/Intel: Add S3FeaturePkg 1. Filled in the "Purpose" section of the feature Readme.md. 10. [edk2-platforms][PATCH V1 04/49] Features/Intel: Add Readme.md 1. Added a Linux example for setting the PACKAGES_PATH value in Features/Intel/Readme.md This patch series introduces a consistent design for Intel advanced features. Advanced features in this context refer to the definition stated in the EDK II Minimum Platform specification. Information regarding this feature design is provided in Features/Intel/Readme.md. An RFC was sent to the mailing list on 11/1/2019 that stated the intention of creating the Features directory in edk2-platforms for this purpose and that change is implemented in this patch series. Testing performed: * Feature packages and board packages build successfully * Board packages boot successfully to their supported OS * Board package Stage 4 and Stage 6 tested The actual feature source implementation that previously existed was not functionally modified. Any issues reported by PatchCheck.py were fixed. Future changes will be made to individually address improving the quality of each feature and to add new features. This patch series is intended to provide a foundation for future changes to the advanced feature design as an incremental improvement over the current state. The contents of this patch series is on the following branch: https://github.com/makubacki/edk2-platforms/tree/advanced_feature_reorg_v2 Cc: Agyeman Prince Cc: Chasel Chiu Cc: Dandan Bi Cc: Eric Dong Cc: Isaac W Oram Cc: Liming Gao Cc: Nate DeSimone Cc: Sai Chaganty Cc: Wei David Y Signed-off-by: Michael Kubacki Michael Kubacki (47): AdvancedFeaturePkg: Package DSC style cleanup DebugFeaturePkg: Package DSC style cleanup UserInterfaceFeaturePkg: Package DSC style cleanup Features/Intel: Add Readme.md Features/Intel/PowerManagement: Add Readme.md Features/Intel/OutOfBandManagement: Add Readme.md Features/Intel/SystemInformation: Add Readme.md Features/Intel/Debugging: Add Readme.md Features/Intel/UserInterface: Add Readme.md Features/Intel/Network: Add Readme.md TemplateFeaturePkg: Add initial package Features/Intel/S3FeaturePkg: Add initial package Features/Intel/IpmiFeaturePkg: Add initial package Features/Intel/IpmiFeaturePkg: Add libraries Features/Intel/IpmiFeaturePkg: Add modules Features/Intel/SmbiosFeaturePkg: Add initial package Features/Intel/SmbiosFeaturePkg: Update default strings Features/Intel/AcpiDebugFeaturePkg: Add initial package Features/Intel/Usb3DebugFeaturePkg: Add initial package Features/Intel/UserAuthFeaturePkg: Add initial package Features/Intel/NetworkFeaturePkg: Add initial package Features/Intel/AdvancedFeaturePkg: Add package Features/Intel/AdvancedFeaturePkg: Add temporary build workaround Features/Intel/AdvancedFeaturePkg: Add FDF include files KabylakeOpenBoardPkg/KabylakeRvp3: Add PEI_ARCH and DXE_ARCH KabylakeOpenBoardPkg/GalagoPro3: Add PEI_ARCH and DXE_ARCH WhiskeylakeOpenBoardPkg/WhiskeylakeURvp: Add PEI_ARCH and DXE_ARCH SimicsOpenBoardPkg/BoardX58Ich10: Use PEI_ARCH and DXE_ARCH MinPlatformPkg: Add
[edk2-devel] [edk2-platforms][PATCH V2 01/47] AdvancedFeaturePkg: Package DSC style cleanup
This change refactors AdvancedFeaturePkg.dsc to consolidate redundant sections and better group file content to improve maintainability and readability. This pattern is being applied in all Minimum Platform package DSC files. Cc: Sai Chaganty Cc: Liming Gao Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc | 133 +++- 1 file changed, 71 insertions(+), 62 deletions(-) diff --git a/Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc b/Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc index b2e7ab8302..b83e72b48c 100644 --- a/Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc +++ b/Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc @@ -1,5 +1,5 @@ ## @file -# Platform description. +# Advanced Feature Package build description file. # # Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved. # @@ -24,8 +24,7 @@ # -# SKU Identification section - list of all SKU IDs supported by this -# Platform. +# SKU Identification section - list of all SKU IDs supported. # [SkuIds] @@ -33,88 +32,93 @@ # -# Pcd Section - list of all EDK II PCD Entries defined by this Platform +# Pcd Section - list of all EDK II PCD Entries defined by this package. # - + [PcdsFeatureFlag] # -# Library Class section - list of all Library Classes needed by this Platform. +# Library Class section - list of all Library Classes needed by this package. # [LibraryClasses.common] - - PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf - PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf - DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf - UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf - UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf - SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf - PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf - - # - # Basic - # + ### + # Edk2 Packages + ### BaseLib|MdePkg/Library/BaseLib/BaseLib.inf BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf - - PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf + BasePciLibPciExpress|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf + CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf + DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf + DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf + DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf + HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf - PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf - PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf - BasePciLibPciExpress|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf -# PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf PciExpressLib|MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf - CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf - PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf + PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf + PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf + PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf + PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf + PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf + PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf + PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf +
[edk2-devel] [edk2-platforms][PATCH V2 03/47] UserInterfaceFeaturePkg: Package DSC style cleanup
This change refactors UserInterfaceFeaturePkg.dsc to consolidate redundant sections and better group file content to improve maintainability and readability. This pattern is being applied in all Minimum Platform package DSC files. Cc: Dandan Bi Cc: Liming Gao Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Platform/Intel/UserInterfaceFeaturePkg/UserInterfaceFeaturePkg.dsc | 45 ++-- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/Platform/Intel/UserInterfaceFeaturePkg/UserInterfaceFeaturePkg.dsc b/Platform/Intel/UserInterfaceFeaturePkg/UserInterfaceFeaturePkg.dsc index 6c5f77b59b..bd09052f3c 100644 --- a/Platform/Intel/UserInterfaceFeaturePkg/UserInterfaceFeaturePkg.dsc +++ b/Platform/Intel/UserInterfaceFeaturePkg/UserInterfaceFeaturePkg.dsc @@ -1,5 +1,6 @@ ## @file # This package provides UI related modules. +# This package should only depend on EDKII Core packages and MinPlatformPkg. # # The DEC files are used by the utilities that parse DSC and # INF files to generate AutoGen.c and AutoGen.h files @@ -22,32 +23,45 @@ SKUID_IDENTIFIER = DEFAULT [LibraryClasses] - UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf + ### + # Edk2 Packages + ### BaseLib|MdePkg/Library/BaseLib/BaseLib.inf BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf - PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf - IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf - UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf - UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf - UefiLib|MdePkg/Library/UefiLib/UefiLib.inf - UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf - HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf - DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf - TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf + HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf + IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf + PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf + TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.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 + + # + # User Interface Feature Package + # PlatformPasswordLib|UserInterfaceFeaturePkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.inf UserPasswordLib|UserInterfaceFeaturePkg/Library/UserPasswordLib/UserPasswordLib.inf [LibraryClasses.common.DXE_DRIVER] + ### + # Edk2 Packages + ### MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf [LibraryClasses.common.DXE_SMM_DRIVER] + ### + # Edk2 Packages + ### + BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf - BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf ### # @@ -68,10 +82,17 @@ # ### [Components] + # + # User Interface Feature Package + # + + # Add library instances here that are not included in package components and should be tested + # in the package build. UserInterfaceFeaturePkg/Library/PlatformPasswordLibNull/PlatformPasswordLibNull.inf UserInterfaceFeaturePkg/Library/UserPasswordLib/UserPasswordLib.inf UserInterfaceFeaturePkg/Library/UserPasswordUiLib/UserPasswordUiLib.inf + # Add components here that should be included in the package build.
[edk2-devel] [edk2-platforms][PATCH V2 05/47] Features/Intel/PowerManagement: Add Readme.md
Adds the Readme.md file to briefly explain the types of features supported in the PowerManagement feature domain directory. Cc: Sai Chaganty Cc: Liming Gao Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Features/Intel/PowerManagement/Readme.md | 10 ++ 1 file changed, 10 insertions(+) diff --git a/Features/Intel/PowerManagement/Readme.md b/Features/Intel/PowerManagement/Readme.md new file mode 100644 index 00..f539fbd2ec --- /dev/null +++ b/Features/Intel/PowerManagement/Readme.md @@ -0,0 +1,10 @@ +# **EDK II Minimum Platform Firmware Power Management Advanced Features** + +This feature domain directory contains power management related advanced features. + +Features may be added to this domain whose primary role and responsibility is related to power management including +support for various power states such as device power states (Dx), system sleep states (Sx), processor power states (Cx), +performance states (Px), etc. Firmware power management responsibilities are largely defined by the +[Advanced Configuration Configuration and Power Interface Specification](https://uefi.org/specifications) though features +in this domain may be written to other specifications or not defined in a specification at all. In any case, the +`Readme.md` file in the feature package should reference all relevant documentation to the feature. -- 2.16.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51390): https://edk2.groups.io/g/devel/message/51390 Mute This Topic: https://groups.io/mt/63456720/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v2 2/3] MdePkg/MdeModule: Add support for RuntimeServicesSupported variable
Please separate the change per package. You can combine MdePkg changes into one patch. Thanks Liming >-Original Message- >From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of >Jeff Brasen >Sent: Thursday, November 28, 2019 7:25 AM >To: devel@edk2.groups.io >Cc: Gao, Liming ; Kinney, Michael D >; Wu, Hao A ; Ni, Ray >; Gao, Zhichao ; >jbra...@nvidia.com >Subject: [edk2-devel] [PATCH v2 2/3] MdePkg/MdeModule: Add support for >RuntimeServicesSupported variable > >Add support for new global variable defined in the UEFI 2.8 >specification. This provides a bitmask of which calls are >implemented by the firmware during runtime services. > >Change-Id: If871e16052ecd871fd03a0eef2e3ed5fa5beb93c >Signed-off-by: Jeff Brasen >--- > .../Library/VarCheckUefiLib/VarCheckUefiLibNullClass.c| 11 >+++ > MdePkg/Include/Guid/GlobalVariable.h | 7 +++ > 2 files changed, 18 insertions(+) > >diff --git >a/MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLibNullClass.c >b/MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLibNullClass.c >index e3bf04a..4264892 100644 >--- a/MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLibNullClass.c >+++ b/MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLibNullClass.c >@@ -553,6 +553,17 @@ UEFI_DEFINED_VARIABLE_ENTRY >mGlobalVariableList[] = { > }, > NULL > }, >+ { >+EFI_RUNTIME_SERVICES_SUPPORTED_VARIABLE_NAME, >+{ >+ VAR_CHECK_VARIABLE_PROPERTY_REVISION, >+ VAR_CHECK_VARIABLE_PROPERTY_READ_ONLY, >+ VARIABLE_ATTRIBUTE_BS_RT, >+ sizeof (UINT16), >+ sizeof (UINT16) >+}, >+NULL >+ }, > }; > > UEFI_DEFINED_VARIABLE_ENTRY mGlobalVariableList2[] = { >diff --git a/MdePkg/Include/Guid/GlobalVariable.h >b/MdePkg/Include/Guid/GlobalVariable.h >index 7abc103..06a8a12 100644 >--- a/MdePkg/Include/Guid/GlobalVariable.h >+++ b/MdePkg/Include/Guid/GlobalVariable.h >@@ -182,5 +182,12 @@ extern EFI_GUID gEfiGlobalVariableGuid; > /// Its attribute is BS+RT. > /// > #define EFI_VENDOR_KEYS_VARIABLE_NAME L"VendorKeys" >+/// >+/// Bitmask of which calls are implemented by the firmware during runtime >services. >+/// RT access is required only if GetVariable() is implemented by runtime >services. >+/// Should be treated as read-only. >+/// Its attribute is BS+RT. >+/// >+#define EFI_RUNTIME_SERVICES_SUPPORTED_VARIABLE_NAME >L"RuntimeServicesSupported" > > #endif >-- >2.7.4 > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51384): https://edk2.groups.io/g/devel/message/51384 Mute This Topic: https://groups.io/mt/63268505/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v2 1/3] MdePkg-UefiSpec.h: Add UEFI 2.8 RuntimeServicesSuppported definations
The change is good. And, please remove Change-Id: in the commit message. Last, have you submitted BZ for it? Thanks Liming >-Original Message- >From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of >Jeff Brasen >Sent: Thursday, November 28, 2019 7:25 AM >To: devel@edk2.groups.io >Cc: Gao, Liming ; Kinney, Michael D >; Wu, Hao A ; Ni, Ray >; Gao, Zhichao ; >jbra...@nvidia.com >Subject: [edk2-devel] [PATCH v2 1/3] MdePkg-UefiSpec.h: Add UEFI 2.8 >RuntimeServicesSuppported definations > >Add bitmask values for the value of the RuntimeServicesSupported >variable defined in the UEFI 2.8 specification. This is used to describe >what services the platform supports while in runtime. > >Change-Id: I7ff0fcdb856b4d2e4ba90a08291f8980e2f66375 >Signed-off-by: Jeff Brasen >--- > MdePkg/Include/Uefi/UefiSpec.h | 18 ++ > 1 file changed, 18 insertions(+) > >diff --git a/MdePkg/Include/Uefi/UefiSpec.h >b/MdePkg/Include/Uefi/UefiSpec.h >index 444aa35..7e2b719 100644 >--- a/MdePkg/Include/Uefi/UefiSpec.h >+++ b/MdePkg/Include/Uefi/UefiSpec.h >@@ -1783,6 +1783,24 @@ EFI_STATUS > #define EFI_OS_INDICATIONS_START_PLATFORM_RECOVERY >0x0040 > > // >+// Bitmasks of supported runtime functions for RuntimeServicesSupported >variable >+// >+#define EFI_RT_SUPPORTED_GET_TIME 0x0001 >+#define EFI_RT_SUPPORTED_SET_TIME 0x0002 >+#define EFI_RT_SUPPORTED_GET_WAKEUP_TIME0x0004 >+#define EFI_RT_SUPPORTED_SET_WAKEUP_TIME0x0008 >+#define EFI_RT_SUPPORTED_GET_VARIABLE 0x0010 >+#define EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME 0x0020 >+#define EFI_RT_SUPPORTED_SET_VARIABLE 0x0040 >+#define EFI_RT_SUPPORTED_SET_VIRTUAL_ADDRESS_MAP0x0080 >+#define EFI_RT_SUPPORTED_CONVERT_POINTER0x0100 >+#define EFI_RT_SUPPORTED_GET_NEXT_HIGH_MONOTONIC_COUNT >0x0200 >+#define EFI_RT_SUPPORTED_RESET_SYSTEM 0x0400 >+#define EFI_RT_SUPPORTED_UPDATE_CAPSULE 0x0800 >+#define EFI_RT_SUPPORTED_QUERY_CAPSULE_CAPABILITIES 0x1000 >+#define EFI_RT_SUPPORTED_QUERY_VARIABLE_INFO0x2000 >+ >+// > // EFI Runtime Services Table > // > #define EFI_SYSTEM_TABLE_SIGNATURE SIGNATURE_64 ('I','B','I',' >','S','Y','S','T') >-- >2.7.4 > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51383): https://edk2.groups.io/g/devel/message/51383 Mute This Topic: https://groups.io/mt/63268482/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2 2/3] MdePkg/MdeModule: Add support for RuntimeServicesSupported variable
Add support for new global variable defined in the UEFI 2.8 specification. This provides a bitmask of which calls are implemented by the firmware during runtime services. Change-Id: If871e16052ecd871fd03a0eef2e3ed5fa5beb93c Signed-off-by: Jeff Brasen --- .../Library/VarCheckUefiLib/VarCheckUefiLibNullClass.c| 11 +++ MdePkg/Include/Guid/GlobalVariable.h | 7 +++ 2 files changed, 18 insertions(+) diff --git a/MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLibNullClass.c b/MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLibNullClass.c index e3bf04a..4264892 100644 --- a/MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLibNullClass.c +++ b/MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLibNullClass.c @@ -553,6 +553,17 @@ UEFI_DEFINED_VARIABLE_ENTRY mGlobalVariableList[] = { }, NULL }, + { +EFI_RUNTIME_SERVICES_SUPPORTED_VARIABLE_NAME, +{ + VAR_CHECK_VARIABLE_PROPERTY_REVISION, + VAR_CHECK_VARIABLE_PROPERTY_READ_ONLY, + VARIABLE_ATTRIBUTE_BS_RT, + sizeof (UINT16), + sizeof (UINT16) +}, +NULL + }, }; UEFI_DEFINED_VARIABLE_ENTRY mGlobalVariableList2[] = { diff --git a/MdePkg/Include/Guid/GlobalVariable.h b/MdePkg/Include/Guid/GlobalVariable.h index 7abc103..06a8a12 100644 --- a/MdePkg/Include/Guid/GlobalVariable.h +++ b/MdePkg/Include/Guid/GlobalVariable.h @@ -182,5 +182,12 @@ extern EFI_GUID gEfiGlobalVariableGuid; /// Its attribute is BS+RT. /// #define EFI_VENDOR_KEYS_VARIABLE_NAME L"VendorKeys" +/// +/// Bitmask of which calls are implemented by the firmware during runtime services. +/// RT access is required only if GetVariable() is implemented by runtime services. +/// Should be treated as read-only. +/// Its attribute is BS+RT. +/// +#define EFI_RUNTIME_SERVICES_SUPPORTED_VARIABLE_NAME L"RuntimeServicesSupported" #endif -- 2.7.4 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51380): https://edk2.groups.io/g/devel/message/51380 Mute This Topic: https://groups.io/mt/63268505/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2 0/3] Support for RuntimeServicesSupported global variable
Add support for the new UEFI 2.8 runtime services supported variable that is used to indicate which runtime services a platform supports. Also, add support for initializing this variable based on a PCD. Change Log: v1 - Initial version v2 - Move pcd from MdeModulePkg to MdePkg and update uni file Jeff Brasen (3): MdePkg-UefiSpec.h: Add UEFI 2.8 RuntimeServicesSuppported definations MdePkg/MdeModule: Add support for RuntimeServicesSupported variable MdeModulePkg/BdsDxe: Set RuntimeServicesSupported variable .../VarCheckUefiLib/VarCheckUefiLibNullClass.c | 11 +++ MdeModulePkg/Universal/BdsDxe/BdsDxe.inf | 1 + MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 35 +- MdePkg/Include/Guid/GlobalVariable.h | 7 + MdePkg/Include/Uefi/UefiSpec.h | 18 +++ MdePkg/MdePkg.dec | 18 +++ MdePkg/MdePkg.uni | 17 +++ 7 files changed, 106 insertions(+), 1 deletion(-) -- 2.7.4 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51378): https://edk2.groups.io/g/devel/message/51378 Mute This Topic: https://groups.io/mt/63268463/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2 3/3] MdeModulePkg/BdsDxe: Set RuntimeServicesSupported variable
Add support for initializing and setting the UEFI 2.8 global variable RuntimeServicesSupported based on the value of a PCD. Change-Id: I8fbd404d492ff8278466edde8aa37d203537318c Signed-off-by: Jeff Brasen --- MdeModulePkg/Universal/BdsDxe/BdsDxe.inf | 1 + MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 35 +++- MdePkg/MdePkg.dec| 18 MdePkg/MdePkg.uni| 17 4 files changed, 70 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf index 9310b4d..52ec04f 100644 --- a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf +++ b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf @@ -90,6 +90,7 @@ gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang ## CONSUMES gEfiMdePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel## CONSUMES gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut ## CONSUMES + gEfiMdePkgTokenSpaceGuid.PcdRuntimeServicesSupported## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareRevision ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdConInConnectOnDemand ## CONSUMES diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c index d387dbe..16bc593 100644 --- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c +++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c @@ -40,7 +40,8 @@ CHAR16 *mReadOnlyVariables[] = { EFI_LANG_CODES_VARIABLE_NAME, EFI_BOOT_OPTION_SUPPORT_VARIABLE_NAME, EFI_HW_ERR_REC_SUPPORT_VARIABLE_NAME, - EFI_OS_INDICATIONS_SUPPORT_VARIABLE_NAME + EFI_OS_INDICATIONS_SUPPORT_VARIABLE_NAME, + EFI_RUNTIME_SERVICES_SUPPORTED_VARIABLE_NAME }; CHAR16 *mBdsLoadOptionName[] = { @@ -626,6 +627,33 @@ BdsFormalizeOSIndicationVariable ( /** + Formalize RuntimeServicesSupported variable. + +**/ +VOID +BdsFormalizeRuntimeServicesSupportedVariable ( + VOID + ) +{ + EFI_STATUS Status; + UINT16 RuntimeServicesSupported; + + RuntimeServicesSupported = PcdGet16 (PcdRuntimeServicesSupported); + Status = gRT->SetVariable ( + EFI_RUNTIME_SERVICES_SUPPORTED_VARIABLE_NAME, + , + EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, + sizeof(RuntimeServicesSupported), + + ); + // + // Platform needs to make sure setting volatile variable before calling 3rd party code shouldn't fail. + // + ASSERT_EFI_ERROR (Status); +} + +/** + Validate variables. **/ @@ -645,6 +673,11 @@ BdsFormalizeEfiGlobalVariable ( // Validate OSIndication related variable. // BdsFormalizeOSIndicationVariable (); + + // + // Validate Runtime Services Supported variable. + // + BdsFormalizeRuntimeServicesSupportedVariable (); } /** diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index d022cc5..cdcb2f9 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -2297,5 +2297,23 @@ # @Prompt Boot Timeout (s) gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|0x|UINT16|0x002c + ## Bitmask of supported runtime services + # BIT0 - GetTime + # BIT1 - SetTime + # BIT2 - GetWakeupTime + # BIT3 - SetWakeupTime + # BIT4 - GetVariable + # BIT5 - GetNextVariableName + # BIT6 - SetVariable + # BIT7 - SetVirtualAddressMap + # BIT8 - ConvertPointer + # BIT9 - GetNextHighMonotonicCount + # BIT10 - ResetSystem + # BIT11 - UpdateCapsule + # BIT12 - QueryCapsuleCapabilites + # BIT13 - QueryVariableInfo + # @Prompt Supported Runtime services bitmask. + gEfiMdePkgTokenSpaceGuid.PcdRuntimeServicesSupported|0x3FFF|UINT16|0x002e + [UserExtensions.TianoCore."ExtraFiles"] MdePkgExtra.uni diff --git a/MdePkg/MdePkg.uni b/MdePkg/MdePkg.uni index 5c1fa24..1edf681 100644 --- a/MdePkg/MdePkg.uni +++ b/MdePkg/MdePkg.uni @@ -413,3 +413,20 @@ #string STR_gEfiMdePkgTokenSpaceGuid_PcdUartDefaultReceiveFifoDepth_HELP #language en-US "Indicates the receive FIFO depth of UART controller." +#string STR_gEfiMdePkgTokenSpaceGuid_PcdRuntimeServicesSupported_PROMPT #language en-US "Supported Runtime Services bitmask" + +#string STR_gEfiMdePkgTokenSpaceGuid_PcdRuntimeServicesSupported_HELP #language en-US "Bitmask of supported runtime services\n" + "BIT0 - GetTime\n" + "BIT1 - SetTime\n" + "BIT2 - GetWakeupTime\n" + "BIT3 - SetWakeupTime\n" +
[edk2-devel] [PATCH v2 1/3] MdePkg-UefiSpec.h: Add UEFI 2.8 RuntimeServicesSuppported definations
Add bitmask values for the value of the RuntimeServicesSupported variable defined in the UEFI 2.8 specification. This is used to describe what services the platform supports while in runtime. Change-Id: I7ff0fcdb856b4d2e4ba90a08291f8980e2f66375 Signed-off-by: Jeff Brasen --- MdePkg/Include/Uefi/UefiSpec.h | 18 ++ 1 file changed, 18 insertions(+) diff --git a/MdePkg/Include/Uefi/UefiSpec.h b/MdePkg/Include/Uefi/UefiSpec.h index 444aa35..7e2b719 100644 --- a/MdePkg/Include/Uefi/UefiSpec.h +++ b/MdePkg/Include/Uefi/UefiSpec.h @@ -1783,6 +1783,24 @@ EFI_STATUS #define EFI_OS_INDICATIONS_START_PLATFORM_RECOVERY 0x0040 // +// Bitmasks of supported runtime functions for RuntimeServicesSupported variable +// +#define EFI_RT_SUPPORTED_GET_TIME 0x0001 +#define EFI_RT_SUPPORTED_SET_TIME 0x0002 +#define EFI_RT_SUPPORTED_GET_WAKEUP_TIME0x0004 +#define EFI_RT_SUPPORTED_SET_WAKEUP_TIME0x0008 +#define EFI_RT_SUPPORTED_GET_VARIABLE 0x0010 +#define EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME 0x0020 +#define EFI_RT_SUPPORTED_SET_VARIABLE 0x0040 +#define EFI_RT_SUPPORTED_SET_VIRTUAL_ADDRESS_MAP0x0080 +#define EFI_RT_SUPPORTED_CONVERT_POINTER0x0100 +#define EFI_RT_SUPPORTED_GET_NEXT_HIGH_MONOTONIC_COUNT 0x0200 +#define EFI_RT_SUPPORTED_RESET_SYSTEM 0x0400 +#define EFI_RT_SUPPORTED_UPDATE_CAPSULE 0x0800 +#define EFI_RT_SUPPORTED_QUERY_CAPSULE_CAPABILITIES 0x1000 +#define EFI_RT_SUPPORTED_QUERY_VARIABLE_INFO0x2000 + +// // EFI Runtime Services Table // #define EFI_SYSTEM_TABLE_SIGNATURE SIGNATURE_64 ('I','B','I',' ','S','Y','S','T') -- 2.7.4 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51379): https://edk2.groups.io/g/devel/message/51379 Mute This Topic: https://groups.io/mt/63268482/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [edk2-platforms][PATCH V1 00/49] Intel Advanced Feature Refactor
Yes, I reordered the patch series this way in V2 and I will update the closed source platforms before the old advanced feature dependencies are removed. Thanks, Michael > -Original Message- > From: Bi, Dandan > Sent: Monday, November 18, 2019 12:41 AM > To: Kubacki, Michael A ; > devel@edk2.groups.io > Cc: Agyeman, Prince ; Chiu, Chasel > ; Dong, Eric ; Oram, Isaac W > ; Gao, Liming ; Desimone, > Nathaniel L ; Chaganty, Rangasai V > ; Wei, David Y > Subject: RE: [edk2-platforms][PATCH V1 00/49] Intel Advanced Feature > Refactor > > Hi Michael, > > One minor comment, could we add the features into Features/ folder firstly > and then update consumer platforms if have (open platforms and close > source platforms) to use the ones in the new location, at last delete the old > ones in Platform/Intel folder? > > > Thanks, > Dandan > > -Original Message- > > From: Kubacki, Michael A > > Sent: Wednesday, November 13, 2019 11:27 AM > > To: devel@edk2.groups.io > > Cc: Agyeman, Prince ; Chiu, Chasel > > ; Bi, Dandan ; Dong, Eric > > ; Oram, Isaac W ; Gao, > > Liming ; Desimone, Nathaniel L > > ; Chaganty, Rangasai V > > ; Wei, David Y > > Subject: [edk2-platforms][PATCH V1 00/49] Intel Advanced Feature > Refactor > > > > RFC:https://edk2.groups.io/g/devel/message/49880 > > > > This patch series introduces a consistent design for Intel advanced > features. > > > > Advanced features in this context refer to the definition stated in > > the EDK II Minimum Platform specification. Information regarding > > this feature design is provided in Features/Intel/Readme.md. > > > > An RFC was sent to the mailing list on 11/1/2019 that stated the > > intention of creating the Features directory in edk2-platforms for > > this purpose and that change is implemented in this patch series. > > > > Testing performed: > > * Feature packages and board packages build successfully > > * Board packages boot successfully to their supported OS > > * Board package Stage 4 and Stage 6 tested > > > > The actual feature source implementation was not functionally > > modified. Any issues reported by PatchCheck.py were fixed. > > Future changes will be made to individually address improving the > > quality of each feature and to add new features. > > > > This patch series is intended to provide a foundation for future > > changes to the advanced feature design as an incremental improvement > > over the current state and should not be considered the final state. > > > > Cc: Agyeman Prince > > Cc: Chasel Chiu > > Cc: Dandan Bi > > Cc: Eric Dong > > Cc: Isaac W Oram > > Cc: Liming Gao > > Cc: Nate DeSimone > > Cc: Sai Chaganty > > Cc: Wei David Y > > Signed-off-by: Michael Kubacki > > > > Michael Kubacki (49): > > AdvancedFeaturePkg: Package DSC style cleanup > > DebugFeaturePkg: Package DSC style cleanup > > UserInterfaceFeaturePkg: Package DSC style cleanup > > Features/Intel: Add Readme.md > > Features/Intel/PowerManagement: Add Readme.md > > Features/Intel/OutOfBandManagement: Add Readme.md > > Features/Intel/SystemInformation: Add Readme.md > > Features/Intel/Debug: Add Readme.md > > Features/Intel/UserInterface: Add Readme.md > > Features/Intel/Network: Add Readme.md > > TemplateFeaturePkg: Add initial package > > SimicsOpenBoardPkg: Remove advanced feature references > > AdvancedFeaturePkg: Remove the S3 feature > > Features/Intel: Add S3FeaturePkg > > AdvancedFeaturePkg: Remove the IPMI feature > > Features/Intel/IpmiFeaturePkg: Add initial package > > Features/Intel/IpmiFeaturePkg: Add libraries > > Features/Intel/IpmiFeaturePkg: Add modules > > AdvancedFeaturePkg: Remove the SMBIOS feature > > Features/Intel/SmbiosFeaturePkg: Add initial package > > Features/Intel/SmbiosFeaturePkg: Update default strings > > DebugFeaturePkg: Remove the ACPI Debug feature > > Features/Intel/AcpiDebugFeaturePkg: Add initial package > > DebugFeaturePkg: Remove the USB3 Debug feature > > Features/Intel/Usb3DebugFeaturePkg: Add initial package > > UserInterfaceFeaturePkg: Remove the User Authentication feature > > Features/Intel/UserAuthFeaturePkg: Add initial package > > Features/Intel/NetworkFeaturePkg: Add initial package > > AdvancedFeaturePkg: Remove remaining contents > > AdvancedFeaturePkg: Move to Features/Intel > > AdvancedFeaturePkg: Add feature build support > > AdvancedFeaturePkg: Add temporary build workaround > > AdvancedFeaturePkg: Add FDF include files > > KabylakeOpenBoardPkg/KabylakeRvp3: Add PEI_ARCH and DXE_ARCH > > KabylakeOpenBoardPkg/GalagoPro3: Add PEI_ARCH and DXE_ARCH > > WhiskeylakeOpenBoardPkg/WhiskeylakeURvp: Add PEI_ARCH and > > DXE_ARCH > > SimicsOpenBoardPkg/BoardX58Ich10: Use PEI_ARCH and DXE_ARCH > > MinPlatformPkg: Add FvAdvancedPreMemory > > KabylakeOpenBoardPkg/KabylakeRvp3: Add FvAdvancedPreMemory > > KabylakeOpenBoardPkg/GalagoPro3: Add FvAdvancedPreMemory > > WhiskeylakeOpenBoardPkg/WhiskeylakeURvp: Add > >
Re: [edk2-devel] [PATCH V1 2/2] MdeModulePkg PeiCore: Improve comment semantics
Hi Philippe, Thanks for your suggestions. I incorporated some of the suggestions into the V2 series. Thanks, Michael > -Original Message- > From: devel@edk2.groups.io On Behalf Of Philippe > Mathieu-Daudé > Sent: Wednesday, November 27, 2019 3:49 AM > To: devel@edk2.groups.io; Kubacki, Michael A > > Cc: Bi, Dandan ; Gao, Liming ; > Wang, Jian J ; Wu, Hao A > Subject: Re: [edk2-devel] [PATCH V1 2/2] MdeModulePkg PeiCore: Improve > comment semantics > > On 11/27/19 5:06 AM, Kubacki, Michael A via Groups.Io wrote: > > Clarifies wording in several PeiCore comments to improve > > "Clarify"? > I believe an implied subject noun led to some confusion so I just explicitly included that in the V2 message. > > reading comprehension. > > > > Cc: Dandan Bi > > Cc: Liming Gao > > Cc: Jian J Wang > > Cc: Hao A Wu > > Signed-off-by: Michael Kubacki > > --- > > MdeModulePkg/Core/Pei/FwVol/FwVol.h | 4 ++-- > > MdeModulePkg/Core/Pei/PeiMain.h | 11 +- > > MdeModulePkg/Core/Pei/Dependency/Dependency.c | 4 ++-- > > MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 4 ++-- > > MdeModulePkg/Core/Pei/FwVol/FwVol.c | 23 ++-- > > MdeModulePkg/Core/Pei/Memory/MemoryServices.c | 4 ++-- > > 6 files changed, 26 insertions(+), 24 deletions(-) > > > > diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.h > > b/MdeModulePkg/Core/Pei/FwVol/FwVol.h > > index 263f0d7a56..8aaf84870b 100644 > > --- a/MdeModulePkg/Core/Pei/FwVol/FwVol.h > > +++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.h > > @@ -303,9 +303,9 @@ FindFileEx ( > > ); > > > > /** > > - Report the information for a new discovered FV in unknown format. > > + Report the information for a newly discovered FV in an unknown format. > > > > - If the EFI_PEI_FIRMWARE_VOLUME_PPI has not been installed for > > specific FV format, but > > + If the EFI_PEI_FIRMWARE_VOLUME_PPI has not been installed for a > > + third-party FV format, but > > the FV in this FV format has been discovered, then the information of > this FV > > will be cached into PEI_CORE_INSTANCE's UnknownFvInfo array. > > Also a notification would be installed for unknown FV format GUID, > > if EFI_PEI_FIRMWARE_VOLUME_PPI diff --git > > a/MdeModulePkg/Core/Pei/PeiMain.h > b/MdeModulePkg/Core/Pei/PeiMain.h > > index 3f61247a0f..96d6df0485 100644 > > --- a/MdeModulePkg/Core/Pei/PeiMain.h > > +++ b/MdeModulePkg/Core/Pei/PeiMain.h > > @@ -1217,8 +1217,8 @@ PeiFfsGetVolumeInfo ( > > ); > > > > /** > > - This routine enable a PEIM to register itself to shadow when PEI > > Foundation > > - discovery permanent memory. > > + This routine enables a PEIM to register itself for shadow when the > > + PEI Foundation discovers permanent memory. > > > > @param FileHandle File handle of a PEIM. > > > > @@ -1314,12 +1314,13 @@ ProcessFvFile ( > > ); > > > > /** > > - Get instance of PEI_CORE_FV_HANDLE for next volume according to > given index. > > + Gets a PEI_CORE_FV_HANDLE instance for the next volume according to > the given index. > > "Get"? > I left as-is in V2. You can see similar usage in the majority of function descriptions in BaseLib.h for example. > > > > - This routine also will install FvInfo PPI for FV HOB in PI ways. > > + This routine also will install an instance of the FvInfo PPI for > > + the FV HOB as defined in the PI specification. > > > > @param PrivatePointer of PEI_CORE_INSTANCE > > - @param Instance The index of FV want to be searched. > > + @param Instance The index of the FV to search. > > Maybe without "The" and trailing dot? > Done in V2. > > > > @return Instance of PEI_CORE_FV_HANDLE. > > **/ > > diff --git a/MdeModulePkg/Core/Pei/Dependency/Dependency.c > > b/MdeModulePkg/Core/Pei/Dependency/Dependency.c > > index 9a8353aef2..b53e5f2686 100644 > > --- a/MdeModulePkg/Core/Pei/Dependency/Dependency.c > > +++ b/MdeModulePkg/Core/Pei/Dependency/Dependency.c > > @@ -2,8 +2,8 @@ > > PEI Dispatcher Dependency Evaluator > > > > This routine evaluates a dependency expression > > (DEPENDENCY_EXPRESSION) to determine > > - if a driver can be scheduled for execution. The criteria for > > - schedulability is that the dependency expression is satisfied. > > + if a driver can be scheduled for execution. The criteria to be > > + scheduled is that the dependency expression is satisfied. > > > > Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved. > > SPDX-License-Identifier: BSD-2-Clause-Patent diff --git > > a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c > > b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c > > index c9f2a91264..a18ac47f61 100644 > > --- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c > > +++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c > > @@ -1347,8 +1347,8 @@ DepexSatisfied ( > > } > > > > /** > > - This routine enable a PEIM to register itself to shadow when PEI > > Foundation > > - discovery
[edk2-devel] [PATCH V2 2/2] MdeModulePkg PeiCore: Improve comment semantics
This patch clarifies wording in several PeiCore comments to improve reading comprehension. Cc: Dandan Bi Cc: Liming Gao Cc: Jian J Wang Cc: Hao A Wu Signed-off-by: Michael Kubacki --- MdeModulePkg/Core/Pei/FwVol/FwVol.h | 9 MdeModulePkg/Core/Pei/PeiMain.h | 11 + MdeModulePkg/Core/Pei/Dependency/Dependency.c | 4 ++-- MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 4 ++-- MdeModulePkg/Core/Pei/FwVol/FwVol.c | 24 +++- MdeModulePkg/Core/Pei/Memory/MemoryServices.c | 4 ++-- 6 files changed, 30 insertions(+), 26 deletions(-) diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.h b/MdeModulePkg/Core/Pei/FwVol/FwVol.h index 263f0d7a56..7241c01b8c 100644 --- a/MdeModulePkg/Core/Pei/FwVol/FwVol.h +++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.h @@ -303,11 +303,12 @@ FindFileEx ( ); /** - Report the information for a new discovered FV in unknown format. + Report the information for a newly discovered FV in an unknown format. + + If the EFI_PEI_FIRMWARE_VOLUME_PPI has not been installed for a third-party FV format, but + the FV has been discovered, then the information of this FV will be cached into PEI_CORE_INSTANCE's + UnknownFvInfo array. - If the EFI_PEI_FIRMWARE_VOLUME_PPI has not been installed for specific FV format, but - the FV in this FV format has been discovered, then the information of this FV - will be cached into PEI_CORE_INSTANCE's UnknownFvInfo array. Also a notification would be installed for unknown FV format GUID, if EFI_PEI_FIRMWARE_VOLUME_PPI is installed later by platform's PEIM, the original unknown FV will be processed by using new installed EFI_PEI_FIRMWARE_VOLUME_PPI. diff --git a/MdeModulePkg/Core/Pei/PeiMain.h b/MdeModulePkg/Core/Pei/PeiMain.h index 3f61247a0f..6431bdaaac 100644 --- a/MdeModulePkg/Core/Pei/PeiMain.h +++ b/MdeModulePkg/Core/Pei/PeiMain.h @@ -1217,8 +1217,8 @@ PeiFfsGetVolumeInfo ( ); /** - This routine enable a PEIM to register itself to shadow when PEI Foundation - discovery permanent memory. + This routine enables a PEIM to register itself for shadow when the PEI Foundation + discovers permanent memory. @param FileHandle File handle of a PEIM. @@ -1314,12 +1314,13 @@ ProcessFvFile ( ); /** - Get instance of PEI_CORE_FV_HANDLE for next volume according to given index. + Gets a PEI_CORE_FV_HANDLE instance for the next volume according to the given index. - This routine also will install FvInfo PPI for FV HOB in PI ways. + This routine also will install an instance of the FvInfo PPI for the FV HOB + as defined in the PI specification. @param PrivatePointer of PEI_CORE_INSTANCE - @param Instance The index of FV want to be searched. + @param Instance Index of the FV to search @return Instance of PEI_CORE_FV_HANDLE. **/ diff --git a/MdeModulePkg/Core/Pei/Dependency/Dependency.c b/MdeModulePkg/Core/Pei/Dependency/Dependency.c index 9a8353aef2..b53e5f2686 100644 --- a/MdeModulePkg/Core/Pei/Dependency/Dependency.c +++ b/MdeModulePkg/Core/Pei/Dependency/Dependency.c @@ -2,8 +2,8 @@ PEI Dispatcher Dependency Evaluator This routine evaluates a dependency expression (DEPENDENCY_EXPRESSION) to determine - if a driver can be scheduled for execution. The criteria for - schedulability is that the dependency expression is satisfied. + if a driver can be scheduled for execution. The criteria to be scheduled is + that the dependency expression is satisfied. Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c index c9f2a91264..a18ac47f61 100644 --- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c +++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c @@ -1347,8 +1347,8 @@ DepexSatisfied ( } /** - This routine enable a PEIM to register itself to shadow when PEI Foundation - discovery permanent memory. + This routine enables a PEIM to register itself for shadow when the PEI Foundation + discovers permanent memory. @param FileHandle File handle of a PEIM. diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.c b/MdeModulePkg/Core/Pei/FwVol/FwVol.c index c21eb9c039..b3661146f2 100644 --- a/MdeModulePkg/Core/Pei/FwVol/FwVol.c +++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.c @@ -593,7 +593,7 @@ FirmwareVolumeInfoPpiNotifyCallback ( } // - // Locate the corresponding FV_PPI according to founded FV's format GUID + // Locate the corresponding FV_PPI according to the format GUID of the FV found // Status = PeiServicesLocatePpi ( , @@ -1533,7 +1533,7 @@ ProcessFvFile ( ); // -// Inform the extracted FvImage to FV HOB consumer phase, i.e. DXE phase +// Expose the extracted FvImage to the FV HOB consumer phase, i.e. DXE phase // BuildFvHob ( (EFI_PHYSICAL_ADDRESS) (UINTN)
[edk2-devel] [PATCH V2 1/2] MdeModulePkg PeiCore: Fix typos
Cc: Dandan Bi Cc: Liming Gao Cc: Jian J Wang Cc: Hao A Wu Signed-off-by: Michael Kubacki --- MdeModulePkg/Core/Pei/PeiMain.inf | 10 ++-- MdeModulePkg/Core/Pei/FwVol/FwVol.h | 20 MdeModulePkg/Core/Pei/PeiMain.h | 40 MdeModulePkg/Core/Pei/Dependency/Dependency.c | 8 ++-- MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 48 +-- MdeModulePkg/Core/Pei/FwVol/FwVol.c | 50 ++-- MdeModulePkg/Core/Pei/Hob/Hob.c | 4 +- MdeModulePkg/Core/Pei/Image/Image.c | 10 ++-- MdeModulePkg/Core/Pei/Memory/MemoryServices.c | 16 +++ MdeModulePkg/Core/Pei/PeiMain/PeiMain.c | 2 +- MdeModulePkg/Core/Pei/Ppi/Ppi.c | 4 +- MdeModulePkg/Core/Pei/Security/Security.c | 12 ++--- 12 files changed, 112 insertions(+), 112 deletions(-) diff --git a/MdeModulePkg/Core/Pei/PeiMain.inf b/MdeModulePkg/Core/Pei/PeiMain.inf index 7c482dacfc..6e25cc4023 100644 --- a/MdeModulePkg/Core/Pei/PeiMain.inf +++ b/MdeModulePkg/Core/Pei/PeiMain.inf @@ -69,12 +69,12 @@ [Guids] gPeiAprioriFileNameGuid ## SOMETIMES_CONSUMES ## File - ## PRODUCES ## UNDEFINED # Install ppi - ## CONSUMES ## UNDEFINED # Locate ppi + ## PRODUCES ## UNDEFINED # Install PPI + ## CONSUMES ## UNDEFINED # Locate PPI gEfiFirmwareFileSystem2Guid - ## PRODUCES ## UNDEFINED # Install ppi - ## CONSUMES ## UNDEFINED # Locate ppi - ## CONSUMES ## GUID # Used to compare with FV's file system guid and get the FV's file system format + ## PRODUCES ## UNDEFINED # Install PPI + ## CONSUMES ## UNDEFINED # Locate PPI + ## CONSUMES ## GUID # Used to compare with FV's file system GUID and get the FV's file system format gEfiFirmwareFileSystem3Guid [Ppis] diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.h b/MdeModulePkg/Core/Pei/FwVol/FwVol.h index ca80e84e0f..263f0d7a56 100644 --- a/MdeModulePkg/Core/Pei/FwVol/FwVol.h +++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.h @@ -1,7 +1,7 @@ /** @file The internal header file for firmware volume related definitions. -Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved. +Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -303,12 +303,12 @@ FindFileEx ( ); /** - Report the information for a new discoveried FV in unknown format. + Report the information for a new discovered FV in unknown format. - If the EFI_PEI_FIRMWARE_VOLUME_PPI has not been installed for specifical FV format, but - the FV in this FV format has been discoveried, then the information of this FV + If the EFI_PEI_FIRMWARE_VOLUME_PPI has not been installed for specific FV format, but + the FV in this FV format has been discovered, then the information of this FV will be cached into PEI_CORE_INSTANCE's UnknownFvInfo array. - Also a notification would be installed for unknown FV format guid, if EFI_PEI_FIRMWARE_VOLUME_PPI + Also a notification would be installed for unknown FV format GUID, if EFI_PEI_FIRMWARE_VOLUME_PPI is installed later by platform's PEIM, the original unknown FV will be processed by using new installed EFI_PEI_FIRMWARE_VOLUME_PPI. @@ -325,14 +325,14 @@ AddUnknownFormatFvInfo ( ); /** - Find the FV information according to FV format guid. + Find the FV information according to FV format GUID. - This routine also will remove the FV information found by given FV format guid from + This routine also will remove the FV information found by given FV format GUID from PrivateData->UnknownFvInfo[]. @param PrivateData Point to instance of PEI_CORE_INSTANCE - @param Format Point to given FV format guid - @param FvInfo On return, the pointer of FV information buffer in given FV format guid + @param Format Point to given FV format GUID + @param FvInfo On return, the pointer of FV information buffer in given FV format GUID @param FvInfoSize On return, the size of FV information buffer. @param AuthenticationStatus On return, the authentication status of FV information buffer. @@ -352,7 +352,7 @@ FindUnknownFormatFvInfo ( Notification callback function for EFI_PEI_FIRMWARE_VOLUME_PPI. When a EFI_PEI_FIRMWARE_VOLUME_PPI is installed to support new FV format, this - routine is called to process all discoveried FVs in this format. + routine is called to process all discovered FVs in this format. @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation @param NotifyDescriptor Address of the notification descriptor data structure. diff --git a/MdeModulePkg/Core/Pei/PeiMain.h b/MdeModulePkg/Core/Pei/PeiMain.h index f2aa97c664..3f61247a0f 100644 --- a/MdeModulePkg/Core/Pei/PeiMain.h +++ b/MdeModulePkg/Core/Pei/PeiMain.h @@ -47,7 +47,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent /// /// It
[edk2-devel] [PATCH V2 0/2] MdeModulePkg PeiCore: Fix grammatical errors
V2 Changes: * "The index of the FV to search." to "Index of the FV to search" in the "Instance" parameter of ProcessFvFile () * Removed "in this FV format" in the function description of AddUnknownFormatFvInfo () * Explicitly stated the implied subject noun in the commit message of patch 2/2 This patch series fixes grammatical errors in the PeiCore module. Originally, this was sent as a single patch which received two Reviewed-by responses: https://edk2.groups.io/g/devel/message/50841 However, a suggestion was made to split the patch into syntactical and semantical changes. That suggestion is implemented in this series. The Reviewed-by responses were not carried forward so the maintainers can evaluate this series as a whole. The previous patch has been dropped. Cc: Dandan Bi Cc: Liming Gao Cc: Jian J Wang Cc: Hao A Wu Signed-off-by: Michael Kubacki Michael Kubacki (2): MdeModulePkg PeiCore: Fix typos MdeModulePkg PeiCore: Improve comment semantics MdeModulePkg/Core/Pei/PeiMain.inf | 10 +-- MdeModulePkg/Core/Pei/FwVol/FwVol.h | 23 +++ MdeModulePkg/Core/Pei/PeiMain.h | 49 +++ MdeModulePkg/Core/Pei/Dependency/Dependency.c | 12 ++-- MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 52 MdeModulePkg/Core/Pei/FwVol/FwVol.c | 64 ++-- MdeModulePkg/Core/Pei/Hob/Hob.c | 4 +- MdeModulePkg/Core/Pei/Image/Image.c | 10 +-- MdeModulePkg/Core/Pei/Memory/MemoryServices.c | 18 +++--- MdeModulePkg/Core/Pei/PeiMain/PeiMain.c | 2 +- MdeModulePkg/Core/Pei/Ppi/Ppi.c | 4 +- MdeModulePkg/Core/Pei/Security/Security.c | 12 ++-- 12 files changed, 132 insertions(+), 128 deletions(-) -- 2.16.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51373): https://edk2.groups.io/g/devel/message/51373 Mute This Topic: https://groups.io/mt/62875486/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH edk2-platforms v2 4/8] Silicon/AMD/Styx: clean up stream ID mappings for SMMU
Tighten the stream ID mappings for the SMMU to only cover the stream IDs that are actually being issued by the respective masters. This is mostly just a cleanup exercise, since specifying unused stream IDs does not typically create any problems. However, the CCP crypto accelerator on B1 silicon actually uses stream IDs that we assigned to the second SATA controller, so there this actually fixes a problem. Since the crypto accelerator shares its SMMU with the second AHCI controller, we can drop the logic that hides the associated IORT node when running on B0 silicon. Signed-off-by: Ard Biesheuvel Acked-by: Leif Lindholm --- Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatform.c | 5 - Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Iort.aslc | 117 2 files changed, 22 insertions(+), 100 deletions(-) diff --git a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatform.c b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatform.c index 743ef0f65523..7c267542db19 100644 --- a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatform.c +++ b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/AcpiPlatform.c @@ -123,7 +123,6 @@ InstallSystemDescriptionTables ( UINTN TableSize; UINTN TableHandle; EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLE*Gtdt; - EFI_ACPI_6_0_IO_REMAPPING_TABLE *Iort; EFI_ACPI_5_1_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER *Madt; EFI_ACPI_5_1_GIC_STRUCTURE *GicC; UINT8 MacPackage[sizeof(mDefaultMacPackageA)]; @@ -177,10 +176,6 @@ InstallSystemDescriptionTables ( if (!PcdGetBool (PcdEnableSmmus)) { continue; } -if ((CpuId & STYX_SOC_VERSION_MASK) < STYX_SOC_VERSION_B1) { - Iort = (EFI_ACPI_6_0_IO_REMAPPING_TABLE *)Table; - Iort->NumNodes -= 2; -} break; case EFI_ACPI_5_1_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE: diff --git a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Iort.aslc b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Iort.aslc index d46be49f0318..7bdc34f6737e 100644 --- a/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Iort.aslc +++ b/Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Iort.aslc @@ -46,7 +46,7 @@ typedef struct { typedef struct { EFI_ACPI_6_0_IO_REMAPPING_NAMED_COMP_NODE Node; CONST CHAR8 Name[11]; - EFI_ACPI_6_0_IO_REMAPPING_ID_TABLERcIdMapping[32]; + EFI_ACPI_6_0_IO_REMAPPING_ID_TABLERcIdMapping[16]; } STYX_NC_NODE; typedef struct { @@ -63,6 +63,7 @@ typedef struct { STYX_NC_NODE Sata0NamedNode; STYX_SMMU_NODESata1SmmuNode; STYX_NC_NODE Sata1NamedNode; + STYX_NC_NODE CcpNamedNode; } STYX_IO_REMAPPING_STRUCTURE; #define __STYX_SMMU_NODE(Base, Size, Irq) \ @@ -114,14 +115,18 @@ typedef struct { EFI_ACPI_IORT_ID_MAPPING_FLAGS_SINGLE \ } -#define __STYX_NAMED_COMPONENT_NODE(Name) \ +#define __STYX_NUM_NODES(Type) \ + ((sizeof(Type) - FIELD_OFFSET(Type, RcIdMapping)) / \ + sizeof(EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE)) + +#define __STYX_NAMED_COMPONENT_NODE(Name, Num) \ { \ { \ EFI_ACPI_IORT_TYPE_NAMED_COMP, \ sizeof(STYX_NC_NODE), \ 0x0,\ 0x0,\ -0x20, \ +Num,\ FIELD_OFFSET(STYX_NC_NODE, RcIdMapping),\ },\ 0x0, \ @@ -139,7 +144,7 @@ STATIC STYX_IO_REMAPPING_STRUCTURE AcpiIort = { AMD_ACPI_HEADER(EFI_ACPI_6_0_IO_REMAPPING_TABLE_SIGNATURE, STYX_IO_REMAPPING_STRUCTURE, EFI_ACPI_IO_REMAPPING_TABLE_REVISION), -10, // NumNodes +11, // NumNodes sizeof(EFI_ACPI_6_0_IO_REMAPPING_TABLE),// NodeOffset 0 // Reserved }, { @@ -175,7 +180,7 @@ STATIC STYX_IO_REMAPPING_STRUCTURE AcpiIort = { STYX_ETH0_SMMU_INTERRUPT) }, { // Eth0NamedNode -__STYX_NAMED_COMPONENT_NODE("\\_SB_.ETH0"), +__STYX_NAMED_COMPONENT_NODE("\\_SB_.ETH0", 16), { __STYX_ID_MAPPING_SINGLE(0x00, Eth0SmmuNode), __STYX_ID_MAPPING_SINGLE(0x01, Eth0SmmuNode), @@ -185,14
[edk2-devel] [PATCH edk2-platforms v2 0/8] fixes and updates for AMD OverDrive
Fix some issues in the ACPI and DT descriptions of the SMMU routing, in particular the routing of the CCP crypto accelerator, which sits behind an SMMU as well on B1 silicon (but not on B0, strangely enough) Changes since v1: - add Leif's ack to patches #1, #2 and #4 - add patches to fix some errors and inaccuracies in the DT - update the DT generation code to emit interrupt affinity for the PMU node - update the DT generation code to emit a description of the cache topology - stop emitting the obsolete linux,phandle properties Ard Biesheuvel (8): Platform/Overdrive: add missing resolution for FileHandleLib Platform/Overdrive: clean up stream ID descriptions in DT Platform/Overdrive: fix a typo in the DT Silicon/AMD/Styx: clean up stream ID mappings for SMMU Silicon/AMD/StyxDtbLoaderLib: add interrupt-affinity property to PMU node Silicon/AMD/StyxDtbLoaderLib: add description of the cache topology Silicon/AMD/StyxDtbLoaderLib: use Cortex-A57 IDs instead of generic ARMv8 Silicon/AMD/StyxDtbLoaderLib: omit linux,phandle properties .../DeviceTree/OverdriveBoard.dts | 25 ++-- .../AMD/OverdriveBoard/OverdriveBoard.dsc | 2 +- .../Drivers/AcpiPlatformDxe/AcpiPlatform.c| 5 - .../Styx/Drivers/AcpiPlatformDxe/Iort.aslc| 117 -- .../StyxDtbLoaderLib/StyxDtbLoaderLib.c | 113 - 5 files changed, 120 insertions(+), 142 deletions(-) -- 2.17.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51363): https://edk2.groups.io/g/devel/message/51363 Mute This Topic: https://groups.io/mt/62736677/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH edk2-platforms v2 8/8] Silicon/AMD/StyxDtbLoaderLib: omit linux,phandle properties
The linux,phandle property is a deprecated alias for the phandle property which was standardized long ago, so don't bother emitting it. Signed-off-by: Ard Biesheuvel --- Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c | 1 - 1 file changed, 1 deletion(-) diff --git a/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c b/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c index 091d151ac722..6ce694573f9f 100644 --- a/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c +++ b/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c @@ -397,7 +397,6 @@ PrepareFdt ( } Phandle[Index] = fdt_alloc_phandle (Fdt); fdt_setprop_cell (Fdt, CpuNode, "phandle", Phandle[Index]); -fdt_setprop_cell (Fdt, CpuNode, "linux,phandle", Phandle[Index]); fdt_setprop_string (Fdt, CpuNode, "enable-method", "psci"); -- 2.17.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51371): https://edk2.groups.io/g/devel/message/51371 Mute This Topic: https://groups.io/mt/62737086/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH edk2-platforms v2 6/8] Silicon/AMD/StyxDtbLoaderLib: add description of the cache topology
Emit the cache topology into the device tree too when generating the CPU nodes and the cpu-map. Note that the cache geometries are all fixed and thus hardcoded - the only runtime variable aspect is how many L2 nodes to generate (one per detected cluster) Signed-off-by: Ard Biesheuvel --- Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c | 49 1 file changed, 49 insertions(+) diff --git a/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c b/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c index 2f7b5e2a7b25..e723e77c7965 100644 --- a/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c +++ b/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c @@ -305,6 +305,10 @@ PrepareFdt ( UINT32 ClusterCount; UINT32 CoresInCluster; UINT32 ClusterId; + INT32 L2Node; + INT32 L3Node; + INT32 L2Phandle[NUM_CORES / 2]; + INT32 L3Phandle; UINTN MpId; CHAR8 Name[10]; AMD_MP_CORE_INFO_PROTOCOL *AmdMpCoreInfoProtocol; @@ -328,6 +332,42 @@ PrepareFdt ( ASSERT (ArmCoreInfoTable != NULL); ASSERT (ArmCoreCount <= NUM_CORES); + // Create the L3 cache node + L3Node = fdt_add_subnode (Fdt, 0, "l3cache"); + if (L3Node < 0) { +DEBUG ((DEBUG_ERROR, "FDT: Error creating 'l3cache' node\n")); +return EFI_INVALID_PARAMETER; + } + + L3Phandle = fdt_alloc_phandle (Fdt); + fdt_setprop_cell (Fdt, L3Node, "cache-level", 3); + fdt_setprop_cell (Fdt, L3Node, "cache-size", SIZE_8MB); + fdt_setprop_cell (Fdt, L3Node, "cache-line-size", 64); + fdt_setprop_cell (Fdt, L3Node, "cache-sets", 8192); + fdt_setprop_empty (Fdt, L3Node, "cache-unified"); + fdt_setprop_cell (Fdt, L3Node, "phandle", L3Phandle); + + ClusterCount = NumberOfClustersInTable (ArmCoreInfoTable, ArmCoreCount); + ASSERT (ClusterCount <= ARRAY_SIZE (L2Phandle)); + + for (Index = 0; Index < ClusterCount; Index++) { +AsciiSPrint (Name, sizeof (Name), "l2cache%d", Index); + +L2Node = fdt_add_subnode (Fdt, 0, Name); +if (L2Node < 0) { + DEBUG ((DEBUG_ERROR, "FDT: Error creating '%a' node\n", Name)); + return EFI_INVALID_PARAMETER; +} + +L2Phandle[Index] = fdt_alloc_phandle (Fdt); +fdt_setprop_cell (Fdt, L2Node, "cache-size", SIZE_1MB); +fdt_setprop_cell (Fdt, L2Node, "cache-line-size", 64); +fdt_setprop_cell (Fdt, L2Node, "cache-sets", 1024); +fdt_setprop_empty (Fdt, L2Node, "cache-unified"); +fdt_setprop_cell (Fdt, L2Node, "next-level-cache", L3Phandle); +fdt_setprop_cell (Fdt, L2Node, "phandle", L2Phandle[Index]); + } + // Get Id from primary CPU MpId = (UINTN)ArmReadMpidr (); @@ -367,6 +407,15 @@ PrepareFdt ( fdt_setprop (Fdt, CpuNode, "reg", , sizeof (MpId)); fdt_setprop_string (Fdt, CpuNode, "compatible", "arm,armv8"); fdt_setprop_string (Fdt, CpuNode, "device_type", "cpu"); + +fdt_setprop_cell (Fdt, CpuNode, "i-cache-size", 3 * SIZE_16KB); +fdt_setprop_cell (Fdt, CpuNode, "i-cache-line-size", 64); +fdt_setprop_cell (Fdt, CpuNode, "i-cache-sets", 256); +fdt_setprop_cell (Fdt, CpuNode, "d-cache-size", 2 * SIZE_16KB); +fdt_setprop_cell (Fdt, CpuNode, "d-cache-line-size", 64); +fdt_setprop_cell (Fdt, CpuNode, "d-cache-sets", 256); +fdt_setprop_cell (Fdt, CpuNode, "l2-cache", + L2Phandle[ArmCoreInfoTable[Index].ClusterId]); } // Create /cpu-map node -- 2.17.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51369): https://edk2.groups.io/g/devel/message/51369 Mute This Topic: https://groups.io/mt/62736997/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH edk2-platforms v2 7/8] Silicon/AMD/StyxDtbLoaderLib: use Cortex-A57 IDs instead of generic ARMv8
Use the more precise Cortex-A57 based compatible strings to describe the CPUs and the PMUs in the device tree. Signed-off-by: Ard Biesheuvel --- Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c b/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c index e723e77c7965..091d151ac722 100644 --- a/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c +++ b/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c @@ -405,7 +405,7 @@ PrepareFdt ( ArmCoreInfoTable[Index].CoreId); MpId = cpu_to_fdt64 (MpId); fdt_setprop (Fdt, CpuNode, "reg", , sizeof (MpId)); -fdt_setprop_string (Fdt, CpuNode, "compatible", "arm,armv8"); +fdt_setprop_string (Fdt, CpuNode, "compatible", "arm,cortex-a57"); fdt_setprop_string (Fdt, CpuNode, "device_type", "cpu"); fdt_setprop_cell (Fdt, CpuNode, "i-cache-size", 3 * SIZE_16KB); @@ -474,7 +474,7 @@ PrepareFdt ( // Create /pmu node PmuNode = fdt_add_subnode(Fdt, 0, "pmu"); if (PmuNode >= 0) { -fdt_setprop_string (Fdt, PmuNode, "compatible", "arm,armv8-pmuv3"); +fdt_setprop_string (Fdt, PmuNode, "compatible", "arm,cortex-a57-pmu"); // append PMU interrupts for (Index = 0; Index < ArmCoreCount; Index++) { -- 2.17.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51370): https://edk2.groups.io/g/devel/message/51370 Mute This Topic: https://groups.io/mt/62737049/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH edk2-platforms v2 2/8] Platform/Overdrive: clean up stream ID descriptions in DT
Align the DT description of the SMMU topology and stream IDs with the actual routing of the SoC. As with the preceding IORT change, this is mostly a cleanup exercise, but it does actually fix an issue with the CCP crypto accelerator on B1 silicon. Since the CCP shares its SMMU with the second SATA controller, which is only enabled on B1 silicon, we can drop the logic that disables this SMMU on B0 silicon or on platforms that do not expose any SATA ports on the second controller (such as the Cello). Signed-off-by: Ard Biesheuvel Acked-by: Leif Lindholm --- Platform/AMD/OverdriveBoard/DeviceTree/OverdriveBoard.dts| 23 +++- Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c | 6 + 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Platform/AMD/OverdriveBoard/DeviceTree/OverdriveBoard.dts b/Platform/AMD/OverdriveBoard/DeviceTree/OverdriveBoard.dts index 1ba0d403eaf0..1d8a6caafd82 100644 --- a/Platform/AMD/OverdriveBoard/DeviceTree/OverdriveBoard.dts +++ b/Platform/AMD/OverdriveBoard/DeviceTree/OverdriveBoard.dts @@ -86,7 +86,7 @@ */ <0 332 4>, <0 332 4>; - #iommu-cells = <2>; + #iommu-cells = <1>; dma-coherent; }; @@ -99,7 +99,7 @@ */ <0 331 4>, <0 331 4>; - #iommu-cells = <2>; + #iommu-cells = <1>; dma-coherent; }; @@ -109,7 +109,12 @@ interrupts = <0x0 0x163 0x4>; clocks = <_clk>; dma-coherent; - iommus = <_smmu 0x00 0x1f>; /* 0-31 */ + iommus = <_smmu 0x0a>, +<_smmu 0x0b>, +<_smmu 0x0e>, +<_smmu 0x0f>, +<_smmu 0x1a>, +<_smmu 0x1e>; }; sata@e0d0 { @@ -119,7 +124,9 @@ interrupts = <0x0 0x162 0x4>; clocks = <_clk>; dma-coherent; - iommus = <_smmu 0x00 0x1f>; /* 0-31 */ + iommus = <_smmu 0x0e>, +<_smmu 0x0f>, +<_smmu 0x1e>; }; i2c@e100 { @@ -233,6 +240,10 @@ interrupts = <0x0 0x3 0x4>; dma-coherent; amd,zlib-support = <0x1>; + iommus = <_smmu 0x00>, +<_smmu 0x02>, +<_smmu 0x40>, +<_smmu 0x42>; }; pcie: pcie@f000 { @@ -409,7 +420,7 @@ phy-handle = <_phy>; phy-mode = "xgmii"; dma-coherent; - iommus = <_smmu 0x00 0x1f>; /* 0-31 */ + iommus = <_smmu 0x00 0x17>; /* 0-7, 16-23 */ }; xgmac@e090 { @@ -428,7 +439,7 @@ phy-handle = <_phy>; phy-mode = "xgmii"; dma-coherent; - iommus = <_smmu 0x00 0x1f>; /* 0-31 */ + iommus = <_smmu 0x00 0x17>; /* 0-7, 16-23 */ }; }; diff --git a/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c b/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c index c84c1a81c3ec..261b5f59c8df 100644 --- a/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c +++ b/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c @@ -212,8 +212,6 @@ DisableSmmu ( Node = fdt_path_offset (Fdt, SmmuNodeName); if (Node <= 0) { -DEBUG ((DEBUG_WARN, "%a: Failed to find path %s: %a\n", - __FUNCTION__, SmmuNodeName, fdt_strerror (Node))); return; } @@ -251,9 +249,7 @@ SetSocIdStatus ( if (!PcdGetBool (PcdEnableSmmus)) { DisableSmmu (Fdt, "iommu-map", "/smb/smmu@e0a0", "/smb/pcie@f000"); DisableSmmu (Fdt, "iommus", "/smb/smmu@e020", "/smb/sata@e030"); - } - - if (!PcdGetBool (PcdEnableSmmus) || !IsRevB1 || FixedPcdGet8 (PcdSata1PortCount) == 0) { +DisableSmmu (Fdt, "iommus", "/smb/smmu@e0c0", "/smb/ccp@e010"); DisableSmmu (Fdt, "iommus", "/smb/smmu@e0c0", "/smb/sata@e0d0"); } -- 2.17.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51365): https://edk2.groups.io/g/devel/message/51365 Mute This Topic: https://groups.io/mt/62736781/21656 Group Owner:
[edk2-devel] [PATCH edk2-platforms v2 1/8] Platform/Overdrive: add missing resolution for FileHandleLib
Changes to the core EDK2 repository have caused the build for Overdrive to break. Move the existing FileHandleLib resolution to global scope to get things working again. Signed-off-by: Ard Biesheuvel Acked-by: Leif Lindholm --- Platform/AMD/OverdriveBoard/OverdriveBoard.dsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc b/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc index 7369173cc125..5a38b9dd96ae 100644 --- a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc +++ b/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc @@ -142,6 +142,7 @@ [LibraryClasses.common] DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf + FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf @@ -697,7 +698,6 @@ [Components.common] PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf - FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf -- 2.17.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51364): https://edk2.groups.io/g/devel/message/51364 Mute This Topic: https://groups.io/mt/62736729/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH edk2-platforms v2 3/8] Platform/Overdrive: fix a typo in the DT
DT unit addresses are hex quantities but they should not include the 0x prefix. Signed-off-by: Ard Biesheuvel --- Platform/AMD/OverdriveBoard/DeviceTree/OverdriveBoard.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Platform/AMD/OverdriveBoard/DeviceTree/OverdriveBoard.dts b/Platform/AMD/OverdriveBoard/DeviceTree/OverdriveBoard.dts index 1d8a6caafd82..a92ab695fb2e 100644 --- a/Platform/AMD/OverdriveBoard/DeviceTree/OverdriveBoard.dts +++ b/Platform/AMD/OverdriveBoard/DeviceTree/OverdriveBoard.dts @@ -291,7 +291,7 @@ dma-coherent; }; - ccn@0xe800 { + ccn@e800 { compatible = "arm,ccn-504"; reg = <0x0 0xe800 0x0 0x100>; interrupts = <0x0 0x17c 0x4>; -- 2.17.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51366): https://edk2.groups.io/g/devel/message/51366 Mute This Topic: https://groups.io/mt/62736828/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH edk2-platforms v2 5/8] Silicon/AMD/StyxDtbLoaderLib: add interrupt-affinity property to PMU node
AMD Seattle uses a range of SPIs to signal PMU events, and this requires a description in the DT which SPI maps to which CPU. This requires us to defer the generation of the PMU node to a point where the CPU phandles have been allocated. Signed-off-by: Ard Biesheuvel --- Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c | 55 ++-- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c b/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c index 261b5f59c8df..2f7b5e2a7b25 100644 --- a/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c +++ b/Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c @@ -331,33 +331,6 @@ PrepareFdt ( // Get Id from primary CPU MpId = (UINTN)ArmReadMpidr (); - // Create /pmu node - PmuNode = fdt_add_subnode(Fdt, 0, "pmu"); - if (PmuNode >= 0) { -fdt_setprop_string (Fdt, PmuNode, "compatible", "arm,armv8-pmuv3"); - -// append PMU interrupts -for (Index = 0; Index < ArmCoreCount; Index++) { - MpId = (UINTN)GET_MPID (ArmCoreInfoTable[Index].ClusterId, - ArmCoreInfoTable[Index].CoreId); - - Status = AmdMpCoreInfoProtocol->GetPmuSpiFromMpId (MpId, ); - if (EFI_ERROR (Status)) { -DEBUG ((DEBUG_ERROR, - "FDT: Error getting PMU interrupt for MpId '0x%x'\n", MpId)); -return Status; - } - - PmuInt.Flag = cpu_to_fdt32 (PMU_INT_FLAG_SPI); - PmuInt.IntId = cpu_to_fdt32 (PmuInt.IntId); - PmuInt.Type = cpu_to_fdt32 (PMU_INT_TYPE_HIGH_LEVEL); - fdt_appendprop (Fdt, PmuNode, "interrupts", , sizeof(PmuInt)); -} - } else { -DEBUG ((DEBUG_ERROR, "FDT: Error creating 'pmu' node\n")); -return EFI_INVALID_PARAMETER; - } - // Create /cpus noide Node = fdt_add_subnode (Fdt, 0, "cpus"); if (Node >= 0) { @@ -449,6 +422,34 @@ PrepareFdt ( return EFI_INVALID_PARAMETER; } + // Create /pmu node + PmuNode = fdt_add_subnode(Fdt, 0, "pmu"); + if (PmuNode >= 0) { +fdt_setprop_string (Fdt, PmuNode, "compatible", "arm,armv8-pmuv3"); + +// append PMU interrupts +for (Index = 0; Index < ArmCoreCount; Index++) { + MpId = (UINTN)GET_MPID (ArmCoreInfoTable[Index].ClusterId, + ArmCoreInfoTable[Index].CoreId); + + Status = AmdMpCoreInfoProtocol->GetPmuSpiFromMpId (MpId, ); + if (EFI_ERROR (Status)) { +DEBUG ((DEBUG_ERROR, + "FDT: Error getting PMU interrupt for MpId '0x%x'\n", MpId)); +return Status; + } + + PmuInt.Flag = cpu_to_fdt32 (PMU_INT_FLAG_SPI); + PmuInt.IntId = cpu_to_fdt32 (PmuInt.IntId); + PmuInt.Type = cpu_to_fdt32 (PMU_INT_TYPE_HIGH_LEVEL); + fdt_appendprop (Fdt, PmuNode, "interrupts", , sizeof(PmuInt)); + fdt_appendprop_cell (Fdt, PmuNode, "interrupt-affinity", Phandle[Index]); +} + } else { +DEBUG ((DEBUG_ERROR, "FDT: Error creating 'pmu' node\n")); +return EFI_INVALID_PARAMETER; + } + SetSocIdStatus (Fdt); SetXgbeStatus (Fdt); -- 2.17.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51368): https://edk2.groups.io/g/devel/message/51368 Mute This Topic: https://groups.io/mt/62736947/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [edk2-platforms][PATCH V1 1/2] KabylakeSiliconPkg: Remove ResetSystemLib.h override
This dependency existed prior to this change (and still does exist). It was obfuscated in such a way that contributed to this problem. See the previous library header path: \Silicon\Intel\KabylakeSiliconPkg\SampleCode\MdeModulePkg\Include\Library\ResetSystemLib.h The fact KabylakeSiliconPkg implements a MdeModulePkg library API introduces the dependency on MdeModulePkg. Hiding a redundant definition of the API locally does not eliminate the dependency in any meaningful way. I think the practice of "freezing" an API with a local copy only works if the codebase is locked onto a specific stable tag in which the upstream API is not expected to change. Zhichao rightfully added the new function definition to the KabylakeSiliconPkg library class implementation because a board package consumer would expect a ResetSystemLib library class instance to be compliant with the API defined in MdeModulePkg and link the ResetSystem () function. The only problem was a set of circumstances that led to the duplicate symbol definition for ResetSystem () with PchResetLib. So I view the task of eliminating the package dependency as a larger separate effort outside the scope of this change. But I do not agree with maintaining redundant local copies of edk2 APIs in packages in edk2-platforms. Thanks, Michael > -Original Message- > From: Chaganty, Rangasai V > Sent: Tuesday, November 26, 2019 10:43 PM > To: Kubacki, Michael A ; > devel@edk2.groups.io > Cc: Chiu, Chasel ; Desimone, Nathaniel L > ; Gao, Zhichao > Subject: RE: [edk2-platforms][PATCH V1 1/2] KabylakeSiliconPkg: Remove > ResetSystemLib.h override > > This change is introducing SiliconPkg's dependency on MdeModulePkg. > SiliconPkg dependencies should be limited to a selected few packages and > this seems to be an unnecessary addition to the dependency list. > The reset interfaces are providing generic reset services and perhaps better > suited in packages like MdePkg. > > -Original Message- > From: Kubacki, Michael A > Sent: Tuesday, November 26, 2019 6:57 PM > To: devel@edk2.groups.io > Cc: Chaganty, Rangasai V ; Chiu, Chasel > ; Desimone, Nathaniel L > ; Gao, Zhichao > Subject: [edk2-platforms][PATCH V1 1/2] KabylakeSiliconPkg: Remove > ResetSystemLib.h override > > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2375 > > Removes a stale ResetSystemLib.h override in KabylakeSiliconPkg that does > not contain the prototype for ResetSystem () and ResetPlatformSpecific (). > > The ResetSystemLib.h file from MdeModulePkg will be used. Any INF files > that did not include the MdeModulePkg.dec under [Packages] were updated > to do so. > > Cc: Sai Chaganty > Cc: Chasel Chiu > Cc: Nate DeSimone > Cc: Zhichao Gao > Signed-off-by: Michael Kubacki > --- > > Silicon/Intel/KabylakeSiliconPkg/Pch/Library/DxeResetSystemLib/DxeResetS > ystemLib.inf | 3 +- > > Silicon/Intel/KabylakeSiliconPkg/Pch/Library/DxeRuntimeResetSystemLib/Dx > eRuntimeResetSystemLib.inf | 3 +- > > Silicon/Intel/KabylakeSiliconPkg/Pch/Library/PeiPchResetLib/PeiPchResetLib. > inf | 3 +- > > Silicon/Intel/KabylakeSiliconPkg/Pch/Library/PeiResetSystemLib/PeiResetSys > temLib.inf | 3 +- > > Silicon/Intel/KabylakeSiliconPkg/SampleCode/MdeModulePkg/Include/Libra > ry/ResetSystemLib.h | 62 > 5 files changed, 8 insertions(+), 66 deletions(-) > > diff --git > a/Silicon/Intel/KabylakeSiliconPkg/Pch/Library/DxeResetSystemLib/DxeRese > tSystemLib.inf > b/Silicon/Intel/KabylakeSiliconPkg/Pch/Library/DxeResetSystemLib/DxeRese > tSystemLib.inf > index aa8877140a..46313bf35f 100644 > --- > a/Silicon/Intel/KabylakeSiliconPkg/Pch/Library/DxeResetSystemLib/DxeRese > tSystemLib.inf > +++ b/Silicon/Intel/KabylakeSiliconPkg/Pch/Library/DxeResetSystemLib/Dxe > +++ ResetSystemLib.inf > @@ -1,7 +1,7 @@ > ## @file > # Component description file for Intel Ich7 Reset System Library. > # > -# Copyright (c) 2017, Intel Corporation. All rights reserved. > +# Copyright (c) 2017 - 2019, Intel Corporation. All rights > +reserved. > # > # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -35,6 +35,7 @@ > PchCycleDecodingLib > > [Packages] > MdePkg/MdePkg.dec > +MdeModulePkg/MdeModulePkg.dec > KabylakeSiliconPkg/SiPkg.dec > > > diff --git > a/Silicon/Intel/KabylakeSiliconPkg/Pch/Library/DxeRuntimeResetSystemLib/ > DxeRuntimeResetSystemLib.inf > b/Silicon/Intel/KabylakeSiliconPkg/Pch/Library/DxeRuntimeResetSystemLib/ > DxeRuntimeResetSystemLib.inf > index 6b27661603..c7fad31c71 100644 > --- > a/Silicon/Intel/KabylakeSiliconPkg/Pch/Library/DxeRuntimeResetSystemLib/ > DxeRuntimeResetSystemLib.inf > +++ > b/Silicon/Intel/KabylakeSiliconPkg/Pch/Library/DxeRuntimeResetSystem > +++ Lib/DxeRuntimeResetSystemLib.inf > @@ -1,7 +1,7 @@ > ## @file > # Component description file for Intel Ich7 Reset System Library. > # > -# Copyright (c) 2017, Intel Corporation. All rights reserved. > +# Copyright (c) 2017
Re: [edk2-devel] [PATCH edk2-platforms 0/3] fixes for AMD OverDrive
On Tue, 26 Nov 2019 at 12:47, Leif Lindholm wrote: > > On Mon, Nov 25, 2019 at 19:07:07 +0100, Ard Biesheuvel wrote: > > Fix some issues in the ACPI and DT descriptions of the SMMU routing, > > in particular the routing of the CCP crypto accelerator, which sits > > behind an SMMU as well on B1 silicon (but not on B0, strangely enough) > > > > Ard Biesheuvel (3): > > Platform/Overdrive: add missing resolution for FileHandleLib > > Silicon/AMD/Styx: clean up stream ID mappings for SMMU > > Platform/Overdrive: clean up stream ID descriptions in DT > > For the series: > Acked-by: Leif Lindholm > Thanks. I'm spinning another version of this series, though ... > > > Platform/AMD/OverdriveBoard/DeviceTree/OverdriveBoard.dts| 19 ++- > > Platform/AMD/OverdriveBoard/OverdriveBoard.dsc | 2 +- > > Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Dsdt.asl| 23 > > Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/Iort.aslc | 137 > > +--- > > Silicon/AMD/Styx/Drivers/AcpiPlatformDxe/SsdtB1.asl | 23 > > Silicon/AMD/Styx/Library/StyxDtbLoaderLib/StyxDtbLoaderLib.c | 5 +- > > 6 files changed, 72 insertions(+), 137 deletions(-) > > > > -- > > 2.20.1 > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51361): https://edk2.groups.io/g/devel/message/51361 Mute This Topic: https://groups.io/mt/61945298/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [edk2-platforms][PATCH 5/5] Platform/RPi: Set SD routing according to model
On 11/27/19 6:04 PM, Leif Lindholm wrote: On Wed, Nov 27, 2019 at 16:33:28 +, Pete Batard wrote: Signed-off-by: Pete Batard ---  Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 137 ++--  1 file changed, 96 insertions(+), 41 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c index 98e58a560ed4..26bc92f28185 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c @@ -1,6 +1,7 @@  /** @file   * - * Copyright (c) 2018, Andrei Warkentin + * Copyright (c) 2019, ARM Limited. All rights reserved. "All rights reserved."? To be honest, that's something that's been bothering me too in this codebase (and some other ones too, where you get to see the same), since there are only so many rights one can reserve when the code is actually governed by the Open Source license being used, and therefore asserting that you reserve "all rights" seems to be in direct conflict with that. However, I am not a lawyer, and this seems to be standard boilerplate being imposed by large companies. For instance, you'll find plenty of instances of it in the existing codebase. E.g. https://github.com/tianocore/edk2/blob/master/ArmPkg/Include/AsmMacroIoLib.h has three separate entities that appear to state that each one holds all the rights to the source, which I can't help by find amusing. I guess we're supposed to understand that each entity reserves all rights to the code they've actually written (including the right to do something that might go against the license, since "All rights" > "Rights to the extent being granted by the BSD"), and that it's up to legal departments to sort up the mess, if mess there is... Yeah, that mostly matches my interpretation. My understanding is that there are certain paranoid interpretations under which you *give away* rights to code you contribute to an open source project - like the right to also publish/contribute the same code under some other license. I don't know if this stems from things like copyright assignment agreements, which (for similar reasons) may explicitly grant back to the contributor a bunch of rights to the contributed code, and various corporate legal departments just blindly require it to be included everywhere. Phil: do a grep in linux, u-boot or qemu. This is silly, but it's commonplace and non-controversial. Sorry for keeping asking about licensing, I'm trying to understand better the situation / status quo, I also am not a lawyer. Thanks both for your explanations :) Then again, while I think I can wrap my head against what copyright entails, I'm not sure I completely get what these additional "rights" are supposed to mean in this context (my current take being that we're supposed to be believe that there exists an implicit grandfathered license, which gives all rights to the parent company, and that governs a virtual version of the source code containing only the changes that the developer applied, and therefore that the BSD licensed version of the source that is then made public is meant to be seen as a derivative of this virtual "All rights reserved" incomplete source, hence granting a partial "All rights" for said source to the company, if that makes any sense), so it may be good for someone with better understanding of this to clarify, or point to a place where this might be explained. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51360): https://edk2.groups.io/g/devel/message/51360 Mute This Topic: https://groups.io/mt/62504750/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [edk2-platforms][PATCH 5/5] Platform/RPi: Set SD routing according to model
On Wed, Nov 27, 2019 at 16:33:28 +, Pete Batard wrote: > > > Signed-off-by: Pete Batard > > > --- > > > Â Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 137 > > > ++-- > > > Â 1 file changed, 96 insertions(+), 41 deletions(-) > > > > > > diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c > > > b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c > > > index 98e58a560ed4..26bc92f28185 100644 > > > --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c > > > +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c > > > @@ -1,6 +1,7 @@ > > > Â /** @file > > > Â Â * > > > - *Â Copyright (c) 2018, Andrei Warkentin > > > + *Â Copyright (c) 2019, ARM Limited. All rights reserved. > > > > "All rights reserved."? > > To be honest, that's something that's been bothering me too in this codebase > (and some other ones too, where you get to see the same), since there are > only so many rights one can reserve when the code is actually governed by > the Open Source license being used, and therefore asserting that you reserve > "all rights" seems to be in direct conflict with that. > > However, I am not a lawyer, and this seems to be standard boilerplate being > imposed by large companies. For instance, you'll find plenty of instances of > it in the existing codebase. E.g. > https://github.com/tianocore/edk2/blob/master/ArmPkg/Include/AsmMacroIoLib.h > has three separate entities that appear to state that each one holds all the > rights to the source, which I can't help by find amusing. > > I guess we're supposed to understand that each entity reserves all rights to > the code they've actually written (including the right to do something that > might go against the license, since "All rights" > "Rights to the extent > being granted by the BSD"), and that it's up to legal departments to sort up > the mess, if mess there is... Yeah, that mostly matches my interpretation. My understanding is that there are certain paranoid interpretations under which you *give away* rights to code you contribute to an open source project - like the right to also publish/contribute the same code under some other license. I don't know if this stems from things like copyright assignment agreements, which (for similar reasons) may explicitly grant back to the contributor a bunch of rights to the contributed code, and various corporate legal departments just blindly require it to be included everywhere. Phil: do a grep in linux, u-boot or qemu. This is silly, but it's commonplace and non-controversial. / Leif > Then again, while I think I can wrap my head against what copyright entails, > I'm not sure I completely get what these additional "rights" are supposed to > mean in this context (my current take being that we're supposed to be > believe that there exists an implicit grandfathered license, which gives all > rights to the parent company, and that governs a virtual version of the > source code containing only the changes that the developer applied, and > therefore that the BSD licensed version of the source that is then made > public is meant to be seen as a derivative of this virtual "All rights > reserved" incomplete source, hence granting a partial "All rights" for said > source to the company, if that makes any sense), so it may be good for > someone with better understanding of this to clarify, or point to a place > where this might be explained. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51359): https://edk2.groups.io/g/devel/message/51359 Mute This Topic: https://groups.io/mt/62504750/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [edk2-platforms][PATCH 5/5] Platform/RPi: Set SD routing according to model
On 2019.11.27 15:24, Philippe Mathieu-Daudé wrote: On 11/27/19 1:37 PM, Pete Batard wrote: From: Samer El-Haj-Mahmoud The Raspberry Pi 4 has a new SD controller. As a result we must handle SD routing according to the model, which we perform in the Config driver by using the GetModelFamily () call that was recently introduced. Signed-off-by: Pete Batard ---  Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 137 ++--  1 file changed, 96 insertions(+), 41 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c index 98e58a560ed4..26bc92f28185 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c @@ -1,6 +1,7 @@  /** @file   * - * Copyright (c) 2018, Andrei Warkentin + * Copyright (c) 2019, ARM Limited. All rights reserved. "All rights reserved."? To be honest, that's something that's been bothering me too in this codebase (and some other ones too, where you get to see the same), since there are only so many rights one can reserve when the code is actually governed by the Open Source license being used, and therefore asserting that you reserve "all rights" seems to be in direct conflict with that. However, I am not a lawyer, and this seems to be standard boilerplate being imposed by large companies. For instance, you'll find plenty of instances of it in the existing codebase. E.g. https://github.com/tianocore/edk2/blob/master/ArmPkg/Include/AsmMacroIoLib.h has three separate entities that appear to state that each one holds all the rights to the source, which I can't help by find amusing. I guess we're supposed to understand that each entity reserves all rights to the code they've actually written (including the right to do something that might go against the license, since "All rights" > "Rights to the extent being granted by the BSD"), and that it's up to legal departments to sort up the mess, if mess there is... Then again, while I think I can wrap my head against what copyright entails, I'm not sure I completely get what these additional "rights" are supposed to mean in this context (my current take being that we're supposed to be believe that there exists an implicit grandfathered license, which gives all rights to the parent company, and that governs a virtual version of the source code containing only the changes that the developer applied, and therefore that the BSD licensed version of the source that is then made public is meant to be seen as a derivative of this virtual "All rights reserved" incomplete source, hence granting a partial "All rights" for said source to the company, if that makes any sense), so it may be good for someone with better understanding of this to clarify, or point to a place where this might be explained. + * Copyright (c) 2018 - 2019, Andrei Warkentin   *   * SPDX-License-Identifier: BSD-2-Clause-Patent   * @@ -9,10 +10,12 @@  #include  #include  #include +#include  #include  #include  #include  #include +#include  #include  #include  #include @@ -212,6 +215,7 @@ ApplyVariables (    UINT32 CpuClock = PcdGet32 (PcdCpuClock);    UINT32 CustomCpuClock = PcdGet32 (PcdCustomCpuClock);    UINT32 Rate = 0; + UINT32 ModelFamily = 0;    if (CpuClock != 0) {  if (CpuClock == 2) { @@ -245,51 +249,102 @@ ApplyVariables (  DEBUG ((DEBUG_INFO, "Current CPU speed is %uHz\n", Rate));    } - /* -  * Switching two groups around, so disable both first. -  * -  * No, I've not seen a problem, but having a group be -  * routed to two sets of pins seems like asking for trouble. -  */ - GpioPinFuncSet (34, GPIO_FSEL_INPUT); - GpioPinFuncSet (35, GPIO_FSEL_INPUT); - GpioPinFuncSet (36, GPIO_FSEL_INPUT); - GpioPinFuncSet (37, GPIO_FSEL_INPUT); - GpioPinFuncSet (38, GPIO_FSEL_INPUT); - GpioPinFuncSet (39, GPIO_FSEL_INPUT); - GpioPinFuncSet (48, GPIO_FSEL_INPUT); - GpioPinFuncSet (49, GPIO_FSEL_INPUT); - GpioPinFuncSet (50, GPIO_FSEL_INPUT); - GpioPinFuncSet (51, GPIO_FSEL_INPUT); - GpioPinFuncSet (52, GPIO_FSEL_INPUT); - GpioPinFuncSet (53, GPIO_FSEL_INPUT); - if (PcdGet32 (PcdSdIsArasan)) { -   DEBUG ((DEBUG_INFO, "Routing SD to Arasan\n")); -   Gpio48Group = GPIO_FSEL_ALT3; + Status = mFwProtocol->GetModelFamily (); + if (Status != EFI_SUCCESS) { +   DEBUG ((DEBUG_ERROR, "Couldn't get the Raspberry Pi model family: %r\n", Status)); + } else { +   DEBUG ((DEBUG_INFO, "Current Raspberry Pi model family is 0x%x\n", ModelFamily)); + } + + + if (ModelFamily == 3) {  /* - * Route SDIO to SdHost. + * Pi 3: either Arasan or SdHost goes to SD card. + * + * Switching two groups around, so disable both first. + * + * No, I've not seen a problem, but having a group be + * routed to two sets of pins seems like asking for trouble.   */ -   Gpio34Group = GPIO_FSEL_ALT0; - } else { -  Â
[edk2-devel] [PATCH v1 1/1] Maintainers.txt: Update reviewer email address
Created new email account that will not append legal disclaimers to my responses/patches. Cc: Jiaxin Wu Signed-off-by: Maciej Rabeda --- Maintainers.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maintainers.txt b/Maintainers.txt index 180ad35d0976..246583204139 100644 --- a/Maintainers.txt +++ b/Maintainers.txt @@ -379,7 +379,7 @@ F: NetworkPkg/ W: https://github.com/tianocore/tianocore.github.io/wiki/NetworkPkg M: Jiaxin Wu R: Siyuan Fu -R: Maciej Rabeda +R: Maciej Rabeda OvmfPkg F: OvmfPkg/ -- 2.24.0.windows.2 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51355): https://edk2.groups.io/g/devel/message/51355 Mute This Topic: https://groups.io/mt/62570954/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v1 0/1] Maintainers.txt: Update reviewer email address
Created new email account that will not append legal disclaimers to my responses/patches. Cc: Jiaxin Wu Maciej Rabeda (1): Maintainers.txt: Update reviewer email address Maintainers.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.24.0.windows.2 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51354): https://edk2.groups.io/g/devel/message/51354 Mute This Topic: https://groups.io/mt/62570951/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v1 0/1] Maintainers.txt: Update reviewer email address
Created new email account that will not append legal disclaimers to my responses/patches. Cc: Jiaxin Wu Maciej Rabeda (1): Maintainers.txt: Update reviewer email address Maintainers.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.24.0.windows.2 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51356): https://edk2.groups.io/g/devel/message/51356 Mute This Topic: https://groups.io/mt/62570951/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v1 1/1] Maintainers.txt: Update reviewer email address
Created new email account that will not append legal disclaimers to my responses/patches. Cc: Jiaxin Wu Signed-off-by: Maciej Rabeda --- Maintainers.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maintainers.txt b/Maintainers.txt index 180ad35d0976..246583204139 100644 --- a/Maintainers.txt +++ b/Maintainers.txt @@ -379,7 +379,7 @@ F: NetworkPkg/ W: https://github.com/tianocore/tianocore.github.io/wiki/NetworkPkg M: Jiaxin Wu R: Siyuan Fu -R: Maciej Rabeda +R: Maciej Rabeda OvmfPkg F: OvmfPkg/ -- 2.24.0.windows.2 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51353): https://edk2.groups.io/g/devel/message/51353 Mute This Topic: https://groups.io/mt/62570949/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [edk2-platforms][PATCH 5/5] Platform/RPi: Set SD routing according to model
On 11/27/19 1:37 PM, Pete Batard wrote: From: Samer El-Haj-Mahmoud The Raspberry Pi 4 has a new SD controller. As a result we must handle SD routing according to the model, which we perform in the Config driver by using the GetModelFamily () call that was recently introduced. Signed-off-by: Pete Batard --- Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 137 ++-- 1 file changed, 96 insertions(+), 41 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c index 98e58a560ed4..26bc92f28185 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c @@ -1,6 +1,7 @@ /** @file * - * Copyright (c) 2018, Andrei Warkentin + * Copyright (c) 2019, ARM Limited. All rights reserved. "All rights reserved."? + * Copyright (c) 2018 - 2019, Andrei Warkentin * * SPDX-License-Identifier: BSD-2-Clause-Patent * @@ -9,10 +10,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -212,6 +215,7 @@ ApplyVariables ( UINT32 CpuClock = PcdGet32 (PcdCpuClock); UINT32 CustomCpuClock = PcdGet32 (PcdCustomCpuClock); UINT32 Rate = 0; + UINT32 ModelFamily = 0; if (CpuClock != 0) { if (CpuClock == 2) { @@ -245,51 +249,102 @@ ApplyVariables ( DEBUG ((DEBUG_INFO, "Current CPU speed is %uHz\n", Rate)); } - /* - * Switching two groups around, so disable both first. - * - * No, I've not seen a problem, but having a group be - * routed to two sets of pins seems like asking for trouble. - */ - GpioPinFuncSet (34, GPIO_FSEL_INPUT); - GpioPinFuncSet (35, GPIO_FSEL_INPUT); - GpioPinFuncSet (36, GPIO_FSEL_INPUT); - GpioPinFuncSet (37, GPIO_FSEL_INPUT); - GpioPinFuncSet (38, GPIO_FSEL_INPUT); - GpioPinFuncSet (39, GPIO_FSEL_INPUT); - GpioPinFuncSet (48, GPIO_FSEL_INPUT); - GpioPinFuncSet (49, GPIO_FSEL_INPUT); - GpioPinFuncSet (50, GPIO_FSEL_INPUT); - GpioPinFuncSet (51, GPIO_FSEL_INPUT); - GpioPinFuncSet (52, GPIO_FSEL_INPUT); - GpioPinFuncSet (53, GPIO_FSEL_INPUT); - if (PcdGet32 (PcdSdIsArasan)) { -DEBUG ((DEBUG_INFO, "Routing SD to Arasan\n")); -Gpio48Group = GPIO_FSEL_ALT3; + Status = mFwProtocol->GetModelFamily (); + if (Status != EFI_SUCCESS) { +DEBUG ((DEBUG_ERROR, "Couldn't get the Raspberry Pi model family: %r\n", Status)); + } else { +DEBUG ((DEBUG_INFO, "Current Raspberry Pi model family is 0x%x\n", ModelFamily)); + } + + + if (ModelFamily == 3) { /* - * Route SDIO to SdHost. + * Pi 3: either Arasan or SdHost goes to SD card. + * + * Switching two groups around, so disable both first. + * + * No, I've not seen a problem, but having a group be + * routed to two sets of pins seems like asking for trouble. */ -Gpio34Group = GPIO_FSEL_ALT0; - } else { -DEBUG ((DEBUG_INFO, "Routing SD to SdHost\n")); -Gpio48Group = GPIO_FSEL_ALT0; +GpioPinFuncSet (34, GPIO_FSEL_INPUT); +GpioPinFuncSet (35, GPIO_FSEL_INPUT); +GpioPinFuncSet (36, GPIO_FSEL_INPUT); +GpioPinFuncSet (37, GPIO_FSEL_INPUT); +GpioPinFuncSet (38, GPIO_FSEL_INPUT); +GpioPinFuncSet (39, GPIO_FSEL_INPUT); +GpioPinFuncSet (48, GPIO_FSEL_INPUT); +GpioPinFuncSet (49, GPIO_FSEL_INPUT); +GpioPinFuncSet (50, GPIO_FSEL_INPUT); +GpioPinFuncSet (51, GPIO_FSEL_INPUT); +GpioPinFuncSet (52, GPIO_FSEL_INPUT); +GpioPinFuncSet (53, GPIO_FSEL_INPUT); + +if (PcdGet32 (PcdSdIsArasan)) { + DEBUG ((DEBUG_INFO, "Routing SD to Arasan\n")); + Gpio48Group = GPIO_FSEL_ALT3; + /* + * Route SDIO to SdHost. + */ + Gpio34Group = GPIO_FSEL_ALT0; +} else { + DEBUG ((DEBUG_INFO, "Routing SD to SdHost\n")); + Gpio48Group = GPIO_FSEL_ALT0; + /* + * Route SDIO to Arasan. + */ + Gpio34Group = GPIO_FSEL_ALT3; +} +GpioPinFuncSet (34, Gpio34Group); +GpioPinFuncSet (35, Gpio34Group); +GpioPinFuncSet (36, Gpio34Group); +GpioPinFuncSet (37, Gpio34Group); +GpioPinFuncSet (38, Gpio34Group); +GpioPinFuncSet (39, Gpio34Group); +GpioPinFuncSet (48, Gpio48Group); +GpioPinFuncSet (49, Gpio48Group); +GpioPinFuncSet (50, Gpio48Group); +GpioPinFuncSet (51, Gpio48Group); +GpioPinFuncSet (52, Gpio48Group); +GpioPinFuncSet (53, Gpio48Group); + + } else if (ModelFamily == 4){ Missing space before opening brackets. Patch looks good otherwise. /* - * Route SDIO to Arasan. + * Pi 4: either Arasan or eMMC2 goes to SD card. */ -Gpio34Group = GPIO_FSEL_ALT3; +if (PcdGet32 (PcdSdIsArasan)) { + /* + * WiFi disabled. + */ + GpioPinFuncSet (34, GPIO_FSEL_INPUT); + GpioPinFuncSet (35, GPIO_FSEL_INPUT); + GpioPinFuncSet (36, GPIO_FSEL_INPUT); + GpioPinFuncSet (37, GPIO_FSEL_INPUT); +
Re: [edk2-devel] [edk2-platforms][PATCH 1/5] Silicon/Bcm283x: Clean up Bcm2836.h header
On 11/27/19 3:59 PM, Pete Batard wrote: On 2019.11.27 14:47, Philippe Mathieu-Daudé wrote: On 11/27/19 1:37 PM, Pete Batard wrote: Add missing RNG registers, This is one change. prefer reusing shorter define's instead of PCDs and clean up spacing. This is another change. All these changes belong to a "cleanup" category, which is what, globally, this patch is all about. Of course, I expect people to argue that adding trivial missing data does not count as cleaning up, which I'd disagree with, but then again, it's not my repo. Why suddenly go back to fixed PERIPHERAL block base address? Earlier version was: #define BCM2836_WDOG_BASE_ADDRESS   0x3f10 which we replaced with: #define BCM2836_WDOG_BASE_ADDRESS  (FixedPcdGet64 (PcdBcm283xRegistersAddress) + BCM2836_WDOG_OFFSET) But considering that we have "BCM2836_SOC_REGISTERS" that now equates    "(FixedPcdGet64 (PcdBcm283xRegistersAddress))" we can write the exact same thing as above, only shorter, which we do. I apologize I misread the code, you are right it is cleaner to use BCM2836_SOC_REGISTERS. Thanks for taking time to clarify. I personally find this more understandable for newcomers who'll be looking at the code and easier to maintain. But I'm not the maintainer, so I'll go with whatever suits you. Neither am I, however I'll appreciate if you can keep patches simple, trying to do one atomic change per patch. So my suggestion to split this patch in 2 stands. Anyhow Ard asked for a clone for the RNG part, so this patch need rework. Signed-off-by: Pete Batard ---  Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h | 23  1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h index 72c8e9dc4b14..744c7ac3b9f4 100644 --- a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h +++ b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h @@ -24,8 +24,7 @@  /* watchdog constants */  #define BCM2836_WDOG_OFFSET 0x0010 -#define BCM2836_WDOG_BASE_ADDRESS (FixedPcdGet64 (PcdBcm283xRegistersAddress) \ -   + BCM2836_WDOG_OFFSET) +#define BCM2836_WDOG_BASE_ADDRESS (BCM2836_SOC_REGISTERS + BCM2836_WDOG_OFFSET)  #define BCM2836_WDOG_PASSWORD  0x5a00  #define BCM2836_WDOG_RSTC_OFFSET   0x001c  #define BCM2836_WDOG_WDOG_OFFSET   0x0024 @@ -34,8 +33,7 @@  /* mailbox interface constants */  #define BCM2836_MBOX_OFFSET 0xb880 -#define BCM2836_MBOX_BASE_ADDRESS (FixedPcdGet64 (PcdBcm283xRegistersAddress) \ -   + BCM2836_MBOX_OFFSET) +#define BCM2836_MBOX_BASE_ADDRESS (BCM2836_SOC_REGISTERS + BCM2836_MBOX_OFFSET)  #define BCM2836_MBOX_READ_OFFSET   0x  #define BCM2836_MBOX_STATUS_OFFSET 0x0018  #define BCM2836_MBOX_CONFIG_OFFSET 0x001c @@ -51,12 +49,19 @@  #define BCM2836_INTC_TIMER_PENDING_OFFSET  0x0060  /* random number generator */ -#define RNG_BASE_ADDRESS  (BCM2836_SOC_REGISTERS + 0x00104000) +#define BCM2836_RNG_OFFSET 0x00104000 +#define RNG_BASE_ADDRESS (BCM2836_SOC_REGISTERS + BCM2836_RNG_OFFSET) -#define RNG_CTRL  (RNG_BASE_ADDRESS + 0x0) -#define RNG_STATUS (RNG_BASE_ADDRESS + 0x4) -#define RNG_DATA  (RNG_BASE_ADDRESS + 0x8) +#define RNG_CTRL (RNG_BASE_ADDRESS + 0x0) +#define RNG_STATUS (RNG_BASE_ADDRESS + 0x4) +#define RNG_DATA (RNG_BASE_ADDRESS + 0x8) +#define RNG_BIT_COUNT (RNG_BASE_ADDRESS + 0xc) +#define RNG_BIT_COUNT_THRESHOLD (RNG_BASE_ADDRESS + 0x10) +#define RNG_INT_STATUS (RNG_BASE_ADDRESS + 0x18) +#define RNG_INT_ENABLE (RNG_BASE_ADDRESS + 0x1c) +#define RNG_FIFO_DATA (RNG_BASE_ADDRESS + 0x20) +#define RNG_FIFO_COUNT (RNG_BASE_ADDRESS + 0x24) -#define RNG_CTRL_ENABLE   0x1 +#define RNG_CTRL_ENABLE 0x1  #endif /*__BCM2836_H__ */ -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51350): https://edk2.groups.io/g/devel/message/51350 Mute This Topic: https://groups.io/mt/62504739/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [staging/branch]: CdePkg - added unit test for STDLIB.H functions - atoi(), atol(), strtol(), strtoul(), rand(), srand(), calloc(), free(), malloc(), realloc(), atexit(), exit(), qsort(),
Hi UEFI community, I’d like to inform you about an update in the CdePkg branch of edk2-staging. https://github.com/tianocore/edk2-staging/tree/CdePkg#cdepkg The goal of the CdePkg is to provide an ANSI C Interface for UEFI POST drivers, that enables BIOS engineers to (more) easily port standard C programs or libraries (e.g. the openSSL library, already done) to POST drivers. Furthermore the ANSI C Interface is disseminated widely, also it’s bugs and pitfalls are known very well by a broad range of IT professionals and may help to be better supportable by the open source initiative compared to the proprietary interface that is available today in Tianocore UEFI. Now 17 new ANSI C functions atoi(), atol(), strtol(), strtoul(), rand(), srand(), calloc(), free(), malloc(), realloc(), atexit(), exit(), qsort(), abs(), labs(), div(), ldiv() are introduced for PEI and DXE. Currently there are 9 examples implemented: 1. argvc: https://github.com/tianocore/edk2-staging/blob/CdePkg/CdeValidationPkg/HOSTED_ENV/argcv/main.c#L57 argc/argv handling according to https://msdn.microsoft.com/en-us/library/a1y7w461.aspx 1. systeminterfacePEI: https://github.com/tianocore/edk2-staging/blob/CdePkg/CdeValidationPkg/SYSTEM_IF/systeminterfacePEI/main.c#L57 demonstration, how PeiServices and FileHandle are passed into main() 1. systeminterfaceDXE: https://github.com/tianocore/edk2-staging/blob/CdePkg/CdeValidationPkg/SYSTEM_IF/systeminterfaceDXE/main.c#L57 demonstration, how SystemTable and ImageHandle are passed into main() ANSI C LIBRARY functions: 1. time.h clock(): https://github.com/tianocore/edk2-staging/blob/CdePkg/CdeValidationPkg/TIME_H/clock/main.c#L1 for PEI and DXE phase. It provides TSC based, millisecond precise, exact and chipset independent clock() function. NOTE: in emulation mode the TSC nominal frequency is supposed to be 1GHz https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/clock?view=vs-2019 1. time.h difftime(): https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/difftime-difftime32-difftime64?view=vs-2019 time.h mktime(): https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/mktime-mktime32-mktime64?view=vs-2019<%20https:/docs.microsoft.com/en-us/cpp/c-runtime-library/reference/mktime-mktime32-mktime64?view=vs-2019> time.h time(): https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/time-time32-time64?view=vs-2019<%20https:/docs.microsoft.com/en-us/cpp/c-runtime-library/reference/time-time32-time64?view=vs-2019> time.h asctime(): https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/asctime-wasctime?view=vs-2019 time.h ctime(): https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/ctime-ctime32-ctime64-wctime-wctime32-wctime64?view=vs-2019 time.h gmtime(): https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/gmtime-gmtime32-gmtime64?view=vs-2019 time.h localtime(): https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/localtime-localtime32-localtime64?view=vs-2019 time.h strftime(): https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/strftime-wcsftime-strftime-l-wcsftime-l?view=vs-2019 NOTE: All TIME.H functions support UTC only. All functions are tested in one single driver PEI/DXE: https://github.com/tianocore/edk2-staging/blob/CdePkg/CdeValidationPkg/TIME_H/timehfunctions/main.c#L52 1. STRING.H memcpy():https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/memcpy-wmemcpy?view=vs-2019 STRING.H memmove():https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/memmove-wmemmove?view=vs-2019 STRING.H strcpy(): https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/strcpy-wcscpy-mbscpy?view=vs-2019 STRING.H strncpy(): https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/strncpy-strncpy-l-wcsncpy-wcsncpy-l-mbsncpy-mbsncpy-l?view=vs-2019 STRING.H strcat(): https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/strcat-wcscat-mbscat?view=vs-2019 STRING.H strncat(): https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/strncat-strncat-l-wcsncat-wcsncat-l-mbsncat-mbsncat-l?view=vs-2019 STRING.H memcmp(): https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/memcmp-wmemcmp?view=vs-2019 STRING.H strcmp(): https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/strcmp-wcscmp-mbscmp?view=vs-2019 STRING.H strncmp(): https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/strncmp-wcsncmp-mbsncmp-mbsncmp-l?view=vs-2019 STRING.H memchr(): https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/memchr-wmemchr?view=vs-2019 STRING.H strchr(): https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/strchr-wcschr-mbschr-mbschr-l?view=vs-2019 STRING.H strcspn(): https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/strcspn-wcscspn-mbscspn-mbscspn-l?view=vs-2019 STRING.H strpbrk():
Re: [edk2-devel] [edk2-platforms][PATCH 1/5] Silicon/Bcm283x: Clean up Bcm2836.h header
On 2019.11.27 14:47, Philippe Mathieu-Daudé wrote: On 11/27/19 1:37 PM, Pete Batard wrote: Add missing RNG registers, This is one change. prefer reusing shorter define's instead of PCDs and clean up spacing. This is another change. All these changes belong to a "cleanup" category, which is what, globally, this patch is all about. Of course, I expect people to argue that adding trivial missing data does not count as cleaning up, which I'd disagree with, but then again, it's not my repo. Why suddenly go back to fixed PERIPHERAL block base address? Earlier version was: #define BCM2836_WDOG_BASE_ADDRESS0x3f10 which we replaced with: #define BCM2836_WDOG_BASE_ADDRESS (FixedPcdGet64 (PcdBcm283xRegistersAddress) + BCM2836_WDOG_OFFSET) But considering that we have "BCM2836_SOC_REGISTERS" that now equates "(FixedPcdGet64 (PcdBcm283xRegistersAddress))" we can write the exact same thing as above, only shorter, which we do. I personally find this more understandable for newcomers who'll be looking at the code and easier to maintain. But I'm not the maintainer, so I'll go with whatever suits you. Regards, /Pete Signed-off-by: Pete Batard ---  Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h | 23  1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h index 72c8e9dc4b14..744c7ac3b9f4 100644 --- a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h +++ b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h @@ -24,8 +24,7 @@  /* watchdog constants */  #define BCM2836_WDOG_OFFSET 0x0010 -#define BCM2836_WDOG_BASE_ADDRESS (FixedPcdGet64 (PcdBcm283xRegistersAddress) \ -   + BCM2836_WDOG_OFFSET) +#define BCM2836_WDOG_BASE_ADDRESS (BCM2836_SOC_REGISTERS + BCM2836_WDOG_OFFSET)  #define BCM2836_WDOG_PASSWORD  0x5a00  #define BCM2836_WDOG_RSTC_OFFSET   0x001c  #define BCM2836_WDOG_WDOG_OFFSET   0x0024 @@ -34,8 +33,7 @@  /* mailbox interface constants */  #define BCM2836_MBOX_OFFSET 0xb880 -#define BCM2836_MBOX_BASE_ADDRESS (FixedPcdGet64 (PcdBcm283xRegistersAddress) \ -   + BCM2836_MBOX_OFFSET) +#define BCM2836_MBOX_BASE_ADDRESS (BCM2836_SOC_REGISTERS + BCM2836_MBOX_OFFSET)  #define BCM2836_MBOX_READ_OFFSET   0x  #define BCM2836_MBOX_STATUS_OFFSET 0x0018  #define BCM2836_MBOX_CONFIG_OFFSET 0x001c @@ -51,12 +49,19 @@  #define BCM2836_INTC_TIMER_PENDING_OFFSET  0x0060  /* random number generator */ -#define RNG_BASE_ADDRESS  (BCM2836_SOC_REGISTERS + 0x00104000) +#define BCM2836_RNG_OFFSET 0x00104000 +#define RNG_BASE_ADDRESS (BCM2836_SOC_REGISTERS + BCM2836_RNG_OFFSET) -#define RNG_CTRL  (RNG_BASE_ADDRESS + 0x0) -#define RNG_STATUS (RNG_BASE_ADDRESS + 0x4) -#define RNG_DATA  (RNG_BASE_ADDRESS + 0x8) +#define RNG_CTRL (RNG_BASE_ADDRESS + 0x0) +#define RNG_STATUS (RNG_BASE_ADDRESS + 0x4) +#define RNG_DATA (RNG_BASE_ADDRESS + 0x8) +#define RNG_BIT_COUNT (RNG_BASE_ADDRESS + 0xc) +#define RNG_BIT_COUNT_THRESHOLD (RNG_BASE_ADDRESS + 0x10) +#define RNG_INT_STATUS (RNG_BASE_ADDRESS + 0x18) +#define RNG_INT_ENABLE (RNG_BASE_ADDRESS + 0x1c) +#define RNG_FIFO_DATA (RNG_BASE_ADDRESS + 0x20) +#define RNG_FIFO_COUNT (RNG_BASE_ADDRESS + 0x24) -#define RNG_CTRL_ENABLE   0x1 +#define RNG_CTRL_ENABLE 0x1  #endif /*__BCM2836_H__ */ -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51349): https://edk2.groups.io/g/devel/message/51349 Mute This Topic: https://groups.io/mt/62504739/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [edk2-platforms][PATCH 1/5] Silicon/Bcm283x: Clean up Bcm2836.h header
On 11/27/19 1:37 PM, Pete Batard wrote: Add missing RNG registers, This is one change. prefer reusing shorter define's instead of PCDs and clean up spacing. This is another change. Why suddenly go back to fixed PERIPHERAL block base address? Signed-off-by: Pete Batard --- Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h | 23 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h index 72c8e9dc4b14..744c7ac3b9f4 100644 --- a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h +++ b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h @@ -24,8 +24,7 @@ /* watchdog constants */ #define BCM2836_WDOG_OFFSET 0x0010 -#define BCM2836_WDOG_BASE_ADDRESS (FixedPcdGet64 (PcdBcm283xRegistersAddress) \ -+ BCM2836_WDOG_OFFSET) +#define BCM2836_WDOG_BASE_ADDRESS (BCM2836_SOC_REGISTERS + BCM2836_WDOG_OFFSET) #define BCM2836_WDOG_PASSWORD 0x5a00 #define BCM2836_WDOG_RSTC_OFFSET0x001c #define BCM2836_WDOG_WDOG_OFFSET0x0024 @@ -34,8 +33,7 @@ /* mailbox interface constants */ #define BCM2836_MBOX_OFFSET 0xb880 -#define BCM2836_MBOX_BASE_ADDRESS (FixedPcdGet64 (PcdBcm283xRegistersAddress) \ -+ BCM2836_MBOX_OFFSET) +#define BCM2836_MBOX_BASE_ADDRESS (BCM2836_SOC_REGISTERS + BCM2836_MBOX_OFFSET) #define BCM2836_MBOX_READ_OFFSET0x #define BCM2836_MBOX_STATUS_OFFSET 0x0018 #define BCM2836_MBOX_CONFIG_OFFSET 0x001c @@ -51,12 +49,19 @@ #define BCM2836_INTC_TIMER_PENDING_OFFSET 0x0060 /* random number generator */ -#define RNG_BASE_ADDRESS (BCM2836_SOC_REGISTERS + 0x00104000) +#define BCM2836_RNG_OFFSET 0x00104000 +#define RNG_BASE_ADDRESS (BCM2836_SOC_REGISTERS + BCM2836_RNG_OFFSET) -#define RNG_CTRL (RNG_BASE_ADDRESS + 0x0) -#define RNG_STATUS (RNG_BASE_ADDRESS + 0x4) -#define RNG_DATA (RNG_BASE_ADDRESS + 0x8) +#define RNG_CTRL(RNG_BASE_ADDRESS + 0x0) +#define RNG_STATUS (RNG_BASE_ADDRESS + 0x4) +#define RNG_DATA(RNG_BASE_ADDRESS + 0x8) +#define RNG_BIT_COUNT (RNG_BASE_ADDRESS + 0xc) +#define RNG_BIT_COUNT_THRESHOLD (RNG_BASE_ADDRESS + 0x10) +#define RNG_INT_STATUS (RNG_BASE_ADDRESS + 0x18) +#define RNG_INT_ENABLE (RNG_BASE_ADDRESS + 0x1c) +#define RNG_FIFO_DATA (RNG_BASE_ADDRESS + 0x20) +#define RNG_FIFO_COUNT (RNG_BASE_ADDRESS + 0x24) -#define RNG_CTRL_ENABLE0x1 +#define RNG_CTRL_ENABLE 0x1 #endif /*__BCM2836_H__ */ -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51348): https://edk2.groups.io/g/devel/message/51348 Mute This Topic: https://groups.io/mt/62504739/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [edk2-platforms][PATCH 1/5] Silicon/Bcm283x: Clean up Bcm2836.h header
On 2019.11.27 13:17, Ard Biesheuvel wrote: On Wed, 27 Nov 2019 at 14:09, Pete Batard wrote: On 2019.11.27 13:00, Ard Biesheuvel wrote: On Wed, 27 Nov 2019 at 13:56, Pete Batard wrote: On 2019.11.27 12:48, Ard Biesheuvel wrote: On Wed, 27 Nov 2019 at 13:37, Pete Batard wrote: Add missing RNG registers, prefer reusing shorter define's instead of PCDs and clean up spacing. Is there a source for these register definitions? I used the most recent Linux driver I could find (but I guess I need to point out that it was used for reference with regards to the registers. Especially, no code was copied from that source). It seems the Linux driver deviates from the below (and the warmup count thing uses the status register as well), so it would be helpful to quote the authoritative reference here. https://github.com/raspberrypi/linux/blob/rpi-5.4.y/drivers/char/hw_random/iproc-rng200.c#L223-L224 seems to indicate that RNG_WARMUP_COUNT (0x4) should go into RNG_TOTAL_BIT_COUNT_THRESHOLD_OFFSET (them) / RNG_BIT_COUNT_THRESHOLD (us) and not the status register. Now, of course, since we don't have a public datasheet, it's hard to have absolute certainty on what's the proper register to write, but I guess the most recent code with a Broadcom Corporation copyright has to our next best thing when it comes to authoritative answer... Well, there is this one too https://github.com/raspberrypi/linux/blob/rpi-5.4.y/drivers/char/hw_random/bcm2835-rng.c which is what I used as the basis for the existing version. Okay. Looks like 2835 (which has to be the basis for the Bcm2837 used on the Pi 3) and 2838 (basis for Bcm2711) have at least one difference with regards to where the warmup count should go. I guess an easy fix, if we don't want to have to spin 2 separate drivers, is to write to both RNG_STATUS and RNG_BIT_COUNT_THRESHOLD during init. I have tested on Pi 3 and not seen any ill effect to writing to RNG_BIT_COUNT_THRESHOLD. I don't like that at all tbh. A misbehaving RNG is virtually undetectable (unless it starts returning zeroes), so knowingly deviating from the initialization routines like that should really be avoided. Would something like this work for you in a v2? Alternatively, I could change the new PcdBcm283xRngUseFifo PCD to PcdBcm283xRng2838Compatible and use that for the conditional code. These are two different IP blocks, with different register layouts etc, so I don't really see the point in parameterizing the existing driver like that. I'd prefer it if we could just clone the existing one and make the changes unconditionally. Okay. I was pretty much expecting that answer... Regards, /Pete -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51347): https://edk2.groups.io/g/devel/message/51347 Mute This Topic: https://groups.io/mt/62504739/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [edk2-platforms][PATCH 1/5] Silicon/Bcm283x: Clean up Bcm2836.h header
On Wed, 27 Nov 2019 at 14:09, Pete Batard wrote: > > On 2019.11.27 13:00, Ard Biesheuvel wrote: > > On Wed, 27 Nov 2019 at 13:56, Pete Batard wrote: > >> > >> On 2019.11.27 12:48, Ard Biesheuvel wrote: > >>> On Wed, 27 Nov 2019 at 13:37, Pete Batard wrote: > > Add missing RNG registers, prefer reusing shorter define's > instead of PCDs and clean up spacing. > > >>> > >>> Is there a source for these register definitions? > >> > >> I used the most recent Linux driver I could find (but I guess I need to > >> point out that it was used for reference with regards to the registers. > >> Especially, no code was copied from that source). > >> > >>> It seems the Linux > >>> driver deviates from the below (and the warmup count thing uses the > >>> status register as well), so it would be helpful to quote the > >>> authoritative reference here. > >> > >> https://github.com/raspberrypi/linux/blob/rpi-5.4.y/drivers/char/hw_random/iproc-rng200.c#L223-L224 > >> seems to indicate that RNG_WARMUP_COUNT (0x4) should go into > >> RNG_TOTAL_BIT_COUNT_THRESHOLD_OFFSET (them) / RNG_BIT_COUNT_THRESHOLD > >> (us) and not the status register. > >> > >> Now, of course, since we don't have a public datasheet, it's hard to > >> have absolute certainty on what's the proper register to write, but I > >> guess the most recent code with a Broadcom Corporation copyright has to > >> our next best thing when it comes to authoritative answer... > >> > > > > Well, there is this one too > > > > https://github.com/raspberrypi/linux/blob/rpi-5.4.y/drivers/char/hw_random/bcm2835-rng.c > > > > which is what I used as the basis for the existing version. > > Okay. Looks like 2835 (which has to be the basis for the Bcm2837 used on > the Pi 3) and 2838 (basis for Bcm2711) have at least one difference with > regards to where the warmup count should go. > > I guess an easy fix, if we don't want to have to spin 2 separate > drivers, is to write to both RNG_STATUS and RNG_BIT_COUNT_THRESHOLD > during init. > > I have tested on Pi 3 and not seen any ill effect to writing to > RNG_BIT_COUNT_THRESHOLD. > I don't like that at all tbh. A misbehaving RNG is virtually undetectable (unless it starts returning zeroes), so knowingly deviating from the initialization routines like that should really be avoided. > Would something like this work for you in a v2? > > Alternatively, I could change the new PcdBcm283xRngUseFifo PCD to > PcdBcm283xRng2838Compatible and use that for the conditional code. > These are two different IP blocks, with different register layouts etc, so I don't really see the point in parameterizing the existing driver like that. I'd prefer it if we could just clone the existing one and make the changes unconditionally. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51346): https://edk2.groups.io/g/devel/message/51346 Mute This Topic: https://groups.io/mt/62504739/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [edk2-platforms][PATCH 1/5] Silicon/Bcm283x: Clean up Bcm2836.h header
On 2019.11.27 13:00, Ard Biesheuvel wrote: On Wed, 27 Nov 2019 at 13:56, Pete Batard wrote: On 2019.11.27 12:48, Ard Biesheuvel wrote: On Wed, 27 Nov 2019 at 13:37, Pete Batard wrote: Add missing RNG registers, prefer reusing shorter define's instead of PCDs and clean up spacing. Is there a source for these register definitions? I used the most recent Linux driver I could find (but I guess I need to point out that it was used for reference with regards to the registers. Especially, no code was copied from that source). It seems the Linux driver deviates from the below (and the warmup count thing uses the status register as well), so it would be helpful to quote the authoritative reference here. https://github.com/raspberrypi/linux/blob/rpi-5.4.y/drivers/char/hw_random/iproc-rng200.c#L223-L224 seems to indicate that RNG_WARMUP_COUNT (0x4) should go into RNG_TOTAL_BIT_COUNT_THRESHOLD_OFFSET (them) / RNG_BIT_COUNT_THRESHOLD (us) and not the status register. Now, of course, since we don't have a public datasheet, it's hard to have absolute certainty on what's the proper register to write, but I guess the most recent code with a Broadcom Corporation copyright has to our next best thing when it comes to authoritative answer... Well, there is this one too https://github.com/raspberrypi/linux/blob/rpi-5.4.y/drivers/char/hw_random/bcm2835-rng.c which is what I used as the basis for the existing version. Okay. Looks like 2835 (which has to be the basis for the Bcm2837 used on the Pi 3) and 2838 (basis for Bcm2711) have at least one difference with regards to where the warmup count should go. I guess an easy fix, if we don't want to have to spin 2 separate drivers, is to write to both RNG_STATUS and RNG_BIT_COUNT_THRESHOLD during init. I have tested on Pi 3 and not seen any ill effect to writing to RNG_BIT_COUNT_THRESHOLD. Would something like this work for you in a v2? Alternatively, I could change the new PcdBcm283xRngUseFifo PCD to PcdBcm283xRng2838Compatible and use that for the conditional code. Regards, /Pete Signed-off-by: Pete Batard --- Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h | 23 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h index 72c8e9dc4b14..744c7ac3b9f4 100644 --- a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h +++ b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h @@ -24,8 +24,7 @@ /* watchdog constants */ #define BCM2836_WDOG_OFFSET 0x0010 -#define BCM2836_WDOG_BASE_ADDRESS (FixedPcdGet64 (PcdBcm283xRegistersAddress) \ -+ BCM2836_WDOG_OFFSET) +#define BCM2836_WDOG_BASE_ADDRESS (BCM2836_SOC_REGISTERS + BCM2836_WDOG_OFFSET) #define BCM2836_WDOG_PASSWORD 0x5a00 #define BCM2836_WDOG_RSTC_OFFSET0x001c #define BCM2836_WDOG_WDOG_OFFSET0x0024 @@ -34,8 +33,7 @@ /* mailbox interface constants */ #define BCM2836_MBOX_OFFSET 0xb880 -#define BCM2836_MBOX_BASE_ADDRESS (FixedPcdGet64 (PcdBcm283xRegistersAddress) \ -+ BCM2836_MBOX_OFFSET) +#define BCM2836_MBOX_BASE_ADDRESS (BCM2836_SOC_REGISTERS + BCM2836_MBOX_OFFSET) #define BCM2836_MBOX_READ_OFFSET0x #define BCM2836_MBOX_STATUS_OFFSET 0x0018 #define BCM2836_MBOX_CONFIG_OFFSET 0x001c @@ -51,12 +49,19 @@ #define BCM2836_INTC_TIMER_PENDING_OFFSET 0x0060 /* random number generator */ -#define RNG_BASE_ADDRESS (BCM2836_SOC_REGISTERS + 0x00104000) +#define BCM2836_RNG_OFFSET 0x00104000 +#define RNG_BASE_ADDRESS (BCM2836_SOC_REGISTERS + BCM2836_RNG_OFFSET) -#define RNG_CTRL (RNG_BASE_ADDRESS + 0x0) -#define RNG_STATUS (RNG_BASE_ADDRESS + 0x4) -#define RNG_DATA (RNG_BASE_ADDRESS + 0x8) +#define RNG_CTRL(RNG_BASE_ADDRESS + 0x0) +#define RNG_STATUS (RNG_BASE_ADDRESS + 0x4) +#define RNG_DATA(RNG_BASE_ADDRESS + 0x8) +#define RNG_BIT_COUNT (RNG_BASE_ADDRESS + 0xc) +#define RNG_BIT_COUNT_THRESHOLD (RNG_BASE_ADDRESS + 0x10) +#define RNG_INT_STATUS (RNG_BASE_ADDRESS + 0x18) +#define RNG_INT_ENABLE
Re: [edk2-devel] [edk2-platforms][PATCH 1/5] Silicon/Bcm283x: Clean up Bcm2836.h header
On Wed, 27 Nov 2019 at 13:56, Pete Batard wrote: > > On 2019.11.27 12:48, Ard Biesheuvel wrote: > > On Wed, 27 Nov 2019 at 13:37, Pete Batard wrote: > >> > >> Add missing RNG registers, prefer reusing shorter define's > >> instead of PCDs and clean up spacing. > >> > > > > Is there a source for these register definitions? > > I used the most recent Linux driver I could find (but I guess I need to > point out that it was used for reference with regards to the registers. > Especially, no code was copied from that source). > > > It seems the Linux > > driver deviates from the below (and the warmup count thing uses the > > status register as well), so it would be helpful to quote the > > authoritative reference here. > > https://github.com/raspberrypi/linux/blob/rpi-5.4.y/drivers/char/hw_random/iproc-rng200.c#L223-L224 > seems to indicate that RNG_WARMUP_COUNT (0x4) should go into > RNG_TOTAL_BIT_COUNT_THRESHOLD_OFFSET (them) / RNG_BIT_COUNT_THRESHOLD > (us) and not the status register. > > Now, of course, since we don't have a public datasheet, it's hard to > have absolute certainty on what's the proper register to write, but I > guess the most recent code with a Broadcom Corporation copyright has to > our next best thing when it comes to authoritative answer... > Well, there is this one too https://github.com/raspberrypi/linux/blob/rpi-5.4.y/drivers/char/hw_random/bcm2835-rng.c which is what I used as the basis for the existing version. > > > > > >> Signed-off-by: Pete Batard > >> --- > >> Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h | 23 > >> > >> 1 file changed, 14 insertions(+), 9 deletions(-) > >> > >> diff --git a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h > >> b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h > >> index 72c8e9dc4b14..744c7ac3b9f4 100644 > >> --- a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h > >> +++ b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h > >> @@ -24,8 +24,7 @@ > >> > >> /* watchdog constants */ > >> #define BCM2836_WDOG_OFFSET 0x0010 > >> -#define BCM2836_WDOG_BASE_ADDRESS > >> (FixedPcdGet64 (PcdBcm283xRegistersAddress) \ > >> -+ > >> BCM2836_WDOG_OFFSET) > >> +#define BCM2836_WDOG_BASE_ADDRESS > >> (BCM2836_SOC_REGISTERS + BCM2836_WDOG_OFFSET) > >> #define BCM2836_WDOG_PASSWORD 0x5a00 > >> #define BCM2836_WDOG_RSTC_OFFSET0x001c > >> #define BCM2836_WDOG_WDOG_OFFSET0x0024 > >> @@ -34,8 +33,7 @@ > >> > >> /* mailbox interface constants */ > >> #define BCM2836_MBOX_OFFSET 0xb880 > >> -#define BCM2836_MBOX_BASE_ADDRESS > >> (FixedPcdGet64 (PcdBcm283xRegistersAddress) \ > >> -+ > >> BCM2836_MBOX_OFFSET) > >> +#define BCM2836_MBOX_BASE_ADDRESS > >> (BCM2836_SOC_REGISTERS + BCM2836_MBOX_OFFSET) > >> #define BCM2836_MBOX_READ_OFFSET0x > >> #define BCM2836_MBOX_STATUS_OFFSET 0x0018 > >> #define BCM2836_MBOX_CONFIG_OFFSET 0x001c > >> @@ -51,12 +49,19 @@ > >> #define BCM2836_INTC_TIMER_PENDING_OFFSET 0x0060 > >> > >> /* random number generator */ > >> -#define RNG_BASE_ADDRESS (BCM2836_SOC_REGISTERS + 0x00104000) > >> +#define BCM2836_RNG_OFFSET 0x00104000 > >> +#define RNG_BASE_ADDRESS > >> (BCM2836_SOC_REGISTERS + BCM2836_RNG_OFFSET) > >> > >> -#define RNG_CTRL (RNG_BASE_ADDRESS + 0x0) > >> -#define RNG_STATUS (RNG_BASE_ADDRESS + 0x4) > >> -#define RNG_DATA (RNG_BASE_ADDRESS + 0x8) > >> +#define RNG_CTRL > >> (RNG_BASE_ADDRESS + 0x0) > >> +#define RNG_STATUS > >> (RNG_BASE_ADDRESS + 0x4) > >> +#define RNG_DATA > >> (RNG_BASE_ADDRESS + 0x8) > >> +#define RNG_BIT_COUNT > >> (RNG_BASE_ADDRESS + 0xc) > >> +#define RNG_BIT_COUNT_THRESHOLD > >> (RNG_BASE_ADDRESS + 0x10) > >> +#define RNG_INT_STATUS > >> (RNG_BASE_ADDRESS + 0x18) > >> +#define RNG_INT_ENABLE > >> (RNG_BASE_ADDRESS + 0x1c) > >> +#define RNG_FIFO_DATA > >> (RNG_BASE_ADDRESS + 0x20) > >> +#define RNG_FIFO_COUNT > >> (RNG_BASE_ADDRESS + 0x24) > >> > >> -#define RNG_CTRL_ENABLE0x1 > >> +#define RNG_CTRL_ENABLE
Re: [edk2-devel] [edk2-platforms][PATCH 1/5] Silicon/Bcm283x: Clean up Bcm2836.h header
On 2019.11.27 12:48, Ard Biesheuvel wrote: On Wed, 27 Nov 2019 at 13:37, Pete Batard wrote: Add missing RNG registers, prefer reusing shorter define's instead of PCDs and clean up spacing. Is there a source for these register definitions? I used the most recent Linux driver I could find (but I guess I need to point out that it was used for reference with regards to the registers. Especially, no code was copied from that source). It seems the Linux driver deviates from the below (and the warmup count thing uses the status register as well), so it would be helpful to quote the authoritative reference here. https://github.com/raspberrypi/linux/blob/rpi-5.4.y/drivers/char/hw_random/iproc-rng200.c#L223-L224 seems to indicate that RNG_WARMUP_COUNT (0x4) should go into RNG_TOTAL_BIT_COUNT_THRESHOLD_OFFSET (them) / RNG_BIT_COUNT_THRESHOLD (us) and not the status register. Now, of course, since we don't have a public datasheet, it's hard to have absolute certainty on what's the proper register to write, but I guess the most recent code with a Broadcom Corporation copyright has to our next best thing when it comes to authoritative answer... Regards, /Pete Signed-off-by: Pete Batard --- Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h | 23 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h index 72c8e9dc4b14..744c7ac3b9f4 100644 --- a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h +++ b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h @@ -24,8 +24,7 @@ /* watchdog constants */ #define BCM2836_WDOG_OFFSET 0x0010 -#define BCM2836_WDOG_BASE_ADDRESS (FixedPcdGet64 (PcdBcm283xRegistersAddress) \ -+ BCM2836_WDOG_OFFSET) +#define BCM2836_WDOG_BASE_ADDRESS (BCM2836_SOC_REGISTERS + BCM2836_WDOG_OFFSET) #define BCM2836_WDOG_PASSWORD 0x5a00 #define BCM2836_WDOG_RSTC_OFFSET0x001c #define BCM2836_WDOG_WDOG_OFFSET0x0024 @@ -34,8 +33,7 @@ /* mailbox interface constants */ #define BCM2836_MBOX_OFFSET 0xb880 -#define BCM2836_MBOX_BASE_ADDRESS (FixedPcdGet64 (PcdBcm283xRegistersAddress) \ -+ BCM2836_MBOX_OFFSET) +#define BCM2836_MBOX_BASE_ADDRESS (BCM2836_SOC_REGISTERS + BCM2836_MBOX_OFFSET) #define BCM2836_MBOX_READ_OFFSET0x #define BCM2836_MBOX_STATUS_OFFSET 0x0018 #define BCM2836_MBOX_CONFIG_OFFSET 0x001c @@ -51,12 +49,19 @@ #define BCM2836_INTC_TIMER_PENDING_OFFSET 0x0060 /* random number generator */ -#define RNG_BASE_ADDRESS (BCM2836_SOC_REGISTERS + 0x00104000) +#define BCM2836_RNG_OFFSET 0x00104000 +#define RNG_BASE_ADDRESS (BCM2836_SOC_REGISTERS + BCM2836_RNG_OFFSET) -#define RNG_CTRL (RNG_BASE_ADDRESS + 0x0) -#define RNG_STATUS (RNG_BASE_ADDRESS + 0x4) -#define RNG_DATA (RNG_BASE_ADDRESS + 0x8) +#define RNG_CTRL(RNG_BASE_ADDRESS + 0x0) +#define RNG_STATUS (RNG_BASE_ADDRESS + 0x4) +#define RNG_DATA(RNG_BASE_ADDRESS + 0x8) +#define RNG_BIT_COUNT (RNG_BASE_ADDRESS + 0xc) +#define RNG_BIT_COUNT_THRESHOLD (RNG_BASE_ADDRESS + 0x10) +#define RNG_INT_STATUS (RNG_BASE_ADDRESS + 0x18) +#define RNG_INT_ENABLE (RNG_BASE_ADDRESS + 0x1c) +#define RNG_FIFO_DATA (RNG_BASE_ADDRESS + 0x20) +#define RNG_FIFO_COUNT (RNG_BASE_ADDRESS + 0x24) -#define RNG_CTRL_ENABLE0x1 +#define RNG_CTRL_ENABLE 0x1 #endif /*__BCM2836_H__ */ -- 2.21.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51343): https://edk2.groups.io/g/devel/message/51343 Mute This Topic: https://groups.io/mt/62504739/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [edk2-platforms][PATCH 1/5] Silicon/Bcm283x: Clean up Bcm2836.h header
On Wed, 27 Nov 2019 at 13:37, Pete Batard wrote: > > Add missing RNG registers, prefer reusing shorter define's > instead of PCDs and clean up spacing. > Is there a source for these register definitions? It seems the Linux driver deviates from the below (and the warmup count thing uses the status register as well), so it would be helpful to quote the authoritative reference here. > Signed-off-by: Pete Batard > --- > Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h | 23 > > 1 file changed, 14 insertions(+), 9 deletions(-) > > diff --git a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h > b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h > index 72c8e9dc4b14..744c7ac3b9f4 100644 > --- a/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h > +++ b/Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h > @@ -24,8 +24,7 @@ > > /* watchdog constants */ > #define BCM2836_WDOG_OFFSET 0x0010 > -#define BCM2836_WDOG_BASE_ADDRESS (FixedPcdGet64 > (PcdBcm283xRegistersAddress) \ > -+ > BCM2836_WDOG_OFFSET) > +#define BCM2836_WDOG_BASE_ADDRESS > (BCM2836_SOC_REGISTERS + BCM2836_WDOG_OFFSET) > #define BCM2836_WDOG_PASSWORD 0x5a00 > #define BCM2836_WDOG_RSTC_OFFSET0x001c > #define BCM2836_WDOG_WDOG_OFFSET0x0024 > @@ -34,8 +33,7 @@ > > /* mailbox interface constants */ > #define BCM2836_MBOX_OFFSET 0xb880 > -#define BCM2836_MBOX_BASE_ADDRESS (FixedPcdGet64 > (PcdBcm283xRegistersAddress) \ > -+ > BCM2836_MBOX_OFFSET) > +#define BCM2836_MBOX_BASE_ADDRESS > (BCM2836_SOC_REGISTERS + BCM2836_MBOX_OFFSET) > #define BCM2836_MBOX_READ_OFFSET0x > #define BCM2836_MBOX_STATUS_OFFSET 0x0018 > #define BCM2836_MBOX_CONFIG_OFFSET 0x001c > @@ -51,12 +49,19 @@ > #define BCM2836_INTC_TIMER_PENDING_OFFSET 0x0060 > > /* random number generator */ > -#define RNG_BASE_ADDRESS (BCM2836_SOC_REGISTERS + 0x00104000) > +#define BCM2836_RNG_OFFSET 0x00104000 > +#define RNG_BASE_ADDRESS > (BCM2836_SOC_REGISTERS + BCM2836_RNG_OFFSET) > > -#define RNG_CTRL (RNG_BASE_ADDRESS + 0x0) > -#define RNG_STATUS (RNG_BASE_ADDRESS + 0x4) > -#define RNG_DATA (RNG_BASE_ADDRESS + 0x8) > +#define RNG_CTRL > (RNG_BASE_ADDRESS + 0x0) > +#define RNG_STATUS > (RNG_BASE_ADDRESS + 0x4) > +#define RNG_DATA > (RNG_BASE_ADDRESS + 0x8) > +#define RNG_BIT_COUNT > (RNG_BASE_ADDRESS + 0xc) > +#define RNG_BIT_COUNT_THRESHOLD > (RNG_BASE_ADDRESS + 0x10) > +#define RNG_INT_STATUS > (RNG_BASE_ADDRESS + 0x18) > +#define RNG_INT_ENABLE > (RNG_BASE_ADDRESS + 0x1c) > +#define RNG_FIFO_DATA > (RNG_BASE_ADDRESS + 0x20) > +#define RNG_FIFO_COUNT > (RNG_BASE_ADDRESS + 0x24) > > -#define RNG_CTRL_ENABLE0x1 > +#define RNG_CTRL_ENABLE 0x1 > > #endif /*__BCM2836_H__ */ > -- > 2.21.0.windows.1 > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51342): https://edk2.groups.io/g/devel/message/51342 Mute This Topic: https://groups.io/mt/62504739/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [edk2-platforms][PATCH 2/5] Silicon/Bcm283x: Add FIFO mode for RNG
On 2019.11.27 12:44, Ard Biesheuvel wrote: On Wed, 27 Nov 2019 at 13:37, Pete Batard wrote: The Bcm283x Random Number Generator does not work in regular mode on the Bcm2711 powered Raspberry Pi 4. It does however work when using FIFO mode. So we add this new mode, which is governed by the use of the new PcdBcm283xRngUseFifo boolean PCD. Note that just as a Pi 4 doesn't seem to support regular mode, a Pi 3 doesn't seem to support FIFO mode, which is why we can't switch to simply using FIFO mode for both platforms. We also fix the register to which RNG_WARMUP_COUNT is written, which was incorrect. At the risk of triggering another endless debate, could we /please/ not mix in trivial bugfixes with more complicated refactoring like this? Well, the "trivial" is the precise reason it is mixed in, but sure, I can split that in v2. Regards, /Pete Signed-off-by: Pete Batard --- Silicon/Broadcom/Bcm283x/Bcm283x.dec | 1 + Silicon/Broadcom/Bcm283x/Drivers/RngDxe/RngDxe.c | 96 +++- Silicon/Broadcom/Bcm283x/Drivers/RngDxe/RngDxe.inf | 2 + 3 files changed, 74 insertions(+), 25 deletions(-) diff --git a/Silicon/Broadcom/Bcm283x/Bcm283x.dec b/Silicon/Broadcom/Bcm283x/Bcm283x.dec index 5b839b00d286..4a9be7b18c97 100644 --- a/Silicon/Broadcom/Bcm283x/Bcm283x.dec +++ b/Silicon/Broadcom/Bcm283x/Bcm283x.dec @@ -21,3 +21,4 @@ [Guids] [PcdsFixedAtBuild.common] gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress|0x0|UINT32|0x0001 + gBcm283xTokenSpaceGuid.PcdBcm283xRngUseFifo|0x0|BOOLEAN|0x0002 diff --git a/Silicon/Broadcom/Bcm283x/Drivers/RngDxe/RngDxe.c b/Silicon/Broadcom/Bcm283x/Drivers/RngDxe/RngDxe.c index 722815d32f06..462a21a6f3c3 100644 --- a/Silicon/Broadcom/Bcm283x/Drivers/RngDxe/RngDxe.c +++ b/Silicon/Broadcom/Bcm283x/Drivers/RngDxe/RngDxe.c @@ -2,6 +2,7 @@ This driver produces an EFI_RNG_PROTOCOL instance for the Broadcom 2836 RNG + Copyright (C) 2019, Pete Batard Copyright (C) 2019, Linaro Ltd. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -12,6 +13,8 @@ #include #include #include +#include +#include #include #include @@ -20,6 +23,8 @@ #define RNG_WARMUP_COUNT0x4 #define RNG_MAX_RETRIES 0x100 // arbitrary upper bound +#define RNG_FIFO_NUMVAL_MASK0xff +#define RNG_STATUS_NUMVAL_SHIFT 24 /** Returns information about the random number generation implementation. @@ -84,6 +89,54 @@ Bcm2836RngGetInfo ( return EFI_SUCCESS; } +/** + Read a single random value, in either FIFO or regular mode. + + @param[in] Val A pointer to the 32-bit word that is to + be filled with a random value. + + @retval EFI_SUCCESS A random value was successfully read. + @retval EFI_NOT_READY The number of retries elapsed before a + random value was generated. + +**/ +STATIC +EFI_STATUS +EFIAPI +Bcm2836RngReadValue ( + IN OUT UINT32 *Val +) +{ + UINT32 Avail; + UINT32 i; + BOOLEAN UseFifo = FixedPcdGetBool (PcdBcm283xRngUseFifo); + + ASSERT (Val != NULL); + + Avail = UseFifo ? +(MmioRead32 (RNG_FIFO_COUNT) & RNG_FIFO_NUMVAL_MASK) : +(MmioRead32 (RNG_STATUS) >> RNG_STATUS_NUMVAL_SHIFT); + + // + // If we don't have a value ready, wait 1 us and retry. + // + for (i = 0; Avail < 1 && i < RNG_MAX_RETRIES; i++) { +MicroSecondDelay (1); +Avail = UseFifo ? + (MmioRead32 (RNG_FIFO_COUNT) & RNG_FIFO_NUMVAL_MASK) : + (MmioRead32 (RNG_STATUS) >> RNG_STATUS_NUMVAL_SHIFT); + } + if (Avail < 1) { +return EFI_NOT_READY; + } + + *Val = UseFifo ? +MmioRead32 (RNG_FIFO_DATA): +MmioRead32 (RNG_DATA); + + return EFI_SUCCESS; +} + /** Produces and returns an RNG value using either the default or specified RNG algorithm. @@ -123,9 +176,8 @@ Bcm2836RngGetRNG ( OUT UINT8 *RNGValue ) { - UINT32 Val; - UINT32 Num; - UINT32 Retries; + EFI_STATUS Status; + UINT32 Val; if (This == NULL || RNGValueLength == 0 || RNGValue == NULL) { return EFI_INVALID_PARAMETER; @@ -139,30 +191,24 @@ Bcm2836RngGetRNG ( return EFI_UNSUPPORTED; } - while (RNGValueLength > 0) { -Retries = RNG_MAX_RETRIES; -do { - Num = MmioRead32 (RNG_STATUS) >> 24; - MemoryFence (); -} while (!Num && Retries-- > 0); - -if (!Num) { - return EFI_DEVICE_ERROR; + while (RNGValueLength >= sizeof (UINT32)) { +Status = Bcm2836RngReadValue (); +if (EFI_ERROR (Status)) { + return Status; } +WriteUnaligned32 ((VOID *)RNGValue, Val); +RNGValue += sizeof (UINT32); +RNGValueLength -= sizeof (UINT32); + } -while (RNGValueLength >= sizeof (UINT32) && Num > 0) { - WriteUnaligned32 ((VOID *)RNGValue, MmioRead32 (RNG_DATA)); - RNGValue += sizeof (UINT32); - RNGValueLength -= sizeof
Re: [edk2-devel] [edk2-platforms][PATCH 2/5] Silicon/Bcm283x: Add FIFO mode for RNG
On Wed, 27 Nov 2019 at 13:37, Pete Batard wrote: > > The Bcm283x Random Number Generator does not work in regular mode > on the Bcm2711 powered Raspberry Pi 4. It does however work when > using FIFO mode. So we add this new mode, which is governed by the > use of the new PcdBcm283xRngUseFifo boolean PCD. > > Note that just as a Pi 4 doesn't seem to support regular mode, a > Pi 3 doesn't seem to support FIFO mode, which is why we can't > switch to simply using FIFO mode for both platforms. > > We also fix the register to which RNG_WARMUP_COUNT is written, > which was incorrect. > At the risk of triggering another endless debate, could we /please/ not mix in trivial bugfixes with more complicated refactoring like this? > Signed-off-by: Pete Batard > --- > Silicon/Broadcom/Bcm283x/Bcm283x.dec | 1 + > Silicon/Broadcom/Bcm283x/Drivers/RngDxe/RngDxe.c | 96 +++- > Silicon/Broadcom/Bcm283x/Drivers/RngDxe/RngDxe.inf | 2 + > 3 files changed, 74 insertions(+), 25 deletions(-) > > diff --git a/Silicon/Broadcom/Bcm283x/Bcm283x.dec > b/Silicon/Broadcom/Bcm283x/Bcm283x.dec > index 5b839b00d286..4a9be7b18c97 100644 > --- a/Silicon/Broadcom/Bcm283x/Bcm283x.dec > +++ b/Silicon/Broadcom/Bcm283x/Bcm283x.dec > @@ -21,3 +21,4 @@ [Guids] > > [PcdsFixedAtBuild.common] >gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress|0x0|UINT32|0x0001 > + gBcm283xTokenSpaceGuid.PcdBcm283xRngUseFifo|0x0|BOOLEAN|0x0002 > diff --git a/Silicon/Broadcom/Bcm283x/Drivers/RngDxe/RngDxe.c > b/Silicon/Broadcom/Bcm283x/Drivers/RngDxe/RngDxe.c > index 722815d32f06..462a21a6f3c3 100644 > --- a/Silicon/Broadcom/Bcm283x/Drivers/RngDxe/RngDxe.c > +++ b/Silicon/Broadcom/Bcm283x/Drivers/RngDxe/RngDxe.c > @@ -2,6 +2,7 @@ > >This driver produces an EFI_RNG_PROTOCOL instance for the Broadcom 2836 RNG > > + Copyright (C) 2019, Pete Batard >Copyright (C) 2019, Linaro Ltd. All rights reserved. > >SPDX-License-Identifier: BSD-2-Clause-Patent > @@ -12,6 +13,8 @@ > #include > #include > #include > +#include > +#include > #include > > #include > @@ -20,6 +23,8 @@ > > #define RNG_WARMUP_COUNT0x4 > #define RNG_MAX_RETRIES 0x100 // arbitrary upper bound > +#define RNG_FIFO_NUMVAL_MASK0xff > +#define RNG_STATUS_NUMVAL_SHIFT 24 > > /** >Returns information about the random number generation implementation. > @@ -84,6 +89,54 @@ Bcm2836RngGetInfo ( >return EFI_SUCCESS; > } > > +/** > + Read a single random value, in either FIFO or regular mode. > + > + @param[in] Val A pointer to the 32-bit word that is to > + be filled with a random value. > + > + @retval EFI_SUCCESS A random value was successfully read. > + @retval EFI_NOT_READY The number of retries elapsed before a > + random value was generated. > + > +**/ > +STATIC > +EFI_STATUS > +EFIAPI > +Bcm2836RngReadValue ( > + IN OUT UINT32 *Val > +) > +{ > + UINT32 Avail; > + UINT32 i; > + BOOLEAN UseFifo = FixedPcdGetBool (PcdBcm283xRngUseFifo); > + > + ASSERT (Val != NULL); > + > + Avail = UseFifo ? > +(MmioRead32 (RNG_FIFO_COUNT) & RNG_FIFO_NUMVAL_MASK) : > +(MmioRead32 (RNG_STATUS) >> RNG_STATUS_NUMVAL_SHIFT); > + > + // > + // If we don't have a value ready, wait 1 us and retry. > + // > + for (i = 0; Avail < 1 && i < RNG_MAX_RETRIES; i++) { > +MicroSecondDelay (1); > +Avail = UseFifo ? > + (MmioRead32 (RNG_FIFO_COUNT) & RNG_FIFO_NUMVAL_MASK) : > + (MmioRead32 (RNG_STATUS) >> RNG_STATUS_NUMVAL_SHIFT); > + } > + if (Avail < 1) { > +return EFI_NOT_READY; > + } > + > + *Val = UseFifo ? > +MmioRead32 (RNG_FIFO_DATA): > +MmioRead32 (RNG_DATA); > + > + return EFI_SUCCESS; > +} > + > /** >Produces and returns an RNG value using either the default or specified RNG >algorithm. > @@ -123,9 +176,8 @@ Bcm2836RngGetRNG ( >OUT UINT8 *RNGValue >) > { > - UINT32 Val; > - UINT32 Num; > - UINT32 Retries; > + EFI_STATUS Status; > + UINT32 Val; > >if (This == NULL || RNGValueLength == 0 || RNGValue == NULL) { > return EFI_INVALID_PARAMETER; > @@ -139,30 +191,24 @@ Bcm2836RngGetRNG ( > return EFI_UNSUPPORTED; >} > > - while (RNGValueLength > 0) { > -Retries = RNG_MAX_RETRIES; > -do { > - Num = MmioRead32 (RNG_STATUS) >> 24; > - MemoryFence (); > -} while (!Num && Retries-- > 0); > - > -if (!Num) { > - return EFI_DEVICE_ERROR; > + while (RNGValueLength >= sizeof (UINT32)) { > +Status = Bcm2836RngReadValue (); > +if (EFI_ERROR (Status)) { > + return Status; > } > +WriteUnaligned32 ((VOID *)RNGValue, Val); > +RNGValue += sizeof (UINT32); > +RNGValueLength -= sizeof (UINT32); > + } > > -while (RNGValueLength >= sizeof (UINT32) && Num > 0) { > - WriteUnaligned32 ((VOID *)RNGValue,
[edk2-devel] [edk2-platforms][PATCH 0/5] Further RPi4 support groundwork
This series mostly focuses on adding fixes, that are not directly relevant for the Pi 3 platform but that are going to be needed for the Pi 4. The first one of these relates to the Random Number Generator, that seems to require a new FIFO mode for readout of data on the Pi4/Bcm2711. The second has to do with some SD SCR read failures that were observed during RPi4 testing and for which we add a workaround. Finally, we use this series to add the config behaviour we eventually require for SD routing, so that both Pi 3 and Pi 4 platforms can be handled by the same driver. Andrei Warkentin (2): Platform/RPi/MmcDxe: Factorize SCR call and clean up MMC init Platform/RPi/MmcDxe: Improve MMC driver stability Pete Batard (2): Silicon/Bcm283x: Clean up Bcm2836.h header Silicon/Bcm283x: Add FIFO mode for RNG Samer El-Haj-Mahmoud (1): Platform/RPi: Set SD routing according to model Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 137 ++-- Platform/RaspberryPi/Drivers/MmcDxe/Mmc.c | 7 +- Platform/RaspberryPi/Drivers/MmcDxe/MmcIdentification.c | 105 +-- Silicon/Broadcom/Bcm283x/Bcm283x.dec| 1 + Silicon/Broadcom/Bcm283x/Drivers/RngDxe/RngDxe.c| 96 ++ Silicon/Broadcom/Bcm283x/Drivers/RngDxe/RngDxe.inf | 2 + Silicon/Broadcom/Bcm283x/Include/IndustryStandard/Bcm2836.h | 23 ++-- 7 files changed, 252 insertions(+), 119 deletions(-) -- 2.21.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51334): https://edk2.groups.io/g/devel/message/51334 Mute This Topic: https://groups.io/mt/62504738/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms][PATCH 2/5] Silicon/Bcm283x: Add FIFO mode for RNG
The Bcm283x Random Number Generator does not work in regular mode on the Bcm2711 powered Raspberry Pi 4. It does however work when using FIFO mode. So we add this new mode, which is governed by the use of the new PcdBcm283xRngUseFifo boolean PCD. Note that just as a Pi 4 doesn't seem to support regular mode, a Pi 3 doesn't seem to support FIFO mode, which is why we can't switch to simply using FIFO mode for both platforms. We also fix the register to which RNG_WARMUP_COUNT is written, which was incorrect. Signed-off-by: Pete Batard --- Silicon/Broadcom/Bcm283x/Bcm283x.dec | 1 + Silicon/Broadcom/Bcm283x/Drivers/RngDxe/RngDxe.c | 96 +++- Silicon/Broadcom/Bcm283x/Drivers/RngDxe/RngDxe.inf | 2 + 3 files changed, 74 insertions(+), 25 deletions(-) diff --git a/Silicon/Broadcom/Bcm283x/Bcm283x.dec b/Silicon/Broadcom/Bcm283x/Bcm283x.dec index 5b839b00d286..4a9be7b18c97 100644 --- a/Silicon/Broadcom/Bcm283x/Bcm283x.dec +++ b/Silicon/Broadcom/Bcm283x/Bcm283x.dec @@ -21,3 +21,4 @@ [Guids] [PcdsFixedAtBuild.common] gBcm283xTokenSpaceGuid.PcdBcm283xRegistersAddress|0x0|UINT32|0x0001 + gBcm283xTokenSpaceGuid.PcdBcm283xRngUseFifo|0x0|BOOLEAN|0x0002 diff --git a/Silicon/Broadcom/Bcm283x/Drivers/RngDxe/RngDxe.c b/Silicon/Broadcom/Bcm283x/Drivers/RngDxe/RngDxe.c index 722815d32f06..462a21a6f3c3 100644 --- a/Silicon/Broadcom/Bcm283x/Drivers/RngDxe/RngDxe.c +++ b/Silicon/Broadcom/Bcm283x/Drivers/RngDxe/RngDxe.c @@ -2,6 +2,7 @@ This driver produces an EFI_RNG_PROTOCOL instance for the Broadcom 2836 RNG + Copyright (C) 2019, Pete Batard Copyright (C) 2019, Linaro Ltd. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -12,6 +13,8 @@ #include #include #include +#include +#include #include #include @@ -20,6 +23,8 @@ #define RNG_WARMUP_COUNT0x4 #define RNG_MAX_RETRIES 0x100 // arbitrary upper bound +#define RNG_FIFO_NUMVAL_MASK0xff +#define RNG_STATUS_NUMVAL_SHIFT 24 /** Returns information about the random number generation implementation. @@ -84,6 +89,54 @@ Bcm2836RngGetInfo ( return EFI_SUCCESS; } +/** + Read a single random value, in either FIFO or regular mode. + + @param[in] Val A pointer to the 32-bit word that is to + be filled with a random value. + + @retval EFI_SUCCESS A random value was successfully read. + @retval EFI_NOT_READY The number of retries elapsed before a + random value was generated. + +**/ +STATIC +EFI_STATUS +EFIAPI +Bcm2836RngReadValue ( + IN OUT UINT32 *Val +) +{ + UINT32 Avail; + UINT32 i; + BOOLEAN UseFifo = FixedPcdGetBool (PcdBcm283xRngUseFifo); + + ASSERT (Val != NULL); + + Avail = UseFifo ? +(MmioRead32 (RNG_FIFO_COUNT) & RNG_FIFO_NUMVAL_MASK) : +(MmioRead32 (RNG_STATUS) >> RNG_STATUS_NUMVAL_SHIFT); + + // + // If we don't have a value ready, wait 1 us and retry. + // + for (i = 0; Avail < 1 && i < RNG_MAX_RETRIES; i++) { +MicroSecondDelay (1); +Avail = UseFifo ? + (MmioRead32 (RNG_FIFO_COUNT) & RNG_FIFO_NUMVAL_MASK) : + (MmioRead32 (RNG_STATUS) >> RNG_STATUS_NUMVAL_SHIFT); + } + if (Avail < 1) { +return EFI_NOT_READY; + } + + *Val = UseFifo ? +MmioRead32 (RNG_FIFO_DATA): +MmioRead32 (RNG_DATA); + + return EFI_SUCCESS; +} + /** Produces and returns an RNG value using either the default or specified RNG algorithm. @@ -123,9 +176,8 @@ Bcm2836RngGetRNG ( OUT UINT8 *RNGValue ) { - UINT32 Val; - UINT32 Num; - UINT32 Retries; + EFI_STATUS Status; + UINT32 Val; if (This == NULL || RNGValueLength == 0 || RNGValue == NULL) { return EFI_INVALID_PARAMETER; @@ -139,30 +191,24 @@ Bcm2836RngGetRNG ( return EFI_UNSUPPORTED; } - while (RNGValueLength > 0) { -Retries = RNG_MAX_RETRIES; -do { - Num = MmioRead32 (RNG_STATUS) >> 24; - MemoryFence (); -} while (!Num && Retries-- > 0); - -if (!Num) { - return EFI_DEVICE_ERROR; + while (RNGValueLength >= sizeof (UINT32)) { +Status = Bcm2836RngReadValue (); +if (EFI_ERROR (Status)) { + return Status; } +WriteUnaligned32 ((VOID *)RNGValue, Val); +RNGValue += sizeof (UINT32); +RNGValueLength -= sizeof (UINT32); + } -while (RNGValueLength >= sizeof (UINT32) && Num > 0) { - WriteUnaligned32 ((VOID *)RNGValue, MmioRead32 (RNG_DATA)); - RNGValue += sizeof (UINT32); - RNGValueLength -= sizeof (UINT32); - Num--; + if (RNGValueLength > 0) { +Status = Bcm2836RngReadValue (); +if (EFI_ERROR (Status)) { + return Status; } - -if (RNGValueLength > 0 && Num > 0) { - Val = MmioRead32 (RNG_DATA); - while (RNGValueLength--) { -*RNGValue++ = (UINT8)Val; -Val >>= 8; - } +while (RNGValueLength--) { + *RNGValue++ =
[edk2-devel] [edk2-platforms][PATCH 5/5] Platform/RPi: Set SD routing according to model
From: Samer El-Haj-Mahmoud The Raspberry Pi 4 has a new SD controller. As a result we must handle SD routing according to the model, which we perform in the Config driver by using the GetModelFamily () call that was recently introduced. Signed-off-by: Pete Batard --- Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 137 ++-- 1 file changed, 96 insertions(+), 41 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c index 98e58a560ed4..26bc92f28185 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c @@ -1,6 +1,7 @@ /** @file * - * Copyright (c) 2018, Andrei Warkentin + * Copyright (c) 2019, ARM Limited. All rights reserved. + * Copyright (c) 2018 - 2019, Andrei Warkentin * * SPDX-License-Identifier: BSD-2-Clause-Patent * @@ -9,10 +10,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -212,6 +215,7 @@ ApplyVariables ( UINT32 CpuClock = PcdGet32 (PcdCpuClock); UINT32 CustomCpuClock = PcdGet32 (PcdCustomCpuClock); UINT32 Rate = 0; + UINT32 ModelFamily = 0; if (CpuClock != 0) { if (CpuClock == 2) { @@ -245,51 +249,102 @@ ApplyVariables ( DEBUG ((DEBUG_INFO, "Current CPU speed is %uHz\n", Rate)); } - /* - * Switching two groups around, so disable both first. - * - * No, I've not seen a problem, but having a group be - * routed to two sets of pins seems like asking for trouble. - */ - GpioPinFuncSet (34, GPIO_FSEL_INPUT); - GpioPinFuncSet (35, GPIO_FSEL_INPUT); - GpioPinFuncSet (36, GPIO_FSEL_INPUT); - GpioPinFuncSet (37, GPIO_FSEL_INPUT); - GpioPinFuncSet (38, GPIO_FSEL_INPUT); - GpioPinFuncSet (39, GPIO_FSEL_INPUT); - GpioPinFuncSet (48, GPIO_FSEL_INPUT); - GpioPinFuncSet (49, GPIO_FSEL_INPUT); - GpioPinFuncSet (50, GPIO_FSEL_INPUT); - GpioPinFuncSet (51, GPIO_FSEL_INPUT); - GpioPinFuncSet (52, GPIO_FSEL_INPUT); - GpioPinFuncSet (53, GPIO_FSEL_INPUT); - if (PcdGet32 (PcdSdIsArasan)) { -DEBUG ((DEBUG_INFO, "Routing SD to Arasan\n")); -Gpio48Group = GPIO_FSEL_ALT3; + Status = mFwProtocol->GetModelFamily (); + if (Status != EFI_SUCCESS) { +DEBUG ((DEBUG_ERROR, "Couldn't get the Raspberry Pi model family: %r\n", Status)); + } else { +DEBUG ((DEBUG_INFO, "Current Raspberry Pi model family is 0x%x\n", ModelFamily)); + } + + + if (ModelFamily == 3) { /* - * Route SDIO to SdHost. + * Pi 3: either Arasan or SdHost goes to SD card. + * + * Switching two groups around, so disable both first. + * + * No, I've not seen a problem, but having a group be + * routed to two sets of pins seems like asking for trouble. */ -Gpio34Group = GPIO_FSEL_ALT0; - } else { -DEBUG ((DEBUG_INFO, "Routing SD to SdHost\n")); -Gpio48Group = GPIO_FSEL_ALT0; +GpioPinFuncSet (34, GPIO_FSEL_INPUT); +GpioPinFuncSet (35, GPIO_FSEL_INPUT); +GpioPinFuncSet (36, GPIO_FSEL_INPUT); +GpioPinFuncSet (37, GPIO_FSEL_INPUT); +GpioPinFuncSet (38, GPIO_FSEL_INPUT); +GpioPinFuncSet (39, GPIO_FSEL_INPUT); +GpioPinFuncSet (48, GPIO_FSEL_INPUT); +GpioPinFuncSet (49, GPIO_FSEL_INPUT); +GpioPinFuncSet (50, GPIO_FSEL_INPUT); +GpioPinFuncSet (51, GPIO_FSEL_INPUT); +GpioPinFuncSet (52, GPIO_FSEL_INPUT); +GpioPinFuncSet (53, GPIO_FSEL_INPUT); + +if (PcdGet32 (PcdSdIsArasan)) { + DEBUG ((DEBUG_INFO, "Routing SD to Arasan\n")); + Gpio48Group = GPIO_FSEL_ALT3; + /* + * Route SDIO to SdHost. + */ + Gpio34Group = GPIO_FSEL_ALT0; +} else { + DEBUG ((DEBUG_INFO, "Routing SD to SdHost\n")); + Gpio48Group = GPIO_FSEL_ALT0; + /* + * Route SDIO to Arasan. + */ + Gpio34Group = GPIO_FSEL_ALT3; +} +GpioPinFuncSet (34, Gpio34Group); +GpioPinFuncSet (35, Gpio34Group); +GpioPinFuncSet (36, Gpio34Group); +GpioPinFuncSet (37, Gpio34Group); +GpioPinFuncSet (38, Gpio34Group); +GpioPinFuncSet (39, Gpio34Group); +GpioPinFuncSet (48, Gpio48Group); +GpioPinFuncSet (49, Gpio48Group); +GpioPinFuncSet (50, Gpio48Group); +GpioPinFuncSet (51, Gpio48Group); +GpioPinFuncSet (52, Gpio48Group); +GpioPinFuncSet (53, Gpio48Group); + + } else if (ModelFamily == 4){ /* - * Route SDIO to Arasan. + * Pi 4: either Arasan or eMMC2 goes to SD card. */ -Gpio34Group = GPIO_FSEL_ALT3; +if (PcdGet32 (PcdSdIsArasan)) { + /* + * WiFi disabled. + */ + GpioPinFuncSet (34, GPIO_FSEL_INPUT); + GpioPinFuncSet (35, GPIO_FSEL_INPUT); + GpioPinFuncSet (36, GPIO_FSEL_INPUT); + GpioPinFuncSet (37, GPIO_FSEL_INPUT); + GpioPinFuncSet (38, GPIO_FSEL_INPUT); + GpioPinFuncSet (39, GPIO_FSEL_INPUT); + /* + * SD card pins go to Arasan. + */ + MmioWrite32((GPIO_BASE_ADDRESS +
[edk2-devel] [edk2-platforms][PATCH 3/5] Platform/RPi/MmcDxe: Factorize SCR call and clean up MMC init
From: Andrei Warkentin This is mostly a maintainability improvement for the InitializeSdMmcDevice () call achieved by factorizing the code related to SCR execution into a new SdExecuteScr () call. Signed-off-by: Pete Batard --- Platform/RaspberryPi/Drivers/MmcDxe/MmcIdentification.c | 105 1 file changed, 62 insertions(+), 43 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/MmcDxe/MmcIdentification.c b/Platform/RaspberryPi/Drivers/MmcDxe/MmcIdentification.c index 4ee5c5ca6fb2..34a97e954220 100644 --- a/Platform/RaspberryPi/Drivers/MmcDxe/MmcIdentification.c +++ b/Platform/RaspberryPi/Drivers/MmcDxe/MmcIdentification.c @@ -1,5 +1,6 @@ /** @file * + * Copyright (c) 2019, Andrei Warkentin * Copyright (c) 2011-2015, ARM Limited. All rights reserved. * * SPDX-License-Identifier: BSD-2-Clause-Patent @@ -567,6 +568,48 @@ SdSetSpeed ( return EFI_SUCCESS; } +STATIC +EFI_STATUS +SdExecuteScr ( + IN MMC_HOST_INSTANCE *MmcHostInstance, + OUT SCR *Scr + ) +{ + EFI_STATUS Status; + UINT32 Response[4]; + EFI_MMC_HOST_PROTOCOL *MmcHost = MmcHostInstance->MmcHost; + + Status = MmcHost->SendCommand (MmcHost, MMC_CMD55, + MmcHostInstance->CardInfo.RCA << 16); + if (EFI_ERROR (Status)) { +DEBUG ((DEBUG_ERROR, "%a (MMC_CMD55): Error and Status = %r\n", __FUNCTION__, Status)); +return Status; + } + Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_R1, Response); + if (EFI_ERROR (Status)) { +DEBUG ((DEBUG_ERROR, "%a (MMC_CMD55): Error and Status = %r\n", __FUNCTION__, Status)); +return Status; + } + if ((Response[0] & MMC_STATUS_APP_CMD) == 0) { +return EFI_SUCCESS; + } + + /* SCR */ + Status = MmcHost->SendCommand (MmcHost, MMC_ACMD51, 0); + if (EFI_ERROR (Status)) { +DEBUG ((DEBUG_ERROR, "%a(MMC_ACMD51): Error and Status = %r\n", __func__, Status)); +return Status; + } + + Status = MmcHost->ReadBlockData (MmcHost, 0, 8, (VOID *) Scr); + if (EFI_ERROR (Status)) { +DEBUG ((DEBUG_ERROR, "%a(MMC_ACMD51): ReadBlockData Error and Status = %r\n", __func__, Status)); +return Status; + } + + return EFI_SUCCESS; +} + STATIC EFI_STATUS InitializeSdMmcDevice ( @@ -574,7 +617,6 @@ InitializeSdMmcDevice ( ) { UINT32Response[4]; - UINT32Buffer[128]; UINTN BlockSize; UINTN CardSize; UINTN NumBlocks; @@ -621,58 +663,35 @@ InitializeSdMmcDevice ( return Status; } - Status = MmcHost->SendCommand (MmcHost, MMC_CMD55, - MmcHostInstance->CardInfo.RCA << 16); + Status = SdExecuteScr (MmcHostInstance, ); if (EFI_ERROR (Status)) { -DEBUG ((DEBUG_ERROR, "%a (MMC_CMD55): Error and Status = %r\n", __FUNCTION__, Status)); -return Status; - } - Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_R1, Response); - if (EFI_ERROR (Status)) { -DEBUG ((DEBUG_ERROR, "%a (MMC_CMD55): Error and Status = %r\n", __FUNCTION__, Status)); -return Status; - } - if ((Response[0] & MMC_STATUS_APP_CMD) == 0) { -return EFI_SUCCESS; + return Status; } - /* SCR */ - Status = MmcHost->SendCommand (MmcHost, MMC_ACMD51, 0); - if (EFI_ERROR (Status)) { -DEBUG ((DEBUG_ERROR, "%a(MMC_ACMD51): Error and Status = %r\n", __func__, Status)); -return Status; - } else { -Status = MmcHost->ReadBlockData (MmcHost, 0, 8, Buffer); -if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a(MMC_ACMD51): ReadBlockData Error and Status = %r\n", __func__, Status)); - return Status; -} -CopyMem (, Buffer, 8); -if (Scr.SD_SPEC == 2) { - if (Scr.SD_SPEC3 == 1) { -if (Scr.SD_SPEC4 == 1) { - DEBUG ((DEBUG_INFO, "Found SD Card for Spec Version 4.xx\n")); -} else { - DEBUG ((DEBUG_INFO, "Found SD Card for Spec Version 3.0x\n")); -} + if (Scr.SD_SPEC == 2) { +if (Scr.SD_SPEC3 == 1) { + if (Scr.SD_SPEC4 == 1) { +DEBUG ((DEBUG_INFO, "Found SD Card for Spec Version 4.xx\n")); } else { -if (Scr.SD_SPEC4 == 0) { - DEBUG ((DEBUG_INFO, "Found SD Card for Spec Version 2.0\n")); -} else { - DEBUG ((DEBUG_ERROR, "Found invalid SD Card\n")); -} +DEBUG ((DEBUG_INFO, "Found SD Card for Spec Version 3.0x\n")); } } else { - if ((Scr.SD_SPEC3 == 0) && (Scr.SD_SPEC4 == 0)) { -if (Scr.SD_SPEC == 1) { - DEBUG ((DEBUG_INFO, "Found SD Card for Spec Version 1.10\n")); -} else { - DEBUG ((DEBUG_INFO, "Found SD Card for Spec Version 1.0\n")); -} + if (Scr.SD_SPEC4 == 0) { +DEBUG ((DEBUG_INFO, "Found SD Card for Spec Version 2.0\n")); } else { DEBUG ((DEBUG_ERROR, "Found invalid SD Card\n")); } } + } else { +if ((Scr.SD_SPEC3 == 0) && (Scr.SD_SPEC4 == 0)) { + if (Scr.SD_SPEC == 1) { +DEBUG ((DEBUG_INFO, "Found SD Card for Spec Version 1.10\n")); + } else { +
[edk2-devel] [edk2-platforms][PATCH 4/5] Platform/RPi/MmcDxe: Improve MMC driver stability
From: Andrei Warkentin For reasons that aren't entirely understood, SCR reads can randomly fail on the Raspberry Pi 4. It can be on the first boot or during subsequent reboots. To alleviate this, and improve the overall behavior of the code, we modify CheckCardsCallback () to retry InitializeMmcDevice () in case of failure. Signed-off-by: Pete Batard --- Platform/RaspberryPi/Drivers/MmcDxe/Mmc.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Platform/RaspberryPi/Drivers/MmcDxe/Mmc.c b/Platform/RaspberryPi/Drivers/MmcDxe/Mmc.c index c3c7279e4707..f6c4cc7bc3a3 100644 --- a/Platform/RaspberryPi/Drivers/MmcDxe/Mmc.c +++ b/Platform/RaspberryPi/Drivers/MmcDxe/Mmc.c @@ -2,6 +2,7 @@ * * Main file of the MMC Dxe driver. The driver entrypoint is defined into this file. * + * Copyright (c) 2019, Andrei Warkentin * Copyright (c) 2011-2013, ARM Limited. All rights reserved. * * SPDX-License-Identifier: BSD-2-Clause-Patent @@ -367,7 +368,11 @@ CheckCardsCallback ( MmcHostInstance->Initialized = !MmcHostInstance->Initialized; if (MmcHostInstance->BlockIo.Media->MediaPresent) { -InitializeMmcDevice (MmcHostInstance); +Status = InitializeMmcDevice (MmcHostInstance); +if (EFI_ERROR (Status)) { + MmcHostInstance->Initialized = !MmcHostInstance->Initialized; + continue; +} } Status = gBS->ReinstallProtocolInterface ( -- 2.21.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51338): https://edk2.groups.io/g/devel/message/51338 Mute This Topic: https://groups.io/mt/62504744/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-