During the process of enabling the S32G3 in our Linux environment, I encountered the following configuration within the BSP:
CONFIG_CMA_SIZE_MBYTES=256
I noticed that if this option is not specified, the system fails to boot.
I investigated the issue and found that no code appears to be utilizing the Contiguous Memory Allocator (CMA) subsystem. However, the system still fails to boot without the option set.
Upon further investigation, I surmised that the CMA configuration itself might not be the critical factor, but rather that the kernel is attempting to use the 256MB memory region starting at 0xf0000000. I was able to successfully run the kernel by explicitly reserving this memory region in the Device Tree with the following entry:
DummyUnknown: memory@f0000000 {
compatible = "reserved-memory";
reg = <0x0 0xf0000000 0x0 0x010000000>;
no-map;
};While this allows me to proceed without knowing the precise cause, I noted that when using the BSP firmware (ATF + U-Boot) with EFIBOOT, the kernel again fails to boot. Looking at U-Boot's memory usage, I discovered that EFI variables and SMI data are situated in this region at 0xfa000000, which leads me to believe this is one of the reasons for the unsuccessful boot.
By trying to restrict the reservation, I was able to narrow the required memory area to a 16MB region starting at 0xfb000000, which also allows the kernel to run successfully in EFI mode.
I've conducted various experiments on this area and established that its relevance is only during early boot, where failing to reserve it leads to a silent kernel hang. Before or after the kernel has fully started, the area can be overwritten by any data without visible consequences.
I have analyzed both the ATF and U-Boot BSP codebases without finding any explicit reference to this critical area.
Since my use case is aimed at the functional safety domain, and the underlying reasons behind this malfunction are not yet fully understood, I am requesting clarification on the original CONFIG_CMA_SIZE_MBYTES=256 statement in the kernel configuration and how it relates to my findings.