blob: 3e8e2cdb9ebdd65f304848678f7038250db72c8d [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 */
Simon Glassbc2df1a2013-02-28 19:26:12 +000016 uint64_t tsc_base; /* Initial value returned by rdtsc() */
17 uint32_t tsc_base_kclocks; /* Initial tsc as a kclocks value */
18 uint32_t tsc_prev; /* For show_boot_progress() */
Simon Glassf697d522013-02-28 19:26:15 +000019 void *new_fdt; /* Relocated FDT */
Simon Glass5cb48582012-12-13 20:48:30 +000020};
21
Graeme Russ9558b482011-09-01 00:48:27 +000022#endif
wdenk2262cfe2002-11-18 00:14:45 +000023
Simon Glass43cff662012-12-13 20:49:27 +000024#include <asm-generic/global_data.h>
25
26#ifndef __ASSEMBLY__
Simon Glassd8819f92013-06-11 11:14:52 -070027static inline __attribute__((no_instrument_function)) gd_t *get_fs_gd_ptr(void)
Graeme Russ9e6c5722011-12-31 22:58:15 +110028{
29 gd_t *gd_ptr;
30
31 asm volatile("fs movl 0, %0\n" : "=r" (gd_ptr));
32
33 return gd_ptr;
34}
35
36#define gd get_fs_gd_ptr()
Graeme Russ161b3582010-10-07 20:03:29 +110037
38#endif
39
Gabe Black91d82a22012-11-03 11:41:28 +000040/*
41 * Our private Global Data Flags
42 */
43#define GD_FLG_COLD_BOOT 0x00100 /* Cold Boot */
44#define GD_FLG_WARM_BOOT 0x00200 /* Warm Boot */
45
Graeme Russ3ef96de2008-09-07 07:08:42 +100046#define DECLARE_GLOBAL_DATA_PTR
wdenk2262cfe2002-11-18 00:14:45 +000047
48#endif /* __ASM_GBL_DATA_H */