[edk2-devel] [edk2-platforms][PATCH V1] KabylakeOpenBoardPkg: Implement the PEI Reset Services

Nate DeSimone posted 1 patch 2 years, 9 months ago
Failed in applying to current master (apply log)
.../Library/BoardInitLib/PeiBoardInitPreMemLib.inf  |  3 ++-
.../BoardInitLib/PeiGalagoPro3InitPreMemLib.c       |  8 +++++++-
.../BoardInitLib/PeiMultiBoardInitPreMemLib.inf     |  3 ++-
.../Library/BoardInitLib/PeiBoardInitPreMemLib.inf  |  3 ++-
.../BoardInitLib/PeiKabylakeRvp3InitPreMemLib.c     | 13 +++++++++++--
.../BoardInitLib/PeiMultiBoardInitPreMemLib.inf     |  3 ++-
6 files changed, 26 insertions(+), 7 deletions(-)
[edk2-devel] [edk2-platforms][PATCH V1] KabylakeOpenBoardPkg: Implement the PEI Reset Services
Posted by Nate DeSimone 2 years, 9 months ago
This change implements the ResetSystem and ResetSystem2
PEI services for KabylakeRvp3 and GalagoPro3. The
invocation of PchInitializeReset() was missing from
BoardInitLib.

Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Jeremy Soller <jeremy@system76.com>
Cc: Michael Kubacki <Michael.Kubacki@microsoft.com>
Cc: Benjamin Doron <benjamin.doron00@gmail.com>
---
 .../Library/BoardInitLib/PeiBoardInitPreMemLib.inf  |  3 ++-
 .../BoardInitLib/PeiGalagoPro3InitPreMemLib.c       |  8 +++++++-
 .../BoardInitLib/PeiMultiBoardInitPreMemLib.inf     |  3 ++-
 .../Library/BoardInitLib/PeiBoardInitPreMemLib.inf  |  3 ++-
 .../BoardInitLib/PeiKabylakeRvp3InitPreMemLib.c     | 13 +++++++++++--
 .../BoardInitLib/PeiMultiBoardInitPreMemLib.inf     |  3 ++-
 6 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/PeiBoardInitPreMemLib.inf b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/PeiBoardInitPreMemLib.inf
index e4b783684f..d6c91cd2b9 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/PeiBoardInitPreMemLib.inf
+++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/PeiBoardInitPreMemLib.inf
@@ -1,7 +1,7 @@
 ## @file
 # Component information file for PEI GalagoPro3 Board Init Pre-Mem Library
 #
-# Copyright (c) 2019 - 2020 Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2019 - 2021 Intel Corporation. All rights reserved.<BR>
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -22,6 +22,7 @@
   MemoryAllocationLib
   PcdLib
   SiliconInitLib
