-
Notifications
You must be signed in to change notification settings - Fork 97
Description
Follow-up from
- Kernel does not parse device tree passend on startup to get available memory seL4#373
- risc-v/spike: reserve memory for SBI seL4#365 (comment)
- Pass a1 as received from OpenSBI to main's second argument #103
There is no plan that the kerne will ever get device tree parsing support, as this is a huge effort for verification. A way to improve the situation is extending the ELF loader support for device tree parsing instead. Since it is usually created with the kernel, it has a certain understanding of the kernel's world-view and expectations. It can do some sanity checks easily before trying to load the kernel into memory regions that are not available of where booting will fails badly later anyway. If a device tree binary blob is compiled into the ELF Loder and a DTB is also passed by a bootloader, the ELF-Loader should try to match them and stop the boot process if there are serious differences. One example for such a sanity check is the the available memory areas on RISC-V, where OpenSBI carves out space for itself dynamically, where the ELF loader's compiled-in DTB contains a reserved area for this that is maintained manually.