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 ?