blob: 5f352e7efffd991806086b5aa93b8420031ee148 [file] [log] [blame]
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +02001# SPDX-License-Identifier: GPL-2.0
2# Copyright (c) 2019, Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
3#
4# Work based on:
5# - test_net.py
6# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
7# - test_fit.py
8# Copyright (c) 2013, Google Inc.
9#
10# Test launching UEFI binaries from FIT images.
11
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +020012"""
13Note: This test relies on boardenv_* containing configuration values to define
14which network environment is available for testing. Without this, the parts
15that rely on network will be automatically skipped.
16
17For example:
18
19# Boolean indicating whether the Ethernet device is attached to USB, and hence
20# USB enumeration needs to be performed prior to network tests.
21# This variable may be omitted if its value is False.
22env__net_uses_usb = False
23
24# Boolean indicating whether the Ethernet device is attached to PCI, and hence
25# PCI enumeration needs to be performed prior to network tests.
26# This variable may be omitted if its value is False.
27env__net_uses_pci = True
28
29# True if a DHCP server is attached to the network, and should be tested.
30# If DHCP testing is not possible or desired, this variable may be omitted or
31# set to False.
32env__net_dhcp_server = True
33
34# A list of environment variables that should be set in order to configure a
35# static IP. If solely relying on DHCP, this variable may be omitted or set to
36# an empty list.
37env__net_static_env_vars = [
38 ('ipaddr', '10.0.0.100'),
39 ('netmask', '255.255.255.0'),
40 ('serverip', '10.0.0.1'),
41]
42
43# Details regarding a file that may be read from a TFTP server. This variable
44# may be omitted or set to None if TFTP testing is not possible or desired.
45# Additionally, when the 'size' is not available, the file will be generated
46# automatically in the TFTP root directory, as specified by the 'dn' field.
47env__efi_fit_tftp_file = {
48 'fn': 'test-efi-fit.img', # File path relative to TFTP root
49 'size': 3831, # File size
50 'crc32': '9fa3f79c', # Checksum using CRC-32 algorithm, optional
51 'addr': 0x40400000, # Loading address, integer, optional
52 'dn': 'tftp/root/dir', # TFTP root directory path, optional
53}
54"""
55
Heinrich Schuchardta944dbb2020-01-25 21:41:29 +010056import os.path
57import pytest
Simon Glassdb0e4532025-02-09 09:07:16 -070058import utils
Heinrich Schuchardta944dbb2020-01-25 21:41:29 +010059
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +020060# Define the parametrized ITS data to be used for FIT images generation.
Heinrich Schuchardta944dbb2020-01-25 21:41:29 +010061ITS_DATA = '''
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +020062/dts-v1/;
63
64/ {
65 description = "EFI image with FDT blob";
66 #address-cells = <1>;
67
68 images {
69 efi {
70 description = "Test EFI";
71 data = /incbin/("%(efi-bin)s");
72 type = "%(kernel-type)s";
73 arch = "%(sys-arch)s";
74 os = "efi";
75 compression = "%(efi-comp)s";
76 load = <0x0>;
77 entry = <0x0>;
78 };
79 fdt {
80 description = "Test FDT";
81 data = /incbin/("%(fdt-bin)s");
82 type = "flat_dt";
83 arch = "%(sys-arch)s";
84 compression = "%(fdt-comp)s";
85 };
86 };
87
88 configurations {
89 default = "config-efi-fdt";
90 config-efi-fdt {
91 description = "EFI FIT w/ FDT";
92 kernel = "efi";
93 fdt = "fdt";
94 };
95 config-efi-nofdt {
96 description = "EFI FIT w/o FDT";
97 kernel = "efi";
98 };
99 };
100};
101'''
102
103# Define the parametrized FDT data to be used for DTB images generation.
Heinrich Schuchardta944dbb2020-01-25 21:41:29 +0100104FDT_DATA = '''
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200105/dts-v1/;
106
107/ {
108 #address-cells = <1>;
Bin Meng524961a2020-06-27 18:03:17 -0700109 #size-cells = <1>;
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200110
111 model = "%(sys-arch)s %(fdt_type)s EFI FIT Boot Test";
112 compatible = "%(sys-arch)s";
113
114 reset@0 {
115 compatible = "%(sys-arch)s,reset";
Bin Meng524961a2020-06-27 18:03:17 -0700116 reg = <0 4>;
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200117 };
118};
119'''
120
121@pytest.mark.buildconfigspec('bootm_efi')
Simon Glassb343ee32024-09-26 23:59:31 +0200122@pytest.mark.buildconfigspec('BOOTEFI_HELLO_COMPILE')
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200123@pytest.mark.buildconfigspec('fit')
124@pytest.mark.notbuildconfigspec('generate_acpi_table')
125@pytest.mark.requiredtool('dtc')
Simon Glassddba5202025-02-09 09:07:14 -0700126def test_efi_fit_launch(ubman):
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200127 """Test handling of UEFI binaries inside FIT images.
128
129 The tests are trying to launch U-Boot's helloworld.efi embedded into
130 FIT images, in uncompressed or gzip compressed format.
131
132 Additionally, a sample FDT blob is created and embedded into the above
133 mentioned FIT images, in uncompressed or gzip compressed format.
134
135 For more details, see launch_efi().
136
137 The following test cases are currently defined and enabled:
138 - Launch uncompressed FIT EFI & internal FDT
139 - Launch uncompressed FIT EFI & FIT FDT
140 - Launch compressed FIT EFI & internal FDT
141 - Launch compressed FIT EFI & FIT FDT
142 """
143
144 def net_pre_commands():
145 """Execute any commands required to enable network hardware.
146
147 These commands are provided by the boardenv_* file; see the comment
148 at the beginning of this file.
149 """
150
Simon Glass32701112025-02-09 09:07:17 -0700151 init_usb = ubman.config.env.get('env__net_uses_usb', False)
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200152 if init_usb:
Simon Glass32701112025-02-09 09:07:17 -0700153 ubman.run_command('usb start')
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200154
Simon Glass32701112025-02-09 09:07:17 -0700155 init_pci = ubman.config.env.get('env__net_uses_pci', False)
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200156 if init_pci:
Simon Glass32701112025-02-09 09:07:17 -0700157 ubman.run_command('pci enum')
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200158
159 def net_dhcp():
160 """Execute the dhcp command.
161
162 The boardenv_* file may be used to enable/disable DHCP; see the
163 comment at the beginning of this file.
164 """
165
Simon Glass32701112025-02-09 09:07:17 -0700166 has_dhcp = ubman.config.buildconfig.get('config_cmd_dhcp', 'n') == 'y'
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200167 if not has_dhcp:
Simon Glass32701112025-02-09 09:07:17 -0700168 ubman.log.warning('CONFIG_CMD_DHCP != y: Skipping DHCP network setup')
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200169 return False
170
Simon Glass32701112025-02-09 09:07:17 -0700171 test_dhcp = ubman.config.env.get('env__net_dhcp_server', False)
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200172 if not test_dhcp:
Simon Glass32701112025-02-09 09:07:17 -0700173 ubman.log.info('No DHCP server available')
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200174 return False
175
Simon Glass32701112025-02-09 09:07:17 -0700176 ubman.run_command('setenv autoload no')
177 output = ubman.run_command('dhcp')
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200178 assert 'DHCP client bound to address ' in output
179 return True
180
181 def net_setup_static():
182 """Set up a static IP configuration.
183
184 The configuration is provided by the boardenv_* file; see the comment at
185 the beginning of this file.
186 """
187
Simon Glass32701112025-02-09 09:07:17 -0700188 has_dhcp = ubman.config.buildconfig.get('config_cmd_dhcp', 'n') == 'y'
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200189 if not has_dhcp:
Simon Glass32701112025-02-09 09:07:17 -0700190 ubman.log.warning('CONFIG_NET != y: Skipping static network setup')
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200191 return False
192
Simon Glass32701112025-02-09 09:07:17 -0700193 env_vars = ubman.config.env.get('env__net_static_env_vars', None)
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200194 if not env_vars:
Simon Glass32701112025-02-09 09:07:17 -0700195 ubman.log.info('No static network configuration is defined')
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200196 return False
197
198 for (var, val) in env_vars:
Simon Glass32701112025-02-09 09:07:17 -0700199 ubman.run_command('setenv %s %s' % (var, val))
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200200 return True
201
Heinrich Schuchardta944dbb2020-01-25 21:41:29 +0100202 def make_fpath(file_name):
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200203 """Compute the path of a given (temporary) file.
204
205 Args:
Heinrich Schuchardt14e3b5b2022-03-27 10:20:24 +0200206 file_name -- The name of a file within U-Boot build dir.
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200207 Return:
208 The computed file path.
209 """
210
Simon Glass32701112025-02-09 09:07:17 -0700211 return os.path.join(ubman.config.build_dir, file_name)
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200212
213 def make_efi(fname, comp):
214 """Create an UEFI binary.
215
216 This simply copies lib/efi_loader/helloworld.efi into U-Boot
217 build dir and, optionally, compresses the file using gzip.
218
219 Args:
Heinrich Schuchardt14e3b5b2022-03-27 10:20:24 +0200220 fname -- The target file name within U-Boot build dir.
221 comp -- Flag to enable gzip compression.
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200222 Return:
223 The path of the created file.
224 """
225
226 bin_path = make_fpath(fname)
Simon Glass32701112025-02-09 09:07:17 -0700227 utils.run_and_log(ubman,
Simon Glassdb0e4532025-02-09 09:07:16 -0700228 ['cp', make_fpath('lib/efi_loader/helloworld.efi'),
229 bin_path])
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200230 if comp:
Simon Glass32701112025-02-09 09:07:17 -0700231 utils.run_and_log(ubman, ['gzip', '-f', bin_path])
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200232 bin_path += '.gz'
233 return bin_path
234
235 def make_dtb(fdt_type, comp):
236 """Create a sample DTB file.
237
238 Creates a DTS file and compiles it to a DTB.
239
240 Args:
Heinrich Schuchardt14e3b5b2022-03-27 10:20:24 +0200241 fdt_type -- The type of the FDT, i.e. internal, user.
242 comp -- Flag to enable gzip compression.
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200243 Return:
244 The path of the created file.
245 """
246
247 # Generate resources referenced by FDT.
248 fdt_params = {
249 'sys-arch': sys_arch,
250 'fdt_type': fdt_type,
251 }
252
253 # Generate a test FDT file.
254 dts = make_fpath('test-efi-fit-%s.dts' % fdt_type)
Heinrich Schuchardt14e3b5b2022-03-27 10:20:24 +0200255 with open(dts, 'w', encoding='ascii') as file:
Heinrich Schuchardta944dbb2020-01-25 21:41:29 +0100256 file.write(FDT_DATA % fdt_params)
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200257
258 # Build the test FDT.
259 dtb = make_fpath('test-efi-fit-%s.dtb' % fdt_type)
Simon Glass32701112025-02-09 09:07:17 -0700260 utils.run_and_log(ubman,
Simon Glassdb0e4532025-02-09 09:07:16 -0700261 ['dtc', '-I', 'dts', '-O', 'dtb', '-o', dtb, dts])
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200262 if comp:
Simon Glass32701112025-02-09 09:07:17 -0700263 utils.run_and_log(ubman, ['gzip', '-f', dtb])
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200264 dtb += '.gz'
265 return dtb
266
267 def make_fit(comp):
268 """Create a sample FIT image.
269
270 Runs 'mkimage' to create a FIT image within U-Boot build dir.
271 Args:
Heinrich Schuchardt14e3b5b2022-03-27 10:20:24 +0200272 comp -- Enable gzip compression for the EFI binary and FDT blob.
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200273 Return:
274 The path of the created file.
275 """
276
277 # Generate resources referenced by ITS.
278 its_params = {
279 'sys-arch': sys_arch,
280 'efi-bin': os.path.basename(make_efi('test-efi-fit-helloworld.efi', comp)),
281 'kernel-type': 'kernel' if comp else 'kernel_noload',
282 'efi-comp': 'gzip' if comp else 'none',
283 'fdt-bin': os.path.basename(make_dtb('user', comp)),
284 'fdt-comp': 'gzip' if comp else 'none',
285 }
286
287 # Generate a test ITS file.
288 its_path = make_fpath('test-efi-fit-helloworld.its')
Heinrich Schuchardt14e3b5b2022-03-27 10:20:24 +0200289 with open(its_path, 'w', encoding='ascii') as file:
Heinrich Schuchardta944dbb2020-01-25 21:41:29 +0100290 file.write(ITS_DATA % its_params)
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200291
292 # Build the test ITS.
293 fit_path = make_fpath('test-efi-fit-helloworld.fit')
Simon Glassdb0e4532025-02-09 09:07:16 -0700294 utils.run_and_log(
Simon Glass32701112025-02-09 09:07:17 -0700295 ubman, [make_fpath('tools/mkimage'), '-f', its_path, fit_path])
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200296 return fit_path
297
Heinrich Schuchardta944dbb2020-01-25 21:41:29 +0100298 def load_fit_from_host(fit):
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200299 """Load the FIT image using the 'host load' command and return its address.
300
301 Args:
Heinrich Schuchardt14e3b5b2022-03-27 10:20:24 +0200302 fit -- Dictionary describing the FIT image to load, see
303 env__efi_fit_test_file in the comment at the beginning of
304 this file.
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200305 Return:
306 The address where the file has been loaded.
307 """
308
Heinrich Schuchardta944dbb2020-01-25 21:41:29 +0100309 addr = fit.get('addr', None)
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200310 if not addr:
Simon Glass32701112025-02-09 09:07:17 -0700311 addr = utils.find_ram_base(ubman)
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200312
Simon Glass32701112025-02-09 09:07:17 -0700313 output = ubman.run_command(
Heinrich Schuchardta944dbb2020-01-25 21:41:29 +0100314 'host load hostfs - %x %s/%s' % (addr, fit['dn'], fit['fn']))
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200315 expected_text = ' bytes read'
Heinrich Schuchardta944dbb2020-01-25 21:41:29 +0100316 size = fit.get('size', None)
317 if size:
318 expected_text = '%d' % size + expected_text
319 assert expected_text in output
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200320
321 return addr
322
Heinrich Schuchardta944dbb2020-01-25 21:41:29 +0100323 def load_fit_from_tftp(fit):
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200324 """Load the FIT image using the tftpboot command and return its address.
325
326 The file is downloaded from the TFTP server, its size and optionally its
327 CRC32 are validated.
328
329 Args:
Heinrich Schuchardt14e3b5b2022-03-27 10:20:24 +0200330 fit -- Dictionary describing the FIT image to load, see env__efi_fit_tftp_file
331 in the comment at the beginning of this file.
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200332 Return:
333 The address where the file has been loaded.
334 """
335
Heinrich Schuchardta944dbb2020-01-25 21:41:29 +0100336 addr = fit.get('addr', None)
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200337 if not addr:
Simon Glass32701112025-02-09 09:07:17 -0700338 addr = utils.find_ram_base(ubman)
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200339
Heinrich Schuchardta944dbb2020-01-25 21:41:29 +0100340 file_name = fit['fn']
Simon Glass32701112025-02-09 09:07:17 -0700341 output = ubman.run_command('tftpboot %x %s' % (addr, file_name))
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200342 expected_text = 'Bytes transferred = '
Heinrich Schuchardta944dbb2020-01-25 21:41:29 +0100343 size = fit.get('size', None)
344 if size:
345 expected_text += '%d' % size
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200346 assert expected_text in output
347
Heinrich Schuchardta944dbb2020-01-25 21:41:29 +0100348 expected_crc = fit.get('crc32', None)
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200349 if not expected_crc:
350 return addr
351
Simon Glass32701112025-02-09 09:07:17 -0700352 if ubman.config.buildconfig.get('config_cmd_crc32', 'n') != 'y':
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200353 return addr
354
Simon Glass32701112025-02-09 09:07:17 -0700355 output = ubman.run_command('crc32 $fileaddr $filesize')
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200356 assert expected_crc in output
357
358 return addr
359
360 def launch_efi(enable_fdt, enable_comp):
361 """Launch U-Boot's helloworld.efi binary from a FIT image.
362
363 An external image file can be downloaded from TFTP, when related
364 details are provided by the boardenv_* file; see the comment at the
365 beginning of this file.
366
367 If the size of the TFTP file is not provided within env__efi_fit_tftp_file,
368 the test image is generated automatically and placed in the TFTP root
369 directory specified via the 'dn' field.
370
371 When running the tests on Sandbox, the image file is loaded directly
372 from the host filesystem.
373
374 Once the load address is available on U-Boot console, the 'bootm'
375 command is executed for either 'config-efi-fdt' or 'config-efi-nofdt'
376 FIT configuration, depending on the value of the 'enable_fdt' function
377 argument.
378
379 Eventually the 'Hello, world' message is expected in the U-Boot console.
380
381 Args:
Heinrich Schuchardt14e3b5b2022-03-27 10:20:24 +0200382 enable_fdt -- Flag to enable using the FDT blob inside FIT image.
383 enable_comp -- Flag to enable GZIP compression on EFI and FDT
384 generated content.
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200385 """
386
Simon Glass32701112025-02-09 09:07:17 -0700387 with ubman.log.section('FDT=%s;COMP=%s' % (enable_fdt, enable_comp)):
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200388 if is_sandbox:
389 fit = {
Simon Glass32701112025-02-09 09:07:17 -0700390 'dn': ubman.config.build_dir,
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200391 }
392 else:
393 # Init networking.
394 net_pre_commands()
395 net_set_up = net_dhcp()
396 net_set_up = net_setup_static() or net_set_up
397 if not net_set_up:
398 pytest.skip('Network not initialized')
399
Simon Glass32701112025-02-09 09:07:17 -0700400 fit = ubman.config.env.get('env__efi_fit_tftp_file', None)
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200401 if not fit:
402 pytest.skip('No env__efi_fit_tftp_file binary specified in environment')
403
Heinrich Schuchardta944dbb2020-01-25 21:41:29 +0100404 size = fit.get('size', None)
405 if not size:
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200406 if not fit.get('dn', None):
407 pytest.skip('Neither "size", nor "dn" info provided in env__efi_fit_tftp_file')
408
409 # Create test FIT image.
410 fit_path = make_fit(enable_comp)
411 fit['fn'] = os.path.basename(fit_path)
412 fit['size'] = os.path.getsize(fit_path)
413
414 # Copy image to TFTP root directory.
Simon Glass32701112025-02-09 09:07:17 -0700415 if fit['dn'] != ubman.config.build_dir:
416 utils.run_and_log(ubman,
Simon Glassdb0e4532025-02-09 09:07:16 -0700417 ['mv', '-f', fit_path, '%s/' % fit['dn']])
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200418
419 # Load FIT image.
420 addr = load_fit_from_host(fit) if is_sandbox else load_fit_from_tftp(fit)
421
422 # Select boot configuration.
423 fit_config = 'config-efi-fdt' if enable_fdt else 'config-efi-nofdt'
424
425 # Try booting.
Simon Glass32701112025-02-09 09:07:17 -0700426 output = ubman.run_command('bootm %x#%s' % (addr, fit_config))
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200427 if enable_fdt:
Heinrich Schuchardtbb38a1f2020-07-17 20:21:00 +0200428 assert 'Booting using the fdt blob' in output
429 assert 'Hello, world' in output
430 assert '## Application failed' not in output
Simon Glass32701112025-02-09 09:07:17 -0700431 ubman.restart_uboot()
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200432
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200433 # Array slice removes leading/trailing quotes.
Simon Glass32701112025-02-09 09:07:17 -0700434 sys_arch = ubman.config.buildconfig.get('config_sys_arch', '"sandbox"')[1:-1]
Heinrich Schuchardteda45902023-06-15 13:40:05 +0200435 if sys_arch == 'arm':
Simon Glass32701112025-02-09 09:07:17 -0700436 arm64 = ubman.config.buildconfig.get('config_arm64')
Heinrich Schuchardteda45902023-06-15 13:40:05 +0200437 if arm64:
438 sys_arch = 'arm64'
439
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200440 is_sandbox = sys_arch == 'sandbox'
441
Heinrich Schuchardt45b48322023-04-20 19:49:47 +0200442 if is_sandbox:
Simon Glass32701112025-02-09 09:07:17 -0700443 old_dtb = ubman.config.dtb
Heinrich Schuchardt45b48322023-04-20 19:49:47 +0200444
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200445 try:
446 if is_sandbox:
447 # Use our own device tree file, will be restored afterwards.
448 control_dtb = make_dtb('internal', False)
Simon Glass32701112025-02-09 09:07:17 -0700449 ubman.config.dtb = control_dtb
Cristian Ciocaltea1cdae972019-12-30 03:34:27 +0200450
451 # Run tests
452 # - fdt OFF, gzip OFF
453 launch_efi(False, False)
454 # - fdt ON, gzip OFF
455 launch_efi(True, False)
456
457 if is_sandbox:
458 # - fdt OFF, gzip ON
459 launch_efi(False, True)
460 # - fdt ON, gzip ON
461 launch_efi(True, True)
462
463 finally:
464 if is_sandbox:
465 # Go back to the original U-Boot with the correct dtb.
Simon Glass32701112025-02-09 09:07:17 -0700466 ubman.config.dtb = old_dtb
467 ubman.restart_uboot()