public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@xilinx.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] microblaze: spl: Do not call mem_malloc_init and use early alloc
Date: Mon, 14 Dec 2015 08:33:34 +0100	[thread overview]
Message-ID: <566E70CE.7070002@xilinx.com> (raw)
In-Reply-To: <CAPnjgZ0ocst7e=ELEST_qE9=JEZVieQC+hwnTT94uu6Gagrr4g@mail.gmail.com>

On 14.12.2015 04:47, Simon Glass wrote:
> Hi Michal,
> 
> On 3 February 2015 at 08:39, Michal Simek <michal.simek@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@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

Thanks,
Michal

  reply	other threads:[~2015-12-14  7:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-03 15:39 [U-Boot] [PATCH 1/2] microblaze: spl: Do not call mem_malloc_init and use early alloc Michal Simek
2015-02-03 15:39 ` [U-Boot] [PATCH 2/2] microblaze: spl: Add LISTS to linker script Michal Simek
2015-12-14  3:47 ` [U-Boot] [PATCH 1/2] microblaze: spl: Do not call mem_malloc_init and use early alloc Simon Glass
2015-12-14  7:33   ` Michal Simek [this message]
2015-12-14 22:14     ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=566E70CE.7070002@xilinx.com \
    --to=michal.simek@xilinx.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox