diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2019-04-22 18:52:57 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2019-04-22 18:52:57 +0000 |
commit | 73ecfd64490097908c0c7e6c1f2bd20de6a86ead (patch) | |
tree | 7c923b5ad265bc9f6c6995450e0e4213aa2fd285 /sys/arch | |
parent | 136c7515cd86cf622f832d3a05a4bb135c7ed971 (diff) |
Not all systems supporting DVFS expose a regulator to set the voltage.
On such systems we should skip setting the voltage and just change the
clock frequency. An example of such a system is the HiKey970 where
firmware running on a microcontroller will transparently adjust the voltage.
ok patrick@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/arm64/arm64/cpu.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/arch/arm64/arm64/cpu.c b/sys/arch/arm64/arm64/cpu.c index e4c0676a5ce..7e83e11583a 100644 --- a/sys/arch/arm64/arm64/cpu.c +++ b/sys/arch/arm64/arm64/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.28 2019/03/31 02:37:05 jsg Exp $ */ +/* $OpenBSD: cpu.c,v 1.29 2019/04/22 18:52:56 kettenis Exp $ */ /* * Copyright (c) 2016 Dale Rahn <drahn@dalerahn.com> @@ -710,8 +710,8 @@ cpu_opp_mountroot(struct device *self) } /* Disable if regulator isn't implemented. */ - error = ENODEV; - if (curr_microvolt != 0) + error = ci->ci_cpu_supply ? ENODEV : 0; + if (ci->ci_cpu_supply && curr_microvolt != 0) error = regulator_set_voltage(ci->ci_cpu_supply, curr_microvolt); if (error) { @@ -776,8 +776,8 @@ cpu_opp_dotask(void *arg) if (error == 0 && opp_hz < curr_hz) error = clock_set_frequency(ci->ci_node, NULL, opp_hz); - if (error == 0 && opp_microvolt != 0 && - opp_microvolt != curr_microvolt) { + if (error == 0 && ci->ci_cpu_supply && + opp_microvolt != 0 && opp_microvolt != curr_microvolt) { error = regulator_set_voltage(ci->ci_cpu_supply, opp_microvolt); } |