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 26*5cb48582SSimon Glass 27*5cb48582SSimon Glass #ifndef __ASSEMBLY__ 28*5cb48582SSimon Glass 29*5cb48582SSimon Glass /* Architecture-specific global data */ 30*5cb48582SSimon Glass struct arch_global_data { 31*5cb48582SSimon Glass }; 32*5cb48582SSimon Glass 33fea25720SGraeme Russ /* 34fea25720SGraeme Russ * The following data structure is placed in some memory wich is 35fea25720SGraeme Russ * available very early after boot (like DPRAM on MPC8xx/MPC82xx, or 36fea25720SGraeme Russ * some locked parts of the data cache) to allow for a minimum set of 37fea25720SGraeme Russ * global variables during system initialization (until we have set 38fea25720SGraeme Russ * up the memory controller so that we can use RAM). 39fea25720SGraeme Russ */ 40fea25720SGraeme Russ 41c953fbeeSGabe Black #include <asm/u-boot.h> 42c953fbeeSGabe Black 43e4fb6116SGraeme Russ typedef struct global_data gd_t; 44e4fb6116SGraeme Russ 45e4fb6116SGraeme Russ struct global_data { 46*5cb48582SSimon Glass struct arch_global_data arch; /* architecture-specific data */ 479e6c572fSGraeme Russ /* NOTE: gd_addr MUST be first member of struct global_data! */ 48e4fb6116SGraeme Russ gd_t *gd_addr; /* Location of Global Data */ 49fea25720SGraeme Russ bd_t *bd; 50fea25720SGraeme Russ unsigned long flags; 5155f97c1bSSimon Glass unsigned int baudrate; 52fea25720SGraeme Russ unsigned long have_console; /* serial_init() was called */ 539558b48aSGraeme Russ #ifdef CONFIG_PRE_CONSOLE_BUFFER 549558b48aSGraeme Russ unsigned long precon_buf_idx; /* Pre-Console buffer index */ 559558b48aSGraeme Russ #endif 56fea25720SGraeme Russ unsigned long reloc_off; /* Relocation Offset */ 57fea25720SGraeme Russ unsigned long load_off; /* Load Offset */ 58fea25720SGraeme Russ unsigned long env_addr; /* Address of Environment struct */ 59fea25720SGraeme Russ unsigned long env_valid; /* Checksum of Environment valid? */ 60fea25720SGraeme Russ unsigned long cpu_clk; /* CPU clock in Hz! */ 61fea25720SGraeme Russ unsigned long bus_clk; 62fea25720SGraeme Russ unsigned long relocaddr; /* Start address of U-Boot in RAM */ 63fea25720SGraeme Russ unsigned long start_addr_sp; /* start_addr_stackpointer */ 649e6c572fSGraeme Russ unsigned long gdt_addr; /* Location of GDT */ 65fea25720SGraeme Russ phys_size_t ram_size; /* RAM size */ 66fea25720SGraeme Russ unsigned long reset_status; /* reset status register at boot */ 67028a5628SGabe Black const void *fdt_blob; /* Our device tree, NULL if none */ 68fea25720SGraeme Russ void **jt; /* jump table */ 69fea25720SGraeme Russ char env_buf[32]; /* buffer for getenv() before reloc. */ 70e4fb6116SGraeme Russ }; 71fea25720SGraeme Russ 729e6c572fSGraeme Russ static inline gd_t *get_fs_gd_ptr(void) 739e6c572fSGraeme Russ { 749e6c572fSGraeme Russ gd_t *gd_ptr; 759e6c572fSGraeme Russ 769e6c572fSGraeme Russ asm volatile("fs movl 0, %0\n" : "=r" (gd_ptr)); 779e6c572fSGraeme Russ 789e6c572fSGraeme Russ return gd_ptr; 799e6c572fSGraeme Russ } 809e6c572fSGraeme Russ 819e6c572fSGraeme Russ #define gd get_fs_gd_ptr() 82fea25720SGraeme Russ 83fea25720SGraeme Russ #endif 84fea25720SGraeme Russ 8547fde91fSMike Frysinger #include <asm-generic/global_data_flags.h> 86fea25720SGraeme Russ 8791d82a29SGabe Black /* 8891d82a29SGabe Black * Our private Global Data Flags 8991d82a29SGabe Black */ 9091d82a29SGabe Black #define GD_FLG_COLD_BOOT 0x00100 /* Cold Boot */ 9191d82a29SGabe Black #define GD_FLG_WARM_BOOT 0x00200 /* Warm Boot */ 9291d82a29SGabe Black 93fea25720SGraeme Russ #define DECLARE_GLOBAL_DATA_PTR 94fea25720SGraeme Russ 95fea25720SGraeme Russ #endif /* __ASM_GBL_DATA_H */ 96