All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] SPL: sunxi: don't force .BSS into DRAM
Date: Sat, 2 Jul 2016 13:49:52 +0200	[thread overview]
Message-ID: <cf2cbbaa-8e8a-dc97-cd0c-6c11061630c0@redhat.com> (raw)
In-Reply-To: <CAPnjgZ2ajoU90kSNMoHVhbXN4CdeKzs5-SQ-Hq-xePfC0brJ3A@mail.gmail.com>

Hi,

On 30-06-16 17:24, Simon Glass wrote:
> Hi,
>
> On 30 June 2016 at 03:00, Hans de Goede <hdegoede@redhat.com> wrote:
>> Hi Andre,
>>
>> On 30-06-16 02:25, Andre Przywara wrote:
>>>
>>> Probably due to some (ill-founded) fear of a large BSS all sunxi boards
>>> forced their SPL BSS section into DRAM.
>>> This only works if there is no usage of a .BSS variable before the DRAM
>>> is initialised.
>>> The recent inclusion of tiny-printf breaks this assumption (it has two
>>> variables in .BSS), so any early printf (printing a number) hangs a board.
>>> This in particular breaks the (WIP) Pine64 SPL, which at the moment links
>>> Allwinner's libdram library, trying to print debug information:
>>> DRAM:DRAM driver version: V1.0
>>> DRAM Type = <hangs>
>>
>>
>> Hmm, although 256 bytes is not a lot I would prefer for BSS to stay in
>> DRAM, esp. since the bss use may grow over time, and the SPL space is quite
>> small.
>>
>> Moreover, given that tiny-printf is specifically meant for use in SPL /
>> restricted environments and having BSS in DRAM is not unheard of for
>> other boards, it seems to me like this is something which should really
>> be fixed in tinyprintf instead.
>>
>> Have you tried looking into fixing this at the tinyprintf level ?
>
> Marek's fix is one option. Another is to make use of global_data,
> which will be available from very early and it set to zero.

I think Marek's fix is fine, we should go and merge that.

As for the worries about not using BSS before DRAM is initialized
coming back to bite us. Yes that may happen, but we are not the
only board / mach / soc code to do this. I agree that documenting
this somewhere would be good (patches welcome).

As for just putting BSS in the sram, nack. Thanks to various efforts
we currently have some free space for the SPL, but in the future
we will likely add NAND support, and try to move the SPL to
dm (with static device instantiation, no space for dt) so that we
can get rid of the duplicate non-dm + dm gpio and uart code we
currently have. These things combined will push things to their
limit and may very well grow the BSS section too.

Regards,

Hans

  parent reply	other threads:[~2016-07-02 11:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20160630002500.2817-1-andre.przywara@arm.com>
     [not found] ` <af86054b-8fcc-3b58-6889-7af02cd7a9fc@redhat.com>
2016-06-30 15:43   ` [U-Boot] [PATCH] SPL: sunxi: don't force .BSS into DRAM Andre Przywara
2016-06-30 17:40     ` Peter Korsgaard
2016-06-30 21:09       ` Marek Vasut
     [not found]   ` <CAPnjgZ2ajoU90kSNMoHVhbXN4CdeKzs5-SQ-Hq-xePfC0brJ3A@mail.gmail.com>
2016-07-02 11:49     ` Hans de Goede [this message]
2016-07-03 21:15       ` Simon Glass
2016-07-03 22:24       ` André Przywara
2016-06-30  0:29 Andre Przywara
2016-06-30  1:54 ` Marek Vasut
2016-06-30  8:50   ` Andre Przywara

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=cf2cbbaa-8e8a-dc97-cd0c-6c11061630c0@redhat.com \
    --to=hdegoede@redhat.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.