I download uboot from uboot-imx - i.MX U-Boot , and the version is rel_imx_4.14.78_1.0.0_ga. I want to try blob enc/dec command in uboot.
My .config is set as follow:
CONFIG_FSL_CAAM=y
SHA_PROG_HW_ACCEL=y
CONFIG_CMD_BLOB=y
CONFIG_CMD_PRIBLOB=y
CONFIG_CMD_DEKBLOB=y
CONFIG_SECURE_BOOT=y
SYS_FSL_SEC_COMPAT 4
My uboot command as follow:
=> tftp 0x12000000 zImage
=> tftp 0x14000000 key.bin
=> blob enc 0x12000000 0x12001000 32 0x14000000
out_jr_size is 0
SEC0: RNG instantiated
Encapsulating data to form blob
01: key
03: seq_in_ptr
03: seq_in_ptr_extlen
06: seq_out_ptr
06: seq_out_ptr_extlen
09: operation
Descriptor dump:
Word[0]: b080000a
Word[1]: 04000010
Word[2]: 14000000
Word[3]: f0400000
Word[4]: 12000000
Word[5]: 00000032
Word[6]: f8400000
Word[7]: 12001000
Word[8]: 00000062
Word[9]: 870d0000
Word[10]: 00000068
Word[11]: 00000018
Word[12]: 00000000
Word[13]: 00000000
SEC Dequeue timed out
Error in blob encapsulation: -2
exit not allowed from main input shell.
I read source code, and found in jr_dequeue() funciton:
static int jr_dequeue(int sec_idx)
{
struct jr_regs *regs = (struct jr_regs *)SEC_JR0_ADDR(sec_idx);
...
while (sec_in32(®s->orsf) && CIRC_CNT(jr->head, jr->tail, jr->size)) {
...
}
return 0;
}
sec_in32(®s->orsf) is always 0. Can anyone tell me why? I really need help.
Thanks,
Yiling Xu