summaryrefslogtreecommitdiffstats
path: root/include/efi/efi-device.h
Commit message (Collapse)AuthorAgeFilesLines
* commands: provide efi_handle_dump in both payload and loaderAhmad Fatoum2024-03-051-0/+9
| | | | | | | | | | | The efi_handle_dump command is currently used when barebox is built as payload, but it's also useful when running as a loader to list handles and their protocols. Move the code into a common area to make it accessible in both configurations. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-109-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: payload: suppress EFI payload initcalls when not EFI-loadedAhmad Fatoum2024-03-051-5/+1
| | | | | | | | | | | | For development, it has proven very useful to be able to load the same barebox binary both as EFI loader and EFI payload and debug the interaction. For this to work, we need to mark all current EFI payload initcalls as such to avoid running them when barebox is not running as EFI payload. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-63-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: make headers self-containedAhmad Fatoum2024-03-051-0/+4
| | | | | | | | | | With the loader support, efi.h will grow quite a bit. To avoid having to include it always, lets move the base definitions into a new <efi/types.h> and make the different <efi/*.h> headers self contained. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-54-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Rename struct driver_d to driverSascha Hauer2023-01-101-2/+2
| | | | | | | | | | | The '_d' suffix was originally meant to distinguish barebox struct names from Linux struct names. struct driver doesn't exist in Linux, so we can rename it and remove the meaningless suffix. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-4-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Rename struct device_d to deviceSascha Hauer2023-01-101-2/+2
| | | | | | | | | | | | | The '_d' suffix was originally introduced in case we want to import Linux struct device as a separate struct into barebox. Over time it became clear that this won't happen, instead barebox struct device_d is basically the same as Linux struct device. Rename the struct name accordingly to make porting Linux code easier. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-3-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: add efi_device hook to be called before an image is startedSascha Hauer2021-12-131-0/+5
| | | | | | | | | | | | | | | | boot_services::open_protocol supports opening protocols exclusively. A protocol that is opened exclusively can not be used anymore by an application that is called via boot_services::start_image. We want to open the SNP protocol exclusively in the next step. That would mean a chainloaded barebox could no longer use the SNP protocol because it's exclusively opened by the current barebox already. To work around this a efi_drv::dev_pause and efi_drv::dev_continue is introduced. The former is called before an application is started and the latter right after an application has exited. This will be used by the SNP network driver to enter/leave exclusive mode. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: use SPDX-License-Identifier where appropriateAhmad Fatoum2021-11-251-0/+1
| | | | | | | | | Couple of files lack an explicit embedded license or contain boilerplate. Replace with the appropriate SPDX-License-Identifier. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211122084732.2597109-11-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: add and use new efi_device_has_guid helperAhmad Fatoum2019-12-091-0/+12
| | | | | | | | | | We have at least two places where we check if a efidev has a particular guid and a follow-up commit will introduce a third place. So lets factor it out into a helper. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: populate boot source instanceAhmad Fatoum2019-10-281-0/+1
| | | | | | | | | | | We already determine the boot source variable at core init level, but so far we didn't populate the instance because the numbering of the block devices isn't known that early. Introduce a helper to check if a block device is the boot source and if it is, have the block device driver populate the missing boot source instance. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: make sure efi-fs is started in the right orderMichael Olbrich2017-09-081-0/+2
| | | | | | | | | with this parch, EFI System partition will be mounted to /boot instead of /mnt/diskXX. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: move bus driver to driver/efiJean-Christophe PLAGNIOL-VILLARD2017-02-241-0/+45
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>