diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2024-10-29 21:19:26 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2024-10-29 21:19:26 +0000 |
commit | f9709db541f9a504d42d479016f0ed968c34efca (patch) | |
tree | c10ce301863bf9c2099dcea6ea8e1555fa489721 /sys/arch | |
parent | 7c3c367038a9258f03a26aacaa252e63951a4f02 (diff) |
We should always set the AP power state, so fold the rtkit_set_ap_pwrstate()
call into rtkit_boot().
ok patrick@, tobhe@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/arm64/dev/aplrtk.c | 9 | ||||
-rw-r--r-- | sys/arch/arm64/dev/aplsmc.c | 8 | ||||
-rw-r--r-- | sys/arch/arm64/dev/rtkit.c | 10 |
3 files changed, 11 insertions, 16 deletions
diff --git a/sys/arch/arm64/dev/aplrtk.c b/sys/arch/arm64/dev/aplrtk.c index 97a95e82f76..b08df27f23d 100644 --- a/sys/arch/arm64/dev/aplrtk.c +++ b/sys/arch/arm64/dev/aplrtk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aplrtk.c,v 1.3 2022/11/09 19:18:11 kettenis Exp $ */ +/* $OpenBSD: aplrtk.c,v 1.4 2024/10/29 21:19:25 kettenis Exp $ */ /* * Copyright (c) 2022 Mark Kettenis <kettenis@openbsd.org> * @@ -98,7 +98,6 @@ int aplrtk_do_start(struct aplrtk_softc *sc) { uint32_t ctrl; - int error; ctrl = HREAD4(sc, CPU_CTRL); HWRITE4(sc, CPU_CTRL, ctrl | CPU_CTRL_RUN); @@ -109,11 +108,7 @@ aplrtk_do_start(struct aplrtk_softc *sc) if (sc->sc_state == NULL) return EIO; - error = rtkit_boot(sc->sc_state); - if (error) - return error; - - return rtkit_set_ap_pwrstate(sc->sc_state, RTKIT_MGMT_PWR_STATE_ON); + return rtkit_boot(sc->sc_state); } int diff --git a/sys/arch/arm64/dev/aplsmc.c b/sys/arch/arm64/dev/aplsmc.c index 4717c54bb8d..c0a2df11c43 100644 --- a/sys/arch/arm64/dev/aplsmc.c +++ b/sys/arch/arm64/dev/aplsmc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aplsmc.c,v 1.26 2024/10/28 14:16:39 kettenis Exp $ */ +/* $OpenBSD: aplsmc.c,v 1.27 2024/10/29 21:19:25 kettenis Exp $ */ /* * Copyright (c) 2021 Mark Kettenis <kettenis@openbsd.org> * @@ -250,12 +250,6 @@ aplsmc_attach(struct device *parent, struct device *self, void *aux) return; } - error = rtkit_set_ap_pwrstate(sc->sc_rs, RTKIT_MGMT_PWR_STATE_ON); - if (error) { - printf(": can't set AP power state\n"); - return; - } - error = rtkit_start_endpoint(sc->sc_rs, SMC_EP, aplsmc_callback, sc); if (error) { printf(": can't start SMC endpoint\n"); diff --git a/sys/arch/arm64/dev/rtkit.c b/sys/arch/arm64/dev/rtkit.c index 03a47ef2021..f1b5d2434fe 100644 --- a/sys/arch/arm64/dev/rtkit.c +++ b/sys/arch/arm64/dev/rtkit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtkit.c,v 1.16 2024/10/28 14:14:04 kettenis Exp $ */ +/* $OpenBSD: rtkit.c,v 1.17 2024/10/29 21:19:25 kettenis Exp $ */ /* * Copyright (c) 2021 Mark Kettenis <kettenis@openbsd.org> * @@ -856,8 +856,14 @@ rtkit_init(int node, const char *name, int flags, struct rtkit *rk) int rtkit_boot(struct rtkit_state *state) { + int error; + /* Wake up! */ - return rtkit_set_iop_pwrstate(state, RTKIT_MGMT_PWR_STATE_INIT); + error = rtkit_set_iop_pwrstate(state, RTKIT_MGMT_PWR_STATE_INIT); + if (error) + return error; + + return rtkit_set_ap_pwrstate(state, RTKIT_MGMT_PWR_STATE_ON); } void |