@ -289,8 +289,8 @@ static inline int final_secure_ddr(u64 *level0_table,
* These tables are in DRAM . Sub tables are added to enable cache for
* These tables are in DRAM . Sub tables are added to enable cache for
* QBMan and OCRAM .
* QBMan and OCRAM .
*
*
* Put the MMU table in secure memory if gd - > secure_ram is valid .
* Put the MMU table in secure memory if gd - > arch . secure_ram is valid .
* OCRAM will be not used for this purpose so gd - > secure_ram can ' t be 0.
* OCRAM will be not used for this purpose so gd - > arch . secure_ram can ' t be 0.
*
*
* Level 1 table 0 contains 512 entries for each 1 GB from 0 to 512 GB .
* Level 1 table 0 contains 512 entries for each 1 GB from 0 to 512 GB .
* Level 1 table 1 contains 512 entries for each 1 GB from 512 GB to 1 TB .
* Level 1 table 1 contains 512 entries for each 1 GB from 512 GB to 1 TB .
@ -321,13 +321,13 @@ static inline void final_mmu_setup(void)
if ( el = = 3 ) {
if ( el = = 3 ) {
/*
/*
* Only use gd - > secure_ram if the address is recalculated
* Only use gd - > arch . secure_ram if the address is recalculated
* Align to 4 KB for MMU table
* Align to 4 KB for MMU table
*/
*/
if ( gd - > secure_ram & MEM_RESERVE_SECURE_MAINTAINED )
if ( gd - > arch . secure_ram & MEM_RESERVE_SECURE_MAINTAINED )
level0_table = ( u64 * ) ( gd - > secure_ram & ~ 0xfff ) ;
level0_table = ( u64 * ) ( gd - > arch . secure_ram & ~ 0xfff ) ;
else
else
printf ( " MMU warning: gd->secure_ram is not maintained, disabled. \n " ) ;
printf ( " MMU warning: gd->arch. secure_ram is not maintained, disabled. \n " ) ;
}
}
# endif
# endif
level1_table0 = level0_table + 512 ;
level1_table0 = level0_table + 512 ;
@ -374,7 +374,7 @@ static inline void final_mmu_setup(void)
}
}
/* Set the secure memory to secure in MMU */
/* Set the secure memory to secure in MMU */
# ifdef CONFIG_SYS_MEM_RESERVE_SECURE
# ifdef CONFIG_SYS_MEM_RESERVE_SECURE
if ( el = = 3 & & gd - > secure_ram & MEM_RESERVE_SECURE_MAINTAINED ) {
if ( el = = 3 & & gd - > arch . secure_ram & MEM_RESERVE_SECURE_MAINTAINED ) {
# ifdef CONFIG_FSL_LSCH3
# ifdef CONFIG_FSL_LSCH3
level2_table_secure = level2_table1 + 512 ;
level2_table_secure = level2_table1 + 512 ;
# elif defined(CONFIG_FSL_LSCH2)
# elif defined(CONFIG_FSL_LSCH2)
@ -382,10 +382,10 @@ static inline void final_mmu_setup(void)
# endif
# endif
if ( ! final_secure_ddr ( level0_table ,
if ( ! final_secure_ddr ( level0_table ,
level2_table_secure ,
level2_table_secure ,
gd - > secure_ram & ~ 0x3 ) ) {
gd - > arch . secure_ram & ~ 0x3 ) ) {
gd - > secure_ram | = MEM_RESERVE_SECURE_SECURED ;
gd - > arch . secure_ram | = MEM_RESERVE_SECURE_SECURED ;
debug ( " Now MMU table is in secured memory at 0x%llx \n " ,
debug ( " Now MMU table is in secured memory at 0x%llx \n " ,
gd - > secure_ram & ~ 0x3 ) ;
gd - > arch . secure_ram & ~ 0x3 ) ;
} else {
} else {
printf ( " MMU warning: Failed to secure DDR \n " ) ;
printf ( " MMU warning: Failed to secure DDR \n " ) ;
}
}