From: Alexander Shiyan <eagle.alexander923@gmail.com>
To: barebox@lists.infradead.org
Cc: Alexander Shiyan <eagle.alexander923@gmail.com>
Subject: [PATCH] crypto: caam: don't build blobgen helper without the CAAM driver
Date: Tue, 1 Dec 2026 12:07:37 +0300 [thread overview]
Message-ID: <20261201090737.124059-1-eagle.alexander923@gmail.com> (raw)
caam-blobgen.o is an integral part of the CAAM driver: it calls into
caam_jr_enqueue() and uses the caam_little_end, caam_imx and caam_ptr_sz
globals, all of which are provided by ctrl.o/jr.o. It was nevertheless
built whenever the generic CONFIG_BLOBGEN core was enabled, so a
COMPILE_TEST configuration with BLOBGEN=y and CRYPTO_DEV_FSL_CAAM=n
failed to link:
ld: caam-blobgen.c:(.text+0x4ea): undefined reference to
`caam_little_end'
ld: caam-blobgen.c:(.text+0xdde): undefined reference to `caam_imx'
ld: caam-blobgen.c:(.text+0x7e4): undefined reference to `caam_ptr_sz'
The reverse combination is fine, so introduce a hidden symbol expressing
the conjunction of both and use it for the Makefile entry and for the
call site in caam_probe(), which previously compiled a call to a
non-existent caam_blob_gen_probe() in the same configuration.
Fixes: 1e951027d89c ("crypto: caam: add blobgen driver")
Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
---
drivers/crypto/caam/Kconfig | 9 +++++++++
drivers/crypto/caam/Makefile | 2 +-
drivers/crypto/caam/ctrl.c | 2 +-
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/caam/Kconfig b/drivers/crypto/caam/Kconfig
index e7f57708f3..137e6e908a 100644
--- a/drivers/crypto/caam/Kconfig
+++ b/drivers/crypto/caam/Kconfig
@@ -38,3 +38,12 @@ config CRYPTO_DEV_FSL_CAAM_RNG
config FSL_CAAM_RNG_PBL_INIT
bool "Setup CAAM in EL3"
depends on ARCH_IMX8M
+
+config CRYPTO_DEV_FSL_CAAM_BLOB_GEN
+ def_bool BLOBGEN
+ depends on CRYPTO_DEV_FSL_CAAM
+ help
+ The CAAM blob generator is an integral part of the CAAM driver
+ and needs the blobgen core, but it must not be built when the
+ CAAM driver itself is disabled, as it references CAAM internals.
+ This hidden symbol expresses the conjunction of both.
diff --git a/drivers/crypto/caam/Makefile b/drivers/crypto/caam/Makefile
index 5ab7892d95..1427cfbdcc 100644
--- a/drivers/crypto/caam/Makefile
+++ b/drivers/crypto/caam/Makefile
@@ -5,5 +5,5 @@
obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM) += ctrl.o error.o jr.o
obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM_RNG) += caamrng.o
obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM) += rng_self_test.o
-obj-$(CONFIG_BLOBGEN) += caam-blobgen.o
+obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM_BLOB_GEN) += caam-blobgen.o
pbl-$(CONFIG_FSL_CAAM_RNG_PBL_INIT) += pbl-init.o
diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c
index 24a01ca094..73529ec33d 100644
--- a/drivers/crypto/caam/ctrl.c
+++ b/drivers/crypto/caam/ctrl.c
@@ -665,7 +665,7 @@ static int caam_probe(struct device *dev)
}
}
- if (IS_ENABLED(CONFIG_BLOBGEN)) {
+ if (IS_ENABLED(CONFIG_CRYPTO_DEV_FSL_CAAM_BLOB_GEN)) {
ret = caam_blob_gen_probe(dev, ctrlpriv->jrpdev[0]);
if (ret) {
dev_err(dev, "failed to instantiate blobgen device");
--
2.54.0
reply other threads:[~2026-12-01 10:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261201090737.124059-1-eagle.alexander923@gmail.com \
--to=eagle.alexander923@gmail.com \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox