[edk2-devel] [PATCH 1/2] Intel/MinPlatformPkg: Support DXE drivers in FSP 2.1.
From: "Chasel, Chiu" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1873 In dispatch mode FSP-S contains DXE drivers so needs to BuildFvHob for DXE dispatcher to dispatch this FV. Test: FSP API mode still boots successfully without impact. Cc: Michael Kubacki Cc: Nate DeSimone Cc: Liming Gao Signed-off-by: Chasel Chiu --- Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobProcessLib/FspWrapperHobProcessLib.c | 19 --- Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobProcessLib/PeiFspWrapperHobProcessLib.inf | 5 - 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobProcessLib/FspWrapperHobProcessLib.c b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobProcessLib/FspWrapperHobProcessLib.c index e8df06dfb7..7ee4d3a31c 100644 --- a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobProcessLib/FspWrapperHobProcessLib.c +++ b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobProcessLib/FspWrapperHobProcessLib.c @@ -1,7 +1,7 @@ /** @file Provide FSP wrapper hob process related function. -Copyright (c) 2017, Intel Corporation. All rights reserved. +Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -653,8 +653,21 @@ PostFspsHobProcess ( { EFI_STATUS Status; - ProcessFspHobList (FspHobList); - + if (PcdGet8 (PcdFspModeSelection) == 1) { +// +// Only in FSP API mode the wrapper has to build hobs basing on FSP output data. +// +ASSERT (FspHobList != NULL); +ProcessFspHobList (FspHobList); + } else { +// +// Only in FSP Dispatch mode, FSP-S should be reported to DXE dispatcher. +// +BuildFvHob ( + (EFI_PHYSICAL_ADDRESS) (UINTN) PcdGet32 (PcdFlashFvFspSBase), + PcdGet32 (PcdFlashFvFspSSize) + ); + } CheckFspGraphicsDeviceInfoHob (); DEBUG_CODE_BEGIN (); DumpFspSmbiosMemoryInfoHob (); diff --git a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobProcessLib/PeiFspWrapperHobProcessLib.inf b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobProcessLib/PeiFspWrapperHobProcessLib.inf index a76e3195d6..64f3302959 100644 --- a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobProcessLib/PeiFspWrapperHobProcessLib.inf +++ b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobProcessLib/PeiFspWrapperHobProcessLib.inf @@ -1,7 +1,7 @@ ## @file # Provide FSP wrapper hob process related function. # -# Copyright (c) 2017, Intel Corporation. All rights reserved. +# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -65,6 +65,9 @@ gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress gMinPlatformPkgTokenSpaceGuid.PcdPciExpressRegionLength gMinPlatformPkgTokenSpaceGuid.PcdFspCpuPeiApWakeupBufferAddr + gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection + gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSBase + gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSSize [Guids] gFspReservedMemoryResourceHobGuid ## CONSUMES ## HOB -- 2.13.3.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#41845): https://edk2.groups.io/g/devel/message/41845 Mute This Topic: https://groups.io/mt/31917294/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 1/2] Intel/MinPlatformPkg: Support DXE drivers in FSP 2.1.
The FSP specification allows FSP-S to contain an arbitrary number of Firmware Volumes. Your attached patch makes the assumption that it only contains one. I'm OK if you decide to commit this as-is for now since it is better than nothing, but I expect a Bugzilla to be filed to fix the 1 FV assumption. Reviewed-by: Nate DeSimone -Original Message- From: Chiu, Chasel Sent: Monday, June 3, 2019 5:53 PM To: devel@edk2.groups.io Cc: Chiu, Chasel ; Kubacki, Michael A ; Desimone, Nathaniel L ; Gao, Liming Subject: [PATCH 1/2] Intel/MinPlatformPkg: Support DXE drivers in FSP 2.1. From: "Chasel, Chiu" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1873 In dispatch mode FSP-S contains DXE drivers so needs to BuildFvHob for DXE dispatcher to dispatch this FV. Test: FSP API mode still boots successfully without impact. Cc: Michael Kubacki Cc: Nate DeSimone Cc: Liming Gao Signed-off-by: Chasel Chiu --- Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobProcessLib/FspWrapperHobProcessLib.c | 19 --- Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobProcessLib/PeiFspWrapperHobProcessLib.inf | 5 - 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobProcessLib/FspWrapperHobProcessLib.c b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobProcessLib/FspWrapperHobProcessLib.c index e8df06dfb7..7ee4d3a31c 100644 --- a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobProcessLib/FspWrapperHobProcessLib.c +++ b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobP +++ rocessLib/FspWrapperHobProcessLib.c @@ -1,7 +1,7 @@ /** @file Provide FSP wrapper hob process related function. -Copyright (c) 2017, Intel Corporation. All rights reserved. +Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -653,8 +653,21 @@ PostFspsHobProcess ( { EFI_STATUS Status; - ProcessFspHobList (FspHobList); - + if (PcdGet8 (PcdFspModeSelection) == 1) { +// +// Only in FSP API mode the wrapper has to build hobs basing on FSP output data. +// +ASSERT (FspHobList != NULL); +ProcessFspHobList (FspHobList); + } else { +// +// Only in FSP Dispatch mode, FSP-S should be reported to DXE dispatcher. +// +BuildFvHob ( + (EFI_PHYSICAL_ADDRESS) (UINTN) PcdGet32 (PcdFlashFvFspSBase), + PcdGet32 (PcdFlashFvFspSSize) + ); + } CheckFspGraphicsDeviceInfoHob (); DEBUG_CODE_BEGIN (); DumpFspSmbiosMemoryInfoHob (); diff --git a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobProcessLib/PeiFspWrapperHobProcessLib.inf b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobProcessLib/PeiFspWrapperHobProcessLib.inf index a76e3195d6..64f3302959 100644 --- a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobProcessLib/PeiFspWrapperHobProcessLib.inf +++ b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobP +++ rocessLib/PeiFspWrapperHobProcessLib.inf @@ -1,7 +1,7 @@ ## @file # Provide FSP wrapper hob process related function. # -# Copyright (c) 2017, Intel Corporation. All rights reserved. +# Copyright (c) 2017 - 2019, Intel Corporation. All rights +reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -65,6 +65,9 @@ gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress gMinPlatformPkgTokenSpaceGuid.PcdPciExpressRegionLength gMinPlatformPkgTokenSpaceGuid.PcdFspCpuPeiApWakeupBufferAddr + gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection + gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSBase + gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSSize [Guids] gFspReservedMemoryResourceHobGuid ## CONSUMES ## HOB -- 2.13.3.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#41992): https://edk2.groups.io/g/devel/message/41992 Mute This Topic: https://groups.io/mt/31917294/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 1/2] Intel/MinPlatformPkg: Support DXE drivers in FSP 2.1.
Agreed. Bugzilla filed for enhancement: https://bugzilla.tianocore.org/show_bug.cgi?id=1892 Thanks! Chasel > -Original Message- > From: Desimone, Nathaniel L > Sent: Thursday, June 6, 2019 5:54 PM > To: Chiu, Chasel ; devel@edk2.groups.io > Cc: Kubacki, Michael A ; Gao, Liming > > Subject: RE: [PATCH 1/2] Intel/MinPlatformPkg: Support DXE drivers in FSP 2.1. > > The FSP specification allows FSP-S to contain an arbitrary number of Firmware > Volumes. Your attached patch makes the assumption that it only contains one. > I'm OK if you decide to commit this as-is for now since it is better than > nothing, > but I expect a Bugzilla to be filed to fix the 1 FV assumption. > > Reviewed-by: Nate DeSimone > > -Original Message- > From: Chiu, Chasel > Sent: Monday, June 3, 2019 5:53 PM > To: devel@edk2.groups.io > Cc: Chiu, Chasel ; Kubacki, Michael A > ; Desimone, Nathaniel L > ; Gao, Liming > Subject: [PATCH 1/2] Intel/MinPlatformPkg: Support DXE drivers in FSP 2.1. > > From: "Chasel, Chiu" > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1873 > > In dispatch mode FSP-S contains DXE drivers so needs to BuildFvHob for DXE > dispatcher to dispatch this FV. > > Test: FSP API mode still boots successfully without impact. > > Cc: Michael Kubacki > Cc: Nate DeSimone > Cc: Liming Gao > Signed-off-by: Chasel Chiu > --- > > Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobProce > ssLib/FspWrapperHobProcessLib.c | 19 --- > > Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobProce > ssLib/PeiFspWrapperHobProcessLib.inf | 5 - > 2 files changed, 20 insertions(+), 4 deletions(-) > > diff --git > a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobPro > cessLib/FspWrapperHobProcessLib.c > b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobPro > cessLib/FspWrapperHobProcessLib.c > index e8df06dfb7..7ee4d3a31c 100644 > --- > a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobPro > cessLib/FspWrapperHobProcessLib.c > +++ > b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobP > +++ rocessLib/FspWrapperHobProcessLib.c > @@ -1,7 +1,7 @@ > /** @file >Provide FSP wrapper hob process related function. > > -Copyright (c) 2017, Intel Corporation. All rights reserved. > +Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved. > SPDX-License-Identifier: BSD-2-Clause-Patent > > **/ > @@ -653,8 +653,21 @@ PostFspsHobProcess ( { >EFI_STATUS Status; > > - ProcessFspHobList (FspHobList); > - > + if (PcdGet8 (PcdFspModeSelection) == 1) { > +// > +// Only in FSP API mode the wrapper has to build hobs basing on FSP > output > data. > +// > +ASSERT (FspHobList != NULL); > +ProcessFspHobList (FspHobList); > + } else { > +// > +// Only in FSP Dispatch mode, FSP-S should be reported to DXE dispatcher. > +// > +BuildFvHob ( > + (EFI_PHYSICAL_ADDRESS) (UINTN) PcdGet32 (PcdFlashFvFspSBase), > + PcdGet32 (PcdFlashFvFspSSize) > + ); > + } >CheckFspGraphicsDeviceInfoHob (); >DEBUG_CODE_BEGIN (); > DumpFspSmbiosMemoryInfoHob (); > diff --git > a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobPro > cessLib/PeiFspWrapperHobProcessLib.inf > b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobPro > cessLib/PeiFspWrapperHobProcessLib.inf > index a76e3195d6..64f3302959 100644 > --- > a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobPro > cessLib/PeiFspWrapperHobProcessLib.inf > +++ > b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperHobP > +++ rocessLib/PeiFspWrapperHobProcessLib.inf > @@ -1,7 +1,7 @@ > ## @file > # Provide FSP wrapper hob process related function. > # > -# Copyright (c) 2017, Intel Corporation. All rights reserved. > +# Copyright (c) 2017 - 2019, Intel Corporation. All rights > +reserved. > # > # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -65,6 +65,9 @@ >gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress >gMinPlatformPkgTokenSpaceGuid.PcdPciExpressRegionLength >gMinPlatformPkgTokenSpaceGuid.PcdFspCpuPeiApWakeupBufferAddr > + gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection > + gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSBase > + gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSSize > > [Guids] >gFspReservedMemoryResourceHobGuid ## CONSUMES ## > HOB > -- > 2.13.3.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#42141): https://edk2.groups.io/g/devel/message/42141 Mute This Topic: https://groups.io/mt/31917294/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-