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