| # Copyright 2022 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/bazel/drivers/bazel_driver_package.gni") |
| import("//build/bazel/wrappers.gni") |
| import("//build/bind/bind.gni") |
| import("//build/components.gni") |
| import("//build/drivers.gni") |
| import("//build/test.gni") |
| |
| driver_bind_rules("aml_usb_phy_bind") { |
| rules = "aml_usb_phy.bind" |
| bind_output = "aml-usb-phy.bindbc" |
| tests = "test_bind.json" |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.registers:fuchsia.hardware.registers_bindlib", |
| "//src/devices/bind/fuchsia.amlogic.platform", |
| "//src/devices/bind/fuchsia.clock", |
| "//src/devices/bind/fuchsia.devicetree", |
| "//src/devices/bind/fuchsia.gpio", |
| "//src/devices/bind/fuchsia.platform", |
| ] |
| } |
| |
| bazel_fuchsia_test_package("aml-usb-phy-test-package") { |
| test_package_name = "aml-usb-phy-test" |
| test_component_names = [ "aml-usb-phy-test-bin" ] |
| test_specs = { |
| environments = basic_envs |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| inputs = [ |
| "aml-usb-phy.cc", |
| "aml-usb-phy.h", |
| "aml-usb-phy-device.cc", |
| "aml-usb-phy-device.h", |
| "aml-usb-phy-test.cc", |
| "power-regs.h", |
| "usb-phy-base.h", |
| "usb-phy-regs.h", |
| "usb-phy2.cc", |
| "usb-phy2.h", |
| "usb-phy2-regs.h", |
| "usb-phy3.cc", |
| "usb-phy3.h", |
| "usb-phy3-regs.h", |
| ] |
| } |
| |
| bazel_driver_package("bazel_package") { |
| bazel_target = "//src/devices/usb/drivers/aml-usb-phy:aml-usb-phy" |
| package_name = "aml-usb-phy" |
| inputs = [ |
| "aml-usb-phy.cc", |
| "aml-usb-phy.h", |
| "aml-usb-phy-device.cc", |
| "aml-usb-phy-device.h", |
| "power-regs.h", |
| "usb-phy-base.h", |
| "usb-phy-regs.h", |
| "usb-phy2.cc", |
| "usb-phy2.h", |
| "usb-phy2-regs.h", |
| "usb-phy3.cc", |
| "usb-phy3.h", |
| "usb-phy3-regs.h", |
| ] |
| } |
| |
| source_set("common") { |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| sources = [ |
| "aml-usb-phy-device.cc", |
| "aml-usb-phy.cc", |
| "usb-phy2.cc", |
| "usb-phy3.cc", |
| ] |
| public_deps = [ |
| ":aml_usb_phy_bind", |
| "//sdk/fidl/fuchsia.driver.compat:fuchsia.driver.compat_cpp", |
| "//sdk/fidl/fuchsia.hardware.platform.device:fuchsia.hardware.platform.device_cpp", |
| "//sdk/fidl/fuchsia.hardware.registers:fuchsia.hardware.registers_cpp", |
| "//sdk/fidl/fuchsia.hardware.usb.phy:fuchsia.hardware.usb.phy_cpp", |
| "//sdk/lib/driver/compat/cpp", |
| "//sdk/lib/driver/component/cpp:cpp", |
| "//src/devices/bind/fuchsia:fuchsia_cpp", |
| "//src/devices/bind/fuchsia.amlogic.platform:fuchsia.amlogic.platform_cpp", |
| "//src/devices/bind/fuchsia.platform:fuchsia.platform_cpp", |
| "//src/devices/lib/amlogic", |
| "//src/devices/lib/mmio", |
| "//src/lib/ddk:ddk_metadata", |
| "//zircon/system/ulib/ddk-platform-defs", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/hwreg", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| fuchsia_driver("aml-usb-phy-driver") { |
| output_name = "aml-usb-phy" |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| deps = [ |
| ":common", |
| "//src/devices/lib/driver:driver_runtime", |
| ] |
| } |
| |
| fuchsia_driver_component("aml-usb-phy") { |
| info = "aml-usb-phy-info.json" |
| component_name = "aml-usb-phy" |
| deps = [ ":aml-usb-phy-driver" ] |
| manifest = "meta/aml-usb-phy.cml" |
| } |
| |
| fuchsia_driver_package("package") { |
| package_name = "aml-usb-phy" |
| driver_components = [ ":aml-usb-phy" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":aml-usb-phy-test-package", |
| ":aml_usb_phy_bind_test", |
| ] |
| } |