blob: 6fe400711402d375b7e74ecb4f5f11695944b8c9 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Ben Stoltzab76a472015-08-04 12:33:46 -06002/*
3 * Copyright (c) 2015 Google, Inc
Ben Stoltzab76a472015-08-04 12:33:46 -06004 */
5
Ben Stoltzab76a472015-08-04 12:33:46 -06006#include <efi.h>
Simon Glass6980b6b2019-11-14 12:57:45 -07007#include <init.h>
Simon Glass3ba929a2020-10-30 21:38:53 -06008#include <asm/global_data.h>
Ben Stoltzab76a472015-08-04 12:33:46 -06009#include <asm/u-boot-x86.h>
10
11DECLARE_GLOBAL_DATA_PTR;
12
Heinrich Schuchardt51a9aac2023-08-12 20:16:58 +020013phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
Ben Stoltzab76a472015-08-04 12:33:46 -060014{
15 return (ulong)efi_get_ram_base() + gd->ram_size;
16}
17
18int dram_init(void)
19{
20 /* gd->ram_size is set as part of EFI init */
21
22 return 0;
23}
24
Simon Glass2f949c32017-03-31 08:40:32 -060025int dram_init_banksize(void)
Ben Stoltzab76a472015-08-04 12:33:46 -060026{
27 gd->bd->bi_dram[0].start = efi_get_ram_base();
28 gd->bd->bi_dram[0].size = CONFIG_EFI_RAM_SIZE;
Simon Glass2f949c32017-03-31 08:40:32 -060029
30 return 0;
Ben Stoltzab76a472015-08-04 12:33:46 -060031}