RPi4
RPi4 copied to clipboard
RPI PlatformBootManager cleanup
Currently, the RPI3/4 uses its own private copy of PlatformBootManagerLib. Other Arm systems either use the common copy in ArmPkg or a slightly modified version.
This issue is to track switching from the RPI specific version to the more common version.
Here is a list of items that the RPI private version does, which are missing from the common ArmPkg version:
-
[x] The RPI version registers for ExitBootServicesHandler to call ExitBootServicesHandler, which adds a debug function to update boot progress to 100% and print a debug message on screen. This was originally added to help debug early OS boot on the PI. This is not needed anymore and can be dropped.
-
[x] The RPI version excludes the UEFI shell from the BootOrder, while the ArmPkg version adds it to the end of the bootlist by default (after all other auto-discovered boot options). This behavior in ArmPkg is more preferred, and solves an issue on the RPI where the shell can be launched only using the F1 hotkey during boot.
-
[ ] The ArmPkg version uses PLATFORM_BOOT_MANAGER_PROTOCOL to allow adding platform specific boot options and keys, and does proper maintenance on the BootOrder (including keeping existing entries in place, removing stale auto-discovered entries, and adding newly discovered entries to the end). RPI should implement this protocol and pass the SD/MMC to make it higher in the boot order (or first if we want to). This gives us full control on the ordering of platform specific boot options, including deciding if we want HTTP Boot to be higher in the options than PXE, etc..
-
[ ] The RPI version registers "F1" hotkey to launch the Shell during boot. This can still be achieved in ArmPkg by implementing the PLATFORM_BOOT_MANAGER_PROTOCOL in RPI and adding that hotkey to the list of BootKeys returned by GetPlatformBootOptionsAndKeys()
-
[ ] For latformBootManagerUnableToBoot(), the ArmPkg does nothing, and the RPI version display a string and wait indefinitely for user to press a key before entering Setup. The ArmPkg behavior makes more sense. Just enter setup when cannot find any devices. An improvement (as done on some commercial systems) is to customize this behavior to do things such as loop in boot retry forever (or for X number of times) before giving up, and then enter setup, or restart system, etc.. This behavior could be an improvement to add to ArmPkg, along with feature PCDs to control the behavior.
-
[ ] ArmPkg prints a hard-coded firmware version string (VERSION_STRING_PREFIX="Tianocore/EDK2 firmware version %d"). This can be improved to use PcdFirmwareVendorString and PcdFirmwareVersionString instead of hard-coding the "TianoCore/EDK2" firmware vendor. This could be submitted as an improvement to the ArmPkg version.
-
[ ] The RPI version prints a prompt "ESC (setup), F1 (shell), ENTER (boot)", while ArmPkg prints a prompt "Press ESCAPE for boot options ". Both are hard-coded. Seems like improving the ArmPkg version to use a PCD is more flexible and allows platforms to customize the prompt.
-
[ ] The RPI version prints prompt messages and progress bar on both Graphics and Serial consoles. The common version in ArmPkg only prints on Graphics console. The prints on serial are useful, and could be submitted as an improvement to the ArmPkg version.
-
[ ] ArmPkg uses a common EDKII_SERIAL_PORT_LIB_VENDOR_GUID , while RPI version uses a redundant SERIAL_DXE_FILE_GUID