1fea25720SGraeme Russ /* 2fea25720SGraeme Russ * (C) Copyright 2002-2010 3fea25720SGraeme Russ * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4fea25720SGraeme Russ * 51a459660SWolfgang Denk * SPDX-License-Identifier: GPL-2.0+ 6fea25720SGraeme Russ */ 7fea25720SGraeme Russ 8fea25720SGraeme Russ #ifndef __ASM_GBL_DATA_H 9fea25720SGraeme Russ #define __ASM_GBL_DATA_H 105cb48582SSimon Glass 115cb48582SSimon Glass #ifndef __ASSEMBLY__ 125cb48582SSimon Glass 138e0df066SSimon Glass enum pei_boot_mode_t { 148e0df066SSimon Glass PEI_BOOT_NONE = 0, 158e0df066SSimon Glass PEI_BOOT_SOFT_RESET, 168e0df066SSimon Glass PEI_BOOT_RESUME, 178e0df066SSimon Glass 188e0df066SSimon Glass }; 198e0df066SSimon Glass 205cb48582SSimon Glass /* Architecture-specific global data */ 215cb48582SSimon Glass struct arch_global_data { 225a35e6c4SSimon Glass struct global_data *gd_addr; /* Location of Global Data */ 2352f952bfSBin Meng uint8_t x86; /* CPU family */ 2452f952bfSBin Meng uint8_t x86_vendor; /* CPU vendor */ 2552f952bfSBin Meng uint8_t x86_model; 2652f952bfSBin Meng uint8_t x86_mask; 2752f952bfSBin Meng uint32_t x86_device; 28bc2df1afSSimon Glass uint64_t tsc_base; /* Initial value returned by rdtsc() */ 29bc2df1afSSimon Glass uint32_t tsc_base_kclocks; /* Initial tsc as a kclocks value */ 30bc2df1afSSimon Glass uint32_t tsc_prev; /* For show_boot_progress() */ 31258b1357SBin Meng uint32_t tsc_mhz; /* TSC frequency in MHz */ 32f697d528SSimon Glass void *new_fdt; /* Relocated FDT */ 33f67cd51eSSimon Glass uint32_t bist; /* Built-in self test value */ 347430f108SSimon Glass struct pci_controller *hose; /* PCI hose for early use */ 358e0df066SSimon Glass enum pei_boot_mode_t pei_boot_mode; 36*1b4f25ffSSimon Glass const struct pch_gpio_map *gpio_map; /* board GPIO map */ 375cb48582SSimon Glass }; 385cb48582SSimon Glass 399558b48aSGraeme Russ #endif 40fea25720SGraeme Russ 4143cff66eSSimon Glass #include <asm-generic/global_data.h> 4243cff66eSSimon Glass 4343cff66eSSimon Glass #ifndef __ASSEMBLY__ 44d8819f94SSimon Glass static inline __attribute__((no_instrument_function)) gd_t *get_fs_gd_ptr(void) 459e6c572fSGraeme Russ { 469e6c572fSGraeme Russ gd_t *gd_ptr; 479e6c572fSGraeme Russ 489e6c572fSGraeme Russ asm volatile("fs movl 0, %0\n" : "=r" (gd_ptr)); 499e6c572fSGraeme Russ 509e6c572fSGraeme Russ return gd_ptr; 519e6c572fSGraeme Russ } 529e6c572fSGraeme Russ 539e6c572fSGraeme Russ #define gd get_fs_gd_ptr() 54fea25720SGraeme Russ 55fea25720SGraeme Russ #endif 56fea25720SGraeme Russ 5791d82a29SGabe Black /* 5891d82a29SGabe Black * Our private Global Data Flags 5991d82a29SGabe Black */ 6091d82a29SGabe Black #define GD_FLG_COLD_BOOT 0x00100 /* Cold Boot */ 6191d82a29SGabe Black #define GD_FLG_WARM_BOOT 0x00200 /* Warm Boot */ 6291d82a29SGabe Black 63fea25720SGraeme Russ #define DECLARE_GLOBAL_DATA_PTR 64fea25720SGraeme Russ 65fea25720SGraeme Russ #endif /* __ASM_GBL_DATA_H */ 66