How to do CRC using Security Engine in linux kernel?

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

How to do CRC using Security Engine in linux kernel?

Jump to solution
1,127 Views
quanliwang
Contributor I

My platform: P1020, linux 3.0.51

Linux Driver: driver/crypto/talitos.c

My Question:

    I want to do CRC using Security Engine 'cryto' in kernel because I have so many data and CRC must be complete in very little time. As I know that P1020 has security engine and can do these very quickly. I have learned that  there is a function 'talitos_submit' which I can use, but I don't know how to do this, what to fill the input parameter and where to get the crc's result.

Could you help me and show me an example?

Thanks.

0 Kudos
1 Solution
811 Views
bpe
NXP Employee
NXP Employee

talitos.c file where talitos_submit() function is defined has a

brief description of the function in comments above the function body.

The driver uses this function internally to enqueue descriptors for

processing,  so the same file offers some invocation examples.

The most important parameter of this function is the SEC descriptor

(struct talitos_desc) which is recognized and processed directly in

SEC hardware. This structure is discussed in full detail in AN3645:

https://www.nxp.com/webapp/Download?colCode=AN3645

For a plain CRC32, use descriptor type 0001_0 with CRCU as the

primary EU. For iSCSI-type double CRC use descriptor type 1100_1.

This operation is discussed in detail in Section 3.14 of AN3645.


Have a great day,
Platon

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

View solution in original post

0 Kudos
3 Replies
811 Views
quanliwang
Contributor I

About this issue, I have some more questions:

1. How to use DMA when do this opration? In the file talitos.c, I see that only setting the DMA address to desc before submit 'GO' to channel fetch fifo register in talitos_submit (). My question: where to trigger DMA start? I haven't found it in talitos.c.

2. I prefer using  descriptor type 0001_0 with CRCU. And CRCU Mode Register ALG is '10 Static custom mode.'. My question is that do I need to config CRCU register, for example write polynomial to CRCU Key Register before?

Thanks

Have a pleasure weekend tomorrow,

Wang

0 Kudos
811 Views
bpe
NXP Employee
NXP Employee

SEC has a dedicated DMA that acts transparently to the software. 

talitos_submit() is the only call you need to process your descriptors.

Static custom CRCU mode requires that the software initializes CR

directly. CR cannot be initialized from a descriptor. If you wish to

supply a polynomial with each descriptor, use Dynamic custom mode,

set your descriptors PTR2 dword to refer to the polynomial in the

format specified in Section 7.2.13 of SEC 3.3.2 Engineering Bulletin.

0 Kudos
812 Views
bpe
NXP Employee
NXP Employee

talitos.c file where talitos_submit() function is defined has a

brief description of the function in comments above the function body.

The driver uses this function internally to enqueue descriptors for

processing,  so the same file offers some invocation examples.

The most important parameter of this function is the SEC descriptor

(struct talitos_desc) which is recognized and processed directly in

SEC hardware. This structure is discussed in full detail in AN3645:

https://www.nxp.com/webapp/Download?colCode=AN3645

For a plain CRC32, use descriptor type 0001_0 with CRCU as the

primary EU. For iSCSI-type double CRC use descriptor type 1100_1.

This operation is discussed in detail in Section 3.14 of AN3645.


Have a great day,
Platon

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

0 Kudos