From: Simon Glass Date: Fri, 11 Jul 2014 04:23:31 +0000 (-0600) Subject: sandbox: Support pre-relocation malloc() X-Git-Tag: v2014.10-rc1~78 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=29afe9e6edc7a817a055de27e98e8d33aad683a2;p=u-boot sandbox: Support pre-relocation malloc() Set up and zero global data before board_init_f() is called so that we can remove the need for CONFIG_SYS_GENERIC_GLOBAL_DATA. Signed-off-by: Simon Glass --- diff --git a/README b/README index 11e9d31285..f704eb3780 100644 --- a/README +++ b/README @@ -3749,6 +3749,9 @@ Configuration Settings: The memory will be freed (or in fact just forgotton) when U-Boot relocates itself. + Pre-relocation malloc() is only supported on sandbox + at present but is fairly easy to enable for other archs. + - CONFIG_SYS_BOOTM_LEN: Normally compressed uImages are limited to an uncompressed size of 8 MBytes. If this is not enough, diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c index 5289291bc8..b3d70515dc 100644 --- a/arch/sandbox/cpu/start.c +++ b/arch/sandbox/cpu/start.c @@ -240,6 +240,9 @@ int main(int argc, char *argv[]) memset(&data, '\0', sizeof(data)); gd = &data; +#ifdef CONFIG_SYS_MALLOC_F_LEN + gd->malloc_base = CONFIG_MALLOC_F_ADDR; +#endif /* Do pre- and post-relocation init */ board_init_f(0);