Addw2 support (#67)

* Add addw2 board

* Set charge params and update gpio.h

* Set VGA fan to 100% when entering scratch rom

* Implement keyboard LEDs

* Turn off keyboard LEDs in gpio defaults

* Default airplane mode LED to off

* Enable GPU power and fan control

* Add NVIDIA GPU power and temp to power.csv

* Add NVIDIA GPU fan value to power.sh

* Move GPU init back to coreboot

* Do not turn on GPU fan if GPU is off

* Show POST codes

* Add timestamps to console_external

* Accept port 81 cycles

* Move setting RSTS into ec_init

* Move post code debugging to system76/common

* Move some GPIO init from system76/common to boards

* Make some power signals optional

* Remove POST code support - it only works on IT5570
This commit is contained in:
Jeremy Soller
2020-06-04 13:22:59 -06:00
committed by GitHub
parent 83102f77ba
commit 39cd014f7b
30 changed files with 1100 additions and 37 deletions

View File

@@ -10,6 +10,12 @@ then
header=0
fi
has_dgpu=0
if nvidia-smi &> /dev/null
then
has_dgpu=1
fi
while true
do
if [ "${header}" == "1" ]
@@ -20,7 +26,13 @@ do
F="${F}\tCPU PL1"
F="${F}\tCPU PL2"
F="${F}\tCPU C"
F="${F}\tFAN %"
F="${F}\tCPU FAN"
if [ "${has_dgpu}" == "1" ]
then
F="${F}\tGPU W"
F="${F}\tGPU C"
F="${F}\tGPU FAN"
fi
else
F="$(date "+%T")"
@@ -53,6 +65,19 @@ do
D="$(sudo tool/target/release/system76_ectool fan 0)"
P="$(echo "(${D} * 100)/255" | bc -lq)"
F="${F}\t$(printf "%.0f" "${P}")"
if [ "${has_dgpu}" == "1" ]
then
DGPU_W="$(nvidia-smi --query-gpu=power.draw --format=csv,noheader | cut -d' ' -f1)"
F="${F}\t$(printf "%.1f" "${DGPU_W}")"
DGPU_T="$(nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader)"
F="${F}\t${DGPU_T}"
D="$(sudo tool/target/release/system76_ectool fan 1)"
P="$(echo "(${D} * 100)/255" | bc -lq)"
F="${F}\t$(printf "%.0f" "${P}")"
fi
fi
for file in /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq