| # 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("//build/fuzzing/fuzzer.gni") |
| import("//build/test.gni") |
| import("//build/test/test_package.gni") |
| import("//build/unification/firmware.gni") |
| |
| # All non-test targets. |
| group("controller") { |
| deps = [ ":intel-hda" ] |
| } |
| |
| # All test targets. |
| group("test") { |
| testonly = true |
| deps = [ |
| ":controller_test", |
| ":nhlt-fuzzer", |
| ] |
| } |
| |
| source_set("src") { |
| visibility = [ ":*" ] |
| sources = [ |
| "binary_decoder.h", |
| "codec-cmd-job.cc", |
| "codec-cmd-job.h", |
| "codec-connection.cc", |
| "codec-connection.h", |
| "debug-logging.h", |
| "device-ids.h", |
| "intel-dsp-code-loader.cc", |
| "intel-dsp-code-loader.h", |
| "intel-dsp-debug.cc", |
| "intel-dsp-ipc.cc", |
| "intel-dsp-ipc.h", |
| "intel-dsp-modules.cc", |
| "intel-dsp-modules.h", |
| "intel-dsp-stream.cc", |
| "intel-dsp-stream.h", |
| "intel-dsp-topology.cc", |
| "intel-dsp-topology.h", |
| "intel-dsp.cc", |
| "intel-dsp.h", |
| "intel-hda-controller-init.cc", |
| "intel-hda-controller.cc", |
| "intel-hda-controller.h", |
| "intel-hda-debug.cc", |
| "intel-hda-irq.cc", |
| "intel-hda-stream.cc", |
| "intel-hda-stream.h", |
| "nhlt.cc", |
| "nhlt.h", |
| "utils.cc", |
| "utils.h", |
| ] |
| deps = [ |
| "//sdk/banjo/ddk.protocol.intelhda.codec", |
| "//src/devices/lib/driver", |
| "//zircon/system/ulib/audio-driver-proto", |
| "//zircon/system/ulib/audio-proto-utils", |
| "//zircon/system/ulib/dispatcher-pool", |
| ] |
| public_deps = [ |
| "//sdk/banjo/ddk.protocol.pci", |
| "//sdk/fidl/fuchsia.hardware.intel.hda:fuchsia.hardware.intel.hda_c", |
| "//src/lib/ddk", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/fit", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/fzl", |
| "//zircon/system/ulib/intel-hda", |
| "//zircon/system/ulib/refcount", |
| ] |
| } |
| |
| driver_module("intel-hda") { |
| defines = [ "_ALL_SOURCE" ] |
| configs += [ "//build/config/fuchsia:enable_zircon_asserts" ] |
| configs -= [ "//build/config/fuchsia:no_cpp_standard_library" ] |
| configs += [ "//build/config/fuchsia:static_cpp_standard_library" ] |
| if (is_fuchsia) { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| } |
| deps = [ ":src" ] |
| data_deps = [ ":firmware" ] |
| } |
| |
| test("controller_test") { |
| if (is_fuchsia) { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| } |
| if (is_fuchsia) { |
| fdio_config = [ "//build/config/fuchsia:fdio_config" ] |
| if (configs + fdio_config - fdio_config != configs) { |
| configs -= fdio_config |
| } |
| } |
| output_name = "intel-hda-controller-test" |
| sources = [ |
| "binary_decoder_test.cc", |
| "intel-dsp-ipc-test.cc", |
| "intel-dsp-modules-test.cc", |
| "nhlt_test.cc", |
| ] |
| deps = [ |
| ":src", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/fdio", |
| "//zircon/public/lib/zx", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/intel-hda", |
| ] |
| } |
| |
| # Fuzz testing for NHLT parsing. |
| # |
| # Name needs to end with "-fuzzer" to be included in the Zircon fuzz test package. |
| fuzzer("nhlt-fuzzer") { |
| sources = [ "nhlt_fuzzer.cc" ] |
| deps = [ |
| ":src", |
| "//zircon/public/lib/fbl", |
| ] |
| |
| # TODO(47959): Fix the leaks and remove this. |
| deps += [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ] |
| } |
| |
| firmware("firmware") { |
| sources = [ "intel-adsp-sst/dsp_fw_kbl_v3420.bin" ] |
| } |
| |
| unittest_package("intel-hda-controller-test") { |
| deps = [ ":controller_test" ] |
| |
| tests = [ |
| { |
| name = "intel-hda-controller-test" |
| environments = basic_envs |
| }, |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":intel-hda-controller-test" ] |
| } |