From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.4117.1674002878721467125 for ; Tue, 17 Jan 2023 16:47:58 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=JYzU/l5A; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: isaac.w.oram@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674002878; x=1705538878; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=o/tOirUi+93m41sSgHSo6CCth+anyFgaq74F1xIpJV8=; b=JYzU/l5AxOqy7LQmp8OEyIhgd/rSBPpmQEFiACe14W4OR4OH/EOZ5Mir D9vF8mlTlp00B+leV06pCgWa4Bj0rmq2azPPS+VNNsfNuqloHi2+Q26uC YPMf1HtXktoWJ164qT4vKto96+brasSUJD3Br4kcMRM8YOIdPHMWc20PX TIHgogbaE+PeNeLor26yEnplyDV2f46pA4TiCsZwzXnHmSny4GP3Bu82G J3uuJtIxFmVjubkCy/eBFcJIF9N1rE5Yo99mpl6xemQJ1hhyD/aTZ8Lxf Dv1k+Ifqbhbw4KwkJAqknq9HOAH4SEIutFsfShSKOboacuhD67vCGSwHo Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10593"; a="312736469" X-IronPort-AV: E=Sophos;i="5.97,224,1669104000"; d="scan'208";a="312736469" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2023 16:47:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10593"; a="727964999" X-IronPort-AV: E=Sophos;i="5.97,224,1669104000"; d="scan'208";a="727964999" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga004.fm.intel.com with ESMTP; 17 Jan 2023 16:47:57 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 17 Jan 2023 16:47:57 -0800 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 17 Jan 2023 16:47:56 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Tue, 17 Jan 2023 16:47:56 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.100) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Tue, 17 Jan 2023 16:47:56 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QjBvalrJXFdK9OTuWEIpEqXlaxPH7ibqXqhEeRQEFzQEEWd6A4xc4AGyTcZoCShe/HjbzGnK+4uLaUabIM8AyF2QOsj/K/FuqUyQEuGPSdbtUqoRwRc39R3TKow2bgU6gUGHhZvhM+xnF1Mew91T3j6ITbhJ4WlMKCuTuNb/TMbHPrdegahbgA/ADXEAeWhQqtUGKTui6A8AKMsU1xdmL9Hr0NKR76m+VAZx8/RjDhj/3njbooRt9PDDyyL+J8Jc7Os/z97Q/E4pI5vi4tQdXU7y20ydm5KTGhpTEI0MhLddS5scRCf8+smbhVjmObXMCtxAQ4Go0BxhhoePOahznw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bW3K18+0lRX9fbQZ7sZOopS/ztNhsFP8eipqsVs5oyY=; b=izS2fLg8cBUCTwsrKPHWu5Ia8lks1o9b2KsDmEjzamJ/dmZqUiWE5JTjwkiBnlsjvo16TXVozjPbbFOQyQ5czvYKGqCUb6w2FRvAfAy/MXIP4DZRCHBElpFW6JdU0B9aqncaiLBfZY14wpI9aGbHmo3lD37uIShx/X3pYG7Q/JhRM9s7q+Rp8FFB9rm+ZFYR2VrNTahsX3zoZhiPHEbSYXhbl9rewENHJDeTymK1Vd0bdFs+CucNFkpyr+d5RKAj2+cF4SDZyVwlgOPRbrNxo7cemBZlYnaNag2llCHH1DK/XzwdKydS5c+IsdMPWXx5Oet49jOZsLJiGQvTfS6HOg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from SA1PR11MB5801.namprd11.prod.outlook.com (2603:10b6:806:23d::13) by LV2PR11MB6000.namprd11.prod.outlook.com (2603:10b6:408:17c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.23; Wed, 18 Jan 2023 00:47:53 +0000 Received: from SA1PR11MB5801.namprd11.prod.outlook.com ([fe80::7623:38f5:ab31:61a5]) by SA1PR11MB5801.namprd11.prod.outlook.com ([fe80::7623:38f5:ab31:61a5%5]) with mapi id 15.20.5986.019; Wed, 18 Jan 2023 00:47:53 +0000 From: "Isaac Oram" To: "Desimone, Nathaniel L" , Benjamin Doron , "devel@edk2.groups.io" CC: "Chaganty, Rangasai V" , "Chiu, Chasel" Subject: Re: [edk2-devel][edk2-platforms][PATCH v2] KabylakeOpenBoardPkg/I2cHdmiDebugSerialPortLib: Configurable timings Thread-Topic: [edk2-devel][edk2-platforms][PATCH v2] KabylakeOpenBoardPkg/I2cHdmiDebugSerialPortLib: Configurable timings Thread-Index: AQHZJ3hrzqmKADPy20aZpcjYnwkXoq6jXTMAgAAAzjA= Date: Wed, 18 Jan 2023 00:47:53 +0000 Message-ID: References: <7e10276730e9a60e39dc5f4be06a49c2a11e56a5.1673632431.git.benjamin.doron00@gmail.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SA1PR11MB5801:EE_|LV2PR11MB6000:EE_ x-ms-office365-filtering-correlation-id: ce7899e7-82ff-418c-f587-08daf8eda1f4 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 9PdbUwBRKx/2ysBxqNa8L0pFEFvs/KfZ2NmhmdPvx93nHrhGUGzDCD6pVjUOS7OZqh9NCAsA9SpR55pGwqdkfGR6cvULkB960yORaeq4HrY9A4Hfrk17myCtUnts6OI5gLPpQFMWgI82oAcbMCJpRex76ixS1M61FbmousXCPGiLT2vmIAOJ690JUZ0uI0/IhL0X9spZB/PolaB7Tb+KntvjCKM7tzBUfDpufuJmqoZn2PkloXsJ1xhm2K+jjCyxWwm5x8FiIuDueH7jWkJjOunlBL3TJT/+CWGeduuL9854BOmjwBatY+w/ob149EJsYJyKub49JzHhh6ZNNbtUXda+95gbYbT6Yrvu4On3B2CATdKRmKMHL/+I/AyYSregbAJMhTTEbBg+/pNGMsSZ+W6OHE+vAsRmydllbnh9+rZK/ouTLjEPZayyfI5en/x+XSvvDolNiS9xnb53DZdh6Ax4f72FTbUTPA6j70v9YXT+Z4x7cDb9Aqbb7KyTmfPw39dQA+EWbw62y+zpRyfekYCtrtuqjjT0xLlOAdCjwfbN6bfSihQxwzeZ+1M3XYpgZzPRehz/AllOAHCrAYZeF4Hqeg5XRisxt4SVxFBsv02mQbpwO0u0A04qeMC3Ud9R59lrs1APC0d3Pm/Xu5V/Da7MRILQ111Z6Nr9RpqzEaYGOJ9gh76ZM0rDE39lBDopEWZOHfiDxrYkU65ZkTzT67BsYbpdt9qW++In3EwoTxWRNypCvqRXaCn39ozOGBfA x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1PR11MB5801.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(39860400002)(366004)(376002)(396003)(346002)(136003)(451199015)(19627235002)(38100700002)(82960400001)(33656002)(55016003)(38070700005)(86362001)(966005)(66556008)(66446008)(66946007)(186003)(4326008)(8676002)(64756008)(66476007)(9686003)(26005)(76116006)(110136005)(478600001)(71200400001)(54906003)(7696005)(53546011)(122000001)(316002)(52536014)(8936002)(5660300002)(6506007)(41300700001)(83380400001)(107886003)(2906002)(30864003)(213903007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?sOyK88fOlFAdTZB6r6gpXqN01dra21odqd207xjR3fSYKoaAczxFkyKAMuw/?= =?us-ascii?Q?5ijxhijgtL45dpQ6oXjdpD4a7MC0xs7Mr6ikeCrD5mkriyXG0mqe4wiBukUK?= =?us-ascii?Q?OgbwV7DnBVPDk6zUsLJHKydLajeGPqaGA/rTiXSAbo01o7F3zFK5ngOxfJSo?= =?us-ascii?Q?DS/PPOUpNEdXQ6uH0RWh70CEvzPCxaSfbpp6RR0GsV1WI0aQRxct9PUZTWuQ?= =?us-ascii?Q?90++MCkNiGjBaCh1SUIfH0uKylZE+/BKjObbG7g9Mihaf/siFigqnjtq5tBj?= =?us-ascii?Q?faUn+P+HjdmX4PtOvPDdp4Z+Eha8La7IbHcMmMQtOBq0UZoLaII4jbnOSidp?= =?us-ascii?Q?ofHICasnD0hPvjr7K3Ner21Pxb+yWZ/6X2thOIaX3salKVliigwL2oENbMnv?= =?us-ascii?Q?Of6KjJopaLcKdXVczAAxNubodkFovgUFFLeQ4IKMlPuhp87NVvdMz1a1+0TX?= =?us-ascii?Q?Z7mYk6tu8opNyLGjo02MDWeAHzo2l/eBh4rlGpsbyNXLQ5+VB4GfqvNYoAud?= =?us-ascii?Q?9S9pbyroeV0JmrfN7CJ2Jn6+uSzUeuIn6TkUs7ru6qp29r7sdDPANvAcwL69?= =?us-ascii?Q?jMheIa6i1+YwbRlugMGqZJfIaWUkVocEaDNF77TKA8k3SmhzG/dxfHZIxRJz?= =?us-ascii?Q?UxOU52d1zL2hi/E4pNwamvaqvMfa76CipBSnyM/4/Z6+207sMWYV0sqDF7kY?= =?us-ascii?Q?nAoGbXRrPoipVVvGp2QxnTZ48iWrHeyVswkDFjTcdOZivveomfsN/PUHq91Q?= =?us-ascii?Q?RbBubx965C8MFLMclIw48ntcfJa4V4/d+CI2tt06vgkXx4arW8ftIscWhTmY?= =?us-ascii?Q?Q4SnXZ3FcwfsQ80Bb5KvnVxnd0XwBJRWKD9WIE1M/4tcE4xCWX/k8xGz4Aw2?= =?us-ascii?Q?Qw9T0KYZr39BbtM45HA6Xh45oPRL6T3V+bPXcio3zSHDZIox851SZpvD0kxS?= =?us-ascii?Q?My7zPNJydwsmLcABbIXVUd2UrNrXLUUf3fndxZIbfjL10ZrtWvQsML9uK7pi?= =?us-ascii?Q?07icBk0jrWoNlGIAFFT118/HKVTGBuN0xj0g1hHLFDijDMQb45avVMBWO0qm?= =?us-ascii?Q?b98z8TTIUXLod2TWixv7OtVdst93f+WEsv9HW7rNoF6NEbjPwSYJSVTrkAWk?= =?us-ascii?Q?1tAup4mZ/H90ZcTi65By3orhH/IbeknHVfhrlQc78UujGiXEkSoR80baFsZN?= =?us-ascii?Q?4ExCmE1MwhQS9cpSopt9+O1UJMnf0U1UfXk3esWgdRvv7e8GES95nhUFxeVb?= =?us-ascii?Q?wBwz95A7h742FA9ikI07tgWOiTx2KaQZBEP0NaWWvVUiLXH3FFfanC5FgXmB?= =?us-ascii?Q?bLwGbLT34gqzAJeooK+aUuFwgaeof1BiPl8wO60pdDYgE21TomB/gEnU7GZ2?= =?us-ascii?Q?7T7J7cfMwyGnzp5fi23OM91FHX4CsDZNR/qem6iBHPA4xTboy51dw3z9dzCA?= =?us-ascii?Q?fIr6d4igA/FmU2wxm6cXg3acB1obJHEh/sM/cUYkpYHkzEfr2z7ZgNbfBEGI?= =?us-ascii?Q?8WSELc1CtQTVe67A/79ny4kDj5zNR/psrLTayHty2SpD8aYOL6ZKEAX6/wuN?= =?us-ascii?Q?uRCSWA5TBmljWheoAAkDd335/QQPhMGagUWviVkY?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA1PR11MB5801.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ce7899e7-82ff-418c-f587-08daf8eda1f4 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Jan 2023 00:47:53.4313 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ek7qBUSQ6/U1QB3/6v3wjFgvlmkKT/cvITo+W7Mm7g7nMuUo8cQ+v9LLmJLa+YWA40IdDQah15ZXg2py1lnmGA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR11MB6000 Return-Path: isaac.w.oram@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Pushed as 8e927b0f42..e43a63746f -----Original Message----- From: Desimone, Nathaniel L =20 Sent: Tuesday, January 17, 2023 4:45 PM To: Benjamin Doron ; devel@edk2.groups.io Cc: Chaganty, Rangasai V ; Oram, Isaac W ; Chiu, Chasel Subject: RE: [edk2-devel][edk2-platforms][PATCH v2] KabylakeOpenBoardPkg/I2= cHdmiDebugSerialPortLib: Configurable timings Reviewed-by: Nate DeSimone -----Original Message----- From: Benjamin Doron =20 Sent: Friday, January 13, 2023 9:56 AM To: devel@edk2.groups.io Cc: Chaganty, Rangasai V ; Oram, Isaac W ; Desimone, Nathaniel L ; Chiu, Chasel Subject: [edk2-devel][edk2-platforms][PATCH v2] KabylakeOpenBoardPkg/I2cHdm= iDebugSerialPortLib: Configurable timings Now that an implementation of the HDMI debug port is available at high spee= d, make the timing parameters configurable. As this is implementation, not = board dependent, perhaps these could become dynamic PCDs. Arduino sketch available at https://github.com/benjamindoron/i2c_debug_port. Tested on Adafruit ItsyBitsy M4, using 1 MHz clock and 60 us delay. Cc: Sai Chaganty Cc: Isaac Oram Cc: Nate DeSimone Cc: Chasel Chiu Signed-off-by: Benjamin Doron --- .../DxeI2cHdmiDebugSerialPortLib.inf | 2 ++ .../Library/I2cHdmiDebugSerialPortLib/Gmbus.c | 9 +++++++-- .../I2cDebugPortProtocol.c | 12 +++++++++--- .../PeiI2cHdmiDebugSerialPortLib.inf | 2 ++ .../SecI2cHdmiDebugSerialPortLib.inf | 2 ++ .../SmmI2cHdmiDebugSerialPortLib.inf | 2 ++ .../KabylakeOpenBoardPkg/OpenBoardPkg.dec | 19 +++++++++++++++++++ 7 files changed, 43 insertions(+), 5 deletions(-) diff --git a/Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerial= PortLib/DxeI2cHdmiDebugSerialPortLib.inf b/Platform/Intel/KabylakeOpenBoard= Pkg/Library/I2cHdmiDebugSerialPortLib/DxeI2cHdmiDebugSerialPortLib.inf index 736b11a561f0..e8af25161008 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPortLib= /DxeI2cHdmiDebugSerialPortLib.inf +++ b/Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPort +++ Lib/DxeI2cHdmiDebugSerialPortLib.inf @@ -51,3 +51,5 @@ [Pcd] gKabylakeOpenBoardPkgTokenSpaceGuid.PcdI2cHdmiDebugPortDdcI2cChann= el ## CONSUMES gKabylakeOpenBoardPkgTokenSpaceGuid.PcdGttMmAddress = ## CONSUMES+ gKabylakeOpenBoardPkgTokenSpaceGuid.PcdI2cHd= miDebugPortGmbusClockRate ## CONSUMES+ gKabylakeOpenBoardPkgTokenSpaceGu= id.PcdI2cHdmiDebugPortPacketStallUs ## CONSUMESdiff --git a/Platform/Int= el/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPortLib/Gmbus.c b/Platfor= m/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPortLib/Gmbus.c index c6453117843a..31965a1b3a54 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPortLib= /Gmbus.c +++ b/Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPort +++ Lib/Gmbus.c @@ -443,6 +443,7 @@ GmbusRead ( { EFI_STATUS Status; EFI_STATUS Status2;+ U= INT8 GmbusClockRate; UINT32 Index; U= INT32 GmbusCmdSts; UINT32 GmbusStatus;@= @ -472,7 +473,8 @@ GmbusRead ( // // Configure Gmbus port and clock speed //- Status =3D GmbusPrep= are (GMBUS_CLOCK_RATE_50K, (DdcBusPinPair & B_SA_GTTMMADR_GMBUS0_PIN_PAIR_M= ASK));+ GmbusClockRate =3D FixedPcdGet8 (PcdI2cHdmiDebugPortGmbusClockRate= );+ Status =3D GmbusPrepare (GmbusClockRate, (DdcBusPinPair & B_SA_GTTMMAD= R_GMBUS0_PIN_PAIR_MASK)); if (EFI_ERROR (Status)) { goto Done; }@@ = -607,6 +609,7 @@ GmbusWrite ( { EFI_STATUS Status; EFI_STATUS Status2;+ U= INT8 GmbusClockRate; UINT32 Index; U= INT32 GmbusCmdSts; UINT32 GmbusStatus;@= @ -637,7 +640,9 @@ GmbusWrite ( // // Configure Gmbus port and clock speed- Status =3D GmbusPrepare = (GMBUS_CLOCK_RATE_50K, (DdcBusPinPair & B_SA_GTTMMADR_GMBUS0_PIN_PAIR_MASK)= );+ //+ GmbusClockRate =3D FixedPcdGet8 (PcdI2cHdmiDebugPortGmbusClockRat= e);+ Status =3D GmbusPrepare (GmbusClockRate, (DdcBusPinPair & B_SA_GTTMMA= DR_GMBUS0_PIN_PAIR_MASK)); if (EFI_ERROR (Status)) { goto Done; }di= ff --git a/Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPo= rtLib/I2cDebugPortProtocol.c b/Platform/Intel/KabylakeOpenBoardPkg/Library/= I2cHdmiDebugSerialPortLib/I2cDebugPortProtocol.c index f76bcf364cd1..d64251b75b4e 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPortLib= /I2cDebugPortProtocol.c +++ b/Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPort +++ Lib/I2cDebugPortProtocol.c @@ -38,6 +38,7 @@ I2cDebugPortWrite ( UINT8 WriteBuffer[I2C_DEBUG_PORT_MAX_DATA_SIZE + 1]; EFI_STATUS = Status; UINT32 Index;+ UINT32 ImplementationDelayUs; UINT8 = CurrentSize; UINT8 DdcBusPinPair; @@ -51,9 +52,10 @@ I2cDebug= PortWrite ( if (EFI_ERROR (Status)) { return Status; }+ ImplementationDelayUs= =3D FixedPcdGet32 (PcdI2cHdmiDebugPortPacketStallUs); //BP: 3ms stall to = catch up RaiseTplForI2cDebugPortAccess (); for (Index =3D 0; Index < Co= unt; Index +=3D I2C_DEBUG_PORT_MAX_DATA_SIZE) {- MicroSecondDelay (3000)= ; //3ms stall to let the BusPirate catch up+ MicroSecondDelay (Implemen= tationDelayUs); if ((Index + I2C_DEBUG_PORT_MAX_DATA_SIZE) >=3D Count) = { CurrentSize =3D (UINT8) (Count - Index); } else {@@ -95,6 +97,7= @@ I2cDebugPortRead ( EFI_STATUS Status; UINT32 Index; UINT32 BytesRead;+ UINT= 32 ImplementationDelayUs; UINT32 CurrentSize; UINT8 Ddc= BusPinPair; UINT8 GmbusIndexData;@@ -110,9 +113,10 @@ I2cDebugPortR= ead ( if (EFI_ERROR (Status)) { return Status; }+ ImplementationDelayUs= =3D FixedPcdGet32 (PcdI2cHdmiDebugPortPacketStallUs); //BP: 3ms stall to = catch up RaiseTplForI2cDebugPortAccess (); for (Index =3D 0; Index < (*= Count); Index +=3D I2C_DEBUG_PORT_MAX_DATA_SIZE) {- MicroSecondDelay (30= 00); //3ms stall to let the BusPirate catch up+ MicroSecondDelay (Imple= mentationDelayUs); if ((Index + I2C_DEBUG_PORT_MAX_DATA_SIZE) >=3D (*Co= unt)) { CurrentSize =3D (*Count) - Index; } else {@@ -163,6 +167,= 7 @@ I2cDebugPortReadyToRead ( EFI_STATUS Status; UINT32 BytesRead; UINT8 DdcBusPinPair= ;+ UINT32 ImplementationDelayUs; UINT8 GmbusIndexData; Byt= esRead =3D 1;@@ -173,7 +178,8 @@ I2cDebugPortReadyToRead ( if (EFI_ERROR (Status)) { return Status; }- MicroSecondDelay (300= 0); //3ms stall to let the BusPirate catch up+ ImplementationDelayUs =3D = FixedPcdGet32 (PcdI2cHdmiDebugPortPacketStallUs); //BP: 3ms stall to catch= up+ MicroSecondDelay (ImplementationDelayUs); GmbusIndexData =3D (I2C_= DEBUG_PORT_READY_TO_READ_COMMAND << I2C_DEBUG_PORT_COMMAND_BIT_POSITION) | = (1 & I2C_DEBUG_PORT_DATA_SIZE_BIT_MASK); //READY_TO_REA= D always returns 1 byte RaiseTplForI2cDebugPortAccess ();diff --git a/Pla= tform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPortLib/PeiI2cHd= miDebugSerialPortLib.inf b/Platform/Intel/KabylakeOpenBoardPkg/Library/I2cH= dmiDebugSerialPortLib/PeiI2cHdmiDebugSerialPortLib.inf index c82e0c9e9b76..c141521a0cd9 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPortLib= /PeiI2cHdmiDebugSerialPortLib.inf +++ b/Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPort +++ Lib/PeiI2cHdmiDebugSerialPortLib.inf @@ -52,3 +52,5 @@ [Pcd] gKabylakeOpenBoardPkgTokenSpaceGuid.PcdI2cHdmiDebugPortDdcI2cChann= el ## CONSUMES gKabylakeOpenBoardPkgTokenSpaceGuid.PcdGttMmAddress = ## CONSUMES+ gKabylakeOpenBoardPkgTokenSpaceGuid.PcdI2cHd= miDebugPortGmbusClockRate ## CONSUMES+ gKabylakeOpenBoardPkgTokenSpaceGu= id.PcdI2cHdmiDebugPortPacketStallUs ## CONSUMESdiff --git a/Platform/Int= el/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPortLib/SecI2cHdmiDebugSe= rialPortLib.inf b/Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugS= erialPortLib/SecI2cHdmiDebugSerialPortLib.inf index 3b84b25c3148..ed755699c312 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPortLib= /SecI2cHdmiDebugSerialPortLib.inf +++ b/Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPort +++ Lib/SecI2cHdmiDebugSerialPortLib.inf @@ -51,3 +51,5 @@ [Pcd] gKabylakeOpenBoardPkgTokenSpaceGuid.PcdI2cHdmiDebugPortDdcI2cChann= el ## CONSUMES gKabylakeOpenBoardPkgTokenSpaceGuid.PcdGttMmAddress = ## CONSUMES+ gKabylakeOpenBoardPkgTokenSpaceGuid.PcdI2cHd= miDebugPortGmbusClockRate ## CONSUMES+ gKabylakeOpenBoardPkgTokenSpaceGu= id.PcdI2cHdmiDebugPortPacketStallUs ## CONSUMESdiff --git a/Platform/Int= el/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPortLib/SmmI2cHdmiDebugSe= rialPortLib.inf b/Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugS= erialPortLib/SmmI2cHdmiDebugSerialPortLib.inf index 68ff31495071..9f46d45b8a38 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPortLib= /SmmI2cHdmiDebugSerialPortLib.inf +++ b/Platform/Intel/KabylakeOpenBoardPkg/Library/I2cHdmiDebugSerialPort +++ Lib/SmmI2cHdmiDebugSerialPortLib.inf @@ -51,3 +51,5 @@ [Pcd] gKabylakeOpenBoardPkgTokenSpaceGuid.PcdI2cHdmiDebugPortDdcI2cChann= el ## CONSUMES gKabylakeOpenBoardPkgTokenSpaceGuid.PcdGttMmAddress = ## CONSUMES+ gKabylakeOpenBoardPkgTokenSpaceGuid.PcdI2cHd= miDebugPortGmbusClockRate ## CONSUMES+ gKabylakeOpenBoardPkgTokenSpaceGu= id.PcdI2cHdmiDebugPortPacketStallUs ## CONSUMESdiff --git a/Platform/Int= el/KabylakeOpenBoardPkg/OpenBoardPkg.dec b/Platform/Intel/KabylakeOpenBoard= Pkg/OpenBoardPkg.dec index 448eafacbfcd..401f6416aa1c 100644 --- a/Platform/Intel/KabylakeOpenBoardPkg/OpenBoardPkg.dec +++ b/Platform/Intel/KabylakeOpenBoardPkg/OpenBoardPkg.dec @@ -102,6 +102,25 @@ gKabylakeOpenBoardPkgTokenSpaceGuid.PcdI2cHdmiDebugPor= tSerialTerminalEnable|FALS # @Prompt DDC I2C channel to claim as the HDMI debug port gKabylakeOpenBoa= rdPkgTokenSpaceGuid.PcdI2cHdmiDebugPortDdcI2cChannel|0x00000000|UINT32|0x90= 000035 +## Specifies the DDC I2C speed to use for the HDMI debug port+# Th= e value is defined as below.+# 0: I2C speed 100K+# 1: I2C speed 50K+# 2:= I2C speed 400K+# 3: I2C speed 1M+# Recommendations as below:+# BusPirat= e: 50K. Increase internal baudrate generator for 100K, maybe 400K. Potentia= lly less stable+# Atmel SAMD boards: 1M+# @Prompt DDC I2C speed to use for= the HDMI debug port+gKabylakeOpenBoardPkgTokenSpaceGuid.PcdI2cHdmiDebugPor= tGmbusClockRate|0x01|UINT8|0x90000036++## Specifies the stall in microsends= between packets on the HDMI debug port+# Recommendations as below:+# Bus= Pirate: 3000+# Atmel SAMD boards: 60+# @Prompt Stall in microsends between= packets on the HDMI debug port+gKabylakeOpenBoardPkgTokenSpaceGuid.PcdI2cH= dmiDebugPortPacketStallUs|3000|UINT32|0x90000037+ [PcdsDynamic] # Board GP= IO Table-- 2.39.0