xref: /rk3399_rockchip-uboot/arch/nds32/include/asm/global_data.h (revision 5cb48582ac05931c66b00b46c60d3ee8c6fc7950)
100f892fcSMacpaul Lin /*
200f892fcSMacpaul Lin  * (C) Copyright 2002
300f892fcSMacpaul Lin  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
400f892fcSMacpaul Lin  *
500f892fcSMacpaul Lin  * Copyright (C) 2011 Andes Technology Corporation
600f892fcSMacpaul Lin  * Shawn Lin, Andes Technology Corporation <nobuhiro@andestech.com>
700f892fcSMacpaul Lin  * Macpaul Lin, Andes Technology Corporation <macpaul@andestech.com>
800f892fcSMacpaul Lin  *
900f892fcSMacpaul Lin  * See file CREDITS for list of people who contributed to this
1000f892fcSMacpaul Lin  * project.
1100f892fcSMacpaul Lin  *
1200f892fcSMacpaul Lin  * This program is free software; you can redistribute it and/or
1300f892fcSMacpaul Lin  * modify it under the terms of the GNU General Public License as
1400f892fcSMacpaul Lin  * published by the Free Software Foundation; either version 2 of
1500f892fcSMacpaul Lin  * the License, or (at your option) any later version.
1600f892fcSMacpaul Lin  *
1700f892fcSMacpaul Lin  * This program is distributed in the hope that it will be useful,
1800f892fcSMacpaul Lin  * but WITHOUT ANY WARRANTY; without even the implied warranty of
1900f892fcSMacpaul Lin  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2000f892fcSMacpaul Lin  * GNU General Public License for more details.
2100f892fcSMacpaul Lin  *
2200f892fcSMacpaul Lin  * You should have received a copy of the GNU General Public License
2300f892fcSMacpaul Lin  * along with this program; if not, write to the Free Software
2400f892fcSMacpaul Lin  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
2500f892fcSMacpaul Lin  * MA 02111-1307 USA
2600f892fcSMacpaul Lin  */
2700f892fcSMacpaul Lin 
2800f892fcSMacpaul Lin /**************************************************************
2900f892fcSMacpaul Lin  * CAUTION:
3000f892fcSMacpaul Lin  *   - do not implement for NDS32 Arch yet.
3100f892fcSMacpaul Lin  *   - so far no one uses the macros defined in this head file.
3200f892fcSMacpaul Lin  **************************************************************/
3300f892fcSMacpaul Lin 
3400f892fcSMacpaul Lin #ifndef	__ASM_GBL_DATA_H
3500f892fcSMacpaul Lin #define __ASM_GBL_DATA_H
36*5cb48582SSimon Glass 
37*5cb48582SSimon Glass /* Architecture-specific global data */
38*5cb48582SSimon Glass struct arch_global_data {
39*5cb48582SSimon Glass };
40*5cb48582SSimon Glass 
4100f892fcSMacpaul Lin /*
4200f892fcSMacpaul Lin  * The following data structure is placed in some memory wich is
4300f892fcSMacpaul Lin  * available very early after boot (like DPRAM on MPC8xx/MPC82xx, or
4400f892fcSMacpaul Lin  * some locked parts of the data cache) to allow for a minimum set of
4500f892fcSMacpaul Lin  * global variables during system initialization (until we have set
4600f892fcSMacpaul Lin  * up the memory controller so that we can use RAM).
4700f892fcSMacpaul Lin  */
4800f892fcSMacpaul Lin 
4900f892fcSMacpaul Lin typedef	struct global_data {
5000f892fcSMacpaul Lin 	bd_t		*bd;
5100f892fcSMacpaul Lin 	unsigned long	flags;
52a25356d7SSimon Glass 	unsigned int	baudrate;
5300f892fcSMacpaul Lin 	unsigned long	have_console;	/* serial_init() was called */
5400f892fcSMacpaul Lin 
5500f892fcSMacpaul Lin 	unsigned long	reloc_off;	/* Relocation Offset */
5600f892fcSMacpaul Lin 	unsigned long	env_addr;	/* Address  of Environment struct */
5700f892fcSMacpaul Lin 	unsigned long	env_valid;	/* Checksum of Environment valid? */
5800f892fcSMacpaul Lin 	unsigned long	fb_base;	/* base address of frame buffer */
5900f892fcSMacpaul Lin 
6000f892fcSMacpaul Lin 	unsigned long	relocaddr;	/* Start address of U-Boot in RAM */
6100f892fcSMacpaul Lin 	phys_size_t	ram_size;	/* RAM size */
6200f892fcSMacpaul Lin 	unsigned long	mon_len;	/* monitor len */
6300f892fcSMacpaul Lin 	unsigned long	irq_sp;		/* irq stack pointer */
6400f892fcSMacpaul Lin 	unsigned long	start_addr_sp;	/* start_addr_stackpointer */
6500f892fcSMacpaul Lin #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
6600f892fcSMacpaul Lin 	unsigned long	tlb_addr;
6700f892fcSMacpaul Lin #endif
6800f892fcSMacpaul Lin 
6900f892fcSMacpaul Lin 	void		**jt;		/* jump table */
7000f892fcSMacpaul Lin 	char		env_buf[32];	/* buffer for getenv() before reloc. */
71*5cb48582SSimon Glass 	struct arch_global_data arch;	/* architecture-specific data */
7200f892fcSMacpaul Lin } gd_t;
7300f892fcSMacpaul Lin 
7447fde91fSMike Frysinger #include <asm-generic/global_data_flags.h>
7500f892fcSMacpaul Lin 
7600f892fcSMacpaul Lin #ifdef CONFIG_GLOBAL_DATA_NOT_REG10
7700f892fcSMacpaul Lin extern volatile gd_t g_gd;
7800f892fcSMacpaul Lin #define DECLARE_GLOBAL_DATA_PTR		static volatile gd_t *gd = &g_gd
7900f892fcSMacpaul Lin #else
8000f892fcSMacpaul Lin #define DECLARE_GLOBAL_DATA_PTR		register volatile gd_t *gd asm ("$r10")
8100f892fcSMacpaul Lin #endif
8200f892fcSMacpaul Lin 
8300f892fcSMacpaul Lin #endif /* __ASM_GBL_DATA_H */
84