| # 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/config/fuchsia/rules.gni") |
| import("//build/test.gni") |
| import("//src/sys/build/components.gni") |
| |
| bind_rules("ahci_bind") { |
| rules = "ahci.bind" |
| output = "ahci_bind.h" |
| tests = "tests.json" |
| deps = [ |
| "//src/devices/bind/fuchsia.pci", |
| "//src/devices/bind/fuchsia.pci.mass_storage", |
| ] |
| } |
| driver_module("ahci") { |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| deps = [ |
| ":shared", |
| "//src/devices/lib/driver", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":ahci-unittest", |
| ":ahci_bind_test", |
| ] |
| } |
| |
| test("ahci-unittest-bin") { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| output_name = "ahci-unittest" |
| configs += [ "//build/config:all_source" ] |
| sources = [ |
| "test/fake-bus.cc", |
| "test/main.cc", |
| ] |
| deps = [ |
| ":shared", |
| "//sdk/banjo/fuchsia.hardware.block", |
| "//src/devices/testing/fake-bti", |
| "//src/devices/testing/no_ddk", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/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", |
| "//sdk/banjo/fuchsia.hardware.pci", |
| "//src/devices/lib/mmio", |
| "//src/devices/pci/lib/device-protocol-pci", |
| "//src/lib/ddk", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/zx", |
| ] |
| } |