* bootm: booting of uncompressed uimages broken
@ 2016-02-23 9:52 Hubert Feurstein
2016-02-23 11:09 ` Sascha Hauer
0 siblings, 1 reply; 3+ messages in thread
From: Hubert Feurstein @ 2016-02-23 9:52 UTC (permalink / raw)
To: barebox
Hi,
booting of uncompressed uimages is broken since patch "ARM: bootm: fix
default uImage placement" (0839e3f402ffc74202a1ca4fbeaffcadb4336ce1):
This is the change causing the issue:
@@ -138,13 +144,10 @@ static int do_bootm_linux(struct image_data *data)
return ret;
/*
- * Put devicetree/initrd at maximum to 128MiB into RAM to not
- * risk to put it outside of lowmem.
+ * put oftree/initrd close behind compressed kernel image to avoid
+ * placing it outside of the kernels lowmem.
*/
- if (mem_size > SZ_256M)
- mem_free = mem_start + SZ_128M;
- else
- mem_free = PAGE_ALIGN(data->os_res->end + SZ_1M);
+ mem_free = PAGE_ALIGN(data->os_res->end + SZ_1M);
return __do_bootm_linux(data, mem_free, 0);
}
System Info: iMX6S; 512MB RAM; LoadAddress 0x10008000; Barebox v2015.06.0
Best Regards
Hubert
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: bootm: booting of uncompressed uimages broken
2016-02-23 9:52 bootm: booting of uncompressed uimages broken Hubert Feurstein
@ 2016-02-23 11:09 ` Sascha Hauer
[not found] ` <CAFfN3gVK2BHq4wC9gTxN-pJ=-j6FHiikfuV+FdGfVwiOKG2a_Q@mail.gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Sascha Hauer @ 2016-02-23 11:09 UTC (permalink / raw)
To: Hubert Feurstein; +Cc: barebox, Lucas Stach
Hi Hubert,
On Tue, Feb 23, 2016 at 10:52:21AM +0100, Hubert Feurstein wrote:
> Hi,
>
> booting of uncompressed uimages is broken since patch "ARM: bootm: fix
> default uImage placement" (0839e3f402ffc74202a1ca4fbeaffcadb4336ce1):
>
> This is the change causing the issue:
> @@ -138,13 +144,10 @@ static int do_bootm_linux(struct image_data *data)
> return ret;
>
> /*
> - * Put devicetree/initrd at maximum to 128MiB into RAM to not
> - * risk to put it outside of lowmem.
> + * put oftree/initrd close behind compressed kernel image to avoid
> + * placing it outside of the kernels lowmem.
> */
> - if (mem_size > SZ_256M)
> - mem_free = mem_start + SZ_128M;
> - else
> - mem_free = PAGE_ALIGN(data->os_res->end + SZ_1M);
> + mem_free = PAGE_ALIGN(data->os_res->end + SZ_1M);
>
> return __do_bootm_linux(data, mem_free, 0);
> }
>
> System Info: iMX6S; 512MB RAM; LoadAddress 0x10008000; Barebox v2015.06.0
I assume what happens here is that due to 0839e3f40 barebox places the
device tree close behind the kernel image, the kernel then copies itself
out of the way so it won't overwrite itself while uncompressing, then it
uncompresses itself back to 0x10008000 and overwrites the device tree.
This behaviour is broken and should be fixed.
However, 0x10008000 is a poor choice for the load address. It's exactly
the place where the decompressor has to put the image to after
decompressing, so this address forces the decompressor to move the
compressed kernel somewhere else before decompressing it.
You could specify the load address to 0xffffffff. This allows barebox to
pick a good place for the kernel image. A bonus is a slightly faster
kernel startup because barebox will pick a place that does not force the
decompressor to move the kernel image.
We should probably finally fix the kernel decompressor so that it won't
overwrite the device tree.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: bootm: booting of uncompressed uimages broken
[not found] ` <20160223120404.GG3939@pengutronix.de>
@ 2016-02-24 10:12 ` Hubert Feurstein
0 siblings, 0 replies; 3+ messages in thread
From: Hubert Feurstein @ 2016-02-24 10:12 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
Hi Sascha,
> Hm, yes, you said so in your mail, I misread it. Then I don't see what
> could be the problem. Does bootm -v give some valuable output?
here is the output of bootm -v <image> (fixed version):
barebox:/ bootm -v /mnt/emmc0/boot/uImage
Image Name: Linux-3.10.14.vd2
Created: 2015-08-06 10:13:02 UTC
OS: Linux
Architecture: ARM
Type: Kernel Image
Compression: uncompressed
Data Size: 2929528 Bytes = 2.8 MiB
Load Address: 10008000
Entry Point: 10008000
Loading U-Boot uImage '/mnt/emmc0/boot/uImage'
OS image not yet relocated
Passing control to ARM Linux uImage handler
no initrd load address, defaulting to 0x18000000
commandline: console=ttymxc2,115200n8
Starting kernel at 0x10008000, oftree at 0x18000000...
> Could it be that the device tree blob is inside the Kernels bss segment?
According to System.map bss ends at offset 0x0567b04. So bss will
overwrite the device-tree blob, because currently the oftree is placed
at 0x103d4000. I've played with the oftree-offset a little bit, and I
need at least 6MB offset from the end of the kernel image in order to
get the system booting.
Hubert
2016-02-23 13:04 GMT+01:00 Sascha Hauer <s.hauer@pengutronix.de>:
> On Tue, Feb 23, 2016 at 12:29:41PM +0100, Hubert Feurstein wrote:
>> Hi Sascha,
>>
>> I use an *uncompressed* kernel image. So the kernel is loaded once
>> without any relocation (LoadAddress == StartAddress).
>
> Hm, yes, you said so in your mail, I misread it. Then I don't see what
> could be the problem. Does bootm -v give some valuable output?
> Could it be that the device tree blob is inside the Kernels bss segment?
>
> Sascha
>
>
> --
> Pengutronix e.K. | |
> Industrial Linux Solutions | http://www.pengutronix.de/ |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-02-24 10:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-23 9:52 bootm: booting of uncompressed uimages broken Hubert Feurstein
2016-02-23 11:09 ` Sascha Hauer
[not found] ` <CAFfN3gVK2BHq4wC9gTxN-pJ=-j6FHiikfuV+FdGfVwiOKG2a_Q@mail.gmail.com>
[not found] ` <20160223120404.GG3939@pengutronix.de>
2016-02-24 10:12 ` Hubert Feurstein
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox