GNU Linux-libre 6.8.9-gnu
[releases.git] / tools / testing / kunit / qemu_configs / riscv.py
1 from ..qemu_config import QemuArchParams
2 import os
3 import os.path
4 import sys
5
6 OPENSBI_FILE = 'opensbi-riscv64-generic-fw_dynamic.bin'
7 OPENSBI_PATH = '/usr/share/qemu/' + OPENSBI_FILE
8
9 if not os.path.isfile(OPENSBI_PATH):
10         print('\n\nOpenSBI bios was not found in "' + OPENSBI_PATH + '".\n'
11               'Please ensure that qemu-system-riscv is installed, or edit the path in "qemu_configs/riscv.py"\n')
12         sys.exit()
13
14 QEMU_ARCH = QemuArchParams(linux_arch='riscv',
15                            kconfig='''
16 CONFIG_SOC_VIRT=y
17 CONFIG_SERIAL_8250=y
18 CONFIG_SERIAL_8250_CONSOLE=y
19 CONFIG_SERIAL_OF_PLATFORM=y
20 CONFIG_RISCV_SBI_V01=y
21 CONFIG_SERIAL_EARLYCON_RISCV_SBI=y''',
22                            qemu_arch='riscv64',
23                            kernel_path='arch/riscv/boot/Image',
24                            kernel_command_line='console=ttyS0',
25                            extra_qemu_params=[
26                                            '-machine', 'virt',
27                                            '-cpu', 'rv64',
28                                            '-bios', OPENSBI_PATH])