| # 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("ahci_bind") { |
| rules = "ahci.bind" |
| tests = "tests.json" |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.pci:fuchsia.hardware.pci_bindlib", |
| "//sdk/fidl/fuchsia.hardware.sysmem:fuchsia.hardware.sysmem_bindlib", |
| "//src/devices/bind/fuchsia.acpi", |
| "//src/devices/bind/fuchsia.pci", |
| "//src/devices/bind/fuchsia.pci.massstorage", |
| ] |
| } |
| |
| fuchsia_driver("ahci-driver") { |
| output_name = "ahci" |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| sources = [ "export.cc" ] |
| deps = [ ":shared" ] |
| } |
| |
| fuchsia_driver_component("ahci") { |
| component_name = "ahci" |
| deps = [ ":ahci-driver" ] |
| info = "ahci-info.json" |
| manifest = "meta/ahci.cml" |
| } |
| |
| fuchsia_driver_package("package") { |
| package_name = "ahci" |
| driver_components = [ ":ahci" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":ahci-unittest", |
| ":ahci_bind_test", |
| ] |
| } |
| |
| test("ahci-unittest-bin") { |
| output_name = "ahci-unittest" |
| configs += [ "//build/config:all_source" ] |
| sources = [ |
| "test/fake-bus.cc", |
| "test/main.cc", |
| ] |
| deps = [ |
| ":shared", |
| "//sdk/fidl/fuchsia.hardware.block.driver:fuchsia.hardware.block.driver_banjo_cpp", |
| "//sdk/lib/async_patterns/testing/cpp", |
| "//sdk/lib/driver/testing/cpp:cpp", |
| "//sdk/lib/inspect/testing/cpp:zxtest", |
| "//src/devices/lib/mmio", |
| "//src/devices/testing/fake-bti", |
| "//zircon/system/ulib/sync:sync-cpp", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| fuchsia_unittest_package("ahci-unittest") { |
| deps = [ ":ahci-unittest-bin" ] |
| test_specs = { |
| log_settings = { |
| # PortTest.ShutdownWaitsForTransactionsInFlight tests timeout errors. |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| source_set("shared") { |
| visibility = [ "./*" ] |
| configs += [ "//build/config:all_source" ] |
| sources = [ |
| "bus.cc", |
| "controller.cc", |
| "pci-bus.cc", |
| "port.cc", |
| "sata.cc", |
| ] |
| deps = [ |
| ":ahci_bind", |
| "//sdk/fidl/fuchsia.hardware.pci:fuchsia.hardware.pci_cpp", |
| "//src/devices/bin/driver_runtime", |
| "//src/devices/block/lib/common:common", |
| "//zircon/system/ulib/sync:sync-cpp", |
| "//zircon/system/ulib/zx", |
| ] |
| public_deps = [ |
| "//sdk/fidl/fuchsia.hardware.block.driver:fuchsia.hardware.block.driver_banjo_cpp", |
| "//sdk/lib/driver/compat/cpp", |
| "//sdk/lib/driver/runtime:driver_runtime_cpp", |
| "//sdk/lib/inspect/component/cpp", |
| "//src/devices/lib/dma-buffer", |
| "//src/devices/lib/mmio", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/inspect", |
| ] |
| } |