uboot misc

uboot misc

global_data struct成员含义

mon_len
uboot image size,uboot image里包含.text,.rodata, .data, .u_boot_list, .bss等section,这些section size之和即是mon_len

static int setup_mon_len(void)
{
#if defined(__ARM__) || defined(__MICROBLAZE__)
    gd->mon_len = (ulong)&__bss_end - (ulong)_start;

 

ram_base/ram_top/ram_size
表示uboot可以访问的DRAM的地址范围,这个范围即是(ram_base, ram_top)。ram_size即是uboot可以访问DRAM范围的size,在dram_init()里设置

setup_dest_addr()

#ifdef CONFIG_SYS_SDRAM_BASE
    gd->ram_base = CONFIG_SYS_SDRAM_BASE;
#endif
    gd->ram_top = gd->ram_base + get_effective_memsize();
    gd->ram_top = board_get_usable_ram_top(gd->mon_len);

 

uboot下如何查看内存里的数据

使用md工具

md.b $address $count (从地址$address处显示$count个字节的数据,b=byte,8位)

md.w $address $count (从地址$address处显示$count个的数据,w=word,16位)

md.l $address $count (从地址$address处显示$count个双字的数据,32位,默认读取单位为32位)

 

uboot memory layout

     "hidden" RAM
     kernel log buffer (optional)
     "protected" RAM (optional)
     video and/or LCD framebuffer (optional)
     U-Boot
     heap (for malloc)
     board info structure
     global data structure
     stack
from: https://lists.denx.de/pipermail/u-boot/2013-December/169910.html

layout diagram

https://icode.best/i/08517234442699

uboot命令学习笔记

 https://blog.csdn.net/weixin_43471255/article/details/112299968

 

posted @ 2022-06-12 18:43  aspirs  阅读(93)  评论(0编辑  收藏  举报