blob: de718600d2d08d56df8a34a1bae0db4c5e2665cb [file] [log] [blame]
# 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_configuration.gni")
import("//build/assembly/board_input_bundle.gni")
import("//build/bazel/assembly/bazel_board_input_bundle.gni")
assert(current_toolchain == default_toolchain,
"The vim3 board can only be defined in the default toolchain.")
assert(current_cpu == "arm64",
"The vim3 board can only be defined in an arm64 toolchain.")
common_board_configuration = {
name = "vim3"
provided_features = [
"fuchsia::bt_transport_uart",
"fuchsia::bus_pci",
"fuchsia::fake_battery",
"fuchsia::fan",
"fuchsia::mali_gpu",
"fuchsia::paver",
"fuchsia::pmm_checker",
"fuchsia::real_time_clock",
"fuchsia::realtek_8211f",
"fuchsia::suspender",
"fuchsia::suspending_token",
"fuchsia::usb_peripheral_support",
"fuchsia::wlan_fullmac",
"fuchsia::xhci",
]
input_bundles = [
":devicetree_board_driver",
":main_bundle",
":paver",
":vulkan_arm_mali",
":rtc_driver",
":bazel_drivers",
]
devicetree = "//src/devices/board/drivers/vim3-devicetree:vim3"
platform = {
connectivity = {
network = {
# Prefer using the built-in NIC to the CDC-ether interface.
netsvc_interface =
"/dwmac-ff3f0000_group/dwmac/Designware-MAC/network-device"
}
}
development_support = {
# Enable the Debug Access Port (DAP) for improved lockup/crash diagnostics.
enable_debug_access_port_for_soc = "amlogic-a311d"
}
sysmem_defaults = {
# The AMlogic display engine needs contiguous physical memory for each
# frame buffer, because it does not have a page table walker.
#
# The maximum supported resolution is documented below.
# * "A311D Quick Reference Manual" revision 01, pages 2-3
# * "A311D Datasheet" revision 08, section 2.2 "Features", pages 4-5
#
# These pages can be loaned back to zircon for use in pager-backed VMOs,
# but these pages won't be used in "anonymous" VMOs (at least for now).
# Whether the loaned-back pages can be absorbed by pager-backed VMOs is
# workload dependent. The "k ppb stats_on" command can be used to
# determine whether all loaned pages are being used by pager-backed VMOs.
#
# This board-level default can be overridden by platform-level config.
contiguous_memory_size = {
# 200 MiB
fixed = 209715200
}
protected_memory_size = {
fixed = 0
}
contiguous_guard_pages_unused = false
}
}
filesystems = {
vbmeta = {
key = "//src/firmware/avb_keys/vim3/vim3-dev-key/vim3_devkey_atx_psk.pem"
key_metadata =
"//src/firmware/avb_keys/vim3/vim3-dev-key/vim3_dev_atx_metadata.bin"
}
zbi = {
compression = "zstd.17"
}
fvm = {
blobfs = {
size_checker_maximum_bytes = 5216665600
}
sparse_output = {
}
fastboot_output = {
# For VIM3, FVM partition uses all of the remaining eMMC.
# However, the total size of the eMMC storage maybe 16G or 32G
# depending on whether it is a basic or pro version. In
# addition, the actual size of the user block allocated by
# Fuchsia can be further different. (i.e. 'lsblk' shows a 29G
# size user block for the 32Gb version). To avoid the risk of
# overflowing available size, here we set it to be the same as
# sherlock (3280mb), which is clearly safe and sufficient for
# now.
truncate_to_length = 3439329280
}
}
fxfs = {
size_checker_maximum_bytes = 5216665600
}
}
kernel = {
contiguous_physical_pages = true
}
}
board_configuration("vim3") {
forward_variables_from(common_board_configuration, "*")
}
board_configuration("reduced_perf_variation") {
forward_variables_from(common_board_configuration, "*")
input_bundles += [ ":reduced_perf_variation_args" ]
# Disable serial console printing during early boot, a phase during which
# UART communication is single-threaded and synchronous. In production,
# the serial console will be disabled, and so early boot benchmarks that
# include this work is sensibly avoided.
kernel.quiet_early_boot = true
}
board_input_bundle("reduced_perf_variation_args") {
kernel_cmdline = [
# Disable page scanning in all its forms. Page scanning is intended to
# provide a memory benefit to final systems, but the operation of the
# scanner and its unpredictable de-duplication or eviction of memory in use
# by benchmarks could cause noticeable variation.
"kernel.page-scanner.start-at-boot=false",
"kernel.page-scanner.zero-page-scans-per-second=0",
"kernel.page-scanner.enable-eviction=false",
]
}
board_input_bundle("main_bundle") {
base_packages = [ "//src/graphics/bin/vulkan_loader" ]
drivers = [
{
package_target =
"//src/connectivity/ethernet/drivers/aml-ethernet:package"
package_set = "bootfs"
driver_components = [ "meta/aml-ethernet.cm" ]
},
{
package_target = "//src/devices/hrtimer/drivers/aml-hrtimer:package"
package_set = "bootfs"
driver_components = [ "meta/aml-hrtimer.cm" ]
},
{
package_target = "//src/connectivity/ethernet/drivers/dwmac:package"
package_set = "bootfs"
driver_components = [ "meta/dwmac.cm" ]
},
{
package_target = "//src/devices/adc/drivers/aml-saradc:package"
package_set = "bootfs"
driver_components = [ "meta/aml-saradc.cm" ]
},
{
package_target = "//src/devices/block/drivers/aml-sdmmc:package"
package_set = "bootfs"
driver_components = [ "meta/aml-sdmmc.cm" ]
},
{
package_target = "//src/devices/cpu/drivers/aml-cpu:package"
package_set = "bootfs"
driver_components = [ "meta/aml-cpu.cm" ]
},
{
package_target = "//src/devices/gpio/drivers/ti-tca6408a:package"
package_set = "bootfs"
driver_components = [ "meta/ti-tca6408a.cm" ]
},
{
package_target = "//src/devices/mcu/drivers/vim3-mcu:package"
package_set = "bootfs"
driver_components = [ "meta/vim3-mcu.cm" ]
},
{
package_target = "//src/devices/ml/drivers/aml-nna:package"
package_set = "bootfs"
driver_components = [ "meta/aml-nna.cm" ]
},
{
package_target = "//src/devices/power/drivers/aml-meson-power:package"
package_set = "bootfs"
driver_components = [ "meta/aml-meson-power.cm" ]
},
{
package_target = "//src/devices/power/drivers/aml-pwm-regulator:package"
package_set = "bootfs"
driver_components = [ "meta/aml-pwm-regulator.cm" ]
},
{
package_target = "//src/devices/power/drivers/fusb302:package"
package_set = "bootfs"
driver_components = [ "meta/fusb302.cm" ]
},
{
package_target = "//src/devices/pwm/drivers/aml-pwm:package"
package_set = "bootfs"
driver_components = [ "meta/aml-pwm.cm" ]
},
{
package_target = "//src/devices/pwm/drivers/aml-pwm-init:package"
package_set = "bootfs"
driver_components = [ "meta/aml-pwm-init.cm" ]
},
{
package_target = "//src/devices/serial/drivers/aml-uart:package-dfv2"
package_set = "bootfs"
driver_components = [ "meta/aml-uart-dfv2.cm" ]
},
{
package_target = "//src/devices/thermal/drivers/aml-thermal:package"
package_set = "bootfs"
driver_components = [ "meta/aml-thermal.cm" ]
},
{
package_target = "//src/devices/temperature/drivers/aml-trip:package"
package_set = "bootfs"
driver_components = [ "meta/aml-trip.cm" ]
},
{
package_target = "//src/devices/suspend/drivers/aml-suspend:package"
package_set = "bootfs"
driver_components = [ "meta/aml-suspend.cm" ]
},
{
package_target = "//src/devices/usb/drivers/dwc2:package"
package_set = "bootfs"
driver_components = [ "meta/dwc2.cm" ]
},
{
package_target = "//src/graphics/display/drivers/aml-canvas:package"
package_set = "bootfs"
driver_components = [ "meta/aml-canvas.cm" ]
},
{
package_target = "//src/graphics/display/drivers/amlogic-display:package"
package_set = "bootfs"
driver_components = [ "meta/amlogic-display.cm" ]
},
{
package_target =
"//src/graphics/display/drivers/vim3-display-detect:package"
package_set = "bootfs"
driver_components = [ "meta/vim3-display-detect.cm" ]
},
{
package_target = "//src/graphics/drivers/aml-gpu:aml-gpu-package"
package_set = "bootfs"
driver_components = [ "meta/aml-gpu.cm" ]
},
{
package_target = "//src/ui/backlight/drivers/vim3-pwm-backlight:package"
package_set = "bootfs"
driver_components = [ "meta/vim3-pwm-backlight.cm" ]
},
{
package_target = "//src/ui/input/drivers/focaltech:package"
package_set = "bootfs"
driver_components = [ "meta/focaltech.cm" ]
},
# Base drivers
{
package_target = "//src/graphics/drivers/msd-arm-mali:msd-arm-mali"
package_set = "base"
driver_components = [ "meta/msd_arm.cm" ]
},
{
package_target = "//src/graphics/drivers/msd-vsi-vip"
package_set = "base"
driver_components = [ "meta/libmsd_vsi.cm" ]
},
]
}
board_input_bundle("devicetree_board_driver") {
configuration = {
power_manager = "//src/power/power-manager/node_config/vim3_devicetree_node_config.json5"
thermal = "//src/power/power-manager/thermal_config/vim3_devicetree.json5"
sysmem_format_costs = [
# order is significant; please don't alphabetize; correct order is:
# * arm_mali
# * video_decoder_nv12
"//src/sysmem/format_costs/arm_mali",
"//src/sysmem/format_costs/video_decoder_nv12",
]
}
drivers = []
}
bazel_board_input_bundle("bazel_drivers") {
bazel_board_input_bundle_target = "//boards/vim3:bazel_drivers"
}
board_input_bundle("vulkan_arm_mali") {
base_packages =
[ "//src/graphics/drivers/arm-mali/icd:libvulkan_arm_g52_r0p0" ]
}
board_input_bundle("rtc_driver") {
drivers = [
{
package_target = "//src/devices/rtc/drivers/nxp:pcf8563"
package_set = "base"
driver_components = [ "meta/pcf8563.cm" ]
},
]
}
board_input_bundle("paver") {
bootfs_packages = [ "//src/bringup/bin/paver:package-vim3" ]
}
# Note: This group contains bazel built drivers that are defined in individual bazel_actions.
# Adding this to your build graph will greatly reduce your build speed.
group("vim3-release") {
deps = [
"//src/connectivity/ethernet/drivers/aml-ethernet:package-archive",
"//src/connectivity/ethernet/drivers/dwmac:package-archive",
"//src/connectivity/ethernet/drivers/realtek-8211f:package-archive",
"//src/devices/adc/drivers/aml-saradc:package-archive",
"//src/devices/block/drivers/aml-sdmmc:package-archive",
"//src/devices/board/drivers/vim3-devicetree:bazel_package-archive",
"//src/devices/bus/drivers/pci:package-archive",
"//src/devices/clock/drivers/vim3-clk:bazel_package-archive",
"//src/devices/cpu/drivers/aml-cpu:package-archive",
"//src/devices/gpio/drivers/aml-gpio:bazel_package-archive",
"//src/devices/gpio/drivers/ti-tca6408a:package-archive",
"//src/devices/hrtimer/drivers/aml-hrtimer:package-archive",
"//src/devices/i2c/drivers/aml-i2c:bazel_package-archive",
"//src/devices/mcu/drivers/vim3-mcu:package-archive",
"//src/devices/ml/drivers/aml-nna:package-archive",
"//src/devices/power/drivers/aml-meson-power:package-archive",
"//src/devices/power/drivers/aml-pwm-regulator:package-archive",
"//src/devices/power/drivers/fusb302:package-archive",
"//src/devices/pwm/drivers/aml-pwm:package-archive",
"//src/devices/pwm/drivers/aml-pwm-init:package-archive",
"//src/devices/serial/drivers/aml-uart:package-dfv2-archive",
"//src/devices/suspend/drivers/aml-suspend:package-archive",
"//src/devices/temperature/drivers/aml-trip:package-archive",
"//src/devices/thermal/drivers/aml-thermal:package-archive",
"//src/devices/usb/drivers/aml-usb-phy:bazel_package-archive",
"//src/devices/usb/drivers/dwc2:package-archive",
"//src/devices/usb/drivers/xhci:package-archive",
"//src/graphics/display/drivers/aml-canvas:package-archive",
"//src/graphics/display/drivers/amlogic-display:package-archive",
"//src/graphics/display/drivers/vim3-display-detect:package-archive",
"//src/graphics/drivers/aml-gpu:aml-gpu-package-archive",
"//src/graphics/drivers/msd-arm-mali:msd-arm-mali-archive",
"//src/graphics/drivers/msd-vsi-vip:msd-vsi-vip-archive",
"//src/media/audio/drivers/aml-g12-tdm:aml-g12-composite-bazel-package-archive",
"//src/power/fake-powersource:fake-battery-archive",
"//src/ui/backlight/drivers/vim3-pwm-backlight:package-archive",
"//src/ui/input/drivers/adc-buttons:bazel_package-archive",
"//src/ui/input/drivers/focaltech:package-archive",
]
}