blob: 177f4c687d1e0a691bb152d777da02520bf70b4a [file] [log] [blame]
# Copyright 2020 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_ram_bind") {
rules = "aml_ram.bind"
bind_output = "aml-ram.bindbc"
tests = "bind_tests.json"
deps = [
"//src/devices/bind/fuchsia.amlogic.platform",
"//src/devices/bind/fuchsia.platform",
]
}
fuchsia_driver("aml-ram-driver") {
output_name = "aml-ram"
configs += [
"//build/config:all_source",
"//build/config/fuchsia:enable_zircon_asserts",
]
sources = [
"aml-ram-hardware-test.cc",
"aml-ram.cc",
]
deps = [
":aml_ram_bind",
":common",
"//src/devices/lib/driver",
"//src/devices/lib/mmio",
]
}
fuchsia_driver_component("aml-ram") {
info = "aml-ram-info.json"
component_name = "aml-ram"
deps = [ ":aml-ram-driver" ]
manifest = "meta/aml-ram.cml"
}
fuchsia_driver_package("package") {
package_name = "aml-ram"
driver_components = [ ":aml-ram" ]
}
test("aml-ram-test-bin") {
output_name = "aml-ram-test"
sources = [
"aml-ram-test.cc",
"aml-ram.cc",
]
deps = [
":aml_ram_bind",
":common",
"//sdk/lib/async_patterns/testing/cpp",
"//sdk/lib/component/outgoing/cpp",
"//src/devices/bus/testing/fake-pdev",
"//src/devices/testing/fake-mmio-reg",
"//src/devices/testing/mock-ddk",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/mock-function",
]
}
group("common") {
public_deps = [
"//sdk/fidl/fuchsia.device:fuchsia.device_cpp",
"//sdk/fidl/fuchsia.hardware.ram.metrics:fuchsia.hardware.ram.metrics_cpp",
"//src/devices/bus/lib/device-protocol-pdev",
"//src/devices/lib/amlogic",
"//src/devices/lib/mmio",
"//src/lib/ddk",
"//src/lib/ddktl",
"//zircon/system/ulib/driver-unit-test",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/hwreg",
"//zircon/system/ulib/sync",
"//zircon/system/ulib/zircon-internal",
"//zircon/system/ulib/zx",
"//zircon/system/ulib/zxtest",
]
}
fuchsia_unittest_package("aml-ram-test") {
deps = [ ":aml-ram-test-bin" ]
test_specs = {
environments = basic_envs
log_settings = {
max_severity = "ERROR"
}
}
}
group("tests") {
testonly = true
deps = [
":aml-ram-test",
":aml_ram_bind_test",
]
}