diff options
author | 2020-06-17 08:00:22 +0000 | |
---|---|---|
committer | 2020-06-17 08:00:22 +0000 | |
commit | d3ae5f180d220c25641b56231fd3a61f53847254 (patch) | |
tree | 263a4a45aaf0bea1b8ec46f65582b6a98f85d432 | |
parent | mark up an argument with Fa, not Va (diff) | |
download | wireguard-openbsd-d3ae5f180d220c25641b56231fd3a61f53847254.tar.xz wireguard-openbsd-d3ae5f180d220c25641b56231fd3a61f53847254.zip |
Attach secondary CPUs early. Since on most machine we need psci(4) to
spin op the secondary CPUs, explicitly probe and attach that driver
before we attach the CPUs.
This should help with distributing interrupts across CPUs on arm64.
ok patrick@, deraadt@, dlg@
-rw-r--r-- | sys/arch/arm64/dev/mainbus.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/sys/arch/arm64/dev/mainbus.c b/sys/arch/arm64/dev/mainbus.c index 85a9ae468a7..0304dd8e6ba 100644 --- a/sys/arch/arm64/dev/mainbus.c +++ b/sys/arch/arm64/dev/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.16 2020/04/22 11:10:07 kettenis Exp $ */ +/* $OpenBSD: mainbus.c,v 1.17 2020/06/17 08:00:22 kettenis Exp $ */ /* * Copyright (c) 2016 Patrick Wildt <patrick@blueri.se> * Copyright (c) 2017 Mark Kettenis <kettenis@openbsd.org> @@ -38,6 +38,7 @@ int mainbus_match_status(struct device *, void *, void *); void mainbus_attach_cpus(struct device *, cfmatch_t); int mainbus_match_primary(struct device *, void *, void *); int mainbus_match_secondary(struct device *, void *, void *); +void mainbus_attach_psci(struct device *); void mainbus_attach_efi(struct device *); void mainbus_attach_apm(struct device *); void mainbus_attach_framebuffer(struct device *); @@ -129,9 +130,14 @@ mainbus_attach(struct device *parent, struct device *self, void *aux) strlcpy(hw_serial, prop, len); } + mainbus_attach_psci(self); + /* Attach primary CPU first. */ mainbus_attach_cpus(self, mainbus_match_primary); + /* Attach secondary CPUs. */ + mainbus_attach_cpus(self, mainbus_match_secondary); + mainbus_attach_efi(self); sc->sc_rangeslen = OF_getproplen(OF_peer(0), "ranges"); @@ -154,9 +160,6 @@ mainbus_attach(struct device *parent, struct device *self, void *aux) mainbus_attach_framebuffer(self); - /* Attach secondary CPUs. */ - mainbus_attach_cpus(self, mainbus_match_secondary); - thermal_init(); } @@ -361,6 +364,20 @@ mainbus_match_secondary(struct device *parent, void *match, void *aux) } void +mainbus_attach_psci(struct device *self) +{ + struct mainbus_softc *sc = (struct mainbus_softc *)self; + int node = OF_finddevice("/psci"); + + if (node == 0) + return; + + sc->sc_early = 1; + mainbus_attach_node(self, node, NULL); + sc->sc_early = 0; +} + +void mainbus_attach_efi(struct device *self) { struct mainbus_softc *sc = (struct mainbus_softc *)self; |