Closed antonsviridenko closed 5 years ago
Hi Anton,
Thank you for reporting this,
It is possible that the DTB memory node is modified by the bootloader, but I am not sure. I will have a look and let you know of my findings.
PS. The kernel cmd line in general is used to easily override the DT nodes... such that you dont need to rebuild the DTB, just tweak from cmd line. Cmdline takes precedence over the DT nodes Eugen
It is possible that the DTB memory node is modified by the bootloader, but I am not sure. I will have a look and let you know of my findings.
Yes, according to sources, memory size is passed to kernel by modifying DTB: https://github.com/linux4sam/at91bootstrap/blob/master/driver/load_kernel.c#L85
PS. The kernel cmd line in general is used to easily override the DT nodes... such that you dont need to rebuild the DTB, just tweak from cmd line. Cmdline takes precedence over the DT nodes
I expect this behavior too
I see that the arm-kernel guys have answered this very well, I will post here a summary: mem=size@address otherwise address is 0 by default hence a crash. Need to be careful where in DDR kernel and DTB is loaded, so kernel can access this DDR Careful with bootloaders ram initialization (U-boot can relocate the DTB to an area of DDR where kernel does not have access to).
I see that the "mem=..." need to be reworked to have a base address, etc. Feel free to submit patches to address this issue you found. However to make sure we do not break anything, testing would be required so if someone has the boards, a Tested-by tag would be sufficient to have this merged into the main branch.
Thanks ! Eugen
Are you aware if following configurations exist and successfully work in production? Like this one https://github.com/linux4sam/at91bootstrap/blob/8b9064beb6169f2c3be089fa99c5080b2182639f/board/at91sam9261ek/Config.in.linux_arg#L2
and others with "mem=" in command line. Btw, why "mem=NN" is used when RAM size can be set in the device tree?
at91bootstrap boots Linux directly, without u-boot
Linux version is 4.9 or higher
Kernel command line is passed by at91bootstrap, i.e. CONFIG_LINUX_KERNEL_ARG_STRING is enabled
SoC is SAMA5D2
I observe kernel crashes when "mem=64M" is appended to command line, please see this post
http://lists.infradead.org/pipermail/linux-arm-kernel/2018-November/613095.html