]> git.sur5r.net Git - u-boot/blob - arch/x86/include/asm/global_data.h
x86: Do CPU identification in the early phase
[u-boot] / arch / x86 / include / asm / global_data.h
1 /*
2  * (C) Copyright 2002-2010
3  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4  *
5  * SPDX-License-Identifier:     GPL-2.0+
6  */
7
8 #ifndef __ASM_GBL_DATA_H
9 #define __ASM_GBL_DATA_H
10
11 #ifndef __ASSEMBLY__
12
13 /* Architecture-specific global data */
14 struct arch_global_data {
15         struct global_data *gd_addr;            /* Location of Global Data */
16         uint8_t  x86;                   /* CPU family */
17         uint8_t  x86_vendor;            /* CPU vendor */
18         uint8_t  x86_model;
19         uint8_t  x86_mask;
20         uint32_t x86_device;
21         uint64_t tsc_base;              /* Initial value returned by rdtsc() */
22         uint32_t tsc_base_kclocks;      /* Initial tsc as a kclocks value */
23         uint32_t tsc_prev;              /* For show_boot_progress() */
24         void *new_fdt;                  /* Relocated FDT */
25         uint32_t bist;                  /* Built-in self test value */
26 };
27
28 #endif
29
30 #include <asm-generic/global_data.h>
31
32 #ifndef __ASSEMBLY__
33 static inline __attribute__((no_instrument_function)) gd_t *get_fs_gd_ptr(void)
34 {
35         gd_t *gd_ptr;
36
37         asm volatile("fs movl 0, %0\n" : "=r" (gd_ptr));
38
39         return gd_ptr;
40 }
41
42 #define gd      get_fs_gd_ptr()
43
44 #endif
45
46 /*
47  * Our private Global Data Flags
48  */
49 #define GD_FLG_COLD_BOOT        0x00100 /* Cold Boot */
50 #define GD_FLG_WARM_BOOT        0x00200 /* Warm Boot */
51
52 #define DECLARE_GLOBAL_DATA_PTR
53
54 #endif /* __ASM_GBL_DATA_H */