@ -317,6 +317,15 @@ __weak ulong board_get_usable_ram_top(ulong total_size)
return gd - > ram_top ;
return gd - > ram_top ;
}
}
__weak phys_size_t board_reserve_ram_top ( phys_size_t ram_size )
{
# ifdef CONFIG_SYS_MEM_TOP_HIDE
return ram_size - CONFIG_SYS_MEM_TOP_HIDE ;
# else
return ram_size ;
# endif
}
static int setup_dest_addr ( void )
static int setup_dest_addr ( void )
{
{
debug ( " Monitor len: %08lX \n " , gd - > mon_len ) ;
debug ( " Monitor len: %08lX \n " , gd - > mon_len ) ;
@ -333,19 +342,17 @@ static int setup_dest_addr(void)
*/
*/
gd - > secure_ram = gd - > ram_size ;
gd - > secure_ram = gd - > ram_size ;
# endif
# endif
# if defined(CONFIG_SYS_MEM_TOP_HIDE)
/*
/*
* Subtract specified amount of memory to hide so that it won ' t
* Subtract specified amount of memory to hide so that it won ' t
* get " touched " at all by U - Boot . By fixing up gd - > ram_size
* get " touched " at all by U - Boot . By fixing up gd - > ram_size
* the Linux kernel should now get passed the now " corrected "
* the Linux kernel should now get passed the now " corrected "
* memory size and won ' t touch it either . This should work
* memory size and won ' t touch it either . This has been used
* for arch / ppc and arch / powerpc . Only Linux board ports in
* by arch / powerpc exclusively . Now ARMv8 takes advantage of
* arch / powerpc with bootwrapper support , that recalculate the
* thie mechanism . If memory is split into banks , addresses
* memory size from the SDRAM controller setup will have to
* need to be calculated .
* get fixed .
*/
*/
gd - > ram_size - = CONFIG_SYS_MEM_TOP_HIDE ;
gd - > ram_size = board_reserve_ram_top ( gd - > ram_size ) ;
# endif
# ifdef CONFIG_SYS_SDRAM_BASE
# ifdef CONFIG_SYS_SDRAM_BASE
gd - > ram_top = CONFIG_SYS_SDRAM_BASE ;
gd - > ram_top = CONFIG_SYS_SDRAM_BASE ;
# endif
# endif