All of lore.kernel.org
 help / color / mirror / Atom feed
From: Giulio Benetti <giulio.benetti@benettiengineering.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] spl: fix entry_point equal to load_addr
Date: Fri, 6 Dec 2019 14:48:58 +0100	[thread overview]
Message-ID: <2352b865-c5f9-329e-9b29-411c4e0530d9@benettiengineering.com> (raw)
In-Reply-To: <20191206133445.GH9549@bill-the-cat>

Hello Tom, all,

On 12/6/19 2:34 PM, Tom Rini wrote:
> On Fri, Dec 06, 2019 at 01:58:46PM +0100, Simon Goldschmidt wrote:
>> On Fri, Dec 6, 2019 at 1:46 PM Patrice CHOTARD <patrice.chotard@st.com> wrote:
>>>
>>> Hi
>>>
>>> This patch is breaking the STM32MP15 basic boot (spl => u-boot).
>>
>> Looking at socfpga gen5 u-boot.img, this is probably broken as well.
>>
>> And I don't even see any RB or TB tags here :-(
> 
> Ugh, what the heck?  I applied this because I looked over the changes
> and they seemed correct.  I'm quite willing to just revert this but I
> would like to know how it's breaking.  Sorry all!
> 

IMHO this is due to wrong images creation with mkinage, especially when 
passing parameters with -a and -e flags.

In my case I need them to be:
-a 0x80002000 (load address) => CONFIG_SYS_TEXT_BASE
-e 0x800023FD (entry point where SPL jumps to) => CONFIG_SYS_UBOOT_START

So *maybe* on STM32MP1 and other broken boards -e 
(CONFIG_SYS_UBOOT_START) is not equal to -a (CONFIG_SYS_TEXT_BASE) as 
was assumed before(but wrong).

Indeed CONFIG_SYS_UBOOT_START is set to 0 if not specified in 
u-boot/Makefile:
`
# U-Boot entry point, needed for booting of full-blown U-Boot
# from the SPL U-Boot version.
#
ifndef CONFIG_SYS_UBOOT_START
CONFIG_SYS_UBOOT_START := 0
endif
`

So probably broken boards try to jump to absolute 0.
A solving patch would be:
ifndef CONFIG_SYS_UBOOT_START
CONFIG_SYS_UBOOT_START := CONFIG_SYS_TEXT_BASE
endif

What do you think?

Sorry for this mess!

Best regards
-- 
Giulio Benetti
Benetti Engineering sas

  parent reply	other threads:[~2019-12-06 13:48 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-25 16:18 [U-Boot] [PATCH] spl: fix entry_point equal to load_addr Giulio Benetti
2019-12-05 22:09 ` Tom Rini
2019-12-06 12:46   ` Patrice CHOTARD
2019-12-06 12:58     ` Simon Goldschmidt
2019-12-06 13:34       ` Tom Rini
2019-12-06 13:37         ` Simon Goldschmidt
2019-12-06 13:44           ` Tom Rini
2019-12-06 13:48         ` Giulio Benetti [this message]
2019-12-06 14:04           ` Patrice CHOTARD
2019-12-06 17:23             ` Giulio Benetti
2019-12-06 14:05           ` Simon Goldschmidt
2019-12-06 14:55             ` Tom Rini
2019-12-07 21:28               ` Simon Goldschmidt
2020-01-10 14:57                 ` Giulio Benetti
2020-01-10 21:51                   ` Tom Rini
2020-01-16 14:40 ` Tom Rini
2020-01-16 14:46   ` Giulio Benetti
2020-01-16 14:49     ` Tom Rini

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=2352b865-c5f9-329e-9b29-411c4e0530d9@benettiengineering.com \
    --to=giulio.benetti@benettiengineering.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.