From 73ecfd64490097908c0c7e6c1f2bd20de6a86ead Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Mon, 22 Apr 2019 18:52:57 +0000 Subject: 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@ --- sys/arch/arm64/arm64/cpu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sys/arch') 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 @@ -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); } -- cgit v1.2.3