linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Ahsan Hussain <ahsan_hussain@mentor.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: <linux-arm-kernel@lists.infradead.org>, <u-boot@lists.denx.de>,
	<ardb@kernel.org>
Subject: Re: U-Boot: Arm64: bootm gets stuck if RANDOMIZE_BASE is disabled
Date: Tue, 13 Jul 2021 14:53:18 +0500	[thread overview]
Message-ID: <d3704b71-083d-f0ec-3cdb-f6c5dbcd0f49@mentor.com> (raw)
In-Reply-To: <20210713092549.GA13027@C02TD0UTHF1T.local>


On 7/13/21 2:25 PM, Mark Rutland wrote:
> On Tue, Jul 13, 2021 at 02:15:08PM +0500, Ahsan Hussain wrote:
>> Hello,
>>
>> I'm dumbfounded by a seemingly unrelated early kernel hang/failing to boot
>> when CONFIG_RANDOMIZE_BASE=n is set in kernel and we use FIT uImage. I've
>> verified this behavior on a couple of i.MX8 SoCs (i.MX8M plus and i.MX8QXP)
>> and the results remain consistent.
>>
>> I'm able to boot kernel when I use booti command. However when I use bootm
>> to boot a U-Boot fitImage (with kernel and fdt load addresses/entrypoint in
>> .its file same as I used for booti command; also tried disabling relocation
>> for fdt by setting fdt_high=~0UL), the boot gets stuck at "Starting kernel
>> ...". On disabling RANDOMIZE_BASE kconfig in Linux the same fitImage is able
>> to boot.
> Can you say which address you're trying to load the kernel to?
At 0xf0000000, towards the end of first DRAM bank which starts at 
0x40000000.
>> I've tried enabling earlycon and U-Boot debug messages in common/bootm.c and
>> arch/arm/lib/bootm.c but found no helpful difference in both boot flows.
>> Please let me know if I'm missing something obvious or where do I start
>> looking to debug this issue.
> IIUC, the booti command respects the text_offset from the kernel header,
> whereas bootm will not. If you have a hard-coded offset, it's possible
> you're violating the offset the kernel expects, and where the kernel is
> not relocatable, if can't fix itself up.

A minor correction is that when CONFIG_RANDOMIZE_BASE is _enabled_ the 
issue is gone. It is only observed when RANDOMIZE_BASE is _disabled_. 
Both booti and bootm calculate text_offset the same way based on arm64 
image header->image_size field, in booti_setup() routine from U-Boot 
arch/arm/lib/image.c.


Regards,
Ahsan

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-07-13 10:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13  9:15 U-Boot: Arm64: bootm gets stuck if RANDOMIZE_BASE is disabled Ahsan Hussain
2021-07-13  9:25 ` Mark Rutland
2021-07-13  9:53   ` Ahsan Hussain [this message]
2021-07-14  8:17     ` Ahsan Hussain

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=d3704b71-083d-f0ec-3cdb-f6c5dbcd0f49@mentor.com \
    --to=ahsan_hussain@mentor.com \
    --cc=ardb@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.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).