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 {
25 uint16_t ddr_frequency;
26 uint8_t rank_per_dimm;
30 /* The 5th byte is '\0' for the end of string */
32 /* The 19th byte is '\0' for the end of string */
33 uint8_t module_part_number[19];
39 struct pei_memory_info {
41 /* Maximum num of dimm is 8 */
42 struct dimm_info dimm[8];
52 uint64_t total_memory;
53 uint64_t total_32bit_memory;
54 struct memory_area area[CONFIG_NR_DRAM_BANKS];
57 #define MAX_MTRR_REQUESTS 8
60 * A request for a memory region to be set up in a particular way. These
61 * requests are processed before board_init_r() is called. They are generally
62 * optional and can be ignored with some performance impact.
65 int type; /* MTRR_TYPE_... */
70 /* Architecture-specific global data */
71 struct arch_global_data {
72 u64 gdt[X86_GDT_NUM_ENTRIES] __aligned(16);
73 struct global_data *gd_addr; /* Location of Global Data */
74 uint8_t x86; /* CPU family */
75 uint8_t x86_vendor; /* CPU vendor */
79 uint64_t tsc_base; /* Initial value returned by rdtsc() */
80 unsigned long clock_rate; /* Clock rate of timer in Hz */
81 void *new_fdt; /* Relocated FDT */
82 uint32_t bist; /* Built-in self test value */
83 enum pei_boot_mode_t pei_boot_mode;
84 const struct pch_gpio_map *gpio_map; /* board GPIO map */
85 struct memory_info meminfo; /* Memory information */
86 struct pei_memory_info pei_meminfo; /* PEI memory information */
87 #ifdef CONFIG_HAVE_FSP
88 void *hob_list; /* FSP HOB list */
90 struct mtrr_request mtrr_req[MAX_MTRR_REQUESTS];
93 /* MRC training data to save for the next boot */
95 unsigned int mrc_output_len;
96 ulong table; /* Table pointer from previous loader */
97 int turbo_state; /* Current turbo state */
98 struct irq_routing_table *pirq_routing_table;
101 u32 high_table_limit;
103 #ifdef CONFIG_HAVE_ACPI_RESUME
104 int prev_sleep_state; /* Previous sleep state ACPI_S0/1../5 */
105 ulong backup_mem; /* Backup memory address for S3 */
111 #include <asm-generic/global_data.h>
114 # if defined(CONFIG_EFI_APP) || CONFIG_IS_ENABLED(X86_64)
116 /* TODO(sjg@chromium.org): Consider using a fixed register for gd on x86_64 */
117 #define gd global_data_ptr
119 #define DECLARE_GLOBAL_DATA_PTR extern struct global_data *global_data_ptr
121 static inline __attribute__((no_instrument_function)) gd_t *get_fs_gd_ptr(void)
125 #if CONFIG_IS_ENABLED(X86_64)
126 asm volatile("fs mov 0, %0\n" : "=r" (gd_ptr));
128 asm volatile("fs movl 0, %0\n" : "=r" (gd_ptr));
134 #define gd get_fs_gd_ptr()
136 #define DECLARE_GLOBAL_DATA_PTR
142 * Our private Global Data Flags
144 #define GD_FLG_COLD_BOOT 0x10000 /* Cold Boot */
145 #define GD_FLG_WARM_BOOT 0x20000 /* Warm Boot */
147 #endif /* __ASM_GBL_DATA_H */