Difference between U-Boot and UEFI firmware


I'm reading a book (Mastering Embedded Linux Programming, 2nd ed). In the chapter on bootloaders it explains the booting process with U-Boot and with UEFI firmware.

It looks like the booting steps are exactly the same, with exception that at the last step either U-Boot or UEFI firmware takes over and loads a Linux image in RAM.

So what is the exact difference? Why would one choose U-Boot over UEFI or vica versa?

Best Answer

The UEFI specification describes an API that a firmware may expose. This API can be used by applications and drivers loaded by the firmware.

The open source firmware Das U-Boot contains a partial implementation of the UEFI specification. A complete open source implementation is offered by TianoCore EDK II. Companies like Phoenix offer closed source UEFI firmware.

On the 64-bit ARM architecture the Linux distributions Suse and Fedora use U-Boot to load GRUB as a UEFI application from U-Boot which in turn loads and starts the Linux kernel via UEFI API calls. Linux itself has an UEFI stub so it can be started as a UEFI application.

The UEFI specification defines a runtime that stays in memory until the system is rebooted. The UEFI runtime offers services including changing UEFI variables, uploading new firmware, and rebooting the system. Compliant to the UEFI specification U-Boot also contains a UEFI runtime. But as of today the functionality is limited to rebooting the system.

Related Question