Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Aug 2016 23:30:26 +0000 (UTC)
From:      Olivier Houchard <cognet@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r305096 - head/sys/arm/arm
Message-ID:  <201608302330.u7UNUQHL011918@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cognet
Date: Tue Aug 30 23:30:26 2016
New Revision: 305096
URL: https://svnweb.freebsd.org/changeset/base/305096

Log:
  Some old arm ports don't load the kernel at the beginning of the memory,
  because the bootloader, ie redboot, won't let them do so, and so used the
  memory before the kernel for early memory allocation, such as pagetables,
  stacks, etc...
  Make a bit of an effort to try to get that memory mapped.

Modified:
  head/sys/arm/arm/locore-v4.S

Modified: head/sys/arm/arm/locore-v4.S
==============================================================================
--- head/sys/arm/arm/locore-v4.S	Tue Aug 30 22:48:05 2016	(r305095)
+++ head/sys/arm/arm/locore-v4.S	Tue Aug 30 23:30:26 2016	(r305096)
@@ -195,6 +195,16 @@ Lunmapped:
 	ldr	r2, =(KERNVIRTADDR)
 	mov	r3, #64
 	bl	build_pagetables
+#if defined(PHYSADDR) && (KERNVIRTADDR != KERNBASE)
+/* 
+ * If the kernel wasn't loaded at the beginning of the ram, map the memory
+ * before the kernel too, as some ports use that for pagetables, stack, etc...
+ */
+	ldr	r1, =PHYSADDR
+	ldr 	r2, =KERNBASE
+	ldr	r3, =((KERNVIRTADDR - KERNBASE) / L1_S_SIZE)
+	bl	build_pagetables
+#endif
 
 	/* Create a device mapping for early_printf if specified. */
 #if defined(SOCDEV_PA) && defined(SOCDEV_VA)



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