xref: /rk3399_rockchip-uboot/arch/sandbox/include/asm/global_data.h (revision f7b2af0a228645f972cc882534b68d32c739f5e9)
1744d9859SSimon Glass /*
2744d9859SSimon Glass  * Copyright (c) 2011 The Chromium OS Authors.
3744d9859SSimon Glass  *
4744d9859SSimon Glass  * (C) Copyright 2002-2010
5744d9859SSimon Glass  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6744d9859SSimon Glass  *
7744d9859SSimon Glass  * See file CREDITS for list of people who contributed to this
8744d9859SSimon Glass  * project.
9744d9859SSimon Glass  *
10744d9859SSimon Glass  * This program is free software; you can redistribute it and/or
11744d9859SSimon Glass  * modify it under the terms of the GNU General Public License as
12744d9859SSimon Glass  * published by the Free Software Foundation; either version 2 of
13744d9859SSimon Glass  * the License, or (at your option) any later version.
14744d9859SSimon Glass  *
15744d9859SSimon Glass  * This program is distributed in the hope that it will be useful,
16744d9859SSimon Glass  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17744d9859SSimon Glass  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18744d9859SSimon Glass  * GNU General Public License for more details.
19744d9859SSimon Glass  *
20744d9859SSimon Glass  * You should have received a copy of the GNU General Public License
21744d9859SSimon Glass  * along with this program; if not, write to the Free Software
22744d9859SSimon Glass  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23744d9859SSimon Glass  * MA 02111-1307 USA
24744d9859SSimon Glass  */
25744d9859SSimon Glass 
26744d9859SSimon Glass #ifndef	__ASM_GBL_DATA_H
27744d9859SSimon Glass #define __ASM_GBL_DATA_H
28744d9859SSimon Glass /*
29744d9859SSimon Glass  * The following data structure is placed in some memory wich is
30744d9859SSimon Glass  * available very early after boot (like DPRAM on MPC8xx/MPC82xx, or
31744d9859SSimon Glass  * some locked parts of the data cache) to allow for a minimum set of
32744d9859SSimon Glass  * global variables during system initialization (until we have set
33744d9859SSimon Glass  * up the memory controller so that we can use RAM).
34744d9859SSimon Glass  *
35744d9859SSimon Glass  * Keep it *SMALL* and remember to set GENERATED_GBL_DATA_SIZE > sizeof(gd_t)
36744d9859SSimon Glass  */
37744d9859SSimon Glass 
38744d9859SSimon Glass typedef	struct global_data {
39744d9859SSimon Glass 	bd_t		*bd;
40744d9859SSimon Glass 	unsigned long	flags;
41744d9859SSimon Glass 	unsigned long	baudrate;
42744d9859SSimon Glass 	unsigned long	have_console;	/* serial_init() was called */
43744d9859SSimon Glass 	unsigned long	env_addr;	/* Address  of Environment struct */
44744d9859SSimon Glass 	unsigned long	env_valid;	/* Checksum of Environment valid? */
45744d9859SSimon Glass 	unsigned long	fb_base;	/* base address of frame buffer */
46744d9859SSimon Glass 	u8		*ram_buf;	/* emulated RAM buffer */
47744d9859SSimon Glass 	phys_size_t	ram_size;	/* RAM size */
48*f7b2af0aSSimon Glass 	const void	*fdt_blob;	/* Our device tree, NULL if none */
49744d9859SSimon Glass 	void		**jt;		/* jump table */
50744d9859SSimon Glass 	char		env_buf[32];	/* buffer for getenv() before reloc. */
51744d9859SSimon Glass } gd_t;
52744d9859SSimon Glass 
53744d9859SSimon Glass /*
54744d9859SSimon Glass  * Global Data Flags
55744d9859SSimon Glass  */
56744d9859SSimon Glass #define	GD_FLG_RELOC		0x00001	/* Code was relocated to RAM */
57744d9859SSimon Glass #define	GD_FLG_DEVINIT		0x00002	/* Devices have been initialized */
58744d9859SSimon Glass #define	GD_FLG_SILENT		0x00004	/* Silent mode */
59744d9859SSimon Glass #define	GD_FLG_POSTFAIL		0x00008	/* Critical POST test failed */
60744d9859SSimon Glass #define	GD_FLG_POSTSTOP		0x00010	/* POST seqeunce aborted */
61744d9859SSimon Glass #define	GD_FLG_LOGINIT		0x00020	/* Log Buffer has been initialized */
62744d9859SSimon Glass #define GD_FLG_DISABLE_CONSOLE	0x00040	/* Disable console (in & out) */
63744d9859SSimon Glass #define GD_FLG_ENV_READY	0x00080	/* Env. imported into hash table */
64744d9859SSimon Glass 
65744d9859SSimon Glass #define DECLARE_GLOBAL_DATA_PTR     extern gd_t *gd
66744d9859SSimon Glass 
67744d9859SSimon Glass #endif /* __ASM_GBL_DATA_H */
68