mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Alexander Shiyan" <shc_work@mail.ru>
To: "Sascha Hauer" <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: ARM bootm regression
Date: Thu, 22 Oct 2020 09:13:27 +0300	[thread overview]
Message-ID: <1603347207.861555734@f485.i.mail.ru> (raw)
In-Reply-To: <20201021144404.GJ26805@pengutronix.de>

>Среда, 21 октября 2020, 17:44 +03:00 от Sascha Hauer <s.hauer@pengutronix.de>:
>
>On Fri, Oct 16, 2020 at 11:49:16AM +0300, Alexander Shiyan wrote:
>> Hello.
>> 
>> Found a regression in arm/lib32/bootm.c after a patch
>> "ARM: bootm: make sure we place the kernel in free memory".
>> 
>> The initial memory size for the board is set to 8 MB (before reading the real value from DT),
>You could read the real value from DT earlier using libfdt, see
>arch/arm/cpu/board-dt-2nd.c for usage examples. That doesn't solve it of
>course when your board really has only 8MB memory.
>
>> so the stack, malloc_space, etc. are placed in the initial 8M space.
>> Then get_kernel_addresses() gets the real SDRAM area (for my board it is 64M),
>> but decreases this size by the first children size (malloc_space),
>> so mem_end is incorrect in this case.
>
>Does an additional:
>
>if (kaddr < mem_start)
>kaddr = mem_start;
>
>help?

Works fine with the following modification:

		/*
		 * Make sure we do not place the image outside of the
		 * available memory.
		 */
		if (((kaddr + image_size + spacing) > mem_end) &&
		    ((mem_end - image_size - spacing) >= mem_start))
			kaddr = mem_end - image_size - spacing;

---
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2020-10-22  6:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-16  8:49 Alexander Shiyan
2020-10-19  9:05 ` Sascha Hauer
2020-10-19  9:38   ` Alexander Shiyan
2020-10-21 14:44 ` Sascha Hauer
2020-10-22  6:13   ` Alexander Shiyan [this message]
2020-10-22  7:26     ` Sascha Hauer

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=1603347207.861555734@f485.i.mail.ru \
    --to=shc_work@mail.ru \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    --subject='Re: ARM bootm regression' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox