aboutsummaryrefslogtreecommitdiff
path: root/tcwg-base
diff options
context:
space:
mode:
authorLaurent Alfonsi <laurent.alfonsi@linaro.org>2024-01-16 16:45:23 +0100
committerLaurent Alfonsi <laurent.alfonsi@linaro.org>2024-01-23 13:03:07 +0000
commite70a8ded773fbe4ea51e308f8f69b4e6b0372dfe (patch)
tree90d814dfdbbfdfe019ad9e0cca422630db626e8e /tcwg-base
parent2f075e3044c85f7b4086948a464ddd3ec53295be (diff)
nvidia-power-cycle.sh,tio_power_control.exp: Add script to power cycling of HK8450 boards
Full procedure desfcribed in https://linaro.atlassian.net/browse/STG-5251 Usage : $ nvidia-power-cycle.sh tcwg-qc-02 This will connect dev-01.tcwglab on port 22 (bare machine) and run tio_power_control.exp with proper parameter. The later script will run tio command with the serial usb to control the requested board. Right now only one board is supported : tcwg-qc-02.tcwglab (192.168.17.122) Remark : The tio_power_control.exp script needs to be installed on bare machine, and not necessarily on the containers. However, it is stored and versionned here, just beside others power control script. Change-Id: Ica2ff6ce8b513fd3cc6d1f517c44ec3762f60e08
Diffstat (limited to 'tcwg-base')
-rwxr-xr-xtcwg-base/nvidia-power-cycle.sh13
-rwxr-xr-xtcwg-base/tio-power-cycle.exp51
2 files changed, 64 insertions, 0 deletions
diff --git a/tcwg-base/nvidia-power-cycle.sh b/tcwg-base/nvidia-power-cycle.sh
index 84eac4da..2081ad7d 100755
--- a/tcwg-base/nvidia-power-cycle.sh
+++ b/tcwg-base/nvidia-power-cycle.sh
@@ -4,6 +4,19 @@
# support.tcwglab:/usr/local/bin/pcycle-* .
case "$*" in
+ "tcwg-qc-"*)
+ case "$*" in
+ "tcwg-qc-02")
+ control_usb_id="usb-Linaro_DebugBoard_cfe5b51575a4451502020223e22160ff-if00"
+ # console_usb_id="usb-FTDI_FT232R_USB_UART_AU04FQ0U-if00-port0"
+ ;;
+ *)
+ echo "Unknown board $*"
+ exit 1
+ ;;
+ esac
+ exec ssh -p22 root@dev-01.tcwglab tio-power-cycle.exp "$control_usb_id"
+ ;;
"tcwg-apm-"*|"tcwg-sq-"*|"tcwg-x15-"*)
pdu=tpdu01
case "$*" in
diff --git a/tcwg-base/tio-power-cycle.exp b/tcwg-base/tio-power-cycle.exp
new file mode 100755
index 00000000..ecb801c2
--- /dev/null
+++ b/tcwg-base/tio-power-cycle.exp
@@ -0,0 +1,51 @@
+#!/usr/bin/expect
+
+####
+#
+# Procedure fully described in https://linaro.atlassian.net/browse/STG-5251
+#
+# Example of command line :
+# tio_power_control.exp usb-Linaro_DebugBoard_cfe5b51575a4451502020223e22160ff-if00
+#
+####
+
+set serial_name [lindex $argv 0]
+
+
+## Connecting to the serial of the QcomLT DebugBoard
+spawn tio /dev/serial/by-id/$serial_name -b 115200
+expect "Connected\r"
+
+# -- print power info : "s"
+send -- "s\r"
+
+## 1. Disconnect the power : "p"
+send -- "p\r"
+
+## 2. Wait for few seconds
+sleep 2
+send -- "s\r"
+
+## 3. Connect the power : "P"
+send -- "P\r"
+
+## 4. Wait for few seconds
+sleep 1
+send -- "s\r"
+
+## 5. Trigger power button
+## 5.a. set the PWR_BTN header signal to high level : "B"
+send -- "B\r"
+
+## 5.b. Wait for a second
+sleep 1
+
+## 5.c. set the PWR_BTN header signal to low level : "b"
+send -- "b\r"
+
+# Wait few seconds before exiting
+sleep 2
+send -- "s\r"
+
+expect eof
+