Heinrich Schuchardt | 8505c0b | 2023-07-24 12:04:18 +0200 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
| 2 | |
| 3 | Emulation of block devices |
| 4 | -------------------------- |
| 5 | |
| 6 | QEMU can emulate common block devices by adding the following parameters to |
| 7 | the qemu-system-<arch> command line: |
| 8 | |
| 9 | * MMC |
| 10 | |
| 11 | .. code-block:: bash |
| 12 | |
| 13 | -device sdhci-pci,sd-spec-version=3 \ |
Heinrich Schuchardt | ba187bd | 2023-07-30 19:39:00 +0200 | [diff] [blame] | 14 | -drive if=none,file=disk.img,format=raw,id=MMC1 \ |
| 15 | -device sd-card,drive=MMC1 |
Heinrich Schuchardt | 8505c0b | 2023-07-24 12:04:18 +0200 | [diff] [blame] | 16 | |
| 17 | * NVMe |
| 18 | |
| 19 | .. code-block:: bash |
| 20 | |
| 21 | -drive if=none,file=disk.img,format=raw,id=NVME1 \ |
| 22 | -device nvme,drive=NVME1,serial=nvme-1 |
| 23 | |
| 24 | * SATA |
| 25 | |
| 26 | .. code-block:: bash |
| 27 | |
| 28 | -device ahci,id=ahci0 \ |
| 29 | -drive if=none,file=disk.img,format=raw,id=SATA1 \ |
| 30 | -device ide-hd,bus=ahci0.0,drive=SATA1 |
| 31 | |
| 32 | * USB |
| 33 | |
| 34 | .. code-block:: bash |
| 35 | |
| 36 | -device qemu-xhci \ |
| 37 | -drive if=none,file=disk.img,format=raw,id=USB1 \ |
| 38 | -device usb-storage,drive=USB1 |
Heinrich Schuchardt | ba187bd | 2023-07-30 19:39:00 +0200 | [diff] [blame] | 39 | |
| 40 | * Virtio |
| 41 | |
| 42 | .. code-block:: bash |
| 43 | |
| 44 | -drive if=none,file=disk.img,format=raw,id=VIRTIO1 \ |
| 45 | -device virtio-blk,drive=VIRTIO1 |
| 46 | |
| 47 | .. note:: |
| 48 | As of v2023.07 U-Boot does not have a driver for virtio-scsi-pci. |