aboutsummaryrefslogtreecommitdiff
path: root/devices/config/hikey960.sh
diff options
context:
space:
mode:
Diffstat (limited to 'devices/config/hikey960.sh')
-rw-r--r--devices/config/hikey960.sh37
1 files changed, 24 insertions, 13 deletions
diff --git a/devices/config/hikey960.sh b/devices/config/hikey960.sh
index 40edc9e4..190bbf74 100644
--- a/devices/config/hikey960.sh
+++ b/devices/config/hikey960.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,15 +18,26 @@
# Helper script used for setting the hikey960 frequency.
-DEVICE_NAME="hikey960"
-
-NUMBER_OF_CPUS=8
-DEVICE_IS_BIG_LITTLE=true
-LITTLE_CPUS=(0 1 2 3)
-BIG_CPUS=(4 5 6 7)
-CPUS=(0 1 2 3 4 5 6 7)
-TARGET_FREQ_LITTLE=1402000
-TARGET_FREQ_BIG=1421000
-LITTLE_CPUS_NAME=a53
-BIG_CPUS_NAME=a73
-DEFAULT_GOVERNOR=schedutil
+readonly DEVICE_NAME="hikey960"
+
+readonly NUMBER_OF_CPUS=8
+
+# Define CPU names.
+readonly BIG_CPUS_NAME="a73"
+readonly LITTLE_CPUS_NAME="a53"
+
+# Define CPU frequencies.
+readonly BIG_CPUS_FREQ=1421000
+readonly LITTLE_CPUS_FREQ=1402000
+
+# Define CPU ID's and embed the name and frequency.
+readonly BIG_CPUS=(${BIG_CPUS_NAME} ${BIG_CPUS_FREQ} 4 5 6 7)
+readonly LITTLE_CPUS=(${LITTLE_CPUS_NAME} ${LITTLE_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=schedutil