blob: df5a9675ee4baf380c7cd53fdbc79cd8f9013afe [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
Tom Riniabb9a042024-05-18 20:20:43 -06007#include <common.h>
Simon Glassc51faed2019-04-25 21:58:54 -06008#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 Glass3ba929a2020-10-30 21:38:53 -060014#include <asm/global_data.h>
Simon Glassc51faed2019-04-25 21:58:54 -060015#include <asm/mtrr.h>
16
17int misc_init_r(void)
18{
19 return 0;
20}
21
22int dram_init(void)
23{
24 struct spl_handoff *ho;
25
Simon Glass90c1a582022-01-12 19:26:17 -070026 ho = bloblist_find(BLOBLISTT_U_BOOT_SPL_HANDOFF, sizeof(*ho));
Simon Glassc51faed2019-04-25 21:58:54 -060027 if (!ho)
28 return log_msg_ret("Missing SPL hand-off info", -ENOENT);
29 handoff_load_dram_size(ho);
30#ifdef CONFIG_TPL
31 /* TODO(sjg@chromium.org): MTRR cannot be adjusted without a hang */
32 mtrr_add_request(MTRR_TYPE_WRBACK, 0, 2ULL << 30);
33#else
34 mtrr_add_request(MTRR_TYPE_WRBACK, 0, gd->ram_size);
35 mtrr_commit(true);
36#endif
37
38 return 0;
39}
40
41int checkcpu(void)
42{
43 return 0;
44}
45
46int print_cpuinfo(void)
47{
48 return 0;
49}
50
51void board_debug_uart_init(void)
52{
53}
54
55int dram_init_banksize(void)
56{
Simon Glassc51faed2019-04-25 21:58:54 -060057 struct spl_handoff *ho;
58
Simon Glass90c1a582022-01-12 19:26:17 -070059 ho = bloblist_find(BLOBLISTT_U_BOOT_SPL_HANDOFF, sizeof(*ho));
Simon Glassc51faed2019-04-25 21:58:54 -060060 if (!ho)
61 return log_msg_ret("Missing SPL hand-off info", -ENOENT);
62 handoff_load_dram_banks(ho);
Simon Glassc51faed2019-04-25 21:58:54 -060063
64 return 0;
65}