experiments/cpu_pstates.py: Only set DVMR if necessary

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2021-09-24 01:16:32 +09:00
parent febf83a981
commit 3a4b2870a8

View file

@ -82,8 +82,11 @@ CLUSTER_PSCTRL = 0x200f8
for cluster in range(2):
print(f"Initializing cluster {cluster}")
ena = (1<<63)
val = p.read64(CREG[cluster] + CLUSTER_DVMR)
if cluster == 1:
ena |= (1<<32) | (1<<31)
if (val & ena) != ena:
print(f"DVMR: {val:#x} -> {val|ena:#x}")
p.set64(CREG[cluster] + CLUSTER_DVMR, ena) # CLUSTER_DVMR
#p.set64(CREG[cluster] + CLUSTER_LIMIT1, 1<<63)