RNG Job Descriptor to copy random number to system RAM

cancel
Showing results for 
Search instead for 
Did you mean: 

RNG Job Descriptor to copy random number to system RAM

Jump to solution
584 Views
fmajeric
Contributor III

Hello,

I read a resolved discussion about RNG Job Descriptor:

P4080 SEC4.0 Job Descriptor to copy random numbers to system RAM

I've the same need : generate a simple random number and store it at  the address 0x10000170 in RAM.

So I use the descriptor provided in the answer of the discussion:

### rnggen_1

[00] B0800006    jobhdr: stidx=0 len=6

[01] 12820004    ld: ccb1-datasz len=4 offs=0 imm

[02] 00000020    data:0x00000020

[03] 82500000    operation: cls1-op rng (SH0) generate random

[04] 60300020    fifostr: msg len=32

[05] 10000170    @ptr->@0x10000170

But when I load the Job Descriptor Base Address into the Input Job Ring Register,

I have no Random number at the address  @0x10000170...

  

... what is the problem with this descriptor ?

What I don't do well ?

Please, could you help me ?

Fabien.

0 Kudos
1 Solution
166 Views
bpe
NXP TechSupport
NXP TechSupport

The job status tells you that  RNG has not been instantiated. Refer to Security RM, Sections 5.7.3.2.1, 5.7.3.2.2,

Table 5-68.


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
4 Replies
166 Views
bpe
NXP TechSupport
NXP TechSupport

What is the Job termination status returned for this JD?


Have a great day,
Platon

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

0 Kudos
166 Views
fmajeric
Contributor III

Hi Platon,

I will try to explain what happened:

1- First, I load the descriptor in RAM memory. I initiate all the Job Ring registers in CAAM (size, addresses, ...)

Addresses in RAMCommentsValues
0x10000000JR0_input_Base_Addr0x10000100
...... ......
0x10000040JR0_Output_Base_Addr0x00000000
...... ......
0x10000100jobhdr: stidx=0 len=6 0xB0800006
0x10000104ld: ccb1-datasz len=4 offs=0 imm 0x12820004
0x10000108data:0x000000200x00000020
0x1000010Coperation: cls1-op rng (SH0) generate random0x82500000
0x10000110fifostr: msg len=320x60300020
0x10000114@ptr->@0x100001700x10000170
...... ......
0x10000170where the descriptor tell the CAAM to store the result.0x00000000
...... ......

--> At this moment, the status register are:

Addresses in RAMCommentsValues
0x02100DF4JRJDS — Job Ring Job-Done Status Register0x00000000
...... ......
0x02100FD4CSTA — CAAM Status Register 0x00000006
...... ......
0x02101044JROSR0 — Job Ring Output Status Register for Job Ring 00x00000000
...... ......
0x02101FD4CSTA — CAAM Status Register0x00000006

2- Then I write into the IRJAR0 of the CAAM the value 0x1 in order it begin its work:

0x0210101C    IRJAR0 — Input Ring Jobs Added Register for Job Ring 00x00000001

3- Last it returns this:

Addresses in RAMCommentsValues
0x10000000JR0_input_Base_Addr0x10000100
...... ......
0x10000040JR0_Output_Base_Addr0x10000100
0x100000440x20000454
...... ......
0x10000100jobhdr: stidx=0 len=60xB0800006
0x10000104ld: ccb1-datasz len=4 offs=0 imm0x12820004
0x10000108data:0x000000200x00000020
0x1000010Coperation: cls1-op rng (SH0) generate random0x82500000
0x10000110fifostr: msg len=320x60300020
0x10000114@ptr->@0x100001700x10000170
...... ......
0x10000170where the descriptor tell the CAAM to store the result.0x00000000
...... ......

--> then the status registers are:

Addresses in RAMCommentsValues
0x02100DF4JRJDS — Job Ring Job-Done Status Register0x00000000
...... ......
0x02100DF4CSTA — CAAM Status Register 0x00000005
...... ......
0x02100DF4JROSR0 — Job Ring Output Status Register for Job Ring 00x20000454
...... ......
0x02101FD4CSTA — CAAM Status Register0x00000005

I hope it explains quite well the situation. If not don't hesitate to ask me some specifications.

Thank you for your help,

Fabien.

0 Kudos
167 Views
bpe
NXP TechSupport
NXP TechSupport

The job status tells you that  RNG has not been instantiated. Refer to Security RM, Sections 5.7.3.2.1, 5.7.3.2.2,

Table 5-68.


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
166 Views
fmajeric
Contributor III

Ok Platon,

Thank you very much. It sould be the reason for this dysfunction :smileyhappy: ...

Best Regards,

Fabien.

0 Kudos