From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web10.100917.1673643939575675451 for ; Fri, 13 Jan 2023 13:05:40 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=cL9szK9F; spf=pass (domain: intel.com, ip: 134.134.136.100, 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=1673643939; x=1705179939; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=+UkdtTJANKCraDkEh8YliYzxnHT2FRjUQvR9KQcAoSM=; b=cL9szK9F1+D8unZX8IxbZzhM+akmUuvJxHjNQtL7h0Y1trQLAXtSp4jB pN/Yo7h/0fVCcohcVTvD/6iuyc3nmsWW5LUXcO0ItAeKkPLoWl1jaIyNR VNmfiMNWPudVeOdj7Qls1Gzi/wkrnVJqUjky9aIXQMYHAvftEInXoZdl5 mW6sgCyN2Vuo1TE3FpEesiVzkLvsyHbFRP5hx+1sl/iPe2NPz+1ZWzouS p8tS80/Yay/tOeiRmnA6ByGYOSb1HZPaDCRrhgJOi+ZiMmVHIi/LG9S6t /eMJnEXR/Gbs+c7hEEO9E2xPIf74/J5zq0ue3ey6tyyn9NkOEiUlcJRYh g==; X-IronPort-AV: E=McAfee;i="6500,9779,10589"; a="388597419" X-IronPort-AV: E=Sophos;i="5.97,214,1669104000"; d="scan'208";a="388597419" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2023 13:05:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10589"; a="987124738" X-IronPort-AV: E=Sophos;i="5.97,214,1669104000"; d="scan'208";a="987124738" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga005.fm.intel.com with ESMTP; 13 Jan 2023 13:05:38 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Fri, 13 Jan 2023 13:05:37 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Fri, 13 Jan 2023 13:05:37 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Fri, 13 Jan 2023 13:05:37 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.175) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Fri, 13 Jan 2023 13:05:37 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IQ6Nauk1/gOvLLzUyGHtbOGdnRTNXiQGXkqCpIJOzz776Yeb/XaiEhkY3fzJEEzk2MRRzmd9iiBE5PRzfMfsow5/9nTie5Pi7BAaS5oGM/SgFqskOIiwRXJ9R7LQP22/vh8KiNTb3QhKnoRIY4iLvd/qM2SjqkvziPP7SYTuBSa57V1twBY/VGW/pUwh5lDPqWdJWqcBj702WPtpx9BOh/nUgQWJVGLF9reCmPcFp8UWtLG5O7ZosaG3Yt2MSGDQSNEwp9pc1hkjp8Gp0lftc1aIvHCvem1/l6J7mknfNgMMEg85ItSYdDW94+S5A7kByMbkfOS1YhzzY/S7LcAHww== 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=zUr+AXYdCZWw8zYGno7rlSkTtbrc+rD2J1hfDyggiGw=; b=H0I9v9o18WBCXTJoDmHwGyRQcCrxvfTi/il+T8th+PldUMm5xZfkPGTc8ggU6OiKJQjm4G0o34NVNt0ctvPzSbathoi6qO0EkBqZ2iig5D3b0SzdyoK28iznwYlAwyYmclS3tGC8H1BFftO/DLz4Xp65Lh1EpwUS+tdDzoWRP32Hm+bbF29g9+2D3LwoIQ56B9F5EOHMwGIESAHeQ1DUY80tPIkNfhF/Uwi9/xnNueCkQweCGxpnEoyaIY13eFWZu+IlV7StMiLZ4F6kp8rnQPK+LRajxuaj+R0AbAxosyOBQ1XLGtwYG04o12i1PadsgzY55mw6IaGdCT5UCJWx/w== 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 PH8PR11MB6732.namprd11.prod.outlook.com (2603:10b6:510:1c8::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Fri, 13 Jan 2023 21:05:35 +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; Fri, 13 Jan 2023 21:05:34 +0000 From: "Isaac Oram" To: Benjamin Doron , "devel@edk2.groups.io" CC: "Chaganty, Rangasai V" , "Desimone, Nathaniel L" , "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: AQHZJ3hrzqmKADPy20aZpcjYnwkXoq6c1ohg Date: Fri, 13 Jan 2023 21:05:34 +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: SA1PR11MB5801:EE_|PH8PR11MB6732:EE_ x-ms-office365-filtering-correlation-id: 23aae055-4b9f-428e-df5d-08daf5a9e9e1 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: zsWiLbUQBP/7+AxVZFx6VdrA9NtT1JYYA6/Ix2ZX8DJe7a0+qCPzGj2fOBT/ItDc4LVI4WIPWnJuo3dp9WZc1q+tWlihjFiOsQvaAzwNtUjYfPqotWXSQvJD7EP3eRYb5IQWGDUV1YJEMvOGoKA8N0gcjc8yv7gz8aLUcFoeyF7sVPB42iOLPmztL2n5yK8QpIAoEWvAg38FBxvXtTumDOiAZO3nIhqS/kii3ogEF5i0kiKk6+8y0fODMFHP8UJXAxVcGO9nBCFPIU2EMnMZ/wMX8wYSYwBTV9CVJHXeo/B5B8FZiDblr5v7342Mc0i0fTamo8RO3gZt4HjEapXShV2kjmmM0L2ZTX/K+CPfgowl/5j9gEQYXPb0zWM1rLg1BQtdIGoTViVzvsWbnItosukrGiibXI7+J3GnI2M4jNN5I9bWVPLVIbuEaHJcHYxPP2Z4iykijK2S38AB1fJMK1TqsCtQZUGmabwscwjy7yDiqJJj1qGDpK3dROyF03KHHFQ8LBauoogBClhbiFx3dR8eOC9JulEVOBN0FZgECu6qeTHMSL7xOBmMTJILOJ0b74bpGiODwM+d56BTN77gC5UTU/d3FnL+vzchwfCsWOkSg1ph65Ov8SdyJzUbjK5vNcWZxhgmaMns3qW59kh0XE9w4nZqkCxlenMLT7ZhPsRD4WvXzpvTk47wNISg9nqS4WRONtInWWfj0Wwd5gCzuDv2eU9RD8bELO503WPAMjngwPZr5i180rGlxida30D5YLse2okqgBuhVpJWh2jitA== 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)(366004)(39860400002)(136003)(376002)(396003)(346002)(451199015)(9686003)(186003)(33656002)(5660300002)(316002)(7696005)(26005)(19627235002)(966005)(71200400001)(8676002)(64756008)(66446008)(76116006)(66556008)(66946007)(54906003)(110136005)(4326008)(41300700001)(8936002)(38070700005)(55016003)(66476007)(86362001)(83380400001)(52536014)(53546011)(107886003)(6506007)(478600001)(122000001)(38100700002)(82960400001)(2906002)(213903007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?kmI6QE8xOk/XAsCIXsiXOLZJG2fdESEyHK0+qCgKduTGNM7qbGC8l+79cmot?= =?us-ascii?Q?iW3t65SyrGOKl7nyO4DUMkFSitanNsU0pcg3rFKNJLATWzt3RNyDI/F/QBDx?= =?us-ascii?Q?UZJptXFHynLdboFnw3LtTj79Auob2kNmvfl4KIx4GdPDiRwyE6C5P35qdn6R?= =?us-ascii?Q?uBmiMwAcMyWLM1XzQPRIOM6n/UrmGB0OT5RFc3EZT6XLs9P4Lo3QjXwHPmqJ?= =?us-ascii?Q?QInp33uiFLxILAdOHwYbPBS9zANQ9bl3rUlGgWZjRSeovMeR25Q1CSozkhRp?= =?us-ascii?Q?2mDWZycpyJh/FChYuzGhRuxTmx5mthO17jBt59f5kWqOamJyuI6MpC+GOl98?= =?us-ascii?Q?wjj3HDHECRWAW1bp6RSsbogiUB2hTJhBgion9MiRvkXeaw0V4sp1499gJKOX?= =?us-ascii?Q?ZWdiQfK4aL3dPtP4f8OABuFjOD4mUs/rAz1T2hC+uHGglqyxNPiuGrURrp11?= =?us-ascii?Q?+sNajtJulzMACYqQ2M2Uf6IDeS+dA/a9y2uhQI2VUYT6BUYeaHUojNUouY1q?= =?us-ascii?Q?1KNQTqdPg/rDGn1JkqAjbn+2JTFdj5tX9Zb07VCZPSIrRnRB7iH1XPdQ2tl7?= =?us-ascii?Q?1ARUUvJbd/sAwkqqKbi8mCNy/WsBRNJ+qsEHyxlKZPnZO4yuDKxdqy7IbUsP?= =?us-ascii?Q?FNSz2pYrPbD4OZ8xQv+fUp1I0yljytyZ983qpb/IoA2FnSJ3X6pjF3r9VaVM?= =?us-ascii?Q?Igkkq+i0GQqYWMl28nnP9OKS/6733roec89Ubo7iGcsLzT5NJ/owqa9d6jSc?= =?us-ascii?Q?kvpewfl4qdd9eXHqj72iFaJU5DXIdEE/Y9go9hKAw6xfIp9GqiCiQ0Z9jV9I?= =?us-ascii?Q?edghLnz4G3B1HBtyqo3inJbmkBzpnkkBR5qcE87AC13tsQDcW8bb7zC0uypp?= =?us-ascii?Q?AXSBEi0vfpw6s0x5k45JOeYdEM+++sghcfF6RFpIA0MCJDbd70oKNTt9w16S?= =?us-ascii?Q?iaeeNyGWixROlt1sFIVs/ioWSW4Sho2efcclawEe8wfMsPCvPTiTuBo5cQHC?= =?us-ascii?Q?cWixiC5L9dQbci+ZY/AkcR1P/BI3mQIwELAhDFosnVbnRF8zfj2kKiWcBsGB?= =?us-ascii?Q?DqzgJS1sCZEcxvAKBFrDl7JfsMqmtpnSxX299bYBVKlrbw2ln1RKtJlXtczD?= =?us-ascii?Q?0zrTW7SF27EkS2bIGs0v9zbSB7oXHrjDM0Qa4EgYBdIl1A6JhIgEsO3GbZuj?= =?us-ascii?Q?fwtvE1H8v/ZdSeIaxIg+HQcLfSwkbKOz48pkJvgLgtquOoBvHyrUVc44+nD6?= =?us-ascii?Q?ivdAxiWEeaMH+v7NRsyG3rNXULPGkpfIN1ip/fSbo/d10KGoRdBZrPGEl0Gv?= =?us-ascii?Q?loHjgWhCdedecTRK5oFkHx0dSfWQb37TX2yL468GDrrYrYv2S7Dls2VEUQCe?= =?us-ascii?Q?vXMyPERbkuW0RuktndG1Ga86AOOhIh3TLsDYc9MznuiYaJH4zwJ0NOZlVn7k?= =?us-ascii?Q?9gUBr1qFS3+YtC9QA9nOJ2jfrJ1g9lksuUE70LcEFqLdHJtNoaaA1wY0aCSM?= =?us-ascii?Q?QI6FEUBBo4F6LbfNfpSSU245pgQ9j/7pygt6c35Bp1izY23Izt7DKoM3871m?= =?us-ascii?Q?y09136itL57tOj/2Yr2hzSBSyH7i0s7tJoVO37aC?= 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: 23aae055-4b9f-428e-df5d-08daf5a9e9e1 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jan 2023 21:05:34.8206 (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: PrN4voN3xzzHBJqfG4/VsRze9YMaJlOOC8iZV19k6W9K9iw/l7aUcwE9iw50zKJPduPNoW9g5BmjDxqVPXVlLQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR11MB6732 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 Reviewed-by: Isaac Oram -----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