From patchwork Sat Feb 18 15:27:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 654769 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcd:0:0:0:0:0 with SMTP id e13csp514123wrc; Sat, 18 Feb 2023 07:28:55 -0800 (PST) X-Google-Smtp-Source: AK7set/PfprhIXA7N/unq73KYzCzZYBRSR3k8/MeJ+2IllxBWG2yhdtOJAtHgvwnXBCFt+NwvnOc X-Received: by 2002:a9d:14e:0:b0:68b:d890:1e03 with SMTP id 72-20020a9d014e000000b0068bd8901e03mr2114981otu.21.1676734135713; Sat, 18 Feb 2023 07:28:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676734135; cv=none; d=google.com; s=arc-20160816; b=XUx/oRwQHoxviM2Z9VVIZWL6omFy3zlv4Rug3PAyYdYtedyKQb0kjw+4L5xGU85+B7 8pEI3oWyW9RsSGVlE35k52Q9EhnsdRJWp4YmW/2yTInVTOZDPMFvoI68OGqIhtrZCQY1 Fs1dgSzkMHMQag5A7y9hyCsBe3NiDm54dssJx1ok0uXEnMQRQuje2Vr3CWsss7Vl52yJ ssWNI2S2WADOpJ4ebgwFMZ5Rn55AMxURNxNdrOo8VHECBYp9Lh1+lF3e2qneuhsCF9oz XV7IfCS2qWWzwqr/xcDwSuMyz+bgRwVR8qDbjKXQN82GRI/6J41zZXuXaItNUpCHX064 9gTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2OKVSn4URdFtFwiVDqazdY05nLnOSyKXVMqzGqzzOAY=; b=X9AsXVGfjwagPmQQE8h52dUCI/DM4Ua85gh0Ddffb1O0DRARWtOIh9GyNWE3bR76gW 9sMkvkqItxA2jOT+NugqVLnkhlL7PPhbq2Uq8ImXvhkP5ZNdbB06MCzENJNbpu39N7Su J8G1MI6UuwVs8+FRaTWDeo/RuAHTUTBMFABmugRPwT2i4UKmaG8/xtFH1B63Zxbdh4za FlRyQcMf9qc+lXsePfIMuiCeD5Qmcr0RtHNiGBrxw4N9lYX4Cp9scs1/aSeVJn+nFaQx mr85JIe9+uc8Y+g7T8ipU7LcQwFnenc6VV9LQJGgSWoUVj9KA0LoDj7JxW88n6iCPoMl uMVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="R/hwMV+r"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id d6-20020a9d4f06000000b0066c691d57b9si9222900otl.105.2023.02.18.07.28.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Feb 2023 07:28:55 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="R/hwMV+r"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0103185A58; Sat, 18 Feb 2023 16:28:22 +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="R/hwMV+r"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C1623851EB; Sat, 18 Feb 2023 16:28:04 +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,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) (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 D9A7485A48 for ; Sat, 18 Feb 2023 16:27:56 +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-x534.google.com with SMTP id fd2so3554154edb.2 for ; Sat, 18 Feb 2023 07:27:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2OKVSn4URdFtFwiVDqazdY05nLnOSyKXVMqzGqzzOAY=; b=R/hwMV+rKcu8evMWvGeZbEfaW63zbDqMNgE3G9tt0VDPxhAVobEU63bU/Sf2pn0WQ+ US3KnxpJQfkEIChTOzSBFeFfg2rcwHER6LiWvEnFY6YN8DRCk0+kqUTbNuCSMshBiKpv fRz78/7SAINJAbSMuxj1oEtnhJcMQOb349m74vCsBA1/y+HSdUG7R70qKyN/sbMHGshX wk0f6eDh5igzsR9VDPQ6mRUUzREFnxAq/p6/dKiOxtpDoSMD6rxZMueQV8L4BhdokbrI DDYe1aAAg8GTZ4pYKLiDLH6lhFP8tAkOoghduGDkyNXZ64Mq+TpMX1xW6c/7Mcq6fZob sRcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2OKVSn4URdFtFwiVDqazdY05nLnOSyKXVMqzGqzzOAY=; b=FYYY9H+IpYkK/OeAjgOyuUnBLbzw83NBpLpYTpPnlPDdIo3kgyT+O0EV8qkNQJkKLd ko44Nx2V+LY2WPdk13fwUUWMzjjpgKSu1sAA4aSaXgQPSSuWtdXy6TXmctmabEnGM3+y ERu/gJO90H7jNo5Pb5rNrSkT8EN8pTsK25lLZxgIydDt1FxlO3WXKu/jXJUz0g/e5Z47 +n33Q6RXb3EDABqLbteZBuxvu9hmWOo1Io6E3oAtaCZmQXYSqJrwmOhV6qpPBWBGeWvF usZydhw4CbfCTJc55S7rTp+55OMxXsIg9yS635Kt20KQeKSeZMsrTO7IyQlTZXwYYhWS sypA== X-Gm-Message-State: AO0yUKX/L68Dfvlh0BNWicBiX0FtKU3s3InzU3yY4+8SsPGYr+JEp0n8 B91LKbUNQtThG8jopUXkbnrXI23pSbBJZ1Wc X-Received: by 2002:a17:907:e8d:b0:8b1:2e8f:d524 with SMTP id ho13-20020a1709070e8d00b008b12e8fd524mr6840719ejc.27.1676734076362; Sat, 18 Feb 2023 07:27:56 -0800 (PST) Received: from localhost.localdomain ([2a02:85f:fc09:d5bf:82f9:4e04:7bf7:880c]) by smtp.gmail.com with ESMTPSA id ce25-20020a170906b25900b008b05b21e8aesm3512759ejb.172.2023.02.18.07.27.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Feb 2023 07:27:56 -0800 (PST) From: Ilias Apalodimas To: u-boot@lists.denx.de Cc: eajames@linux.ibm.com, Ilias Apalodimas , Heinrich Schuchardt , Simon Glass , Sughosh Ganu Subject: [PATCH 4/4 v4] test: add a test for the new tpm_auto_start() function Date: Sat, 18 Feb 2023 17:27:41 +0200 Message-Id: <20230218152741.528191-4-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230218152741.528191-1-ilias.apalodimas@linaro.org> References: <20230218152741.528191-1-ilias.apalodimas@linaro.org> MIME-Version: 1.0 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 A prior patch adds a new API function for TPM2.0, which performs the full startup sequence of the TPM. Add a selftest for that. Signed-off-by: Ilias Apalodimas Reviewed-by: Simon Glass --- Changes since v4: - New patch test/dm/tpm.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.39.2 diff --git a/test/dm/tpm.c b/test/dm/tpm.c index 0b46f799591f..8ee17f6a9bc3 100644 --- a/test/dm/tpm.c +++ b/test/dm/tpm.c @@ -25,6 +25,11 @@ static int dm_test_tpm(struct unit_test_state *uts) ut_asserteq_str("init_done=0", buf); ut_assertok(tpm_init(dev)); + /* + * tpm_auto_start will rerun tpm_init, but handles the + * -EBUSY return code internally. + */ + ut_assertok(tpm_auto_start(dev)); ut_assert(tpm_report_state(dev, buf, sizeof(buf))); ut_asserteq_str("init_done=1", buf);