Add --update demo
PATCH 1/1 Add --update demo
In this commit we add a demo that reads the NB voltage sensor on a Carrizo in shell script.
Signed-off-by Tom St Denis <[email protected]>
--- demo/update/carrizo.update | 4 ++++ demo/update/read_sensor.sh | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 demo/update/carrizo.update create mode 100755 demo/update/read_sensor.sh
demo/update/carrizo.update new file +4 -0
@@ -0,0 +1,4 @@ +add reg carrizo.smu80.ixSMUSVI_NB_CURRENTVID smc 0xD8230044 +add bit carrizo.smu80.ixSMUSVI_NB_CURRENTVID.CURRENT_NB_VID 24 31 +add reg carrizo.smu80.ixSMUSVI_GFX_CURRENTVID smc 0xD8230048 +add bit carrizo.smu80.ixSMUSVI_GFX_CURRENTVID.CURRENT_GFX_VID 24 31
demo/update/read_sensor.sh new file +17 -0
@@ -0,0 +1,17 @@ +#!/bin/bash + +# Example script that uses umr + update scripts to read sensors that are not +# part of the kernel headers. +# +# In this case we're reading the NB voltage sensor from Carrizo + +# capture value in hex +NB_VID=`umr -O risky,risky,read_smc -u carrizo.update -r carrizo.smu80.ixSMUSVI_NB_CURRENTVID | cut -b1-4` + +# convert to decimal +NB_VID_DEC=`printf "%d" ${NB_VID}` + +# voltage is 6200mV - (25mV * sensor_data) +NB_VID_V=`expr ${NB_VID_DEC} \* 25` +NB_VID_V=`expr 6200 - ${NB_VID_V}` +printf "Northbridge voltage is %dmV\n" ${NB_VID_V}
Signature · 6 lines
2.12.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx