blob: af65982fd0c09b1544da04e35cb1e6ce11419373 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Ben Stoltz3dcdd172015-08-04 12:33:46 -06002/*
3 * Copyright (c) 2015 Google, Inc
Ben Stoltz3dcdd172015-08-04 12:33:46 -06004 */
5
6#include <common.h>
7#include <efi.h>
Simon Glass67c4e9f2019-11-14 12:57:45 -07008#include <init.h>
Simon Glass401d1c42020-10-30 21:38:53 -06009#include <asm/global_data.h>
Ben Stoltz3dcdd172015-08-04 12:33:46 -060010#include <asm/u-boot-x86.h>
11
12DECLARE_GLOBAL_DATA_PTR;
13
14ulong board_get_usable_ram_top(ulong total_size)
15{
16 return (ulong)efi_get_ram_base() + gd->ram_size;
17}
18
19int dram_init(void)
20{
21 /* gd->ram_size is set as part of EFI init */
22
23 return 0;
24}
25
Simon Glass76b00ac2017-03-31 08:40:32 -060026int dram_init_banksize(void)
Ben Stoltz3dcdd172015-08-04 12:33:46 -060027{
28 gd->bd->bi_dram[0].start = efi_get_ram_base();
29 gd->bd->bi_dram[0].size = CONFIG_EFI_RAM_SIZE;
Simon Glass76b00ac2017-03-31 08:40:32 -060030
31 return 0;
Ben Stoltz3dcdd172015-08-04 12:33:46 -060032}