Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB6A7C433EF for ; Thu, 11 Nov 2021 04:07:40 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 530F161381 for ; Thu, 11 Nov 2021 04:07:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 530F161381 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=traverse.com.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D574E83983; Thu, 11 Nov 2021 05:07:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=traverse.com.au Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=traverse.com.au header.i=@traverse.com.au header.b="C8sKe13Q"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="DK2otGy0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EB7ED83754; Thu, 11 Nov 2021 05:07:04 +0100 (CET) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DCEF6836C5 for ; Thu, 11 Nov 2021 05:06:57 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=traverse.com.au Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=matt@traverse.com.au Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 1EBCB5C01AF; Wed, 10 Nov 2021 23:06:57 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 10 Nov 2021 23:06:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=traverse.com.au; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=5yzbRPTQHQkF6 SwBlh9zwsIV/AGxkdDXi9d4xr5dQO8=; b=C8sKe13QZp0WPInZ3wSRoVq3b9Gmh Xaqqiyxy7jTg0EyhOzvD4mA3Kormv+akhukCQQShvHWRAXOScDUbagi4f2/pCjSb zIw6CoJz6RbV2JKcplNIfOoJzaXm9vtLB8zMjMZxCv6oImqr8fSqRJgAgLDoWySx 5bKYcbHD36JlG9IvrRBsgoSvrsAHNUz8zAgyqwgQ9FbkxRoI695MdOjy0dCW9sjV jn9mZiIAFuAnmnZl/BBJ3iKaX6ueqU/Po37Rpg4Ly7hOD3lGJSPvR7jNejuCDrQz wYCxk9QibPv61rvnZ2Z4eZPME5Yf0O35iCQ0sYGsBNFrSqfIUVxu7mLAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=5yzbRPTQHQkF6SwBlh9zwsIV/AGxkdDXi9d4xr5dQO8=; b=DK2otGy0 ORNpnZqrp3TMi8SWvpBx3jdspsmK1HXOcsTQBAVSfR/YbkkgM94YW/YInBWGhYAw LPtTX0wJGm/OX5MqNjQODtp3SI78Iq6n3fpZeJKtqDRLoq+Mma1F/1DgCZJ/2uvg oZ70cu0gZmAst7KHqj0OBk1J+1V6P8hDzcjPzyPHvYuA8GdEkKsI+t+7Ro+PKyhB wdHqdx4xMDbMGgImBw6Hxm0JGmQA2y3FZqHIBLVLpGzSEexasrxFpYi2UT3aUEIB iPbHZq7prQ1jVeh3u6pEDn/rHE72aPAcNK64UsfFFnn0oFVOBVCUsyFsCO145PlE NJ/3ih3o/XQ2lg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrvddtgdeifecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrthhhvgif ucfotgeurhhiuggvuceomhgrthhtsehtrhgrvhgvrhhsvgdrtghomhdrrghuqeenucggtf frrghtthgvrhhnpeekleevteelvdduheetgfdvfeelueekffeggeethedtteeljeeivedv gfehjeejheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehmrghtthesthhrrghvvghrshgvrdgtohhmrdgruh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 10 Nov 2021 23:06:55 -0500 (EST) From: Mathew McBride To: Ilias Apalodimas , eugen.hristev@microchip.com, sjg@chromium.org, u-boot@lists.denx.de Cc: Mathew McBride Subject: [PATCH v2 5/6] drivers: tpm: atmel_twi: implement get_desc operation Date: Thu, 11 Nov 2021 04:06:30 +0000 Message-Id: <20211111040631.21262-6-matt@traverse.com.au> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20211111040631.21262-1-matt@traverse.com.au> References: <20211111040631.21262-1-matt@traverse.com.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Without get_desc, the tpm command will not provide a description of the device in 'tpm device' or 'tpm info'. Due to the characteristics of the Atmel TPM it isn't possible to determine certain attributes (e.g open/close status) without using the TPM stack (compare Infineon and ST TPM drivers), so just print out the chip model and udevice name as the identifier. Signed-off-by: Mathew McBride --- drivers/tpm/tpm_atmel_twi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/tpm/tpm_atmel_twi.c b/drivers/tpm/tpm_atmel_twi.c index 71b101406d..a5dfb34846 100644 --- a/drivers/tpm/tpm_atmel_twi.c +++ b/drivers/tpm/tpm_atmel_twi.c @@ -52,7 +52,10 @@ static int tpm_atmel_twi_close(struct udevice *dev) */ static int tpm_atmel_twi_get_desc(struct udevice *dev, char *buf, int size) { - return 0; + if (size < 50) + return -ENOSPC; + + return snprintf(buf, size, "Atmel AT97SC3204T I2C 1.2 TPM (%s)", dev->name); } /* -- 2.30.1