blob: 2ddbaa4ece54abc3e11d339440e5020d808113d8 [file] [log] [blame]
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/bind/bind.gni")
import("//build/config/fuchsia/rules.gni")
import("//build/test.gni")
import("//src/sys/build/components.gni")
bind_rules("aml-cpu-bind") {
rules = "aml-cpu.bind"
output = "aml-cpu-bind.h"
tests = "bind-tests.json"
deps = [ "//src/devices/bind/fuchsia.google.platform" ]
}
driver_module("aml-cpu") {
configs += [
"//build/config:all_source",
"//build/config/fuchsia:enable_zircon_asserts",
]
if (is_fuchsia) {
configs += [ "//build/unification/config:zircon-migrated" ]
}
sources = [ "aml-cpu.cc" ]
deps = [
":aml-cpu-bind",
"//sdk/banjo/fuchsia.hardware.clock:fuchsia.hardware.clock_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.platform.device",
"//sdk/banjo/fuchsia.hardware.thermal",
"//sdk/fidl/fuchsia.device:fuchsia.device_llcpp",
"//sdk/fidl/fuchsia.hardware.cpu.ctrl:fuchsia.hardware.cpu.ctrl_llcpp",
"//src/devices/bus/lib/device-protocol-pdev",
"//src/devices/lib/amlogic",
"//src/devices/lib/driver",
"//src/devices/lib/mmio",
"//src/lib/ddk",
"//src/lib/ddktl",
"//zircon/public/lib/fbl",
"//zircon/public/lib/fidl",
"//zircon/public/lib/sync",
"//zircon/public/lib/zircon-internal",
"//zircon/public/lib/zx",
"//zircon/system/ulib/inspect",
]
}
test("aml-cpu-test-bin") {
configs += [ "//build/unification/config:zircon-migrated" ]
sources = [
"aml-cpu-test.cc",
"aml-cpu.cc",
]
output_name = "aml-cpu-test"
deps = [
":aml-cpu-bind",
"//sdk/banjo/fuchsia.hardware.clock:fuchsia.hardware.clock_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.clock:fuchsia.hardware.clock_banjo_cpp_mock",
"//sdk/banjo/fuchsia.hardware.platform.device",
"//sdk/banjo/fuchsia.hardware.power:fuchsia.hardware.power_mock",
"//sdk/banjo/fuchsia.hardware.thermal",
"//sdk/fidl/fuchsia.device:fuchsia.device_llcpp",
"//sdk/fidl/fuchsia.hardware.cpu.ctrl:fuchsia.hardware.cpu.ctrl_llcpp",
"//sdk/lib/inspect/testing/cpp:zxtest",
"//src/devices/bus/lib/device-protocol-pdev",
"//src/devices/lib/amlogic",
"//src/devices/lib/mmio",
"//src/devices/testing/fake_ddk",
"//src/lib/ddk",
"//src/lib/ddktl",
"//zircon/public/lib/fbl",
"//zircon/public/lib/fidl",
"//zircon/public/lib/mock-function",
"//zircon/public/lib/sync",
"//zircon/public/lib/zircon-internal",
"//zircon/public/lib/zx",
"//zircon/public/lib/zxtest",
]
# TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated.
# Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>).
# See linked bug for details.
configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ]
}
fuchsia_unittest_package("aml-cpu-test") {
deps = [ ":aml-cpu-test-bin" ]
test_specs = {
environments = basic_envs
}
}
group("tests") {
testonly = true
deps = [
":aml-cpu-bind_test",
":aml-cpu-test",
]
}