Re: ARM bootm regression

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>Среда, 21 октября 2020, 17:44 +03:00 от Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>:
>
>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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux