summaryrefslogtreecommitdiff
path: root/include/efi.h
Commit message (Collapse)AuthorAgeFilesLines
* efi: add device tree configuration table supportAhmad Fatoum2022-10-131-0/+1
| | | | | | | | | | When running on device-tree enabled systems, barebox as EFI payload may be passed a device tree via the system table. We've no use for that just yet, but lets make it available as /efi.dtb. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221010060842.2083550-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: implement and use for_each_efi_config_tableAhmad Fatoum2022-10-131-0/+5
| | | | | | | | | | Iterating over the system table is something we do at two places, already and the third will soon follow. Use the occasion to factor the loop head into a macro. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221010060842.2083550-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* hw_random: add EFI RNG driverAhmad Fatoum2022-10-131-0/+18
| | | | | | | | | | The EFI_RNG_PROTOCOL_GUID is quite simple and as such was a good first protocol to implement for the barebox EFI loader support. We don't yet have a payload-side driver making use of it though, so add that here. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221010060842.2083550-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: capitalize enumeration constantsAhmad Fatoum2022-10-131-3/+3
| | | | | | | | | Linux coding style is using all caps for constants. Follow this for enum efi_locate_search_type as well. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221010060842.2083550-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: retire efi_bool_tAhmad Fatoum2022-10-131-1/+0
| | | | | | | | | | GCC defaults to a one-byte bool on all its platform, except for IBM RS/6000, which will most likely never support. Thus just drop the efi_bool type we only use at a single place and use bool directly. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221010060842.2083550-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: Implement device_path_to_subtype()Sascha Hauer2021-12-131-0/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: define and use new EFI_ERROR_MASK macroAhmad Fatoum2021-12-131-32/+35
| | | | | | | | | Future code may want to differentiate between warnings and errors, so add a new macro for the error mask and use it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211122084732.2597109-24-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: make efi_main __noreturnAhmad Fatoum2021-12-131-0/+2
| | | | | | | | The function never returns, so mark it as such. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211122084732.2597109-23-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: align LOAD_FILE_PROTOCOL_GUID's name with other PROTOCOL_GUIDsAhmad Fatoum2021-11-251-1/+1
| | | | | | | | | Convention is to m/EFI_.*_PROTOCOLG_GUID/. Rename LOAD_FILE_PROTOCOL_GUID for uniformity. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211122084732.2597109-7-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* resource: enable use of iomem command on EFI systemsAhmad Fatoum2021-04-131-0/+9
| | | | | | | | | | | | iomem was so far unimplemented for EFI, because barebox didn't know what to put there as the UEFI implementation does the heavy lifting. Add an initcall that uses the EFI get_memory_map entry point to remedy this. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.pengutronix.de/20210410110355.2105448-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: declare prototype for close_protocol BootServiceAhmad Fatoum2021-02-161-1/+2
| | | | | | | | | | | | | Sometimes, drivers need to probe whether the EFI device in front of them is the actual hardware they expect. If it's not, the driver should call close_protocol to leave the decision on whether to match this device to another driver. Use the correct type for close_protocol to facilitate this. No functional change, as no in-tree driver makes use of this yet. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* include: add SPDX GPL-2.0-only license tags for files without licensing ↵Roland Hieber2020-02-171-0/+1
| | | | | | | | | | | information According to our /README, GPL-2.0-only applies for the whole project except noted otherwise. Signed-off-by: Roland Hieber <rohieb@rohieb.name> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: turn set of defines into enumerationsAhmad Fatoum2019-12-091-19/+23
| | | | | | | | This allows us to use enum types instead of plain integers ttypes to hold the values, which is done in a follow up commit. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: retire efi_compare_guid in favor of efi_guidcmpAhmad Fatoum2019-10-181-5/+0
| | | | | | | | | | | | Both functions wrap the same memcmp except that one uses pointers to GUIDs and the other passes the GUIDs by value. The function is static inline, so it doesn't really matter which one we keep. We'll drop efi_compare_guid because it's been used once only in the code base so far. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: add prototype and definition for set_watchdog_timerOleksij Rempel2019-02-181-1/+4
| | | | | Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi-gui: add USB IO Protocol GUID definitionJean-Christophe PLAGNIOL-VILLARD2017-10-271-0/+3
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: add prototype and definition for setting timerJean-Christophe PLAGNIOL-VILLARD2017-03-091-1/+7
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: add prototype and definition for creating and closing eventJean-Christophe PLAGNIOL-VILLARD2017-03-091-2/+15
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: add efi handle dump commandJean-Christophe PLAGNIOL-VILLARD2017-03-091-0/+8
| | | | | | | so we can inspect easly what is supported by the EFI implementation we running on Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi-gui: add Timestamp Protocol GUID definitionJean-Christophe PLAGNIOL-VILLARD2017-03-091-0/+3
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: bus: add firmware vendor and resision and tables infoJean-Christophe PLAGNIOL-VILLARD2017-03-091-1/+6
| | | | | | | This alllow us to known where we boot from Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: move x86 efi boot support to x86 archJean-Christophe PLAGNIOL-VILLARD2017-02-271-1/+1
| | | | | | | prepare to drop the efi arch as efi boot up is not arch sepecific Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: use an EFI variable to save the environmentMichael Olbrich2015-07-271-0/+1
| | | | | Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: write volatile EFI variables used by systemdMichael Olbrich2015-07-271-0/+5
| | | | | | | | | | LoaderTimeInitUSec and LoaderTimeExecUSec are used e.g. in systemd-analyze to calculate the time spent in the firmare and barebox. LoaderDevicePartUUID is used to mount the EFI partition to /boot. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: export device_path_from_handle()Michael Olbrich2015-07-271-0/+1
| | | | | Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: add helper to get the GPT partition UUID for a deviceMichael Olbrich2015-07-271-0/+1
| | | | | Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: add support for initrd loadingMichael Olbrich2015-07-231-1/+1
| | | | | Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: efivars: implement write supportLucas Stach2014-12-091-1/+2
| | | | | | | | Implement the standard FS ops for writing/manipulating efivars. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: add Barebox GUIDLucas Stach2014-12-091-0/+4
| | | | | | | | A proper GUID is needed to namespace all sorts of things, most prominently persistent variables. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: add proper reset hookLucas Stach2014-12-091-4/+7
| | | | | | | | This allows to actually reset the system from barebox instead of dropping back into the EFI firmware. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: add function to determine type of device pathLucas Stach2014-12-091-0/+1
| | | | | | | | | Thanks to the wonders of UEFI we have to walk down the device path all the way until we arrive at the device we got this path from... Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* EFI: introduce efi_strguid to convert GUID to human readable namesJean-Christophe PLAGNIOL-VILLARD2014-07-161-0/+108
| | | | | | | | | use in devinfo Protocols Tested today on qemu with all the GUID translated Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add initial EFI architecture supportSascha Hauer2014-07-161-265/+204
| | | | | | | This adds support for running barebox in an EFI environment on X86 PC hardware. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: Add more error codesSascha Hauer2014-07-141-7/+34
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Move efi.h to include/Sascha Hauer2014-07-141-0/+547
With upcoming EFI payload support the efi.h file will diverge from the kernel, so move it from include/linux/ to include/ Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>