* [PATCH] crypto: caam: don't build blobgen helper without the CAAM driver
@ 2026-12-01 9:07 Alexander Shiyan
0 siblings, 0 replies; only message in thread
From: Alexander Shiyan @ 2026-12-01 9:07 UTC (permalink / raw)
To: barebox; +Cc: Alexander Shiyan
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-12-01 10:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 9:07 [PATCH] crypto: caam: don't build blobgen helper without the CAAM driver Alexander Shiyan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox