world leader in high performance signal processing
Trace: » inetd » root_file_system_structure » arbitrary_waveform_generator » vlc » netscope » memory-layout

Blackfin U-Boot Memory Layout

The default memory layout of the Blackfin port of U-Boot is similar to the other U-Boot ports. The common documentation though tends to be a bit PowerPC specific so we'll explicitly cover the Blackfin memory layout here.

Default Layout

Here we show a typical system that has 64 megs of external memory. The memory regions above the asynchronous memory will differ depending on your Blackfin variant, so consult the appropriate datasheet for exact addresses if you really want to know.

0xffe00000: Blackfin Core MMRs
 ...
0xffc00000: Blackfin System MMRs
 ...
0xef000000: Boot ROM jump table
 ...
0x20000000: Start of asynchronous memory
 ...
0x04000000: CFG_MAX_RAM_SIZE:  End of external memory
0x03fc0000: CFG_MONITOR_BASE:  Relocated U-Boot image
0x03f60000: CFG_MALLOC_BASE:   U-Boot's dynamic heap for malloc()
0x03f5c000: CFG_GBL_DATA_ADDR: U-Boot's static "global data" region
0x03f5bffc: CFG_STACKBASE:     U-Boot's stack: grows "down"
0x03f5a000: CFG_MEMTEST_END:   End address for U-Boot's memory test code
 ...
0x00000000: CFG_SDRAM_BASE/CFG_MEMTEST_START: Start of external memory

If you only define the relevant size's (CFG_MONITOR_LEN and CFG_MALLOC_LEN), then you will get a memory layout such as this automatically.

If you start relocating pieces though (such as putting the global data or stack into on-chip memory), then you will need to define all of the memory regions accordingly. Otherwise the mismatch of custom addresses and automatic placement will result in an invalid memory layout.

Configuration

Review the common documentation (the top level README file) for more information on these.

CFG_MONITOR_BASE  - Base address where U-Boot executes
CFG_MONITOR_LEN   - Size of the monitor region

CFG_MALLOC_BASE   - Base address of U-Boot's dynamic heap
CFG_MALLOC_LEN    - Size of the heap

CFG_GBL_DATA_ADDR - Base address of U-Boot's global data
CFG_GBL_DATA_SIZE - Size of the global data (should not really need to change)

CFG_STACKBASE     - Base address of U-Boot's stack (which grows down)

/* These are Blackfin specific */
CFG_LINUX_CMDLINE_ADDR - Base address for the Linux kernel command line
CFG_LINUX_CMDLINE_SIZE - Largest string that may be passed

You should not use the on-chip scratch pad for any memory region which may be a target or source for DMA. For example, U-Boot's stack should not be placed into scratch pad DMA as there are some places where the stack is used for memory DMA (to/from L1 instruction).