CAAM not working on imx7d

cancel
Showing results for 
Search instead for 
Did you mean: 

CAAM not working on imx7d

83 Views
Contributor IV

Hello Everyone, 

My company is working on imx7d based board. I want to use CAAM.

1. I have enabled CAAM related Configs as given in imx-test suite shown as below:

CONFIG_CRYPTO_DEV_FSL_CAAM=y
CONFIG_CRYPTO_DEV_FSL_CAAM_SM=y
CONFIG_CRYPTO_DEV_FSL_CAAM_SM_TEST=y
CONFIG_CRYPTO_DEV_FSL_CAAM_SECVIO=y
CONFIG_CRYPTO_DEV_MXS_DCP=y
CONFIG_CRYPTO_USER_API=y
CONFIG_CRYPTO_USER_API_HASH=y
CONFIG_CRYPTO_USER_API_SKCIPHER=y
CONFIG_CRYPTO_USER_API_RNG=y
CONFIG_CRYPTO_USER_API_AEAD=y
CONFIG_CRYPTO_AEAD=y
CONFIG_CRYPTO_AUTHENC=y
CONFIG_CRYPTO_DEV_FSL_CAAM_RINGSIZE=9
CONFIG_CRYPTO_DEV_FSL_CAAM_INTC=y
CONFIG_CRYPTO_DEV_FSL_CAAM_INTC_COUNT_THLD=255
CONFIG_CRYPTO_DEV_FSL_CAAM_INTC_TIME_THLD=2048
CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API=y
CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API=y
CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=n

2. I have set bootargs=caam, my environment variables

=> printenv
baudrate=115200
bootargs=caam
bootcmd=mmc dev ${mmcdev};if mmc rescan; then run mmcargs; if run loadimage; then if run loadfdt; then if test ${tee} = yes; then if run loadtee; then bootm ${tee_addr} - ${fdt_addr}; else echo ERROR: Failed to load uTee; fi; else bootz ${loadaddr} - ${fdt_addr}; fi; else echo ERROR: Failed to load FDT; fi; else echo ERROR: Failed to load zImage; fi; fi;
bootcmd_mfg=run mfgtool_args;if iminfo ${initrd_addr}; then if test ${tee} = yes; then bootm ${tee_addr} ${initrd_addr} ${fdt_addr}; else bootz ${loadaddr} ${initrd_addr} ${fdt_addr}; fi; else echo "Run fastboot ..."; fastboot 0; fi;
bootdelay=3
console=ttymxc0,115200
dfu_alt_info=image raw 0 0x800000;u-boot raw 0 0x4000;bootimg part 0 1;rootfs part 0 2
emmc_dev=0
fdt_addr=0x83000000
fdt_file=imx7d.dtb
fdt_high=0xFFFFFFFF
image=zImage.hab
initrd_addr=0x86800000
initrd_high=0xffffffff
kboot=bootz
loadaddr=0x80800000
loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}
loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}
loadm4image=fatload mmc ${mmcdev}:${mmcpart} 0x7F8000 ${m4image}
loadtee=fatload mmc ${mmcdev}:${mmcpart} ${tee_addr} ${tee_file}
m4boot=run loadm4image; bootaux 0x7F8000
m4image=m4_qspi.bin
mfgtool_args=setenv bootargs console=${console},${baudrate} rdinit=/linuxrc clk_ignore_unused
mmcargs=setenv bootargs splash plymouth.ignore-serial-consoles fbcon=map:01 console=${console} root=${mmcroot} vt.global_cursor_default=0
mmcautodetect=yes
mmcboot=echo Booting from mmc ...; run mmcargs; if run loadfdt; then bootz ${loadaddr} - ${fdt_addr}; else echo ERROR: Failed to load FDT; fi;
mmcdev=0
mmcpart=1
mmcroot=/dev/mmcblk2p2 rootwait rw
panel=ET035VBBW3
sd_dev=0
tee=no

I can see /proc/crypto directory is created, but /dev/crypto directory is not created.

While booting I see the following logs

