| 488bf12d | 18-Aug-2016 |
Alexander Graf <agraf@suse.de> |
efi_loader: Expose efi_install_configuration_table
We want to be able to add configuration table entries from our own code as well as from EFI payload code. Export the boot service function internal
efi_loader: Expose efi_install_configuration_table
We want to be able to add configuration table entries from our own code as well as from EFI payload code. Export the boot service function internally too, so that we can reuse it.
Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 4b6dddc2 | 18-Aug-2016 |
Alexander Graf <agraf@suse.de> |
x86: Move smbios generation into arch independent directory
We will need the SMBIOS generation function on ARM as well going forward, so let's move it into a non arch specific location.
Signed-off-
x86: Move smbios generation into arch independent directory
We will need the SMBIOS generation function on ARM as well going forward, so let's move it into a non arch specific location.
Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 1befb38b | 18-Aug-2016 |
Alexander Graf <agraf@suse.de> |
x86: Move table csum into separate file
We need the checksum function without all the other table functionality soon, so let's split it out into its own C file.
Signed-off-by: Alexander Graf <agraf
x86: Move table csum into separate file
We need the checksum function without all the other table functionality soon, so let's split it out into its own C file.
Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
show more ...
|
| 8f661a5b | 06-Jun-2016 |
Alexander Graf <agraf@suse.de> |
efi_loader: gop: Expose fb when 32bpp
When we're running in 32bpp mode, expose the frame buffer address to our payloads so that Linux efifb can pick it up.
Signed-off-by: Alexander Graf <agraf@suse
efi_loader: gop: Expose fb when 32bpp
When we're running in 32bpp mode, expose the frame buffer address to our payloads so that Linux efifb can pick it up.
Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
| 712cd298 | 06-Sep-2016 |
Alexander Graf <agraf@suse.de> |
efi_loader: Allow bouncing for network
So far bounce buffers were only used for disk I/O, but network I/O may suffer from the same problem.
On platforms that have problems doing DMA on high address
efi_loader: Allow bouncing for network
So far bounce buffers were only used for disk I/O, but network I/O may suffer from the same problem.
On platforms that have problems doing DMA on high addresses, let's also bounce outgoing network packets. Incoming ones always already get bounced.
This patch fixes EFI PXE boot on ZynqMP for me.
Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
| 80a4800e | 16-Aug-2016 |
Alexander Graf <agraf@suse.de> |
efi_loader: Allow boards to implement get_time and reset_system
EFI allows an OS to leverage firmware drivers while the OS is running. In the generic code we so far had to stub those implementations
efi_loader: Allow boards to implement get_time and reset_system
EFI allows an OS to leverage firmware drivers while the OS is running. In the generic code we so far had to stub those implementations out, because we would need board specific knowledge about MMIO setups for it.
However, boards can easily implement those themselves. This patch provides the framework so that a board can implement its own versions of get_time and reset_system which would actually do something useful.
While at it we also introduce a simple way for code to reserve MMIO pointers as runtime available.
Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
| 511d0b97 | 01-Oct-2016 |
Stefan Brüns <stefan.bruens@rwth-aachen.de> |
efi_loader: Do not leak memory when unlinking a mapping
As soon as a mapping is unlinked from the list, there are no further references to it, so it should be freed. If it not unlinked, update the s
efi_loader: Do not leak memory when unlinking a mapping
As soon as a mapping is unlinked from the list, there are no further references to it, so it should be freed. If it not unlinked, update the start address and length.
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
| b6a95172 | 01-Oct-2016 |
Stefan Brüns <stefan.bruens@rwth-aachen.de> |
efi_loader: Keep memory mapping sorted when splitting an entry
The code assumes sorted mappings in descending address order. When splitting a mapping, insert the new part next to the current mapping
efi_loader: Keep memory mapping sorted when splitting an entry
The code assumes sorted mappings in descending address order. When splitting a mapping, insert the new part next to the current mapping.
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
| b61d857b | 01-Oct-2016 |
Stefan Brüns <stefan.bruens@rwth-aachen.de> |
efi_loader: Readd freed pages to memory pool
Currently each allocation creates a new mapping. Readding the mapping as free memory (EFI_CONVENTIONAL_MEMORY) potentially allows to hand out an existing
efi_loader: Readd freed pages to memory pool
Currently each allocation creates a new mapping. Readding the mapping as free memory (EFI_CONVENTIONAL_MEMORY) potentially allows to hand out an existing mapping, thus limiting the number of mapping descriptors in the memory map.
Mitigates a problem with current (4.8rc7) linux kernels when doing an efi_get_memory map, resulting in an infinite loop. Space for the memory map is reserved with allocate_pool (implicitly creating a new mapping) and filled. If there is insufficient slack space (8 entries) in the map, the space is freed and a new round is started, with space for one more entry. As each round increases requirement and allocation by exactly one, there is never enough slack space. (At least 32 entries are allocated, so as long as there are less than 24 entries, there is enough slack). Earlier kernels reserved no slack, and did less allocations, so this problem was not visible.
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
| 42417bc8 | 09-Oct-2016 |
Stefan Brüns <stefan.bruens@rwth-aachen.de> |
efi_loader: Track size of pool allocations to allow freeing
We need a functional free_pool implementation, as otherwise each allocate_pool causes growth of the memory descriptor table.
Different to
efi_loader: Track size of pool allocations to allow freeing
We need a functional free_pool implementation, as otherwise each allocate_pool causes growth of the memory descriptor table.
Different to free_pages, free_pool does not provide the size for the to be freed allocation, thus we have to track the size ourselves.
As the only EFI requirement for pool allocation is an alignment of 8 bytes, we can keep allocating a range using the page allocator, reserve the first 8 bytes for our bookkeeping and hand out the remainder to the caller. This saves us from having to use any independent data structures for tracking.
To simplify the conversion between pool allocations and the corresponding page allocation, we create an auxiliary struct efi_pool_allocation.
Given the allocation size free_pool size can handoff freeing the page range, which was indirectly allocated by a call to allocate_pool, to free_pages.
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
| ead1274b | 09-Oct-2016 |
Stefan Brüns <stefan.bruens@rwth-aachen.de> |
efi_loader: Move efi_allocate_pool implementation to efi_memory.c
We currently handle efi_allocate_pool() in our boot time service file. In the following patch, pool allocation will receive addition
efi_loader: Move efi_allocate_pool implementation to efi_memory.c
We currently handle efi_allocate_pool() in our boot time service file. In the following patch, pool allocation will receive additional internal semantics that we should preserve inside efi_memory.c instead.
As foundation for those changes, split the function into an externally facing efi_allocate_pool_ext() for use by payloads and an internal helper efi_allocate_pool() in efi_memory.c that handles the actual allocation.
While at it, change the magic 0xfff / 12 constants to the more obvious EFI_PAGE_MASK/SHIFT defines.
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
| 991d62fa | 13-Sep-2016 |
Robin Randhawa <robin.randhawa@arm.com> |
efi_loader: Fix crash on 32-bit systems
A type mismatch in the efi_allocate_pool boot service flow causes hazardous memory scribbling on 32-bit systems.
This is efi_allocate_pool's prototype:
stat
efi_loader: Fix crash on 32-bit systems
A type mismatch in the efi_allocate_pool boot service flow causes hazardous memory scribbling on 32-bit systems.
This is efi_allocate_pool's prototype:
static efi_status_t EFIAPI efi_allocate_pool(int pool_type, unsigned long size, void **buffer);
Internally, it invokes efi_allocate_pages as follows:
efi_allocate_pages(0, pool_type, (size + 0xfff) >> 12, (void*)buffer);
This is efi_allocate_pages' prototype:
efi_status_t efi_allocate_pages(int type, int memory_type, unsigned long pages, uint64_t *memory);
The problem: efi_allocate_pages does this internally:
*memory = addr;
This fix in efi_allocate_pool uses a transitional uintptr_t cast to ensure the correct outcome, irrespective of the system's native word size.
This was observed when bootefi'ing the EFI instance of FreeBSD's first stage bootstrap (boot1.efi) on a 32-bit ARM platform (Qemu VExpress + Cortex-a9).
Signed-off-by: Robin Randhawa <robin.randhawa@arm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
| bdf5c1b3 | 09-Oct-2016 |
Stefan Brüns <stefan.bruens@rwth-aachen.de> |
efi_loader: Fix memory map size check to avoid out-of-bounds access
The current efi_get_memory_map() function overwrites the map_size property before reading its value. That way the sanity check whe
efi_loader: Fix memory map size check to avoid out-of-bounds access
The current efi_get_memory_map() function overwrites the map_size property before reading its value. That way the sanity check whether our memory map fits into the given array always succeeds, potentially overwriting arbitrary payload memory.
This patch moves the property update write after its sanity check, so that the check actually verifies the correct value.
So far this has not triggered any known bugs, but we're better off safe than sorry.
If the buffer is to small, the returned memory_map_size indicates the required size to the caller.
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
| 9c07b987 | 02-Oct-2016 |
Simon Glass <sjg@chromium.org> |
libfdt: Sync up with upstream
This includes small changes to the following functions, from upstream commit 6d1832c:
- fdt_get_max_phandle() (upstream commit 84e0e134) - fdt_node_check_compatible (u
libfdt: Sync up with upstream
This includes small changes to the following functions, from upstream commit 6d1832c:
- fdt_get_max_phandle() (upstream commit 84e0e134) - fdt_node_check_compatible (upstream commit 53bf130b) - fdt_setprop_inplace_namelen_partial() to remove useless brackets and use idx instead of index - _fdt_resize_property() to use idx instead of index - _fdt_splice() (upstream commit d4c7c25c)
It also includes various typo fixes in libfdt.h
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| d2d9bdfc | 28-Sep-2016 |
B, Ravi <ravibabu@ti.com> |
spl: saveenv: adding saveenv support in SPL
By default saveenv option is not supported for SPL. This patch enable the support for save environment variable for SPL build.
Enable save environment su
spl: saveenv: adding saveenv support in SPL
By default saveenv option is not supported for SPL. This patch enable the support for save environment variable for SPL build.
Enable save environment support in SPL after setenv. By default the saveenv option is not provided in SPL, but some boards need this support in 'Falcon' boot, where SPL need to boot from different images based on environment variable set by OS. For example OS may set "reboot_image" environment variable to "recovery" inorder to boot recovery image by SPL. The SPL read "reboot_image" and act accordingly and change the reboot_image to default mode using setenv and save the environemnt.
Signed-off-by: Ravi Babu <ravibabu@ti.com> Reviewed-by: Simon Glass <sig@chromium.org>
change in v1: - dropped SUPPORT, use CONFIG_SPL_SAVEENV - updates the comments in mmc_private.h
show more ...
|