生活随笔
收集整理的這篇文章主要介紹了
Exynos4412 Uboot 移植(六)—— 相关知识补充
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Uboot版本:u-boot-2013.01
一、gd結構體的定義與使用
gd_t 和 bd_t 是u-boot中兩個重要的數據結構,在初始化操作很多都要靠這兩個數據結構來保存或傳遞。
gd_t 定義在/u-boot-2013.01/arch/arm/include/asm/global_data.h
bd_t 定義在 ./include/asm-arm/u-boot.h
1、gd_t : global data數據結構定義
位于文件/u-boot-2013.01/arch/arm/include/asm/global_data.h 中。其成員主要是一些全局的系統初始化參數。
當使用gd_t 時需用宏定義進行聲明DECLARE_GLOBAL_DATA_PTR
從這個宏的定義可以看出,gd是一個保存在ARM的r8寄存器中的gd_t結構體的指針。指定占用寄存器R8。
[cpp]?view plaincopy
typedef?struct??global_data?{?? ????bd_t????????*bd;?? ????unsigned?long???flags;?? ????unsigned?int????baudrate;?? ????unsigned?long???have_console;????? #ifdef?CONFIG_PRE_CONSOLE_BUFFER?? ????unsigned?long???precon_buf_idx;??? #endif?? ????unsigned?long???env_addr;????? ????unsigned?long???env_valid;???? ????unsigned?long???fb_base;?????? #ifdef?CONFIG_FSL_ESDHC?? ????unsigned?long???sdhc_clk;?? #endif?? #ifdef?CONFIG_AT91FAMILY?? ?????? ????unsigned?long???cpu_clk_rate_hz;?? ????unsigned?long???main_clk_rate_hz;?? ????unsigned?long???mck_rate_hz;?? ????unsigned?long???plla_rate_hz;?? ????unsigned?long???pllb_rate_hz;?? ????unsigned?long???at91_pllb_usb_init;?? #endif?? #ifdef?CONFIG_ARM?? ?????? ????unsigned?long???timer_rate_hz;?? ????unsigned?long???tbl;?? ????unsigned?long???tbu;?? ????unsigned?long?long??timer_reset_value;?? ????unsigned?long???lastinc;?? #endif?? #ifdef?CONFIG_IXP425?? ????unsigned?long???timestamp;?? #endif?? ????unsigned?long???relocaddr;???? ????phys_size_t?ram_size;????? ????unsigned?long???mon_len;?????? ????unsigned?long???irq_sp;??????? ????unsigned?long???start_addr_sp;???? ????unsigned?long???reloc_off;?? #if?!(defined(CONFIG_SYS_ICACHE_OFF)?&&?defined(CONFIG_SYS_DCACHE_OFF))?? ????unsigned?long???tlb_addr;?? ????unsigned?long???tlb_size;?? #endif?? ????const?void??*fdt_blob;???? ????void????????**jt;????????? ????char????????env_buf[32];?????? #if?defined(CONFIG_POST)?||?defined(CONFIG_LOGBUFFER)?? ????unsigned?long???post_log_word;??? ????unsigned?long???post_log_res;??? ????unsigned?long???post_init_f_time;??? #endif?? }?gd_t;??
2.、bd_t :board info數據結構定義
位于文件u-boot-2013.01/arch/arm/include/asm/u-boot.h。保存板子參數。
[cpp]?view plaincopy
typedef?struct?bd_info?{?? ????unsigned?int????bi_baudrate;?????? ????ulong???????????bi_arch_number;??? ????ulong???????????bi_boot_params;??? ????unsigned?long???bi_arm_freq;??? ????unsigned?long???bi_dsp_freq;??? ????unsigned?long???bi_ddr_freq;??? ????struct???????????????? ????{?? ????ulong?start;?? ????ulong?size;?? ????}???????????bi_dram[CONFIG_NR_DRAM_BANKS];?? }?bd_t; ?
總結
以上是生活随笔為你收集整理的Exynos4412 Uboot 移植(六)—— 相关知识补充的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。