uboot下init_sequence_f函数之setup_dest_addr

来源:互联网 发布:linux shell 参数 编辑:程序博客网 时间:2024/06/05 22:42
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