LSDK Sec Engine Integration

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LSDK Sec Engine Integration

ソリューションへジャンプ
2,433件の閲覧回数
rashmikj
Contributor III

Hi, I am trying to integrate cryptodev_linux component. I used the following commands to generate bootpartition.

$ flex-builder -c cryptodev_linux -a arm64
$ flex-builder -c openssl -a arm64
$ flex-builder -i merge-component -a arm64:
$ flex-builder -i mkbootpartition -a arm64

I copied the bootpartition in sd card and used the following command in the kit.

flex-installer -b bootpartition_LS_arm64_lts_5.4.tgz -r rootfs_lsdk2004_ubuntu_main_arm64.tgz -d /dev/mmcblk0

when i reboot the kit and run the following command ,

modprobe caamalg

It shows error as 

"caamalg not found in modules.dep"

How do i  make openssl use sec engine for the operations?? Kindly help.

0 件の賞賛
1 解決策
2,379件の閲覧回数
yipingwang
NXP TechSupport
NXP TechSupport

Please execute the following commands

$ flex-builder -c cryptodev_linux -a arm64
$ flex-builder -c openssl -a arm64:
$ flex-builder -i merge-component -a arm64
$ flex-builder -i mkbootpartition -a arm64

$ flex-builder -i mkrfs -r ubuntu:main

Then run the following command, please note you need to use /dev/mmcblk0(the device name)

# flex-installer -b bootpartition_LS_arm64_lts_5.4.tgz -r rootfs_lsdk2004_ubuntu_main_arm64.tgz -d /dev/mmcblk0

元の投稿で解決策を見る

0 件の賞賛
11 返答(返信)
2,415件の閲覧回数
yipingwang
NXP TechSupport
NXP TechSupport

If you want to use "modprobe caamalg", you need to build caamalg as Linux Kernel module when build Linux Kernel image, you need to configure "CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API" as "m" in Linux Kernel configuration file.

However in the default Linux Kernel configuration file, these SEC related Kernel options have already been configured as built-in mode, so "modprobe caamalg" is not needed.

# CONFIG_CRYPTO_DEV_MARVELL_CESA is not set
CONFIG_CRYPTO_DEV_FSL_CAAM_COMMON=y
CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_DESC=y
CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API_DESC=y
CONFIG_CRYPTO_DEV_FSL_CAAM=y
# CONFIG_CRYPTO_DEV_FSL_CAAM_DEBUG is not set
CONFIG_CRYPTO_DEV_FSL_CAAM_JR=y
CONFIG_CRYPTO_DEV_FSL_CAAM_RINGSIZE=9
# CONFIG_CRYPTO_DEV_FSL_CAAM_INTC is not set
CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API=y
CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI=y
CONFIG_CRYPTO_DEV_FSL_CAAM_AHASH_API=y
CONFIG_CRYPTO_DEV_FSL_CAAM_PKC_API=y
CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API=y

 

You need to use "modprobe cryptodev" for hardware offloading with OpenSSL.

0 件の賞賛
2,408件の閲覧回数
rashmikj
Contributor III

When i use modprobe cryptodev also , I get the same error.

Module cryptodev not found in modules.dep

0 件の賞賛
2,403件の閲覧回数
yipingwang
NXP TechSupport
NXP TechSupport

Please mount the second SD partition to /mnt, then check whether cryptodev.ko exists in module folder.

$ mount /dev/mmcblk0p2 /mnt

root@localhost:~# find /mnt/modules/ -name cryptodev.ko
/mnt/modules/4.19.90/extra/cryptodev.ko
/mnt/modules/5.4.3/extra/cryptodev.ko

If cryptodev.ko exists in the bootpartition, please check whether it exists in the rootfs filesystem.

root@localhost:~# find / -name cryptodev.ko
/boot/modules/4.19.90/extra/cryptodev.ko
/boot/modules/5.4.3/extra/cryptodev.ko

You could use the pre_built images which could be downloaded as the following.

$ wget https://www.nxp.com/lgfiles/sdk/lsdk2004/bootpartition_LS_arm64_lts_5.4.tgz
$ wget https://www.nxp.com/lgfiles/sdk/lsdk2004/rootfs_lsdk2004_ubuntu_main_arm64.tgz

0 件の賞賛
2,395件の閲覧回数
rashmikj
Contributor III

I tried the steps suggested by you . I have attached error enclosed.

How do i integrate cryptodev with openssl and create an image as i want it to be part of the image. I tried these steps as suggested by you in one of my pevious query 

flex-builder -c cryptodev_linux -a arm64 $
flex-builder -c openssl -a arm64 $
flex-builder -i mkrfs -r yocto:tiny $ f
flex-builder -i merge-component -r yocto:tiny $
flex-builder -i mklinux -r yocto:tiny $
flex-builder -i mkfw -m ls1046ardb -b qspi

But still when i type modprobe cryptodev , I get the following error,

Cryptodev not found in modules.dep.

 

0 件の賞賛
2,392件の閲覧回数
yipingwang
NXP TechSupport
NXP TechSupport

In LSDK 20.04, Kernel module cryptodev.ko is integrated in bootpartition.

Please execute the following commands

$ flex-builder -c cryptodev_linux -a arm64
$ flex-builder -c openssl -a arm64:
$ flex-builder -i merge-component -a arm64
$ flex-builder -i mkbootpartition -a arm64

$ flex-builder -i mkrfs -r ubuntu:main

Then run the following command, please note you need to use /dev/mmcblk0(the device name)

# flex-installer -b bootpartition_LS_arm64_lts_5.4.tgz -r rootfs_lsdk2004_ubuntu_main_arm64.tgz -d /dev/mmcblk0

0 件の賞賛
2,390件の閲覧回数
rashmikj
Contributor III

Thanks for the reply.

I tried your previous instruction.

When i enter the following , I get this error

root@TinyLinux:/mnt# /mnt/modules/5.4.3/extra/cryptodev.ko
-sh: /mnt/modules/5.4.3/extra/cryptodev.ko: Permission denied

0 件の賞賛
2,387件の閲覧回数
yipingwang
NXP TechSupport
NXP TechSupport

Please use the above instruction which I posted just now.

0 件の賞賛
2,382件の閲覧回数
rashmikj
Contributor III

Sorry I couldn't follow . Which Instruction??

0 件の賞賛
2,380件の閲覧回数
yipingwang
NXP TechSupport
NXP TechSupport

Please execute the following commands

$ flex-builder -c cryptodev_linux -a arm64
$ flex-builder -c openssl -a arm64:
$ flex-builder -i merge-component -a arm64
$ flex-builder -i mkbootpartition -a arm64

$ flex-builder -i mkrfs -r ubuntu:main

Then run the following command, please note you need to use /dev/mmcblk0(the device name)

# flex-installer -b bootpartition_LS_arm64_lts_5.4.tgz -r rootfs_lsdk2004_ubuntu_main_arm64.tgz -d /dev/mmcblk0

0 件の賞賛
2,369件の閲覧回数
rashmikj
Contributor III

Thank you. Its working

0 件の賞賛
2,375件の閲覧回数
rashmikj
Contributor III

Sir , 

I executed those instructions. everything worked fine. Now how do i link openssl with cryptodev ?

For that I executed ur previous instruction

root@localhost:~# find /mnt/modules/ -name cryptodev.ko

root@TinyLinux:/mnt# /mnt/modules/5.4.3/extra/cryptodev.ko
-sh: /mnt/modules/5.4.3/extra/cryptodev.ko: Permission denied

0 件の賞賛