| # Copyright 2023 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("a1_usb_phy_bind") { |
| rules = "a1_usb_phy.bind" |
| bind_output = "a1-usb-phy.bindbc" |
| tests = "test_bind.json" |
| deps = [ |
| "//src/devices/bind/fuchsia.amlogic.platform", |
| "//src/devices/bind/fuchsia.platform", |
| ] |
| } |
| |
| fuchsia_driver("a1-usb-phy-driver") { |
| output_name = "a1-usb-phy" |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| sources = [ "a1-usb-phy.cc" ] |
| deps = [ |
| ":a1_usb_phy_bind", |
| "//sdk/banjo/fuchsia.hardware.usb.phy:fuchsia.hardware.usb.phy_banjo_cpp", |
| "//src/devices/bus/lib/device-protocol-pdev", |
| "//src/devices/lib/amlogic", |
| "//src/devices/lib/driver", |
| "//src/devices/lib/mmio", |
| "//src/devices/usb/lib/usb", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/hwreg", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| fuchsia_driver_component("a1-usb-phy") { |
| info = "a1-usb-phy-info.json" |
| component_name = "a1-usb-phy" |
| deps = [ ":a1-usb-phy-driver" ] |
| manifest = "meta/a1-usb-phy.cml" |
| } |
| |
| test("a1-usb-phy-test-bin") { |
| configs += [ "//build/config:all_source" ] |
| sources = [ |
| "a1-usb-phy-test.cc", |
| "a1-usb-phy.cc", |
| ] |
| output_name = "a1-usb-phy-test" |
| deps = [ |
| ":a1_usb_phy_bind", |
| "//sdk/banjo/fuchsia.hardware.usb:fuchsia.hardware.usb_banjo_cpp", |
| "//sdk/banjo/fuchsia.hardware.usb.phy:fuchsia.hardware.usb.phy_banjo_cpp", |
| "//sdk/banjo/fuchsia.hardware.usb.request:fuchsia.hardware.usb.request_banjo_cpp", |
| "//sdk/lib/async_patterns/testing/cpp", |
| "//sdk/lib/component/outgoing/cpp", |
| "//src/devices/bus/lib/device-protocol-pdev", |
| "//src/devices/bus/testing/fake-pdev", |
| "//src/devices/lib/amlogic", |
| "//src/devices/lib/driver", |
| "//src/devices/lib/mmio", |
| "//src/devices/testing/fake-mmio-reg", |
| "//src/devices/testing/fake-resource", |
| "//src/devices/testing/mock-ddk", |
| "//src/devices/usb/lib/usb", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/hwreg", |
| "//zircon/system/ulib/pretty", |
| "//zircon/system/ulib/sync", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| fuchsia_unittest_package("a1-usb-phy-test") { |
| deps = [ ":a1-usb-phy-test-bin" ] |
| test_specs = { |
| environments = basic_envs |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":a1-usb-phy-test", |
| ":a1_usb_phy_bind_test", |
| ] |
| } |