blob: 754decd3ca22200c86a929b48e244b3683ab5f18 [file]
# Copyright 2023 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/assembly/board_input_bundle.gni")
import("//build/bazel/assembly/bazel_board_configuration.gni")
import("//build/bazel/bazel_inputs.gni")
import("//zircon/tools/zbi/zbi_item.gni")
assert(current_toolchain == default_toolchain,
"The arm64 board can only be defined in the default toolchain.")
assert(current_cpu == "arm64",
"The arm64 board can only be defined in an arm64 toolchain.")
bazel_board_configuration("arm64") {
testonly = true
bazel_board_configuration_target = "//boards/arm64"
deps = [ ":arm64.bazel_input" ]
}
group("arm64.bazel_input") {
testonly = true
deps = [
":main_bundle.bazel_inputs",
":qemu_psci_cpu_suspend_states.bazel_inputs",
"//boards/emulation/virtio:virtio.bazel_inputs",
"//src/firmware/gigaboot/cpp:esp.bazel_input",
]
}
board_input_bundle("main_bundle") {
configuration = {
power_manager =
"//src/power/power-manager/node_config/base_node_config.json5"
}
drivers = [
{
package_target = "//src/devices/block/drivers/nvme:package"
package_set = "bootfs"
driver_components = [ "meta/nvme.cm" ]
},
]
# Additional drivers to support running as a virtualization guest.
drivers += [
{
package_target = "//src/devices/block/drivers/ahci:package"
package_set = "bootfs"
driver_components = [ "meta/ahci.cm" ]
},
{
package_target = "//src/devices/board/drivers/qemu-arm64:package"
package_set = "bootfs"
driver_components = [ "meta/qemu-arm64.cm" ]
},
{
package_target = "//src/devices/rtc/drivers/pl031-rtc:package"
package_set = "bootfs"
driver_components = [ "meta/pl031-rtc.cm" ]
},
]
version = build_info_version
}
# Special PSCI_CPU_SUSPEND states for QEMU.
#
# Both in TCG and KVM mode, suspend states are accepted, and treated as a
# `retention` state, meaning core state is not lost, and the core isn't powered
# down. The core enters WFI internally.
zbi_item("qemu_psci_cpu_suspend_states") {
type = "ZBI_TYPE_KERNEL_DRIVER"
extra = "ZBI_KERNEL_DRIVER_ARM_PSCI_CPU_SUSPEND"
contents = [
# PSCI CPU_SUSPEND power state with retention.
{
id = 0
# QEMU only supports the "Original format" (section 5.4.2.1 of
# DEN0022F.b), where bit 16 is the StateType and bits 15:0 are the
# StateID.
#
# Since QEMU does not support powerdown states, we use StateType=0
# (meaning standby/retention). For the StateID field, QEMU doesn't care so
# we simply use 1, which if QEMU were following the recommended encoding
# would mean core is last in the core power level, system level is run,
# cluster level is run, core level is standby.
power_state = 1
# Nothing special.
flags = 0
},
]
}
bazel_input_file("qemu_psci_cpu_suspend_states.bazel_inputs") {
generator = ":qemu_psci_cpu_suspend_states"
}