From mboxrd@z Thu Jan 1 00:00:00 1970 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 9CA2BC636CC for ; Mon, 20 Feb 2023 16:48:33 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 967B28340F; Mon, 20 Feb 2023 17:48:30 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="XmCGmNvb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A413E8340F; Mon, 20 Feb 2023 17:48:28 +0100 (CET) Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 14A7A85805 for ; Mon, 20 Feb 2023 17:48:26 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-ed1-x533.google.com with SMTP id ec43so6549210edb.8 for ; Mon, 20 Feb 2023 08:48:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=qplDITs3itsklhHmEpUe06bpaI+Y55mGz6Q7ieCTPlw=; b=XmCGmNvbP4rjc88xG4A7hwwKO/YkK3pMqtFbgm3K08gAV4InEIzsdlFrG8prgSfeJ2 OxgKoH6/yjaPYDhJRhaRudL9B94UMkQytjbmEy+7jLjeFZbrbpWD/nKedIYUgyeDPvy0 KyHDmYMlWtwJk7EBr/PXz430d6nqEvt9RWEE9g5p25GwP/VmLPIOzmMDhjDKehvMjpyo +//ykpTOJ3vw8Eeu8dAKAhO2um/mHeMUokI7q9AGlnpV1I92mQtzK0haQXnbQo+M4OAO L59LO1vr95jxnKsbirIdbnT9C+o6ip/TTkYob+a/yArpmNQtR0LUfT8PiqpQgOU6bPfo np5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=qplDITs3itsklhHmEpUe06bpaI+Y55mGz6Q7ieCTPlw=; b=Q706Lm3rh4xQCNhmYz/niQIuRu5VrtbmSsBuEUTyiFo9ZJngDHRc17+rgu7ndEGkKJ C/hUQ84rpnxP/EfoY5rseM8dR1suJbtUjpQcvTAiU05Xgc3lJM06Lc0MZq90cZdJZt45 jIRbldmFmJa2VLQhU5vYpe03vu+HaBhTpb8H2SC6a2B0SkOYNMQfSjdc5I3RdMgCG16z aU9MiiSB7Iao4Pk0a714GDTJ/cLzXyp35tAAMN4Io4kFcTnIFm04SfIqEVEjWGZ7rDv9 RJYsLfuaraKqIlX6Clif//6SD9osYT0SlvJujc2E55hd7M5zKwWygz7Kb6Qs+tuK6oGm rN6Q== X-Gm-Message-State: AO0yUKW+3NQZ9DOlRV3amVWBzQtU5rs+P0NvWWGswGSAAAxlUaTqrvKO XZfpU8UhOJHFt/xoJbzjin/4/A== X-Google-Smtp-Source: AK7set+TSOjrcDH+0uoyjjzxKjXrXrPDjAM8W0iydBizlRlExgAoojFYy+pLYaNWBAwSKwW9u+pVQw== X-Received: by 2002:a17:907:9714:b0:8b1:7eba:de5 with SMTP id jg20-20020a170907971400b008b17eba0de5mr9137308ejc.10.1676911705623; Mon, 20 Feb 2023 08:48:25 -0800 (PST) Received: from hera (ppp176092130041.access.hol.gr. [176.92.130.41]) by smtp.gmail.com with ESMTPSA id v18-20020a1709060b5200b008a9e585786dsm6046049ejg.64.2023.02.20.08.48.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 08:48:25 -0800 (PST) Date: Mon, 20 Feb 2023 18:48:22 +0200 From: Ilias Apalodimas To: Simon Glass Cc: U-Boot Mailing List , Dzmitry Sankouski , Etienne Carriere , Marek =?iso-8859-1?Q?Beh=FAn?= , Nikhil M Jain , Patrick Delaunay , Ramon Fried , Sean Anderson , Sughosh Ganu Subject: Re: [PATCH] WIP: TPM additions Message-ID: References: <20230220145156.1886797-1-sjg@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230220145156.1886797-1-sjg@chromium.org> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean Hi Simon, > + * @dev TPM device > + * Return: TPM2_RC_SUCCESS, on success, or when the TPM returns > + * TPM_INVALID_POSTINIT; TPM_FAILEDSELFTEST, if the TPM is in failure state > + */ > +u32 tpm1_auto_start(struct udevice *dev); > + > #endif /* __TPM_V1_H */ > diff --git a/lib/tpm-v1.c b/lib/tpm-v1.c > index d0e3ab1b21d..884b8ddbac9 100644 > --- a/lib/tpm-v1.c > +++ b/lib/tpm-v1.c > @@ -69,6 +69,17 @@ u32 tpm1_continue_self_test(struct udevice *dev) > return tpm_sendrecv_command(dev, command, NULL, NULL); > } > > +u32 tpm1_auto_start(struct udevice *dev) > +{ > + u32 rc; > + > + rc = tpm1_startup(dev, TPM_ST_CLEAR); > + if (rc == TPM_INVALID_POSTINIT) > + rc = 0; I am not an expert in 1.2 devices by any means, but don't you need to start auto tests here as well similarly to what 2.0 does? Looking at the kernel code it does something along the lines of rc= tpm1_self_test_full(dev); if (rc == TPM_FAILEDSELFTEST) { ..... } > + > + return rc; > - * -EBUSY return code internally. [...] > - */ > ut_assertok(tpm_auto_start(dev)); > > ut_assert(tpm_report_state(dev, buf, sizeof(buf))); > @@ -36,4 +123,4 @@ static int dm_test_tpm(struct unit_test_state *uts) > > return 0; > } > -DM_TEST(dm_test_tpm, UT_TESTF_SCAN_FDT); > +DM_TEST(dm_test_tpm_report_state, UT_TESTF_SCAN_FDT); > -- > 2.39.2.637.g21b0678d19-goog > Other than that, this looks ok to me Cheers /Ilias