aboutsummaryrefslogtreecommitdiff
path: root/devices/config/bullhead.sh
diff options
context:
space:
mode:
Diffstat (limited to 'devices/config/bullhead.sh')
-rw-r--r--devices/config/bullhead.sh35
1 files changed, 23 insertions, 12 deletions
diff --git a/devices/config/bullhead.sh b/devices/config/bullhead.sh
index 6bbccd1e..899d00a0 100644
--- a/devices/config/bullhead.sh
+++ b/devices/config/bullhead.sh
@@ -1,7 +1,7 @@
#!/bin/bash
# shellcheck disable=SC2034
#
-# Copyright (c) 2016-2017, Linaro Ltd.
+# Copyright (c) 2016-2022, Linaro Ltd.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,14 +18,25 @@
# Helper script used for setting the Nexus 5X frequency.
-DEVICE_NAME="Nexus 5X"
-
-NUMBER_OF_CPUS=6
-DEVICE_IS_BIG_LITTLE=true
-LITTLE_CPUS=(0 1 2 3)
-BIG_CPUS=(4 5)
-CPUS=(0 1 2 3 4 5)
-TARGET_FREQ=1248000
-LITTLE_CPUS_NAME=a53
-BIG_CPUS_NAME=a57
-DEFAULT_GOVERNOR=interactive
+readonly DEVICE_NAME="Nexus 5X"
+
+readonly NUMBER_OF_CPUS=6
+
+# Define CPU names.
+readonly BIG_CPUS_NAME="a57"
+readonly LITTLE_CPUS_NAME="a53"
+
+# Define CPU frequencies.
+readonly CPUS_FREQ=1248000
+
+# Define CPU ID's and embed the name and frequency.
+readonly BIG_CPUS=(${BIG_CPUS_NAME} ${CPUS_FREQ} 4 5)
+readonly LITTLE_CPUS=(${LITTLE_CPUS_NAME} ${CPUS_FREQ} 0 1 2 3)
+
+# Bash does not support 2d arrays so instead store the name of the array and
+# later dereference by using "!" e.g: "arr=(${!CPUS[big]})".
+declare -A -g CPUS
+CPUS[big]="BIG_CPUS[@]"
+CPUS[little]="LITTLE_CPUS[@]"
+
+readonly DEFAULT_GOVERNOR=interactive