summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaptor Engineering Development Team <support@raptorengineering.com>2018-06-07 16:37:41 -0500
committerRaptor Engineering Development Team <support@raptorengineering.com>2018-06-07 16:39:12 -0500
commitc61174ae381a5a8dc17eeb37b7023cc32026d1b5 (patch)
treef3927da48506185b3b4e3937f6fb9bce391a0071
parenta84458d20af3dc8314d8409918fc299057b90529 (diff)
downloadvpdtools-c61174ae381a5a8dc17eeb37b7023cc32026d1b5.tar.gz
vpdtools-c61174ae381a5a8dc17eeb37b7023cc32026d1b5.zip
Make sure CPU voltage never exceeds 1.1V
-rwxr-xr-xwoferclock/update_poundv_buckets26
1 files changed, 21 insertions, 5 deletions
diff --git a/woferclock/update_poundv_buckets b/woferclock/update_poundv_buckets
index b14cb8a..767ec8a 100755
--- a/woferclock/update_poundv_buckets
+++ b/woferclock/update_poundv_buckets
@@ -53,6 +53,7 @@ new_powerbus_mhz = int(sys.argv[3])
new_ultraturbo_mhz = int(sys.argv[4])
voltage_multiplier = float(sys.argv[5])
raw_data = sys.argv[6]
+max_voltage = 1098
if (source_bucket < 0) or (source_bucket > 5):
print "[ERROR] Invalid source bucket specified"
@@ -121,11 +122,26 @@ turbo[0] = format(int(int(turbo[0], 16) * ultraturbo_ratio), '04x')
nominal[0] = format(int(int(nominal[0], 16) * ultraturbo_ratio), '04x')
powersave[0] = format(int(int(powersave[0], 16) * ultraturbo_ratio), '04x')
powerbus[0] = format(new_powerbus_mhz, '04x')
-ultraturbo[1] = format(int(voltage_multiplier * int(ultraturbo[1], 16)), '04x')
-turbo[1] = format(int(voltage_multiplier * int(turbo[1], 16)), '04x')
-nominal[1] = format(int(voltage_multiplier * int(nominal[1], 16)), '04x')
-powersave[1] = format(int(voltage_multiplier * int(powersave[1], 16)), '04x')
-powerbus[1] = format(int(voltage_multiplier * int(powerbus[1], 16)), '04x')
+new_voltage = voltage_multiplier * int(ultraturbo[1], 16)
+if (new_voltage > max_voltage):
+ new_voltage = max_voltage
+ultraturbo[1] = format(int(new_voltage), '04x')
+new_voltage = voltage_multiplier * int(turbo[1], 16)
+if (new_voltage > max_voltage):
+ new_voltage = max_voltage
+turbo[1] = format(int(new_voltage), '04x')
+new_voltage = voltage_multiplier * int(nominal[1], 16)
+if (new_voltage > max_voltage):
+ new_voltage = max_voltage
+nominal[1] = format(int(new_voltage), '04x')
+new_voltage = voltage_multiplier * int(powersave[1], 16)
+if (new_voltage > max_voltage):
+ new_voltage = max_voltage
+powersave[1] = format(int(new_voltage), '04x')
+new_voltage = voltage_multiplier * int(powerbus[1], 16)
+if (new_voltage > max_voltage):
+ new_voltage = max_voltage
+powerbus[1] = format(int(new_voltage), '04x')
ultraturbo[2] = format(int(voltage_multiplier * int(ultraturbo[2], 16)), '04x')
turbo[2] = format(int(voltage_multiplier * int(turbo[2], 16)), '04x')
nominal[2] = format(int(voltage_multiplier * int(nominal[2], 16)), '04x')
OpenPOWER on IntegriCloud