blob: d32987b7ec8495a7bb9b513ef8617aee22b25263 [file] [log] [blame]
wdenk2262cfe2002-11-18 00:14:45 +00001/*
Wolfgang Denk91a76752010-07-24 20:22:02 +02002 * (C) Copyright 2002-2010
wdenk2262cfe2002-11-18 00:14:45 +00003 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
wdenk2262cfe2002-11-18 00:14:45 +00006 */
7
8#ifndef __ASM_GBL_DATA_H
9#define __ASM_GBL_DATA_H
Simon Glass5cb48582012-12-13 20:48:30 +000010
11#ifndef __ASSEMBLY__
12
13/* Architecture-specific global data */
14struct arch_global_data {
Simon Glass5a35e6c2012-12-13 20:48:41 +000015 struct global_data *gd_addr; /* Location of Global Data */
Bin Meng52f952b2014-11-09 22:18:56 +080016 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;
Simon Glassbc2df1a2013-02-28 19:26:12 +000021 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() */
Bin Meng258b1352014-11-09 22:19:35 +080024 uint32_t tsc_mhz; /* TSC frequency in MHz */
Simon Glassf697d522013-02-28 19:26:15 +000025 void *new_fdt; /* Relocated FDT */
Simon Glassf67cd512014-11-06 13:20:10 -070026 uint32_t bist; /* Built-in self test value */
Simon Glass7430f102014-11-12 22:42:12 -070027 struct pci_controller *hose; /* PCI hose for early use */
Simon Glass5cb48582012-12-13 20:48:30 +000028};
29
Graeme Russ9558b482011-09-01 00:48:27 +000030#endif
wdenk2262cfe2002-11-18 00:14:45 +000031
Simon Glass43cff662012-12-13 20:49:27 +000032#include <asm-generic/global_data.h>
33
34#ifndef __ASSEMBLY__
Simon Glassd8819f92013-06-11 11:14:52 -070035static inline __attribute__((no_instrument_function)) gd_t *get_fs_gd_ptr(void)
Graeme Russ9e6c5722011-12-31 22:58:15 +110036{
37 gd_t *gd_ptr;
38
39 asm volatile("fs movl 0, %0\n" : "=r" (gd_ptr));
40
41 return gd_ptr;
42}
43
44#define gd get_fs_gd_ptr()
Graeme Russ161b3582010-10-07 20:03:29 +110045
46#endif
47
Gabe Black91d82a22012-11-03 11:41:28 +000048/*
49 * Our private Global Data Flags
50 */
51#define GD_FLG_COLD_BOOT 0x00100 /* Cold Boot */
52#define GD_FLG_WARM_BOOT 0x00200 /* Warm Boot */
53
Graeme Russ3ef96de2008-09-07 07:08:42 +100054#define DECLARE_GLOBAL_DATA_PTR
wdenk2262cfe2002-11-18 00:14:45 +000055
56#endif /* __ASM_GBL_DATA_H */