From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4D5EE8197E for ; Tue, 10 Jan 2017 12:03:17 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP; 10 Jan 2017 12:03:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,344,1477983600"; d="scan'208";a="1081465456" Received: from orsmsx101.amr.corp.intel.com ([10.22.225.128]) by orsmga001.jf.intel.com with ESMTP; 10 Jan 2017 12:03:17 -0800 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.184]) by ORSMSX101.amr.corp.intel.com ([169.254.8.63]) with mapi id 14.03.0248.002; Tue, 10 Jan 2017 12:03:16 -0800 From: "Leahy, Leroy P" To: "Kinney, Michael D" , "edk2-devel@lists.01.org" Thread-Topic: [Patch 1/3] QuarkPlatformPkg/Tpm12DeviceLibAtmelI2c: Remove PP Check Thread-Index: AQHSa22/2TSWB/JViUezfiuQu7DP8qEyIhag Date: Tue, 10 Jan 2017 20:03:15 +0000 Message-ID: References: <1484072204-35608-1-git-send-email-michael.d.kinney@intel.com> <1484072204-35608-2-git-send-email-michael.d.kinney@intel.com> In-Reply-To: <1484072204-35608-2-git-send-email-michael.d.kinney@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYmI3ZGEwMjEtMjY3OS00OTM2LTkzMTktY2I0ZWUxZWUyYzRhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6Imc1NkpNNmtsbjdETWdBNHkwNDNcL1JcL0hMOElJbDY0UFlaVTQwbkpIK0grST0ifQ== x-ctpclassification: CTP_IC x-originating-ip: [10.22.254.140] MIME-Version: 1.0 Subject: Re: [Patch 1/3] QuarkPlatformPkg/Tpm12DeviceLibAtmelI2c: Remove PP Check X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2017 20:03:17 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Lee Leahy -----Original Message----- From: Kinney, Michael D=20 Sent: Tuesday, January 10, 2017 10:17 AM To: edk2-devel@lists.01.org Cc: Steele, Kelly ; Leahy, Leroy P Subject: [Patch 1/3] QuarkPlatformPkg/Tpm12DeviceLibAtmelI2c: Remove PP Che= ck https://bugzilla.tianocore.org/show_bug.cgi?id=3D337 The Tpm12CommandLib in the SecurityPkg was updated to check the returnCode = in the response packet in the following commit: https://github.com/tianocore/edk2/commit/950a3bc788b5b101729b26aed3ff75fd2a= 64a570 The Tpm12DeviceLibAtmelI2C uses the Tpm12PhysicalPresence() function from t= he Tpm12CommandLib to verify that the I2C device is responding to TPM comma= nd packets. However, at this point the TPM device has not been started, an= d the TPM properly responds with an error in the returnCode field of the re= sponse packet. Before the commit above, the check worked, but the addition= al error checking in the commit above now returns an error and an Atmel I2C= is returned as not present. The fix is to remove the call to the Tpm12PhysicalPresence() API in the Tpm= 12CommandLib from the Tpm12RequestUseTpm() API. The Atmel I2C TPM device is detected if a byte can be read from the slave a= ddress assigned to the Atmel I2C device. When the startup command is sent to the TPM later, the command and response= packet processing will be verified, and if the I2C device is not an Atmel = TPM, it will be detected at that point. Cc: Kelly Steele Cc: Lee Leahy Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney --- QuarkPlatformPkg/Library/Tpm12DeviceLibAtmelI2c/TisPc.c | 12 +-------= ---- .../Tpm12DeviceLibAtmelI2c/Tpm12DeviceLibAtmelI2c.inf | 3 +-- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/QuarkPlatformPkg/Library/Tpm12DeviceLibAtmelI2c/TisPc.c b/Quar= kPlatformPkg/Library/Tpm12DeviceLibAtmelI2c/TisPc.c index 4e5aa41..08a005f 100644 --- a/QuarkPlatformPkg/Library/Tpm12DeviceLibAtmelI2c/TisPc.c +++ b/QuarkPlatformPkg/Library/Tpm12DeviceLibAtmelI2c/TisPc.c @@ -1,7 +1,7 @@ /** @file Basic TIS (TPM Interface Specification) functions for Atmel I2C TPM. =20 - Copyright (c) 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2016 - 2017, Intel Corporation. All rights=20 + reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -18,7 +18,6 @@ #include #include #include -#include =20 // // Atmel I2C TPM slave address @@ -224,15 +223,6 @@ Tpm12RequestUseTpm ( } } while (EFI_ERROR (Status)); =20 - // - // Send Physical Presence Command to Atmel I2C TPM - // - Status =3D Tpm12PhysicalPresence (TPM_PHYSICAL_PRESENCE_PRESENT); - if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "Atmel I2C TPM failed to submit physical presence= command: %r\n", Status)); - return Status; - } - return EFI_SUCCESS; } =20 diff --git a/QuarkPlatformPkg/Library/Tpm12DeviceLibAtmelI2c/Tpm12DeviceLib= AtmelI2c.inf b/QuarkPlatformPkg/Library/Tpm12DeviceLibAtmelI2c/Tpm12DeviceL= ibAtmelI2c.inf index 5a8734f..1f7e4be 100644 --- a/QuarkPlatformPkg/Library/Tpm12DeviceLibAtmelI2c/Tpm12DeviceLibAtmelI2= c.inf +++ b/QuarkPlatformPkg/Library/Tpm12DeviceLibAtmelI2c/Tpm12DeviceLibAtme +++ lI2c.inf @@ -4,7 +4,7 @@ # This instance provides basic TPM Interface Specification (TIS) function= s # or Atmel I2C TPM. # -# Copyright (c) 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2016 - 2017, Intel Corporation. All rights=20 +reserved.
# This program and the accompanying materials # are licensed and made ava= ilable under the terms and conditions of the BSD License # which accompani= es this distribution. The full text of the license may be found at @@ -42,4= +42,3 @@ TimerLib DebugLib I2cLib - Tpm12CommandLib -- 2.6.3.windows.1