| # 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/bazel/bazel_inputs.gni") |
| import("//build/bazel/drivers/bazel_driver_package.gni") |
| import("//build/bind/bind.gni") |
| import("//build/devicetree/devicetree.gni") |
| import("//build/devicetree/devicetree_visitor.gni") |
| |
| # Note: Don't add additional bazel tests into this group as it will introduce |
| # more bazel actions into build graph. Instead, add them into |
| # //src:bazel_tests |
| group("tests") { |
| testonly = true |
| deps = [ ":vim3-devicetree-bind_test" ] |
| } |
| |
| devicetree_fragment("meson-g12-common") { |
| sources = [ "dts/meson-g12-common.dtsi.S" ] |
| } |
| |
| devicetree_fragment("amlogic-a311d") { |
| sources = [ "dts/amlogic-a311d.dtsi.S" ] |
| deps = [ |
| ":meson-g12-common", |
| "//src/devices/lib/amlogic", |
| ] |
| } |
| |
| devicetree_fragment("khadas-vim3-board") { |
| sources = [ "dts/khadas-vim3-board.dtsi.S" ] |
| deps = [ |
| ":amlogic-a311d", |
| ":meson-g12-common", |
| "//src/devices/lib/amlogic", |
| "//zircon/system/ulib/ddk-platform-defs", |
| ] |
| } |
| |
| devicetree_fragment("vim3-power-config") { |
| sources = [ "dts/vim3-power-config.dtsi" ] |
| deps = [ ":khadas-vim3-board" ] |
| } |
| |
| devicetree("vim3") { |
| sources = [ "dts/vim3.dts" ] |
| deps = [ ":vim3-power-config" ] |
| golden = "dts/vim3.golden.dts" |
| |
| # Suppressing warnings for bus@ffd00000 and video-decoder@ffd00000 which both |
| # use the same mmio region by design. |
| dtcflags = [ "-Wno-unique_unit_address" ] |
| } |
| |
| driver_bind_rules("vim3-devicetree-bind") { |
| rules = "meta/vim3-devicetree.bind" |
| tests = "meta/bind-tests.json" |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.platform.bus:fuchsia.hardware.platform.bus_bindlib", |
| "//src/devices/bind/fuchsia.khadas.platform", |
| ] |
| } |
| |
| bazel_driver_package("bazel_package") { |
| bazel_target = "//src/devices/board/drivers/vim3-devicetree:vim3-devicetree" |
| package_name = "vim3-devicetree" |
| inputs = [ |
| "vim3-devicetree.cc", |
| "vim3-devicetree.h", |
| ] |
| } |
| |
| bazel_input_file("vim3-dtb") { |
| generator = ":vim3" |
| outputs = [ "$target_out_dir/vim3.dtb" ] |
| gn_targets_name = "vim3-dtb" |
| } |