29 lines · python
1from ..qemu_config import QemuArchParams2import os3import os.path4import sys5 6OPENSBI_FILE = 'opensbi-riscv64-generic-fw_dynamic.bin'7OPENSBI_PATH = '/usr/share/qemu/' + OPENSBI_FILE8 9if 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 14QEMU_ARCH = QemuArchParams(linux_arch='riscv',15 kconfig='''16CONFIG_ARCH_VIRT=y17CONFIG_SERIAL_8250=y18CONFIG_SERIAL_8250_CONSOLE=y19CONFIG_SERIAL_OF_PLATFORM=y20CONFIG_RISCV_SBI_V01=y21CONFIG_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])29