From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.412.1573712556165867066 for ; Wed, 13 Nov 2019 22:22:36 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: nathaniel.l.desimone@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Nov 2019 22:22:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,302,1569308400"; d="scan'208";a="216641614" Received: from nldesimo-desk1.amr.corp.intel.com ([10.7.159.63]) by orsmga002.jf.intel.com with ESMTP; 13 Nov 2019 22:22:34 -0800 From: "Nate DeSimone" To: devel@edk2.groups.io Cc: Chasel Chiu , Michael Kubacki Subject: [edk2-platforms] [PATCH V1 06/13] WhiskeylakeOpenBoardPkg: Add SiliconInitLib APIs to BoardInitLib Date: Wed, 13 Nov 2019 22:06:48 -0800 Message-Id: <20191114060655.5161-7-nathaniel.l.desimone@intel.com> X-Mailer: git-send-email 2.23.0.windows.1 In-Reply-To: <20191114060655.5161-1-nathaniel.l.desimone@intel.com> References: <20191114060655.5161-1-nathaniel.l.desimone@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Cc: Chasel Chiu Cc: Michael Kubacki Signed-off-by: Nate DeSimone --- .../BoardInitLib/PeiBoardInitPostMemLib.inf | 1 + .../BoardInitLib/PeiBoardInitPreMemLib.inf | 1 + .../PeiMultiBoardInitPostMemLib.inf | 1 + .../PeiMultiBoardInitPreMemLib.inf | 2 +- .../PeiWhiskeylakeURvpInitPostMemLib.c | 6 +- .../PeiWhiskeylakeURvpInitPreMemLib.c | 89 ++----------------- .../BoardInitLib/WhiskeylakeURvpInit.h | 1 + .../WhiskeylakeURvp/OpenBoardPkg.dsc | 5 ++ 8 files changed, 24 insertions(+), 82 deletions(-) diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library= /BoardInitLib/PeiBoardInitPostMemLib.inf b/Platform/Intel/WhiskeylakeOpenBo= ardPkg/WhiskeylakeURvp/Library/BoardInitLib/PeiBoardInitPostMemLib.inf index 9bf4d127c5..affc5c56ad 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/BoardI= nitLib/PeiBoardInitPostMemLib.inf +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/BoardI= nitLib/PeiBoardInitPostMemLib.inf @@ -26,6 +26,7 @@ HdaVerbTableLib=0D MemoryAllocationLib=0D PcdLib=0D + SiliconInitLib=0D =0D [Packages]=0D MinPlatformPkg/MinPlatformPkg.dec=0D diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library= /BoardInitLib/PeiBoardInitPreMemLib.inf b/Platform/Intel/WhiskeylakeOpenBoa= rdPkg/WhiskeylakeURvp/Library/BoardInitLib/PeiBoardInitPreMemLib.inf index 4ab80f9eb3..40e20285e0 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/BoardI= nitLib/PeiBoardInitPreMemLib.inf +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/BoardI= nitLib/PeiBoardInitPreMemLib.inf @@ -23,6 +23,7 @@ BaseMemoryLib=0D MemoryAllocationLib=0D PcdLib=0D + SiliconInitLib=0D =0D [Packages]=0D MinPlatformPkg/MinPlatformPkg.dec=0D diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library= /BoardInitLib/PeiMultiBoardInitPostMemLib.inf b/Platform/Intel/WhiskeylakeO= penBoardPkg/WhiskeylakeURvp/Library/BoardInitLib/PeiMultiBoardInitPostMemLi= b.inf index c043e32638..21dc2f70c0 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/BoardI= nitLib/PeiMultiBoardInitPostMemLib.inf +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/BoardI= nitLib/PeiMultiBoardInitPostMemLib.inf @@ -30,6 +30,7 @@ PeiPlatformHookLib=0D PeiPolicyInitLib=0D PchInfoLib=0D + SiliconInitLib=0D =0D [Packages]=0D MinPlatformPkg/MinPlatformPkg.dec=0D diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library= /BoardInitLib/PeiMultiBoardInitPreMemLib.inf b/Platform/Intel/WhiskeylakeOp= enBoardPkg/WhiskeylakeURvp/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.= inf index cd0315377a..7389f1dfcd 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/BoardI= nitLib/PeiMultiBoardInitPreMemLib.inf +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/BoardI= nitLib/PeiMultiBoardInitPreMemLib.inf @@ -31,6 +31,7 @@ PeiPlatformHookLib=0D PeiPolicyInitLib=0D PlatformHookLib=0D + SiliconInitLib=0D StallPpiLib=0D =0D [Packages]=0D @@ -57,7 +58,6 @@ =0D [Guids]=0D gPchGeneralPreMemConfigGuid ## CONSUMES=0D - gTcoWdtHobGuid ## CONSUMES=0D =0D [Pcd]=0D gWhiskeylakeOpenBoardPkgTokenSpaceGuid.PcdLpcSioConfigDefaultPort=0D diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library= /BoardInitLib/PeiWhiskeylakeURvpInitPostMemLib.c b/Platform/Intel/Whiskeyla= keOpenBoardPkg/WhiskeylakeURvp/Library/BoardInitLib/PeiWhiskeylakeURvpInitP= ostMemLib.c index 9413620a4a..248a6657d5 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/BoardI= nitLib/PeiWhiskeylakeURvpInitPostMemLib.c +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/BoardI= nitLib/PeiWhiskeylakeURvpInitPostMemLib.c @@ -430,6 +430,10 @@ WhiskeylakeURvpBoardInitBeforeSiliconInit ( //=0D Status =3D UpdateChipsetInitPtr();=0D =0D + ///=0D + /// Do Late PCH init=0D + ///=0D + LateSiliconInit ();=0D +=0D return EFI_SUCCESS;=0D }=0D -=0D diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library= /BoardInitLib/PeiWhiskeylakeURvpInitPreMemLib.c b/Platform/Intel/Whiskeylak= eOpenBoardPkg/WhiskeylakeURvp/Library/BoardInitLib/PeiWhiskeylakeURvpInitPr= eMemLib.c index 0124888244..055d731651 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/BoardI= nitLib/PeiWhiskeylakeURvpInitPreMemLib.c +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/BoardI= nitLib/PeiWhiskeylakeURvpInitPreMemLib.c @@ -45,7 +45,6 @@ #include =0D #include =0D #include =0D -#include =0D #include =0D =0D ///=0D @@ -232,50 +231,8 @@ BoardMiscInitPreMem( return EFI_SUCCESS;=0D }=0D =0D -//@todo it should be moved to Si Pkg.=0D -/**=0D -Early Platform PCH initialization=0D -**/=0D -VOID=0D -EarlyPlatformPchInit(=0D - VOID=0D -)=0D -{=0D - UINT8 Data8;=0D - UINT8 TcoRebootHappened;=0D - TCO_WDT_HOB *TcoWdtHobPtr;=0D - EFI_STATUS Status;=0D -=0D - ///=0D - /// Read the Second TO status bit=0D - ///=0D - Data8 =3D IoRead8(PcdGet16(PcdTcoBaseAddress) + R_TCO_IO_TCO2_STS);=0D - if ((Data8 & B_TCO_IO_TCO2_STS_SECOND_TO) =3D=3D B_TCO_IO_TCO2_STS_SECON= D_TO) {=0D - TcoRebootHappened =3D 1;=0D - DEBUG((DEBUG_INFO, "PlatformInitPreMem - TCO Second TO status bit is s= et. This might be a TCO reboot\n"));=0D - }=0D - else {=0D - TcoRebootHappened =3D 0;=0D - }=0D -=0D - ///=0D - /// Create HOB=0D - ///=0D - Status =3D PeiServicesCreateHob(EFI_HOB_TYPE_GUID_EXTENSION, sizeof(TCO_= WDT_HOB), (VOID **)&TcoWdtHobPtr);=0D - if (!EFI_ERROR(Status)) {=0D - TcoWdtHobPtr->Header.Name =3D gTcoWdtHobGuid;=0D - TcoWdtHobPtr->TcoRebootHappened =3D TcoRebootHappened;=0D - }=0D -=0D - ///=0D - /// Clear the Second TO status bit=0D - ///=0D - IoWrite8(PcdGet16(PcdTcoBaseAddress) + R_TCO_IO_TCO2_STS, B_TCO_IO_TCO2_= STS_SECOND_TO);=0D -}=0D -=0D /**=0D Board configuration initialization in the pre-memory boot phase.=0D -=0D **/=0D VOID=0D BoardConfigInitPreMem (=0D @@ -341,7 +298,6 @@ PlatformInitPreMemCallBack( )=0D {=0D EFI_STATUS Status;=0D - UINT16 ABase;=0D UINT8 FwConfig;=0D =0D //=0D @@ -378,16 +334,8 @@ PlatformInitPreMemCallBack( ///=0D /// Configure GPIO and SIO=0D ///=0D - Status =3D BoardInitPreMem();=0D - ASSERT_EFI_ERROR(Status);=0D -=0D - ABase =3D PmcGetAcpiBase();=0D -=0D - ///=0D - /// Clear all pending SMI. On S3 clear power button enable so it will no= t generate an SMI.=0D - ///=0D - IoWrite16(ABase + R_ACPI_IO_PM1_EN, 0);=0D - IoWrite32(ABase + R_ACPI_IO_GPE0_EN_127_96, 0);=0D + Status =3D BoardInitPreMem ();=0D + ASSERT_EFI_ERROR (Status);=0D =0D ///=0D /// Install Pre Memory PPIs=0D @@ -550,12 +498,6 @@ WhiskeylakeURvpInitPreMem ( Status =3D InstallStallPpi();=0D ASSERT_EFI_ERROR(Status);=0D =0D - ///@todo it should be moved to Si Pkg.=0D - ///=0D - /// Do Early PCH init=0D - ///=0D - EarlyPlatformPchInit();=0D -=0D //=0D // Install PCH RESET PPI and EFI RESET2 PeiService=0D //=0D @@ -588,6 +530,11 @@ WhiskeylakeURvpBoardInitBeforeMemoryInit ( VOID=0D )=0D {=0D + ///=0D + /// Do basic PCH init=0D + ///=0D + SiliconInit ();=0D +=0D WhiskeylakeURvpInitPreMem ();=0D =0D return EFI_SUCCESS;=0D @@ -600,27 +547,9 @@ WhiskeylakeURvpBoardDebugInit ( )=0D {=0D ///=0D - /// LPC I/O Configuration=0D + /// Do Early PCH init=0D ///=0D - PchLpcIoDecodeRangesSet (=0D - (V_LPC_CFG_IOD_LPT_378 << N_LPC_CFG_IOD_LPT) |=0D - (V_LPC_CFG_IOD_COMB_3E8 << N_LPC_CFG_IOD_COMB) |=0D - (V_LPC_CFG_IOD_COMA_3F8 << N_LPC_CFG_IOD_COMA)=0D - );=0D -=0D - PchLpcIoEnableDecodingSet (=0D - B_LPC_CFG_IOE_ME2 |=0D - B_LPC_CFG_IOE_SE |=0D - B_LPC_CFG_IOE_ME1 |=0D - B_LPC_CFG_IOE_KE |=0D - B_LPC_CFG_IOE_HGE |=0D - B_LPC_CFG_IOE_LGE |=0D - B_LPC_CFG_IOE_FDE |=0D - B_LPC_CFG_IOE_PPE |=0D - B_LPC_CFG_IOE_CBE |=0D - B_LPC_CFG_IOE_CAE=0D - );=0D -=0D + EarlySiliconInit ();=0D return EFI_SUCCESS;=0D }=0D =0D diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library= /BoardInitLib/WhiskeylakeURvpInit.h b/Platform/Intel/WhiskeylakeOpenBoardPk= g/WhiskeylakeURvp/Library/BoardInitLib/WhiskeylakeURvpInit.h index 325bcb41df..d3a709b2a9 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/BoardI= nitLib/WhiskeylakeURvpInit.h +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Library/BoardI= nitLib/WhiskeylakeURvpInit.h @@ -15,6 +15,7 @@ #include =0D #include =0D #include =0D +#include =0D #include =0D #include =0D =0D diff --git a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoa= rdPkg.dsc b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoar= dPkg.dsc index cdaf47b6f7..3cd0478021 100644 --- a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.d= sc +++ b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.d= sc @@ -154,6 +154,11 @@ TimerLib|$(PLATFORM_BOARD_PACKAGE)/Library/AcpiTimerLib/BaseAcpiTimerLib= .inf=0D =0D [LibraryClasses.common.PEIM]=0D + #######################################=0D + # Silicon Initialization Package=0D + #######################################=0D + SiliconInitLib|$(PLATFORM_SI_PACKAGE)/Library/PeiSiliconInitLib/PeiSilic= onInitLib.inf=0D +=0D #######################################=0D # Platform Package=0D #######################################=0D --=20 2.23.0.windows.1