Memory Management:
------------------

U-Boot runs in system state and uses physical addresses, i.e. the
MMU is not used either for address mapping nor for memory protection.

The available memory is mapped to fixed addresses using the memory
controller. In this process, a contiguous block is formed for each
memory type (Flash, SDRAM, SRAM), even when it consists of several
physical memory banks.

U-Boot is installed in the first 128 kB of the first Flash bank (on
TQM8xxL modules this is the range 0x40000000 ... 0x4001FFFF). After
booting and sizing and initializing DRAM, the code relocates itself
to the upper end of DRAM. Immediately below the U-Boot code some
memory is reserved for use by malloc() [see CONFIG_SYS_MALLOC_LEN
configuration setting]. Below that, a structure with global Board
Info data is placed, followed by the stack (growing downward).

Additionally, some exception handler code is copied to the low 8 kB
of DRAM (0x00000000 ... 0x00001FFF).

So a typical memory configuration with 16 MB of DRAM could look like
this:

0x0000 0000 Exception Vector code
:
0x0000 1FFF
0x0000 2000 Free for Application Use
:
:

:
:
0x00FB FF20 Monitor Stack (Growing downward)
0x00FB FFAC Board Info Data and permanent copy of global data
0x00FC 0000 Malloc Arena
:
0x00FD FFFF
0x00FE 0000 RAM Copy of Monitor Code
... eventually: LCD or video framebuffer
... eventually: pRAM (Protected RAM - unchanged by reset)
0x00FF FFFF [End of RAM]

System Initialization:
----------------------

In the reset configuration, U-Boot starts at the reset entry point
(on most PowerPC systems at address 0x00000100). Because of the reset
configuration for CS0# this is a mirror of the onboard Flash memory.
To be able to re-map memory U-Boot then jumps to its link address.
To be able to implement the initialization code in C, a (small!)
initial stack is set up in the internal Dual Ported RAM (in case CPUs
which provide such a feature like MPC8xx or MPC8260), or in a locked
part of the data cache. After that, U-Boot initializes the CPU core,
the caches and the SIU.

Next, all (potentially) available memory banks are mapped using a
preliminary mapping. For example, we put them on 512 MB boundaries
(multiples of 0x20000000: SDRAM on 0x00000000 and 0x20000000, Flash
on 0x40000000 and 0x60000000, SRAM on 0x80000000). Then UPM A is
programmed for SDRAM access. Using the temporary configuration, a
simple memory test is run that determines the size of the SDRAM
banks.

When there is more than one SDRAM bank, and the banks are of
different size, the largest is mapped first. For equal size, the first
bank (CS2#) is mapped first. The first mapping is always for address
0x00000000, with any additional banks following immediately to create
contiguous memory starting from 0.

Then, the monitor installs itself at the upper end of the SDRAM area
and allocates memory for use by malloc() and for the global Board
Info data; also, the exception vector code is copied to the low RAM
pages, and the final stack is set up.

Only after this relocation will you have a "normal" C environment;
until that you are restricted in several ways, mostly because you are
running from ROM, and because the code will have to be relocated to a
new address in RAM.

u-boot README--Memory Management&initialize的更多相关文章

  1. Operating System Memory Management、Page Fault Exception、Cache Replacement Strategy Learning、LRU Algorithm

    目录 . 引言 . 页表 . 结构化内存管理 . 物理内存的管理 . SLAB分配器 . 处理器高速缓存和TLB控制 . 内存管理的概念 . 内存覆盖与内存交换 . 内存连续分配管理方式 . 内存非连 ...

  2. MIT-6.828-JOS-lab2:Memory management

    MIT-6.828 Lab 2: Memory Management实验报告 tags:mit-6.828 os 概述 本文主要介绍lab2,讲的是操作系统内存管理,从内容上分为三部分: 第一部分讲的 ...

  3. 再谈.net的堆和栈---.NET Memory Management Basics

    .NET Memory Management Basics .NET memory management is designed so that the programmer is freed fro ...

  4. lwIP Memory Management

    http://lwip.wikia.com/wiki/Lwipopts.h Memory management (RAM usage) /** * MEM_LIBC_MALLOC==1: Use ma ...

  5. Memory Management in Open Cascade

    Open Cascade中的内存管理 Memory Management in Open Cascade eryar@163.com 一.C++中的内存管理 Memory Management in ...

  6. Java (JVM) Memory Model – Memory Management in Java

    原文地址:http://www.journaldev.com/2856/java-jvm-memory-model-memory-management-in-java Understanding JV ...

  7. Objective-C Memory Management

    Objective-C Memory Management Using Reference Counting 每一个从NSObject派生的对象都继承了对应的内存管理的行为.这些类的内部存在一个称为r ...

  8. Android内存管理(2)HUNTING YOUR LEAKS: MEMORY MANAGEMENT IN ANDROID PART 2

    from: http://www.raizlabs.com/dev/2014/04/hunting-your-leaks-memory-management-in-android-part-2-of- ...

  9. Android内存管理(1)WRANGLING DALVIK: MEMORY MANAGEMENT IN ANDROID PART 1

    from : http://www.raizlabs.com/dev/2014/03/wrangling-dalvik-memory-management-in-android-part-1-of-2 ...

  10. Understanding Memory Management(2)

    Understanding Memory Management Memory management is the process of allocating new objects and remov ...

随机推荐

  1. Static和Final修饰类属性变量及初始化

    1.static修饰一个属性字段,那么这个属性字段将成为类本身的资源,public修饰为共有的,可以在类的外部通过test.a来访问此属性;在类内部任何地方可以使用.如果被修饰为private私有,那 ...

  2. rest ---hateoas

    推荐一篇博客. https://www.ibm.com/developerworks/cn/java/j-lo-SpringHATEOAS/

  3. bean装配--auto

    1,Dao package com.songyan.autoZhuangpei; public interface UserDao { public void say(); } package com ...

  4. 程序编译时书写Makefile注意事项一例

    在进行程序编译时,可能需要指定一些库的库的路径.头文件的路径,分别使用的参数选项是-L和-I,需要注意的是: 需要确保-L和-I后边的内容不为空,否则会出现意想不到的错误,而这种错误比较难以发现,引起 ...

  5. python 中的 sorted

    1) 输入help(sorted)可以得到下面类容: ------------------------------------------------------------------------- ...

  6. NFS 服务配置篇

    安装.配置NFS服务 1.NFS简介 NFS(network file system) NFS是一个主机A通过网络,允许其他主机B可以来共享主机A的一个目录文件的一个文件系统 2.需要安装两个包nfs ...

  7. JS方面重点摘要(一)

    1.获取样式(1)style只能获取到行间样式的属性(2)火狐getComputedStyle(obj,null)[attr],IE:obj.currentStyle[attr] 2.ready.on ...

  8. TCP为什么要三次握手,不是两次四次

    转载:   http://blog.chinaunix.net/uid-20726927-id-2455485.html 在革命战争影片中,经常会看到英勇的解放军战士背着步话机在喊“长江长江,我是黄河 ...

  9. sersync+rsync实时数据同步

    sersync+rsync实时数据同步 1.相关背景介绍 前面有关文章配置实现了rsync增量同步以及配置为定时同步,但是在实际生产环境中需要实时的监控数据从而进行同步(不间断同步),可以采取inot ...

  10. 怎么windows10下设置始终以管理员身份运行

    怎么windows10下设置始终以管理员身份运行 学习了:https://jingyan.baidu.com/article/e2284b2b6e6df8e2e7118d7a.html 可以对快捷方式 ...