U-boot的gd_t和bd_t数据结构简介
来源:互联网 发布:管家婆软件下载中心 编辑:程序博客网 时间:2024/04/25 14:08
gd_t和bd_t数据结构简介
原文出处 http://blog.chinaunix.net/uid-24810608-id-71232.html
gd_t和bd_t是u-boot中两个重要的数据结构,在初始化操作很多都要靠这两个数据结构来保存或传递。分别定义在./include/asm-arm/global_data.h和 ./include/asm-arm/u-boot.h
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)
* CFG_GBL_DATA_SIZE在config文件中定义,start.S中会根据这个值分配栈空间给global_data
*/
typedef 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的基址
#ifdef CONFIG_VFD
unsigned char vfd_type; /* display type */
#endif
#if 0
unsigned long cpu_clk; /* CPU clock in Hz! */
unsigned long bus_clk;
unsigned long ram_size; /* RAM size */
unsigned long reset_status; /* reset status register at boot */
#endif
void **jt; /* jump table */
} gd_t;
/*
* Global Data Flags
*/
#define GD_FLG_RELOC 0x00001 /* Code was relocated to RAM */
#define GD_FLG_DEVINIT 0x00002 /* Devices have been initialized */
#define GD_FLG_SILENT 0x00004 /* 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 */
#define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in & out) */
#define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r8")
2.、bd_t :board info数据结构定义,位于文件 include/asm-arm/u-boot.h。保存板子参数。
typedef struct bd_info {
int bi_baudrate; //串口波特率
unsigned long bi_ip_addr; // IP地址
struct environment_s *bi_env;
ulong bi_arch_number; // 板子ID号
ulong bi_boot_params; //启动参数
struct // DRAM BANKS配置,起始地址与长度
{
ulong start;
ulong size;
}bi_dram[CONFIG_NR_DRAM_BANKS];
} bd_t;
- U-boot的gd_t和bd_t数据结构简介
- U-BOOT之五:gd_t和bd_t数据结构简介
- gd_t和bd_t数据结构简介 .
- u-boot下的两个重要数据:bd_t和gd_t
- uboot中gd_t和bd_t数据结构简介
- uboot的gd_t和bd_t数据结构
- uboot的gd_t和bd_t数据结构
- uboot的gd_t和bd_t数据结构
- uboot的gd_t和bd_t数据结构
- uboot的gd_t和bd_t数据结构
- U-Boot第二阶段之初解二个重要的数据结构gd_t与bd_t
- U-Boot第二阶段之初解二个重要的数据结构gd_t与bd_t
- u-boot第二阶段之gd_t和 bd_t结构体
- u-boot移植随笔:一些内存地址的研究(gd_t和bd_t结构体)
- U-boot启动代码第二阶段之 gd_t和bd_t 以及 *gd asm ("r8")
- u-boot分析——struct gd_t与struct bd_t
- u-boot分析 之 struct gd_t与struct bd_t
- u-boot分析——struct gd_t与struct bd_t
- 在家上用宽带IPv6网站,下载六维,IPv4 to IPv6
- ASO主要影响因素分析
- 堆和栈访问效率哪个更高
- ExtJS学习------Ext.ProgressBar
- 工作3年7个月——又是新的开始
- U-boot的gd_t和bd_t数据结构简介
- GOOGLE C++编程风格笔记(一)
- mvc执行流程
- 用MySQL创建数据库和数据库表
- List的【addAll(List list)】方法
- AMPS:Oracle数据库操作模块源码解读
- 递归算法 转载
- 各手机平台开发对比
- 为什么要当项目经理