Hi Udit, On 25.04.25 06:35, Kumar, Udit wrote: > > On 4/23/2025 7:52 PM, Ahmad Fatoum wrote: >> I went with the FIT route for barebox, because we can now ship device >> trees for all enabled boards in the same FIT image alongside one generic >> second stage barebox with DT support. If you want to support different >> boards with your OS image that might be of interest to you as well. > > Sorry for novice question. > > But trying to understand how FIT fixes problem for you . > > at the end, its a jump command to OS/other code be it through u-boot go or > fit way.
The difference is whether, prior to the jump, the caches are flushed and the MMU is disabled and U-Boot's go does neither. Thinking about it, I am wondering whether U-Boot go is inherently broken, even for the jump-table use case, if caches are enabled: Because go doesn't do any cache maintenance, what guarantee do we have that the I-Cache actually reflects the data that was freshly loaded? It might only work because the region you go to happens to not be resident in the I-Cache yet... FWIW, barebox go does cache maintenance and disables the MMU, which is why I mistakenly thought U-Boot's go would behave similarly. barebox didn't inherit the jump table mechanism. > In case OS/other code handles caches, then should not be an issue. > But this put requirement on next stage to take care of caches [0] In the fit case, MMU is disabled and so the next stage is free to not do any cache maintenance if it doesn't need to enable the MMU. Linux and barebox want to use the MMU/caches by default, so that's why they have to do cache maintenance. If they assume MMU is disabled on startup, it follows the lines in the cache are stale and unimportant and then memory corruption occurs once they are discarded. Cheers, Ahmad > > > [0] : > https://github.com/torvalds/linux/blob/master/arch/arm64/kernel/head.S#L105 > > >> >> Cheers, >> Ahmad >> >>> Regards, >>> Simon >>> > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |