blob: 832118503a88c4df827ab5f167c5aea6847eee43 [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/components.gni")
import("//build/drivers.gni")
import("//build/test.gni")
driver_bind_rules("aml-cpu-bind") {
rules = "aml-cpu.bind"
bind_output = "aml-cpu.bindbc"
tests = "bind-tests.json"
deps = [
"//sdk/fidl/fuchsia.hardware.clock:fuchsia.hardware.clock_bindlib",
"//sdk/fidl/fuchsia.hardware.power:fuchsia.hardware.power_bindlib",
"//src/devices/bind/fuchsia.amlogic.platform",
"//src/devices/bind/fuchsia.clock",
"//src/devices/bind/fuchsia.google.platform",
"//src/devices/bind/fuchsia.gpio",
"//src/devices/bind/fuchsia.platform",
"//src/devices/bind/fuchsia.power",
]
}
fuchsia_driver("aml-cpu-driver") {
output_name = "aml-cpu"
configs += [
"//build/config:all_source",
"//build/config/fuchsia:enable_zircon_asserts",
]
sources = [
"aml-cpu-driver.cc",
"aml-cpu.cc",
]
deps = [
"//sdk/fidl/fuchsia.device:fuchsia.device_cpp",
"//sdk/fidl/fuchsia.hardware.clock:fuchsia.hardware.clock_cpp",
"//sdk/fidl/fuchsia.hardware.cpu.ctrl:fuchsia.hardware.cpu.ctrl_cpp",
"//sdk/lib/driver/compat/cpp",
"//src/devices/bus/lib/device-protocol-pdev",
"//src/devices/lib/amlogic",
]
}
fuchsia_driver_component("aml-cpu") {
deps = [
":aml-cpu-bind",
":aml-cpu-driver",
]
manifest = "meta/aml-cpu.cml"
info = "aml-cpu-info.json"
}
fuchsia_driver_package("package") {
package_name = "aml-cpu"
driver_components = [ ":aml-cpu" ]
}
test("aml-cpu-test-bin") {
sources = [
"aml-cpu-driver.cc",
"aml-cpu-test.cc",
"aml-cpu.cc",
]
output_name = "aml-cpu-test"
deps = [
"//sdk/fidl/fuchsia.device:fuchsia.device_cpp",
"//sdk/fidl/fuchsia.hardware.clock:fuchsia.hardware.clock_cpp",
"//sdk/fidl/fuchsia.hardware.cpu.ctrl:fuchsia.hardware.cpu.ctrl_cpp",
"//sdk/lib/driver/compat/cpp",
"//sdk/lib/driver/testing/cpp:gtest_fixture",
"//sdk/lib/inspect/testing/cpp",
"//src/devices/bus/lib/device-protocol-pdev",
"//src/devices/bus/testing/fake-pdev",
"//src/devices/lib/amlogic",
"//src/devices/testing/fake-mmio-reg",
"//src/lib/fxl/test:gtest_main",
"//src/lib/testing/predicates",
"//zircon/system/ulib/fbl",
]
}
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",
]
}