Skip to content

Commit

Permalink
Merge branch 'cel_develop' of https://github.com/SW-CSA/openbmc into …
Browse files Browse the repository at this point in the history
…cel_develop
  • Loading branch information
Xuth committed Dec 7, 2018
2 parents 37e4158 + 9bb1794 commit e6e6799
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -352,3 +352,25 @@ come_rest_status() {

return $ret
}

get_cpu_temp() {
TJMAX=$(peci-util 0x30 0x05 0x05 0xa1 0x00 16 00 00 | awk -F " " '{printf "0x%s\n", $4}')
info=$(peci-util 0x30 0x1 0x2 0x01)
lsb=$(echo $info |awk -F " " '{printf "0x%s\n", $1}')
msb=$(echo $info |awk -F " " '{printf "0x%s\n", $2}')
((sign=$msb&0x80))
if [ $sign -ne 128 ] ; then
return 1
fi
((a=($lsb&0xc0)>>6))
((b=($msb<<2)+$a))
((t=((~$b)+1)&0xff))
((c=$lsb&0x3f))
if [ $c -ge 40 ]; then
((t=$t+1))
fi
((temp=$TJMAX-$t))
echo $temp

return 0
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
devmem_clear_bit 0x1e78502c 0

# Disable the watch dog
devmem_clear_bit 0x1e78500c 0
#devmem_clear_bit 0x1e78500c 0

0 comments on commit e6e6799

Please sign in to comment.