summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: df50ca1)
raw | patch | inline | side by side (parent: df50ca1)
author | Nikhil Devshatwar <a0132237@ti.com> | |
Mon, 30 Sep 2019 09:39:49 +0000 (15:09 +0530) | ||
committer | Nikhil Devshatwar <a0132237@ti.com> | |
Mon, 30 Sep 2019 09:41:52 +0000 (15:11 +0530) |
GPIO buttons are modelled as input keys. This helps to
setup the GPIO, pinmux and other device specific setup
to be done by the kernel itself. Remove all the setup code.
The script runs the evtest application filtering the events
related to button presses.
Now each VM can crash iself, no need to explicitly destroy VM.
Signed-off-by: Nikhil Devshatwar <a0132237@ti.com>
setup the GPIO, pinmux and other device specific setup
to be done by the kernel itself. Remove all the setup code.
The script runs the evtest application filtering the events
related to button presses.
Now each VM can crash iself, no need to explicitly destroy VM.
Signed-off-by: Nikhil Devshatwar <a0132237@ti.com>
demo/cockpit-demo-infotainment-VM.sh | patch | blob | history | |
demo/crash-VM.sh | patch | blob | history |
index ecc15ca6727d3b9d326155b7de01079f894f47ec..a3f5b226cf412eb5f0b7bc39794c7ac9caa5a9dd 100755 (executable)
run_multimedia 2>/dev/null 1>&2 &
ti-heartbeat-i-am-here 2>/dev/null 1>&2 &
+
+/usr/share/ti/util-scripts/demo/crash-VM.sh 2>/dev/null 1>&2 &
+
diff --git a/demo/crash-VM.sh b/demo/crash-VM.sh
index 36ced67e0b36d353bf1b9fd54112380d3c575e48..dde3724d27f03b7b6ed227e1f0b910cea582b1aa 100755 (executable)
--- a/demo/crash-VM.sh
+++ b/demo/crash-VM.sh
#Crashes kernel using sysrq
#https://www.kernel.org/doc/html/latest/admin-guide/sysrq.html
-#Detect the board on which the script is running
-BRD=`cat /proc/device-tree/model`
-
-# Setup SW11(SYS_IRQz) => WAKEUP GPIO0_7 (CTRLMMR_WKUP_PADCONFIG51)
-devmem2 0x4301c0cc w 0x44007
-
-#Setup GPIO muxmode and input
-echo 7 > /sys/class/gpio/export
-echo in > /sys/class/gpio/gpio7/direction
-
-# Setup SW10(SOC_EXTINTn) => MAIN GPIO0_7 (CTRLMMR_PADCONFIG0)
-devmem2 0x11c000 w 0x44007
-
-#Setup GPIO muxmode and input
-echo 84 > /sys/class/gpio/export
-echo in > /sys/class/gpio/gpio84/direction
-
-#Wait till the button is pressed and crash the kernel
+#Wait till the push button is pressed to crash the kernel
while true;
do
- val=`cat /sys/class/gpio/gpio7/value`
- if [ $val -eq "0" ]; then
- wall "SW11 button pressed, Crashing the root cell (Cluster VM)"
- msleep 100
- echo c > /proc/sysrq-trigger
- fi
-
- val=`cat /sys/class/gpio/gpio84/value`
- if [ $val -eq "0" ]; then
- wall "SW10 button pressed, Crashing the inmate cell (Infotainment VM)"
- msleep 100
- jailhouse cell destroy 1
- fi
-
- msleep 100
+ evtest /dev/input/by-path/platform-gpio-keys-event | grep -m2 BTN_
+ if [ $? -eq "0" ]; then
+ wall "Push button pressed, Crashing the kernel..."
+ msleep 100
+ echo c > /proc/sysrq-trigger
+ fi
+ msleep 100
done &
-
-