blob: 31b629728259e6508ca89f547d3820c8374a0775 [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")
driver_bind_rules("dwc2_bind") {
rules = "dwc2.bind"
header_output = "dwc2_bind.h"
bind_output = "dwc2.bindbc"
tests = "tests.json"
deps = [
"//src/devices/bind/fuchsia.designware.platform",
"//src/devices/bind/fuchsia.platform",
]
}
fuchsia_driver("dwc2-driver") {
output_name = "dwc2"
configs += [
"//build/config:all_source",
"//build/config/fuchsia:enable_zircon_asserts",
]
sources = [ "dwc2.cc" ]
deps = [
":dwc2_bind",
"//sdk/banjo/fuchsia.hardware.platform.device:fuchsia.hardware.platform.device_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.usb:fuchsia.hardware.usb_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.usb.dci:fuchsia.hardware.usb.dci_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/fit",
"//src/devices/bus/lib/device-protocol-pdev",
"//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/pretty",
"//zircon/system/ulib/sync",
"//zircon/system/ulib/zx",
]
}
fuchsia_driver_component("dwc2") {
info = "dwc2-info.json"
component_name = "dwc2"
deps = [ ":dwc2-driver" ]
colocate = true
}
test("dwc2-test-bin") {
configs += [ "//build/config:all_source" ]
sources = [
"dwc2-test.cc",
"dwc2.cc",
]
output_name = "dwc2-test"
deps = [
":dwc2_bind",
"//sdk/banjo/fuchsia.hardware.platform.device:fuchsia.hardware.platform.device_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.usb:fuchsia.hardware.usb_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.usb.dci:fuchsia.hardware.usb.dci_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",
"//src/devices/bus/lib/device-protocol-pdev",
"//src/devices/lib/driver",
"//src/devices/lib/mmio",
"//src/devices/testing/mock-ddk",
"//src/devices/usb/lib/usb",
"//src/lib/ddk",
"//src/lib/ddktl",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/hwreg",
"//zircon/system/ulib/pretty",
"//zircon/system/ulib/sync",
"//zircon/system/ulib/zxtest",
]
}
fuchsia_unittest_package("dwc2-test") {
deps = [ ":dwc2-test-bin" ]
test_specs = {
environments = basic_envs
}
}
group("tests") {
testonly = true
deps = [
":dwc2-test",
":dwc2_bind_test",
]
}