Module Name:    src
Committed By:   jmcneill
Date:           Wed Jun 10 19:29:48 UTC 2020

Modified Files:
        src/sys/arch/arm/fdt: cpu_fdt.c

Log Message:
If enable-method is missing, try psci


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/arm/fdt/cpu_fdt.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/arm/fdt/cpu_fdt.c
diff -u src/sys/arch/arm/fdt/cpu_fdt.c:1.35 src/sys/arch/arm/fdt/cpu_fdt.c:1.36
--- src/sys/arch/arm/fdt/cpu_fdt.c:1.35	Fri Feb 21 13:15:54 2020
+++ src/sys/arch/arm/fdt/cpu_fdt.c	Wed Jun 10 19:29:48 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_fdt.c,v 1.35 2020/02/21 13:15:54 skrll Exp $ */
+/* $NetBSD: cpu_fdt.c,v 1.36 2020/06/10 19:29:48 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <jmcne...@invisible.ca>
@@ -30,7 +30,7 @@
 #include "psci_fdt.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu_fdt.c,v 1.35 2020/02/21 13:15:54 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_fdt.c,v 1.36 2020/06/10 19:29:48 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -191,16 +191,11 @@ arm_fdt_cpu_bootstrap(void)
 
 #ifdef MULTIPROCESSOR
 static struct arm_cpu_method *
-arm_fdt_cpu_enable_method(int phandle)
+arm_fdt_cpu_enable_method_byname(const char *method)
 {
-	const char *method;
-
- 	method = fdtbus_get_string(phandle, "enable-method");
-	if (method == NULL)
-		return NULL;
-
 	__link_set_decl(arm_cpu_methods, struct arm_cpu_method);
 	struct arm_cpu_method * const *acmp;
+
 	__link_set_foreach(acmp, arm_cpu_methods) {
 		if (strcmp(method, (*acmp)->acm_compat) == 0)
 			return *acmp;
@@ -209,6 +204,18 @@ arm_fdt_cpu_enable_method(int phandle)
 	return NULL;
 }
 
+static struct arm_cpu_method *
+arm_fdt_cpu_enable_method(int phandle)
+{
+	const char *method;
+
+ 	method = fdtbus_get_string(phandle, "enable-method");
+	if (method == NULL)
+		return NULL;
+
+	return arm_fdt_cpu_enable_method_byname(method);
+}
+
 static int
 arm_fdt_cpu_enable(int phandle, struct arm_cpu_method *acm)
 {
@@ -251,6 +258,8 @@ arm_fdt_cpu_mpstart(void)
 		if (acm == NULL)
 			acm = arm_fdt_cpu_enable_method(cpus);
 		if (acm == NULL)
+			acm = arm_fdt_cpu_enable_method_byname("psci");
+		if (acm == NULL)
 			continue;
 
 		error = arm_fdt_cpu_enable(child, acm);

Reply via email to