1# Copyright 2021 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("//test/hftest/args.gni")
9
10config("config") {
11  include_dirs = [ "inc" ]
12}
13
14source_set("ffa") {
15  public_configs = [
16    "//test/vmapi/primary_with_secondaries:config",
17    "//src/arch/aarch64:config",
18    "//test/hftest:hftest_config",
19  ]
20  sources = [
21    "//test/vmapi/primary_with_secondaries/ffa.c",
22  ]
23}
24
25source_set("memory_sharing") {
26  public_configs = [
27    "//test/vmapi/primary_with_secondaries:config",
28    "//src/arch/aarch64:config",
29    "//test/hftest:hftest_config",
30  ]
31  sources = [
32    "memory_sharing.c",
33  ]
34}
35
36vm_kernel("el0_partition_test_vm") {
37  testonly = true
38  public_configs = [
39    "//test/vmapi/primary_with_secondaries:config",
40    "//src/arch/aarch64:config",
41  ]
42
43  sources = [
44    "//test/vmapi/primary_with_secondaries/mailbox_common.c",
45    "boot.c",
46    "interrupts.c",
47  ]
48
49  deps = [
50    ":ffa",
51    ":memory_sharing",
52    "//src/arch/aarch64/hftest:registers",
53    "//test/hftest:hftest_primary_vm",
54    "//test/vmapi/common",
55    "//vmlib",
56  ]
57}
58
59manifest("el0_partition_test_manifest") {
60  source = "manifest.dts"
61  output = "manifest.dtb"
62  overlay = hftest_manifest_overlay
63}
64
65device_tree("secondary_dtb") {
66  source = "secondary.dts"
67  output = "$target_out_dir/secondary.dtb"
68}
69
70initrd("el0_partitions_test") {
71  testonly = true
72
73  files = [
74    [
75      "manifest.dtb",
76      ":el0_partition_test_manifest",
77      "manifest.dtb",
78    ],
79    [
80      "el0_partition_test",
81      ":el0_partition_test_vm",
82      "el0_partition_test_vm.bin",
83    ],
84    [
85      "services1",
86      "services:service_vm1",
87      "service_vm1.bin",
88    ],
89    [
90      "services2",
91      "services:service_vm2",
92      "service_vm2.bin",
93    ],
94    [
95      "services3",
96      "services:service_vm3",
97      "service_vm3.bin",
98    ],
99    [
100      "secondary.dtb",
101      ":secondary_dtb",
102      "secondary.dtb",
103    ],
104  ]
105}
106