2 * (C) Copyright 2002-2010
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 * SPDX-License-Identifier: GPL-2.0+
8 #ifndef __ASM_GBL_DATA_H
9 #define __ASM_GBL_DATA_H
13 #include <asm/processor.h>
15 enum pei_boot_mode_t {
29 uint64_t total_memory;
30 uint64_t total_32bit_memory;
31 struct memory_area area[CONFIG_NR_DRAM_BANKS];
34 #define MAX_MTRR_REQUESTS 8
37 * A request for a memory region to be set up in a particular way. These
38 * requests are processed before board_init_r() is called. They are generally
39 * optional and can be ignored with some performance impact.
42 int type; /* MTRR_TYPE_... */
47 /* Architecture-specific global data */
48 struct arch_global_data {
49 u64 gdt[X86_GDT_NUM_ENTRIES] __aligned(16);
50 struct global_data *gd_addr; /* Location of Global Data */
51 uint8_t x86; /* CPU family */
52 uint8_t x86_vendor; /* CPU vendor */
56 uint64_t tsc_base; /* Initial value returned by rdtsc() */
57 uint32_t tsc_base_kclocks; /* Initial tsc as a kclocks value */
58 uint32_t tsc_prev; /* For show_boot_progress() */
59 uint32_t tsc_mhz; /* TSC frequency in MHz */
60 void *new_fdt; /* Relocated FDT */
61 uint32_t bist; /* Built-in self test value */
62 enum pei_boot_mode_t pei_boot_mode;
63 const struct pch_gpio_map *gpio_map; /* board GPIO map */
64 struct memory_info meminfo; /* Memory information */
65 #ifdef CONFIG_HAVE_FSP
66 void *hob_list; /* FSP HOB list */
68 struct mtrr_request mtrr_req[MAX_MTRR_REQUESTS];
71 /* MRC training data to save for the next boot */
73 unsigned int mrc_output_len;
74 ulong table; /* Table pointer from previous loader */
79 #include <asm-generic/global_data.h>
82 # ifdef CONFIG_EFI_APP
84 #define gd global_data_ptr
86 #define DECLARE_GLOBAL_DATA_PTR extern struct global_data *global_data_ptr
88 static inline __attribute__((no_instrument_function)) gd_t *get_fs_gd_ptr(void)
92 asm volatile("fs movl 0, %0\n" : "=r" (gd_ptr));
97 #define gd get_fs_gd_ptr()
99 #define DECLARE_GLOBAL_DATA_PTR
105 * Our private Global Data Flags
107 #define GD_FLG_COLD_BOOT 0x10000 /* Cold Boot */
108 #define GD_FLG_WARM_BOOT 0x20000 /* Warm Boot */
110 #endif /* __ASM_GBL_DATA_H */