| # 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("sdmmc-bind") { |
| rules = "sdmmc.bind" |
| output = "sdmmc-bind.h" |
| tests = "sdmmc-bind-test.json" |
| deps = [ "//src/devices/bind/fuchsia.sdmmc" ] |
| } |
| |
| driver_module("sdmmc") { |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| sources = [ |
| "mmc.cc", |
| "sd.cc", |
| "sdio-controller-device.cc", |
| "sdio-function-device.cc", |
| "sdmmc-block-device.cc", |
| "sdmmc-device.cc", |
| "sdmmc-root-device.cc", |
| ] |
| deps = [ |
| ":sdmmc-bind", |
| "//sdk/banjo/fuchsia.hardware.block", |
| "//sdk/banjo/fuchsia.hardware.block.partition", |
| "//sdk/banjo/fuchsia.hardware.platform.device:fuchsia.hardware.platform.device_banjo_cpp", |
| "//sdk/banjo/fuchsia.hardware.rpmb", |
| "//sdk/banjo/fuchsia.hardware.sdio", |
| "//sdk/banjo/fuchsia.hardware.sdmmc", |
| "//sdk/fidl/fuchsia.hardware.rpmb:fuchsia.hardware.rpmb_llcpp", |
| "//sdk/fidl/fuchsia.hardware.sdio:fuchsia.hardware.sdio_llcpp", |
| "//sdk/lib/fdio", |
| "//src/devices/block/lib/sdio", |
| "//src/devices/block/lib/sdmmc", |
| "//src/devices/lib/dev-operation", |
| "//src/devices/lib/driver", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/public/lib/pretty", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/public/lib/zx", |
| "//zircon/public/lib/zxc", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fidl-async:fidl-async-cpp", |
| "//zircon/system/ulib/fzl", |
| "//zircon/system/ulib/trace:trace-driver", |
| ] |
| |
| # TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated. |
| # Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>). |
| # See linked bug for details. |
| configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ] |
| } |
| |
| test("sdmmc-test-bin") { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| output_name = "sdmmc-test" |
| configs += [ "//build/config:all_source" ] |
| sources = [ |
| "fake-sdmmc-device.cc", |
| "mmc.cc", |
| "sd.cc", |
| "sdio-controller-device-test.cc", |
| "sdio-controller-device.cc", |
| "sdio-function-device.cc", |
| "sdmmc-block-device-test.cc", |
| "sdmmc-block-device.cc", |
| "sdmmc-device.cc", |
| ] |
| deps = [ |
| ":sdmmc-bind", |
| "//sdk/banjo/fuchsia.hardware.block", |
| "//sdk/banjo/fuchsia.hardware.block.partition", |
| "//sdk/banjo/fuchsia.hardware.platform.device:fuchsia.hardware.platform.device_banjo_cpp", |
| "//sdk/banjo/fuchsia.hardware.rpmb", |
| "//sdk/banjo/fuchsia.hardware.sdio", |
| "//sdk/banjo/fuchsia.hardware.sdmmc", |
| "//sdk/fidl/fuchsia.hardware.rpmb:fuchsia.hardware.rpmb_llcpp", |
| "//sdk/fidl/fuchsia.hardware.sdio:fuchsia.hardware.sdio_llcpp", |
| "//src/devices/block/lib/sdio", |
| "//src/devices/block/lib/sdmmc", |
| "//src/devices/lib/dev-operation", |
| "//src/devices/testing/fake_ddk", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//src/lib/vmo_store", |
| "//zircon/public/lib/mock-function", |
| "//zircon/public/lib/pretty", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/public/lib/zx", |
| "//zircon/public/lib/zxc", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fidl-async:fidl-async-cpp", |
| "//zircon/system/ulib/fzl", |
| "//zircon/system/ulib/trace:trace-driver", |
| ] |
| |
| # TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated. |
| # Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>). |
| # See linked bug for details. |
| configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ] |
| } |
| |
| fuchsia_unittest_package("sdmmc-test") { |
| deps = [ ":sdmmc-test-bin" ] |
| test_specs = { |
| environments = basic_envs |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":sdmmc-bind_test", |
| ":sdmmc-test", |
| ] |
| } |