xref: /rk3399_rockchip-uboot/include/asm-generic/global_data.h (revision 71c52dba2bf42937e6c6b736393eeecb11f10d8f)
150b1fa39SSimon Glass /*
250b1fa39SSimon Glass  * Copyright (c) 2012 The Chromium OS Authors.
350b1fa39SSimon Glass  * (C) Copyright 2002-2010
450b1fa39SSimon Glass  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
550b1fa39SSimon Glass  *
650b1fa39SSimon Glass  * See file CREDITS for list of people who contributed to this
750b1fa39SSimon Glass  * project.
850b1fa39SSimon Glass  *
950b1fa39SSimon Glass  * This program is free software; you can redistribute it and/or
1050b1fa39SSimon Glass  * modify it under the terms of the GNU General Public License as
1150b1fa39SSimon Glass  * published by the Free Software Foundation; either version 2 of
1250b1fa39SSimon Glass  * the License, or (at your option) any later version.
1350b1fa39SSimon Glass  *
1450b1fa39SSimon Glass  * This program is distributed in the hope that it will be useful,
1550b1fa39SSimon Glass  * but WITHOUT ANY WARRANTY; without even the implied warranty of
1650b1fa39SSimon Glass  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1750b1fa39SSimon Glass  * GNU General Public License for more details.
1850b1fa39SSimon Glass  *
1950b1fa39SSimon Glass  * You should have received a copy of the GNU General Public License
2050b1fa39SSimon Glass  * along with this program; if not, write to the Free Software
2150b1fa39SSimon Glass  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
2250b1fa39SSimon Glass  * MA 02111-1307 USA
2350b1fa39SSimon Glass  */
2450b1fa39SSimon Glass 
2550b1fa39SSimon Glass #ifndef __ASM_GENERIC_GBL_DATA_H
2650b1fa39SSimon Glass #define __ASM_GENERIC_GBL_DATA_H
2750b1fa39SSimon Glass /*
2850b1fa39SSimon Glass  * The following data structure is placed in some memory which is
2950b1fa39SSimon Glass  * available very early after boot (like DPRAM on MPC8xx/MPC82xx, or
3050b1fa39SSimon Glass  * some locked parts of the data cache) to allow for a minimum set of
3150b1fa39SSimon Glass  * global variables during system initialization (until we have set
3250b1fa39SSimon Glass  * up the memory controller so that we can use RAM).
3350b1fa39SSimon Glass  *
3450b1fa39SSimon Glass  * Keep it *SMALL* and remember to set GENERATED_GBL_DATA_SIZE > sizeof(gd_t)
3550b1fa39SSimon Glass  *
3650b1fa39SSimon Glass  * Each architecture has its own private fields. For now all are private
3750b1fa39SSimon Glass  */
3850b1fa39SSimon Glass 
3950b1fa39SSimon Glass #ifndef __ASSEMBLY__
4050b1fa39SSimon Glass typedef struct global_data {
4150b1fa39SSimon Glass 	bd_t *bd;
4250b1fa39SSimon Glass 	unsigned long flags;
43b5bec884SSimon Glass 	unsigned int baudrate;
4450b1fa39SSimon Glass 	unsigned long cpu_clk;	/* CPU clock in Hz!		*/
4550b1fa39SSimon Glass 	unsigned long bus_clk;
4650b1fa39SSimon Glass 	/* We cannot bracket this with CONFIG_PCI due to mpc5xxx */
4750b1fa39SSimon Glass 	unsigned long pci_clk;
4850b1fa39SSimon Glass 	unsigned long mem_clk;
4950b1fa39SSimon Glass #if defined(CONFIG_LCD) || defined(CONFIG_VIDEO)
5050b1fa39SSimon Glass 	unsigned long fb_base;	/* Base address of framebuffer mem */
5150b1fa39SSimon Glass #endif
5250b1fa39SSimon Glass #if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
5350b1fa39SSimon Glass 	unsigned long post_log_word;  /* Record POST activities */
5450b1fa39SSimon Glass 	unsigned long post_log_res; /* success of POST test */
5550b1fa39SSimon Glass 	unsigned long post_init_f_time;  /* When post_init_f started */
5650b1fa39SSimon Glass #endif
5750b1fa39SSimon Glass #ifdef CONFIG_BOARD_TYPES
5850b1fa39SSimon Glass 	unsigned long board_type;
5950b1fa39SSimon Glass #endif
6050b1fa39SSimon Glass 	unsigned long have_console;	/* serial_init() was called */
6150b1fa39SSimon Glass #ifdef CONFIG_PRE_CONSOLE_BUFFER
6250b1fa39SSimon Glass 	unsigned long precon_buf_idx;	/* Pre-Console buffer index */
6350b1fa39SSimon Glass #endif
6450b1fa39SSimon Glass #ifdef CONFIG_MODEM_SUPPORT
6550b1fa39SSimon Glass 	unsigned long do_mdm_init;
6650b1fa39SSimon Glass 	unsigned long be_quiet;
6750b1fa39SSimon Glass #endif
6850b1fa39SSimon Glass 	unsigned long env_addr;	/* Address  of Environment struct */
6950b1fa39SSimon Glass 	unsigned long env_valid;	/* Checksum of Environment valid? */
7050b1fa39SSimon Glass 
7150b1fa39SSimon Glass 	unsigned long ram_top;	/* Top address of RAM used by U-Boot */
7250b1fa39SSimon Glass 
7350b1fa39SSimon Glass 	unsigned long relocaddr;	/* Start address of U-Boot in RAM */
7450b1fa39SSimon Glass 	phys_size_t ram_size;	/* RAM size */
7550b1fa39SSimon Glass 	unsigned long mon_len;	/* monitor len */
7650b1fa39SSimon Glass 	unsigned long irq_sp;		/* irq stack pointer */
7750b1fa39SSimon Glass 	unsigned long start_addr_sp;	/* start_addr_stackpointer */
7850b1fa39SSimon Glass 	unsigned long reloc_off;
7950b1fa39SSimon Glass 	struct global_data *new_gd;	/* relocated global data */
8050b1fa39SSimon Glass 	const void *fdt_blob;	/* Our device tree, NULL if none */
811938f4a5SSimon Glass 	void *new_fdt;		/* Relocated FDT */
821938f4a5SSimon Glass 	unsigned long fdt_size;	/* Space reserved for relocated FDT */
8350b1fa39SSimon Glass 	void **jt;		/* jump table */
8450b1fa39SSimon Glass 	char env_buf[32];	/* buffer for getenv() before reloc. */
85*71c52dbaSSimon Glass #ifdef CONFIG_TRACE
86*71c52dbaSSimon Glass 	void		*trace_buff;	/* The trace buffer */
87*71c52dbaSSimon Glass #endif
8850b1fa39SSimon Glass 	struct arch_global_data arch;	/* architecture-specific data */
8950b1fa39SSimon Glass } gd_t;
9050b1fa39SSimon Glass #endif
9150b1fa39SSimon Glass 
9250b1fa39SSimon Glass /*
9350b1fa39SSimon Glass  * Global Data Flags
9450b1fa39SSimon Glass  */
9550b1fa39SSimon Glass #define GD_FLG_RELOC		0x00001	/* Code was relocated to RAM	   */
9650b1fa39SSimon Glass #define GD_FLG_DEVINIT		0x00002	/* Devices have been initialized   */
9750b1fa39SSimon Glass #define GD_FLG_SILENT		0x00004	/* Silent mode			   */
9850b1fa39SSimon Glass #define GD_FLG_POSTFAIL		0x00008	/* Critical POST test failed	   */
9950b1fa39SSimon Glass #define GD_FLG_POSTSTOP		0x00010	/* POST seqeunce aborted	   */
10050b1fa39SSimon Glass #define GD_FLG_LOGINIT		0x00020	/* Log Buffer has been initialized */
10150b1fa39SSimon Glass #define GD_FLG_DISABLE_CONSOLE	0x00040	/* Disable console (in & out)	   */
10250b1fa39SSimon Glass #define GD_FLG_ENV_READY	0x00080	/* Env. imported into hash table   */
10350b1fa39SSimon Glass 
10450b1fa39SSimon Glass #endif /* __ASM_GENERIC_GBL_DATA_H */
105