Module Name:    src
Committed By:   jmcneill
Date:           Tue May 12 10:37:20 UTC 2015

Modified Files:
        src/sys/arch/evbarm/tegra: tegra_machdep.c tegra_start.S

Log Message:
copy bootargs from uboot before we turn on the MMU, for the benefit of kernels 
without __HAVE_MM_MD_DIRECT_MAPPED_PHYS


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/evbarm/tegra/tegra_machdep.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbarm/tegra/tegra_start.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbarm/tegra/tegra_machdep.c
diff -u src/sys/arch/evbarm/tegra/tegra_machdep.c:1.12 src/sys/arch/evbarm/tegra/tegra_machdep.c:1.13
--- src/sys/arch/evbarm/tegra/tegra_machdep.c:1.12	Sat May  9 18:57:30 2015
+++ src/sys/arch/evbarm/tegra/tegra_machdep.c	Tue May 12 10:37:20 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_machdep.c,v 1.12 2015/05/09 18:57:30 jmcneill Exp $ */
+/* $NetBSD: tegra_machdep.c,v 1.13 2015/05/12 10:37:20 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcne...@invisible.ca>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tegra_machdep.c,v 1.12 2015/05/09 18:57:30 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_machdep.c,v 1.13 2015/05/12 10:37:20 jmcneill Exp $");
 
 #include "opt_tegra.h"
 #include "opt_machdep.h"
@@ -93,7 +93,7 @@ __KERNEL_RCSID(0, "$NetBSD: tegra_machde
 #endif
 
 BootConfig bootconfig;
-static char bootargs[TEGRA_MAX_BOOT_STRING];
+char bootargs[TEGRA_MAX_BOOT_STRING] = "";
 char *boot_args = NULL;
 u_int uboot_args[4] = { 0 };	/* filled in by tegra_start.S (not in bss) */
 
@@ -303,14 +303,6 @@ initarm(void *arg)
 	arm32_kernel_vm_init(KERNEL_VM_BASE, ARM_VECTORS_HIGH, 0, devmap,
 	    mapallmem_p);
 
-	if (mapallmem_p) {
-		if (uboot_args[3] < ram_size) {
-			const char * const args = (const char *)
-			    (uboot_args[3] + KERNEL_BASE_VOFFSET);
-			strlcpy(bootargs, args, sizeof(bootargs));
-		}
-	}
-
 	DPRINTF("bootargs: %s\n", bootargs);
 
 	boot_args = bootargs;

Index: src/sys/arch/evbarm/tegra/tegra_start.S
diff -u src/sys/arch/evbarm/tegra/tegra_start.S:1.3 src/sys/arch/evbarm/tegra/tegra_start.S:1.4
--- src/sys/arch/evbarm/tegra/tegra_start.S:1.3	Sun Apr 26 22:04:28 2015
+++ src/sys/arch/evbarm/tegra/tegra_start.S	Tue May 12 10:37:20 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_start.S,v 1.3 2015/04/26 22:04:28 jmcneill Exp $ */
+/* $NetBSD: tegra_start.S,v 1.4 2015/05/12 10:37:20 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014, 2015 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
 #include <arm/nvidia/tegra_reg.h>
 #include <evbarm/tegra/platform.h>  
 
-RCSID("$NetBSD: tegra_start.S,v 1.3 2015/04/26 22:04:28 jmcneill Exp $")
+RCSID("$NetBSD: tegra_start.S,v 1.4 2015/05/12 10:37:20 jmcneill Exp $")
 
 #if defined(VERBOSE_INIT_ARM)
 #define	XPUTC(n)	mov r0, n; bl xputc
@@ -102,6 +102,26 @@ _C_LABEL(tegra_start):
 	stmia	r4, {r0-r3}		// Save the arguments
 
 	/*
+	 * Copy the value of the "bootargs" environment variable from r3.
+	 */
+	movw	r4, #:lower16:bootargs
+	movt	r4, #:upper16:bootargs
+	sub	r4, r4, #KERNEL_BASE_VOFFSET
+
+	cmp	r3, #0
+	beq	1f
+2:
+	ldrb	r0, [r3], #1
+	strb	r0, [r4], #1
+	teq	r0, #0
+	bne	2b
+1:
+
+        /*
+         * Turn on the SMP bit
+         */
+
+	/*
 	 * Turn on the SMP bit
 	 */
 	bl	cortex_init

Reply via email to