diff options
author | Julien Duraj <julien.duraj@linaro.org> | 2017-06-16 15:50:38 +0000 |
---|---|---|
committer | Linaro Android Code Review <android-review@review.linaro.org> | 2017-06-16 15:50:38 +0000 |
commit | 35b64c333f190181a407eeff2ec25825e866046a (patch) | |
tree | 7491b10df08ad1b7766a292ef9414bfd5e974b0d | |
parent | b63caef6d2ab2fd3107476aaa1dcc2ebd235cc67 (diff) | |
parent | 5ddea658951864efb3f4255995659bb7fda81f2e (diff) |
Merge "Add support for the hikey960 board"
-rwxr-xr-x | benchmarks/benchmarks_run_target.sh | 2 | ||||
-rw-r--r-- | devices/config/hikey960.sh | 31 | ||||
-rw-r--r-- | devices/flash_device.sh | 2 | ||||
-rwxr-xr-x | devices/set_cpu_freq.sh | 47 | ||||
-rw-r--r-- | devices/support/getprop_NUC6i5SYH | 1 |
5 files changed, 61 insertions, 22 deletions
diff --git a/benchmarks/benchmarks_run_target.sh b/benchmarks/benchmarks_run_target.sh index 898d5a2..a099f83 100755 --- a/benchmarks/benchmarks_run_target.sh +++ b/benchmarks/benchmarks_run_target.sh @@ -189,7 +189,7 @@ run_benchmarks() { } run_all_benchmarks() { - local -r target_device=$(safe adb_shell getprop ro.product.board) + local -r target_device=$(safe adb_shell getprop ro.product.device) local -r cpu="${options["cpu"]}" if [[ "$cpu" == "default" ]]; then diff --git a/devices/config/hikey960.sh b/devices/config/hikey960.sh new file mode 100644 index 0000000..f70c6d4 --- /dev/null +++ b/devices/config/hikey960.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# shellcheck disable=SC2034 +# +# Copyright (c) 2016-2017, Linaro Ltd. +# All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# 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 diff --git a/devices/flash_device.sh b/devices/flash_device.sh index 5f08a54..74da7a7 100644 --- a/devices/flash_device.sh +++ b/devices/flash_device.sh @@ -127,7 +127,7 @@ adb_check_device() { fi # Check that the device is what we expect. - local adb_device=$(safe adb_shell getprop ro.product.board) + local adb_device=$(safe adb_shell getprop ro.product.device) if [[ ! ${adb_device} =~ ${BOARD} ]]; then log E "Unsupported device ${adb_device}." log E "This script works for ${BOARD}." diff --git a/devices/set_cpu_freq.sh b/devices/set_cpu_freq.sh index 119f5b9..845639d 100755 --- a/devices/set_cpu_freq.sh +++ b/devices/set_cpu_freq.sh @@ -102,27 +102,34 @@ set_device_freq() { exit 0 fi - local -a cpus_to_configure - - if [[ ${options["cpus"]} == "all" ]]; then - log I "Enabling all CPUs." - cpus_to_configure=("${CPUS[@]}") - safe enable_cpus "${cpus_to_configure[@]}" - elif [[ ${options["cpus"]} == "big" ]]; then - log I "Enabling only the big cluster." - safe enable_cpus "${BIG_CPUS[@]}" - safe disable_cpus "${LITTLE_CPUS[@]}" - cpus_to_configure=("${BIG_CPUS[@]}") - elif [[ ${options["cpus"]} == "little" ]]; then - log I "Enabling only the little cluster." - safe enable_cpus "${LITTLE_CPUS[@]}" - safe disable_cpus "${BIG_CPUS[@]}" - cpus_to_configure=("${LITTLE_CPUS[@]}") - fi + case ${options["cpus"]} in + all) + log I "Enabling all CPUs." + safe enable_cpus "${CPUS[@]}" + ;; + big) + log I "Enabling only the big cluster." + safe enable_cpus "${BIG_CPUS[@]}" + safe disable_cpus "${LITTLE_CPUS[@]}" + ;; + little) + log I "Enabling only the little cluster." + safe enable_cpus "${LITTLE_CPUS[@]}" + safe disable_cpus "${BIG_CPUS[@]}" + ;; + esac if ${options["pin-freq"]}; then - log I "Pinning the frequency." - safe set_freq_cpus "${TARGET_FREQ}" "${cpus_to_configure[@]}" + case ${options["cpus"]} in + big|all) + log I "Pinning the frequency on the big cores." + safe set_freq_cpus "${TARGET_FREQ_BIG:-${TARGET_FREQ}}" "${BIG_CPUS[@]}" + ;;& + little|all) + log I "Pinning the frequency on the little cores." + safe set_freq_cpus "${TARGET_FREQ_LITTLE:-${TARGET_FREQ}}" "${LITTLE_CPUS[@]}" + ;; + esac fi } @@ -132,7 +139,7 @@ main() { # Make sure that adb is started before checking the board name. safe adb start-server - readonly target_device=$(safe adb_shell getprop ro.product.board) + readonly target_device=$(safe adb_shell getprop ro.product.device) log I "Detected device ${target_device}" exit_on_failure get_device_settings "${target_device}" "${local_path}/config" diff --git a/devices/support/getprop_NUC6i5SYH b/devices/support/getprop_NUC6i5SYH index 8be10d1..7257ff8 100644 --- a/devices/support/getprop_NUC6i5SYH +++ b/devices/support/getprop_NUC6i5SYH @@ -25,6 +25,7 @@ declare -Ar props=( ["dalvik.vm.isa.x86.features"]="default" ["dalvik.vm.isa.x86.variant"]="silvermont" ["ro.product.board"]="NUC6i5SYH" + ["ro.product.device"]="NUC6i5SYH" ["ro.product.cpu.abi"]="x86_64" ) |