u-boot-brain/lib
Simon Glass d59476b644 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>
2014-07-23 14:05:40 +01:00
..
libfdt libfdt: Fix segfault when calling fit_check_format() on corrupt FIT images 2014-06-19 11:18:42 -04:00
lzma LzmaTools: don't self assign values 2014-06-11 16:27:06 -04:00
lzo lib: descend into sub directories only when it is necessary 2013-11-17 14:11:30 -05:00
rsa includes: move openssl headers to include/u-boot 2014-06-19 11:19:04 -04:00
tizen Logo: TIZEN: Change booting logo size to official size. 2014-03-28 15:06:30 -04:00
zlib lib: descend into sub directories only when it is necessary 2013-11-17 14:11:30 -05:00
addr_map.c lib/powerpc: addrmap_phys_to_virt() should return a pointer 2012-07-06 17:30:32 -05:00
aes.c aes: make apply_cbc_chain_data non-static 2014-04-18 16:14:17 -04:00
asm-offsets.c Add a simple malloc() implementation for pre-relocation 2014-07-23 14:05:40 +01:00
bch.c nand: Merge BCH code from Linux nand driver 2012-01-26 16:09:02 -06:00
bitrev.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
bzlib_crctable.c Rename lib_generic/ to lib/ 2010-04-13 09:13:04 +02:00
bzlib_decompress.c Rename lib_generic/ to lib/ 2010-04-13 09:13:04 +02:00
bzlib_huffman.c Rename lib_generic/ to lib/ 2010-04-13 09:13:04 +02:00
bzlib_private.h Rename lib_generic/ to lib/ 2010-04-13 09:13:04 +02:00
bzlib_randtable.c Rename lib_generic/ to lib/ 2010-04-13 09:13:04 +02:00
bzlib.c Rename lib_generic/ to lib/ 2010-04-13 09:13:04 +02:00
circbuf.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
crc7.c lib: add crc7 from Linux 2011-01-18 23:38:08 +01:00
crc8.c Add crc8 routine 2014-01-08 17:20:34 -07:00
crc16.c Add eCos-2.0 SPDX-License-Identifier to source files 2013-07-24 09:45:01 -04:00
crc32.c crc32: Correct endianness of crc32 result 2013-04-19 10:24:14 -04:00
ctype.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
display_options.c Add 64-bit data support for memory commands 2014-03-04 12:15:30 -05:00
div64.c lib: div64: add missing include 2014-07-18 17:53:22 -04:00
errno.c Add basic errno support. 2010-09-19 19:29:47 +02:00
fdtdec_common.c lib, fdt: move fdtdec_get_int() out of lib/fdtdec.c 2014-06-23 09:11:30 -04:00
fdtdec_test.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
fdtdec.c lib, fdt: move fdtdec_get_int() out of lib/fdtdec.c 2014-06-23 09:11:30 -04:00
gunzip.c gzip: correctly bounds-check output buffer 2013-09-03 13:30:14 -06:00
gzip.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
hang.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
hashtable.c Add option -r to env import to allow import of text files with CRLF as line endings 2014-07-22 07:44:26 -04:00
initcall.c initcall: Improve debugging support 2014-05-28 10:58:19 +09:00
ldiv.c Add LGPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:45:01 -04:00
linux_string.c Make linux kernel string funcs available to tools 2012-12-13 11:46:07 -07:00
lmb.c lib:lmb: use __weak 2014-07-18 17:53:23 -04:00
Makefile lib, fdt: move fdtdec_get_int() out of lib/fdtdec.c 2014-06-23 09:11:30 -04:00
md5.c GCC47: Fix warning in md5.c 2012-04-29 14:14:08 +02:00
net_utils.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
physmem.c Introduce arch_phys_memset which works like memset but on physical memory 2012-12-06 14:30:40 -08:00
qsort.c Include common.h in qsort.c to fix build warning 2011-12-07 08:39:54 +01:00
rand.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
rbtree.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
sha1.c lib:sha1: remove unused constant 2014-07-18 17:53:23 -04:00
sha256.c includes: move openssl headers to include/u-boot 2014-06-19 11:19:04 -04:00
slre.c Coding Style cleanup: remove trailing white space 2013-10-14 16:06:53 -04:00
string.c Coding Style cleanup: remove trailing empty lines 2013-10-14 16:06:54 -04:00
strmhz.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
time.c lib/time.c cleanups 2014-07-22 07:44:26 -04:00
tpm.c includes: move openssl headers to include/u-boot 2014-06-19 11:19:04 -04:00
trace.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
uuid.c cmd:gpt: randomly generate each partition uuid if undefined 2014-04-02 16:36:06 -04:00
vsprintf.c lib:vsprintf: reduce scope of pack_hex_byte 2014-07-18 17:53:23 -04:00