world leader in high performance signal processing
Trace: » 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: CONFIG_SYS_MAX_RAM_SIZE:  End of external memory
0x03f80000: CONFIG_SYS_MONITOR_BASE:  Relocated U-Boot image
0x03f20000: CONFIG_SYS_MALLOC_BASE:   U-Boot's dynamic heap for malloc()
0x03f1ffb0: CONFIG_SYS_GBL_DATA_ADDR: U-Boot's static "global data" region
0x03f1ff70: CONFIG_SYS_BD_INFO_ADDR:  U-Boot's static "board info" region
0x03f1ff6c: CONFIG_STACKBASE:         U-Boot's stack: grows "down"
0x03f1df70: CONFIG_SYS_MEMTEST_END:   End address for U-Boot's memory test code
 ...
0x00000000: CONFIG_SYS_SDRAM_BASE/CONFIG_SYS_MEMTEST_START: Start of external memory

If you only define the relevant size's (CONFIG_SYS_MONITOR_LEN and CONFIG_SYS_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.

CONFIG_SYS_MONITOR_BASE  - Base address where U-Boot executes
CONFIG_SYS_MONITOR_LEN   - Size of the monitor region

CONFIG_SYS_MALLOC_BASE   - Base address of U-Boot's dynamic heap
CONFIG_SYS_MALLOC_LEN    - Size of the heap

CONFIG_SYS_GBL_DATA_ADDR - Base address of U-Boot's global data
GENERATED_BD_INFO_SIZE   - Size of the global data w/padding (calculated automatically)

CONFIG_SYS_BD_INFO_ADDR  - Base address of U-Boot's global data
GENERATED_BD_INFO_SIZE   - Size of the board info w/padding (calculated automatically)

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

/* These are Blackfin specific */
CONFIG_LINUX_CMDLINE_ADDR - Base address for the Linux kernel command line
CONFIG_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).