Using DCP AES in U-Boot

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Using DCP AES in U-Boot

跳至解决方案
1,245 次查看
ivandrobyshevs1
Contributor II

I'm trying to use AES encryption as provided by i.MX6 ULL's DCP in U-Boot. In order to do that, I ported relevant rt-thread code and corresponding code sample from i.MX6 ULL reference manual.

 

Here's the code: u-boot code 

Besides the above file, dcp.h and regsdcp.h are taken from rt-thread, with the only difference being change of DCP base address, since the version I took them from was for 6SL I think.

 

The error I'm getting is "ERROR_DST" ("This bit indicates that a bus error occurred when storing to the destination buffer. When an error is detected, the channel's processing stops until the error is handled by the software.").

I've tried different source and destination buffers, as well as in-place encryption.

 

Here are debug prints:

src_buf: 8ef4b6c8
dst_buf: 8ef4b6c8
DCP STAT: 0x10000001
DCP ERROR: 0x20
DCP VERSION: 0x2010000

 

There's a Linux driver for that, however it's quite complicated with using DMA, interrupts, etc, and I need to get it working in U-Boot.

Original Attachment has been moved to: cmd_aes.c.zip

标签 (1)
0 项奖励
1 解答
783 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Ivan

DCP bypass cpu and access memory directly, so DMA should be used.

There is DCP driver in linux-2.6.35.3/drivers/crypto/dcp.c, one can check it:

i.MX28 Evaluation Kit|NXP 

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

在原帖中查看解决方案

0 项奖励
1 回复
784 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Ivan

DCP bypass cpu and access memory directly, so DMA should be used.

There is DCP driver in linux-2.6.35.3/drivers/crypto/dcp.c, one can check it:

i.MX28 Evaluation Kit|NXP 

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

0 项奖励