x86: put global data pointer into the .data section
[oweals/u-boot.git] / arch / x86 / cpu / x86_64 / cpu.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 <debug_uart.h>
9
10 /*
11  * Global declaration of gd.
12  *
13  * As we write to it before relocation we have to make sure it is not put into
14  * a .bss section which may overlap a .rela section. Initialization forces it
15  * into a .data section which cannot overlap any .rela section.
16  */
17 struct global_data *global_data_ptr = (struct global_data *)~0;
18
19 void arch_setup_gd(gd_t *new_gd)
20 {
21         global_data_ptr = new_gd;
22
23         /*
24          * TODO(sjg@chromium.org): For some reason U-Boot does not boot
25          * without this line. It fails to start up U-Boot proper and instead
26          * restarts SPL. Need to figure out why:
27          *
28          * U-Boot SPL 2017.01
29          *
30          * U-Boot SPL 2017.01
31          * CPU:   Intel(R) Core(TM) i5-3427U CPU @ 1.80GHz
32          * Trying to boot from SPIJumping to 64-bit U-Boot: Note many
33          * features are missing
34          *
35          * U-Boot SPL 2017.01
36          */
37 #ifdef CONFIG_DEBUG_UART
38         printch(' ');
39 #endif
40 }
41
42 int cpu_has_64bit(void)
43 {
44         return true;
45 }
46
47 void enable_caches(void)
48 {
49         /* Not implemented */
50 }
51
52 void disable_caches(void)
53 {
54         /* Not implemented */
55 }
56
57 int dcache_status(void)
58 {
59         return true;
60 }
61
62 int x86_mp_init(void)
63 {
64         /* Not implemented */
65         return 0;
66 }
67
68 int misc_init_r(void)
69 {
70         return 0;
71 }
72
73 int checkcpu(void)
74 {
75         return 0;
76 }
77
78 int print_cpuinfo(void)
79 {
80         return 0;
81 }