]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | // SPDX-License-Identifier: GPL-2.0+ |
b2e02d28 BM |
2 | /* |
3 | * Copyright (C) 2014, Bin Meng <bmeng.cn@gmail.com> | |
b2e02d28 BM |
4 | */ |
5 | ||
d678a59d | 6 | #include <common.h> |
691d719d | 7 | #include <init.h> |
e9de4a7c | 8 | #include <asm/fsp/fsp_support.h> |
401d1c4f | 9 | #include <asm/global_data.h> |
b2e02d28 BM |
10 | |
11 | int dram_init(void) | |
12 | { | |
e9de4a7c | 13 | int ret; |
b2e02d28 | 14 | |
e9de4a7c SG |
15 | /* The FSP has already set up DRAM, so grab the info we need */ |
16 | ret = fsp_scan_for_ram_size(); | |
17 | if (ret) | |
18 | return ret; | |
b2e02d28 | 19 | |
515e8174 SG |
20 | if (IS_ENABLED(CONFIG_ENABLE_MRC_CACHE)) { |
21 | struct mrc_output *mrc = &gd->arch.mrc[MRC_TYPE_NORMAL]; | |
22 | ||
23 | mrc->buf = fsp_get_nvs_data(gd->arch.hob_list, &mrc->len); | |
24 | } | |
ff1e18af | 25 | |
b2e02d28 BM |
26 | return 0; |
27 | } | |
28 | ||
b2e02d28 BM |
29 | /* |
30 | * This function looks for the highest region of memory lower than 4GB which | |
31 | * has enough space for U-Boot where U-Boot is aligned on a page boundary. | |
32 | * It overrides the default implementation found elsewhere which simply | |
33 | * picks the end of ram, wherever that may be. The location of the stack, | |
34 | * the relocation address, and how far U-Boot is moved by relocation are | |
35 | * set in the global data structure. | |
36 | */ | |
d768dd88 | 37 | phys_addr_t board_get_usable_ram_top(phys_size_t total_size) |
b2e02d28 | 38 | { |
255fd5ca | 39 | return fsp_get_usable_lowmem_top(gd->arch.hob_list); |
b2e02d28 | 40 | } |