Hi,
I'm using P4080 (E500MC) to use the new security driver 4.0. I follow the instruction in P4080 QorIQ Reference Manual to program using Descriptor command to perform Kasumi F8 algorithm over the input data blocks. However I found the Security driver behaves not as I supposed. Following are some detailed description:
1. When I use the ALGORITHM command in a descriptor, the SEC 4.0 driver are always hang. The descriptor that I've programmed and feed into system is as below:
Header Command: 0xb081000a
Key Command: 0x02200010 // This is to load the key into Class 1 Key Register
0x05f6b774 // Pointer of the key address, key is always 16 bytes
Load Command: 0x12200040 // This is to load into Class 1 Context Register
0x05f6b7f0 // Address of the data that want to copy into class 1 context register, 512 bits total
FIFO Load Command: 0x22100010 // This is to load message data into Input Data FIFO, data is 16 bytes
0x05f63014 // Data address
Algorithm command: 0x82700d07 // This is to perform ALGORITHM (kasumi f8) over the input Data
FIFO Store Command: 0x60300010 // This is to move the ciphered data in Output Data FIFO into system memory buffer 0x05f68e70 // Output data buffer address
While I build a descriptor buffer and call the SEC_JQ_Enqueue() to perform the ciphering operation, I found I could not get the expected result. When I query the Status register using following command, I found the SEC4 driver is hung!! Please not the sstar is 0x401 (According to P4080 reference manual the lowest bit indicate the SEC 4.0 is Busy that SEC 4.0 is processing at least one Descriptor). Also, in SEC_JQ_Dequeue() source code, the sec 4.0 driver is querying orsfr register to expected SEC 4.0 to update that register to non-zero value, but unfortunately it seems SEC 4.0 never update orsfr therefore the descriptor is never completed!
Does anybody in Freescale could explain why is that? This puzzled me for quite some time.
Thanks a lot!
Jianhui
-> SEC_JQ_DumpRegisters p_SecJq
JQ Registers (0xE0301000)
---------------------------------------------------------
0xE0301000: 0x0000000005e94010 irbar
0xE030100C: 0x00000100 irsr
0xE0301014: 0x00000100 irsar
0xE030101C: 0x00000001 irjar
0xE0301020: 0x0000000005f50730 orbar
0xE030102C: 0x00000100 orsr
0xE0301034: 0x00000000 orjrr
0xE030103C: 0x00000000 orsfr
0xE0301044: 0x00000000 ostar
0xE030104C: 0x00000000 istar
0xE0301050: 0x0000000000000001 cfgr
0xE030105C: 0x0000000c irrir
0xE0301064: 0x00000000 orwir
0xE030106C: 0x00000000 cmdr
Status Registers (0xE0301F00)
---------------------------------------------------------
0xE0301F00: 0x0000000000000003 req_deq
0xE0301F08: 0x0000000000000000 ob_enc_req
0xE0301F10: 0x0000000000000000 ib_dec_req
0xE0301F18: 0x0000000000000000 ob_encrypt
0xE0301F20: 0x0000000000000000 ob_protect
0xE0301F28: 0x0000000000000000 ib_decrypt
0xE0301F30: 0x0000000000000000 ib_validated
0xE0301FA0: 0x1000000011010000 crnr
0xE0301FA8: 0x8ebf000000001fff ctpr
0xE0301FC0: 0x0000000000000000 far
0xE0301FC8: 0x00000000 falr
0xE0301FCC: 0x00000000 fadr
0xE0301FD4: 0x00000401 sstar
0xE0301FE0: 0x0f0a0001 rvidr
0xE0301FE4: 0x00000001 ccbvidr
0xE0301FE8: 0x0100000100122104 chavidr
0xE0301FF0: 0x4500001512125135 chanumr
0xE0301FF8: 0x0a10020000000000 secvidr
value = 40 = 0x28 = '('