diff options
Diffstat (limited to 'meta-openbmc-mods/meta-wolfpass/recipes-intel/temporary/set-passthrough/set-passthrough.sh')
-rw-r--r-- | meta-openbmc-mods/meta-wolfpass/recipes-intel/temporary/set-passthrough/set-passthrough.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/meta-openbmc-mods/meta-wolfpass/recipes-intel/temporary/set-passthrough/set-passthrough.sh b/meta-openbmc-mods/meta-wolfpass/recipes-intel/temporary/set-passthrough/set-passthrough.sh new file mode 100644 index 000000000..3fbe5e7c6 --- /dev/null +++ b/meta-openbmc-mods/meta-wolfpass/recipes-intel/temporary/set-passthrough/set-passthrough.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# this script uses devmem to set hardware passthrough +# it is temporary and should be removed in the future + +PASSTHROUGH_ENABLE=0x3000 + +if [[ -z $1 ]]; then + echo "First Argument Must Be 1 To Enable or 0 To Disable" + exit 1 +fi + +if [[ $1 != "0" && $1 != "1" ]]; then + echo "Arg 1 must be 0 or 1" + exit 1 +fi + +# read register +var=$(devmem 0x1e6e208C w) + +# convert to int +typeset -i value=$( echo $(( $var )) ) + +if [[ $1 == "0" ]]; then + value=$((value & ~PASSTHROUGH_ENABLE)) +fi + +if [[ $1 == "1" ]]; then + value=$((value | PASSTHROUGH_ENABLE)) +fi + +val=$(printf '0x%x\n' $value) + +#echo $val + +devmem 0x1e6e208C w $val + +# devmem 0x1e6e208C w |