summaryrefslogtreecommitdiffstats
path: root/arch/efi/efi/efi.c
Commit message (Collapse)AuthorAgeFilesLines
* efi: move startup and payload to common/efiJean-Christophe PLAGNIOL-VILLARD2017-02-241-388/+0
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: move bus driver to driver/efiJean-Christophe PLAGNIOL-VILLARD2017-02-241-2/+2
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* include: Move ns16550 serial platform_data to include/platform_dataSascha Hauer2016-04-151-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: let the generic relocate code handle all relocationsMichael Olbrich2016-04-071-42/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Part of the barebox code and variables are put in separate sections (.barebox* and .initcall*). When this code is compiled as position independent code then the compiler creates corresponding .rela.barebox* and .rela.initcall* sections with the relocation table entries. These sections don't match the .rela.data* wildcard in the linker script. As a result, they are not added to the .rela section during linking but are added individually after it instead. And when the EFI binary is created from the ELF binary, these sections are not copied. This has two side effects: 1. The corresponding relocations are not handled by the generic relocation code. 'fixup_tables()' was added to do these relocations manually. 2. In the DYNAMIC section, the RELASZ entry contains the total size of relocations in bytes. This includes the .rela.barebox* and .rela.initcall* sections. This value is not modified when the EFI binary is created. So the value is too large. The generic relocation code in _relocate() used this value when iterating over all relocation entries. With the wrong RELASZ value it iterates beyond the end of the .rela section into uninitialized memory. After power-on this memory is zero and the relocation code interprets this as 'nothing to do', so there is no visible effect. After a soft reset, random data in that area may produce a seemingly valid relocation entry, a random address is modified and barebox crashes. This patch adds the .rela.barebox* and .rela.initcall* sections to the normal .rela section. The RELASZ now contains the correct size and the generic relocation code works correctly. 'fixup_tables()' must be removed at the same time to avoid relocating these entries twice. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* restart: replace reset_cpu with registered restart handlersSascha Hauer2015-08-271-2/+11
| | | | | | | | | | | | | | | | | | | | | | This replaces the reset_cpu() function which every SoC or board must provide with registered handlers. This makes it possible to have multiple reset functions for boards which have multiple ways to reset the machine. Also boards which have no way at all to reset the machine no longer have to provide a dummy reset_cpu() function. The problem this solves is that some machines have external PMICs or similar to reset the system which have to be preferred over the internal SoC reset, because the PMIC can reset not only the SoC but also the external devices. To pick the right way to reset a machine each handler has a priority. The default priority is 100 and all currently existing restart handlers are registered with this priority. of_get_restart_priority() allows to retrieve the priority from the device tree which makes it possible for boards to give certain restart handlers a higher priority in order to use this one instead of the default one. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: use an EFI variable to save the environmentMichael Olbrich2015-07-271-0/+5
| | | | | Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: use xstrdup_* when appropriateMichael Olbrich2015-07-271-3/+3
| | | | | Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: use xasprintf() when appropriateMichael Olbrich2015-07-271-1/+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/+16
| | | | | | | | | | 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: add helper functions to write EFI variablesMichael Olbrich2015-07-271-0/+27
| | | | | Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: improve malloc pool allocationMichael Olbrich2015-07-231-3/+17
| | | | | | | | | | Use allocate_pages() instead of allocate_pool(). With allocate_pages() we can specify the address. This way, any address passed to the kernel will never exceed the lower 32 bit. If possible, try to allocate a larger pool. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2015-01-091-1/+1
|\
| * sizes.h: move include/sizes.h to include/linux/sizes.hMasahiro Yamada2015-01-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This file originates in Linux. Linux has it under include/linux/ directory since commit dccd2304cc90. Let's move it to the same place as well in barebox. This commit was generated by the following commands: find -name '*.[chS]' | xargs sed -i -e 's:<sizes.h>:<linux/sizes.h>:' git mv include/sizes.h include/linux/ Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | efi: move exit to EFI into own commandLucas Stach2014-12-091-0/+16
| | | | | | | | | | | | | | Adds a command to drop back into the calling EFI process. 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-1/+1
|/ | | | | | | | 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: fix error handling in efi_get_boot()Michael Olbrich2014-09-011-1/+1
| | | | | | | efi_get_global_var() returns an error code, not NULL when it fails. Signed-off-by: Michael Olbrich <m.olbrich@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-2/+3
| | | | | | | | | 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-0/+342
This adds support for running barebox in an EFI environment on X86 PC hardware. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>