Skip to content
Snippets Groups Projects
Commit 285c7481 authored by Sumit Garg's avatar Sumit Garg Committed by York Sun
Browse files

board: ls1043ardb: move sec_init to board_init


sec_init() which was earlier called in misc_init_r()
is now done in board_init() before PPA init as SEC
block will be used during PPA image validation.

Signed-off-by: default avatarAneesh Bansal <aneesh.bansal@nxp.com>
Signed-off-by: default avatarSumit Garg <sumit.garg@nxp.com>
Reviewed-by: default avatarYork Sun <york.sun@nxp.com>
parent 4baa38c5
No related branches found
No related tags found
No related merge requests found
...@@ -94,6 +94,23 @@ int board_init(void) ...@@ -94,6 +94,23 @@ int board_init(void)
enable_layerscape_ns_access(); enable_layerscape_ns_access();
#endif #endif
#ifdef CONFIG_SECURE_BOOT
/* In case of Secure Boot, the IBR configures the SMMU
* to allow only Secure transactions.
* SMMU must be reset in bypass mode.
* Set the ClientPD bit and Clear the USFCFG Bit
*/
u32 val;
val = (in_le32(SMMU_SCR0) | SCR0_CLIENTPD_MASK) & ~(SCR0_USFCFG_MASK);
out_le32(SMMU_SCR0, val);
val = (in_le32(SMMU_NSCR0) | SCR0_CLIENTPD_MASK) & ~(SCR0_USFCFG_MASK);
out_le32(SMMU_NSCR0, val);
#endif
#ifdef CONFIG_FSL_CAAM
sec_init();
#endif
#ifdef CONFIG_FSL_LS_PPA #ifdef CONFIG_FSL_LS_PPA
ppa_init(); ppa_init();
#endif #endif
...@@ -137,21 +154,6 @@ int config_board_mux(void) ...@@ -137,21 +154,6 @@ int config_board_mux(void)
int misc_init_r(void) int misc_init_r(void)
{ {
config_board_mux(); config_board_mux();
#ifdef CONFIG_SECURE_BOOT
/* In case of Secure Boot, the IBR configures the SMMU
* to allow only Secure transactions.
* SMMU must be reset in bypass mode.
* Set the ClientPD bit and Clear the USFCFG Bit
*/
u32 val;
val = (in_le32(SMMU_SCR0) | SCR0_CLIENTPD_MASK) & ~(SCR0_USFCFG_MASK);
out_le32(SMMU_SCR0, val);
val = (in_le32(SMMU_NSCR0) | SCR0_CLIENTPD_MASK) & ~(SCR0_USFCFG_MASK);
out_le32(SMMU_NSCR0, val);
#endif
#ifdef CONFIG_FSL_CAAM
return sec_init();
#endif
return 0; return 0;
} }
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment