From patchwork Mon Dec 8 02:32:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 848 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161240; bh=QhX9+GvLZ4KEYhd2lx4baCvMcN8N+ada6axkIcPPqCQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=VGGOji14NjVLQwpz8kuoz5xL5iS/wGpCOouBgdpO13tjer0yfbnJ5kZIUGp1NnSKR DAhwPFN28bevB+dL2tGJcGtcsLQubFZviuslyaAy+T826NXykH4EysuzowZgKBvhfg irSz11CAAJlfYqBBmT70VUyfw2enSTtueQowqMu0scwrRnmkBRowcx9B87GMSLFe4w N4kNITWYXyakNwc05oEO+CxWvKG4NMP4eWsNNG/9xxBJlKB7oeR/k/XgGBfYmonEGR RG4qJuCCDETkEFeg+qz2WOUs7eFcaLIHVXgQeQhb0afeKL0WJuiGuvg26BSxF/CgmX 5OTf9EuTIlaEg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DC32F689D0 for ; Sun, 7 Dec 2025 19:34:00 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id SxqCQDymyubR for ; Sun, 7 Dec 2025 19:34:00 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161240; bh=QhX9+GvLZ4KEYhd2lx4baCvMcN8N+ada6axkIcPPqCQ=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=VGGOji14NjVLQwpz8kuoz5xL5iS/wGpCOouBgdpO13tjer0yfbnJ5kZIUGp1NnSKR DAhwPFN28bevB+dL2tGJcGtcsLQubFZviuslyaAy+T826NXykH4EysuzowZgKBvhfg irSz11CAAJlfYqBBmT70VUyfw2enSTtueQowqMu0scwrRnmkBRowcx9B87GMSLFe4w N4kNITWYXyakNwc05oEO+CxWvKG4NMP4eWsNNG/9xxBJlKB7oeR/k/XgGBfYmonEGR RG4qJuCCDETkEFeg+qz2WOUs7eFcaLIHVXgQeQhb0afeKL0WJuiGuvg26BSxF/CgmX 5OTf9EuTIlaEg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CC56768900 for ; Sun, 7 Dec 2025 19:34:00 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161238; bh=BKkHAzXt1oSfNL0lXugh7DSntmcI/6cb6gIfIGP9lLE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NwsiyD9GVKiyf7D82Xa85zDjkHwK2l4c42EVDBDKwEnM0fpxwe8tSzUF/t0J9lQdF eyJYdilsTR0EVu/CLZXq1SjgkwbirXTrOTlXhAaM6EFGr5eYqHQEPhLZjznVE36/FJ GnAi+iQheCGgfaVFyGUNAU7LERzoe5+Gj9RWUiv3IOmffnaZEKvv/YMYDDGNHDAPBC f7w0Yy+Ryk5t5x1k9AgcerGJ9gjXvk+aGEUbIsRE8UFQD9Cu8mCLw75XhuR/7jPemK S+mUJ6msu4YyeAaO+vsOC6lno2mv5oGgMTb7U9dLasagGcVL7DI9P5eIIPepH4n7OK 8YFq2e/BJ+tbQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D03EA68930; Sun, 7 Dec 2025 19:33:58 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id b51XRgzK67Pl; Sun, 7 Dec 2025 19:33:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765161234; bh=Xvv0cPGIqp+iiq44jhlhFJpnRZ5/TaqCaAgLL6yM/68=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bkJv1Rh7AbzYfuJdJCOIkiQPa7vUdFvpFTsrd5qFfkCPv4zmWgqWGjo92V75L96rp shqVdb9fK360bdmij8O1TKYjifc0wQhTEZiR9qOqsB2OlIItVCCoyRyExsq6EBXtFf CdxNMMADcN2bV0jARl3f6nSbyEhn8KuQLwIsWOMxZJKRY62Vdobs+BsF/kpfDsUHHN JYdqkflQSPJ0vrycI4WEPC4E1JRNqS8+XpOKYgln8NHhDYsY7thOwahwaAa4XwafIg EpCFbWT4JCkrMUSjKNHPOPd4PJ2Nh44PgYk601eZ0HYfZVa+x1A86OGniNUADSp/7L /hktZ3wxzFhHw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id D5A3568900; Sun, 7 Dec 2025 19:33:53 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 19:32:18 -0700 Message-ID: <20251208023229.3929910-16-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251208023229.3929910-1-sjg@u-boot.org> References: <20251208023229.3929910-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: WA5NVTH2COMTS7HA2VOX37MT4TCYWFKM X-Message-ID-Hash: WA5NVTH2COMTS7HA2VOX37MT4TCYWFKM X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 15/19] tkey: Allow using the selected TKey from luks List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Export the function which sets the current TKey so that the luks command can work with 'tkey connect'. Signed-off-by: Simon Glass --- cmd/tkey.c | 2 +- include/tkey.h | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cmd/tkey.c b/cmd/tkey.c index 3a31712990a..a1a382bac0c 100644 --- a/cmd/tkey.c +++ b/cmd/tkey.c @@ -22,7 +22,7 @@ /* Static device pointer set by tkey connect command */ static struct udevice *tkey_dev; -static struct udevice *tkey_get_device(void) +struct udevice *tkey_get_device(void) { struct udevice *dev; int ret; diff --git a/include/tkey.h b/include/tkey.h index e610d91140c..418b6aca7d2 100644 --- a/include/tkey.h +++ b/include/tkey.h @@ -327,4 +327,11 @@ int tkey_emul_set_app_mode_for_test(struct udevice *dev, bool app_mode); */ int tkey_emul_set_connected_for_test(struct udevice *dev, bool connected); +/** + * tkey_get_device() - Get the current TKey device + * + * Return: Pointer to TKey device, or NULL if not found + */ +struct udevice *tkey_get_device(void); + #endif /* _TKEY_UCLASS_H */