1# Copyright 2020 The Hafnium Authors.
2#
3# Use of this source code is governed by a BSD-style
4# license that can be found in the LICENSE file or at
5# https://opensource.org/licenses/BSD-3-Clause.
6
7import("//build/image/image.gni")
8import("//build/toolchain/platform.gni")
9
10# The bootloader image.
11image_binary("qemuloader") {
12  image_name = "qemuloader"
13  deps = [
14    ":loader",
15  ]
16}
17
18source_set("loader") {
19  public_configs = [
20    "//src/arch/aarch64:config",
21    "//third_party/dtc:libfdt_config",
22  ]
23  sources = [
24    "entry.S",
25    "fwcfg.c",
26    "loader.c",
27  ]
28
29  deps = [
30    "//src:abort",
31    "//src:dlog",
32    "//src:layout",
33    "//src:panic",
34    "//src/arch/${plat_arch}:entry",
35    "//third_party/dtc:libfdt",
36  ]
37}
38
39copy("tfa_trusty_copy") {
40  sources = [
41    "//prebuilts/linux-aarch64/trusted-firmware-a-trusty/qemu/bl2.bin",
42    "//prebuilts/linux-aarch64/trusted-firmware-a-trusty/qemu/bl31.bin",
43    "//prebuilts/linux-aarch64/trusted-firmware-a-trusty/qemu/bl32.bin",
44  ]
45  outputs = [
46    "$root_out_dir/{{source_file_part}}",
47  ]
48}
49
50copy("qemuloader_copy") {
51  sources = [
52    "$root_out_dir/qemuloader.bin",
53  ]
54  deps = [
55    ":qemuloader",
56  ]
57  outputs = [
58    "$root_out_dir/bl33.bin",
59  ]
60}
61
62group("bl") {
63  deps = [
64    ":qemuloader_copy",
65    ":tfa_trusty_copy",
66  ]
67}
68