#!/bin/bash # # Copyright (c) 2018 Raptor Engineering, LLC # Released under the terms of the AGPL v3 # # Provided WITHOUT WARRANTY OF ANY KIND, to the # maximum extent possible under law. Modify at # your sole risk! set -e echo "======================================================================" echo "Welcome to WoFerClock!" echo "" echo "This program is free software, developed by Raptor Engineering, LLC" echo "for use with the Talos II line of POWER9 machines:" echo "" echo "https://www.raptorcs.com/TALOSII" echo "" echo "======================================================================" echo "WARNING" echo "======================================================================" echo "This program will alter the Vital Product Data (VPD) of your CPU(s)" echo "" echo "We strongly recommend you back up the original VPD image(s) in the" echo "unlikely event the VPD of your CPU(s) is corrupted. These images" echo "will be available in the vpd_backup directory after this program" echo "has completed execution" echo "" echo "======================================================================" echo "Raptor Engineering, LLC, Raptor Computing Systems, LLC, IBM, and" echo "affiliated entities disclaim all liability resulting from the use" echo "or misuse of this program. You accept all risk associated with" echo "modification of clock and/or power data, including, without" echo "restriction, hardware damage, data corruption, and/or loss of" echo "business resulting from the use of this program." echo "" echo "CPU and/or mainboard damage incurred as a result of attempted" echo "overclocking may void any and all warranty(s) for the damaged" echo "component(s)." echo "" echo "======================================================================" echo "Do you accept these terms and wish to proceed at your own risk? [y/N]" echo "======================================================================" read -r -p "" INPUT if [[ "$INPUT" != "Y" && "$INPUT" != "y" ]]; then echo "Exiting..." exit 1 fi # Clean up possibly stale output files if present rm -rf vpd_out echo "======================================================================" read -r -p "Core count of installed CPU(s): " CORE_COUNT if [[ "$INPUT" == "" ]]; then CORE_COUNT=24 fi # Defaults NEW_ULTRATURBO_MHZ=4200 VOLTAGE_MULTIPLIER=1.00 # Reasonable defaults # Partly validated on initial silicon # NOT GUARANTEED, starting point ONLY! if [[ "$CORE_COUNT" == "4" ]]; then NEW_ULTRATURBO_MHZ=4200 VOLTAGE_MULTIPLIER=1.142 fi if [[ "$CORE_COUNT" == "8" ]]; then NEW_ULTRATURBO_MHZ=4400 VOLTAGE_MULTIPLIER=1.142 fi if [[ "$CORE_COUNT" == "18" ]]; then NEW_ULTRATURBO_MHZ=4200 VOLTAGE_MULTIPLIER=1.1 fi if [[ "$CORE_COUNT" == "22" ]]; then NEW_ULTRATURBO_MHZ=4200 VOLTAGE_MULTIPLIER=1.05 fi echo "======================================================================" echo "Targetting bucket 5 with a new Ultra Turbo frequency of ${NEW_ULTRATURBO_MHZ}MHz" echo "Voltage multiplier: ${VOLTAGE_MULTIPLIER}" echo "======================================================================" ./list_i2c_busses echo "======================================================================" read -r -p "MVPD I2C bus of your first CPU (typically 0, to skip): " I2C_BUS_0 if [[ "$I2C_BUS_0" != "" ]]; then mkdir -p vpd_backup echo -n "Reading VPD..." set +e ./read_vpd "${I2C_BUS_0}" 0x50 vpd_backup/cpu0.bin RETCODE=$? set -e if [[ $RETCODE != 0 ]]; then echo "Exiting..." exit 1 fi echo "done!" mkdir -p vpd_out echo "Modifying VPD" ./copy_buckets ${NEW_ULTRATURBO_MHZ} ${VOLTAGE_MULTIPLIER} `realpath vpd_backup` cpu0 vpd_out/cpu0 echo "Done!" fi echo "======================================================================" ./list_i2c_busses echo "======================================================================" read -r -p "MVPD I2C bus of your second CPU ( to skip): " I2C_BUS_1 if [[ "$I2C_BUS_1" != "" ]]; then mkdir -p vpd_backup echo -n "Reading VPD..." set +e ./read_vpd "${I2C_BUS_1}" 0x50 vpd_backup/cpu1.bin RETCODE=$? set -e if [[ $RETCODE != 0 ]]; then echo "Exiting..." exit 1 fi echo "done!" mkdir -p vpd_out echo "Modifying VPD" ./copy_buckets ${NEW_ULTRATURBO_MHZ} ${VOLTAGE_MULTIPLIER} `realpath vpd_backup` cpu1 vpd_out/cpu1 echo "Done!" fi echo "======================================================================" echo "Ready to write new VPD image(s). Continue? [y/N]" echo "======================================================================" read -r -p "" INPUT if [[ "$INPUT" != "Y" && "$INPUT" != "y" ]]; then echo "Exiting..." exit 1 fi if [[ "$I2C_BUS_0" != "" ]]; then echo "Writing CPU 0 VPD..." ./write_vpd "${I2C_BUS_0}" 0x50 vpd_out/cpu0.bin fi if [[ "$I2C_BUS_1" != "" ]]; then echo "Writing CPU 1 VPD" ./write_vpd "${I2C_BUS_1}" 0x50 vpd_out/cpu1.bin fi echo "======================================================================" echo "VPD image(s) have been updated successfully!" echo "" echo "NOTE: Your system will continue to use the old clocking data until you" echo "load the aggressive variant of the Talos II PNOR. If your system will" echo "not IPL or is unstable at the higher clocks, reloading the stock PNOR" echo "will restore your system back to the original clock speeds" echo "" echo "Thank you for using WoFerClock!" echo "======================================================================"