aboutsummaryrefslogtreecommitdiff
path: root/sys/arm64/arm64/mp_machdep.c
diff options
context:
space:
mode:
authorAndrew Turner <andrew@FreeBSD.org>2016-08-01 12:17:44 +0000
committerAndrew Turner <andrew@FreeBSD.org>2016-08-01 12:17:44 +0000
commit698c14e189107f370e0b4523a914d3916d46e603 (patch)
tree3981139a19cebf74f4e6bbafee50475d6d9de38e /sys/arm64/arm64/mp_machdep.c
parent5a31465d50caddf43ed410e4b846c2c559fc259d (diff)
downloadsrc-698c14e189107f370e0b4523a914d3916d46e603.tar.gz
src-698c14e189107f370e0b4523a914d3916d46e603.zip
Add a kernel variable to let the user to select their preferred order
between ACPI and FDT. This will be needed on machines with both, e.g. the SoftIron Overdrive 3000. The kernel will accept one or more comma separated values of either 'acpi' or 'fdt'. Any other values are skipped. To set it the user can either set it on the loader command line, or in loader.conf e.g. in loader.conf: kern.cfg.order=acpi,fdt This will try using ACPI then FDT. If none of the selected options work the kernel tries to use one to get the serial console, then panics. Reviewed by: emaste (earlier version) Obtained from: ABT Systems Ltd MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D7274
Notes
Notes: svn path=/head/; revision=303614
Diffstat (limited to 'sys/arm64/arm64/mp_machdep.c')
-rw-r--r--sys/arm64/arm64/mp_machdep.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/sys/arm64/arm64/mp_machdep.c b/sys/arm64/arm64/mp_machdep.c
index b8e0394d2611..b0e182796461 100644
--- a/sys/arm64/arm64/mp_machdep.c
+++ b/sys/arm64/arm64/mp_machdep.c
@@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$");
#include <vm/vm_kern.h>
#include <machine/debug_monitor.h>
+#include <machine/machdep.h>
#include <machine/intr.h>
#include <machine/smp.h>
#ifdef VFP
@@ -90,13 +91,6 @@ boolean_t ofw_cpu_reg(phandle_t node, u_int, cell_t *);
extern struct pcpu __pcpu[];
-static enum {
- CPUS_UNKNOWN,
-#ifdef FDT
- CPUS_FDT,
-#endif
-} cpu_enum_method;
-
static device_identify_t arm64_cpu_identify;
static device_probe_t arm64_cpu_probe;
static device_attach_t arm64_cpu_attach;
@@ -499,14 +493,14 @@ cpu_mp_start(void)
CPU_SET(0, &all_cpus);
- switch(cpu_enum_method) {
+ switch(arm64_bus_method) {
#ifdef FDT
- case CPUS_FDT:
+ case ARM64_BUS_FDT:
KASSERT(cpu0 >= 0, ("Current CPU was not found"));
ofw_cpu_early_foreach(cpu_init_fdt, true);
break;
#endif
- case CPUS_UNKNOWN:
+ default:
break;
}
}
@@ -544,15 +538,17 @@ cpu_mp_setmaxid(void)
#ifdef FDT
int cores;
- cores = ofw_cpu_early_foreach(cpu_find_cpu0_fdt, false);
- if (cores > 0) {
- cores = MIN(cores, MAXCPU);
- if (bootverbose)
- printf("Found %d CPUs in the device tree\n", cores);
- mp_ncpus = cores;
- mp_maxid = cores - 1;
- cpu_enum_method = CPUS_FDT;
- return;
+ if (arm64_bus_method == ARM64_BUS_FDT) {
+ cores = ofw_cpu_early_foreach(cpu_find_cpu0_fdt, false);
+ if (cores > 0) {
+ cores = MIN(cores, MAXCPU);
+ if (bootverbose)
+ printf("Found %d CPUs in the device tree\n",
+ cores);
+ mp_ncpus = cores;
+ mp_maxid = cores - 1;
+ return;
+ }
}
#endif