summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-07-10 22:23:28 -0600
committerSimon Glass <sjg@chromium.org>2014-07-23 14:05:40 +0100
commitd59476b6446799c21e64147d86483140154c1886 (patch)
tree4776a03340adc8f85434c91d4cb0d060cf36c013 /README
parent4d94dfa0594260245813ea150e276908cc677199 (diff)
downloadu-boot-imx-d59476b6446799c21e64147d86483140154c1886.zip
u-boot-imx-d59476b6446799c21e64147d86483140154c1886.tar.gz
u-boot-imx-d59476b6446799c21e64147d86483140154c1886.tar.bz2
Add a simple malloc() implementation for pre-relocation
If we are to have driver model before relocation we need to support some way of calling memory allocation routines. The standard malloc() is pretty complicated: 1. It uses some BSS memory for its state, and BSS is not available before relocation 2. It supports algorithms for reducing memory fragmentation and improving performace of free(). Before relocation we could happily just not support free(). 3. It includes about 4KB of code (Thumb 2) and 1KB of data. However since this has been loaded anyway this is not really a problem. The simplest way to support pre-relocation malloc() is to reserve an area of memory and allocate it in increasing blocks as needed. This implementation does this. To enable it, you need to define the size of the malloc() pool as described in the README. It will be located above the pre-relocation stack on supported architectures. Note that this implementation is only useful on machines which have some memory available before dram_init() is called - this includes those that do no DRAM init (like tegra) and those that do it in SPL (quite a few boards). Enabling driver model preior to relocation for the rest of the boards is left for a later exercise. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'README')
-rw-r--r--README13
1 files changed, 13 insertions, 0 deletions
diff --git a/README b/README
index 4ac7399..11e9d31 100644
--- a/README
+++ b/README
@@ -3736,6 +3736,19 @@ Configuration Settings:
- CONFIG_SYS_MALLOC_LEN:
Size of DRAM reserved for malloc() use.
+- CONFIG_SYS_MALLOC_F_LEN
+ Size of the malloc() pool for use before relocation. If
+ this is defined, then a very simple malloc() implementation
+ will become available before relocation. The address is just
+ below the global data, and the stack is moved down to make
+ space.
+
+ This feature allocates regions with increasing addresses
+ within the region. calloc() is supported, but realloc()
+ is not available. free() is supported but does nothing.
+ The memory will be freed (or in fact just forgotton) when
+ U-Boot relocates itself.
+
- CONFIG_SYS_BOOTM_LEN:
Normally compressed uImages are limited to an
uncompressed size of 8 MBytes. If this is not enough,