plat: imx8m: Add dram pll lock check before retention exit

Add the dram pll lock check to make the pll is already
locked bofore dram exit from retention mode.

addtionally, the DDR4 reset flow need some change to
make sure DRAM exit retention safely.

Signed-off-by: Jacky Bai <>
(cherry picked from commit 858e2141138d87fe6072f8ba0321b3963ae9630c)
4 files changed