Module Name:    src
Committed By:   ryo
Date:           Wed Nov 28 09:16:19 UTC 2018

Modified Files:
        src/sys/arch/aarch64/aarch64: aarch64_machdep.c cpu.c
        src/sys/arch/evbarm/fdt: fdt_machdep.c

Log Message:
support boot option "-1" to disable multiprocessor boot, and "-z" to set 
AB_SILENT flag.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/aarch64/aarch64/aarch64_machdep.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/aarch64/aarch64/cpu.c
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/evbarm/fdt/fdt_machdep.c

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/aarch64/aarch64/aarch64_machdep.c
diff -u src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.22 src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.23
--- src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.22	Tue Nov 20 01:59:51 2018
+++ src/sys/arch/aarch64/aarch64/aarch64_machdep.c	Wed Nov 28 09:16:19 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: aarch64_machdep.c,v 1.22 2018/11/20 01:59:51 mrg Exp $ */
+/* $NetBSD: aarch64_machdep.c,v 1.23 2018/11/28 09:16:19 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.22 2018/11/20 01:59:51 mrg Exp $");
+__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.23 2018/11/28 09:16:19 ryo Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -389,6 +389,8 @@ parse_mi_bootargs(char *args)
 {
 	int val;
 
+	if (get_bootconf_option(args, "-1", BOOTOPT_TYPE_BOOLEAN, &val) && val)
+		boothowto |= RB_MD1;
 	if (get_bootconf_option(args, "-s", BOOTOPT_TYPE_BOOLEAN, &val) && val)
 		boothowto |= RB_SINGLE;
 	if (get_bootconf_option(args, "-d", BOOTOPT_TYPE_BOOLEAN, &val) && val)
@@ -401,6 +403,8 @@ parse_mi_bootargs(char *args)
 		boothowto |= AB_VERBOSE;
 	if (get_bootconf_option(args, "-x", BOOTOPT_TYPE_BOOLEAN, &val) && val)
 		boothowto |= AB_DEBUG;
+	if (get_bootconf_option(args, "-z", BOOTOPT_TYPE_BOOLEAN, &val) && val)
+		boothowto |= AB_SILENT;
 }
 
 void

Index: src/sys/arch/aarch64/aarch64/cpu.c
diff -u src/sys/arch/aarch64/aarch64/cpu.c:1.13 src/sys/arch/aarch64/aarch64/cpu.c:1.14
--- src/sys/arch/aarch64/aarch64/cpu.c:1.13	Tue Nov 20 01:59:51 2018
+++ src/sys/arch/aarch64/aarch64/cpu.c	Wed Nov 28 09:16:19 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.13 2018/11/20 01:59:51 mrg Exp $ */
+/* $NetBSD: cpu.c,v 1.14 2018/11/28 09:16:19 ryo Exp $ */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu <[email protected]>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.13 2018/11/20 01:59:51 mrg Exp $");
+__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.14 2018/11/28 09:16:19 ryo Exp $");
 
 #include "locators.h"
 #include "opt_arm_debug.h"
@@ -40,6 +40,7 @@ __KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.13
 #include <sys/device.h>
 #include <sys/cpu.h>
 #include <sys/kmem.h>
+#include <sys/reboot.h>
 #include <sys/sysctl.h>
 
 #include <aarch64/armreg.h>
@@ -109,6 +110,12 @@ cpu_attach(device_t dv, cpuid_t id)
 		cpu_setup_id(ci);
 	} else {
 #ifdef MULTIPROCESSOR
+		if ((boothowto & RB_MD1) != 0) {
+			aprint_naive("\n");
+			aprint_normal(": multiprocessor boot disabled\n");
+			return;
+		}
+
 		KASSERT(unit < MAXCPUS);
 		ci = &cpu_info_store[unit];
 
@@ -485,6 +492,9 @@ cpu_setup_sysctl(device_t dv, struct cpu
 void
 cpu_boot_secondary_processors(void)
 {
+	if ((boothowto & RB_MD1) != 0)
+		return;
+
 	mutex_init(&cpu_hatch_lock, MUTEX_DEFAULT, IPL_NONE);
 
 	VPRINTF("%s: writing mbox with %#x\n", __func__, arm_cpu_hatched);

Index: src/sys/arch/evbarm/fdt/fdt_machdep.c
diff -u src/sys/arch/evbarm/fdt/fdt_machdep.c:1.55 src/sys/arch/evbarm/fdt/fdt_machdep.c:1.56
--- src/sys/arch/evbarm/fdt/fdt_machdep.c:1.55	Thu Nov 15 23:53:40 2018
+++ src/sys/arch/evbarm/fdt/fdt_machdep.c	Wed Nov 28 09:16:19 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_machdep.c,v 1.55 2018/11/15 23:53:40 jmcneill Exp $ */
+/* $NetBSD: fdt_machdep.c,v 1.56 2018/11/28 09:16:19 ryo Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill <[email protected]>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.55 2018/11/15 23:53:40 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.56 2018/11/28 09:16:19 ryo Exp $");
 
 #include "opt_machdep.h"
 #include "opt_bootconfig.h"
@@ -545,9 +545,11 @@ initarm(void *arg)
 	u_int sp = initarm_common(KERNEL_VM_BASE, KERNEL_VM_SIZE, fdt_physmem,
 	     nfdt_physmem);
 
-	VPRINTF("mpstart\n");
-	if (plat->ap_mpstart)
-		plat->ap_mpstart();
+	if ((boothowto & RB_MD1) == 0) {
+		VPRINTF("mpstart\n");
+		if (plat->ap_mpstart)
+			plat->ap_mpstart();
+	}
 
 	/*
 	 * Now we have APs started the pages used for stacks and L1PT can

Reply via email to