1# Copyright 2018 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
14# Tests with secondary VMs.
15vm_kernel("primary_with_secondaries_no_fdt_vm") {
16  testonly = true
17  public_configs = [
18    ":config",
19    "//src/arch/aarch64:config",
20  ]
21
22  sources = [
23    "no_fdt.c",
24  ]
25
26  deps = [
27    "//src/arch/aarch64/hftest:registers",
28    "//test/hftest:hftest_primary_vm",
29    "//test/vmapi/common",
30    "//vmlib",
31  ]
32}
33
34vm_kernel("secondary_vm_no_fdt") {
35  testonly = true
36
37  sources = [
38    "no_fdt_secondary.c",
39  ]
40
41  deps = [
42    "//test/hftest:hftest_secondary_vm_no_fdt",
43  ]
44}
45
46manifest("primary_with_secondaries_no_fdt_manifest") {
47  source = "manifest_no_fdt.dts"
48  output = "manifest_no_fdt.dtb"
49  overlay = hftest_manifest_overlay
50}
51
52initrd("primary_with_secondaries_no_fdt") {
53  testonly = true
54
55  files = [
56    [
57      "manifest.dtb",
58      ":primary_with_secondaries_no_fdt_manifest",
59      "manifest_no_fdt.dtb",
60    ],
61    [
62      "primary_with_secondaries_no_fdt",
63      ":primary_with_secondaries_no_fdt_vm",
64      "primary_with_secondaries_no_fdt_vm.bin",
65    ],
66    [
67      "secondary_vm_no_fdt",
68      ":secondary_vm_no_fdt",
69      "secondary_vm_no_fdt.bin",
70    ],
71  ]
72}
73
74vm_kernel("primary_with_secondaries_test_vm") {
75  testonly = true
76  public_configs = [
77    ":config",
78    "//src/arch/aarch64:config",
79  ]
80
81  sources = [
82    "boot.c",
83    "debug_el1.c",
84    "ffa.c",
85    "floating_point.c",
86    "indirect_messaging.c",
87    "interrupts.c",
88    "mailbox_common.c",
89    "memory_sharing.c",
90    "no_services.c",
91    "perfmon.c",
92    "run_race.c",
93    "smp.c",
94    "sysregs.c",
95    "unmapped.c",
96  ]
97
98  deps = [
99    "//src/arch/aarch64/hftest:registers",
100    "//test/hftest:hftest_primary_vm",
101    "//test/vmapi/common",
102    "//vmlib",
103  ]
104}
105
106manifest("primary_with_secondaries_test_manifest") {
107  source = "manifest.dts"
108  output = "manifest.dtb"
109  overlay = hftest_manifest_overlay
110}
111
112device_tree("service1_dtb") {
113  source = "service1.dts"
114  output = "$target_out_dir/service1.dtb"
115}
116
117device_tree("service2_dtb") {
118  source = "service2.dts"
119  output = "$target_out_dir/service2.dtb"
120}
121
122device_tree("service3_dtb") {
123  source = "service3.dts"
124  output = "$target_out_dir/service3.dtb"
125}
126
127initrd("primary_with_secondaries_test") {
128  testonly = true
129
130  files = [
131    [
132      "manifest.dtb",
133      ":primary_with_secondaries_test_manifest",
134      "manifest.dtb",
135    ],
136    [
137      "primary_with_secondaries_test",
138      ":primary_with_secondaries_test_vm",
139      "primary_with_secondaries_test_vm.bin",
140    ],
141    [
142      "services1",
143      "services:service_vm1",
144      "service_vm1.bin",
145    ],
146    [
147      "services2",
148      "services:service_vm2",
149      "service_vm2.bin",
150    ],
151    [
152      "services3",
153      "services:service_vm3",
154      "service_vm3.bin",
155    ],
156    [
157      "service1.dtb",
158      ":service1_dtb",
159      "service1.dtb",
160    ],
161    [
162      "service2.dtb",
163      ":service2_dtb",
164      "service2.dtb",
165    ],
166    [
167      "service3.dtb",
168      ":service3_dtb",
169      "service3.dtb",
170    ],
171  ]
172}
173