{"id":2235242,"url":"http://patchwork.ozlabs.org/api/1.2/patches/2235242/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/ae30e01390285556c4de8ee9289d462c0b59f22b.1778277334.git.aidan@wolfssl.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/1.2/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<ae30e01390285556c4de8ee9289d462c0b59f22b.1778277334.git.aidan@wolfssl.com>","list_archive_url":null,"date":"2026-05-09T00:04:08","name":"[v3,01/12] tpm: export tpm_show_device, tpm_set_device, and get_tpm","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"074e2dd5aa27a90d74db25000f38250d52ada0c0","submitter":{"id":92785,"url":"http://patchwork.ozlabs.org/api/1.2/people/92785/?format=json","name":"Aidan Garske","email":"aidan@wolfssl.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/ae30e01390285556c4de8ee9289d462c0b59f22b.1778277334.git.aidan@wolfssl.com/mbox/","series":[{"id":503464,"url":"http://patchwork.ozlabs.org/api/1.2/series/503464/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=503464","date":"2026-05-09T00:04:07","name":"tpm: Add wolfTPM library support for TPM 2.0","version":3,"mbox":"http://patchwork.ozlabs.org/series/503464/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2235242/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2235242/checks/","tags":{},"related":[],"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=wolfssl-com.20251104.gappssmtp.com\n header.i=@wolfssl-com.20251104.gappssmtp.com header.a=rsa-sha256\n header.s=20251104 header.b=AVXB9SM4;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=fail (p=none dis=none) header.from=wolfssl.com","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=wolfssl-com.20251104.gappssmtp.com\n header.i=@wolfssl-com.20251104.gappssmtp.com header.b=\"AVXB9SM4\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=fail (p=none dis=none) header.from=wolfssl.com","phobos.denx.de;\n spf=pass smtp.mailfrom=aidan@wolfssl.com"],"Received":["from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4gC6bH0Ny2z1yCg\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 09 May 2026 10:40:27 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 3150C84E05;\n\tSat,  9 May 2026 02:40:14 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 367BC84E02; Sat,  9 May 2026 02:04:39 +0200 (CEST)","from mail-dl1-x122b.google.com (mail-dl1-x122b.google.com\n [IPv6:2607:f8b0:4864:20::122b])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id C26E384E0B\n for <u-boot@lists.denx.de>; Sat,  9 May 2026 02:04:36 +0200 (CEST)","by mail-dl1-x122b.google.com with SMTP id\n a92af1059eb24-12e332315a8so4194842c88.0\n for <u-boot@lists.denx.de>; Fri, 08 May 2026 17:04:36 -0700 (PDT)","from localhost.localdomain ([207.231.76.218])\n by smtp.gmail.com with ESMTPSA id\n a92af1059eb24-132787673ffsm5505030c88.15.2026.05.08.17.04.34\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 08 May 2026 17:04:34 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"*","X-Spam-Status":"No, score=1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_SBL_CSS,SPF_HELO_NONE,\n SPF_PASS autolearn=no autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=wolfssl-com.20251104.gappssmtp.com; s=20251104; t=1778285075; x=1778889875;\n darn=lists.denx.de;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=2o4rlL6GsBQtVdjKYp4BzTjCiK4suS7EC40S8T/+Wlo=;\n b=AVXB9SM4yFu/Ij1dp0SmnVJgHgdNcDXK12Ee8H6XtzBBIR+iajFfmWbSzdlEQQsFEq\n fO63BztjAbDtb2ByMjV8QDG5asw0lhh9yoxpnZkCDIPOy5duFJkoQELdYgwtnrZYJJVk\n x9oAWTrqt9WJaY1HgdjztAyVLXUv7EjSyDjUq/hFxFXDVfUb49pCk7nUZ+Ay06V/kSQz\n Ys5x3oD4PaoGrDWiR0KaY20M73gLRcfUyJ4VdD/whfLc4+zE10NpUnIzRFFq72j5kNYL\n XbbtwtvOwKDcvOzTdU0Tw+8AjWYLpVwTcauqPAZRkUdfr6LIMHcjBeLQPufK+VNKexNk\n haIA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1778285075; x=1778889875;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=2o4rlL6GsBQtVdjKYp4BzTjCiK4suS7EC40S8T/+Wlo=;\n b=O3ZiIgfNir8YoXZFlOcD2mPFMy0ILYKFflFRMkgyrwx/yPAO0FK9jedyk+h2fYihtZ\n e0gaEXRSz0nvXawO53oVPFd656Mc16CKiF7aGJyNxGIUCRj9R2OkYHcPo5U/sVTXO97M\n 418CZe4ORTN59t5v4D50eheGEjOXZLutmtYv4/kjHUz7/fi8gkkEac7blcqAb2OgrzUe\n FSrkw8u2pGxmLB7XDxTqWCo9OEDH6+mwE8V8YT++nbjOLEDxdeYx4Ve8JWyJOyqrKkSZ\n SVnYEJac8KD/YOeCSpEnFhC1hJUq+wpbcXsE3IwtxFgQPJ5z8q7uyd4X7Qxfo/B4kGTt\n HB7A==","X-Gm-Message-State":"AOJu0YyYbcll4wxXxXVbt86GnqLnc9iOp9DcdbUMNmmwWXZKbnJefm4K\n ySnuI6lYnKihwwXGd5NL92H/GnVwbF2POmnUHT0bxByA6Rj9eHnkI86pVjv0pOnRL8n0QQLaQgy\n Fg2m1","X-Gm-Gg":"AeBDieuk5u4+sxrg4iC/a6N5h1QkkuD0RvTg7jrKFilGT3WKfn3TOvkaPPfJEHFiJW9\n /g+D2vtpemEdndimJouuS2RS5VBNuJI2PCZ67qznrSqbA/p5bbkejjeygawbiaVN+ix1QJcCfl8\n Zs9iPu8UPgmJVkrAxq39qe15DA0hAxrFMxH1YmrADLjSiMyOoQy72PJHu4BnJZ6A81wycpyEnHe\n YUnr9wkxOqJX3RyP0SFQRNcRBRv7vo+AnWEoFAHynHC5Ksj2wZGdtc0lhywmeq9rv/8iGqCdgoe\n DJw/O9+n+qH3zT155zUY1Lufae69XlLpahfYTJ0phEoRSNzT0knEDsA8puvJQNYCUrc9w5oVaJ2\n BSXaS6hlveE2njnLzPGKnzxkzgy5y5AQFW7POhdiQbIZfYL/107wBKeImVOy8qTofNVODlK7e7I\n IouLIGGK4dDTf0No5yB//NfxiXcC7nbc9JxuT9T4I38Gm/kQKhKckEIItaRjpKCKJ1zjNDCWS8S\n YOW6Y+8P4HzWKG42XEHhcvbCqGuHjEE","X-Received":"by 2002:a05:7022:6997:b0:12f:1f67:e743 with SMTP id\n a92af1059eb24-132a83ee5c2mr240403c88.40.1778285074811;\n Fri, 08 May 2026 17:04:34 -0700 (PDT)","From":"Aidan Garske <aidan@wolfssl.com>","To":"u-boot@lists.denx.de","Cc":"David Garske <david@wolfssl.com>,\n Ilias Apalodimas <ilias.apalodimas@linaro.org>","Subject":"[PATCH v3 01/12] tpm: export tpm_show_device, tpm_set_device,\n and get_tpm","Date":"Fri,  8 May 2026 17:04:08 -0700","Message-ID":"\n <ae30e01390285556c4de8ee9289d462c0b59f22b.1778277334.git.aidan@wolfssl.com>","X-Mailer":"git-send-email 2.47.3","In-Reply-To":"<cover.1778277334.git.aidan@wolfssl.com>","References":"<cover.1778277334.git.aidan@wolfssl.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-Mailman-Approved-At":"Sat, 09 May 2026 02:40:11 +0200","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"},"content":"From: Aidan <aidan@wolfssl.com>\n\nRemove static scope from tpm_show_device(), tpm_set_device(), and\nget_tpm() in cmd/tpm-common.c so they can be called from other\ntranslation units. Add corresponding declarations to\ninclude/tpm-common.h.\n\nwolfTPM's command backend needs these functions for device enumeration\nand selection when operating through U-Boot's driver model.\n\nSigned-off-by: Aidan Garske <aidan@wolfssl.com>\n---\n cmd/tpm-common.c     |  4 ++--\n include/tpm-common.h | 22 ++++++++++++++++++++++\n 2 files changed, 24 insertions(+), 2 deletions(-)","diff":"diff --git a/cmd/tpm-common.c b/cmd/tpm-common.c\nindex 1cd57f901b6..30e99e10758 100644\n--- a/cmd/tpm-common.c\n+++ b/cmd/tpm-common.c\n@@ -234,7 +234,7 @@ int type_string_write_vars(const char *type_str, u8 *data,\n \treturn 0;\n }\n \n-static int tpm_show_device(void)\n+int tpm_show_device(void)\n {\n \tstruct udevice *dev;\n \tchar buf[80];\n@@ -253,7 +253,7 @@ static int tpm_show_device(void)\n \treturn 0;\n }\n \n-static int tpm_set_device(unsigned long num)\n+int tpm_set_device(unsigned long num)\n {\n \tstruct udevice *dev;\n \tunsigned long n = 0;\ndiff --git a/include/tpm-common.h b/include/tpm-common.h\nindex bfb84a931d1..1ea4463fbbe 100644\n--- a/include/tpm-common.h\n+++ b/include/tpm-common.h\n@@ -337,4 +337,26 @@ enum tpm_version tpm_get_version(struct udevice *dev);\n /* Iterate on all TPM devices */\n #define for_each_tpm_device(dev) uclass_foreach_dev_probe(UCLASS_TPM, (dev))\n \n+/**\n+ * tpm_show_device() - Show all TPM devices\n+ *\n+ * Return: 0 on success, -ve on failure\n+ */\n+int tpm_show_device(void);\n+\n+/**\n+ * tpm_set_device() - Set the TPM device to use\n+ *\n+ * @num: The number of the TPM device to use\n+ * Return: 0 on success, -ve on failure\n+ */\n+int tpm_set_device(unsigned long num);\n+\n+/**\n+ * get_tpm() - Get the TPM device\n+ *\n+ * Return: 0 on success, -ve on failure\n+ */\n+int get_tpm(struct udevice **devp);\n+\n #endif /* __TPM_COMMON_H */\n","prefixes":["v3","01/12"]}