From patchwork Thu Jul 8 08:23:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 471210 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp45935jao; Thu, 8 Jul 2021 01:23:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyT/VjJiJ8/E+WdtolKjmi8QlCYYwY9cihzt7Mfc8Lhd158+1zx3Zvnh+jbseSpjcynsRhH X-Received: by 2002:a17:906:cb86:: with SMTP id mf6mr7251522ejb.116.1625732612062; Thu, 08 Jul 2021 01:23:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625732612; cv=none; d=google.com; s=arc-20160816; b=zC4ztSb8S365NMvweGC+jP2R6PQfgxb5f5IkZgTbgxI+Ul62cFeAUDS9daPgBa2/J7 BStEb29VC2XFupJk/B+er+FtWPsP+OjfXxEBEiJ6MTs6/a0Q55xsdehBEY6kWd7lcaZv wM7lET+EtC0jkwiKUo8nioRu0swWoyNTwUi7FCJGoKhxPz/1kswD+Iohi/2PM2gzQmYn 1D+WD4ydZwrhD80gy5+xTTdTpvhhvD67Tt2k1BJw8i0K+NfhLn8Y6a3CINvwwmGT3MMJ AFAnPv2c9fEtRey5y+Psnq5tZcYtbk73CRMQ9FVUhq2+yonWoA3QG4QIg0fp5/Mg/E3N gdag== 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=V5+/kwe9p8s6koPgaO9ZM9zyEGPWO18liSNHSwNEqMQ=; b=uahJ1An42HN2SRbIaU2+h+C6uWRkXYGyf4O4y9r86wB1B2yfQkKfVdssu3t3LFAAlm 9q/7rkjENLz74uG6lQe/R+e+NkNT+KQCec4H527Fw7gzgqvjRwqwQBcJzu6EvKhmbtFo qfSMQOYrxNeVF6JLmCZBTZ79aVucZdG124e8UAeUcnezuvIx/pVKBLJ8l3l0gxJOVIGz rEoFrv3dd/U+axnP+TAJN8120kmJBBRVKQP40BLYW7LXHSMJwXkHarMnbajh51xiwZVl 7Lo0sfhPhrjJuiEi68bYb4sUqY8uEemsefx/q+VJSWon1QkAlpiRjt+jqXAcoXEX2nuZ QMSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IKxCBj4p; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id j3si2041559ejo.404.2021.07.08.01.23.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jul 2021 01:23:32 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IKxCBj4p; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 343CD83114; Thu, 8 Jul 2021 10:23:26 +0200 (CEST) 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="IKxCBj4p"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DB5E083117; Thu, 8 Jul 2021 10:23:24 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) (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 D1B8383114 for ; Thu, 8 Jul 2021 10:23:18 +0200 (CEST) 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-wm1-x332.google.com with SMTP id i2-20020a05600c3542b02902058529ea07so3408401wmq.3 for ; Thu, 08 Jul 2021 01:23:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=V5+/kwe9p8s6koPgaO9ZM9zyEGPWO18liSNHSwNEqMQ=; b=IKxCBj4pK5rDDDKDZs5q7yG7Kv+JcIHDSVyFgFLK+oiz26fTgEZkvdJZCQzL5reEwF 0mAlnZDIiYuXROFwcUZhvWnxSy+lsmrBuSHTzoHpPvqZXmqa9OArU52uEfSWQmsLkkMv DeDpECx6mkojDdlIX4I2NJ/xaRCVtkDNQf4HsjUhKB9WfLeOA1+/V7Q6++dhRxoOq4Rh 5WZYGgj5hYrhNCBLLREq6gV1ld87pgFIrRBFLIhs4e30WVCmp++/51eTs9NR4VWhK02k bX9SzPr1JkY/e9oSzmIuIsoAbXFXqyRG2/MxF6mHOCmI6+LLZkv6SxrWAi5Io+VUlMVZ MZkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=V5+/kwe9p8s6koPgaO9ZM9zyEGPWO18liSNHSwNEqMQ=; b=ftDafjFSUCklgFRFE1n99OIIz+Q8IHk3vUkpukhDaulqghd2Pef3sAyUVHjVbJw9vO jHUQazWV1hclf0KqyoXiKzfYRVakoFjOW7ryoCaDN0mOP7Tku+DFGO+N/6lz+nJ7FXmr rxyuD4V4DbhRRbYHixGr5FbxNEeFrKmuDrixLXFFEtsgE/WH//ws/SxxmxHXsYTz+pho NDjPldhNobtO8kr3awrmH2JArRUY/A/TdwKtLl77SVmZJMZsI+fTyVekCNDhKzClfsoF bQanyPY3sd2HxstxDqRWflbSPQHy6FsEGmNy7NP7pPAkaja4qNSuGzoISKWnvL9cAoaV sGvg== X-Gm-Message-State: AOAM533h+8SyROq1CDZfXwVS3esRLghc0ZeJDf9z5BfwKWzXdl9+vGrO sgdw9Uj3Vj9JohnTBdow0iG5OG0S0/R6s4Ef X-Received: by 2002:a7b:c18d:: with SMTP id y13mr29321131wmi.88.1625732598330; Thu, 08 Jul 2021 01:23:18 -0700 (PDT) Received: from localhost.localdomain (ppp-94-66-242-227.home.otenet.gr. [94.66.242.227]) by smtp.gmail.com with ESMTPSA id z3sm1689362wrv.45.2021.07.08.01.23.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jul 2021 01:23:17 -0700 (PDT) From: Ilias Apalodimas To: xypron.glpk@gmx.de, trini@konsulko.com Cc: Ilias Apalodimas , Simon Glass , Robert Marko , Alex Nemirovsky , Stefan Roese , Sean Anderson , Weijie Gao , Bin Meng , Rayagonda Kokatanur , Stefan Bosch , Dhananjay Phadke , Masahisa Kojima , u-boot@lists.denx.de Subject: [PATCH 1/3 v3] tpm2: Introduce TIS tpm core Date: Thu, 8 Jul 2021 11:23:06 +0300 Message-Id: <20210708082310.87540-2-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210708082310.87540-1-ilias.apalodimas@linaro.org> References: <20210708082310.87540-1-ilias.apalodimas@linaro.org> 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 There's a lot of code duplication in U-Boot right now. All the TPM TIS compatible drivers we have at the moment have their own copy of a TIS implementation. So let's create a common layer which implements the core TIS functions. Any driver added from now own, which is compatible with the TIS spec, will only have to provide the underlying bus communication mechanisms. Signed-off-by: Ilias Apalodimas --- drivers/tpm/tpm2_tis_core.c | 545 ++++++++++++++++++++++++++++++++++++ drivers/tpm/tpm_tis.h | 40 +++ include/tpm-v2.h | 1 + 3 files changed, 586 insertions(+) create mode 100644 drivers/tpm/tpm2_tis_core.c -- 2.32.0.rc0 diff --git a/drivers/tpm/tpm2_tis_core.c b/drivers/tpm/tpm2_tis_core.c new file mode 100644 index 000000000000..9860ce2379e0 --- /dev/null +++ b/drivers/tpm/tpm2_tis_core.c @@ -0,0 +1,545 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2020, Linaro Limited + * + * Based on the Linux TIS core interface + */ + +#include +#include +#include +#include +#include +#include "tpm_tis.h" + +/** + * tpm_tis_get_desc - Get the TPM description + * + * @udev: udevice + * @buf: buffer to fill data + * @size: buffer size + * + * @Return: Number of characters written (or would have been written) in buffer + */ +int tpm_tis_get_desc(struct udevice *udev, char *buf, int size) +{ + struct tpm_chip *chip = dev_get_priv(udev); + + if (size < 80) + return -ENOSPC; + + return snprintf(buf, size, + "%s v2.0: VendorID 0x%04x, DeviceID 0x%04x, RevisionID 0x%02x [%s]", + udev->name, chip->vend_dev & 0xFFFF, + chip->vend_dev >> 16, chip->rid, + (chip->is_open ? "open" : "closed")); +} + +/** + * tpm_tis_check_locality - Check the current TPM locality + * + * @udev: udevice + * @loc: locality + * + * Return: True if the tested locality matches + */ +static bool tpm_tis_check_locality(struct udevice *udev, int loc) +{ + struct tpm_chip *chip = dev_get_priv(udev); + struct tpm_tis_phy_ops *phy_ops = chip->phy_ops; + u8 locality; + + if (!phy_ops) + return false; + + phy_ops->read_bytes(udev, TPM_ACCESS(loc), 1, &locality); + if ((locality & (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID | + TPM_ACCESS_REQUEST_USE)) == + (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID)) { + chip->locality = loc; + return true; + } + + return false; +} + +/** + * tpm_tis_request_locality - Request a locality from the TPM + * + * @udev: udevce + * @loc: requested locality + * + * Return: 0 on success -1 on failure + */ +int tpm_tis_request_locality(struct udevice *udev, int loc) +{ + struct tpm_chip *chip = dev_get_priv(udev); + struct tpm_tis_phy_ops *phy_ops = chip->phy_ops; + u8 buf = TPM_ACCESS_REQUEST_USE; + unsigned long start, stop; + + if (!phy_ops) + return -1; + + if (tpm_tis_check_locality(udev, loc)) + return 0; + + phy_ops->write_bytes(udev, TPM_ACCESS(loc), 1, &buf); + start = get_timer(0); + stop = chip->timeout_a; + do { + if (tpm_tis_check_locality(udev, loc)) + return 0; + mdelay(TPM_TIMEOUT_MS); + } while (get_timer(start) < stop); + + return -1; +} + +/** + * tpm_tis_status - Check the current device status + * + * @udev: udevice + * @status: return value of status + * + * Return: 0 on success, negative on failure + */ +static int tpm_tis_status(struct udevice *udev, u8 *status) +{ + struct tpm_chip *chip = dev_get_priv(udev); + struct tpm_tis_phy_ops *phy_ops = chip->phy_ops; + + if (!phy_ops) + return -EINVAL; + + if (chip->locality < 0) + return -EINVAL; + + phy_ops->read_bytes(udev, TPM_STS(chip->locality), 1, status); + + if ((*status & TPM_STS_READ_ZERO)) { + log_err("TPM returned invalid status\n"); + return -EINVAL; + } + + return 0; +} + +/** + * tpm_tis_release_locality - Release the requested locality + * + * @udev: udevice + * @loc: requested locality + * + * Return: 0 on success, negative on failure + */ +int tpm_tis_release_locality(struct udevice *udev, int loc) +{ + struct tpm_chip *chip = dev_get_priv(udev); + struct tpm_tis_phy_ops *phy_ops = chip->phy_ops; + u8 buf = TPM_ACCESS_ACTIVE_LOCALITY; + int ret; + + if (!phy_ops) + return -1; + + if (chip->locality < 0) + return 0; + + ret = phy_ops->write_bytes(udev, TPM_ACCESS(loc), 1, &buf); + if (!ret) + chip->locality = -1; + + return ret; +} + +/** + * tpm_tis_wait_for_stat - Wait for TPM to become ready + * + * @udev: udev + * @mask: mask to match + * @timeout: timeout for retries + * @status: current status + * + * Return: 0 on success, negative on failure + */ +static int tpm_tis_wait_for_stat(struct udevice *udev, u8 mask, + unsigned long timeout, u8 *status) +{ + unsigned long start = get_timer(0); + unsigned long stop = timeout; + int ret; + + do { + mdelay(TPM_TIMEOUT_MS); + ret = tpm_tis_status(udev, status); + if (ret) + return ret; + + if ((*status & mask) == mask) + return 0; + } while (get_timer(start) < stop); + + return -ETIMEDOUT; +} + +/** + * tpm_tis_get_burstcount - Get the burstcount for the data FIFO + * + * @udev: udevice + * @burstcount: current burstcount + * + * Return: 0 on success, negative on failure + */ +static int tpm_tis_get_burstcount(struct udevice *udev, size_t *burstcount) +{ + struct tpm_chip *chip = dev_get_priv(udev); + struct tpm_tis_phy_ops *phy_ops = chip->phy_ops; + unsigned long start, stop; + u32 burst; + + if (!phy_ops) + return -EINVAL; + + if (chip->locality < 0) + return -EINVAL; + + /* wait for burstcount */ + start = get_timer(0); + /* + * This is the TPMv2 defined timeout. Change this in case you want to + * make the driver compatile to TPMv1 + */ + stop = chip->timeout_a; + do { + phy_ops->read32(udev, TPM_STS(chip->locality), &burst); + *burstcount = (burst >> 8) & 0xFFFF; + if (*burstcount) + return 0; + + mdelay(TPM_TIMEOUT_MS); + } while (get_timer(start) < stop); + + return -ETIMEDOUT; +} + +/** + * tpm_tis_ready - Cancel pending comands and get the device on a ready state + * + * @udev: udevcie + * + * Return: 0 on success, negative on failure + */ +static int tpm_tis_ready(struct udevice *udev) +{ + struct tpm_chip *chip = dev_get_priv(udev); + struct tpm_tis_phy_ops *phy_ops = chip->phy_ops; + u8 data = TPM_STS_COMMAND_READY; + + if (!phy_ops) + return -1; + + /* This will cancel any pending commands */ + return phy_ops->write_bytes(udev, TPM_STS(chip->locality), 1, &data); +} + +/** + * tpm_tis_send - send data to the device + * + * @udev: udevice + * @buf: buffer to send + * @len: size of the buffer + * + * Return: number of bytes sent or negative on failure + */ +int tpm_tis_send(struct udevice *udev, const u8 *buf, size_t len) +{ + struct tpm_chip *chip = dev_get_priv(udev); + struct tpm_tis_phy_ops *phy_ops = chip->phy_ops; + size_t burstcnt, wr_size, sent = 0; + u8 data = TPM_STS_GO; + u8 status; + int ret; + + if (!phy_ops) + return -EINVAL; + + if (!chip) + return -ENODEV; + + ret = tpm_tis_request_locality(udev, 0); + if (ret < 0) + return -EBUSY; + + ret = tpm_tis_status(udev, &status); + if (ret) + goto release_locality; + + if (!(status & TPM_STS_COMMAND_READY)) { + ret = tpm_tis_ready(udev); + if (ret) { + log_err("Can't cancel previous TPM operation\n"); + goto release_locality; + } + ret = tpm_tis_wait_for_stat(udev, TPM_STS_COMMAND_READY, + chip->timeout_b, &status); + if (ret) { + log_err("TPM not ready\n"); + goto release_locality; + } + } + + while (len > 0) { + ret = tpm_tis_get_burstcount(udev, &burstcnt); + if (ret) + goto release_locality; + + wr_size = min(len, burstcnt); + ret = phy_ops->write_bytes(udev, TPM_DATA_FIFO(chip->locality), + wr_size, buf + sent); + if (ret < 0) + goto release_locality; + + ret = tpm_tis_wait_for_stat(udev, TPM_STS_VALID, + chip->timeout_c, &status); + if (ret) + goto release_locality; + + sent += wr_size; + len -= wr_size; + /* make sure the TPM expects more data */ + if (len && !(status & TPM_STS_DATA_EXPECT)) { + ret = -EIO; + goto release_locality; + } + } + + /* + * Make a final check ensuring everything is ok and the TPM expects no + * more data + */ + ret = tpm_tis_wait_for_stat(udev, TPM_STS_VALID, chip->timeout_c, + &status); + if (ret) + goto release_locality; + + if (status & TPM_STS_DATA_EXPECT) { + ret = -EIO; + goto release_locality; + } + + ret = phy_ops->write_bytes(udev, TPM_STS(chip->locality), 1, &data); + if (ret) + goto release_locality; + + tpm_tis_release_locality(udev, chip->locality); + return sent; + +release_locality: + tpm_tis_ready(udev); + tpm_tis_release_locality(udev, chip->locality); + + return ret; +} + +/** + * tpm_tis_recv_data - Receive data from a device. Wrapper for tpm_tis_recv + * + * @udev: udevice + * @buf: buffer to copy data + * @size: buffer size + * + * Return: bytes read or negative on failure + */ +static int tpm_tis_recv_data(struct udevice *udev, u8 *buf, size_t count) +{ + struct tpm_chip *chip = dev_get_priv(udev); + struct tpm_tis_phy_ops *phy_ops = chip->phy_ops; + int size = 0, len, ret; + size_t burstcnt; + u8 status; + + if (!phy_ops) + return -EINVAL; + + while (size < count && + tpm_tis_wait_for_stat(udev, TPM_STS_DATA_AVAIL | TPM_STS_VALID, + chip->timeout_c, &status) == 0) { + ret = tpm_tis_get_burstcount(udev, &burstcnt); + if (ret) + return burstcnt; + + len = min_t(int, burstcnt, count - size); + ret = phy_ops->read_bytes(udev, TPM_DATA_FIFO(chip->locality), + len, buf + size); + if (ret < 0) + return ret; + + size += len; + } + + return size; +} + +/** + * tpm_tis_recv - Receive data from a device + * + * @udev: udevice + * @buf: buffer to copy data + * @size: buffer size + * + * Return: bytes read or negative on failure + */ +int tpm_tis_recv(struct udevice *udev, u8 *buf, size_t count) +{ + struct tpm_chip *chip = dev_get_priv(udev); + int ret; + int size, expected; + + if (!chip) + return -ENODEV; + + if (count < TPM_HEADER_SIZE) + return -E2BIG; + + ret = tpm_tis_request_locality(udev, 0); + if (ret < 0) + return -EBUSY; + + size = tpm_tis_recv_data(udev, buf, TPM_HEADER_SIZE); + if (size < TPM_HEADER_SIZE) { + log_err("TPM error, unable to read header\n"); + goto out; + } + + expected = get_unaligned_be32(buf + TPM_CMD_COUNT_OFFSET); + if (expected > count) { + size = -EIO; + log_warning("Too much data: %d > %zu\n", expected, count); + goto out; + } + + size += tpm_tis_recv_data(udev, &buf[TPM_HEADER_SIZE], + expected - TPM_HEADER_SIZE); + if (size < expected) { + log(LOGC_NONE, LOGL_ERR, + "TPM error, unable to read remaining bytes of result\n"); + size = -EIO; + goto out; + } + +out: + tpm_tis_ready(udev); + tpm_tis_release_locality(udev, chip->locality); + + return size; +} + +/** tpm_tis_cleanup - Get the device in ready state and release locality + * + * @udev: udevice + * + * Return: always 0 + */ +int tpm_tis_cleanup(struct udevice *udev) +{ + struct tpm_chip *chip = dev_get_priv(udev); + + tpm_tis_ready(udev); + tpm_tis_release_locality(udev, chip->locality); + + return 0; +} + +/** + * tpm_tis_open - Open the device and request locality 0 + * + * @udev: udevice + * + * Return: 0 on success, negative on failure + */ +int tpm_tis_open(struct udevice *udev) +{ + struct tpm_chip *chip = dev_get_priv(udev); + int ret; + + if (chip->is_open) + return -EBUSY; + + ret = tpm_tis_request_locality(udev, 0); + if (!ret) + chip->is_open = 1; + + return ret; +} + +/** + * tpm_tis_ops_register - register the PHY ops for the device + * + * @udev: udevice + * @ops: bus ops for the device + */ +void tpm_tis_ops_register(struct udevice *udev, struct tpm_tis_phy_ops *ops) +{ + struct tpm_chip *chip = dev_get_priv(udev); + + chip->phy_ops = ops; +} + +/** + * tpm_tis_init - inititalize the device + * + * @udev: udevice + * + * Return: 0 on success, negative on failure + */ +int tpm_tis_init(struct udevice *udev) +{ + struct tpm_chip *chip = dev_get_priv(udev); + struct tpm_tis_phy_ops *phy_ops = chip->phy_ops; + int ret; + u32 tmp; + + if (!phy_ops) + return -1; + ret = tpm_tis_request_locality(udev, 0); + if (ret) + return ret; + + chip->timeout_a = TIS_SHORT_TIMEOUT_MS; + chip->timeout_b = TIS_LONG_TIMEOUT_MS; + chip->timeout_c = TIS_SHORT_TIMEOUT_MS; + chip->timeout_d = TIS_SHORT_TIMEOUT_MS; + + /* Disable interrupts */ + phy_ops->read32(udev, TPM_INT_ENABLE(chip->locality), &tmp); + tmp |= TPM_INTF_CMD_READY_INT | TPM_INTF_LOCALITY_CHANGE_INT | + TPM_INTF_DATA_AVAIL_INT | TPM_INTF_STS_VALID_INT; + tmp &= ~TPM_GLOBAL_INT_ENABLE; + phy_ops->write32(udev, TPM_INT_ENABLE(chip->locality), tmp); + + phy_ops->read_bytes(udev, TPM_RID(chip->locality), 1, &chip->rid); + phy_ops->read32(udev, TPM_DID_VID(chip->locality), &chip->vend_dev); + + return tpm_tis_release_locality(udev, chip->locality); +} + +/** + * tpm_tis_close - Close the device and release locality + * + * @udev: udevice + * + * Return: 0 on success, negative on failure + */ +int tpm_tis_close(struct udevice *udev) +{ + struct tpm_chip *chip = dev_get_priv(udev); + int ret = 0; + + if (chip->is_open) { + ret = tpm_tis_release_locality(udev, chip->locality); + chip->is_open = 0; + } + + return ret; +} diff --git a/drivers/tpm/tpm_tis.h b/drivers/tpm/tpm_tis.h index 2a160fe05c9a..fde3bb71f7c2 100644 --- a/drivers/tpm/tpm_tis.h +++ b/drivers/tpm/tpm_tis.h @@ -21,6 +21,37 @@ #include #include +struct tpm_tis_phy_ops { + int (*read_bytes)(struct udevice *udev, u32 addr, u16 len, + u8 *result); + int (*write_bytes)(struct udevice *udev, u32 addr, u16 len, + const u8 *value); + int (*read16)(struct udevice *udev, u32 addr, u16 *result); + int (*read32)(struct udevice *udev, u32 addr, u32 *result); + int (*write32)(struct udevice *udev, u32 addr, u32 src); +}; + +enum tis_int_flags { + TPM_GLOBAL_INT_ENABLE = 0x80000000, + TPM_INTF_BURST_COUNT_STATIC = 0x100, + TPM_INTF_CMD_READY_INT = 0x080, + TPM_INTF_INT_EDGE_FALLING = 0x040, + TPM_INTF_INT_EDGE_RISING = 0x020, + TPM_INTF_INT_LEVEL_LOW = 0x010, + TPM_INTF_INT_LEVEL_HIGH = 0x008, + TPM_INTF_LOCALITY_CHANGE_INT = 0x004, + TPM_INTF_STS_VALID_INT = 0x002, + TPM_INTF_DATA_AVAIL_INT = 0x001, +}; + +#define TPM_ACCESS(l) (0x0000 | ((l) << 12)) +#define TPM_INT_ENABLE(l) (0x0008 | ((l) << 12)) +#define TPM_STS(l) (0x0018 | ((l) << 12)) +#define TPM_DATA_FIFO(l) (0x0024 | ((l) << 12)) +#define TPM_DID_VID(l) (0x0F00 | ((l) << 12)) +#define TPM_RID(l) (0x0F04 | ((l) << 12)) +#define TPM_INTF_CAPS(l) (0x0014 | ((l) << 12)) + enum tpm_timeout { TPM_TIMEOUT_MS = 5, TIS_SHORT_TIMEOUT_MS = 750, @@ -43,6 +74,7 @@ struct tpm_chip { u8 rid; unsigned long timeout_a, timeout_b, timeout_c, timeout_d; /* msec */ ulong chip_type; + struct tpm_tis_phy_ops *phy_ops; }; struct tpm_input_header { @@ -130,4 +162,12 @@ enum tis_status { }; #endif +int tpm_tis_open(struct udevice *udev); +int tpm_tis_close(struct udevice *udev); +int tpm_tis_cleanup(struct udevice *udev); +int tpm_tis_send(struct udevice *udev, const u8 *buf, size_t len); +int tpm_tis_recv(struct udevice *udev, u8 *buf, size_t count); +int tpm_tis_get_desc(struct udevice *udev, char *buf, int size); +int tpm_tis_init(struct udevice *udev); +void tpm_tis_ops_register(struct udevice *udev, struct tpm_tis_phy_ops *ops); #endif diff --git a/include/tpm-v2.h b/include/tpm-v2.h index 247b38696766..3e48e358613f 100644 --- a/include/tpm-v2.h +++ b/include/tpm-v2.h @@ -378,6 +378,7 @@ enum { TPM_STS_DATA_EXPECT = 1 << 3, TPM_STS_SELF_TEST_DONE = 1 << 2, TPM_STS_RESPONSE_RETRY = 1 << 1, + TPM_STS_READ_ZERO = 0x23 }; enum { From patchwork Thu Jul 8 08:23:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 471211 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp46027jao; Thu, 8 Jul 2021 01:23:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxm3tkmf0AoHaGab+AkaNIyJofQ3c8dPjXGQqz6LToNiixd1VPx+7TvYi7gAaT2eTi30BO4 X-Received: by 2002:a17:906:2287:: with SMTP id p7mr6178311eja.181.1625732621316; Thu, 08 Jul 2021 01:23:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625732621; cv=none; d=google.com; s=arc-20160816; b=wf/XLy52WKsBvs+VVxVJ6Op6G6EpMUjqabvFJSu49Lq8lL0hleueS+7vvtnMg4Keg3 mEHY7pjdZjzVLiHbvgFMe4CC/XZ9sWKi9EFwYEi/Wy+SfreSNksEfm6qJo7iUPTh/S+H taFZfBrkTDiJnuDcJI88yqU6Zcb0VLDUkCClwVbc6tXcZFjZhjmfYTLxBfhwWmD/ghEK FUnX4tbPeovn3TDQfNV9Exlw+tDNKXbUNpS4lNu48oLwh2mLStq/I9qoZsZlU94ZFFXR keuxuvyfalTvIE4N+FCUNcCbvGUNotcEXrJWTDCNURBeIXXmTZh9VFEoqg7M5sdZb/0W YP2w== 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=5hkmll2ug3aLdVqribgnHYAfhnF5Tq0src3sdcXyjO8=; b=GS878g6DAQKcekvGSyuio1rdvGpPDHS0GeswSzZzQCn87RfLdnBDevbjw75O80cZcX O1G7qQji4oa+BU4ksDW+11xolyWJl/raeUyhjqNbMfH7BCw4KK/CmvEu75enGZB+/HR/ fgd1aFtwh+q/tbd54OTH04lnXxblAcrqwrGPuQyVKhWFPh3m47zyP5MhJx/HgL73Dksy 3cMdCUfLezc0s/yWg5s21HTioU+bUze5jYElKsjaNQmUFvj3LXKFp1eF5974OrATrU8p 40tPSoO3dUWmyyBqWj2pQQfkmVXqg4CQlc8QM2PJ7yWRNyGifPRq+MwWcQBWRwTiJG0s GLGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Mt/DgZNx"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id dp16si2709160ejc.454.2021.07.08.01.23.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jul 2021 01:23:41 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Mt/DgZNx"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 E38A882F36; Thu, 8 Jul 2021 10:23:32 +0200 (CEST) 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="Mt/DgZNx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AE00283139; Thu, 8 Jul 2021 10:23:30 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) (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 A7E7283124 for ; Thu, 8 Jul 2021 10:23:22 +0200 (CEST) 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-wr1-x435.google.com with SMTP id l7so5465114wrv.7 for ; Thu, 08 Jul 2021 01:23:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5hkmll2ug3aLdVqribgnHYAfhnF5Tq0src3sdcXyjO8=; b=Mt/DgZNx8yIu92W8MzOdkjZnYtcI3jA26yJFcUY1FWHtcOs5TqUgqJQrS6L0T3wofd Es9pUoBx6V5CzM38a4+PwGKhcZEcu+SSDdFbxTjD9ga/osHjcxSWzDJdrGjtqmr18eQx 1oLI9VpBe18zfu47RgF4+l/PISm8vurv5BAnQQLp0ncy6FMz+g2vZP6Ho9nx5CpEPzIi cryHcxd4qo7gZBGBKhvBWKH6clqp55tDg19zQEb2pdBoKou7nx1vNmboy2qR5E+w1MX2 9mYK7cGCoUSRFZfnWGZLWJdNFqs2KjyIqjUfKBLm2mk0T7A/SXmUzBAlA4OJ1JBlgNq2 amPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5hkmll2ug3aLdVqribgnHYAfhnF5Tq0src3sdcXyjO8=; b=Uth00OQJln1aRRC49iDljXJYab5YTwDzsv7QpfLeYihpv421viKkHPVsrP1Q3rBAzO LalSVPISenN/B4JVMuGRnNkcE4F4ZjnOWuileJcyKfu1ovSzk4A7IFpgNxbfiL5QEp3V OAmbSE43zCq4vF6tNm9vW/aPorjhs45C653U3VslHV9TrmWQ5qW1gZLMe6iaIx4l9G7u ayY5JElTYXd5Jlhks4RmxQ4JpVMhwnuFPgy3pTSMwiGfq50rle1ffh0W+PDhL/7cxcN1 DUCTM6k8sV2FtQaQkTV05Mo/peMqVOVtM4JBrM6w7EEoJkNjC6B+OkAy3/qZFZN7QC+x FAZA== X-Gm-Message-State: AOAM533dOAF16OGjsbjXgAYdd5lUTgGnsHyZqVd45Vn8nJ460rBaHkXz +DWEvcbkrHuI92CUsIVUy40q9g== X-Received: by 2002:adf:d235:: with SMTP id k21mr707074wrh.222.1625732602159; Thu, 08 Jul 2021 01:23:22 -0700 (PDT) Received: from localhost.localdomain (ppp-94-66-242-227.home.otenet.gr. [94.66.242.227]) by smtp.gmail.com with ESMTPSA id z3sm1689362wrv.45.2021.07.08.01.23.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jul 2021 01:23:21 -0700 (PDT) From: Ilias Apalodimas To: xypron.glpk@gmx.de, trini@konsulko.com Cc: Ilias Apalodimas , Simon Glass , Robert Marko , Alex Nemirovsky , Sean Anderson , Weijie Gao , Bin Meng , Rayagonda Kokatanur , Stefan Bosch , Dhananjay Phadke , Masahisa Kojima , u-boot@lists.denx.de Subject: [PATCH 2/3 v3] tpm2: Add a TPMv2 MMIO TIS driver Date: Thu, 8 Jul 2021 11:23:07 +0300 Message-Id: <20210708082310.87540-3-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210708082310.87540-1-ilias.apalodimas@linaro.org> References: <20210708082310.87540-1-ilias.apalodimas@linaro.org> 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 Add support for devices that expose a TPMv2 though MMIO. Apart from those devices, we can use the driver in our QEMU setups and test TPM related code which is difficult to achieve using the sandbox driver (e.g test the EFI TCG2 protocol). It's worth noting that a previous patch added TPMv2 TIS core functions, which the current driver is consuming. Signed-off-by: Ilias Apalodimas --- drivers/tpm/Kconfig | 9 +++ drivers/tpm/Makefile | 1 + drivers/tpm/tpm2_tis_mmio.c | 156 ++++++++++++++++++++++++++++++++++++ 3 files changed, 166 insertions(+) create mode 100644 drivers/tpm/tpm2_tis_mmio.c -- 2.32.0.rc0 diff --git a/drivers/tpm/Kconfig b/drivers/tpm/Kconfig index 9eebab5cfd90..406ee8716e1e 100644 --- a/drivers/tpm/Kconfig +++ b/drivers/tpm/Kconfig @@ -161,6 +161,15 @@ config TPM2_FTPM_TEE help This driver supports firmware TPM running in TEE. +config TPM2_MMIO + bool "MMIO based TPM2 Interface" + depends on TPM_V2 + help + This driver supports firmware TPM2.0 MMIO interface. + The usual TPM operations and the 'tpm' command can be used to talk + to the device using the standard TPM Interface Specification (TIS) + protocol. + endif # TPM_V2 endmenu diff --git a/drivers/tpm/Makefile b/drivers/tpm/Makefile index f64d20067f88..1065c1874f58 100644 --- a/drivers/tpm/Makefile +++ b/drivers/tpm/Makefile @@ -14,3 +14,4 @@ obj-$(CONFIG_$(SPL_TPL_)TPM2_CR50_I2C) += cr50_i2c.o obj-$(CONFIG_TPM2_TIS_SANDBOX) += tpm2_tis_sandbox.o obj-$(CONFIG_TPM2_TIS_SPI) += tpm2_tis_spi.o obj-$(CONFIG_TPM2_FTPM_TEE) += tpm2_ftpm_tee.o +obj-$(CONFIG_TPM2_MMIO) += tpm2_tis_core.o tpm2_tis_mmio.o diff --git a/drivers/tpm/tpm2_tis_mmio.c b/drivers/tpm/tpm2_tis_mmio.c new file mode 100644 index 000000000000..2183a2807162 --- /dev/null +++ b/drivers/tpm/tpm2_tis_mmio.c @@ -0,0 +1,156 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * driver for mmio TCG/TIS TPM (trusted platform module). + * + * Specifications at www.trustedcomputinggroup.org + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "tpm_tis.h" +#include "tpm_internal.h" + +struct tpm_tis_chip_data { + unsigned int pcr_count; + unsigned int pcr_select_min; + unsigned int time_before_first_cmd_ms; + void __iomem *iobase; +}; + +static int mmio_read_bytes(struct udevice *udev, u32 addr, u16 len, + u8 *result) +{ + struct tpm_tis_chip_data *drv_data = (void *)dev_get_driver_data(udev); + + while (len--) + *result++ = ioread8(drv_data->iobase + addr); + return 0; +} + +static int mmio_write_bytes(struct udevice *udev, u32 addr, u16 len, + const u8 *value) +{ + struct tpm_tis_chip_data *drv_data = (void *)dev_get_driver_data(udev); + + while (len--) + iowrite8(*value++, drv_data->iobase + addr); + return 0; +} + +static int mmio_read16(struct udevice *udev, u32 addr, u16 *result) +{ + struct tpm_tis_chip_data *drv_data = (void *)dev_get_driver_data(udev); + + *result = ioread16(drv_data->iobase + addr); + return 0; +} + +static int mmio_read32(struct udevice *udev, u32 addr, u32 *result) +{ + struct tpm_tis_chip_data *drv_data = (void *)dev_get_driver_data(udev); + + *result = ioread32(drv_data->iobase + addr); + return 0; +} + +static int mmio_write32(struct udevice *udev, u32 addr, u32 value) +{ + struct tpm_tis_chip_data *drv_data = (void *)dev_get_driver_data(udev); + + iowrite32(value, drv_data->iobase + addr); + return 0; +} + +static struct tpm_tis_phy_ops phy_ops = { + .read_bytes = mmio_read_bytes, + .write_bytes = mmio_write_bytes, + .read16 = mmio_read16, + .read32 = mmio_read32, + .write32 = mmio_write32, +}; + +static int tpm_tis_probe(struct udevice *udev) +{ + struct tpm_tis_chip_data *drv_data = (void *)dev_get_driver_data(udev); + struct tpm_chip_priv *priv = dev_get_uclass_priv(udev); + int ret = 0; + fdt_addr_t ioaddr; + u64 sz; + + ioaddr = dev_read_addr(udev); + if (ioaddr == FDT_ADDR_T_NONE) + return -EINVAL; + + ret = dev_read_u64(udev, "reg", &sz); + if (ret) + return -EINVAL; + + drv_data->iobase = ioremap(ioaddr, sz); + log_info("Remapped TPM2 base: 0x%llx size: 0x%llx\n", ioaddr, sz); + tpm_tis_ops_register(udev, &phy_ops); + ret = tpm_tis_init(udev); + if (ret) + goto iounmap; + + priv->pcr_count = drv_data->pcr_count; + priv->pcr_select_min = drv_data->pcr_select_min; + /* + * Although the driver probably works with a TPMv1 our Kconfig + * limits the driver to TPMv2 only + */ + priv->version = TPM_V2; + + return ret; +iounmap: + iounmap(drv_data->iobase); + return -EINVAL; +} + +static int tpm_tis_remove(struct udevice *udev) +{ + struct tpm_tis_chip_data *drv_data = (void *)dev_get_driver_data(udev); + + iounmap(drv_data->iobase); + return tpm_tis_cleanup(udev); +} + +static const struct tpm_ops tpm_tis_ops = { + .open = tpm_tis_open, + .close = tpm_tis_close, + .get_desc = tpm_tis_get_desc, + .send = tpm_tis_send, + .recv = tpm_tis_recv, + .cleanup = tpm_tis_cleanup, +}; + +static const struct tpm_tis_chip_data tpm_tis_std_chip_data = { + .pcr_count = 24, + .pcr_select_min = 3, +}; + +static const struct udevice_id tpm_tis_ids[] = { + { + .compatible = "tcg,tpm-tis-mmio", + .data = (ulong)&tpm_tis_std_chip_data, + }, + { } +}; + +U_BOOT_DRIVER(tpm_tis_mmio) = { + .name = "tpm_tis_mmio", + .id = UCLASS_TPM, + .of_match = tpm_tis_ids, + .ops = &tpm_tis_ops, + .probe = tpm_tis_probe, + .remove = tpm_tis_remove, + .priv_auto = sizeof(struct tpm_chip), +}; From patchwork Thu Jul 8 08:23:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 471212 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp46135jao; Thu, 8 Jul 2021 01:23:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCke8NFCCeteq5wKVLbJmI3X9J07rt+KVwXhiGMwOjOy+bCRLKx39x2kcpUIRKSV6BZ2AU X-Received: by 2002:a17:906:51d4:: with SMTP id v20mr9583335ejk.107.1625732630969; Thu, 08 Jul 2021 01:23:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625732630; cv=none; d=google.com; s=arc-20160816; b=sWZzZZQK3ZsWoBuF8qdVyu0NFseBOFRZCasXbOX9OkxzvtxodiSgB0kfGtkdyMXn0h OauCXdmBrJaDfzkPkm1i8vakccLYaxVAfF8evnwF6CCXavOCGX0Xiq/xbcNP+fGSFf/3 I58nqM8/KWFyMheNDoHXwGjW8LqSczXdYoh7jcy5MNpXcgXK86OehwzGxfs9ZZVcHms3 kf85GqtGcOrXfvHg/mvtZq5eCAWDWJL6TP2NaYQ6kz3XlI1FZuekbbO2f6PEUytySioJ iNjHjdoBtc3MLUAHYq+BQVnJZLJLHpOqtChBPU1E07ABOxt4upCG+JCtLB8P4N4CTS80 vrog== 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=3Hxhueh1yOJ4tD6dqCMZaj30op6y2pMPkDJ7TnMKGlc=; b=fOGDxgj5H2/lP3glVlqr6Z+Fiv8TVp8g9KxPWdWaAsiVgJRgoRKeHt51AvW2C7u54h jOedAJJ+Xu66E0gFtc3JoEt4Baq0dRP902jM6GoNSsH2OJYgcsoqgG805tIMhQlGokde TJiJcgchqs34Bvpzcp254WZctkcKtOLHzEHxL9WZB5K0STOvJqbBTTvh5xcwpI4Vn1mM TbCOcce4qW5FhRVvWOlFB4kNsq7pVSmCqN9/4/WUc07ejbKUZnsYETj39k7fkvaYgzan cqJKhCTbXTBKOkApN5537+u6Oa70x79lLLF/rhPJwMXLXyOBCynqjK+cFooPXxsalQBf 5lWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uwLJBeRK; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id h9si2121691eje.11.2021.07.08.01.23.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jul 2021 01:23:50 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uwLJBeRK; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 1A97483134; Thu, 8 Jul 2021 10:23:36 +0200 (CEST) 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="uwLJBeRK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ABAA28313E; Thu, 8 Jul 2021 10:23:31 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) (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 7152783137 for ; Thu, 8 Jul 2021 10:23:26 +0200 (CEST) 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-wr1-x435.google.com with SMTP id i94so6410385wri.4 for ; Thu, 08 Jul 2021 01:23:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3Hxhueh1yOJ4tD6dqCMZaj30op6y2pMPkDJ7TnMKGlc=; b=uwLJBeRKTdEQuoo0Q2YhvDlBmkIdq3ASzQxwAMfalBKqCgbPE3Phr/BQOqzYbDq4Gi fzffEscJ8SVvpyQCFfK04aUrC/GKHMIxy2o2TJukPGFW1VExWK3+waLGHhfanRd0/Qr3 R70mlpBbyJp9GKZWPiu4xWro2IQB9Dklq8XO6Np65hY4M3nNmN652KOFCgD6zKsHkOje jzjOekSGQ6hMQKEO0iOK+S3Ay98NC/PohajTFPkT29JCc8qsppAeofSs1dnEXwZ7ireC clnp+zVy/WoUrchnVY0D4RWSfx5vf7Mr2nwDgcu0jb8GvpoBOp9SvoGZ53pwk5uA5+r/ qN4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3Hxhueh1yOJ4tD6dqCMZaj30op6y2pMPkDJ7TnMKGlc=; b=h8bzSupqZ/uTNVik+jCoXAjVH8iZZKL/MCqQlWTmWmn62npSpJ3jxPNojs83HAraUb 33Z7XS+FR8xcNRDl+rFeTzvbObOSUyxRdtjMaRYk1OJiLGhYvPGKZem5uTkR9GadIFfq mZ7iCILQKYeR//Dx4+fvKyrGJ7OGrGOHMta+lzRDG1LH1ZjN3vBX7LnMZwxGrf80YIbj 5X65nOuW/T7VjeKGWnhxeDMRKuYC7juOlMLWOMvk3UufOdpF/b03w1XZio7Y46cIcDIj jMmP7/HklNpL/3bhOs39ipULHhUcLQmDYlKJO68dE6hM+ZtZiKYqOTvUIr4S2qPS7aK8 AL4w== X-Gm-Message-State: AOAM531HsiByGCQV7NmdJpcfz1eGe2XJmGnQK0GXsfBspSveL80CYXtQ fjGFo/6A0beb7LS+Yrcqw7Lvww== X-Received: by 2002:a05:6000:1b90:: with SMTP id r16mr25131813wru.316.1625732606013; Thu, 08 Jul 2021 01:23:26 -0700 (PDT) Received: from localhost.localdomain (ppp-94-66-242-227.home.otenet.gr. [94.66.242.227]) by smtp.gmail.com with ESMTPSA id z3sm1689362wrv.45.2021.07.08.01.23.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jul 2021 01:23:25 -0700 (PDT) From: Ilias Apalodimas To: xypron.glpk@gmx.de, trini@konsulko.com Cc: Ilias Apalodimas , Simon Glass , Robert Marko , Alex Nemirovsky , Sean Anderson , Weijie Gao , Bin Meng , Rayagonda Kokatanur , Stefan Bosch , Dhananjay Phadke , Masahisa Kojima , u-boot@lists.denx.de Subject: [PATCH 3/3 v3] MAINTAINERS: Add entry for TPM drivers Date: Thu, 8 Jul 2021 11:23:08 +0300 Message-Id: <20210708082310.87540-4-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.32.0.rc0 In-Reply-To: <20210708082310.87540-1-ilias.apalodimas@linaro.org> References: <20210708082310.87540-1-ilias.apalodimas@linaro.org> 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 TPM drivers have currently no maintainers. Add myself since I contributed the TIS implementation. Signed-off-by: Ilias Apalodimas --- MAINTAINERS | 5 +++++ 1 file changed, 5 insertions(+) -- 2.32.0.rc0 Reviewed-by: Heinrich Schuchardt Reviewed-by: Simon Glass diff --git a/MAINTAINERS b/MAINTAINERS index 11e11d51a7da..d67e22401cf4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1142,6 +1142,11 @@ F: configs/am65x_hs_evm_a53_defconfig F: configs/j721e_hs_evm_r5_defconfig F: configs/j721e_hs_evm_a72_defconfig +TPM DRIVERS +M: Ilias Apalodimas +S: Maintained +F: drivers/tpm/ + TQ GROUP #M: Martin Krause S: Orphaned (Since 2016-02)