-/* $OpenBSD: cpu.c,v 1.15 2018/02/23 19:08:56 kettenis Exp $ */
+/* $OpenBSD: cpu.c,v 1.16 2018/02/24 09:45:10 kettenis Exp $ */
/*
* Copyright (c) 2016 Dale Rahn <drahn@dalerahn.com>
}
#ifdef MULTIPROCESSOR
else {
- ncpusfound++;
ci = malloc(sizeof(*ci), M_DEVBUF, M_WAITOK | M_ZERO);
cpu_info[dev->dv_unit] = ci;
ci->ci_next = cpu_info_list->ci_next;
cpu_info_list->ci_next = ci;
ci->ci_flags |= CPUF_AP;
}
-#else
- else {
- ncpusfound++;
- printf(" mpidr %llx not configured\n",
- faa->fa_reg[0].addr);
- return;
- }
#endif
ci->ci_dev = dev;
-/* $OpenBSD: mainbus.c,v 1.8 2018/01/04 14:30:08 kettenis Exp $ */
+/* $OpenBSD: mainbus.c,v 1.9 2018/02/24 09:45:10 kettenis Exp $ */
/*
* Copyright (c) 2016 Patrick Wildt <patrick@blueri.se>
* Copyright (c) 2017 Mark Kettenis <kettenis@openbsd.org>
struct mainbus_softc *sc = (struct mainbus_softc *)self;
int node = OF_finddevice("/cpus");
int acells, scells;
+ char buf[32];
if (node == 0)
return;
sc->sc_acells = OF_getpropint(node, "#address-cells", 2);
sc->sc_scells = OF_getpropint(node, "#size-cells", 0);
- for (node = OF_child(node); node != 0; node = OF_peer(node))
+ ncpusfound = 0;
+ for (node = OF_child(node); node != 0; node = OF_peer(node)) {
+ if (OF_getprop(node, "device_type", buf, sizeof(buf)) > 0 &&
+ strcmp(buf, "cpu") == 0)
+ ncpusfound++;
+
mainbus_attach_node(self, node, match);
+ }
sc->sc_acells = acells;
sc->sc_scells = scells;