+  PchResetLib
 
 [Packages]
   MinPlatformPkg/MinPlatformPkg.dec
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/PeiGalagoPro3InitPreMemLib.c b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/PeiGalagoPro3InitPreMemLib.c
index ca32ab2514..6bf77a2af0 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/PeiGalagoPro3InitPreMemLib.c
+++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/PeiGalagoPro3InitPreMemLib.c
@@ -1,7 +1,7 @@
 /** @file
   System 76 GalagoPro3 board pre-memory initialization.
 
-Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -209,6 +209,12 @@ GalagoPro3BoardInitBeforeMemoryInit (
   ///
   SiliconInit ();
 
+  //
+  // Install PCH RESET PPI and EFI RESET2 PeiService
+  //
+  Status = PchInitializeReset ();
+  ASSERT_EFI_ERROR (Status);
+
   return EFI_SUCCESS;
 }
 
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.inf b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.inf
index d866f59338..fe31f42135 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.inf
+++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.inf
@@ -1,7 +1,7 @@
 ## @file
 # Component information file for PEI GalagoPro3 Board Init Pre-Mem Library
 #
-# Copyright (c) 2019 - 2020 Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2019 - 2021 Intel Corporation. All rights reserved.<BR>
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -24,6 +24,7 @@
   PcdLib
   SiliconInitLib
   MultiBoardInitSupportLib
+  PchResetLib
 
 [Packages]
   MinPlatformPkg/MinPlatformPkg.dec
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiBoardInitPreMemLib.inf b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiBoardInitPreMemLib.inf
index d0cdba666f..850fc51418 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiBoardInitPreMemLib.inf
+++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiBoardInitPreMemLib.inf
@@ -1,7 +1,7 @@
 ## @file
 # Component information file for PEI KabylakeRvp3 Board Init Pre-Mem Library
 #
-# Copyright (c) 2017 - 2020 Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2017 - 2021 Intel Corporation. All rights reserved.<BR>
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -23,6 +23,7 @@
   PcdLib
   SiliconInitLib
   EcLib
+  PchResetLib
 
 [Packages]
   MinPlatformPkg/MinPlatformPkg.dec
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiKabylakeRvp3InitPreMemLib.c b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiKabylakeRvp3InitPreMemLib.c
index 8f2e036356..d34b0be3c7 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiKabylakeRvp3InitPreMemLib.c
+++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiKabylakeRvp3InitPreMemLib.c
@@ -1,6 +1,6 @@
 /** @file
 
-Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -28,6 +28,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <SioRegs.h>
 #include <Library/PchPcrLib.h>
 #include <Library/SiliconInitLib.h>
+#include <Library/PchResetLib.h>
 
 #include "PeiKabylakeRvp3InitLib.h"
 
@@ -282,6 +283,8 @@ KabylakeRvp3BoardInitBeforeMemoryInit (
   VOID
   )
 {
+  EFI_STATUS    Status;
+
   if (LibPcdGetSku () == BoardIdKabyLakeYLpddr3Rvp3) {
     KabylakeRvp3InitPreMem ();
   } else if (LibPcdGetSku () == BoardIdSkylakeRvp3) {
@@ -297,12 +300,18 @@ KabylakeRvp3BoardInitBeforeMemoryInit (
 
   GpioInitPreMem ();
   SioInit ();
-    
+
   ///
   /// Do basic PCH init
   ///
   SiliconInit ();
 
+  //
+  // Install PCH RESET PPI and EFI RESET2 PeiService
+  //
+  Status = PchInitializeReset ();
+  ASSERT_EFI_ERROR (Status);
+
   return EFI_SUCCESS;
 }
 
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.inf b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.inf
index a51712ac34..23fe6b6f03 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.inf
+++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.inf
@@ -1,7 +1,7 @@
 ## @file
 # Component information file for PEI KabylakeRvp3 Board Init Pre-Mem Library
 #
-# Copyright (c) 2017 - 2020 Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2017 - 2021 Intel Corporation. All rights reserved.<BR>
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -25,6 +25,7 @@
   SiliconInitLib
   MultiBoardInitSupportLib
   EcLib
+  PchResetLib
 
 [Packages]
   MinPlatformPkg/MinPlatformPkg.dec
-- 
2.27.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#77743): https://edk2.groups.io/g/devel/message/77743
Mute This Topic: https://groups.io/mt/84174637/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [edk2-platforms][PATCH V1] KabylakeOpenBoardPkg: Implement the PEI Reset Services
Posted by Chiu, Chasel 2 years, 9 months ago
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>


> -----Original Message-----
> From: Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
> Sent: Tuesday, July 13, 2021 5:27 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Jeremy Soller
> <jeremy@system76.com>; Michael Kubacki <Michael.Kubacki@microsoft.com>;
> Benjamin Doron <benjamin.doron00@gmail.com>
> Subject: [edk2-platforms][PATCH V1] KabylakeOpenBoardPkg: Implement the
> PEI Reset Services
> 
> This change implements the ResetSystem and ResetSystem2 PEI services for
> KabylakeRvp3 and GalagoPro3. The invocation of PchInitializeReset() was
> missing from BoardInitLib.
> 
> Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Chasel Chiu <chasel.chiu@intel.com>
> Cc: Jeremy Soller <jeremy@system76.com>
> Cc: Michael Kubacki <Michael.Kubacki@microsoft.com>
> Cc: Benjamin Doron <benjamin.doron00@gmail.com>
> ---
>  .../Library/BoardInitLib/PeiBoardInitPreMemLib.inf  |  3 ++-
>  .../BoardInitLib/PeiGalagoPro3InitPreMemLib.c       |  8 +++++++-
>  .../BoardInitLib/PeiMultiBoardInitPreMemLib.inf     |  3 ++-
>  .../Library/BoardInitLib/PeiBoardInitPreMemLib.inf  |  3 ++-
>  .../BoardInitLib/PeiKabylakeRvp3InitPreMemLib.c     | 13 +++++++++++--
>  .../BoardInitLib/PeiMultiBoardInitPreMemLib.inf     |  3 ++-
>  6 files changed, 26 insertions(+), 7 deletions(-)
> 
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/PeiB
> oardInitPreMemLib.inf
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/PeiB
> oardInitPreMemLib.inf
> index e4b783684f..d6c91cd2b9 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/PeiB
> oardInitPreMemLib.inf
> +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLi
> +++ b/PeiBoardInitPreMemLib.inf
> @@ -1,7 +1,7 @@
>  ## @file
>  # Component information file for PEI GalagoPro3 Board Init Pre-Mem Library  #
> -# Copyright (c) 2019 - 2020 Intel Corporation. All rights reserved.<BR>
> +# Copyright (c) 2019 - 2021 Intel Corporation. All rights reserved.<BR>
>  #
>  # SPDX-License-Identifier: BSD-2-Clause-Patent  # @@ -22,6 +22,7 @@
>    MemoryAllocationLib
>    PcdLib
>    SiliconInitLib
> +  PchResetLib
> 
>  [Packages]
>    MinPlatformPkg/MinPlatformPkg.dec
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/PeiG
> alagoPro3InitPreMemLib.c
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/PeiG
> alagoPro3InitPreMemLib.c
> index ca32ab2514..6bf77a2af0 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/PeiG
> alagoPro3InitPreMemLib.c
> +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLi
> +++ b/PeiGalagoPro3InitPreMemLib.c
> @@ -1,7 +1,7 @@
>  /** @file
>    System 76 GalagoPro3 board pre-memory initialization.
> 
> -Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.<BR>
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> @@ -209,6 +209,12 @@ GalagoPro3BoardInitBeforeMemoryInit (
>    ///
>    SiliconInit ();
> 
> +  //
> +  // Install PCH RESET PPI and EFI RESET2 PeiService  //  Status =
> + PchInitializeReset ();  ASSERT_EFI_ERROR (Status);
> +
>    return EFI_SUCCESS;
>  }
> 
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/Pei
> MultiBoardInitPreMemLib.inf
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/Pei
> MultiBoardInitPreMemLib.inf
> index d866f59338..fe31f42135 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/Pei
> MultiBoardInitPreMemLib.inf
> +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLi
> +++ b/PeiMultiBoardInitPreMemLib.inf
> @@ -1,7 +1,7 @@
>  ## @file
>  # Component information file for PEI GalagoPro3 Board Init Pre-Mem Library  #
> -# Copyright (c) 2019 - 2020 Intel Corporation. All rights reserved.<BR>
> +# Copyright (c) 2019 - 2021 Intel Corporation. All rights reserved.<BR>
>  #
>  # SPDX-License-Identifier: BSD-2-Clause-Patent  # @@ -24,6 +24,7 @@
>    PcdLib
>    SiliconInitLib
>    MultiBoardInitSupportLib
> +  PchResetLib
> 
>  [Packages]
>    MinPlatformPkg/MinPlatformPkg.dec
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/Pe
> iBoardInitPreMemLib.inf
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/Pe
> iBoardInitPreMemLib.inf
> index d0cdba666f..850fc51418 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/Pe
> iBoardInitPreMemLib.inf
> +++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInit
> +++ Lib/PeiBoardInitPreMemLib.inf
> @@ -1,7 +1,7 @@
>  ## @file
>  # Component information file for PEI KabylakeRvp3 Board Init Pre-Mem Library
> # -# Copyright (c) 2017 - 2020 Intel Corporation. All rights reserved.<BR>
> +# Copyright (c) 2017 - 2021 Intel Corporation. All rights reserved.<BR>
>  #
>  # SPDX-License-Identifier: BSD-2-Clause-Patent  # @@ -23,6 +23,7 @@
>    PcdLib
>    SiliconInitLib
>    EcLib
> +  PchResetLib
> 
>  [Packages]
>    MinPlatformPkg/MinPlatformPkg.dec
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/Pe
> iKabylakeRvp3InitPreMemLib.c
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/Pe
> iKabylakeRvp3InitPreMemLib.c
> index 8f2e036356..d34b0be3c7 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/Pe
> iKabylakeRvp3InitPreMemLib.c
> +++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInit
> +++ Lib/PeiKabylakeRvp3InitPreMemLib.c
> @@ -1,6 +1,6 @@
>  /** @file
> 
> -Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR>
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> @@ -28,6 +28,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent  #include
> <SioRegs.h>  #include <Library/PchPcrLib.h>  #include <Library/SiliconInitLib.h>
> +#include <Library/PchResetLib.h>
> 
>  #include "PeiKabylakeRvp3InitLib.h"
> 
> @@ -282,6 +283,8 @@ KabylakeRvp3BoardInitBeforeMemoryInit (
>    VOID
>    )
>  {
> +  EFI_STATUS    Status;
> +
>    if (LibPcdGetSku () == BoardIdKabyLakeYLpddr3Rvp3) {
>      KabylakeRvp3InitPreMem ();
>    } else if (LibPcdGetSku () == BoardIdSkylakeRvp3) { @@ -297,12 +300,18 @@
> KabylakeRvp3BoardInitBeforeMemoryInit (
> 
>    GpioInitPreMem ();
>    SioInit ();
> -
> +
>    ///
>    /// Do basic PCH init
>    ///
>    SiliconInit ();
> 
> +  //
> +  // Install PCH RESET PPI and EFI RESET2 PeiService  //  Status =
> + PchInitializeReset ();  ASSERT_EFI_ERROR (Status);
> +
>    return EFI_SUCCESS;
>  }
> 
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/Pe
> iMultiBoardInitPreMemLib.inf
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/Pe
> iMultiBoardInitPreMemLib.inf
> index a51712ac34..23fe6b6f03 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/Pe
> iMultiBoardInitPreMemLib.inf
> +++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInit
> +++ Lib/PeiMultiBoardInitPreMemLib.inf
> @@ -1,7 +1,7 @@
>  ## @file
>  # Component information file for PEI KabylakeRvp3 Board Init Pre-Mem Library
> # -# Copyright (c) 2017 - 2020 Intel Corporation. All rights reserved.<BR>
> +# Copyright (c) 2017 - 2021 Intel Corporation. All rights reserved.<BR>
>  #
>  # SPDX-License-Identifier: BSD-2-Clause-Patent  # @@ -25,6 +25,7 @@
>    SiliconInitLib
>    MultiBoardInitSupportLib
>    EcLib
> +  PchResetLib
> 
>  [Packages]
>    MinPlatformPkg/MinPlatformPkg.dec
> --
> 2.27.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#78004): https://edk2.groups.io/g/devel/message/78004
Mute This Topic: https://groups.io/mt/84174637/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-