LS1021a Sec: Job ring access from normal world

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

LS1021a Sec: Job ring access from normal world

Jump to solution
1,281 Views
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

Labels (1)
0 Kudos
1 Solution
996 Views
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.

View solution in original post

0 Kudos
1 Reply
997 Views
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 Kudos