blob: f187ff22a866ca5aa273cf45bb93fa95a0e9701f [file] [log] [blame]
Heinrich Schuchardt8505c0b2023-07-24 12:04:18 +02001.. SPDX-License-Identifier: GPL-2.0+
2
3Emulation of block devices
4--------------------------
5
6QEMU can emulate common block devices by adding the following parameters to
7the qemu-system-<arch> command line:
8
9* MMC
10
11 .. code-block:: bash
12
13 -device sdhci-pci,sd-spec-version=3 \
Heinrich Schuchardtba187bd2023-07-30 19:39:00 +020014 -drive if=none,file=disk.img,format=raw,id=MMC1 \
15 -device sd-card,drive=MMC1
Heinrich Schuchardt8505c0b2023-07-24 12:04:18 +020016
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 Schuchardtba187bd2023-07-30 19:39:00 +020039
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.