Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Sep 2020 09:16:27 +0000 (UTC)
From:      Michal Meloun <mmel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r366219 - head/sys/arm64/arm64
Message-ID:  <202009280916.08S9GRWg058568@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009280916.08S9GRWg058568>