| # 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/config/fuchsia/rules.gni") |
| import("pci.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_irqs.cc", |
| "device_protocol.cc", |
| "service.cc", |
| "upstream_node.cc", |
| ] |
| public_deps = [ |
| "//sdk/banjo/ddk.protocol.pci", |
| "//sdk/banjo/ddk.protocol.pciroot", |
| "//sdk/fidl/fuchsia.hardware.pci:fuchsia.hardware.pci_llcpp", |
| "//src/devices/lib/driver", |
| "//src/lib/ddk", |
| |
| # TODO(fxb/38132): Migrate to the new bind rules and delete the below |
| "//src/lib/ddk:ddk-deprecated-binding-headers", |
| "//src/lib/ddktl", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/hwreg", |
| "//zircon/public/lib/pretty", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/public/lib/zx", |
| "//zircon/public/lib/zxc", |
| "//zircon/system/ulib/region-alloc", |
| |
| # TODO(fxbug.dev/33846): 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. |
| "//src/devices/lib/mmio", |
| ] |
| } |
| |
| source_set("user_pci.proxy") { |
| sources = [ "device_proxy.cc" ] |
| public_deps = [ |
| "//sdk/banjo/ddk.protocol.pci", |
| "//sdk/banjo/ddk.protocol.sysmem", |
| "//src/devices/lib/driver", |
| "//src/lib/ddk", |
| |
| # TODO(fxb/38132): Migrate to the new bind rules and delete the below |
| "//src/lib/ddk:ddk-deprecated-binding-headers", |
| "//src/lib/ddktl", |
| "//zircon/public/lib/hwreg", |
| "//zircon/public/lib/pretty", |
| ] |
| } |
| |
| if (platform_enable_user_pci) { |
| driver_module("bus-pci") { |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| if (is_fuchsia) { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| } |
| sources = [ |
| # The driver needs bind glue, unlike tests. |
| "bind.cc", |
| ] |
| deps = [ ":user_pci" ] |
| } |
| |
| driver_module("bus-pci.proxy") { |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| if (is_fuchsia) { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| } |
| deps = [ ":user_pci.proxy" ] |
| } |
| } else { |
| driver_module("bus-pci") { |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| if (is_fuchsia) { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| } |
| sources = [ "kpci/kpci.c" ] |
| deps = [ |
| "//sdk/banjo/ddk.protocol.pci", |
| "//sdk/banjo/ddk.protocol.pciroot", |
| "//sdk/banjo/ddk.protocol.platform.device", |
| "//sdk/banjo/ddk.protocol.sysmem", |
| "//src/devices/lib/driver", |
| "//src/lib/ddk", |
| |
| # TODO(fxb/38132): Migrate to the new bind rules and delete the below |
| "//src/lib/ddk:ddk-deprecated-binding-headers", |
| "//src/lib/ddktl", |
| "//zircon/public/lib/fidl", |
| ] |
| } |
| |
| driver_module("bus-pci.proxy") { |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| if (is_fuchsia) { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| } |
| sources = [ "kpci/proxy.c" ] |
| deps = [ |
| "//sdk/banjo/ddk.protocol.pci", |
| "//sdk/banjo/ddk.protocol.pciroot", |
| "//sdk/banjo/ddk.protocol.platform.device", |
| "//sdk/banjo/ddk.protocol.sysmem", |
| "//src/devices/lib/driver", |
| "//src/lib/ddk", |
| |
| # TODO(fxb/38132): Migrate to the new bind rules and delete the below |
| "//src/lib/ddk:ddk-deprecated-binding-headers", |
| "//src/lib/ddktl", |
| ] |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| "test:pci-driver-test", |
| "test:pci-unit-test", |
| ] |
| } |