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.6192.1655525155936388213 for ; Fri, 17 Jun 2022 21:05:56 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=DopNzAzL; 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=1655525155; x=1687061155; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=GXNMKwfWKtCZ78j3EwbBQs3psu0NPqeQNcWKUfCfG+k=; b=DopNzAzLcI6HWR9E9//jE0RJ4FnWcVxeQicneQTTn76xNwZyLmqdd9ov oOm5V5YNjZUPMDnZX9UfK40WqtNVceGWZ3Ou3s/OryFS2+7+d/39mSqI3 rPhT9FRVC5UTmzJDOAQX/GIoVDE0q6V0xibsGh5lDXnLlDZ9i4B8IDXED o8DCaTfw0ARwDILUquhKMwWDbtetgC+KTyyyjbaqQgfzVfoHlb3bL2BJU DoUbVFqzSmZ5bUwgBysIwxI8NHT1wQRXAGGgIojMVN3KDtAvOCS6lWtl8 hfm2b1qK+glHgkySVenuQAl0xGplWmT568DKLb0e0ErmBb1PVoWfjb1JP Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="305057847" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="305057847" 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:55 -0700 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="613763913" 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 , Eric Dong , Liming Gao , Benjamin Doron , Michael Kubacki , Jeremy Soller Subject: [edk2-platforms] [PATCH V1 0/5] KabylakeOpenBoardPkg: HDMI DDC I2C Bus Debugging Date: Fri, 17 Jun 2022 21:05:45 -0700 Message-Id: <20220618040550.8467-1-nathaniel.l.desimone@intel.com> X-Mailer: git-send-email 2.27.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Normally the HDMI DDC I2C bus is used to read the EDID data from the monitor. An unintended but useful property of this interface is that is does not require DMA to perform I/O. This means that this interface can be used to perform I/O before DRAM is initialized. HDMI video output is a common feature of many laptops. This makes the HDMI DDC bus the only I/O interface that is often exposed outside of the laptop chassis while simultaneously capable of being used in Pre-Memory. Oddly... this makes it an ideal and novel way to perform closed chassis debug. This patch series adds a implementation of using the HDMI DDC I2C Bus as a "poor man's" UART. This is accomplished using the GMBUS that is part of the Intel HD Graphics device. Accordingly, this implementation will only work on systems with the HDMI port routed to the Intel graphics device, and will not work on systems with HDMI routed to a discrete GPU. In order to use this implementation, one will also need a BusPirate programmed with Nate's Custom Bus Pirate FW for I2C Serial Debug. This firmware is available from: https://github.com/nate-desimone/Bus_Pirate This firmware interfaces with the I2C Bus and forwards traffic from it to the FTDI USB Serial Adapter that is integrated with the BusPirate. In combination, this results in the HDMI port appearing to function as a regular UART to the user. If you would like to see this in action, I made a short YouTube video: https://www.youtube.com/watch?v=xe7cFhRsr80 Cc: Chasel Chiu Cc: Sai Chaganty Cc: Isaac Oram Cc: Eric Dong Cc: Liming Gao Cc: Benjamin Doron Cc: Michael Kubacki Cc: Jeremy Soller Signed-off-by: Nate DeSimone Nate DeSimone (5): KabylakeOpenBoardPkg: Add I2cHdmiDebugSerialPortLib KabylakeOpenBoardPkg: Add HdmiDebugGpioInitLib KabylakeOpenBoardPkg: Add SecBoardInitLib BoardModulePkg: Add BdsSerialPortTerminalLib KabylakeOpenBoardPkg/GalagoPro3: Enable HDMI DDC Debug Port .../Intel/BoardModulePkg/BoardModulePkg.dsc | 3 +- .../BdsSerialPortTerminalLib.c | 114 +++ .../BdsSerialPortTerminalLib.h | 53 ++ .../BdsSerialPortTerminalLib.inf | 49 ++ .../PeiAspireVn7Dash572GInitPreMemLib.c | 3 +- .../AspireVn7Dash572G/OpenBoardPkg.dsc | 11 +- .../AspireVn7Dash572G/OpenBoardPkgPcd.dsc | 9 + .../BoardInitLib/PeiGalagoPro3InitPreMemLib.c | 13 +- .../GalagoPro3/OpenBoardPkg.dsc | 88 +- .../GalagoPro3/OpenBoardPkg.fdf | 6 +- .../GalagoPro3/OpenBoardPkgPcd.dsc | 39 + .../Include/Library/HdmiDebugGpioInitLib.h | 26 + .../PeiKabylakeRvp3InitPreMemLib.c | 13 +- .../KabylakeRvp3/OpenBoardPkg.dsc | 11 +- .../KabylakeRvp3/OpenBoardPkgPcd.dsc | 9 + .../HdmiDebugGpioInitLib.c | 221 +++++ .../HdmiDebugGpioInitLib.inf | 42 + .../DxeI2cHdmiDebugSerialPortLib.inf | 51 ++ .../DxeSmmI2cHdmiDebugSerialPortLib.c | 161 ++++ .../Library/I2cHdmiDebugSerialPortLib/Gmbus.c | 826 ++++++++++++++++++ .../Library/I2cHdmiDebugSerialPortLib/Gmbus.h | 324 +++++++ .../I2cDebugPortProtocol.c | 194 ++++ .../I2cDebugPortProtocol.h | 77 ++ .../I2cDebugPortTplDxe.c | 44 + .../I2cDebugPortTplNull.c | 36 + .../I2cHdmiDebugSerialPortLib.c | 201 +++++ .../I2cHdmiDebugSerialPortLib/IgfxI2c.c | 112 +++ .../I2cHdmiDebugSerialPortLib/IgfxI2c.h | 146 ++++ .../PeiI2cHdmiDebugSerialPortLib.c | 237 +++++ .../PeiI2cHdmiDebugSerialPortLib.inf | 52 ++ .../SecI2cHdmiDebugSerialPortLib.c | 134 +++ .../SecI2cHdmiDebugSerialPortLib.inf | 51 ++ .../SmmI2cHdmiDebugSerialPortLib.inf | 51 ++ .../SecBoardInitLib/Ia32/SecBoardInit.nasm | 18 + .../Library/SecBoardInitLib/SecBoardInitLib.c | 35 + .../SecBoardInitLib/SecBoardInitLib.inf | 39 + .../KabylakeOpenBoardPkg/OpenBoardPkg.dec | 33 +- 37 files changed, 3498 insertions(+), 34 deletions(-) create mode 100644 Platform/Intel/BoardModulePkg/Library/BdsSerialPortTerminalLib/BdsSerialPortTerminalLib.c create mode 100644 Platform/Intel/BoardModulePkg/Library/BdsSerialPortTerminalLib/BdsSerialPortTerminalLib.h create mode 100644 Platform/Intel/BoardModulePkg/Library/BdsSerialPortTerminalLib/BdsSerialPortTerminalLib.inf create mode 100644 Platform/Intel/KabylakeOpenBoardPkg/Include/Library/HdmiDebugGpioInitLib.h create mode 100644 Platform/Intel/KabylakeOpenBoardPkg/Library/HdmiDebugGpioInitLib/HdmiDebugGpioInitLib.c create mode 100644 Platform/Intel/KabylakeOpenBoardPkg/Library/HdmiDebugGpioInitLib/HdmiDebugGpioInitLib.inf create mode 100644 Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPortLib/DxeI2cHdmiDebugSerialPortLib.inf create mode 100644 Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPortLib/DxeSmmI2cHdmiDebugSerialPortLib.c create mode 100644 Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPortLib/Gmbus.c create mode 100644 Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPortLib/Gmbus.h create mode 100644 Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPortLib/I2cDebugPortProtocol.c create mode 100644 Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPortLib/I2cDebugPortProtocol.h create mode 100644 Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPortLib/I2cDebugPortTplDxe.c create mode 100644 Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPortLib/I2cDebugPortTplNull.c create mode 100644 Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPortLib/I2cHdmiDebugSerialPortLib.c create mode 100644 Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPortLib/IgfxI2c.c create mode 100644 Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPortLib/IgfxI2c.h create mode 100644 Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPortLib/PeiI2cHdmiDebugSerialPortLib.c create mode 100644 Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPortLib/PeiI2cHdmiDebugSerialPortLib.inf create mode 100644 Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPortLib/SecI2cHdmiDebugSerialPortLib.c create mode 100644 Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPortLib/SecI2cHdmiDebugSerialPortLib.inf create mode 100644 Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPortLib/SmmI2cHdmiDebugSerialPortLib.inf 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 -- 2.27.0.windows.1