svn commit: r366219 - head/sys/arm64/arm64

Michal Meloun mmel at FreeBSD.org
Mon Sep 28 09:16:28 UTC 2020


Author: mmel
Date: Mon Sep 28 09:16:27 2020
New Revision: 366219
URL: https://svnweb.freebsd.org/changeset/base/366219

Log:
  Fix booting arm64 EFI with LINUX_BOOT_ABI enabled.
  Use address of the pointer passed to kernel to determine whether the pointer
  is a FDT block (physical address) or a module pointer (virtual kernel address).
  This fragment was supposed to be committed before r366196, but I accidentally
  skipped it in a patch series.
  
  Reported by:	bz

Modified:
  head/sys/arm64/arm64/locore.S

Modified: head/sys/arm64/arm64/locore.S
==============================================================================
--- head/sys/arm64/arm64/locore.S	Mon Sep 28 07:59:50 2020	(r366218)
+++ head/sys/arm64/arm64/locore.S	Mon Sep 28 09:16:27 2020	(r366219)
@@ -46,8 +46,6 @@
 
 /* U-Boot booti related constants. */
 #if defined(LINUX_BOOT_ABI)
-#define FDT_MAGIC		0xEDFE0DD0	/* FDT blob Magic */
-
 #ifndef UBOOT_IMAGE_OFFSET
 #define	UBOOT_IMAGE_OFFSET	0		/* Image offset from start of */
 #endif						/*  2 MiB page */
@@ -408,11 +406,12 @@ create_pagetables:
 	/* No modules or FDT pointer ? */
 	cbz	x0, booti_no_fdt
 
-	/* Test if modulep points to modules descriptor or to FDT */
-	ldr	w8, [x0]
-	ldr	w7, =FDT_MAGIC
-	cmp	w7, w8
-	b.eq	booti_fdt
+	/*
+	 * Test if x0 points to modules descriptor(virtual address) or
+	 * to FDT (physical address)
+	 */
+	cmp	x0, x6		/* x6 is #(KERNBASE) */
+	b.lo	booti_fdt
 #endif
 
 	/* Booted with modules pointer */


More information about the svn-src-head mailing list