U-boot readme--memory Management&initialize

Source: Internet
Author: User

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 are formed for each
Memory Type (Flash, SDRAM, SRAM), even when it consists of several
Physical memory banks.

U-boot is installed in the first Flash bank
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, 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 a DRAM of more than could look like
This

0x0000 0000Exception Vector Code
:
0x0000 1FFF
0x0000 2000Free for application use
:
:

:
:
0X00FB Ff20monitor Stack (growing downward)
0X00FB Ffacboard Info Data and permanent copy of global data
0X00FC 0000Malloc Arena
:
0X00FD FFFF
0x00fe 0000RAM 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 the PowerPC systems at address 0x00000100). Because of the Reset
configuration for cs0# This is a mirror of the onboard Flash Memory.
to is able to re-map memory u-boot and jumps to its link address.
to be able to implement the initialization code in C, a (small!)
initial stack is set to 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 is mapped using a
preliminary mapping. For example, we put them on MB boundaries
(multiples of 0x20000000:sdram on 0x00000000 and 0x20000000, Flash
on 0x40000000 and 0x60000000, SRAM on 0x80000000). Then UPM A was
programmed for SDRAM access. Using the temporary configuration, a
simple memory test is run that determines t He size of the SDRAM
banks.

When there was 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 would you have a "normal" C environment;
Until that is restricted in several ways, mostly because
Running from ROM, and because the code'll has to be relocated to a
New address in RAM.

U-boot readme--memory Management&initialize

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.