1、gd_t: global data数据结构定义,位于文件include/asm-arm/global_data.h。其成员主要是一些全局的系统初始化参数。当使用gd_t时需用宏定义进行声明:DECLARE_GLOBAL_DATA_PTR,指定占用寄存器R8。

*The following data structure is placed in some memory wich is
*available very early after boot (like DPRAM on MPC8xx/MPC82xx, or
*some locked parts of the data cache) to allow for a minimum set of
*global variables during system initialization (until we have set
*up the memory controller so that we can use RAM).
* Keep it*SMALL* and remember to set CFG_GBL_DATA_SIZE > sizeof(gd_t)

ypedef struct global_data {
bd_t *bd;                                //struct board_info指针,保存板子信息
unsigned long flags;                //指示标志,如设备已经初始化标志等
unsigned long baudrate;          //串口波特率
unsigned long have_console;    //串口初始化标志
unsigned long env_addr;          //Address of Environment struct ,环境参数地址
unsigned long env_valid;          //环境参数CRC检验有效标志
unsigned long fb_base;            //frame buffer的基址
unsigned char vfd_type;            /*display type */
#if 0
unsigned long cpu_clk;            /* CPU clock in Hz! */
unsignedlong bus_clk;
unsigned long ram_size;            /*RAM size */
unsigned long reset_status;      /*reset status register at boot */
void **jt;                                    /*jump table */
} gd_t;


*Global Data Flags

#defineGD_FLG_RELOC0x00001      /*Code was relocated to RAM */
#define GD_FLG_DEVINIT 0x00002    /*Devices have been initialized */
#define GD_FLG_SILENT0x00004      /*Silent mode */
#define GD_FLG_POSTFAIL 0x00008  /*Critical POST test failed */

#define GD_FLG_POSTSTOP 0x00010  /*POST seqeunce aborted */

#define GD_FLG_LOGINIT 0x00020    /*Log Buffer has been initialized */

#defineGD_FLG_DISABLE_CONSOLE 0x00040 /*Disable console (in & out) */
#defineDECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r8")