blob: 4d4cdafa2b0aebf3d0796577535d42b57bf038c9 [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>
Simon Glass97589732020-05-10 11:40:02 -060012#include <init.h>
Simon Glass0f2af882020-05-10 11:40:05 -060013#include <log.h>
Simon Glassc51faed2019-04-25 21:58:54 -060014#include <asm/mtrr.h>
15
16int misc_init_r(void)
17{
18 return 0;
19}
20
21int 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
40int checkcpu(void)
41{
42 return 0;
43}
44
45int print_cpuinfo(void)
46{
47 return 0;
48}
49
50void board_debug_uart_init(void)
51{
52}
53
54int dram_init_banksize(void)
55{
Simon Glassc51faed2019-04-25 21:58:54 -060056 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 Glassc51faed2019-04-25 21:58:54 -060062
63 return 0;
64}