blob: b11a50b9ced5450dc803a145da27023bda9cfdaa [file] [log] [blame]
# Copyright 2018 The Hafnium Authors.
#
# 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
#
# https://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.
import("//build/toolchain/platform.gni")
declare_args() {
hftest_ctrl = ":ctrl_fdt"
hftest_device = ":device_psci"
}
config("hftest_config") {
include_dirs = [ "//test/inc" ]
}
# Testing framework for a primary VM.
source_set("hftest_primary_vm") {
testonly = true
public_configs = [ ":hftest_config" ]
deps = [
":hftest_standalone",
"//vmlib/${plat_arch}:call",
]
}
# Testing framework for a secondary VM. It's currently just a slave VM and
# can't affect the tests directly.
source_set("hftest_secondary_vm") {
testonly = true
public_configs = [ ":hftest_config" ]
sources = [
"service.c",
]
deps = [
":mm",
":power_mgmt",
"//src:dlog",
"//src:memiter",
"//src:panic",
"//src:std",
"//src/arch/${plat_arch}:entry",
"//src/arch/${plat_arch}/hftest:entry",
"//src/arch/${plat_arch}/hftest:power_mgmt",
"//vmlib/${plat_arch}:call",
]
}
# Testing framework for a hypervisor.
source_set("hftest_hypervisor") {
testonly = true
public_configs = [ ":hftest_config" ]
deps = [
":hftest_standalone",
]
}
# Testing framework for tests running under Linux in the primary VM.
source_set("hftest_linux") {
testonly = true
public_configs = [ ":hftest_config" ]
sources = [
"linux_main.c",
]
deps = [
":common",
"//src:dlog",
"//src:memiter",
"//src/arch/${plat_arch}/hftest:power_mgmt",
]
}
source_set("hftest_standalone") {
visibility = [ ":*" ]
testonly = true
public_configs = [ ":hftest_config" ]
sources = [
"standalone_main.c",
]
deps = [
":common",
":mm",
":power_mgmt",
"//src:dlog",
"//src:memiter",
"//src/arch/${plat_arch}:entry",
"//src/arch/${plat_arch}/hftest:entry",
"//src/arch/${plat_arch}/hftest:interrupts",
"//src/arch/${plat_arch}/hftest:power_mgmt",
hftest_ctrl,
hftest_device,
]
}
# Common code for hftest, whether it is running under Linux, under Hafnium in
# the primary VM, or directly on the hardware.
source_set("common") {
visibility = [ ":*" ]
testonly = true
public_configs = [ ":hftest_config" ]
sources = [
"common.c",
]
deps = [
"//src:fdt_handler",
"//src:memiter",
"//src:panic",
"//src:std",
]
}
source_set("device_psci") {
testonly = true
public_configs = [ ":hftest_config" ]
sources = [
"device_psci.c",
]
deps = [
"//src/arch/${plat_arch}/hftest:power_mgmt",
]
}
source_set("mm") {
testonly = true
public_configs = [ ":hftest_config" ]
sources = [
"mm.c",
]
deps = [
"//src:layout",
"//src:mm",
"//src/arch/${plat_arch}:arch",
"//src/arch/${plat_arch}/hftest:mm",
]
}
source_set("power_mgmt") {
testonly = true
public_configs = [ ":hftest_config" ]
sources = [
"power_mgmt.c",
]
deps = [
":mm",
"//src/arch/${plat_arch}/hftest:power_mgmt",
]
}
source_set("ctrl_fdt") {
testonly = true
public_configs = [ ":hftest_config" ]
sources = [
"ctrl_fdt.c",
]
deps = [
"//src:dlog",
"//src:fdt",
"//src:memiter",
]
}
source_set("ctrl_uart") {
testonly = true
public_configs = [ ":hftest_config" ]
sources = [
"ctrl_uart.c",
]
deps = [
"//src:dlog",
"//src:memiter",
hftest_device,
plat_console,
]
}