common: Move checkcpu() out of common.h
[platform/kernel/u-boot.git] / arch / x86 / cpu / broadwell / cpu_from_spl.c
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 <cpu_func.h>
10 #include <debug_uart.h>
11 #include <handoff.h>
12 #include <asm/mtrr.h>
13
14 int misc_init_r(void)
15 {
16         return 0;
17 }
18
19 int 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
38 int checkcpu(void)
39 {
40         return 0;
41 }
42
43 int print_cpuinfo(void)
44 {
45         return 0;
46 }
47
48 void board_debug_uart_init(void)
49 {
50 }
51
52 int 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 }