[U-Boot] [BUG] Odroid-C2 does not boot with U-Boot master anymore

Alexander Graf agraf at suse.de
Sun Dec 9 00:16:29 UTC 2018



On 08.12.18 14:16, Heinrich Schuchardt wrote:
> Hello Alex,
> 
> the patch 7a82c3051c8f ("efi_loader: Align runtime section to 64kb")
> currently breaks booting Linux on the Odroid-C2.
> 
> Output stops for kernel 4.18 after earlycon is replaced:
> [    0.012518] console [tty0] enabled
> [    0.015923] bootconsole [meson0] disabled
> Without your patch it continues.
> 
> The calculation introduced by the patch does what is expected:
> ram_start = 0x0000000000000000
> ram_end = 0x0000000080000000
> __efi_runtime_start = 0x000000007ff67118
> ~runtime_mask = 0xffffffffffff0000
> runtime_start = 0x000000007ff60000
> runtime_end = 0x000000007ff70000
> 
> These two memory reservation do not conflict with addresses in question:
> arch/arm/mach-meson/board-common.c(60) meson_board_add_reserved_memory:
> 0x0000000000000000-0x0000000001000000
> arch/arm/mach-meson/board-common.c(60) meson_board_add_reserved_memory:
> 0x0000000010000000-0x0000000010200000

I'll write up a nice patch description after some sleep, but here's at
least something that makes it work again for me:

diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c
index 95844efdb0..4f2aa9deda 100644
--- a/lib/efi_loader/efi_runtime.c
+++ b/lib/efi_loader/efi_runtime.c
@@ -436,8 +436,13 @@ static efi_status_t EFIAPI efi_set_virtual_address_map(
 			uint32_t descriptor_version,
 			struct efi_mem_desc *virtmap)
 {
+#if defined(__aarch64__)
+	unsigned long runtime_mask = SZ_64K - 1;
+#else
+	unsigned long runtime_mask = EFI_PAGE_MASK;
+#endif
 	ulong runtime_start = (ulong)&__efi_runtime_start &
-			      ~(ulong)EFI_PAGE_MASK;
+			      ~runtime_mask;
 	int n = memory_map_size / descriptor_size;
 	int i;


Alex


More information about the U-Boot mailing list