xref: /qemu/tests/functional/test_aarch64_raspi3.py (revision 513823e7521a09ed7ad1e32e6454bac3b2cbf52d)
1#!/usr/bin/env python3
2#
3# Functional test that boots a Linux kernel on a Raspberry Pi machine
4# and checks the console
5#
6# Copyright (c) 2020 Philippe Mathieu-Daudé <f4bug@amsat.org>
7#
8# SPDX-License-Identifier: GPL-2.0-or-later
9
10from qemu_test import LinuxKernelTest, Asset
11
12
13class Aarch64Raspi3Machine(LinuxKernelTest):
14
15    ASSET_RPI3_UEFI = Asset(
16        ('https://github.com/pbatard/RPi3/releases/download/'
17         'v1.15/RPi3_UEFI_Firmware_v1.15.zip'),
18        '8cff2e979560048b4c84921f41a91893240b9fb71a88f0b5c5d6c8edd994bd5b')
19
20    def test_aarch64_raspi3_atf(self):
21        efi_name = 'RPI_EFI.fd'
22        efi_fd = self.archive_extract(self.ASSET_RPI3_UEFI, member=efi_name)
23
24        self.set_machine('raspi3b')
25        self.vm.set_console(console_index=1)
26        self.vm.add_args('-cpu', 'cortex-a53',
27                         '-nodefaults',
28                         '-device', f'loader,file={efi_fd},force-raw=true')
29        self.vm.launch()
30        self.wait_for_console_pattern('version UEFI Firmware v1.15')
31
32
33if __name__ == '__main__':
34    LinuxKernelTest.main()
35