From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web08.4705.1662532076879836693 for ; Tue, 06 Sep 2022 23:27:57 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=jyAZD7kr; spf=permerror, err=too many SPF records (domain: intel.com, ip: 192.55.52.43, mailfrom: nathaniel.l.desimone@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662532077; x=1694068077; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UiOEgACB1U3R6NSNn4N7QlLscUcc6xLOqyiXhXV2uSs=; b=jyAZD7krj1Zv9O3KgtuP0XFhzdWex/FcosxPHcxO90C0Bsi+nWti+UFB 7BlorCmcIUEm0Z3y+TBJbU9E099Y8l2v6tt6h93lz2G8v+1WCxTpYg3/V Lv5UpTOgziLFr/9ptJnF5qY9ogs5Gt+jpNk/jTbZIsY4pCFLqrUzvYM/U Ee1gsdFjCIiZzFO5Ihl/tBlRUpkC0Ch2YQv8F92DAqyQDuqasoANVUBBW v3p19GVDczxPIxLd+WVAWOGfxzABFTJ3q8a0azmKO4PS+Efmg9oV6Jc2g qXS818wre0bfRyMh1kV5/dVzPknpePjTtZMHMhjjazTOdZ6lymY04wrZL Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10462"; a="383088397" X-IronPort-AV: E=Sophos;i="5.93,295,1654585200"; d="scan'208";a="383088397" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2022 23:27:49 -0700 X-IronPort-AV: E=Sophos;i="5.93,295,1654585200"; d="scan'208";a="682687462" Received: from nldesimo-desk1.amr.corp.intel.com ([10.24.80.62]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Sep 2022 23:27:49 -0700 From: "Nate DeSimone" To: devel@edk2.groups.io Cc: Chasel Chiu , Sai Chaganty , Isaac Oram , Benjamin Doron , Michael Kubacki , Jeremy Soller Subject: [edk2-platforms] [PATCH V2 3/5] KabylakeOpenBoardPkg: Add SecBoardInitLib Date: Tue, 6 Sep 2022 23:27:33 -0700 Message-Id: <20220907062735.5734-4-nathaniel.l.desimone@intel.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20220907062735.5734-1-nathaniel.l.desimone@intel.com> References: <20220907062735.5734-1-nathaniel.l.desimone@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Adds a board-specific implementation of SecBoardInitLib. This implementation will invoke the GPIO initialization routine for the HDMI DDC Bus if the HDMI DDC Bus is being used for debug log output. Adds PCDs for enable/disable of using HDMI DDC I2C Bus as a Serial Port. Cc: Chasel Chiu Cc: Sai Chaganty Cc: Isaac Oram Cc: Benjamin Doron Cc: Michael Kubacki Cc: Jeremy Soller Signed-off-by: Nate DeSimone --- .../PeiAspireVn7Dash572GInitPreMemLib.c | 3 +- .../AspireVn7Dash572G/OpenBoardPkg.dsc | 8 +++- .../BoardInitLib/PeiGalagoPro3InitPreMemLib.c | 13 ++----- .../GalagoPro3/OpenBoardPkg.dsc | 7 +++- .../PeiKabylakeRvp3InitPreMemLib.c | 13 ++----- .../KabylakeRvp3/OpenBoardPkg.dsc | 8 +++- .../SecBoardInitLib/Ia32/SecBoardInit.nasm | 18 +++++++++ .../Library/SecBoardInitLib/SecBoardInitLib.c | 35 +++++++++++++++++ .../SecBoardInitLib/SecBoardInitLib.inf | 39 +++++++++++++++++++ .../KabylakeOpenBoardPkg/OpenBoardPkg.dec | 18 +++++++++ 10 files changed, 137 insertions(+), 25 deletions(-) create mode 100644 Platform/Intel/KabylakeOpenBoardPkg/Library/SecBoardInitLib/Ia32/SecBoardInit.nasm create mode 100644 Platform/Intel/KabylakeOpenBoardPkg/Library/SecBoardInitLib/SecBoardInitLib.c create mode 100644 Platform/Intel/KabylakeOpenBoardPkg/Library/SecBoardInitLib/SecBoardInitLib.inf diff --git a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Library/BoardInitLib/PeiAspireVn7Dash572GInitPreMemLib.c b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Library/BoardInitLib/PeiAspireVn7Dash572GInitPreMemLib.c index d17685be82..1c9a65399b 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Library/BoardInitLib/PeiAspireVn7Dash572GInitPreMemLib.c +++ b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/Library/BoardInitLib/PeiAspireVn7Dash572GInitPreMemLib.c @@ -1,6 +1,6 @@ /** @file -Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.
+Copyright (c) 2017 - 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -251,7 +251,6 @@ AspireVn7Dash572GBoardDebugInit ( /// /// Do Early PCH init /// - EarlySiliconInit (); LpcInit (); // NB: MinPlatform specification defines platform initialisation flow. diff --git a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/OpenBoardPkg.dsc b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/OpenBoardPkg.dsc index ec5591e00f..261f141056 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/OpenBoardPkg.dsc +++ b/Platform/Intel/KabylakeOpenBoardPkg/AspireVn7Dash572G/OpenBoardPkg.dsc @@ -209,8 +209,12 @@ # Platform Package ####################################### TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib/SecTestPointCheckLib.inf - SecBoardInitLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/SecBoardInitLibNull/SecBoardInitLibNull.inf - SiliconPolicyUpdateLib|MinPlatformPkg/PlatformInit/Library/SiliconPolicyUpdateLibNull/SiliconPolicyUpdateLibNull.inf + SiliconPolicyUpdateLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/SiliconPolicyUpdateLibNull/SiliconPolicyUpdateLibNull.inf + + ####################################### + # Board-specific + ####################################### + SecBoardInitLib|$(PLATFORM_BOARD_PACKAGE)/Library/SecBoardInitLib/SecBoardInitLib.inf [LibraryClasses.common.PEI_CORE] ####################################### diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/PeiGalagoPro3InitPreMemLib.c b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardInitLib/PeiGalagoPro3InitPreMemLib.c index f4833149f3..051dac0b20 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 - 2021, Intel Corporation. All rights reserved.
+Copyright (c) 2019 - 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -167,9 +167,9 @@ SioInit ( } /** - Configues the IC2 Controller on which GPIO Expander Communicates. - This Function is to enable the I2CGPIOExapanderLib to programm the Gpios - Complete intilization will be done in later Stage + Configures the IC2 Controller on which GPIO Expander Communicates. + This Function is to enable the I2CGPIOExapanderLib to program the Gpios + Complete initialization will be done in later Stage **/ VOID @@ -227,10 +227,6 @@ GalagoPro3BoardDebugInit ( VOID ) { - /// - /// Do Early PCH init - /// - EarlySiliconInit (); return EFI_SUCCESS; } @@ -242,4 +238,3 @@ GalagoPro3BoardBootModeDetect ( { return BOOT_WITH_FULL_CONFIGURATION; } - diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc index 1df3cf13a3..5cf2d424ff 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc @@ -152,8 +152,13 @@ ####################################### # Platform Package ####################################### - SecBoardInitLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/SecBoardInitLibNull/SecBoardInitLibNull.inf TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib/SecTestPointCheckLib.inf + SiliconPolicyUpdateLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/SiliconPolicyUpdateLibNull/SiliconPolicyUpdateLibNull.inf + + ####################################### + # Board-specific + ####################################### + SecBoardInitLib|$(PLATFORM_BOARD_PACKAGE)/Library/SecBoardInitLib/SecBoardInitLib.inf [LibraryClasses.common.PEIM] ####################################### diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiKabylakeRvp3InitPreMemLib.c b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardInitLib/PeiKabylakeRvp3InitPreMemLib.c index d34b0be3c7..87ae3b531e 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 - 2021, Intel Corporation. All rights reserved.
+Copyright (c) 2017 - 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -257,9 +257,9 @@ SioInit ( } /** - Configues the IC2 Controller on which GPIO Expander Communicates. - This Function is to enable the I2CGPIOExapanderLib to programm the Gpios - Complete intilization will be done in later Stage + Configures the IC2 Controller on which GPIO Expander Communicates. + This Function is to enable the I2CGPIOExapanderLib to program the Gpios + Complete initialization will be done in later Stage **/ VOID @@ -321,10 +321,6 @@ KabylakeRvp3BoardDebugInit ( VOID ) { - /// - /// Do Early PCH init - /// - EarlySiliconInit (); return EFI_SUCCESS; } @@ -336,4 +332,3 @@ KabylakeRvp3BoardBootModeDetect ( { return BOOT_WITH_FULL_CONFIGURATION; } - diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc index 1f2950be72..26a54b0dc7 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc +++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc @@ -189,8 +189,12 @@ # Platform Package ####################################### TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib/SecTestPointCheckLib.inf - SecBoardInitLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/SecBoardInitLibNull/SecBoardInitLibNull.inf - SiliconPolicyUpdateLib|MinPlatformPkg/PlatformInit/Library/SiliconPolicyUpdateLibNull/SiliconPolicyUpdateLibNull.inf + SiliconPolicyUpdateLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/SiliconPolicyUpdateLibNull/SiliconPolicyUpdateLibNull.inf + + ####################################### + # Board-specific + ####################################### + SecBoardInitLib|$(PLATFORM_BOARD_PACKAGE)/Library/SecBoardInitLib/SecBoardInitLib.inf [LibraryClasses.common.PEIM] ####################################### diff --git a/Platform/Intel/KabylakeOpenBoardPkg/Library/SecBoardInitLib/Ia32/SecBoardInit.nasm b/Platform/Intel/KabylakeOpenBoardPkg/Library/SecBoardInitLib/Ia32/SecBoardInit.nasm new file mode 100644 index 0000000000..c9cfa236ea --- /dev/null +++ b/Platform/Intel/KabylakeOpenBoardPkg/Library/SecBoardInitLib/Ia32/SecBoardInit.nasm @@ -0,0 +1,18 @@ +;; @file +; Kaby Lake board SEC initialization. +; +; Copyright (c) 2022, Intel Corporation. All rights reserved.
+; SPDX-License-Identifier: BSD-2-Clause-Patent +; +;; + +SECTION .text + +global ASM_PFX(BoardBeforeTempRamInit) +ASM_PFX(BoardBeforeTempRamInit): + ; + ; This hook is called before FSP TempRamInit API call + ; ESI, EDI need to be preserved + ; ESP contains return address + ; + jmp esp diff --git a/Platform/Intel/KabylakeOpenBoardPkg/Library/SecBoardInitLib/SecBoardInitLib.c b/Platform/Intel/KabylakeOpenBoardPkg/Library/SecBoardInitLib/SecBoardInitLib.c new file mode 100644 index 0000000000..22712d12db --- /dev/null +++ b/Platform/Intel/KabylakeOpenBoardPkg/Library/SecBoardInitLib/SecBoardInitLib.c @@ -0,0 +1,35 @@ +/** @file + Kaby Lake board SEC initialization. + +Copyright (c) 2022, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include +#include + +EFI_STATUS +EFIAPI +BoardAfterTempRamInit ( + VOID + ) +{ + /// + /// Do Early PCH init + /// + EarlySiliconInit (); + + /// + /// Initialize HDMI DDC GPIOs if HDMI I2C Debug Port is Enabled + /// + if (PcdGetBool (PcdI2cHdmiDebugPortEnable) || + PcdGetBool (PcdI2cHdmiDebugPortSerialTerminalEnable)) { + HdmiDebugGpioInit (); + } + + return EFI_SUCCESS; +} diff --git a/Platform/Intel/KabylakeOpenBoardPkg/Library/SecBoardInitLib/SecBoardInitLib.inf b/Platform/Intel/KabylakeOpenBoardPkg/Library/SecBoardInitLib/SecBoardInitLib.inf new file mode 100644 index 0000000000..192a78865f --- /dev/null +++ b/Platform/Intel/KabylakeOpenBoardPkg/Library/SecBoardInitLib/SecBoardInitLib.inf @@ -0,0 +1,39 @@ +## @file +# Component information file for Kaby Lake SEC Board Init Library +# +# Copyright (c) 2022, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = SecKabyLakeBoardInitLib + FILE_GUID = B9DC6910-67E0-4FCE-A1A4-675115E71455 + MODULE_TYPE = SEC + VERSION_STRING = 1.0 + LIBRARY_CLASS = SecBoardInitLib + +[Sources.IA32] + Ia32/SecBoardInit.nasm + +[Sources] + SecBoardInitLib.c + +[Packages] + MinPlatformPkg/MinPlatformPkg.dec + MdePkg/MdePkg.dec + KabylakeSiliconPkg/SiPkg.dec + KabylakeOpenBoardPkg/OpenBoardPkg.dec + +[LibraryClasses] + BaseLib + SiliconInitLib + HdmiDebugGpioInitLib + +[Guids] + +[Pcd] + gKabylakeOpenBoardPkgTokenSpaceGuid.PcdI2cHdmiDebugPortEnable ## CONSUMES + gKabylakeOpenBoardPkgTokenSpaceGuid.PcdI2cHdmiDebugPortSerialTerminalEnable ## CONSUMES diff --git a/Platform/Intel/KabylakeOpenBoardPkg/OpenBoardPkg.dec b/Platform/Intel/KabylakeOpenBoardPkg/OpenBoardPkg.dec index c89715766b..448eafacbf 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/OpenBoardPkg.dec +++ b/Platform/Intel/KabylakeOpenBoardPkg/OpenBoardPkg.dec @@ -76,6 +76,24 @@ gKabylakeOpenBoardPkgTokenSpaceGuid.PcdFlashNvDebugMessageBase|0x00000000|UINT32 gKabylakeOpenBoardPkgTokenSpaceGuid.PcdFlashNvDebugMessageSize|0x00000000|UINT32|0x90000031 gKabylakeOpenBoardPkgTokenSpaceGuid.PcdFlashNvDebugMessageOffset|0x00000000|UINT32|0x90000032 +## Enable usage the HDMI DDC channel as a debug port - Causes the BIOS debug log +# to be written to the HDMI DDC channel. +# The value is defined as below. +# FALSE: Do NOT use the HDMI DDC channel as a debug port +# TRUE: Use the HDMI DDC channel as a debug port +# @Prompt Enable usage the HDMI DDC channel as a debug port +gKabylakeOpenBoardPkgTokenSpaceGuid.PcdI2cHdmiDebugPortEnable|FALSE|BOOLEAN|0x90000033 + +## Enable usage the HDMI DDC channel as a serial terminal - Enables usage of the +# HDMI DDC channel to display BIOS Setup, UEFI Shell, etc. using a terminal +# emulator. Useful for cases where video is not operating correctly. +# +# The value is defined as below. +# FALSE: Do NOT use the HDMI DDC channel as a debug port +# TRUE: Use the HDMI DDC channel as a debug port +# @Prompt Enable usage the HDMI DDC channel as a debug port +gKabylakeOpenBoardPkgTokenSpaceGuid.PcdI2cHdmiDebugPortSerialTerminalEnable|FALSE|BOOLEAN|0x90000034 + ## Specifies the DDC I2C channel to claim as the HDMI debug port # The value is defined as below. # 2: DDC channel B -- 2.27.0.windows.1