Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Ben Stoltz | ab76a47 | 2015-08-04 12:33:46 -0600 | [diff] [blame] | 2 | /* |
3 | * Copyright (c) 2015 Google, Inc | ||||
Ben Stoltz | ab76a47 | 2015-08-04 12:33:46 -0600 | [diff] [blame] | 4 | */ |
5 | |||||
Ben Stoltz | ab76a47 | 2015-08-04 12:33:46 -0600 | [diff] [blame] | 6 | #include <efi.h> |
Simon Glass | 6980b6b | 2019-11-14 12:57:45 -0700 | [diff] [blame] | 7 | #include <init.h> |
Simon Glass | 3ba929a | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 8 | #include <asm/global_data.h> |
Tom Rini | 412a021 | 2024-04-27 08:10:56 -0600 | [diff] [blame] | 9 | #include <asm/u-boot.h> |
Ben Stoltz | ab76a47 | 2015-08-04 12:33:46 -0600 | [diff] [blame] | 10 | #include <asm/u-boot-x86.h> |
11 | |||||
12 | DECLARE_GLOBAL_DATA_PTR; | ||||
13 | |||||
Heinrich Schuchardt | 51a9aac | 2023-08-12 20:16:58 +0200 | [diff] [blame] | 14 | phys_addr_t board_get_usable_ram_top(phys_size_t total_size) |
Ben Stoltz | ab76a47 | 2015-08-04 12:33:46 -0600 | [diff] [blame] | 15 | { |
16 | return (ulong)efi_get_ram_base() + gd->ram_size; | ||||
17 | } | ||||
18 | |||||
19 | int dram_init(void) | ||||
20 | { | ||||
21 | /* gd->ram_size is set as part of EFI init */ | ||||
22 | |||||
23 | return 0; | ||||
24 | } | ||||
25 | |||||
Simon Glass | 2f949c3 | 2017-03-31 08:40:32 -0600 | [diff] [blame] | 26 | int dram_init_banksize(void) |
Ben Stoltz | ab76a47 | 2015-08-04 12:33:46 -0600 | [diff] [blame] | 27 | { |
28 | gd->bd->bi_dram[0].start = efi_get_ram_base(); | ||||
29 | gd->bd->bi_dram[0].size = CONFIG_EFI_RAM_SIZE; | ||||
Simon Glass | 2f949c3 | 2017-03-31 08:40:32 -0600 | [diff] [blame] | 30 | |
31 | return 0; | ||||
Ben Stoltz | ab76a47 | 2015-08-04 12:33:46 -0600 | [diff] [blame] | 32 | } |