1*00f892fcSMacpaul Lin /* 2*00f892fcSMacpaul Lin * (C) Copyright 2002 3*00f892fcSMacpaul Lin * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4*00f892fcSMacpaul Lin * 5*00f892fcSMacpaul Lin * Copyright (C) 2011 Andes Technology Corporation 6*00f892fcSMacpaul Lin * Shawn Lin, Andes Technology Corporation <nobuhiro@andestech.com> 7*00f892fcSMacpaul Lin * Macpaul Lin, Andes Technology Corporation <macpaul@andestech.com> 8*00f892fcSMacpaul Lin * 9*00f892fcSMacpaul Lin * See file CREDITS for list of people who contributed to this 10*00f892fcSMacpaul Lin * project. 11*00f892fcSMacpaul Lin * 12*00f892fcSMacpaul Lin * This program is free software; you can redistribute it and/or 13*00f892fcSMacpaul Lin * modify it under the terms of the GNU General Public License as 14*00f892fcSMacpaul Lin * published by the Free Software Foundation; either version 2 of 15*00f892fcSMacpaul Lin * the License, or (at your option) any later version. 16*00f892fcSMacpaul Lin * 17*00f892fcSMacpaul Lin * This program is distributed in the hope that it will be useful, 18*00f892fcSMacpaul Lin * but WITHOUT ANY WARRANTY; without even the implied warranty of 19*00f892fcSMacpaul Lin * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20*00f892fcSMacpaul Lin * GNU General Public License for more details. 21*00f892fcSMacpaul Lin * 22*00f892fcSMacpaul Lin * You should have received a copy of the GNU General Public License 23*00f892fcSMacpaul Lin * along with this program; if not, write to the Free Software 24*00f892fcSMacpaul Lin * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 25*00f892fcSMacpaul Lin * MA 02111-1307 USA 26*00f892fcSMacpaul Lin */ 27*00f892fcSMacpaul Lin 28*00f892fcSMacpaul Lin /************************************************************** 29*00f892fcSMacpaul Lin * CAUTION: 30*00f892fcSMacpaul Lin * - do not implement for NDS32 Arch yet. 31*00f892fcSMacpaul Lin * - so far no one uses the macros defined in this head file. 32*00f892fcSMacpaul Lin **************************************************************/ 33*00f892fcSMacpaul Lin 34*00f892fcSMacpaul Lin #ifndef __ASM_GBL_DATA_H 35*00f892fcSMacpaul Lin #define __ASM_GBL_DATA_H 36*00f892fcSMacpaul Lin /* 37*00f892fcSMacpaul Lin * The following data structure is placed in some memory wich is 38*00f892fcSMacpaul Lin * available very early after boot (like DPRAM on MPC8xx/MPC82xx, or 39*00f892fcSMacpaul Lin * some locked parts of the data cache) to allow for a minimum set of 40*00f892fcSMacpaul Lin * global variables during system initialization (until we have set 41*00f892fcSMacpaul Lin * up the memory controller so that we can use RAM). 42*00f892fcSMacpaul Lin * 43*00f892fcSMacpaul Lin * Keep it *SMALL* and remember to set CONFIG_GBL_DATA_SIZE > sizeof(gd_t) 44*00f892fcSMacpaul Lin */ 45*00f892fcSMacpaul Lin 46*00f892fcSMacpaul Lin typedef struct global_data { 47*00f892fcSMacpaul Lin bd_t *bd; 48*00f892fcSMacpaul Lin unsigned long flags; 49*00f892fcSMacpaul Lin unsigned long baudrate; 50*00f892fcSMacpaul Lin unsigned long have_console; /* serial_init() was called */ 51*00f892fcSMacpaul Lin 52*00f892fcSMacpaul Lin unsigned long reloc_off; /* Relocation Offset */ 53*00f892fcSMacpaul Lin unsigned long env_addr; /* Address of Environment struct */ 54*00f892fcSMacpaul Lin unsigned long env_valid; /* Checksum of Environment valid? */ 55*00f892fcSMacpaul Lin unsigned long fb_base; /* base address of frame buffer */ 56*00f892fcSMacpaul Lin 57*00f892fcSMacpaul Lin unsigned long relocaddr; /* Start address of U-Boot in RAM */ 58*00f892fcSMacpaul Lin phys_size_t ram_size; /* RAM size */ 59*00f892fcSMacpaul Lin unsigned long mon_len; /* monitor len */ 60*00f892fcSMacpaul Lin unsigned long irq_sp; /* irq stack pointer */ 61*00f892fcSMacpaul Lin unsigned long start_addr_sp; /* start_addr_stackpointer */ 62*00f892fcSMacpaul Lin #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF)) 63*00f892fcSMacpaul Lin unsigned long tlb_addr; 64*00f892fcSMacpaul Lin #endif 65*00f892fcSMacpaul Lin 66*00f892fcSMacpaul Lin void **jt; /* jump table */ 67*00f892fcSMacpaul Lin char env_buf[32]; /* buffer for getenv() before reloc. */ 68*00f892fcSMacpaul Lin } gd_t; 69*00f892fcSMacpaul Lin 70*00f892fcSMacpaul Lin /* 71*00f892fcSMacpaul Lin * Global Data Flags 72*00f892fcSMacpaul Lin */ 73*00f892fcSMacpaul Lin #define GD_FLG_RELOC 0x00001 /* Code was relocated to RAM */ 74*00f892fcSMacpaul Lin #define GD_FLG_DEVINIT 0x00002 /* Devices have been initialized */ 75*00f892fcSMacpaul Lin #define GD_FLG_SILENT 0x00004 /* Silent mode */ 76*00f892fcSMacpaul Lin #define GD_FLG_POSTFAIL 0x00008 /* Critical POST test failed */ 77*00f892fcSMacpaul Lin #define GD_FLG_POSTSTOP 0x00010 /* POST seqeunce aborted */ 78*00f892fcSMacpaul Lin #define GD_FLG_LOGINIT 0x00020 /* Log Buffer has been initialized */ 79*00f892fcSMacpaul Lin #define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */ 80*00f892fcSMacpaul Lin #define GD_FLG_ENV_READY 0x00080 /* Envs imported into hash table */ 81*00f892fcSMacpaul Lin 82*00f892fcSMacpaul Lin #ifdef CONFIG_GLOBAL_DATA_NOT_REG10 83*00f892fcSMacpaul Lin extern volatile gd_t g_gd; 84*00f892fcSMacpaul Lin #define DECLARE_GLOBAL_DATA_PTR static volatile gd_t *gd = &g_gd 85*00f892fcSMacpaul Lin #else 86*00f892fcSMacpaul Lin #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("$r10") 87*00f892fcSMacpaul Lin #endif 88*00f892fcSMacpaul Lin 89*00f892fcSMacpaul Lin #endif /* __ASM_GBL_DATA_H */ 90