mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jules Maselbas <jmaselbas@zdiv.net>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>, barebox@lists.infradead.org
Subject: Re: [PATCH v2 04/13] ARM: lds: Add SoC specific sections to go before .text_head_prologue
Date: Thu, 01 Jun 2023 23:20:03 +0200	[thread overview]
Message-ID: <CB94379A-4B3D-4834-8587-A144BF76D604@zdiv.net> (raw)
In-Reply-To: <855aba3f-6753-3260-2527-5342a6cdc6e4@pengutronix.de>



On June 1, 2023 8:34:21 AM GMT+02:00, Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
> On 25.05.23 01:43, Jules Maselbas wrote:
> > On sunxi platforms the boot rom (BROM) looks for a specific header which
> > will also be loaded in memory, causing pbl, or barebox, image not loaded
> > at the expected BASE addresse. This also cause an issue with relocatable
> > pbl: instruction used for relocation expect the image to be aligned on a
> > 4K page boundary.
> > 
> > The proposed solution here is to allow to soc specific section to be put
> > in the very begging of the .text section, before anything else.
> > 
> > Signed-off-by: Jules Maselbas <jmaselbas@zdiv.net>
> > ---
> > rfc->v2:
> >  - fix typo in commit title
> >  - replace the use of macro with SORT_BY_NAME(.text_head_soc_header*)
> > 
> >  arch/arm/lib/pbl.lds.S | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/arch/arm/lib/pbl.lds.S b/arch/arm/lib/pbl.lds.S
> > index 114ec7bc81..059909806e 100644
> > --- a/arch/arm/lib/pbl.lds.S
> > +++ b/arch/arm/lib/pbl.lds.S
> > @@ -27,6 +27,7 @@ SECTIONS
> >  	.text      :
> >  	{
> >  		_stext = .;
> > +		*(SORT_BY_NAME(.text_head_soc_header*))
> 
> You shouldn't need SORT_BY_NAME here, because they should be just one.
sadly there isnt one but two:
 - egon header
 - switch to aarch64 header

moreover the egon header is only needed once ... well actually egon header cannot be executed in aarch64 so it should never came after it (hence only once)
This makes two configurations:
 - eGON header followed by switch to aarch64 (xload conf)
 - only te switch to aarch64 (boot from USB/fel)

maybe this wont be an issue if there is only one image (not xload).

> 
> >  		*(.text_head_prologue*)
> >  		*(.text_head_entry*)
> >  		__bare_init_start = .;
> 



  reply	other threads:[~2023-06-01 21:21 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-24 23:43 [PATCH v2 00/13] Add support for Allwinner (sunxi) A64 SoC Jules Maselbas
2023-05-24 23:43 ` [PATCH v2 01/13] Documentation: sunxi: Add some documentation Jules Maselbas
2023-05-29  9:24   ` Jules Maselbas
2023-05-24 23:43 ` [PATCH v2 02/13] scripts: Add Allwinner eGON image support Jules Maselbas
2023-06-16 22:00   ` Marco Felsch
2023-06-17  7:25     ` Jules Maselbas
2023-06-20  4:52       ` Marco Felsch
2023-06-21  8:26       ` Sascha Hauer
2023-05-24 23:43 ` [PATCH v2 03/13] ARM: sunxi: introduce mach-sunxi Jules Maselbas
2023-05-24 23:43 ` [PATCH v2 04/13] ARM: lds: Add SoC specific sections to go before .text_head_prologue Jules Maselbas
2023-06-01  6:34   ` Ahmad Fatoum
2023-06-01 21:20     ` Jules Maselbas [this message]
2023-05-24 23:43 ` [PATCH v2 05/13] ARM: sunxi: Add lowlevel switch to aarch64 Jules Maselbas
2023-05-24 23:43 ` [PATCH v2 06/13] ARM: sunxi: Add debug_ll Jules Maselbas
2023-05-24 23:43 ` [PATCH v2 07/13] clk: Add clock driver for sun50i-a64 Jules Maselbas
2023-05-24 23:43 ` [PATCH v2 08/13] pinctrl: Add sun50i-a64 pinctrl driver Jules Maselbas
2023-05-24 23:43 ` [PATCH v2 09/13] mci: Add sunxi-mmc driver Jules Maselbas
2023-05-30  8:14   ` Sascha Hauer
2023-06-01  6:15     ` Jules Maselbas
2023-06-01  8:35       ` Sascha Hauer
2023-05-24 23:43 ` [PATCH v2 10/13] ARM: sunxi: Add sun50i SDRAM init Jules Maselbas
2023-05-24 23:43 ` [PATCH v2 11/13] ARM: boards: sunxi: Add initial support for the pinephone Jules Maselbas
2023-05-30  8:42   ` Sascha Hauer
2023-06-01  5:50     ` Jules Maselbas
2023-06-01  6:00       ` Ahmad Fatoum
2023-06-01  6:19         ` Jules Maselbas
2023-06-01  6:36           ` Ahmad Fatoum
2023-06-01  7:09             ` Ahmad Fatoum
2023-05-24 23:43 ` [PATCH v2 12/13] ARM: boards: sunxi: Add pine64 board Jules Maselbas
2023-05-24 23:43 ` [PATCH v2 13/13] ARM: sunxi: xload: Add helpers for chain-loading from SD-card Jules Maselbas

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=CB94379A-4B3D-4834-8587-A144BF76D604@zdiv.net \
    --to=jmaselbas@zdiv.net \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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