Simon Glass | c51faed | 2019-04-25 21:58:54 -0600 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * (C) Copyright 2016 Google, Inc |
| 4 | * Written by Simon Glass <sjg@chromium.org> |
| 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <bloblist.h> |
| 9 | #include <debug_uart.h> |
| 10 | #include <handoff.h> |
| 11 | #include <asm/mtrr.h> |
| 12 | |
| 13 | int misc_init_r(void) |
| 14 | { |
| 15 | return 0; |
| 16 | } |
| 17 | |
| 18 | int dram_init(void) |
| 19 | { |
| 20 | struct spl_handoff *ho; |
| 21 | |
| 22 | ho = bloblist_find(BLOBLISTT_SPL_HANDOFF, sizeof(*ho)); |
| 23 | if (!ho) |
| 24 | return log_msg_ret("Missing SPL hand-off info", -ENOENT); |
| 25 | handoff_load_dram_size(ho); |
| 26 | #ifdef CONFIG_TPL |
| 27 | /* TODO(sjg@chromium.org): MTRR cannot be adjusted without a hang */ |
| 28 | mtrr_add_request(MTRR_TYPE_WRBACK, 0, 2ULL << 30); |
| 29 | #else |
| 30 | mtrr_add_request(MTRR_TYPE_WRBACK, 0, gd->ram_size); |
| 31 | mtrr_commit(true); |
| 32 | #endif |
| 33 | |
| 34 | return 0; |
| 35 | } |
| 36 | |
| 37 | int checkcpu(void) |
| 38 | { |
| 39 | return 0; |
| 40 | } |
| 41 | |
| 42 | int print_cpuinfo(void) |
| 43 | { |
| 44 | return 0; |
| 45 | } |
| 46 | |
| 47 | void board_debug_uart_init(void) |
| 48 | { |
| 49 | } |
| 50 | |
| 51 | int dram_init_banksize(void) |
| 52 | { |
| 53 | #ifdef CONFIG_NR_DRAM_BANKS |
| 54 | struct spl_handoff *ho; |
| 55 | |
| 56 | ho = bloblist_find(BLOBLISTT_SPL_HANDOFF, sizeof(*ho)); |
| 57 | if (!ho) |
| 58 | return log_msg_ret("Missing SPL hand-off info", -ENOENT); |
| 59 | handoff_load_dram_banks(ho); |
| 60 | #endif |
| 61 | |
| 62 | return 0; |
| 63 | } |