aboutsummaryrefslogtreecommitdiff
path: root/prepare-device.sh
diff options
context:
space:
mode:
Diffstat (limited to 'prepare-device.sh')
-rwxr-xr-xprepare-device.sh86
1 files changed, 64 insertions, 22 deletions
diff --git a/prepare-device.sh b/prepare-device.sh
index 914dc36..90ebcef 100755
--- a/prepare-device.sh
+++ b/prepare-device.sh
@@ -24,27 +24,19 @@
set -e
echo "Preparing device for mode: $1"
-if [ $1 == 'mp' ]
-then
- # disable IKS
+disable_iks () {
IPADDR=`cat IPADDR`
echo "Disable IKS for $IPADDR"
- adb root | true
- adb connect $IPADDR:5555
- adb devices
- echo "Waiting for device"
- adb wait-for-device
echo "adb -s $IPADDR:5555 shell \"echo 0 > /sys/kernel/bL_switcher/active\""
adb -s $IPADDR:5555 shell "echo 0 > /sys/kernel/bL_switcher/active"
adb -s $IPADDR:5555 shell "cat /sys/kernel/bL_switcher/active"
-fi
+}
if [ $1 == 'iks' ]
then
# enable IKS
IPADDR=`cat IPADDR`
echo "Enable IKS for $IPADDR"
- adb root | true
adb connect $IPADDR:5555
adb devices
echo "Waiting for device"
@@ -56,17 +48,11 @@ fi
if [ $1 == 'a7only' ]
then
- # disable IKS
IPADDR=`cat IPADDR`
- echo "Disable IKS for $IPADDR"
- adb root | true
adb connect $IPADDR:5555
adb devices
echo "Waiting for device"
adb wait-for-device
- echo "adb -s $IPADDR:5555 shell \"echo 0 > /sys/kernel/bL_switcher/active\""
- adb -s $IPADDR:5555 shell "echo 0 > /sys/kernel/bL_switcher/active"
- adb -s $IPADDR:5555 shell "cat /sys/kernel/bL_switcher/active"
echo "Disable A15 cluster"
adb -s $IPADDR:5555 shell "echo 0 > /sys/devices/system/cpu/cpu3/online"
adb -s $IPADDR:5555 shell "echo 0 > /sys/devices/system/cpu/cpu4/online"
@@ -74,21 +60,77 @@ fi
if [ $1 == 'a15only' ]
then
- # disable IKS
IPADDR=`cat IPADDR`
- echo "Disable IKS for $IPADDR"
- adb root | true
adb connect $IPADDR:5555
adb devices
echo "Waiting for device"
adb wait-for-device
- echo "adb -s $IPADDR:5555 shell \"echo 0 > /sys/kernel/bL_switcher/active\""
- adb -s $IPADDR:5555 shell "echo 0 > /sys/kernel/bL_switcher/active"
- adb -s $IPADDR:5555 shell "cat /sys/kernel/bL_switcher/active"
echo "Disable A7 cluster"
adb -s $IPADDR:5555 shell "echo 0 > /sys/devices/system/cpu/cpu0/online"
adb -s $IPADDR:5555 shell "echo 0 > /sys/devices/system/cpu/cpu1/online"
adb -s $IPADDR:5555 shell "echo 0 > /sys/devices/system/cpu/cpu2/online"
fi
+if [ $1 == 'a53only' ]
+then
+ IPADDR=`cat IPADDR`
+ adb connect $IPADDR:5555
+ adb devices
+ echo "Waiting for device"
+ adb wait-for-device
+ adb devices
+ echo "Disable A57 cluster"
+ adb -s $IPADDR:5555 shell "echo 0 > /sys/devices/system/cpu/cpu4/online | su"
+ adb -s $IPADDR:5555 shell "echo 0 > /sys/devices/system/cpu/cpu5/online | su"
+fi
+
+if [ $1 == 'a57only' ]
+then
+ IPADDR=`cat IPADDR`
+ adb connect $IPADDR:5555
+ adb devices
+ echo "Waiting for device"
+ adb wait-for-device
+ adb devices
+ echo "Disable A53 cluster"
+ adb -s $IPADDR:5555 shell "echo 0 > /sys/devices/system/cpu/cpu0/online | su"
+ adb -s $IPADDR:5555 shell "echo 0 > /sys/devices/system/cpu/cpu1/online | su"
+ adb -s $IPADDR:5555 shell "echo 0 > /sys/devices/system/cpu/cpu2/online | su"
+ adb -s $IPADDR:5555 shell "echo 0 > /sys/devices/system/cpu/cpu3/online | su"
+fi
+
+if [ $1 == 'hmp' ]
+then
+ IPADDR=`cat IPADDR`
+ adb connect $IPADDR:5555
+ adb devices
+ echo "Waiting for device"
+ adb wait-for-device
+ adb devices
+ if [ $2 == 'vexpress-tc2' ]
+ then
+ disable_iks
+ fi
+ adb connect $IPADDR:5555
+ adb wait-for-device
+ adb devices
+fi
+
+if [ $1 == 'eas' ]
+then
+ IPADDR=`cat IPADDR`
+ adb connect $IPADDR:5555
+ adb devices
+ echo "Waiting for device"
+ adb wait-for-device
+ adb devices
+ if [ $2 == 'vexpress-tc2' ]
+ then
+ disable_iks
+ fi
+ adb connect $IPADDR:5555
+ adb wait-for-device
+ adb devices
+fi
+
exit 0