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