Commit 94af399a authored by aTc's avatar aTc

update letux scripts to 4.4-rc4 version

parent e704c665
TWL4030_MADC=/sys/devices/platform/68000000.ocp/48070000.i2c/i2c-0/0-0048/48070000.i2c:twl@48:madc/iio:device0
TWL6037_GPADC=/sys/bus/platform/drivers/palmas-gpadc/48070000.i2c:palmas@48:gpadc
TWL6030_GPADC=/sys/devices/platform/44000000.ocp/48070000.i2c/i2c-0/0-0048/48070000.i2c:twl@48:adc/iio:device0
TWL6037_GPADC=/sys/devices/platform/44000000.ocp/48070000.i2c/i2c-0/0-0048/48070000.i2c:palmas@48:gpadc/iio:device0
if [ -d $TWL4030_MADC ]
then
......@@ -23,8 +24,52 @@ echo
fi
if [ -d $TWL6037_GPADC ]
then
if [ -d $TWL6030_GPADC ]
then # OMAP4 with twl6030
# channels (twl6030 only - twl6032 has different channels!)
# 0 battery type
# 1 battery temp
# 2 audio/GP
# 3 GP
# 4 GP
# 5 GP
# 6 GP
# 7 VBAT_SENSE
# 8 Backup Battery
# 9 external charger (VCHG)
# 10 VBUS
# 11 VBUS charging current
# 12 internal die temp
# 13 internal die temp
# 14 USB ID line voltage
# 15 test network
echo "System Voltage"
echo "=============="
echo VSYS: $(cat $TWL6030_GPADC/in_voltage7_input)mV
echo
echo "Main Battery"
echo "============"
VOLT=$(cat $TWL6030_GPADC/in_voltage7_input)
echo volt: ${VOLT}mV ca. $(expr \( "$VOLT" - 3300 \) \* 100 / 950)%
# NOTE: the driver reports mV and not mA or °C!
# NOTE: in_voltage11_input is missing on Pandaboard
# echo current: $(cat $TWL6030_GPADC/in_voltage11_input)mA
echo temp: $(cat $TWL6030_GPADC/in_temp1_raw)°C
echo type: $(cat $TWL6030_GPADC/in_voltage0_input)mV
echo VBUS: $(cat $TWL6030_GPADC/in_voltage10_input)mV
echo VCHG: $(cat $TWL6030_GPADC/in_voltage9_input)mV
echo audio: $(cat $TWL6030_GPADC/in_voltage2_input)mV
echo usb id: $(cat $TWL6030_GPADC/in_voltage14_input)mV
echo
echo "Backup battery"
echo "=============="
echo volt: $(cat $TWL6030_GPADC/in_voltage8_input)mV
echo
elif [ -d $TWL6037_GPADC ]
then # OMAP5 with Palmas
# channels
# 0 battery type (source current 0, 5, 15, 20 uA)
......@@ -44,27 +89,26 @@ then
# 14 USB ID line voltage
# 15 test network
# FIXME: adapt for iio driver
echo "System Voltage"
echo "=============="
echo VSYS: $(cat $TWL6037_GPADC/in7_channel)mV
echo VSYS: $(cat $TWL6037_GPADC/in_voltage7_input)mV
echo
echo "Main Battery"
echo "============"
VOLT=$(cat $TWL6037_GPADC/in6_channel)
VOLT=$(cat $TWL6037_GPADC/in_voltage6_input)
echo volt: ${VOLT}mV ca. $(expr \( "$VOLT" - 3300 \) \* 100 / 950)%
echo current: $(cat $TWL6037_GPADC/in11_channel)mA
echo temp: $(cat $TWL6037_GPADC/in2_channel)°C
echo type: $(cat $TWL6037_GPADC/in0_channel)mV
echo VBUS: $(cat $TWL6037_GPADC/in10_channel)mV
echo VCHG: $(cat $TWL6037_GPADC/in9_channel)mV
echo audio: $(cat $TWL6037_GPADC/in2_channel)mV
echo usb id: $(cat $TWL6037_GPADC/in14_channel)mV
# NOTE: the driver reports mV and not mA or °C!
echo current: $(cat $TWL6037_GPADC/in_voltage11_input)mA
echo temp: $(cat $TWL6037_GPADC/in_temp1_raw)°C
echo type: $(cat $TWL6037_GPADC/in_voltage0_input)mV
echo VBUS: $(cat $TWL6037_GPADC/in_voltage10_input)mV
echo VCHG: $(cat $TWL6037_GPADC/in_voltage9_input)mV
echo audio: $(cat $TWL6037_GPADC/in_voltage2_input)mV
echo usb id: $(cat $TWL6037_GPADC/in_voltage14_input)mV
echo
echo "Backup battery"
echo "=============="
echo volt: $(cat $TWL6037_GPADC/in8_channel)mV
echo volt: $(cat $TWL6037_GPADC/in_voltage8_input)mV
echo
fi
......@@ -82,7 +126,7 @@ echo online: $(cat $SUPPLY/online 2>/dev/null)
echo status: $(cat $SUPPLY/status 2>/dev/null)
echo volt: $(cat $SUPPLY/voltage_now 2>/dev/null)uV
echo current: $(cat $SUPPLY/current_now 2>/dev/null)uA
echo max_current: $(cat /dev/usb_max_current 2>/dev/null)uA
echo max_current: $(cat $SUPPLY/max_current 2>/dev/null)uA
echo ID: $(cat /dev/usb_id 2>/dev/null)
echo
;;
......@@ -95,6 +139,7 @@ echo online: $(cat $SUPPLY/online 2>/dev/null)
echo status: $(cat $SUPPLY/status 2>/dev/null)
echo volt: $(cat /sys$SUPPLY/voltage_now 2>/dev/null)uV
echo current: $(cat $SUPPLY/current_now 2>/dev/null)uA
echo max_current: $(cat $SUPPLY/max_current 2>/dev/null)uA
echo
;;
......
......@@ -59,6 +59,16 @@ then ok "SD"
else ok "NAND"
fi
function findregulator {
for regulator in /sys/class/regulator/regulator.*
do
if [ "$(cat $regulator/name 2>/dev/null)" = "$1" ]
then echo $regulator
break
fi
done
}
function findiio {
for iiodev in /sys/bus/iio/devices/iio:device*
do
......@@ -349,6 +359,18 @@ if $OK
fi
done
nok
# known to fail on GTA04A3
testing "GTM601 power off" "check power off through rfkill block"
rfkill block wwan
sleep 8
if lsusb | fgrep '0af0:8800 Option' >/dev/null
then # still/again found
nok
else
ok
fi
fi
# enable antenna power
......@@ -373,6 +395,8 @@ $PSRF' >/dev/null
done
nok
VAUX4=$(findregulator "VAUX4")
testing "W2CBW003-BT UART" "Bluetooth/WLAN power, UART1, Bluetooth and initial baudrate"
rfkill unblock bluetooth
for BTBAUD in 3000000 921600 115200
......@@ -419,7 +443,7 @@ then # scan
testing "W2CBW003-BT-Scan" "scan for Bluetooth Base station"
for i in 1 2 3 4 5
do
BASE=$(hcitool scan --refresh | fgrep --invert-match Scanning | head -1 | cut -f 2) # try to locate base station
BASE=$(hcitool scan --info | fgrep 'BD Address' | head -1 | cut -f 2 | cut -d ' ' -f 1) # try to locate base station
if [ "$BASE" ]
then
ok $BASE # found
......@@ -429,8 +453,14 @@ then # scan
nok
fi
testing "VAUX4" "power on for Bluetooth"
[ "$(cat $VAUX4/num_users)" = "2" ] && ok || nok
killall hciattach 2>/dev/null # stop any running daemon
testing "VAUX4" "power off for Bluetooth"
[ "$(cat $VAUX4/num_users)" = "1" ] && ok || nok
testing "W2CBW003-WLAN-libertas" "check if kernel did load libertas driver"
rfkill unblock wifi
( lsmod | fgrep libertas_sdio >/dev/null ) && ok || nok
......@@ -465,6 +495,9 @@ then # scan
ok || nok
fi
testing "VAUX4" "power off for WLAN"
[ "$(cat $VAUX4/num_users)" = "0" ] && ok || nok
killall -9 arecord aplay 2>/dev/null # stop any running audio forwarding
testing "Tests-End" "Summary of all tests"
......
......@@ -3,6 +3,19 @@
# must properly resize the framebuffer for othe display given by hardware
#
ls -l /sys/devices/platform/omapdrm.0/drm/card0/card0-*
if [ "$1" == "1" ]
then
xrandr --output None-1 --same-as None-2
else
xrandr --output None-1 --off
fi
exit
### old
MUX=$(expr "$(cat /proc/cmdline)" : ".*mux=\([^ ]*\)")
TV=unknown
......
......@@ -35,6 +35,12 @@ case "$IF" in
/dev/ttyACM0 | /dev/ttyUSB[0-4] ) # Neo900 / Pyra
(
# is this correct??
INA231=$(ls -d1 /sys/bus/i2c/drivers/ina2xx/1-004f/hwmon/hwmon? | head -1)
echo "VSYS: $(cat $INA231/in1_input) mV"
echo "Modem Current: $(cat $INA231/curr1_input) mA"
echo "Modem Power: $(cat $INA231/power1_input) uW"
echo "VMODEM: $(cat $INA231/in0_input) mV"
# FIXME
echo "AT^SBV"; sleep 1
echo "AT^SDPORT?"; sleep 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment