uboot下init_sequence_f函数之setup_dest_addr

setup_dest_addr:

static int setup_dest_addr(void) {  debug("Monitor len: %08lX\n", gd->mon_len);  /*   * Ram is setup, size stored in gd !!   */  debug("Ram size: %08lX\n", (ulong)gd->ram_size); #ifdef CONFIG_SYS_MEM_RESERVE_SECURE  /* Reserve memory for secure MMU tables, and/or security monitor */  gd->ram_size -= CONFIG_SYS_MEM_RESERVE_SECURE;  /*   * Record secure memory location. Need recalcuate if memory splits   * into banks, or the ram base is not zero.   */  gd->arch.secure_ram = gd->ram_size; #endif  /*   * Subtract specified amount of memory to hide so that it won't   * get "touched" at all by U-Boot. By fixing up gd->ram_size   * the Linux kernel should now get passed the now "corrected"   * memory size and won't touch it either. This has been used   * by arch/powerpc exclusively. Now ARMv8 takes advantage of   * thie mechanism. If memory is split into banks, addresses   * need to be calculated.   */  gd->ram_size = board_reserve_ram_top(gd->ram_size);

#ifdef CONFIG_SYS_SDRAM_BASE  gd->ram_top = CONFIG_SYS_SDRAM_BASE; #endif  gd->ram_top += get_effective_memsize();  gd->ram_top = board_get_usable_ram_top(gd->mon_len);  gd->relocaddr = gd->ram_top;  debug("Ram top: %08lX\n", (ulong)gd->ram_top); #if defined(CONFIG_MP) && (defined(CONFIG_MPC86xx) || defined(CONFIG_E500))  /*   * We need to make sure the location we intend to put secondary core   * boot code is reserved and not used by any part of u-boot   */  if (gd->relocaddr > determine_mp_bootpg(NULL)) {   gd->relocaddr = determine_mp_bootpg(NULL);   debug("Reserving MP boot page to %08lx\n", gd->relocaddr);  } #endif  return 0; }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值