From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web10.4053.1674002700698667099 for ; Tue, 17 Jan 2023 16:45:00 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=f8WxW2Nq; spf=pass (domain: intel.com, ip: 192.55.52.115, 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=1674002700; x=1705538700; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=M2qtQ5W4uvFgZgTUTTsnAjiMZrcuBsU4oKmqnmTmjaE=; b=f8WxW2Nq5TZ27fEErgiB40vKDZF9oOkCOj1unhfTh1+ylf5j6fY3jhBi +MkArcSOKSiOfAHV42y/7FOB9dK329fmGkmQGaWxTTTz0MOmaBQO0i3TY Qf63mtDK+2QlBUfktKURhu1OqmAidqv4SBFs7yjH7WXZHPLRqwz+Hqiaq wgtEeqf/QOO3QKEfKlR6gJ2HXkJjI+fV0DLIU1/OdY+/8LTxwTPrWpR7/ nT9sL4A3+ntiUEzwHSRK5jkYKbk8oCjlFRQI+ubcvHYdyfMYqQFqF/N7b NXyvAHIwh4HKL2gZMq+RobrY3Kxwa7CMOkWa096V2rz+fhsXsrmOjrUIr Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10593"; a="324917593" X-IronPort-AV: E=Sophos;i="5.97,224,1669104000"; d="scan'208";a="324917593" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2023 16:45:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10593"; a="988337411" X-IronPort-AV: E=Sophos;i="5.97,224,1669104000"; d="scan'208";a="988337411" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga005.fm.intel.com with ESMTP; 17 Jan 2023 16:45:00 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX602.amr.corp.intel.com (10.22.229.15) 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:44:59 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx611.amr.corp.intel.com (10.22.229.24) 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:44:59 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.104) by edgegateway.intel.com (134.134.137.100) 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:44:59 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hJLl2QGKqQxNRugTA7fdtknaVwCG8iY1LmGgRMxVyV2p0LzZ9LUv2O40Kl/9DEiZ+rLJPEOjAm3h3DY0LAaPcdZ54eGV3ulMC9+mgAnpns9LHDS2mZrDtN3GUIIB8b7VR3Talt+9ntnHNOGQ9U5lJ1eEKWd1tcnS1gO+PsDX7Oet72LDIJCZ1Ai7dGzSMy8B4l159P89Qrwlm2RkSqD7cQ4cutnpktnn7Rah3m0dw16hf5JnEuQeo8CEbRz72kmMG9qX1SAKETTTJuE/ZKKJrqVc8yQbDKK9giRqMNakUG4K6Z6iu4AeVGJmjGUHqsMT2dVWIF6T9mzy9DNvvQCwkw== 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=s1aOrs/nWQfDVn/cAl1eZCyHBzq56LXv5q3t5+d8eAE=; b=PuIbzl/gizg0DJBM5946fk/sCtW5FoaI4fznaVbjKmyTICl1rrd4qpyi/0RkOQWRil58QzJO0DbAKYFPfdcEwxuoX+MSkqJmepYr+8JEIT4wWRqW3GUtsmnrq8n/RvalXbl7aCmYFRFrDttip7je75FO2ovKCfOdUoDjafVcO9OHoj/5wWdtcGMydzfZUBAut+VQDEdk4dGozxw44/bJAK4NB/n8yerBJO8fWBPGbe4VP9OOACd86jcfypG0J3+5qq9rnwYw/1qu2DBFREWpqJLjySP7BlWZIeUmtknpwn97pi8UiWxlBLXxVUjTdBzy0DdiMeUAzJdWR3AZiXJzyQ== 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 MW4PR11MB5821.namprd11.prod.outlook.com (2603:10b6:303:184::5) by DS0PR11MB8163.namprd11.prod.outlook.com (2603:10b6:8:165::22) 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:44:51 +0000 Received: from MW4PR11MB5821.namprd11.prod.outlook.com ([fe80::2aa:e66e:48d7:163f]) by MW4PR11MB5821.namprd11.prod.outlook.com ([fe80::2aa:e66e:48d7:163f%4]) with mapi id 15.20.5986.023; Wed, 18 Jan 2023 00:44:50 +0000 From: "Nate DeSimone" 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/I2cHdmiDebugSerialPortLib: Configurable timings Thread-Topic: [edk2-devel][edk2-platforms][PATCH v2] KabylakeOpenBoardPkg/I2cHdmiDebugSerialPortLib: Configurable timings Thread-Index: AQHZJ3hrILsKmOsNUkyCAg2uvMVnRK6jXRmA Date: Wed, 18 Jan 2023 00:44:50 +0000 Message-ID: References: <7e10276730e9a60e39dc5f4be06a49c2a11e56a5.1673632431.git.benjamin.doron00@gmail.com> In-Reply-To: <7e10276730e9a60e39dc5f4be06a49c2a11e56a5.1673632431.git.benjamin.doron00@gmail.com> 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: MW4PR11MB5821:EE_|DS0PR11MB8163:EE_ x-ms-office365-filtering-correlation-id: 8cf8a27e-d773-48ef-86eb-08daf8ed3510 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: NbM27DBfvgy9bH/V9YpYptcS1xT6XCGTDTvbgvXOD/76BvCswp4YjQHD7bZ3w5XXP9Bi7zKe66N+8zeUMpBCzRyPX5U+DrzUW/2oclpNVeQKXfszB4s1zQLGpqNJNoQy6R8L/A7qyNcYkXpDGg4XuvzAmqwUeHXPgvENlc4QJ6bTfoFEP6la70PSNdVvQeCUQpEGoU58V5MZK2GcupbDzXUggV00EhXgH6VyZupZ7IqlecRp4KWYZkfmeII98yJIdx7I46ntQ4XB8sG11Z25mD2yX6MKnp1Z1vfwZG/dgeROgFbCGztcKy8skAYiTeyQfwsyOn18MuarEWxxofEzikfQdar9VCRbuIxjs6Z5y1IDOTvs4WdEKexhQ7KWzfS/pzcd3fnYFjv/cb8P5fsqTFAJqw5NGvGdU2mZKZ3fNyTxRo+0Dub/xbjedveGJCUFqItRZpYoVFS5SCpe+ErGaxBC5Iw7B59rk8g0j/xozm2Pou3EFOxeZB2BN0YzP+t1n9Lax/3kW7KWuXYei5vKWOWAnd/sSZKve+rX232AvbUjImIVI2NlA9ksgBYY8DJtHdlb0emJ88kLA2rn2tUQXUoMYOiFn8qwW23Tarb+eoG34JBfrQiBQdHDnOayKSZb9OxcCgVKLFm65T1ACmI9rRyx7kCr41fJsB8qwZwG8JvoG1CvvzjyUpjXQMo5OJs0PhjL0FzbiG2DqoAHS55cRb5waKD/xu8NXyAV5pEyRMlg5gTbIfaAOP8xGswfSxXv x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR11MB5821.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(396003)(136003)(39860400002)(366004)(376002)(346002)(451199015)(2906002)(19627235002)(316002)(122000001)(86362001)(110136005)(6506007)(53546011)(54906003)(107886003)(8936002)(38070700005)(33656002)(55016003)(52536014)(71200400001)(4326008)(76116006)(66556008)(66476007)(66446008)(8676002)(66946007)(41300700001)(64756008)(38100700002)(82960400001)(83380400001)(7696005)(478600001)(966005)(5660300002)(26005)(186003)(9686003)(213903007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?rEZY3Xh9YjfNGVdDH8Cs1jRcoiKMlX72YNJs9Vu7BlJ/zPOx2h4YFduiulkW?= =?us-ascii?Q?6x/RmFhnW5sc2r1/KAvmjlK6zip1hyJ8E3UtgTullJPUctjcBz6mkgaGkZ4l?= =?us-ascii?Q?y2iKBFeDpdAKsCU8EBAytgczVWUizEvn4kPU4oRNABwz6J4ZdGjRBM55+Ryt?= =?us-ascii?Q?5+LY7/Fs9/7N26OGnqY8HdPR7S75isP3UjiHDNByPtjOh65L3Y/S55ThLK6o?= =?us-ascii?Q?MANYk/yDWMPdiDsOjA/kq4hIH0Q8yCLsLKyjynVWwodNpSNVHm1ncsRKF6B+?= =?us-ascii?Q?zJGlpqvNAfwsBOt6znMTAP+ys86V7grg0as9tzk/g3FL8J3R1R1puxUjHL07?= =?us-ascii?Q?Va5ZwrvY5cChcoyniFIqUuuMsz6OUKZcG4AfvZxkOcju1PizYayAaVwa5LP4?= =?us-ascii?Q?L2qeFDhEPjynxWaOxRZxeQr+gos0Midtqd+VDYHW+K252WZKjeaQlqzR32tQ?= =?us-ascii?Q?znAQPz2e7cRCRn3upBatpgUF73MG/QQaNcCu8KdDp7TfQbpJp6Jxgrnt2U1w?= =?us-ascii?Q?Qtq1p+HmjG5WNu6JFIhc6d0Hs5jsX1ovNW0bQUucfb8b7k/PJ6y6E5js3Wdi?= =?us-ascii?Q?d2XKGldIJBUgIx8YwoETy6/O8joFRcSaj3tvQNumP6l3J858BV+oOCMmscYK?= =?us-ascii?Q?u8Wws8qo7yWpNL/hm1oebpMIVGVY5L2JDz+iDSrSSa72R39DujHfzZDrmtjW?= =?us-ascii?Q?0WgQGzYG0SPJFh7bf/MK94o2U2LBi/3Z2HvRjcsF4l2tirStvqSIIYfnsLwj?= =?us-ascii?Q?660EJkIdc/gRT5U6/1ez1O6+hASA/TO0TN0L5kVJuuY7Bot9fBG54+7Ji8Sp?= =?us-ascii?Q?fm6tazIBY3ZhjaEcfQ7J5VPMGBWjGbrgCBcrldv0beKLsDQIQ9oWZ3xwgmry?= =?us-ascii?Q?PrH3roVUpaOA4CrN2W/4xpEON8Va8i7d/LkoE+qUgoSlYOkEhxfgKW4XzktS?= =?us-ascii?Q?dfe1lM19NUYa+aKg5UOaVl+PRByMflQj2Men9lThTYiyJrZRwCMpEOXWEyOE?= =?us-ascii?Q?1zhEprUlhgGsi+/CgHx9Z7k4pRMnvQB1KLbOFeLQJNZIdPt9NKtNDUi15UFq?= =?us-ascii?Q?ieoRbVtOgtmdUY1bWkpVetX8mLsRCcB/KbFPTAQrBdJNOSVwTepVXx17AO7e?= =?us-ascii?Q?ISKo0xQon/yXUZZ3ZpXMGtsrNFdJn/P93yr77aBJ//0PIlOqC+S0USN25a3Z?= =?us-ascii?Q?92Z5FKrGwWwWqswZUi8VXThyWEYlLpv07LyceRDgzWHvUGgsGz5hz18Meye0?= =?us-ascii?Q?uEVajRt6i2L6rymb9+K2V/e1rrJgKNCz5i50SLAvTXQwhYAuHUmHyra4wkrV?= =?us-ascii?Q?oFWduD4kJhgLbLPJK/dlFbxMig2vHRyFt8xW/0mOBzEXAsCMBjrak9H0WeVA?= =?us-ascii?Q?kmckCJBnFUqb/7D85fMC9uXKKKIuqhbABRC+8kj4y+JU+HFutLnotz0t4LYX?= =?us-ascii?Q?OglyRf+wRHJn3vZcxO7O0Feq63Vjhf6WjWhIxoFTodywSkK4G2Utw3wlEGhz?= =?us-ascii?Q?FHhlfGmJTMgCQU1vIYEoVfIuNKXr3JNieHN+Lu3wX08ynRmfgJrb2CBL4vTO?= =?us-ascii?Q?9k/+glkvBhv6xWUx9b6008FbP5wxpORQ4idBpbFcw6uY4TLYPRVgbj8lY+SI?= =?us-ascii?Q?qg=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5821.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8cf8a27e-d773-48ef-86eb-08daf8ed3510 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Jan 2023 00:44:50.7403 (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: fkU6PCCIXOp9gaYGg0jVwCXvCeHeQ4bxbNsVFKBc50d0tGvvF4FmNGffa1AkxCzfAfKsYOeAbZ6EM0DCCIclbw69ASIcZ3wK8s6lhwPg1bs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB8163 Return-Path: nathaniel.l.desimone@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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