alg: No test for authenc(hmac(sha224),ecb(cipher_null)) (authenc-hmac-sha224-ecb-cipher_null-caam)
alg: No test for authenc(hmac(sha256),ecb(cipher_null)) (authenc-hmac-sha256-ecb-cipher_null-caam)
alg: No test for authenc(hmac(md5),cbc(aes)) (authenc-hmac-md5-cbc-aes-caam)
alg: No test for echainiv(authenc(hmac(md5),cbc(aes))) (echainiv-authenc-hmac-md5-cbc-aes-caam)
alg: No test for echainiv(authenc(hmac(sha1),cbc(aes))) (echainiv-authenc-hmac-sha1-cbc-aes-caam)
alg: No test for authenc(hmac(sha224),cbc(aes)) (authenc-hmac-sha224-cbc-aes-caam)
alg: No test for echainiv(authenc(hmac(sha224),cbc(aes))) (echainiv-authenc-hmac-sha224-cbc-aes-caam)
alg: No test for echainiv(authenc(hmac(sha256),cbc(aes))) (echainiv-authenc-hmac-sha256-cbc-aes-caam)
alg: No test for authenc(hmac(md5),cbc(des3_ede)) (authenc-hmac-md5-cbc-des3_ede-caam)
alg: No test for echainiv(authenc(hmac(md5),cbc(des3_ede))) (echainiv-authenc-hmac-md5-cbc-des3_ede-caam)
alg: No test for echainiv(authenc(hmac(sha1),cbc(des3_ede))) (echainiv-authenc-hmac-sha1-cbc-des3_ede-caam)
alg: No test for echainiv(authenc(hmac(sha224),cbc(des3_ede))) (echainiv-authenc-hmac-sha224-cbc-des3_ede-caam)
alg: No test for echainiv(authenc(hmac(sha256),cbc(des3_ede))) (echainiv-authenc-hmac-sha256-cbc-des3_ede-caam)
alg: No test for authenc(hmac(md5),cbc(des)) (authenc-hmac-md5-cbc-des-caam)
alg: No test for echainiv(authenc(hmac(md5),cbc(des))) (echainiv-authenc-hmac-md5-cbc-des-caam)
alg: No test for echainiv(authenc(hmac(sha1),cbc(des))) (echainiv-authenc-hmac-sha1-cbc-des-caam)
alg: No test for echainiv(authenc(hmac(sha224),cbc(des))) (echainiv-authenc-hmac-sha224-cbc-des-caam)
alg: No test for echainiv(authenc(hmac(sha256),cbc(des))) (echainiv-authenc-hmac-sha256-cbc-des-caam)
alg: No test for authenc(hmac(md5),rfc3686(ctr(aes))) (authenc-hmac-md5-rfc3686-ctr-aes-caam)
alg: No test for seqiv(authenc(hmac(md5),rfc3686(ctr(aes)))) (seqiv-authenc-hmac-md5-rfc3686-ctr-aes-caam)
alg: No test for seqiv(authenc(hmac(sha1),rfc3686(ctr(aes)))) (seqiv-authenc-hmac-sha1-rfc3686-ctr-aes-caam)
alg: No test for authenc(hmac(sha224),rfc3686(ctr(aes))) (authenc-hmac-sha224-rfc3686-ctr-aes-caam)
alg: No test for seqiv(authenc(hmac(sha224),rfc3686(ctr(aes)))) (seqiv-authenc-hmac-sha224-rfc3686-ctr-aes-caam)
alg: No test for seqiv(authenc(hmac(sha256),rfc3686(ctr(aes)))) (seqiv-authenc-hmac-sha256-rfc3686-ctr-aes-caam)

And when I run insmod tcrypt.ko mode=10 As given in imx-test for AES testing, I get following error

alg: skcipher: Failed to load transform for cfb(aes): -2
tcrypt: one or more tests failed!
insmod: ERROR: could not insert module tcrypt.ko: Unknown symbol in module

What can possibly be wrong? Is my hardware CAAM enabled or not?

Any help is really appreciated.

Thanks,

Asma

Labels (1)
Tags (1)
0 Kudos
4 Replies

