| # 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") |
| import("//build/testing/bootfs_test.gni") |
| import("//src/devices/bus/drivers/pci/pci.gni") |
| |
| group("x86") { |
| deps = [ ":platform-bus-x86" ] |
| } |
| |
| config("config") { |
| visibility = [ ":*" ] |
| |
| include_dirs = [ |
| "include", |
| ".", |
| ] |
| |
| if (platform_enable_user_pci) { |
| defines = [ "ENABLE_USER_PCI" ] |
| } |
| |
| cflags = [ "-Wno-null-pointer-arithmetic" ] |
| cflags_c = [ "-fno-strict-aliasing" ] |
| } |
| |
| driver_bind_rules("x64-bind") { |
| rules = "x64.bind" |
| bind_output = "platform-bus-x64.bindbc" |
| tests = "bind-tests.json" |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.platform.bus:fuchsia.hardware.platform.bus_bindlib", |
| "//src/devices/bind/fuchsia.intel.platform", |
| ] |
| } |
| |
| fuchsia_driver("platform-bus-x86-driver") { |
| output_name = "platform-bus-x86" |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| |
| sources = [ |
| "acpi-dev/dev-ec.cc", |
| "acpi-nswalk.cc", |
| "debug.cc", |
| "goldfish-control.cc", |
| "init.cc", |
| "iommu-driver-tests.cc", |
| "methods.cc", |
| "power.cc", |
| "sysmem.cc", |
| "x86-driver-tests.cc", |
| "x86.cc", |
| "x86.h", |
| ] |
| |
| # Userspace PCI feature flag. The scaffolding for the userspace pci bus |
| # driver is in pci.cpp. If not enabled then the kernel pci bus driver |
| # initialization code in ACPI (kpci.cc) will be built instead. |
| if (!platform_enable_user_pci) { |
| sources += [ "kpci.cc" ] |
| } |
| configs += [ ":config" ] |
| deps = [ |
| ":x64-bind", |
| ":x86-config", |
| "//sdk/banjo/fuchsia.hardware.hidbus:fuchsia.hardware.hidbus_banjo_cpp", |
| "//sdk/banjo/fuchsia.hardware.pciroot:fuchsia.hardware.pciroot_banjo_cpp", |
| "//sdk/fidl/fuchsia.acpi.tables:fuchsia.acpi.tables_cpp", |
| "//sdk/fidl/fuchsia.hardware.acpi:fuchsia.hardware.acpi_cpp", |
| "//sdk/fidl/fuchsia.hardware.goldfish:fuchsia.hardware.goldfish_bindlib_cpp", |
| "//sdk/fidl/fuchsia.hardware.goldfish.pipe:fuchsia.hardware.goldfish.pipe_bindlib_cpp", |
| "//sdk/fidl/fuchsia.hardware.platform.bus:fuchsia.hardware.platform.bus_cpp", |
| "//sdk/fidl/fuchsia.hardware.powersource:fuchsia.hardware.powersource_cpp", |
| "//sdk/fidl/fuchsia.hardware.sysmem:fuchsia.hardware.sysmem_bindlib_cpp", |
| "//sdk/fidl/fuchsia.hardware.sysmem:fuchsia.hardware.sysmem_cpp", |
| "//sdk/lib/driver/runtime:driver_runtime_cpp", |
| "//src/devices/bind/fuchsia:fuchsia_cpp", |
| "//src/devices/bind/fuchsia.goldfish.platform:fuchsia.goldfish.platform_cpp", |
| "//src/devices/bind/fuchsia.google.platform:fuchsia.google.platform_cpp", |
| "//src/devices/board/lib/acpi", |
| "//src/devices/board/lib/smbios", |
| "//src/devices/lib/driver", |
| "//src/devices/lib/driver:driver_runtime", |
| "//src/devices/lib/iommu:iommu-x86", |
| "//src/devices/pci/lib/pci", |
| "//src/lib/ddk", |
| |
| # TODO(https://fxbug.dev/42113849): Migrate to the new bind rules and delete the below |
| "//sdk/lib/fit", |
| "//src/lib/ddk:ddk-deprecated-binding-headers", |
| "//src/lib/ddktl", |
| "//src/ui/input/lib/hid", |
| "//third_party/acpica", |
| "//zircon/system/ulib/async:async-cpp", |
| "//zircon/system/ulib/driver-unit-test", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/inspect", |
| "//zircon/system/ulib/lazy_init", |
| "//zircon/system/ulib/region-alloc", |
| "//zircon/system/ulib/zircon-internal", |
| "//zircon/system/ulib/zx", |
| "//zircon/system/ulib/zxtest", |
| "//zircon/third_party/ulib/chromiumos-platform-ec", |
| ] |
| |
| # TODO(https://fxbug.dev/42136089): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| fuchsia_component_manifest("manifest") { |
| component_name = "platform-bus-x86" |
| manifest = "meta/platform-bus-x86.cml" |
| } |
| |
| fuchsia_structured_config_cpp_elf_lib("x86-config") { |
| cm_label = ":manifest" |
| } |
| |
| fuchsia_driver_component("platform-bus-x86") { |
| cm_label = ":manifest" |
| deps = [ ":platform-bus-x86-driver" ] |
| info = "platform-bus-x86-info.json" |
| } |
| |
| fuchsia_driver_package("package") { |
| package_name = "platform-bus-x86" |
| driver_components = [ ":platform-bus-x86" ] |
| } |
| |
| test("x86-ec-test-bin") { |
| output_name = "x86-ec-test" |
| sources = [ |
| "acpi-dev/dev-ec-test.cc", |
| "acpi-dev/dev-ec.cc", |
| ] |
| deps = [ |
| "//src/devices/board/lib/acpi/test:mock-acpi", |
| "//src/devices/testing/mock-ddk", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//third_party/acpica", |
| "//zircon/system/ulib/inspect", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| fuchsia_unittest_package("x86-ec-test") { |
| deps = [ ":x86-ec-test-bin" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":x64-bind_test", |
| ":x86-ec-test", |
| ] |
| } |