blob: 8930d2f35299d67d0ae213698faf0a87ff5460c9 [file]
# 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("$zx/kernel/params.gni")
group("pci") {
deps = [
":bus-pci",
":bus-pci.proxy",
]
}
# The userspace PCI bus driver uses this set, as well as the
# automated tests.
source_set("user_pci") {
visibility = [
":*",
"test/:*",
]
sources = [
"allocation.cc",
"bridge.cc",
"bus.cc",
"capabilities.cc",
"config.cc",
"device.cc",
"device_caps.cc",
"device_protocol.cc",
"upstream_node.cc",
]
public_deps = [
"$zx/system/banjo/ddk.protocol.pci",
"$zx/system/banjo/ddk.protocol.pciroot",
"$zx/system/ulib/ddk",
"$zx/system/ulib/ddktl",
"$zx/system/ulib/fbl",
"$zx/system/ulib/hwreg",
"$zx/system/ulib/pretty",
"$zx/system/ulib/region-alloc",
"$zx/system/ulib/zircon",
"$zx/system/ulib/zircon-internal",
"$zx/system/ulib/zx",
# TODO(ZX-4062): This shouldn't be here if the mmio code is actually
# used in the test too. Anything using that needs to be separately
# compiled for the test using the mock version.
"$zx/system/dev/lib/mmio",
]
}
source_set("user_pci.proxy") {
sources = [ "device_proxy.cc" ]
public_deps = [
"$zx/system/banjo/ddk.protocol.pci",
"$zx/system/ulib/ddk",
"$zx/system/ulib/ddktl",
"$zx/system/ulib/hwreg",
"$zx/system/ulib/pretty",
]
}
if (enable_user_pci) {
zx_driver("bus-pci") {
sources = [
# The driver needs bind glue, unlike tests.
"bind.cc",
]
deps = [ ":user_pci" ]
}
zx_driver("bus-pci.proxy") {
deps = [ ":user_pci.proxy" ]
}
} else {
zx_driver("bus-pci") {
sources = [ "kpci/kpci.c" ]
deps = [
"$zx/system/banjo/ddk.protocol.pci",
"$zx/system/banjo/ddk.protocol.pciroot",
"$zx/system/banjo/ddk.protocol.platform.device",
"$zx/system/banjo/ddk.protocol.sysmem",
"$zx/system/ulib/ddk",
"$zx/system/ulib/fidl",
"$zx/system/ulib/zircon",
]
}
zx_driver("bus-pci.proxy") {
sources = [ "kpci/proxy.c" ]
deps = [
"$zx/system/banjo/ddk.protocol.pci",
"$zx/system/banjo/ddk.protocol.pciroot",
"$zx/system/banjo/ddk.protocol.platform.device",
"$zx/system/banjo/ddk.protocol.sysmem",
"$zx/system/ulib/ddk",
"$zx/system/ulib/zircon",
]
}
}