UBOOT+LINUX上电启动(10)

2019-08-30 21:07

* already puts a few entries in the table. */ li r0,__got2_entries@sectoff@l la

r3,GOT(_GOT2_TABLE_)

lwz r11,GOT(_GOT2_TABLE_) mtctr

r0

sub r11,r3,r11

addi r3,r3,-4

1: lwzu r0,4(r3) cmpwi r0,0

beq- 2f add r0,r0,r11

stw r0,0(r3)

2: bdnz 1b

#ifndef CONFIG_NAND_SPL /*

* Now adjust the fixups and the pointers to the fixups * in case we need to move ourselves again. */ li

r0,__fixup_entries@sectoff@l

lwz r3,GOT(_FIXUP_TABLE_) cmpwi r0,0

mtctr

r0

46

addi r3,r3,-4

beq 4f

3: lwzu r4,4(r3) lwzux

r0,r4,r11

add r0,r0,r11 stw r10,0(r3) stw r0,0(r4) bdnz 3b

4: #endif

clear_bss: /*

* Now clear BSS segment */

lwz r3,GOT(__bss_start) #if defined(CONFIG_HYMOD) /*

* For HYMOD - the environment is the very last item in flash. * The real .bss stops just before environment starts, so only * clear up to that point. *

* taken from mods for FADS board

*/

47

lwz r4,GOT(environment)

#else

lwz r4,GOT(_end)

#endif cmplw 0, r3, r4

beq 6f

li

r0, 0 5: stw r0, 0(r3) addi r3, r3, 4 cmplw 0, r3, r4

bne 5b

6: mr r3, r9 /* Global Data pointer mr r4, r10

/* Destination Address bl

board_init_r

这其中的代码留下后面分析。 3.2.2 board_init_r

void board_init_r (gd_t *id, ulong dest_addr) {

*/ */

48

char *s; bd_t *bd; ulong malloc_start;

ulong flash_size;

gd = id; /* initialize RAM version of global data 好方法,又将这个变量地址改变了*/ bd = gd->bd;

gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */

/* The Malloc area is immediately below the monitor copy in DRAM */

malloc_start = dest_addr - TOTAL_MALLOC_LEN;// malloc_start=0x07fae000-520KB

serial_initialize();

debug (\ //dest_addr=0x07fae000 WATCHDOG_RESET ();

/*

* Setup trap handlers */

trap_init (dest_addr);

49

monitor_flash_len = (ulong)&__init_end - dest_addr;

WATCHDOG_RESET ();

#if defined(CONFIG_SYS_DELAYED_ICACHE) || defined(CONFIG_MPC83xx)

icache_enable (); /* it's time to enable the instruction cache */

#endif asm (\

mem_malloc_init (malloc_start, TOTAL_MALLOC_LEN);

#if !defined(CONFIG_SYS_NO_FLASH) puts (\

if ((flash_size = flash_init ()) > 0) {

print_size (flash_size, \

} else { puts (failed); hang ();

}

bd->bi_flashstart = CONFIG_SYS_FLASH_BASE; /* update start of FLASH memory

*/

50


UBOOT+LINUX上电启动(10).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:科目一 Packet Tracer基本操作 - 图文

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: