Using DCP AES in U-Boot

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using DCP AES in U-Boot

Jump to solution
1,242 Views
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

Labels (1)
0 Kudos
1 Solution
780 Views
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!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
1 Reply
781 Views
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 Kudos