LS1021a Sec: Job ring access from normal world

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

LS1021a Sec: Job ring access from normal world

跳至解决方案
1,367 次查看
vsiles
Senior Contributor I

I'm working with a LS1021a board, and using the ls1021atwr target of NXP's SDK 1.9. In this setup, U-boot is compiled in SPL mode, and both SPL and u-boot are run in the Secure World. The switch from Secure to Normal is done by u-boot just prior to call Linux entry point.

My goal is to switch from Secure to Normal priori to start u-boot, so I have to patch a couple places (timer_init and csu initialization for example) to be sure u-boot can run correctly in normal mode. I'm stuck with sec_init (in drivers/crypto/fsl/jr.c) which is used to initialize the RNG.

From what I can observe using printfs, all the values used to program the Job Ring are exactly the same as a valid execution in Secure world, but at some point, the code goes to instantiate_rng -> run_descriptor_jr_idx  where a job is enqueued and then dequeued. In a valid execution, I enter jr_enqueue and jr_dequeue, and they are both successful. In an execution in the Normal world, jr_enqueue is successful but jr_dequeue isn't, it's like the job is never done, or discarded.

From what I gather from the SEC documentation and the values used in u-boot, I think I should be able to enqueue job from the Normal World, but maybe I missed something.

Could anyone help me to understand how to configure the RNG from the Normal world, or point out why it is not possible and what part needs to be perform in the Secure world ?

Best,

Vincent

标签 (1)
0 项奖励
回复
1 解答
1,082 次查看
vsiles
Senior Contributor I

Hi ! In the end the issue was not at all a SEC/CAAM issue: my kernel (which is running in between SPL and u-boot, as secure), was setting the ACTLR.SMP bit, to enable caching. With ACTLR.SMP bit set to 1, u-boot doesn't seem to work properly.

For now, I just leave it that way, I'll investigate why later.

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,083 次查看
vsiles
Senior Contributor I

Hi ! In the end the issue was not at all a SEC/CAAM issue: my kernel (which is running in between SPL and u-boot, as secure), was setting the ACTLR.SMP bit, to enable caching. With ACTLR.SMP bit set to 1, u-boot doesn't seem to work properly.

For now, I just leave it that way, I'll investigate why later.

0 项奖励
回复