f8503719 | 09-Sep-2018 |
Marek Vasut <marek.vasut@gmail.com> |
fdt: fix get_next_memory_node()
The get_next_memory_node() always sets mem to -1 , which is incorrect, because then every iteration of memory bank parsing will start from the first memory bank inste
fdt: fix get_next_memory_node()
The get_next_memory_node() always sets mem to -1 , which is incorrect, because then every iteration of memory bank parsing will start from the first memory bank instead of the previous one.
On systems with 1 memory bank defined in DT and CONFIG_NR_DRAM_BANKS=4 , like ie. r8a77965-salvator-x , this will result in U-Boot incorrectly reporting four identical memory banks with the same memory configuration.
Fix this by setting mem to startoffset value, which restores the behavior before the fixed patch was applied.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Jens Wiklander <jens.wiklander@linaro.org> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com> Fixes: 452bc121027d ("fdt: fix fdtdec_setup_memory_banksize()") Tested-by: Michal Simek <michal.simek@xilinx.com> [on ZynqMP}
show more ...
|
e3332e1a | 24-Aug-2018 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
Make kmalloc'ed memory really DMA-safe
In Linux, the memory returned by kmalloc() is DMA-capable. However, it is not true in U-Boot.
At a glance, kmalloc() in U-Boot returns address aligned with AR
Make kmalloc'ed memory really DMA-safe
In Linux, the memory returned by kmalloc() is DMA-capable. However, it is not true in U-Boot.
At a glance, kmalloc() in U-Boot returns address aligned with ARCH_DMA_MINALIGN. However, it never pads the allocated memory. This half-way house is completely useless because calling kmalloc() and malloc() in this order causes a cache sharing problem.
Change the implementation to call malloc_cache_aligned(), which allocates really DMA-capable memory.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
show more ...
|
9b89183b | 14-Jul-2018 |
Eugeniu Rosca <roscaeugeniu@gmail.com> |
efi: Fix truncation of constant value
Starting with commit 867a6ac86dd8 ("efi: Add start-up library code"), sparse constantly complains about truncated constant value in efi.h:
include/efi.h:176:35
efi: Fix truncation of constant value
Starting with commit 867a6ac86dd8 ("efi: Add start-up library code"), sparse constantly complains about truncated constant value in efi.h:
include/efi.h:176:35: warning: cast truncates bits from constant value (8000000000000000 becomes 0)
This can get quite noisy, preventing real issues to be noticed:
$ make defconfig *** Default configuration is based on 'sandbox_defconfig' $ make C=2 -j12 2>&1 | grep truncates | wc -l 441
After the patch is applied: $ make C=2 -j12 2>&1 | grep truncates | wc -l 0 $ sparse --version v0.5.2
Following the suggestion of Heinrich Schuchardt, instead of only fixing the root-cause, I replaced the whole enum of _SHIFT values by ULL defines. This matches both the UEFI 2.7 spec and the Linux kernel implementation.
Some ELF size comparison before and after the patch (gcc 7.3.0):
efi-x86_payload64_defconfig: text data bss dec hex filename 407174 29432 278676 715282 aea12 u-boot.old 407152 29464 278676 715292 aea1c u-boot.new -22 +32 0 +10
efi-x86_payload32_defconfig: text data bss dec hex filename 447075 30308 280076 757459 b8ed3 u-boot.old 447053 30340 280076 757469 b8edd u-boot.new -22 +32 0 +10
Fixes: 867a6ac86dd8 ("efi: Add start-up library code") Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
9d12daff | 05-Jul-2018 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.Reset()
Implement the reset service of the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.
This should resolve the error reported by the SCT in Protocol/SimpleTextOut/B
efi_loader: EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.Reset()
Implement the reset service of the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.
This should resolve the error reported by the SCT in Protocol/SimpleTextOut/BlackBoxTest/SimpleTextOutBBTestFunction_uefi.c:639
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
54bfba27 | 22-Jul-2018 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_selftest: correct block device unit test
The UEFI specification mandates that the create flag is only used in conjunction with both the read and the write flag.
Signed-off-by: Heinrich Schuchar
efi_selftest: correct block device unit test
The UEFI specification mandates that the create flag is only used in conjunction with both the read and the write flag.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
a39f39cd | 29-Jul-2018 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: update runtime services table crc32
The crc32 of the runtime services table must be updated after detaching.
efi_update_table_header_crc32() must be __efi_runtime. So move it to efi_run
efi_loader: update runtime services table crc32
The crc32 of the runtime services table must be updated after detaching.
efi_update_table_header_crc32() must be __efi_runtime. So move it to efi_runtime.c
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
483dbab9 | 29-Jul-2018 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
lib: crc32: mark function crc32() as __efi_runtime
The function crc32() is needed by the EFI subsystem at runtime. So it has to be linked into the runtime section together with all dependencies.
El
lib: crc32: mark function crc32() as __efi_runtime
The function crc32() is needed by the EFI subsystem at runtime. So it has to be linked into the runtime section together with all dependencies.
Eliminate empty defines local and ZEXPORT.
Mark variables as static which are not exported.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
fa995d0d | 06-Aug-2018 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: avoid NULL dereference in efi_get_memory_map()
We should only dereference parameter memory_map_size after checking that it is valid.
Fixes: 8e835554b36b ("efi_loader: check parameters o
efi_loader: avoid NULL dereference in efi_get_memory_map()
We should only dereference parameter memory_map_size after checking that it is valid.
Fixes: 8e835554b36b ("efi_loader: check parameters of GetMemoryMap") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
3748ed90 | 10-Aug-2018 |
AKASHI Takahiro <takahiro.akashi@linaro.org> |
efi_loader: fix a parameter check at CreateEvent()
The commit 21b3edfc9644 ("efi_loader: check parameters of CreateEvent") enforces a strict parameter check at CreateEvent(). On the other hand, UEFI
efi_loader: fix a parameter check at CreateEvent()
The commit 21b3edfc9644 ("efi_loader: check parameters of CreateEvent") enforces a strict parameter check at CreateEvent(). On the other hand, UEFI specification version 2.7, section 7.1, says:
The EVT_NOTIFY_WAIT and EVT_NOTIFY_SIGNAL flags are exclusive. If neither flag is specified, the caller does not require any notification concerning the event and the NotifyTpl, NotifyFunction, and NotifyContext parameters are ignored.
So the check should be mitigated so as to comply with the specification. Without this patch, EDK2's Shell.efi won't be started.
Fixes: 21b3edfc9644 ("efi_loader: check parameters of CreateEvent") Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
07240da2 | 04-Aug-2018 |
Heinrich Schuchardt <xypron.glpk@gmx.de> |
efi_loader: relocate pointer to tables
When applying a virtual memory map we have to update the pointer to the list of configuration tables.
Fixes: 4182a129ef73 ("efi_loader: allocate configuration
efi_loader: relocate pointer to tables
When applying a virtual memory map we have to update the pointer to the list of configuration tables.
Fixes: 4182a129ef73 ("efi_loader: allocate configuration table array") Reported-by: Mark Kettenis <mark.kettenis@xs4all.nl> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Tested-by: Mark Kettenis <kettenis@openbsd.org> Signed-off-by: Alexander Graf <agraf@suse.de>
show more ...
|
60a4df32 | 30-Jul-2018 |
Christian Gmeiner <christian.gmeiner@gmail.com> |
smbios: fix checkstyle warning
Fixes the following checkstyle warning:
WARNING: Missing a blank line after declarations + int tmp = smbios_write_funcs[i]((ulong *)&addr, handle++); +
smbios: fix checkstyle warning
Fixes the following checkstyle warning:
WARNING: Missing a blank line after declarations + int tmp = smbios_write_funcs[i]((ulong *)&addr, handle++); + max_struct_size = max(max_struct_size, tmp);
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
show more ...
|
ab948cd2 | 19-Jul-2018 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
fdt_support: make FDT_FIXUP_PARTITIONS depend on CMD_MTDPARTS
fdt_fixup_mtdparts() calls mtdparts_init() and device_find(), which are defined in cmd/mtdparts.c
The combination of FDT_FIXUP_PARTITIO
fdt_support: make FDT_FIXUP_PARTITIONS depend on CMD_MTDPARTS
fdt_fixup_mtdparts() calls mtdparts_init() and device_find(), which are defined in cmd/mtdparts.c
The combination of FDT_FIXUP_PARTITIONS=y and CMD_MTDPARTS=n emits the following link error:
common/fdt_support.c:903: undefined reference to `mtdparts_init' common/fdt_support.c:914: undefined reference to `device_find'
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org>
show more ...
|