Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/fdt Boot APs with status "disabled" if they hav...



details:   https://anonhg.NetBSD.org/src/rev/4b588a0efdaf
branches:  trunk
changeset: 433360:4b588a0efdaf
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Sep 09 21:16:05 2018 +0000

description:
Boot APs with status "disabled" if they have an enable-method property

diffstat:

 sys/arch/arm/fdt/psci_fdt.c |  27 ++++++++++++++++++++++++---
 1 files changed, 24 insertions(+), 3 deletions(-)

diffs (55 lines):

diff -r 46d110975fc5 -r 4b588a0efdaf sys/arch/arm/fdt/psci_fdt.c
--- a/sys/arch/arm/fdt/psci_fdt.c       Sun Sep 09 21:15:21 2018 +0000
+++ b/sys/arch/arm/fdt/psci_fdt.c       Sun Sep 09 21:16:05 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: psci_fdt.c,v 1.16 2018/09/09 13:32:26 jmcneill Exp $ */
+/* $NetBSD: psci_fdt.c,v 1.17 2018/09/09 21:16:05 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
 #include "opt_multiprocessor.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: psci_fdt.c,v 1.16 2018/09/09 13:32:26 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: psci_fdt.c,v 1.17 2018/09/09 21:16:05 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -169,6 +169,27 @@
 }
 #endif
 
+static bool
+psci_fdt_cpu_okay(const int child)
+{
+       const char *s;
+
+       s = fdtbus_get_string(child, "device_type");
+       if (!s || strcmp(s, "cpu") != 0)
+               return false;
+
+       s = fdtbus_get_string(child, "status");
+       if (s) {
+               if (strcmp(s, "okay") == 0)
+                       return false;
+               if (strcmp(s, "disabled") == 0)
+                       return of_hasprop(child, "enable-method");
+               return false;
+       } else {
+               return true;
+       }
+}
+
 void
 psci_fdt_bootstrap(void)
 {
@@ -202,7 +223,7 @@
        /* Boot APs */
        cpuindex = 1;
        for (child = OF_child(cpus); child; child = OF_peer(child)) {
-               if (!fdtbus_status_okay(child))
+               if (!psci_fdt_cpu_okay(child))
                        continue;
                if (fdtbus_get_reg64(child, 0, &mpidr, NULL) != 0)
                        continue;



Home | Main Index | Thread Index | Old Index