blob: 3e8e2cdb9ebdd65f304848678f7038250db72c8d [file] [log] [blame]
wdenk591dda52002-11-18 00:14:45 +00001/*
Wolfgang Denkf710efd2010-07-24 20:22:02 +02002 * (C) Copyright 2002-2010
wdenk591dda52002-11-18 00:14:45 +00003 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
wdenk591dda52002-11-18 00:14:45 +00006 */
7
8#ifndef __ASM_GBL_DATA_H
9#define __ASM_GBL_DATA_H
Simon Glass3ac47d72012-12-13 20:48:30 +000010
11#ifndef __ASSEMBLY__
12
13/* Architecture-specific global data */
14struct arch_global_data {
Simon Glass2e4df992012-12-13 20:48:41 +000015 struct global_data *gd_addr; /* Location of Global Data */
Simon Glass6fa6e4a2013-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 Glass347c05b2013-02-28 19:26:15 +000019 void *new_fdt; /* Relocated FDT */
Simon Glass3ac47d72012-12-13 20:48:30 +000020};
21
Graeme Russ3c28f482011-09-01 00:48:27 +000022#endif
wdenk591dda52002-11-18 00:14:45 +000023
Simon Glassd3887632012-12-13 20:49:27 +000024#include <asm-generic/global_data.h>
25
26#ifndef __ASSEMBLY__
Simon Glass42081ce2013-06-11 11:14:52 -070027static inline __attribute__((no_instrument_function)) gd_t *get_fs_gd_ptr(void)
Graeme Russ35368962011-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 Russ5fb91cc2010-10-07 20:03:29 +110037
38#endif
39
Gabe Blackef899322012-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 Russ2fe2a972008-09-07 07:08:42 +100046#define DECLARE_GLOBAL_DATA_PTR
wdenk591dda52002-11-18 00:14:45 +000047
48#endif /* __ASM_GBL_DATA_H */