Jiaxun Yang | 8363c87 | 2024-06-18 14:56:10 +0100 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
| 2 | .. Copyright (C) 2024 Jiaxun Yang <jiaxun.yang@flygoat.com> |
| 3 | |
| 4 | QEMU Xtensa |
| 5 | =========== |
| 6 | |
| 7 | QEMU for Xtensa supports a special 'virt' machine designed for emulation and |
| 8 | virtualization purposes. This document describes how to run U-Boot under it. |
| 9 | |
| 10 | The QEMU virt machine models a generic Xtensa virtual machine with PCI Bus |
| 11 | and Xtensa ISS simcall semihosting support. It supports many different Xtensa |
| 12 | CPU configuration. Currently, only dc233c variant is tested against U-Boot. |
| 13 | |
| 14 | Building U-Boot |
| 15 | --------------- |
| 16 | Set the CROSS_COMPILE environment variable as usual, and run: |
| 17 | |
| 18 | make qemu-xtensa-dc233c_defconfig |
| 19 | make |
| 20 | |
| 21 | Note that Xtensa's toolchain is bounded to CPU configuration, you must use |
| 22 | the toolchain built for exactly the same CPU configuration as you selected |
| 23 | in U-Boot. |
| 24 | |
| 25 | Running U-Boot |
| 26 | -------------- |
| 27 | The minimal QEMU command line to get U-Boot up and running is: |
| 28 | |
| 29 | qemu-system-xtensa -nographic -machine virt -cpu dc233c -semihosting -kernel ./u-boot.elf |
| 30 | |
| 31 | You many change cpu option to match your U-Boot CPU type configuration. |
| 32 | semihosting option is mandatory because this is the only way to interact |
| 33 | with U-Boot in command line. |