[U-Boot] [PATCH 1/2] microblaze: spl: Do not call mem_malloc_init and use early alloc
Simon Glass
sjg at chromium.org
Mon Dec 14 23:14:16 CET 2015
On 14 December 2015 at 00:33, Michal Simek <michal.simek at xilinx.com> wrote:
> On 14.12.2015 04:47, Simon Glass wrote:
>> Hi Michal,
>>
>> On 3 February 2015 at 08:39, Michal Simek <michal.simek at xilinx.com> wrote:
>>>
>>> This patch has some parts connected together:
>>> - Use _gd in bss section which is automatically cleared
>>> Location at SPL_MALLOC_END wasn't cleared at all
>>> - Use MALLOC_F_LEN(early alloc) instead of FULL MALLOC
>>> (mem_malloc_init is not called at all)
>>> - Simplify malloc and stack init.
>>> At the end of SPL addr is malloc area and below is stack
>>>
>>> Signed-off-by: Michal Simek <michal.simek at xilinx.com>
>>> ---
>>>
>>> arch/microblaze/cpu/start.S | 6 +++++-
>>> include/configs/microblaze-generic.h | 32 +++++++++++---------------------
>>> 2 files changed, 16 insertions(+), 22 deletions(-)
>>>
>>> diff --git a/arch/microblaze/cpu/start.S b/arch/microblaze/cpu/start.S
>>> index cf9ee7e3e6ad..953d3a15eef2 100644
>>> --- a/arch/microblaze/cpu/start.S
>>> +++ b/arch/microblaze/cpu/start.S
>>> @@ -162,7 +162,11 @@ clear_bss:
>>> #endif
>>> brai board_init_f
>>> #else
>>> - addi r31, r0, CONFIG_SYS_SPL_MALLOC_END
>>> + addi r31, r0, _gd
>>> +#if defined(CONFIG_SYS_MALLOC_F_LEN)
>>> + addi r6, r0, CONFIG_SPL_STACK_ADDR
>>> + swi r6, r31, GD_MALLOC_BASE
>>> +#endif
>>> brai board_init_r
>>> #endif
>>> 1: bri 1b
>>> diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h
>>> index 770acbea691b..166ab4f05654 100644
>>> --- a/include/configs/microblaze-generic.h
>>> +++ b/include/configs/microblaze-generic.h
>>> @@ -113,7 +113,12 @@
>>> #endif
>>>
>>> #define CONFIG_SYS_MALLOC_LEN 0xC0000
>>> -#define CONFIG_SYS_MALLOC_F_LEN 1024
>>> +#ifndef CONFIG_SPL_BUILD
>>> +# define CONFIG_SYS_MALLOC_F_LEN 1024
>>> +#else
>>> +# define CONFIG_SYS_MALLOC_SIMPLE
>>> +# define CONFIG_SYS_MALLOC_F_LEN 0x150
>>> +#endif
>>
>> These should be set via Kconfig - e.g. default values for your arch,
>> or perhaps individual values in the defconfig files. At present this
>> breaks when driver model is enabled by default.
>>
>> Can you please take a look?
>>
>
> Already did. Here is follow up patch.
>
> http://lists.denx.de/pipermail/u-boot/2015-December/237468.html
Great, found it, thanks.
- Simon
More information about the U-Boot
mailing list