From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web09.6193.1655525157666528425 for ; Fri, 17 Jun 2022 21:05:58 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=GVzzoiEj; spf=pass (domain: intel.com, ip: 192.55.52.88, 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=1655525157; x=1687061157; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kfYimDGAwhWsKSy9gG4wSzp0rQZ6/aBOuWUVVmojrEE=; b=GVzzoiEj4U2iYCteM+XhuXpc0nWNDxJfkN18hlvRNa0bG9xFAmMhS8Wi JiKRyDRCelkyNHTy87OL6Ok5i8/9zByCTSGIVCvSSw2xV3VddvQZtC0T5 rqg/TTrrLpnJcDvZ4s4MG0TuCzozwWSdikT4/UzqZE0hN6Db9/wXLxUNU O5r8xiyZMNCQoseYFjrjZAQVjBcHP5KnuSFxwd6s+q4PnJnwO2HUyNHHn L5dFsv3QqhsgcFxceFnkYn5AdNlsP3+Gj/ERFSJSawewk0BzmltQu6DE2 c5H/I7W9NSwMEbVEkVbOO7HLH1zV5yI2O1Mp/B9B+ejIzW8ZaLQjFQaSU w==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="305057853" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="305057853" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jun 2022 21:05:56 -0700 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="613763929" Received: from nldesimo-desk1.amr.corp.intel.com ([10.7.159.54]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jun 2022 21:05:55 -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 V1 5/5] KabylakeOpenBoardPkg/GalagoPro3: Enable HDMI DDC Debug Port Date: Fri, 17 Jun 2022 21:05:50 -0700 Message-Id: <20220618040550.8467-6-nathaniel.l.desimone@intel.com> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20220618040550.8467-1-nathaniel.l.desimone@intel.com> References: <20220618040550.8467-1-nathaniel.l.desimone@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Enables usage of the HDMI DDC I2C Bus SerialPortLib implementation on the GalagoPro3 board. Cc: Chasel Chiu Cc: Sai Chaganty Cc: Isaac Oram Cc: Benjamin Doron Cc: Michael Kubacki Cc: Jeremy Soller Signed-off-by: Nate DeSimone --- .../GalagoPro3/OpenBoardPkg.dsc | 78 ++++++++++++++++++- .../GalagoPro3/OpenBoardPkg.fdf | 6 +- .../GalagoPro3/OpenBoardPkgPcd.dsc | 30 +++++++ 3 files changed, 111 insertions(+), 3 deletions(-) diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc index 5cf2d424ff..2e3c6d3ca5 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc @@ -142,6 +142,12 @@ PlatformHookLib|$(PROJECT)/Library/BasePlatformHookLib/BasePlatformHookLib.inf SiliconPolicyUpdateLib|$(PROJECT)/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf +[LibraryClasses.common.PEI_CORE] +!if $(TARGET) == DEBUG && gKabylakeOpenBoardPkgTokenSpaceGuid.PcdI2cHdmiDebugPortEnable == TRUE + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf + SerialPortLib|$(PLATFORM_BOARD_PACKAGE)/Library/I2cHdmiDebugSerialPortLib/PeiI2cHdmiDebugSerialPortLib.inf +!endif + [LibraryClasses.IA32.SEC] ####################################### # Edk2 Packages @@ -166,7 +172,6 @@ ####################################### DebugLib|MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf - SetCacheMtrrLib|$(PLATFORM_PACKAGE)/Library/SetCacheMtrrLib/SetCacheMtrrLibNull.inf ####################################### # Silicon Package @@ -183,6 +188,7 @@ !if $(TARGET) == DEBUG TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib/PeiTestPointCheckLib.inf !endif + SetCacheMtrrLib|$(PLATFORM_PACKAGE)/Library/SetCacheMtrrLib/SetCacheMtrrLibNull.inf ####################################### # Board Package @@ -193,7 +199,19 @@ PeiTbtPolicyLib|$(PLATFORM_BOARD_PACKAGE)/Features/Tbt/Library/PeiTbtPolicyLib/PeiTbtPolicyLib.inf !endif +[LibraryClasses.common.DXE_CORE] +!if $(TARGET) == DEBUG + DebugLib|MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf +!endif + [LibraryClasses.common.DXE_DRIVER] + ####################################### + # Edk2 Packages + ####################################### +!if $(TARGET) == DEBUG + DebugLib|MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf +!endif + ####################################### # Silicon Initialization Package ####################################### @@ -225,11 +243,24 @@ SiliconPolicyUpdateLib|$(PROJECT)/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLib.inf [LibraryClasses.X64.DXE_RUNTIME_DRIVER] + ####################################### + # Edk2 Packages + ####################################### +!if $(TARGET) == DEBUG + DebugLib|MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf +!endif + ####################################### # Silicon Initialization Package ####################################### ResetSystemLib|$(PLATFORM_SI_PACKAGE)/Pch/Library/DxeRuntimeResetSystemLib/DxeRuntimeResetSystemLib.inf +[LibraryClasses.common.SMM_CORE] +!if $(TARGET) == DEBUG && gKabylakeOpenBoardPkgTokenSpaceGuid.PcdI2cHdmiDebugPortEnable == TRUE + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf + SerialPortLib|$(PLATFORM_BOARD_PACKAGE)/Library/I2cHdmiDebugSerialPortLib/SmmI2cHdmiDebugSerialPortLib.inf +!endif + [LibraryClasses.X64.DXE_SMM_DRIVER] ####################################### # Silicon Initialization Package @@ -245,6 +276,14 @@ !if $(TARGET) == DEBUG TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib/SmmTestPointCheckLib.inf !endif +# @todo DebugLibReportStatusCode isn't working for SMM drivers for some reason +# temporary W/A is to link the serial port lib into every SMM driver +# I think the only driver that needs this is PiSmmCpuDxeSmm... +# But more testing is needed. +!if $(TARGET) == DEBUG && gKabylakeOpenBoardPkgTokenSpaceGuid.PcdI2cHdmiDebugPortEnable == TRUE + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf + SerialPortLib|$(PLATFORM_BOARD_PACKAGE)/Library/I2cHdmiDebugSerialPortLib/SmmI2cHdmiDebugSerialPortLib.inf +!endif ####################################### # PEI Components @@ -258,11 +297,17 @@ UefiCpuPkg/SecCore/SecCore.inf { PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf +!if $(TARGET) == DEBUG && gKabylakeOpenBoardPkgTokenSpaceGuid.PcdI2cHdmiDebugPortEnable == TRUE + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf +!endif } MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf { DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf +!if $(TARGET) == DEBUG && gKabylakeOpenBoardPkgTokenSpaceGuid.PcdI2cHdmiDebugPortEnable == TRUE + SerialPortLib|$(PLATFORM_BOARD_PACKAGE)/Library/I2cHdmiDebugSerialPortLib/PeiI2cHdmiDebugSerialPortLib.inf +!endif } IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf { @@ -333,6 +378,13 @@ ####################################### # Edk2 Packages ####################################### + MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf { + + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf +!if $(TARGET) == DEBUG && gKabylakeOpenBoardPkgTokenSpaceGuid.PcdI2cHdmiDebugPortEnable == TRUE + SerialPortLib|$(PLATFORM_BOARD_PACKAGE)/Library/I2cHdmiDebugSerialPortLib/DxeI2cHdmiDebugSerialPortLib.inf +!endif + } IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf @@ -341,9 +393,12 @@ MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.inf MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf - MdeModulePkg/Universal/BdsDxe/BdsDxe.inf{ + MdeModulePkg/Universal/BdsDxe/BdsDxe.inf { NULL|BoardModulePkg/Library/BdsPs2KbcLib/BdsPs2KbcLib.inf +!if gKabylakeOpenBoardPkgTokenSpaceGuid.PcdI2cHdmiDebugPortSerialTerminalEnable == TRUE + NULL|BoardModulePkg/Library/BdsSerialPortTerminalLib/BdsSerialPortTerminalLib.inf +!endif } UefiCpuPkg/CpuDxe/CpuDxe.inf @@ -373,9 +428,20 @@ !if $(TARGET) == DEBUG DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf + !if gKabylakeOpenBoardPkgTokenSpaceGuid.PcdI2cHdmiDebugPortEnable == TRUE + SerialPortLib|$(PLATFORM_BOARD_PACKAGE)/Library/I2cHdmiDebugSerialPortLib/SmmI2cHdmiDebugSerialPortLib.inf + !endif !endif } !endif +!if gKabylakeOpenBoardPkgTokenSpaceGuid.PcdI2cHdmiDebugPortSerialTerminalEnable == TRUE + MdeModulePkg/Universal/SerialDxe/SerialDxe.inf { + + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf + SerialPortLib|$(PLATFORM_BOARD_PACKAGE)/Library/I2cHdmiDebugSerialPortLib/DxeI2cHdmiDebugSerialPortLib.inf + } + MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf +!endif ####################################### # Silicon Initialization Package @@ -422,6 +488,14 @@ NULL|$(PROJECT)/Library/BoardAcpiLib/DxeMultiBoardAcpiSupportLib.inf !endif } + MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.inf { + + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf +# @todo This is causing crashes still... more debug needed. +#!if $(TARGET) == DEBUG && gKabylakeOpenBoardPkgTokenSpaceGuid.PcdI2cHdmiDebugPortEnable == TRUE +# SerialPortLib|$(PLATFORM_BOARD_PACKAGE)/Library/I2cHdmiDebugSerialPortLib/SmmI2cHdmiDebugSerialPortLib.inf +#!endif + } !endif diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf index 239b6b720a..6468962730 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf @@ -1,7 +1,7 @@ ## @file # System 76 GalagoPro3 board flash file. # -# 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 # @@ -347,6 +347,10 @@ INF $(PLATFORM_PACKAGE)/PlatformInit/PlatformInitDxe/PlatformInitDxe.inf INF IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf INF $(PLATFORM_PACKAGE)/Test/TestPointStubDxe/TestPointStubDxe.inf +!if gKabylakeOpenBoardPkgTokenSpaceGuid.PcdI2cHdmiDebugPortSerialTerminalEnable == TRUE + INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf + INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf +!endif [FV.FvUefiBoot] BlockSize = $(FLASH_BLOCK_SIZE) diff --git a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc index c05535aab7..4a37d6157b 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc @@ -361,6 +361,36 @@ gBoardModulePkgTokenSpaceGuid.PcdSuperIoPciIsaBridgeDevice|{0x00, 0x00, 0x1F, 0x00} gKabylakeOpenBoardPkgTokenSpaceGuid.PcdGttMmAddress|0xDF000000 + ## 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 + + ## 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 + + ## Indicates the type of terminal to use. + # If PcdI2cHdmiDebugPortSerialTerminalEnable is TRUE, this PCD will be used + # to determine which terminal protocol to use. + # 0 - PCANSI + # 1 - VT100 + # 2 - VT100+ + # 3 - UTF8 + # 4 - TTYTERM + # @Prompt Default Terminal Type. + # @ValidRange 0x80000001 | 0 - 4 + gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|3 + ## 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