diff options
author | 2018-08-04 11:55:40 +0000 | |
---|---|---|
committer | 2018-08-04 11:55:40 +0000 | |
commit | c696cd1a5693b021c8bb133eeedd0f12cd2df4e3 (patch) | |
tree | bbd3e10e7b0b6fcdd626aad1061d109b267a491b | |
parent | Revert back previous commit, we have decided that socket files don't cause any (diff) | |
download | wireguard-openbsd-c696cd1a5693b021c8bb133eeedd0f12cd2df4e3.tar.xz wireguard-openbsd-c696cd1a5693b021c8bb133eeedd0f12cd2df4e3.zip |
The operating-points-v2 binding allows opp-microvolt to be a single cell
or three cells. Handle both cases, but ignore the minimum and maximum
values if they are provided in the case where we have three cells.
ok patrick@
-rw-r--r-- | sys/arch/arm64/arm64/cpu.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/arch/arm64/arm64/cpu.c b/sys/arch/arm64/arm64/cpu.c index 74879ff8a48..c8f75912a72 100644 --- a/sys/arch/arm64/arm64/cpu.c +++ b/sys/arch/arm64/arm64/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.21 2018/08/03 18:36:01 kettenis Exp $ */ +/* $OpenBSD: cpu.c,v 1.22 2018/08/04 11:55:40 kettenis Exp $ */ /* * Copyright (c) 2016 Dale Rahn <drahn@dalerahn.com> @@ -525,7 +525,8 @@ cpu_opp_init(struct cpu_info *ci, uint32_t phandle) { struct opp_table *ot; int count, node, child; - int i; + uint32_t values[3]; + int i, len; LIST_FOREACH(ot, &opp_tables, ot_list) { if (ot->ot_phandle == phandle) { @@ -562,8 +563,10 @@ cpu_opp_init(struct cpu_info *ci, uint32_t phandle) continue; ot->ot_opp[count].opp_hz = OF_getpropint64(child, "opp-hz", 0); - ot->ot_opp[count].opp_microvolt = - OF_getpropint(child, "opp-microvolt", 0); + len = OF_getpropintarray(child, "opp-microvolt", + values, sizeof(values)); + if (len == sizeof(uint32_t) || len == 3 * sizeof(uint32_t)) + ot->ot_opp[count].opp_microvolt = values[0]; count++; } |