All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] ARM: crt0: Pass malloc base address
Date: Wed, 11 Nov 2015 14:49:05 -0700	[thread overview]
Message-ID: <CAPnjgZ1Af6UMHBcXpRBPjv3UO81QDvrRS6Rf2ZSBOcyr4qCKfg@mail.gmail.com> (raw)
In-Reply-To: <CAOMZO5AWiaVEdF9phpPhM-93J2fjiyOV0FLb+QhWYR8nFNm7DQ@mail.gmail.com>

Hi Fabio,

On 11 November 2015 at 14:24, Fabio Estevam <festevam@gmail.com> wrote:
> Hi Simon,
>
> On Wed, Nov 11, 2015 at 7:08 PM, Simon Glass <sjg@chromium.org> wrote:
>
>> That test is intended to avoid setting up simple malloc() if we plan
>> to use full malloc() in SPL. Of course, full malloc() is set up a
>> little later (in spl_init()). But we should not need both - either we
>> use simple malloc() or full malloc().
>>
>> But for your board I see:
>>
>> $ grep CONFIG_SYS_SPL_MALLOC_SIZE b/mx6sabresd_spl/u-boot.cfg
>> #define CONFIG_SYS_SPL_MALLOC_SIZE 0x3200000
>>
>> So you will not be able to use simple malloc(). I'd suggest calling
>> spl_init() from board_init_f() if you need malloc() there. But it
>
> Yes, I do call spl_init() from board_init_f() prior to calling
> malloc() and this has been working fine prior to 5ba534d247d418.
>
>> presumably needs to be done after you have SDRAM up. So perhaps
>
> The trick here is that I need malloc to work prior to have SDRAM configured.
>
> On cgtqmx6eval we need to read SPI NOR to determine what kind of DDR
> we will need to configure.
>
> Otavio has sent the SPL support for cgtqmx6eval, but it has not
> reached U-boot mainline yet.
>
> I am reproducing the problem on a mx6sabresd_spl target with the
> simple example code I sent previously.

I see. That's not a use case I have seen before.

I'd suggest changing the #ifdef to always set up early malloc() if
CONFIG_SYS_MALLOC_F is set. There will of course be a new malloc()
once spi_init() is called, but that does not matter.

In your patch, please be careful to add some docs to the README on
this point (the early malloc() is only there to permit DRAM init,
etc.). It could get quite confusing...

Regards,
Simon

  reply	other threads:[~2015-11-11 21:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-11 20:23 [U-Boot] [PATCH] ARM: crt0: Pass malloc base address Fabio Estevam
2015-11-11 20:26 ` Simon Glass
2015-11-11 20:41   ` Fabio Estevam
2015-11-11 21:00     ` Fabio Estevam
2015-11-11 21:08       ` Simon Glass
2015-11-11 21:24         ` Fabio Estevam
2015-11-11 21:49           ` Simon Glass [this message]
2015-11-12  6:57             ` Albert ARIBAUD
2015-11-12 12:48               ` Fabio Estevam
2015-11-12 15:59               ` Simon Glass
2015-11-12 16:13                 ` Albert ARIBAUD
2015-11-14  2:12                   ` Simon Glass
2015-11-14 15:23                     ` Albert ARIBAUD
2015-11-11 20:33 ` Albert ARIBAUD
2015-11-11 20:49   ` Fabio Estevam

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=CAPnjgZ1Af6UMHBcXpRBPjv3UO81QDvrRS6Rf2ZSBOcyr4qCKfg@mail.gmail.com \
    --to=sjg@chromium.org \
    --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.