| # 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" |
| header_output = "ahci_bind.h" |
| tests = "tests.json" |
| deps = [ |
| "//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", |
| ] |
| deps = [ |
| ":shared", |
| "//src/devices/lib/driver", |
| ] |
| } |
| |
| fuchsia_driver_component("ahci") { |
| component_name = "ahci" |
| deps = [ ":ahci-driver" ] |
| info = "ahci-info.json" |
| colocate = true |
| } |
| |
| 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/banjo/fuchsia.hardware.block:fuchsia.hardware.block_banjo_cpp", |
| "//src/devices/lib/mmio", |
| "//src/devices/testing/fake-bti", |
| "//src/devices/testing/no_ddk", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/system/ulib/sync", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| fuchsia_unittest_package("ahci-unittest") { |
| deps = [ ":ahci-unittest-bin" ] |
| } |
| |
| 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/banjo/fuchsia.hardware.block:fuchsia.hardware.block_banjo_cpp", |
| "//src/devices/lib/mmio", |
| "//src/devices/pci/lib/device-protocol-pci", |
| "//src/devices/pci/lib/fuchsia.hardware.pci:fuchsia.hardware.pci_banjo_cpp", |
| "//src/devices/pci/lib/pci", |
| "//src/lib/ddk", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/sync", |
| "//zircon/system/ulib/zx", |
| ] |
| } |