blob: fff9119c6bd4e7a9a523b6224c2af35ea4615716 [file] [log] [blame]
# 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("$zx/kernel/params.gni")
assert(current_cpu == "x64")
group("x86") {
deps = [
":platform-bus-x86",
]
}
config("config") {
visibility = [ ":*" ]
include_dirs = [ "include" ]
if (enable_user_pci) {
defines = [ "ENABLE_USER_PCI" ]
}
if (!is_gcc) {
cflags = [ "-Wno-null-pointer-arithmetic" ]
}
cflags_c = [ "-fno-strict-aliasing" ]
}
source_set("iommu") {
visibility = [ ":*" ]
sources = [
"iommu.c",
]
configs += [ ":config" ]
deps = [
"$zx/system/ulib/ddk",
"$zx/system/ulib/zircon",
"$zx/third_party/lib/acpica",
]
}
source_set("smbios") {
visibility = [ ":*" ]
sources = [
"smbios.cc",
]
configs += [ ":config" ]
deps = [
"$zx/system/ulib/ddk",
"$zx/system/ulib/fbl",
"$zx/system/ulib/fzl",
"$zx/system/ulib/smbios:static",
"$zx/system/ulib/zircon",
"$zx/system/ulib/zx",
]
}
driver("platform-bus-x86") {
sources = [
"acpi-dev/dev-battery.c",
"acpi-dev/dev-cros-ec/dev.cc",
"acpi-dev/dev-cros-ec/motion.cc",
"acpi-dev/dev-ec.c",
"acpi-dev/dev-lid.cc",
"acpi-dev/dev-lid.h",
"acpi-dev/dev-pwrbtn.cc",
"acpi-dev/dev-pwrsrc.c",
"acpi-dev/dev-tbmc.cc",
"acpi-dev/dev-thermal.c",
"acpi-nswalk.c",
"debug.c",
"init.c",
"methods.cc",
"nhlt.c",
"pciroot.cc",
"power.c",
"resources.c",
"sysmem.c",
"util.c",
"x86.c",
]
# 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.c) will be built instead.
if (enable_user_pci) {
sources += [ "pci.cc" ]
} else {
sources += [ "kpci.c" ]
}
configs += [ ":config" ]
deps = [
":iommu",
":smbios",
"$zx/system/banjo/ddk.protocol.acpi",
"$zx/system/banjo/ddk.protocol.hidbus",
"$zx/system/banjo/ddk.protocol.pciroot",
"$zx/system/banjo/ddk.protocol.platform.bus",
"$zx/system/banjo/ddk.protocol.platform.device",
"$zx/system/banjo/ddk.protocol.scpi",
"$zx/system/banjo/ddk.protocol.sysmem",
"$zx/system/fidl/fuchsia-hardware-power:c",
"$zx/system/fidl/fuchsia-hardware-thermal:c",
"$zx/system/fidl/fuchsia-sysinfo:c",
"$zx/system/fidl/fuchsia-sysmem:c",
"$zx/system/ulib/ddk",
"$zx/system/ulib/ddktl",
"$zx/system/ulib/fbl",
"$zx/system/ulib/fit",
"$zx/system/ulib/hid",
"$zx/system/ulib/pci",
"$zx/system/ulib/region-alloc",
"$zx/system/ulib/zircon",
"$zx/third_party/lib/acpica",
"$zx/third_party/ulib/chromiumos-platform-ec",
]
# TODO(ZX-2863): This driver violates the allowed shlib deps policy.
deprecated_inhibit_driver_shlib_allowlist = true
}
test("x86-battery-test") {
output_name = "x86-battery-test"
test_group = "ddk"
sources = [
"acpi-dev/dev-battery-test.c",
]
configs += [ ":config" ]
deps = [
"$zx/system/banjo/ddk.protocol.acpi",
"$zx/system/banjo/ddk.protocol.hidbus",
"$zx/system/banjo/ddk.protocol.pciroot",
"$zx/system/banjo/ddk.protocol.platform.bus",
"$zx/system/banjo/ddk.protocol.platform.device",
"$zx/system/banjo/ddk.protocol.scpi",
"$zx/system/banjo/ddk.protocol.sysmem",
"$zx/system/fidl/fuchsia-hardware-power:c",
"$zx/system/fidl/fuchsia-hardware-thermal:c",
"$zx/system/ulib/ddk",
"$zx/system/ulib/ddktl",
"$zx/system/ulib/fbl",
"$zx/system/ulib/hid",
"$zx/system/ulib/pci",
"$zx/system/ulib/region-alloc",
"$zx/system/ulib/zircon",
"$zx/system/ulib/zxtest",
"$zx/third_party/lib/acpica",
"$zx/third_party/ulib/chromiumos-platform-ec",
]
}
test("x86-lid-test") {
output_name = "x86-lid-test"
test_group = "ddk"
sources = [
"acpi-dev/dev-lid-test.cc",
"acpi-dev/dev-lid.cc",
"acpi-dev/dev-lid.h",
]
configs += [ ":config" ]
deps = [
"$zx/system/banjo/ddk.protocol.acpi",
"$zx/system/banjo/ddk.protocol.hidbus",
"$zx/system/dev/lib/fake_ddk",
"$zx/system/dev/lib/mock-hidbus-ifc",
"$zx/system/ulib/ddk",
"$zx/system/ulib/ddktl",
"$zx/system/ulib/fbl",
"$zx/system/ulib/hid",
"$zx/system/ulib/sync",
"$zx/system/ulib/zircon",
"$zx/system/ulib/zxtest",
"$zx/third_party/lib/acpica",
]
}
test("x86-board-test") {
test_group = "ddk"
sources = [
"iommu-test.cc",
"smbios-test.cc",
]
configs += [ ":config" ]
deps = [
":iommu",
":smbios",
"$zx/system/ulib/fdio",
"$zx/system/ulib/zxtest",
]
}