18 Views
NXP TechSupport
NXP TechSupport

Hi Asma

what bsp used in the case, one can try to test on i.MX7D Sabre SD reference board

with Demo Images from link

Embedded Linux for i.MX Applications Processors | NXP 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

18 Views
Contributor IV

Hi igorpadykov‌,

We have or custom board. My kernel is 4.19.35-00036-g55d92ea49ff9-dirty. If I do insmod tcrypt.ko mode=200. I get this

testing speed of async xts(aes) (xts(ecb(aes-generic))) encryption
tcrypt: test 0 (256 bit key, 16 byte blocks): 434231 operations in 1 seconds (6947696 bytes)
tcrypt: test 1 (256 bit key, 64 byte blocks): 250150 operations in 1 seconds (16009600 bytes)
tcrypt: test 2 (256 bit key, 256 byte blocks): 90005 operations in 1 seconds (23041280 bytes)
tcrypt: test 3 (256 bit key, 1024 byte blocks): 26244 operations in 1 seconds (26873856 bytes)
tcrypt: test 4 (256 bit key, 8192 byte blocks): 3415 operations in 1 seconds (27975680 bytes)
tcrypt: test 5 (512 bit key, 16 byte blocks): 371698 operations in 1 seconds (5947168 bytes)
tcrypt: test 6 (512 bit key, 64 byte blocks): 201907 operations in 1 seconds (12922048 bytes)
tcrypt: test 7 (512 bit key, 256 byte blocks): 70058 operations in 1 seconds (17934848 bytes)
tcrypt: test 8 (512 bit key, 1024 byte blocks): 19946 operations in 1 seconds (20424704 bytes)
tcrypt: test 9 (512 bit key, 8192 byte blocks): 2580 operations in 1 seconds (21135360 bytes)
tcrypt:
testing speed of async xts(aes) (xts(ecb(aes-generic))) decryption
tcrypt: test 0 (256 bit key, 16 byte blocks): 365889 operations in 1 seconds (5854224 bytes)
tcrypt: test 1 (256 bit key, 64 byte blocks): 216758 operations in 1 seconds (13872512 bytes)
tcrypt: test 2 (256 bit key, 256 byte blocks): 79919 operations in 1 seconds (20459264 bytes)
tcrypt: test 3 (256 bit key, 1024 byte blocks): 23665 operations in 1 seconds (24232960 bytes)
tcrypt: test 4 (256 bit key, 8192 byte blocks): 3095 operations in 1 seconds (25354240 bytes)
tcrypt: test 5 (512 bit key, 16 byte blocks): 320425 operations in 1 seconds (5126800 bytes)
tcrypt: test 6 (512 bit key, 64 byte blocks): 179317 operations in 1 seconds (11476288 bytes)
tcrypt: test 7 (512 bit key, 256 byte blocks): 63828 operations in 1 seconds (16339968 bytes)
tcrypt: test 8 (512 bit key, 1024 byte blocks): 18436 operations in 1 seconds (18878464 bytes)
tcrypt: test 9 (512 bit key, 8192 byte blocks): 2395 operations in 1 seconds (19619840 bytes)
tcrypt:
testing speed of async cts(cbc(aes)) (cts(cbc(aes-generic))) encryption
tcrypt: test 0 (128 bit key, 16 byte blocks): 996697 operations in 1 seconds (15947152 bytes)
tcrypt: test 1 (128 bit key, 64 byte blocks): 223599 operations in 1 seconds (14310336 bytes)
tcrypt: test 2 (128 bit key, 256 byte blocks): 89393 operations in 1 seconds (22884608 bytes)
tcrypt: test 3 (128 bit key, 1024 byte blocks): 26300 operations in 1 seconds (26931200 bytes)
tcrypt: test 4 (128 bit key, 8192 byte blocks): 3458 operations in 1 seconds (28327936 bytes)
tcrypt: test 5 (192 bit key, 16 byte blocks): 916018 operations in 1 seconds (14656288 bytes)
tcrypt: test 6 (192 bit key, 64 byte blocks): 204285 operations in 1 seconds (13074240 bytes)
tcrypt: test 7 (192 bit key, 256 byte blocks): 78556 operations in 1 seconds (20110336 bytes)
tcrypt: test 8 (192 bit key, 1024 byte blocks): 22696 operations in 1 seconds (23240704 bytes)
tcrypt: test 9 (192 bit key, 8192 byte blocks): 2924 operations in 1 seconds (23953408 bytes)
tcrypt: test 10 (256 bit key, 16 byte blocks): 839066 operations in 1 seconds (13425056 bytes)
tcrypt: test 11 (256 bit key, 64 byte blocks): 190332 operations in 1 seconds (12181248 bytes)
tcrypt: test 12 (256 bit key, 256 byte blocks): 70514 operations in 1 seconds (18051584 bytes)
tcrypt: test 13 (256 bit key, 1024 byte blocks): 20049 operations in 1 seconds (20530176 bytes)
tcrypt: test 14 (256 bit key, 8192 byte blocks): 2606 operations in 1 seconds (21348352 bytes)
tcrypt:
testing speed of async cts(cbc(aes)) (cts(cbc(aes-generic))) decryption
tcrypt: test 0 (128 bit key, 16 byte blocks): 874971 operations in 1 seconds (13999536 bytes)
tcrypt: test 1 (128 bit key, 64 byte blocks): 186565 operations in 1 seconds (11940160 bytes)
tcrypt: test 2 (128 bit key, 256 byte blocks): 78388 operations in 1 seconds (20067328 bytes)
tcrypt: test 3 (128 bit key, 1024 byte blocks): 23616 operations in 1 seconds (24182784 bytes)
tcrypt: test 4 (128 bit key, 8192 byte blocks): 3131 operations in 1 seconds (25649152 bytes)
tcrypt: test 5 (192 bit key, 16 byte blocks): 802141 operations in 1 seconds (12834256 bytes)
tcrypt: test 6 (192 bit key, 64 byte blocks): 174346 operations in 1 seconds (11158144 bytes)
tcrypt: test 7 (192 bit key, 256 byte blocks): 70260 operations in 1 seconds (17986560 bytes)
tcrypt: test 8 (192 bit key, 1024 byte blocks): 20737 operations in 1 seconds (21234688 bytes)
tcrypt: test 9 (192 bit key, 8192 byte blocks): 2694 operations in 1 seconds (22069248 bytes)
tcrypt: test 10 (256 bit key, 16 byte blocks): 750517 operations in 1 seconds (12008272 bytes)
tcrypt: test 11 (256 bit key, 64 byte blocks): 164361 operations in 1 seconds (10519104 bytes)
tcrypt: test 12 (256 bit key, 256 byte blocks): 63632 operations in 1 seconds (16289792 bytes)
tcrypt: test 13 (256 bit key, 1024 byte blocks): 18461 operations in 1 seconds (18904064 bytes)
tcrypt: test 14 (256 bit key, 8192 byte blocks): 2419 operations in 1 seconds (19816448 bytes)
tcrypt:
testing speed of async ctr(aes) (ctr(aes-generic)) encryption
tcrypt: test 0 (128 bit key, 16 byte blocks): 915020 operations in 1 seconds (14640320 bytes)
tcrypt: test 1 (128 bit key, 64 byte blocks): 353041 operations in 1 seconds (22594624 bytes)
tcrypt: test 2 (128 bit key, 256 byte blocks): 102218 operations in 1 seconds (26167808 bytes)
tcrypt: test 3 (128 bit key, 1024 byte blocks): 26597 operations in 1 seconds (27235328 bytes)
tcrypt: test 4 (128 bit key, 8192 byte blocks): 3357 operations in 1 seconds (27500544 bytes)
tcrypt: test 5 (192 bit key, 16 byte blocks): 852882 operations in 1 seconds (13646112 bytes)
tcrypt: test 6 (192 bit key, 64 byte blocks): 314482 operations in 1 seconds (20126848 bytes)
tcrypt: test 7 (192 bit key, 256 byte blocks): 89417 operations in 1 seconds (22890752 bytes)
tcrypt: test 8 (192 bit key, 1024 byte blocks): 23152 operations in 1 seconds (23707648 bytes)
tcrypt: test 9 (192 bit key, 8192 byte blocks): 2892 operations in 1 seconds (23691264 bytes)
tcrypt: test 10 (256 bit key, 16 byte blocks): 784159 operations in 1 seconds (12546544 bytes)
tcrypt: test 11 (256 bit key, 64 byte blocks): 280117 operations in 1 seconds (17927488 bytes)
tcrypt: test 12 (256 bit key, 256 byte blocks): 78949 operations in 1 seconds (20210944 bytes)
tcrypt: test 13 (256 bit key, 1024 byte blocks): 20389 operations in 1 seconds (20878336 bytes)
tcrypt: test 14 (256 bit key, 8192 byte blocks): 2568 operations in 1 seconds (21037056 bytes)
tcrypt:
testing speed of async ctr(aes) (ctr(aes-generic)) decryption
tcrypt: test 0 (128 bit key, 16 byte blocks): 918439 operations in 1 seconds (14695024 bytes)
tcrypt: test 1 (128 bit key, 64 byte blocks): 353097 operations in 1 seconds (22598208 bytes)
tcrypt: test 2 (128 bit key, 256 byte blocks): 102214 operations in 1 seconds (26166784 bytes)
tcrypt: test 3 (128 bit key, 1024 byte blocks): 26598 operations in 1 seconds (27236352 bytes)
tcrypt: test 4 (128 bit key, 8192 byte blocks): 3357 operations in 1 seconds (27500544 bytes)
tcrypt: test 5 (192 bit key, 16 byte blocks): 852701 operations in 1 seconds (13643216 bytes)
tcrypt: test 6 (192 bit key, 64 byte blocks): 314369 operations in 1 seconds (20119616 bytes)
tcrypt: test 7 (192 bit key, 256 byte blocks): 89424 operations in 1 seconds (22892544 bytes)
tcrypt: test 8 (192 bit key, 1024 byte blocks): 23151 operations in 1 seconds (23706624 bytes)
tcrypt: test 9 (192 bit key, 8192 byte blocks): 2893 operations in 1 seconds (23699456 bytes)
tcrypt: test 10 (256 bit key, 16 byte blocks): 782777 operations in 1 seconds (12524432 bytes)
tcrypt: test 11 (256 bit key, 64 byte blocks): 280049 operations in 1 seconds (17923136 bytes)
tcrypt: test 12 (256 bit key, 256 byte blocks): 78968 operations in 1 seconds (20215808 bytes)
tcrypt: test 13 (256 bit key, 1024 byte blocks): 20391 operations in 1 seconds (20880384 bytes)
tcrypt: test 14 (256 bit key, 8192 byte blocks): 2568 operations in 1 seconds (21037056 bytes)
tcrypt: failed to load transform for cfb(aes): -2
tcrypt: failed to load transform for cfb(aes): -2
insmod: ERROR: could not insert module tcrypt.ko: Resource temporarily unavailable

it fails for aes. Why is it only for aes its failing?

0 Kudos

18 Views
NXP TechSupport
NXP TechSupport

Hi Asma

 

for  kernel 4.19.35 nxp has 4.19.35_1.1.0 release

linux-imx - i.MX Linux kernel 

Also please try to reproduce issue on i.MX7D Sabre SD reference board

with Demo Images from link

Embedded Linux for i.MX Applications Processors | NXP 

 

Best regards
igor

0 Kudos

18 Views
Contributor IV

Hi, igorpadykov

I took all the changes from 4.19.35 nxp has 4.19.35_1.1.0 release. But still, the output is the same as above. I don't have sabre board with me. That shouldn't matter right as this has nothing to do with any hardware related issue.

I see there had been many changes in the above updated for CAAM with the changes the error for cfb(aes) is still there.

tcrypt: failed to load transform for cfb(aes): -2
tcrypt: failed to load transform for cfb(aes): -2

Is the problem still present?

Regards,

Asma

0 Kudos