distribution/packages/sysutils/system-utils/sources/devices/AMD64/overclock

81 lines
1.5 KiB
Text
Raw Normal View History

2022-09-04 16:57:55 +00:00
#!/bin/bash
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
. /etc/profile
###
### On startup the device will run at the maximum TDP that
### the CPU is capable of. This is not desired behavior.
###
### 1. Check if we have a TDP setting, and set it.
### 2. Check if we have a device default TDP, and set it.
### 3. Use a common TDP down value used across multiple AMD CPUs.
###
2022-09-04 16:57:55 +00:00
if [ $# -eq 0 ] || [ "$1" == "boot" ]
then
PROFILE=$(get_setting system.overclock)
if [ -z "${PROFILE}" ] && \
[ -n "${DEVICE_BASE_TDP}" ]
then
PROFILE="${DEVICE_BASE_TDP}"
else
PROFILE="15w"
fi
2022-09-04 16:57:55 +00:00
else
### When run from ES or a shell, and the value of "off"
### is passed, go back to the default TDP. If not available
### use our default of 15w.
2022-09-04 16:57:55 +00:00
PROFILE=$1
if [ "${PROFILE}" = "off" ]
then
if [ -n "${DEVICE_BASE_TDP}" ]
then
PROFILE="${DEVICE_BASE_TDP}"
else
PROFILE="15w"
fi
fi
2022-09-04 16:57:55 +00:00
fi
case ${PROFILE} in
2.5w)
WATTS="2500"
2022-09-04 16:57:55 +00:00
;;
4.5w)
WATTS="4500"
2022-09-04 16:57:55 +00:00
;;
6w)
WATTS="6000"
;;
9w)
WATTS="9000"
2022-09-04 16:57:55 +00:00
;;
12w)
WATTS="12000"
;;
15w)
WATTS="15000"
2022-09-04 16:57:55 +00:00
;;
16w)
WATTS="16000"
;;
18w)
WATTS="18000"
;;
22w)
2022-11-29 11:00:27 +00:00
WATTS="22000"
;;
24w)
2022-11-29 11:00:27 +00:00
WATTS="24000"
;;
28w)
WATTS="28000"
;;
*)
WATTS="${PROFILE}"
;;
2022-09-04 16:57:55 +00:00
esac
ryzenadj --tctl-temp=97 --stapm-limit=${WATTS} --fast-limit=${WATTS} --stapm-time=500 --slow-limit=${WATTS} --slow-time=30 --vrmmax-current=70000