uboot 移植之gd_t,bd_t

来源:互联网 发布:2017日本就业率数据 编辑:程序博客网 时间:2024/04/18 15:16
gd_t定义在uboot/include/asm-arm/global_data.h
/* * (C) Copyright 2002 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. * * See file CREDITS for list of people who contributed to this * project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA */#ifndef__ASM_GBL_DATA_H#define __ASM_GBL_DATA_H/* * 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 CONFIG_SYS_GBL_DATA_SIZE > sizeof(gd_t) */typedefstructglobal_data {bd_t*bd;unsigned longflags;unsigned longbaudrate;unsigned longhave_console;/* serial_init() was called */unsigned longenv_addr;/* Address  of Environment struct */unsigned longenv_valid;/* Checksum of Environment valid? */unsigned longfb_base;/* base address of frame buffer */#ifdef CONFIG_VFDunsigned charvfd_type;/* display type */#endif#if 0unsigned longcpu_clk;/* CPU clock in Hz!*/unsigned longbus_clk;phys_size_tram_size;/* RAM size */unsigned longreset_status;/* reset status register at boot */#endifvoid**jt;/* jump table */} gd_t;/* * Global Data Flags */#defineGD_FLG_RELOC0x00001/* Code was relocated to RAM*/#defineGD_FLG_DEVINIT0x00002/* Devices have been initialized*/#defineGD_FLG_SILENT0x00004/* Silent mode*/#defineGD_FLG_POSTFAIL0x00008/* Critical POST test failed*/#defineGD_FLG_POSTSTOP0x00010/* POST seqeunce aborted*/#defineGD_FLG_LOGINIT0x00020/* Log Buffer has been initialized*/#define GD_FLG_DISABLE_CONSOLE0x00040/* Disable console (in & out) */#define DECLARE_GLOBAL_DATA_PTR     register volatile gd_t *gd asm ("r8")//#endif /* __ASM_GBL_DATA_H */

bd_t定义在uboot/include/asm-arm/u-boot.h
/* * (C) Copyright 2002 * Sysgo Real-Time Solutions, GmbH <www.elinos.com> * Marius Groeger <mgroeger@sysgo.de> * * (C) Copyright 2002 * Sysgo Real-Time Solutions, GmbH <www.elinos.com> * Alex Zuepke <azu@sysgo.de> * * See file CREDITS for list of people who contributed to this * project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * ******************************************************************** * NOTE: This header file defines an interface to U-Boot. Including * this (unmodified) header file in another file is considered normal * use of U-Boot, and does *not* fall under the heading of "derived * work". ******************************************************************** */#ifndef _U_BOOT_H_#define _U_BOOT_H_1typedef struct bd_info {    intbi_baudrate;/* serial console baudrate */    unsigned longbi_ip_addr;/* IP Address */    struct environment_s       *bi_env;    ulong        bi_arch_number;/* unique id for this board */    ulong        bi_boot_params;/* where this board expects params */    struct/* RAM configuration */    {ulong start;ulong size;    }bi_dram[CONFIG_NR_DRAM_BANKS];} bd_t;#define bi_env_data bi_env->data#define bi_env_crc  bi_env->crc#endif/* _U_BOOT_H_ */
可参考
http://hi.baidu.com/shaoyi1110/blog/item/5246f5d1e0ac93123bf3cf56.html

原创粉丝点击