| # 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("//build/testing/bootfs_test.gni") |
| import("//src/devices/bus/drivers/pci/pci.gni") |
| import("//src/sys/build/fuchsia_unittest_package.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" ] |
| } |
| |
| source_set("smbios") { |
| visibility = [ ":*" ] |
| |
| sources = [ "smbios.cc" ] |
| |
| configs += [ ":config" ] |
| |
| deps = [ |
| "//src/lib/ddk", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/fzl", |
| "//zircon/system/ulib/smbios", |
| ] |
| } |
| |
| bind_rules("x64-bind") { |
| rules = "x64.bind" |
| output = "x64-bind.h" |
| tests = "bind-tests.json" |
| deps = [ |
| "//src/devices/bind/fuchsia.intel.platform", |
| "//src/devices/bind/fuchsia.platform", |
| ] |
| } |
| |
| driver_module("platform-bus-x86") { |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| |
| sources = [ |
| "acpi-dev/dev-battery.cc", |
| "acpi-dev/dev-cros-ec/acpi.cc", |
| "acpi-dev/dev-cros-ec/dev.cc", |
| "acpi-dev/dev-cros-ec/motion.cc", |
| "acpi-dev/dev-ec.cc", |
| "acpi-dev/dev-lid.cc", |
| "acpi-dev/dev-lid.h", |
| "acpi-dev/dev-pwrbtn.cc", |
| "acpi-dev/dev-pwrsrc.cc", |
| "acpi-dev/dev-tbmc.cc", |
| "acpi-dev/dev-thermal.cc", |
| "acpi-nswalk.cc", |
| "debug.cc", |
| "goldfish-control.cc", |
| "i2c.cc", |
| "init.cc", |
| "iommu-driver-tests.cc", |
| "methods.cc", |
| "nhlt.cc", |
| "pciroot.cc", |
| "power.cc", |
| "resources.cc", |
| "sysmem.cc", |
| "util.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 += [ |
| "pci.cc", |
| "pci_irqs.cc", |
| ] |
| } else { |
| sources += [ "kpci.cc" ] |
| } |
| configs += [ ":config" ] |
| deps = [ |
| ":smbios", |
| ":x64-bind", |
| "//sdk/banjo/fuchsia.hardware.acpi:fuchsia.hardware.acpi_banjo_cpp", |
| "//sdk/banjo/fuchsia.hardware.hidbus", |
| "//sdk/banjo/fuchsia.hardware.pciroot", |
| "//sdk/banjo/fuchsia.hardware.platform.bus", |
| "//sdk/banjo/fuchsia.hardware.platform.device", |
| "//sdk/banjo/fuchsia.hardware.sysmem", |
| "//sdk/banjo/fuchsia.sysmem", |
| "//sdk/fidl/fuchsia.hardware.acpi:fuchsia.hardware.acpi_llcpp", |
| "//sdk/fidl/fuchsia.hardware.power:fuchsia.hardware.power_c", |
| "//sdk/fidl/fuchsia.hardware.thermal:fuchsia.hardware.thermal_c", |
| "//sdk/fidl/fuchsia.sysinfo:fuchsia.sysinfo_c", |
| "//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem_c", |
| "//src/devices/lib/driver", |
| "//src/devices/lib/iommu", |
| "//src/devices/pci/lib/pci", |
| "//src/lib/ddk", |
| |
| # TODO(fxb/38132): Migrate to the new bind rules and delete the below |
| "//sdk/lib/fit", |
| "//src/lib/ddk:ddk-deprecated-binding-headers", |
| "//src/lib/ddktl", |
| "//third_party/acpica", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/public/lib/zx", |
| "//zircon/public/lib/zxc", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/driver-unit-test", |
| "//zircon/system/ulib/hid", |
| "//zircon/system/ulib/lazy_init", |
| "//zircon/system/ulib/region-alloc", |
| "//zircon/third_party/ulib/chromiumos-platform-ec", |
| ] |
| } |
| |
| test("x86-battery-test") { |
| sources = [ |
| "acpi-dev/dev-battery-test.cc", |
| "acpi-dev/dev-battery.cc", |
| ] |
| configs += [ ":config" ] |
| deps = [ |
| "//sdk/banjo/fuchsia.hardware.acpi:fuchsia.hardware.acpi_banjo_cpp", |
| "//sdk/banjo/fuchsia.hardware.hidbus", |
| "//sdk/banjo/fuchsia.hardware.pciroot", |
| "//sdk/banjo/fuchsia.hardware.platform.bus", |
| "//sdk/banjo/fuchsia.hardware.platform.device", |
| "//sdk/banjo/fuchsia.hardware.sysmem", |
| "//sdk/fidl/fuchsia.hardware.power:fuchsia.hardware.power_c", |
| "//sdk/fidl/fuchsia.hardware.thermal:fuchsia.hardware.thermal_c", |
| "//sdk/lib/fdio", |
| "//src/devices/lib/driver", |
| "//src/devices/pci/lib/pci", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//third_party/acpica", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/hid", |
| "//zircon/system/ulib/region-alloc", |
| "//zircon/third_party/ulib/chromiumos-platform-ec", |
| ] |
| } |
| |
| test("x86-lid-test") { |
| sources = [ |
| "acpi-dev/dev-lid-test.cc", |
| "acpi-dev/dev-lid.cc", |
| "acpi-dev/dev-lid.h", |
| ] |
| configs += [ ":config" ] |
| deps = [ |
| "//sdk/banjo/fuchsia.hardware.acpi:fuchsia.hardware.acpi_banjo_cpp", |
| "//sdk/banjo/fuchsia.hardware.hidbus", |
| "//src/devices/testing/fake_ddk", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//src/ui/input/testing/mock-hidbus-ifc", |
| "//third_party/acpica", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/hid", |
| ] |
| } |
| |
| bootfs_test("x86-lid-bootfs-test") { |
| name = "x86-lid-test" |
| deps = [ ":x86-lid-test" ] |
| } |
| |
| test("x86-pwrsrc-test") { |
| sources = [ |
| "acpi-dev/dev-pwrsrc-test.cc", |
| "acpi-dev/dev-pwrsrc.cc", |
| ] |
| configs += [ ":config" ] |
| deps = [ |
| "//sdk/banjo/fuchsia.hardware.acpi:fuchsia.hardware.acpi_banjo_cpp", |
| "//sdk/banjo/fuchsia.hardware.hidbus", |
| "//sdk/banjo/fuchsia.hardware.platform.bus", |
| "//sdk/banjo/fuchsia.hardware.platform.device", |
| "//sdk/banjo/fuchsia.hardware.sysmem", |
| "//sdk/fidl/fuchsia.hardware.power:fuchsia.hardware.power_c", |
| "//sdk/lib/fdio", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//third_party/acpica", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/hid", |
| ] |
| } |
| |
| bootfs_test("x86-pwrsrc-bootfs-test") { |
| name = "x86-pwrsrc-test" |
| deps = [ ":x86-pwrsrc-test" ] |
| } |
| |
| test("x86-board-test") { |
| sources = [ "smbios-test.cc" ] |
| configs += [ ":config" ] |
| deps = [ |
| ":smbios", |
| "//src/devices/testing/fake_ddk", |
| "//zircon/public/lib/zxtest", |
| ] |
| } |
| |
| bootfs_test("x86-board-bootfs-test") { |
| name = "x86-board-test" |
| deps = [ ":x86-board-test" ] |
| } |
| |
| test("x86-thermal-test") { |
| sources = [ |
| "acpi-dev/dev-thermal-test.cc", |
| "acpi-dev/dev-thermal.cc", |
| "acpi-dev/dev-thermal.h", |
| ] |
| configs += [ ":config" ] |
| deps = [ |
| "//sdk/banjo/fuchsia.hardware.acpi:fuchsia.hardware.acpi_banjo_cpp", |
| "//sdk/fidl/fuchsia.hardware.thermal:fuchsia.hardware.thermal_c", |
| "//sdk/lib/fdio", |
| "//src/devices/testing/fake_ddk", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//third_party/acpica", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/async-loop", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fidl-async", |
| ] |
| } |
| |
| bootfs_test("x86-thermal-bootfs-test") { |
| name = "x86-thermal-test" |
| deps = [ ":x86-thermal-test" ] |
| } |
| |
| test("x86-cros-ec-test") { |
| sources = [ |
| "acpi-dev/dev-cros-ec/acpi.cc", |
| "acpi-dev/dev-cros-ec/acpi.h", |
| "acpi-dev/dev-cros-ec/dev.cc", |
| "acpi-dev/dev-cros-ec/dev.h", |
| "acpi-dev/dev-cros-ec/motion-test.cc", |
| "acpi-dev/dev-cros-ec/motion.cc", |
| ] |
| configs += [ ":config" ] |
| deps = [ |
| "//sdk/banjo/fuchsia.hardware.acpi:fuchsia.hardware.acpi_banjo_cpp", |
| "//sdk/banjo/fuchsia.hardware.hidbus", |
| "//src/devices/testing/fake_ddk", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//src/ui/input/testing/mock-hidbus-ifc", |
| "//third_party/acpica", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/hid", |
| "//zircon/system/ulib/hid-parser", |
| "//zircon/third_party/ulib/chromiumos-platform-ec", |
| ] |
| } |
| |
| fuchsia_unittest_package("x86-battery-test-pkg") { |
| package_name = "x86-battery-test" |
| deps = [ ":x86-battery-test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":x64-bind_test" ] |
| if (target_cpu == "x64") { |
| deps += [ |
| ":x86-battery-test-pkg", |
| ":x86-cros-ec-test-pkg", |
| ] |
| } |
| } |
| |
| fuchsia_unittest_package("x86-cros-ec-test-pkg") { |
| package_name = "x86-cros-ec-test" |
| deps = [ ":x86-cros-ec-test" ] |
| } |