blob: 9a77deff0397ebb2599d792f3654974fb3335ab4 [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")
group("tests") {
testonly = true
deps = [
":aml-uart-test",
":aml_uart_bind_test",
]
}
driver_bind_rules("aml_uart_bind") {
rules = "meta/aml_uart.bind"
bind_output = "aml-uart.bindbc"
tests = "meta/bind_tests.json"
deps = [
"//src/devices/bind/fuchsia.amlogic.platform",
"//src/devices/bind/fuchsia.devicetree",
"//src/devices/bind/fuchsia.gpio",
"//src/devices/bind/fuchsia.platform",
"//src/devices/bind/fuchsia.pwm",
]
}
source_set("aml-uart-source") {
configs += [ "//build/config/fuchsia:enable_zircon_asserts" ]
sources = [
"aml-uart-dfv2.cc",
"aml-uart-dfv2.h",
"aml-uart.cc",
"aml-uart.h",
"registers.h",
]
deps = [ "//src/devices/lib/driver:driver_runtime" ]
public_deps = [
":aml-uart-config",
"//sdk/fidl/fuchsia.boot.metadata:fuchsia.boot.metadata_cpp",
"//sdk/fidl/fuchsia.hardware.power:fuchsia.hardware.power_cpp",
"//sdk/fidl/fuchsia.hardware.serialimpl:fuchsia.hardware.serialimpl_cpp",
"//sdk/lib/async:async-cpp",
"//sdk/lib/driver/component/cpp",
"//sdk/lib/driver/metadata/cpp",
"//sdk/lib/driver/mmio/cpp",
"//sdk/lib/driver/platform-device/cpp",
"//sdk/lib/driver/power/cpp",
"//src/devices/bind/fuchsia:fuchsia_cpp",
"//src/devices/bind/fuchsia.serial:fuchsia.serial_cpp",
"//src/lib/ddk",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/hwreg",
"//zircon/system/ulib/zircon-internal",
]
}
fuchsia_cc_driver("aml-uart-driver") {
output_name = "aml-uart"
deps = [ ":aml-uart-source" ]
}
fuchsia_component_manifest("aml-uart-manifest") {
component_name = "aml-uart"
manifest = "meta/aml-uart.cml"
}
fuchsia_driver_component("aml-uart") {
cm_label = ":aml-uart-manifest"
info = "meta/aml-uart-info.json"
deps = [
":aml-uart-driver",
":aml_uart_bind",
]
}
fuchsia_structured_config_cpp_elf_lib("aml-uart-config") {
cm_label = ":aml-uart-manifest"
}
fuchsia_structured_config_values("sc-values") {
cm_label = ":aml-uart-manifest"
values = {
enable_suspend = true
}
}
fuchsia_driver_package("package") {
package_name = "aml-uart"
export_to_bazel = true
driver_components = [ ":aml-uart" ]
deps = [ ":sc-values" ]
}
test("aml-uart-test-bin") {
output_name = "aml-uart-test"
sources = [
"tests/aml-uart-test.cc",
"tests/device_state.h",
]
deps = [
":aml-uart-source",
"//sdk/fidl/fuchsia.hardware.serial:fuchsia.hardware.serial_cpp",
"//sdk/fidl/fuchsia.power.system:fuchsia.power.system_cpp",
"//sdk/lib/driver/fake-platform-device/cpp",
"//sdk/lib/driver/power/cpp/testing",
"//sdk/lib/driver/testing/cpp",
"//src/devices/bind/fuchsia.broadcom.platform:fuchsia.broadcom.platform_cpp",
"//src/devices/testing/fake-mmio-reg",
"//src/lib/ddk", # needed for metadata.h
"//src/lib/fxl/test:gtest_main",
]
}
fuchsia_unittest_package("aml-uart-test") {
deps = [ ":aml-uart-test-bin" ]
test_specs = {
environments = basic_envs
log_settings = {
max_severity = "ERROR"
}
}
}