From patchwork Thu Nov 4 01:12:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathew McBride X-Patchwork-Id: 1550699 X-Patchwork-Delegate: eugen.hristev@microchip.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=traverse.com.au header.i=@traverse.com.au header.a=rsa-sha256 header.s=fm2 header.b=PtIjtMz/; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm1 header.b=VxitP7lz; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Hl5KW0676z9sR4 for ; Thu, 4 Nov 2021 12:15:10 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8D64A83670; Thu, 4 Nov 2021 02:14:29 +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="PtIjtMz/"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="VxitP7lz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2C30283645; Thu, 4 Nov 2021 02:14:17 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 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 561C983658 for ; Thu, 4 Nov 2021 02:14:12 +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 compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 8BE835C00D0; Wed, 3 Nov 2021 21:14:11 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 03 Nov 2021 21:14:11 -0400 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=RXZsJmwCTxHOx KB2o/19J1rfbuAG0Zz3wJjho3+afk0=; b=PtIjtMz/gpIEqhoK+bCWnDpE2M4Ny og5X/f8lNMl8NBNlrrYF6hobrtIo/JpWqzFPFLHq6EpXdfrUpuxbTg0XO/WGfcKW HfFBHipsJXwqnRS3s1WR+F23bY2bDwfbhxys1/EJR0xnzNqrgsLdChmdzZjCI1y+ Dmb886l5/6oPOlKWHJxb/mxXHKmRsCHtCxk55VTQ0Ozw/AJLnrP3sSWuQodJs/Sv UfiwEEHrE60YY68xW+Fg6AM6vaohrgT7pPAXzDePeEMlquBrNo72u3+FpZSmBMA+ DMku8Agcg1D1VGq+QmggCUQEP7lBpuLbhWaxvycydWVOLUo/zUG3FHBrA== 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=RXZsJmwCTxHOxKB2o/19J1rfbuAG0Zz3wJjho3+afk0=; b=VxitP7lz z/CXHVJA25KgliNotuVMwsxS4vnxzw7K2kiF1vrZohf/6b1rk0pLHiUNnjoZ+6TQ mCTya6aMKPmhXc0UxhAvcTS7bN3En0trsgzBtXMGwRdp3ETz/uGGGn49nA4X6en+ RxBWMwC5tdjeJPtpwL7Vm8B49JwtjXY5c3i0i8qF4tr44eij8jQHMXtB0vrsEtXh NJUTThkBwtypwTXKJ2eGgN7zj1yZJodIk3kdGOHjre+X6KLEItCPBtAYm2Ne/BHJ tQRhaQ2d3ViZdbREQF4prYYklt86iV6F2hdSRokHrMX04tasixs4bSoQwYm0FpM5 dhwr7npNCzphyw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrtdefgddvlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrthhhvgif ucfotgeurhhiuggvuceomhgrthhtsehtrhgrvhgvrhhsvgdrtghomhdrrghuqeenucggtf frrghtthgvrhhnpeekleevteelvdduheetgfdvfeelueekffeggeethedtteeljeeivedv gfehjeejheenucevlhhushhtvghrufhiiigvpedvnecurfgrrhgrmhepmhgrihhlfhhroh hmpehmrghtthesthhrrghvvghrshgvrdgtohhmrdgruh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 3 Nov 2021 21:14:09 -0400 (EDT) From: Mathew McBride To: u-boot@lists.denx.de, Ilias Apalodimas , Simon Glass Cc: Mathew McBride Subject: [PATCH 5/6] drivers: tpm: atmel_twi: implement get_desc operation Date: Thu, 4 Nov 2021 01:12:52 +0000 Message-Id: <20211104011253.4401-6-matt@traverse.com.au> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20211104011253.4401-1-matt@traverse.com.au> References: <20211104011253.4401-1-matt@traverse.com.au> MIME-Version: 1.0 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 udevice name as a unique 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..9ca33e4334 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 1.2 TPM (%s)", dev->name); } /*