Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/evbarm/tegra copy bootargs from uboot before we tur...
details: https://anonhg.NetBSD.org/src/rev/00b6c69f66ed
branches: trunk
changeset: 338145:00b6c69f66ed
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Tue May 12 10:37:20 2015 +0000
description:
copy bootargs from uboot before we turn on the MMU, for the benefit of kernels without __HAVE_MM_MD_DIRECT_MAPPED_PHYS
diffstat:
sys/arch/evbarm/tegra/tegra_machdep.c | 14 +++-----------
sys/arch/evbarm/tegra/tegra_start.S | 24 ++++++++++++++++++++++--
2 files changed, 25 insertions(+), 13 deletions(-)
diffs (87 lines):
diff -r 01af089c96e4 -r 00b6c69f66ed sys/arch/evbarm/tegra/tegra_machdep.c
--- a/sys/arch/evbarm/tegra/tegra_machdep.c Tue May 12 10:20:14 2015 +0000
+++ b/sys/arch/evbarm/tegra/tegra_machdep.c Tue May 12 10:37:20 2015 +0000
@@ -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 <jmcneill%invisible.ca@localhost>
@@ -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 @@
#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 @@
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;
diff -r 01af089c96e4 -r 00b6c69f66ed sys/arch/evbarm/tegra/tegra_start.S
--- a/sys/arch/evbarm/tegra/tegra_start.S Tue May 12 10:20:14 2015 +0000
+++ b/sys/arch/evbarm/tegra/tegra_start.S Tue May 12 10:37:20 2015 +0000
@@ -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 @@
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
Home |
Main Index |
Thread Index |
Old Index