2024-09-03 04:30 AM
We have a custom board based on STM32MP157C-DK2. U_boot shows a splash image(logo). Then U-boot starts the kernel from a fip image. I the same fip image there is a ramfs partition in cpio.gz format which is used as rootfs by the kernel. When kernel starts it decompresses the ramfs partition. During this decompression the logo on the screen gets corrupted. I am sure this corruption happens during the decompression as I put 1 ms delay in the kernel code where it is decompressed and I can see how the logo gets slowly corrupted for about 20 seconds. This is the result of the corruption:
This happens because we have 1Gb of ram starting at address 0xC0000000 and framebuffer in U-boot occupies the top part of the ram which is around 0xfff00000. Obviously this is the address space which kernel uses to decompress the ramfs partition. I have this in the kernel dts:
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;
gpu_reserved: gpu@fa000000 {
reg = <0xfa000000 0x4000000>;
no-map;
};
};
But this does not help to prevent the kernel to use this address to decompress the ramfs partition.
I can change the framebuffer address in U-boot to prevent this corruption to happen in kernel but I do not think this is proper solution as I am not sure which address to use for it as it might cause another corruption in U-boot or in kernel.
Is there a proper solution for this problem?
Is it possible to instruct kernel to use another safe address range for the ramfs?