From 5721df32a37acb04c380a4f1d564f40f0b236e60 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sat, 28 Mar 2020 10:41:20 +0100 Subject: [PATCH 1/5] test/py: UEFI helloworld requires OF_CONTROL With CONFIG_OF_CONTROL environment variable $fdtcontroladdr is not defined and test_efi_helloworld_net() fails. Signed-off-by: Heinrich Schuchardt --- test/py/tests/test_efi_loader.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/py/tests/test_efi_loader.py b/test/py/tests/test_efi_loader.py index adf9d77452..e105645484 100644 --- a/test/py/tests/test_efi_loader.py +++ b/test/py/tests/test_efi_loader.py @@ -141,12 +141,13 @@ def fetch_tftp_file(u_boot_console, env_conf): return addr +@pytest.mark.buildconfigspec('of_control') @pytest.mark.buildconfigspec('cmd_bootefi_hello_compile') def test_efi_helloworld_net(u_boot_console): """Run the helloworld.efi binary via TFTP. - The helloworld.efi file is downloaded from the TFTP server and gets - executed. + The helloworld.efi file is downloaded from the TFTP server and is executed + using the fallback device tree at $fdtcontroladdr. """ addr = fetch_tftp_file(u_boot_console, 'env__efi_loader_helloworld_file') From 6c0ef35cdc3164fda9c7ddd15db58793b1bd3263 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Fri, 27 Mar 2020 04:33:17 +0000 Subject: [PATCH 2/5] cmd: efidebug: fix int to pointer cast On 32 bit systems fix warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] Fixes: a415d61eac26 ("cmd: map addresses to sysmem in efidebug memmap") Signed-off-by: Heinrich Schuchardt --- cmd/efidebug.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/efidebug.c b/cmd/efidebug.c index bb7c13d6a1..c1bb76477a 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -489,10 +489,12 @@ static int do_efi_show_memmap(cmd_tbl_t *cmdtp, int flag, printf("%-16s %.*llx-%.*llx", type, EFI_PHYS_ADDR_WIDTH, - (u64)map_to_sysmem((void *)map->physical_start), + (u64)map_to_sysmem((void *)(uintptr_t) + map->physical_start), EFI_PHYS_ADDR_WIDTH, - (u64)map_to_sysmem((void *)map->physical_start + - map->num_pages * EFI_PAGE_SIZE)); + (u64)map_to_sysmem((void *)(uintptr_t) + (map->physical_start + + map->num_pages * EFI_PAGE_SIZE))); print_memory_attributes(map->attribute); putc('\n'); From 4ef2b0d5512857c1af1110a0b23744c00a585cb2 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 24 Mar 2020 07:37:52 +0100 Subject: [PATCH 3/5] efi_loader: only reserve memory if fdt node enabled Sub-nodes of /reserved-memory may be disabled. In this case we should not reserve memory in the memory map. Reported-by: Patrick DELAUNAY Fixes: fef907b2e440 ("efi_loader: create reservations after ft_board_setup") Signed-off-by: Heinrich Schuchardt Reviewed-by: Atish Patra --- cmd/bootefi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/bootefi.c b/cmd/bootefi.c index 3bbe2d6a1a..aaed575505 100644 --- a/cmd/bootefi.c +++ b/cmd/bootefi.c @@ -199,7 +199,8 @@ static void efi_carve_out_dt_rsv(void *fdt) * The /reserved-memory node may have children with * a size instead of a reg property. */ - if (addr != FDT_ADDR_T_NONE) + if (addr != FDT_ADDR_T_NONE && + fdtdec_get_is_enabled(fdt, subnode)) efi_reserve_memory(addr, size); subnode = fdt_next_subnode(fdt, subnode); } From d4babee087f24a60d910659cb4367a077bad87a0 Mon Sep 17 00:00:00 2001 From: Kristian Amlie Date: Tue, 25 Feb 2020 18:22:16 +0100 Subject: [PATCH 4/5] vexpress_ca9x4: Enable use of correct DTB file and restore EFI loader. EFI was disabled in f95b8a4b5f64f because of the missing DTB file, and indeed, the DTB file is required to load recent versions of GRUB (2.04) correctly. Signed-off-by: Kristian Amlie --- configs/vexpress_ca9x4_defconfig | 2 +- include/configs/vexpress_common.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/configs/vexpress_ca9x4_defconfig b/configs/vexpress_ca9x4_defconfig index 2119df6b10..6bd1f253b6 100644 --- a/configs/vexpress_ca9x4_defconfig +++ b/configs/vexpress_ca9x4_defconfig @@ -34,4 +34,4 @@ CONFIG_SMC911X_32_BIT=y CONFIG_BAUDRATE=38400 CONFIG_CONS_INDEX=0 CONFIG_OF_LIBFDT=y -# CONFIG_EFI_LOADER is not set +CONFIG_DEFAULT_FDT_FILE="vexpress-v2p-ca9.dtb" diff --git a/include/configs/vexpress_common.h b/include/configs/vexpress_common.h index 7f215a6707..e73658a9e6 100644 --- a/include/configs/vexpress_common.h +++ b/include/configs/vexpress_common.h @@ -207,7 +207,8 @@ "devtmpfs.mount=0 vmalloc=256M\0" \ "bootflash=run flashargs; " \ "cp ${ramdisk_addr} ${ramdisk_addr_r} ${maxramdisk}; " \ - "bootm ${kernel_addr} ${ramdisk_addr_r}\0" + "bootm ${kernel_addr} ${ramdisk_addr_r}\0" \ + "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" /* FLASH and environment organization */ #define PHYS_FLASH_SIZE 0x04000000 /* 64MB */ From 67357553ad59eb9b4f412412252e02868ceb16dc Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Mon, 30 Mar 2020 20:27:42 +0200 Subject: [PATCH 5/5] test/py: test_efi_grub_net() requires OF_CONTROL With CONFIG_OF_CONTROL environment variable $fdtcontroladdr is not defined and test_efi_grub_net() fails. Signed-off-by: Heinrich Schuchardt --- test/py/tests/test_efi_loader.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/py/tests/test_efi_loader.py b/test/py/tests/test_efi_loader.py index e105645484..9465c28fbc 100644 --- a/test/py/tests/test_efi_loader.py +++ b/test/py/tests/test_efi_loader.py @@ -170,6 +170,7 @@ def test_efi_helloworld_builtin(u_boot_console): expected_text = 'Hello, world' assert expected_text in output +@pytest.mark.buildconfigspec('of_control') @pytest.mark.buildconfigspec('cmd_bootefi') def test_efi_grub_net(u_boot_console): """Run the grub.efi binary via TFTP.