u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: ChiaWei Wang <chiawei_wang@aspeedtech.com>
To: Joel Stanley <joel@jms.id.au>, Tom Rini <trini@konsulko.com>
Cc: "Ryan Chen" <ryan_chen@aspeedtech.com>,
	BMC-SW <BMC-SW@aspeedtech.com>,
	"U-Boot Mailing List" <u-boot@lists.denx.de>,
	"Cédric Le Goater" <clg@kaod.org>
Subject: RE: [PATCH] configs: ast2600: Move SPL bss section to DRAM space
Date: Wed, 29 Jun 2022 00:36:04 +0000	[thread overview]
Message-ID: <HK0PR06MB3779EDBF16AC6E113EC3F1A391BB9@HK0PR06MB3779.apcprd06.prod.outlook.com> (raw)
In-Reply-To: <CACPK8Xfq6N9BaAhb1Y+UgWDeDCxpYD3j9-tC8heUg5hh398Nyg@mail.gmail.com>

Hi Joel,

> From: Joel Stanley <joel@jms.id.au>
> Sent: Tuesday, June 28, 2022 12:24 PM
> 
> Hi Chai Wei,
> 
> On Wed, 1 Jun 2022 at 08:21, Chia-Wei Wang
> <chiawei_wang@aspeedtech.com> wrote:
> >
> > The commit b583348ca8c8 ("image: fit: Align hash output buffers")
> > places the hash output buffer at the .bss section. However, AST2600 by
> > default executes SPL in the NOR flash XIP way. This results in the
> > hash output cannot be written to the buffer as it is located at the R/X only
> region.
> >
> > We need to move the .bss section out of the SPL body to the DRAM
> > space, where hash output can be written to. This patch includes:
> >  - Define the .bss section base and size
> >  - A new SPL linker script is added with a separate .bss region
> > specified
> >  - Enable CONFIG_SPL_SEPARATE_BSS kconfig option
> >
> > Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
> 
> This patch breaks booting for me.
> 
> My concern with the approach is it creates extra maintenance work.
> When changes are made to the main linker script they need to be mirrored
> here, or else the aspeed port will miss out. (Having the machine tested in CI
> will help this somewhat, but only for the code paths we can test under
> emulation).

The patch was trying to solve the hash buffer allocation change to common code and to avoid similar issues.
But I agree there is additional maintenance work on the customized linker script.

> 
> I know the patch has been merged, but I have a few questions:
> 
> I imagine the ast2600 is not the only board that runs XIP. How do other boards
> solve the problem?
> 
> What happens when a symbol that is used before DRAM training has
> completed is placed in bss?

Honestly, I am not sure how other platforms/boards dealing with this.
But like U-Boot REAME stated, the initial global data is read-only.
I guess we have to be careful about the global variable use before DRAM initialization or even variable relocation.

> 
> How do you plan to support systems that don't have NOR?

We would like to have another defconfig for eMMC booting.
If the NOR-based linker script is not applicable, the default one can be used.

Chiawei

      parent reply	other threads:[~2022-06-29  0:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-01  8:21 [PATCH] configs: ast2600: Move SPL bss section to DRAM space Chia-Wei Wang
2022-06-02  2:05 ` Neal Liu
2022-06-23 12:19 ` Tom Rini
2022-06-28  4:23 ` Joel Stanley
2022-06-28  4:57   ` Sean Anderson
2022-06-29  0:39     ` ChiaWei Wang
2022-06-29  0:36   ` ChiaWei Wang [this message]

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=HK0PR06MB3779EDBF16AC6E113EC3F1A391BB9@HK0PR06MB3779.apcprd06.prod.outlook.com \
    --to=chiawei_wang@aspeedtech.com \
    --cc=BMC-SW@aspeedtech.com \
    --cc=clg@kaod.org \
    --cc=joel@jms.id.au \
    --cc=ryan_chen@aspeedtech.com \
    --cc=trini@konsulko.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;
as well as URLs for NNTP newsgroup(s).