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 135cb48582SSimon Glass /* Architecture-specific global data */ 145cb48582SSimon Glass struct arch_global_data { 155a35e6c4SSimon Glass struct global_data *gd_addr; /* Location of Global Data */ 1652f952bfSBin Meng uint8_t x86; /* CPU family */ 1752f952bfSBin Meng uint8_t x86_vendor; /* CPU vendor */ 1852f952bfSBin Meng uint8_t x86_model; 1952f952bfSBin Meng uint8_t x86_mask; 2052f952bfSBin Meng uint32_t x86_device; 21bc2df1afSSimon Glass uint64_t tsc_base; /* Initial value returned by rdtsc() */ 22bc2df1afSSimon Glass uint32_t tsc_base_kclocks; /* Initial tsc as a kclocks value */ 23bc2df1afSSimon Glass uint32_t tsc_prev; /* For show_boot_progress() */ 24*258b1357SBin Meng uint32_t tsc_mhz; /* TSC frequency in MHz */ 25f697d528SSimon Glass void *new_fdt; /* Relocated FDT */ 26f67cd51eSSimon Glass uint32_t bist; /* Built-in self test value */ 275cb48582SSimon Glass }; 285cb48582SSimon Glass 299558b48aSGraeme Russ #endif 30fea25720SGraeme Russ 3143cff66eSSimon Glass #include <asm-generic/global_data.h> 3243cff66eSSimon Glass 3343cff66eSSimon Glass #ifndef __ASSEMBLY__ 34d8819f94SSimon Glass static inline __attribute__((no_instrument_function)) gd_t *get_fs_gd_ptr(void) 359e6c572fSGraeme Russ { 369e6c572fSGraeme Russ gd_t *gd_ptr; 379e6c572fSGraeme Russ 389e6c572fSGraeme Russ asm volatile("fs movl 0, %0\n" : "=r" (gd_ptr)); 399e6c572fSGraeme Russ 409e6c572fSGraeme Russ return gd_ptr; 419e6c572fSGraeme Russ } 429e6c572fSGraeme Russ 439e6c572fSGraeme Russ #define gd get_fs_gd_ptr() 44fea25720SGraeme Russ 45fea25720SGraeme Russ #endif 46fea25720SGraeme Russ 4791d82a29SGabe Black /* 4891d82a29SGabe Black * Our private Global Data Flags 4991d82a29SGabe Black */ 5091d82a29SGabe Black #define GD_FLG_COLD_BOOT 0x00100 /* Cold Boot */ 5191d82a29SGabe Black #define GD_FLG_WARM_BOOT 0x00200 /* Warm Boot */ 5291d82a29SGabe Black 53fea25720SGraeme Russ #define DECLARE_GLOBAL_DATA_PTR 54fea25720SGraeme Russ 55fea25720SGraeme Russ #endif /* __ASM_GBL_DATA_H */ 56