All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/6] spl: support using full malloc with SYS_MALLOC_F_LEN
Date: Tue, 19 Mar 2019 19:52:23 +0100	[thread overview]
Message-ID: <a474a225-b205-83ab-f413-093a7e8264f7@gmail.com> (raw)
In-Reply-To: <CAPnjgZ1sQEhGHygFu0uW9QdS5BP0rryW-JD02NAVYHXQW9k-+w@mail.gmail.com>

Hi Simon,

you were replying to v1 where v2 has already been sent. However, this 
patch hasn't changed, so I'm commenting here.

Am 19.03.2019 um 02:24 schrieb Simon Glass:
> Hi Simon,
> 
> On Tue, 12 Mar 2019 at 05:35, Simon Goldschmidt
> <simon.k.r.goldschmidt@gmail.com> wrote:
>>
>> Some platforms (like socfpga A10) need a big hep before SDRAM is available
>> (e.g. because FAT is used). For such platforms, simple_malloc is often not
>> a good option as it does not support freeing memory. These platforms often
>> use the non-Kconfig defines CONFIG_SYS_SPL_MALLOC_START (and its SIZE).
>>
>> This patch allows enabling CONFIG_SPL_SYS_MALLOC_F_LEN while leaving
>> CONFIG_SPL_SYS_MALLOC_SIMPLE disabled. In this case, the full malloc heap
>> is made available as early as the simple_malloc heap would be normally.
>>
>> This way, platforms can drop the non-Kconfig options to set up the full
>> heap and rely on the same automatically calculated heap allocation used
>> for simple heap.
>>
>> Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
>> ---
>>
>>   common/spl/spl.c | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/common/spl/spl.c b/common/spl/spl.c
>> index 88d4b8a9bf..b89340eb27 100644
>> --- a/common/spl/spl.c
>> +++ b/common/spl/spl.c
>> @@ -383,8 +383,13 @@ static int spl_common_init(bool setup_malloc)
>>   #ifdef CONFIG_MALLOC_F_ADDR
>>                  gd->malloc_base = CONFIG_MALLOC_F_ADDR;
>>   #endif
>> +#if CONFIG_IS_ENABLED(SYS_MALLOC_SIMPLE)
> 
> Can we use if() instead of #if here?

Yes, that should work. Noted for v3.

> 
>>                  gd->malloc_limit = CONFIG_VAL(SYS_MALLOC_F_LEN);
>>                  gd->malloc_ptr = 0;
>> +#else
>> +               mem_malloc_init(gd->malloc_base, CONFIG_VAL(SYS_MALLOC_F_LEN));
>> +               gd->flags |= GD_FLG_FULL_MALLOC_INIT;
>> +#endif
>>          }
>>   #endif
>>          ret = bootstage_init(true);
>> --
>> 2.17.1
>>
> 
> Also I feel some updates should be made to the README, or perhaps Kconfig help.

Yes, you're right. Honestly, I didn't want to go through all the 
documentation mess unless getting at least some slightly positive 
feedback to this. Searching the readme files and Kconfig help to get 
them consistent is probably more work than coding these patches :-)

Regards,
Simon

  reply	other threads:[~2019-03-19 18:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-11 21:35 [U-Boot] [PATCH 0/6] spl: full-featured heap cleanups Simon Goldschmidt
2019-03-11 21:35 ` [U-Boot] [PATCH 1/6] spl: add Kconfig option to clear bss early Simon Goldschmidt
2019-03-12  6:02   ` Stefan Roese
2019-03-12 20:52     ` Simon Goldschmidt
2019-03-11 21:35 ` [U-Boot] [PATCH 2/6] spl: arm: implement SPL_CLEAR_BSS_F Simon Goldschmidt
2019-03-11 21:35 ` [U-Boot] [PATCH 3/6] dlmalloc: fix malloc range at end of ram Simon Goldschmidt
2019-03-11 21:35 ` [U-Boot] [PATCH 4/6] dlmalloc: be compatible to tiny printf Simon Goldschmidt
2019-03-11 21:35 ` [U-Boot] [PATCH 5/6] spl: support using full malloc with SYS_MALLOC_F_LEN Simon Goldschmidt
2019-03-19  1:24   ` Simon Glass
2019-03-19 18:52     ` Simon Goldschmidt [this message]
2019-03-11 21:35 ` [U-Boot] [PATCH 6/6] arm: socfpga: a10: move SPL stack size to Kconfig Simon Goldschmidt
2019-03-18  7:45   ` Chee, Tien Fong

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=a474a225-b205-83ab-f413-093a7e8264f7@gmail.com \
    --to=simon.k.r.goldschmidt@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.