| # 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/config/fuchsia/rules.gni") |
| import("//build/test.gni") |
| import("//src/sys/build/components.gni") |
| |
| bind_rules("registers_bind") { |
| rules = "registers.bind" |
| output = "registers-bind.h" |
| tests = "tests.json" |
| deps = [ "//src/devices/bind/fuchsia.platform" ] |
| } |
| |
| driver_module("registers") { |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| "//build/unification/config:zircon-migrated", |
| ] |
| sources = [ "registers.cc" ] |
| deps = [ |
| ":common", |
| ":registers_bind", |
| "//src/devices/lib/driver", |
| |
| #"//zircon/system/banjo/ddk.protocol.platform.device", |
| ] |
| } |
| |
| test("registers-test") { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| output_name = "registers-test" |
| sources = [ |
| "registers-test.cc", |
| "registers.cc", |
| ] |
| deps = [ |
| ":common", |
| ":registers_bind", |
| "//src/devices/testing/fake_ddk", |
| "//src/devices/testing/mock-mmio-reg", |
| "//zircon/public/lib/zx", |
| "//zircon/public/lib/zxtest", |
| ] |
| } |
| |
| group("common") { |
| public_deps = [ |
| "//sdk/banjo/ddk.protocol.platform.bus", |
| "//sdk/banjo/ddk.protocol.registers", |
| "//sdk/fidl/fuchsia.hardware.registers:fuchsia.hardware.registers_llcpp", |
| "//src/devices/bus/lib/device-protocol-pdev", |
| "//src/devices/lib/amlogic", |
| "//src/devices/lib/metadata:llcpp", |
| "//src/devices/lib/mmio", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/hwreg", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/public/lib/zxc", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fidl-async:fidl-async-cpp", |
| ] |
| } |
| |
| fuchsia_unittest_package("registers-test-package") { |
| package_name = "registers-test" |
| executable_path = "test/registers-test" |
| deps = [ ":registers-test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":registers-test-package", |
| ":registers_bind_test", |
| ] |
| } |