summaryrefslogtreecommitdiffstats
path: root/arch/efi
Commit message (Collapse)AuthorAgeFilesLines
* arch: refresh defconfigsSascha Hauer2016-10-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | The defconfig files are long untouched and a make xy_defconfig; make savedefconfig usually generates quite a different looking file. Refresh them to make it easier to generate patches against the configs using make xy_defconfig; make menuconfig; make savedefconfig This has been done with the following script. for a in arch/*; do arch=$(basename $a) for c in $a/configs/*; do config=$(basename $c) export ARCH=$arch make $config && make savedefconfig && mv defconfig $c done done Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Make generic default environment type a use choiceSascha Hauer2016-10-101-1/+0
| | | | | | | | So far it was hardcoded for each board if defenv-1 or defenv-2 is used. Make this a user choice so that a particular board no longer enforces a defenv type. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* include: Move bulk of boot.h to bootm.hSascha Hauer2016-07-261-0/+1
| | | | | | | | The majority of the stuff currently in include/boot.h is about bootm code implemented common/bootm.c. To be more consistent move it to a new file include/bootm.h. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootm: Move bootm options to common/KconfigSascha Hauer2016-05-101-4/+4
| | | | | | | | | | | | bootm has a C API, so the bootm options have to depend on the option providing the bootm code (CONFIG_BOOTM), not on the option providing the command (CONFIG_CMD_BOOTM). Fixing the dependencies makes it possible to fully use bootm from C without enabling the bootm command support. This also removes the CMD_ prefix from the options which means we have to update the defconfigs aswell. 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-072-42/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* efi: fix memory leak in error pathLucas Stach2016-03-041-1/+3
| | | | | Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootm: Push dryrun to handlersSascha Hauer2016-01-261-1/+8
| | | | | | | We can make the dryrun option more useful by calling into the handlers. With this we can detect more cases that can go wrong during boot. 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>
* Merge branch 'for-next/exitcall'Sascha Hauer2015-08-062-0/+8
|\
| * exitcall: Add exitcall infrastructureHerve Codina2015-07-132-0/+8
| | | | | | | | | | | | | | | | exitcall infrastructure is based on initcall infrastructure. It allows to have and use exit call hooks on barebox shutdown. Signed-off-by: Herve Codina <Herve.CODINA@celad.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | efi: enable blspec in the defconfigMichael Olbrich2015-07-271-0/+1
| | | | | | | | | | Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> 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-272-2/+2
| | | | | | | | | | 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-272-0/+21
| | | | | | | | | | | | | | | | | | | | 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-272-0/+31
| | | | | | | | | | 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-13/+180
| | | | | | | | | | 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>
* efi: use generic posix_types.hSascha Hauer2015-06-031-93/+1
| | | | | | | Use generic asm-generic/posix_types.h instead of repeating the typedefs. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* introduce bitsperlong.h for remaining architecturesSascha Hauer2015-06-032-5/+11
| | | | | | | | This introduces the bitsperlong.h file for the remaining architectures. It's purpose is to define BITS_PER_LONG which in the next step can be used by a generic posix_types.h file. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dma: Use generic place for dma_addr_t typedefSascha Hauer2015-05-221-4/+0
| | | | | | | | | Instead of letting all architectures define their own dma_addr_t use a common place in include/linux/types.h and use a Kconfig symbol that architectures can select to define the width of dma_addr_t. The same is done in the Kernel. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* driver: Call remove function only when availableSascha Hauer2015-03-171-1/+2
| | | | | | | | The bus implementations currently call the drivers remove hook unconditionally, but this hook is seldomly populated. Only call it when it's actually populated. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* kbuild: add KBUILD_DEFCONFIGMasahiro Yamada2015-01-141-0/+2
| | | | | | | | | | This allows "make ARCH=... defconfig". Fox example, you can type "make defconfig" instead of "make sandbox_defconfig". Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2015-01-093-3/+3
|\
| * sizes.h: move include/sizes.h to include/linux/sizes.hMasahiro Yamada2015-01-083-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'for-next/kbuild'Sascha Hauer2015-01-091-0/+12
|\ \
| * | kbuild: move asm-offsets.h rule to ./KbuildMasahiro Yamada2015-01-081-0/+12
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, MIPS is the only architecture that needs include/generated/asm-offsets.h, but we have got ./Kbuild file now. It is a good reason to move asm-offsets.h rule from arch/mips/Makefile to ./Kbuild and add dummy asm-offsets.c for the other architectures. asm-offsets.h would be useful for all the architectures. This commit does not implement include/generated/bounds.h, but if necessary, it is easy to implement it. 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>
* treewide: Reuse init_clock() return value for clocksource driversAlexander Shiyan2014-11-101-3/+1
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* EFI: report correct block device sizeMichael Olbrich2014-10-231-1/+1
| | | | | | | | last_block is a zero-based block number, so the total number of blocks is last_block + 1 Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: use objcopy with CROSS_COMPILE prefixMichael Olbrich2014-09-191-1/+1
| | | | | Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* EFI: add missing includeMichael Olbrich2014-09-031-0/+1
| | | | | | | | | | | | | | Otherwise building produces these warnings: [...] arch/efi/efi/efi-image.c:48:2: warning: implicit declaration of function 'read_file' [-Wimplicit-function-declaration] arch/efi/efi/efi-image.c:48:6: warning: assignment makes pointer from integer without a cast [enabled by default] [...] And bootm fails for x86_64. The implicit declaration has an int as return value, so half of the returned address is lost. Signed-off-by: Michael Olbrich <m.olbrich@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>
* Merge branch 'for-next/misc'Sascha Hauer2014-08-072-0/+8
| | | | | Conflicts: lib/Makefile
* EFI: introduce efi_strguid to convert GUID to human readable namesJean-Christophe PLAGNIOL-VILLARD2014-07-162-3/+5
| | | | | | | | | 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-1634-0/+2189
This adds support for running barebox in an EFI environment on X86 PC hardware. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>