diff options
Diffstat (limited to 'arch/x86/cpu/coreboot/sdram.c')
| -rw-r--r-- | arch/x86/cpu/coreboot/sdram.c | 18 | 
1 files changed, 4 insertions, 14 deletions
| diff --git a/arch/x86/cpu/coreboot/sdram.c b/arch/x86/cpu/coreboot/sdram.c index 76274cb88..a8136a06a 100644 --- a/arch/x86/cpu/coreboot/sdram.c +++ b/arch/x86/cpu/coreboot/sdram.c @@ -60,12 +60,8 @@ unsigned install_e820_map(unsigned max_entries, struct e820entry *entries)   * address, and how far U-Boot is moved by relocation are set in the global   * data structure.   */ -int calculate_relocation_address(void) +ulong board_get_usable_ram_top(ulong total_size)  { -	const uint64_t uboot_size = (uintptr_t)&__bss_end - -			(uintptr_t)&__text_start; -	const uint64_t total_size = uboot_size + CONFIG_SYS_MALLOC_LEN + -		CONFIG_SYS_STACK_SIZE;  	uintptr_t dest_addr = 0;  	int i; @@ -87,21 +83,15 @@ int calculate_relocation_address(void)  			continue;  		/* Use this address if it's the largest so far. */ -		if (end - uboot_size > dest_addr) +		if (end > dest_addr)  			dest_addr = end;  	}  	/* If no suitable area was found, return an error. */  	if (!dest_addr) -		return 1; +		panic("No available memory found for relocation"); -	dest_addr -= uboot_size; -	dest_addr &= ~((1 << 12) - 1); -	gd->relocaddr = dest_addr; -	gd->reloc_off = dest_addr - (uintptr_t)&__text_start; -	gd->start_addr_sp = dest_addr - CONFIG_SYS_MALLOC_LEN; - -	return 0; +	return (ulong)dest_addr;  }  int dram_init_f(void) |