xref: /rk3399_rockchip-uboot/arch/x86/include/asm/global_data.h (revision bc2df1afb92435da6fb16310dac6b722bfaade9f)
1fea25720SGraeme Russ /*
2fea25720SGraeme Russ  * (C) Copyright 2002-2010
3fea25720SGraeme Russ  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4fea25720SGraeme Russ  *
5fea25720SGraeme Russ  * See file CREDITS for list of people who contributed to this
6fea25720SGraeme Russ  * project.
7fea25720SGraeme Russ  *
8fea25720SGraeme Russ  * This program is free software; you can redistribute it and/or
9fea25720SGraeme Russ  * modify it under the terms of the GNU General Public License as
10fea25720SGraeme Russ  * published by the Free Software Foundation; either version 2 of
11fea25720SGraeme Russ  * the License, or (at your option) any later version.
12fea25720SGraeme Russ  *
13fea25720SGraeme Russ  * This program is distributed in the hope that it will be useful,
14fea25720SGraeme Russ  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15fea25720SGraeme Russ  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16fea25720SGraeme Russ  * GNU General Public License for more details.
17fea25720SGraeme Russ  *
18fea25720SGraeme Russ  * You should have received a copy of the GNU General Public License
19fea25720SGraeme Russ  * along with this program; if not, write to the Free Software
20fea25720SGraeme Russ  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21fea25720SGraeme Russ  * MA 02111-1307 USA
22fea25720SGraeme Russ  */
23fea25720SGraeme Russ 
24fea25720SGraeme Russ #ifndef	__ASM_GBL_DATA_H
25fea25720SGraeme Russ #define __ASM_GBL_DATA_H
265cb48582SSimon Glass 
275cb48582SSimon Glass #ifndef __ASSEMBLY__
285cb48582SSimon Glass 
295cb48582SSimon Glass /* Architecture-specific global data */
305cb48582SSimon Glass struct arch_global_data {
315a35e6c4SSimon Glass 	struct global_data *gd_addr;		/* Location of Global Data */
32*bc2df1afSSimon Glass 	uint64_t tsc_base;		/* Initial value returned by rdtsc() */
33*bc2df1afSSimon Glass 	uint32_t tsc_base_kclocks;	/* Initial tsc as a kclocks value */
34*bc2df1afSSimon Glass 	uint32_t tsc_prev;		/* For show_boot_progress() */
355cb48582SSimon Glass };
365cb48582SSimon Glass 
379558b48aSGraeme Russ #endif
38fea25720SGraeme Russ 
3943cff66eSSimon Glass #include <asm-generic/global_data.h>
4043cff66eSSimon Glass 
4143cff66eSSimon Glass #ifndef __ASSEMBLY__
429e6c572fSGraeme Russ static inline gd_t *get_fs_gd_ptr(void)
439e6c572fSGraeme Russ {
449e6c572fSGraeme Russ 	gd_t *gd_ptr;
459e6c572fSGraeme Russ 
469e6c572fSGraeme Russ 	asm volatile("fs movl 0, %0\n" : "=r" (gd_ptr));
479e6c572fSGraeme Russ 
489e6c572fSGraeme Russ 	return gd_ptr;
499e6c572fSGraeme Russ }
509e6c572fSGraeme Russ 
519e6c572fSGraeme Russ #define gd	get_fs_gd_ptr()
52fea25720SGraeme Russ 
53fea25720SGraeme Russ #endif
54fea25720SGraeme Russ 
5591d82a29SGabe Black /*
5691d82a29SGabe Black  * Our private Global Data Flags
5791d82a29SGabe Black  */
5891d82a29SGabe Black #define GD_FLG_COLD_BOOT	0x00100	/* Cold Boot */
5991d82a29SGabe Black #define GD_FLG_WARM_BOOT	0x00200	/* Warm Boot */
6091d82a29SGabe Black 
61fea25720SGraeme Russ #define DECLARE_GLOBAL_DATA_PTR
62fea25720SGraeme Russ 
63fea25720SGraeme Russ #endif /* __ASM_GBL_DATA_H */
64