1)、gd_t该数据结构保存了u-boot需要的配置信息,注释简单明了 typedef struct global_data { bd_t *bd; //与板子相关的结构,见下面 unsigned long flags; unsigned long baudrate; unsigned long have_console; /* serial_init() was called */ unsigned long reloc_off; /* Relocation Offset */ unsigned long env_addr; /* Address of Environment struct */ unsigned long env_valid; /* Checksum of Environment valid? */ #ifdef CONFIG_VFD //我们一般没有配置这个,这个是frame buffer的首地址 unsigned long fb_base; /* base address of frame buffer */ #endif } gd_t;
2)、bd_t 保存与板子相关的配置参数 typedef struct bd_info { int bi_baudrate; /* serial console baudrate */ unsigned long bi_ip_addr; /* IP Address */ unsigned char bi_enetaddr[6]; /* Ethernet adress */ 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];//在我的板子上是1个 } bd_t;