diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2018-02-23 19:08:57 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2018-02-23 19:08:57 +0000 |
commit | 689418c561ffcbdeb85ab214b9db398236e6dd14 (patch) | |
tree | d4f1dbb4ca4ecd78af691ef40c05f1d227c1a56f /sys/dev | |
parent | 9b42c3abd68f7d555c7c621d085f3f3d57b9a3e7 (diff) |
Get rid of the cpu_on_fn hook and call the psci(4) functions directly instead
like we already do in the code that flushes the BTB.
ok jsg@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/fdt/psci.c | 20 | ||||
-rw-r--r-- | sys/dev/fdt/pscivar.h | 4 |
2 files changed, 14 insertions, 10 deletions
diff --git a/sys/dev/fdt/psci.c b/sys/dev/fdt/psci.c index 0dec743dc81..774b15ff89f 100644 --- a/sys/dev/fdt/psci.c +++ b/sys/dev/fdt/psci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: psci.c,v 1.5 2018/01/28 12:48:20 jsg Exp $ */ +/* $OpenBSD: psci.c,v 1.6 2018/02/23 19:08:56 kettenis Exp $ */ /* * Copyright (c) 2016 Jonathan Gray <jsg@openbsd.org> @@ -30,7 +30,6 @@ extern void (*cpuresetfn)(void); extern void (*powerdownfn)(void); -extern int (*cpu_on_fn)(register_t, register_t); #define PSCI_VERSION 0x84000000 #define SYSTEM_OFF 0x84000008 @@ -57,7 +56,6 @@ int psci_match(struct device *, void *, void *); void psci_attach(struct device *, struct device *, void *); void psci_reset(void); void psci_powerdown(void); -int psci_cpu_on(register_t, register_t); extern register_t hvc_call(register_t, register_t, register_t, register_t); extern register_t smc_call(register_t, register_t, register_t, register_t); @@ -123,8 +121,6 @@ psci_attach(struct device *parent, struct device *self, void *aux) powerdownfn = psci_powerdown; if (sc->sc_system_reset != 0) cpuresetfn = psci_reset; - if (sc->sc_cpu_on != 0) - cpu_on_fn = psci_cpu_on; } uint32_t @@ -155,11 +151,15 @@ psci_powerdown(void) (*sc->sc_callfn)(sc->sc_system_off, 0, 0, 0); } -int -psci_cpu_on(register_t mpidr, register_t pc) +int32_t +psci_cpu_on(register_t target_cpu, register_t entry_point_address, + register_t context_id) { struct psci_softc *sc = psci_sc; - if (sc->sc_callfn) - return (*sc->sc_callfn)(sc->sc_cpu_on, mpidr, pc, 0); - return -1; + + if (sc && sc->sc_callfn && sc->sc_cpu_on != 0) + return (*sc->sc_callfn)(sc->sc_cpu_on, target_cpu, + entry_point_address, context_id); + + return PSCI_NOT_SUPPORTED; } diff --git a/sys/dev/fdt/pscivar.h b/sys/dev/fdt/pscivar.h index 77551db3d2a..59d3702670e 100644 --- a/sys/dev/fdt/pscivar.h +++ b/sys/dev/fdt/pscivar.h @@ -3,6 +3,10 @@ #ifndef _SYS_DEV_FDT_PSCIVAR_H_ #define _SYS_DEV_FDT_PSCIVAR_H_ +#define PSCI_SUCCESS 0 +#define PSCI_NOT_SUPPORTED -1 + uint32_t psci_version(void); +int32_t psci_cpu_on(register_t, register_t, register_t); #endif /* _SYS_DEV_FDT_PSCIVAR_H_ */ |